[PATCH 3/3] test/py: rewrite sqfsls command test suite

2021-05-23 Thread Joao Marcos Costa
Add more details to test cases by comparing each expected line with the
command's output. Add new test cases:
- sqfsls at an empty directory
- sqfsls at a sub-directory

Signed-off-by: Joao Marcos Costa 
---
 .../test_fs/test_squashfs/test_sqfs_ls.py | 80 ++-
 1 file changed, 62 insertions(+), 18 deletions(-)

diff --git a/test/py/tests/test_fs/test_squashfs/test_sqfs_ls.py 
b/test/py/tests/test_fs/test_squashfs/test_sqfs_ls.py
index a0dca2e2fc..2895aefc3b 100644
--- a/test/py/tests/test_fs/test_squashfs/test_sqfs_ls.py
+++ b/test/py/tests/test_fs/test_squashfs/test_sqfs_ls.py
@@ -6,6 +6,52 @@ import os
 import pytest
 from sqfs_common import *
 
+def sqfs_ls_at_root(u_boot_console):
+# first and most basic test is to check if these two give the same output
+no_slash = u_boot_console.run_command('sqfsls host 0')
+slash = u_boot_console.run_command('sqfsls host 0 /')
+assert no_slash == slash
+
+expected_lines = ['empty-dir/', '1000   f1000', '4096   f4096', '5096   
f5096',
+'subdir/', '   sym', '4 file(s), 2 dir(s)']
+
+output = u_boot_console.run_command('sqfsls host 0')
+for line in expected_lines:
+assert line in output
+
+def sqfs_ls_at_empty_dir(u_boot_console):
+assert u_boot_console.run_command('sqfsls host 0 empty-dir') == 'Empty 
directory.'
+
+def sqfs_ls_at_subdir(u_boot_console):
+expected_lines = ['100   subdir-file', '1 file(s), 0 dir(s)']
+output = u_boot_console.run_command('sqfsls host 0 subdir')
+for line in expected_lines:
+assert line in output
+
+def sqfs_ls_at_symlink(u_boot_console):
+# since sym -> subdir, the following outputs must be equal
+output = u_boot_console.run_command('sqfsls host 0 sym')
+output_subdir= u_boot_console.run_command('sqfsls host 0 subdir')
+assert output == output_subdir
+
+expected_lines = ['100   subdir-file', '1 file(s), 0 dir(s)']
+for line in expected_lines:
+assert line in output
+
+# output should be the same for non-existent directories and files
+def sqfs_ls_at_non_existent_dir(u_boot_console):
+out_non_existent = u_boot_console.run_command('sqfsls host 0 fff')
+out_not_dir = u_boot_console.run_command('sqfsls host 0 f1000')
+assert out_non_existent == out_not_dir
+assert '** Cannot find directory. **' in out_non_existent
+
+def sqfs_run_all_ls_tests(u_boot_console):
+sqfs_ls_at_root(u_boot_console)
+sqfs_ls_at_empty_dir(u_boot_console)
+sqfs_ls_at_subdir(u_boot_console)
+sqfs_ls_at_symlink(u_boot_console)
+sqfs_ls_at_non_existent_dir(u_boot_console)
+
 @pytest.mark.boardspec('sandbox')
 @pytest.mark.buildconfigspec('cmd_fs_generic')
 @pytest.mark.buildconfigspec('cmd_squashfs')
@@ -13,24 +59,22 @@ from sqfs_common import *
 @pytest.mark.requiredtool('mksquashfs')
 def test_sqfs_ls(u_boot_console):
 build_dir = u_boot_console.config.build_dir
-for opt in comp_opts:
-try:
-opt.gen_image(build_dir)
-except RuntimeError:
-opt.clean_source(build_dir)
-# skip unsupported compression types
-continue
-path = os.path.join(build_dir, "sqfs-" + opt.name)
-output = u_boot_console.run_command("host bind 0 " + path)
 
+# setup test environment
+generate_sqfs_src_dir(build_dir)
+make_all_images(build_dir)
+
+# run all tests for each image
+for image in standard_table.keys():
 try:
-# list files in root directory
-output = u_boot_console.run_command("sqfsls host 0")
-assert str(len(opt.files) + 1) + " file(s), 0 dir(s)" in output
-assert "   sym" in output
-output = u_boot_console.run_command("sqfsls host 0 xxx")
-assert "** Cannot find directory. **" in output
+image_path = os.path.join(build_dir, image)
+u_boot_console.run_command('host bind 0 {}'.format(image_path))
+sqfs_run_all_ls_tests(u_boot_console)
 except:
-opt.cleanup(build_dir)
-assert False
-opt.cleanup(build_dir)
+clean_all_images(build_dir)
+clean_sqfs_src_dir(build_dir)
+raise AssertionError
+
+# clean test environment
+clean_all_images(build_dir)
+clean_sqfs_src_dir(build_dir)
-- 
2.25.1



[PATCH 2/3] test/py: rewrite sqfsload command test suite

2021-05-23 Thread Joao Marcos Costa
The previous strategy to know if a file was correctly loaded was to
check for how many bytes were read and compare it against the file's
original size. Since this is not a good solution, replace it by
comparing the checksum of the loaded bytes against the original file's
checksum. Add more test cases: files at a sub-directory and non-existent
file.

Signed-off-by: Joao Marcos Costa 
---
 .../test_fs/test_squashfs/test_sqfs_load.py   | 99 +--
 1 file changed, 69 insertions(+), 30 deletions(-)

diff --git a/test/py/tests/test_fs/test_squashfs/test_sqfs_load.py 
b/test/py/tests/test_fs/test_squashfs/test_sqfs_load.py
index 9e90062384..0b416eb4c3 100644
--- a/test/py/tests/test_fs/test_squashfs/test_sqfs_load.py
+++ b/test/py/tests/test_fs/test_squashfs/test_sqfs_load.py
@@ -1,11 +1,62 @@
 # SPDX-License-Identifier: GPL-2.0
-# Copyright (C) 2020 Bootlin
+# Copyright (C) 2021 Bootlin
 # Author: Joao Marcos Costa 
 
 import os
 import pytest
 from sqfs_common import *
 
+@pytest.mark.requiredtool('md5sum')
+def original_md5sum(path):
+out = subprocess.run(['md5sum ' + path], shell = True, check = True,
+capture_output = True, text = True)
+checksum = out.stdout.split()[0]
+
+return checksum
+
+def uboot_md5sum(u_boot_console, address, count):
+out = u_boot_console.run_command('md5sum {} {}'.format(address, count))
+checksum = out.split()[-1]
+
+return checksum
+
+# loads files and asserts checksums
+def sqfs_load_files(u_boot_console, files, sizes, address):
+build_dir = u_boot_console.config.build_dir
+for (f, size) in zip(files, sizes):
+out = u_boot_console.run_command('sqfsload host 0 {} 
{}'.format(address, f))
+
+# check if the right amount of bytes was read
+assert size in out
+
+# compare original file's checksum against u-boot's
+u_boot_checksum = uboot_md5sum(u_boot_console, address, hex(int(size)))
+original_checksum = original_md5sum(os.path.join(build_dir, 
sqfs_src_dir + '/' + f))
+assert u_boot_checksum == original_checksum
+
+def sqfs_load_files_at_root(u_boot_console):
+files = ['f4096', 'f5096', 'f1000']
+sizes = ['4096', '5096', '1000']
+address = '$kernel_addr_r'
+sqfs_load_files(u_boot_console, files, sizes, address)
+
+def sqfs_load_files_at_subdir(u_boot_console):
+files = ['subdir/subdir-file']
+sizes = ['100']
+address = '$kernel_addr_r'
+sqfs_load_files(u_boot_console, files, sizes, address)
+
+def sqfs_load_non_existent_file(u_boot_console):
+address = '$kernel_addr_r'
+f = 'non-existent'
+out = u_boot_console.run_command('sqfsload host 0 {} {}'.format(address, 
f))
+assert 'Failed to load' in out
+
+def sqfs_run_all_load_tests(u_boot_console):
+sqfs_load_files_at_root(u_boot_console)
+sqfs_load_files_at_subdir(u_boot_console)
+sqfs_load_non_existent_file(u_boot_console)
+
 @pytest.mark.boardspec('sandbox')
 @pytest.mark.buildconfigspec('cmd_fs_generic')
 @pytest.mark.buildconfigspec('cmd_squashfs')
@@ -13,34 +64,22 @@ from sqfs_common import *
 @pytest.mark.requiredtool('mksquashfs')
 def test_sqfs_load(u_boot_console):
 build_dir = u_boot_console.config.build_dir
-command = "sqfsload host 0 $kernel_addr_r "
 
-for opt in comp_opts:
-# generate and load the squashfs image
+# setup test environment
+generate_sqfs_src_dir(build_dir)
+make_all_images(build_dir)
+
+# run all tests for each image
+for image in standard_table.keys():
 try:
-opt.gen_image(build_dir)
-except RuntimeError:
-opt.clean_source(build_dir)
-# skip unsupported compression types
-continue
-
-path = os.path.join(build_dir, "sqfs-" + opt.name)
-output = u_boot_console.run_command("host bind 0 " + path)
-
-output = u_boot_console.run_command(command + "xxx")
-assert "File not found." in output
-
-for (f, s) in zip(opt.files, opt.sizes):
-try:
-output = u_boot_console.run_command(command + f)
-assert str(s) in output
-except:
-assert False
-opt.cleanup(build_dir)
-
-# test symbolic link
-output = u_boot_console.run_command(command + "sym")
-assert str(opt.sizes[0]) in output
-
-# remove generated files
-opt.cleanup(build_dir)
+image_path = os.path.join(build_dir, image)
+u_boot_console.run_command('host bind 0 {}'.format(image_path))
+sqfs_run_all_load_tests(u_boot_console)
+except:
+clean_all_images(build_dir)
+clean_sqfs_src_dir(build_dir)
+raise AssertionError
+
+# clean test environment
+clean_all_images(build_dir)
+clean_sqfs_src_dir(build_dir)
-- 
2.25.1



[PATCH 1/3] test/py: rewrite common tools for SquashFS tests

2021-05-23 Thread Joao Marcos Costa
Remove the previous OOP approach, which was confusing and incomplete.
Add more test cases by making SquashFS images with various options,
concerning file fragmentation and its compression. Add comments to
properly document the code.

Signed-off-by: Joao Marcos Costa 
---
 .../test_fs/test_squashfs/sqfs_common.py  | 198 --
 1 file changed, 133 insertions(+), 65 deletions(-)

diff --git a/test/py/tests/test_fs/test_squashfs/sqfs_common.py 
b/test/py/tests/test_fs/test_squashfs/sqfs_common.py
index c96f92c1d8..81a378a9f9 100644
--- a/test/py/tests/test_fs/test_squashfs/sqfs_common.py
+++ b/test/py/tests/test_fs/test_squashfs/sqfs_common.py
@@ -1,76 +1,144 @@
 # SPDX-License-Identifier: GPL-2.0
-# Copyright (C) 2020 Bootlin
+# Copyright (C) 2021 Bootlin
 # Author: Joao Marcos Costa 
 
 import os
-import random
-import string
+import shutil
 import subprocess
 
-def sqfs_get_random_letters(size):
-letters = []
-for i in range(0, size):
-letters.append(random.choice(string.ascii_letters))
+"""
+standard test images table: Each table item is a key:value pair representing 
the
+output image name and its respective mksquashfs options. This table should be
+modified only when adding support for new compression algorithms.
+The 'default' case takes no options but the input and output names, so it must
+be assigned with an empty string.
+"""
+standard_table = {
+'default' : '',
+'lzo_comp_frag' : '',
+'lzo_frag' : '',
+'lzo_no_frag' : '',
+'zstd_comp_frag' : '',
+'zstd_frag' : '',
+'zstd_no_frag' : '',
+'gzip_comp_frag' : '',
+'gzip_frag' : '',
+'gzip_no_frag' : ''
+}
 
-return ''.join(letters)
+"""
+extra_table: Set this table's keys and values if you want to make squashfs 
images with
+your own customized options.
+"""
+extra_table = {}
 
-def sqfs_generate_file(path, size):
-content = sqfs_get_random_letters(size)
-file = open(path, "w")
+# path to source directory used to make squashfs test images
+sqfs_src_dir = 'sqfs_src_dir'
+
+"""
+Combines fragmentation and compression options into a list of strings.
+opts_list's firts item is an empty string as standard_table's first item is
+the 'default' case.
+"""
+def get_opts_list():
+# supported compression options only
+comp_opts = ['-comp lzo', '-comp zstd', '-comp gzip']
+# file fragmentation options
+frag_opts = ['-always-use-fragments', '-always-use-fragments -noF', 
'-no-fragments']
+
+opts_list = [' ']
+for c in comp_opts:
+for f in frag_opts:
+opts_list.append(' '.join([c, f]))
+
+return opts_list
+
+def init_standard_table():
+opts_list = get_opts_list()
+
+for key, value in zip(standard_table.keys(), opts_list):
+standard_table[key] = value
+
+def generate_file(file_name, file_size):
+# file is filled with file_size * 'x'
+content = ''
+for i in range(file_size):
+content += 'x'
+
+file = open(file_name, 'w')
 file.write(content)
 file.close()
 
-class Compression:
-def __init__(self, name, files, sizes, block_size = 4096):
-self.name = name
-self.files = files
-self.sizes = sizes
-self.mksquashfs_opts = " -b " + str(block_size) + " -comp " + self.name
-
-def add_opt(self, opt):
-self.mksquashfs_opts += " " + opt
-
-def gen_image(self, build_dir):
-src = os.path.join(build_dir, "sqfs_src/")
-os.mkdir(src)
-for (f, s) in zip(self.files, self.sizes):
-sqfs_generate_file(src + f, s)
-
-# the symbolic link always targets the first file
-os.symlink(self.files[0], src + "sym")
-
-sqfs_img = os.path.join(build_dir, "sqfs-" + self.name)
-i_o = src + " " + sqfs_img
-opts = self.mksquashfs_opts
-try:
-subprocess.run(["mksquashfs " + i_o + opts], shell = True, check = 
True)
-except:
-print("mksquashfs error. Compression type: " + self.name)
-raise RuntimeError
-
-def clean_source(self, build_dir):
-src = os.path.join(build_dir, "sqfs_src/")
-for f in self.files:
-os.remove(src + f)
-os.remove(src + "sym")
-os.rmdir(src)
-
-def cleanup(self, build_dir):
-self.clean_source(build_dir)
-sqfs_img = os.path.join(build_dir, "sqfs-" + self.name)
-os.remove(sqfs_img)
-
-files = ["blks_only", "blks_frag", "frag_only"]
-sizes = [4096, 5100, 100]
-gzip = Compression("gzip", files, sizes)
-zstd = Compression("zstd", files, sizes)
-lzo = Compression("lzo", files, sizes)
-
-# use fragment blocks for files larger than block_size
-gzip.add_opt("-always-use-fragments")
-zstd.add_opt("-always-use-fragments")
-
-# avoid fragments if lzo is used
-lzo.add_opt("-no-fragments")
-
-comp_opts = [gzip, zstd, lzo]
+"""
+sqfs_src_dir
+├── empty-dir
+├── f1000
+├── f4096
+├── f5096
+├── subdir
+│   └── subdir-file
+└── 

[PATCH 0/3] test/py: Rewrite SquashFS commands test suite

2021-05-23 Thread Joao Marcos Costa
Hello,

This patch series fixes the following issues:
- poor strategy to check if files were properly loaded
- wrong quoting style for strings
- tests failing at the second run because of a wrong clean-up strategy

Finally, it improves:
- code overall documentation level, with more comments and better
  naming for functions and variables
- code readability by adding more helper functions
- completeness: more test cases were added for both sqfsls and sqfsload
  commands

The sqfsload new test suite may fail when testing images with fragmented
files if the patch I previously sent (fs/squashfs: fix reading of
fragmented files) is not applied, so this patch series depends on it.

Best regards,
Joao

Joao Marcos Costa (3):
  test/py: rewrite common tools for SquashFS tests
  test/py: rewrite sqfsload command test suite
  test/py: rewrite sqfsls command test suite

 .../test_fs/test_squashfs/sqfs_common.py  | 198 --
 .../test_fs/test_squashfs/test_sqfs_load.py   |  99 ++---
 .../test_fs/test_squashfs/test_sqfs_ls.py |  80 +--
 3 files changed, 264 insertions(+), 113 deletions(-)

-- 
2.25.1



[PATCH v5, 1/2] driver: watchdog: reset watchdog in designware_wdt_stop() function

2021-05-23 Thread Meng . Li
From: MengLi 

In uboot command line environment, watchdog is not able to be
stopped with below commands:
SOCFPGA_STRATIX10 # wdt dev watchdog@ffd00200
SOCFPGA_STRATIX10 # wdt stop
Refer to watchdog driver in linux kernel, it is also need to reset
watchdog after disable it so that the disable action takes effect.

Signed-off-by: Meng Li 
Reviewed-by: Stefan Roese 

---
v5:
fix build issue, and verify this patch with latest upstream u-boot.
v4:
Remove the unauthorized signature.
v3:
Add the resets to designware_wdt_priv and initialize it in probe().
v2:
Change "#if CONFIG_IS_ENABLED(DM_RESET)" into
"if (CONFIG_IS_ENABLED(DM_RESET)) {", and define the variable
into if condition sentence.
---
 drivers/watchdog/designware_wdt.c | 19 +++
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/drivers/watchdog/designware_wdt.c 
b/drivers/watchdog/designware_wdt.c
index 9e5487168c..afed81e6c6 100644
--- a/drivers/watchdog/designware_wdt.c
+++ b/drivers/watchdog/designware_wdt.c
@@ -22,6 +22,7 @@
 struct designware_wdt_priv {
void __iomem*base;
unsigned intclk_khz;
+   struct reset_ctl_bulk *resets;
 };
 
 /*
@@ -95,6 +96,18 @@ static int designware_wdt_stop(struct udevice *dev)
designware_wdt_reset(dev);
writel(0, priv->base + DW_WDT_CR);
 
+if (CONFIG_IS_ENABLED(DM_RESET)) {
+   int ret;
+
+   ret = reset_assert_bulk(priv->resets);
+   if (ret)
+   return ret;
+
+   ret = reset_deassert_bulk(priv->resets);
+   if (ret)
+   return ret;
+   }
+
return 0;
 }
 
@@ -143,13 +156,11 @@ static int designware_wdt_probe(struct udevice *dev)
 #endif
 
if (CONFIG_IS_ENABLED(DM_RESET)) {
-   struct reset_ctl_bulk resets;
-
-   ret = reset_get_bulk(dev, );
+   ret = reset_get_bulk(dev, priv->resets);
if (ret)
goto err;
 
-   ret = reset_deassert_bulk();
+   ret = reset_deassert_bulk(priv->resets);
if (ret)
goto err;
}
-- 
2.17.1



[PATCH v5, 2/2] arm: socfpga: socfpga_stratix10: enable wdt command by default

2021-05-23 Thread Meng . Li
From: MengLi 

In latest u-boot code, watchdog feature is implemented, so enable
wdt command by default.

Signed-off-by: Meng Li 

---
v2:
Change the title of this patch
---
 configs/socfpga_stratix10_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/socfpga_stratix10_defconfig 
b/configs/socfpga_stratix10_defconfig
index da8bf986cd..7c6ee3c001 100644
--- a/configs/socfpga_stratix10_defconfig
+++ b/configs/socfpga_stratix10_defconfig
@@ -39,6 +39,7 @@ CONFIG_CMD_CACHE=y
 CONFIG_CMD_EXT4=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
+CONFIG_CMD_WDT=y
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_NET_RANDOM_ETHADDR=y
-- 
2.17.1



Re: [PATCH v4 00/14] arm64: synquacer: Add SynQuacer/DeveloperBox support

2021-05-23 Thread Masami Hiramatsu
Hello Ilias,

2021年5月23日(日) 17:07 Ilias Apalodimas :

>
> Hi Masami,
>
> On Wed, May 19, 2021 at 02:44:21PM +0900, Masami Hiramatsu wrote:
> > Hi,
> >
> > Here is the 4th version of the series (including some fixes for build
> > errors) to add SynQuacer/DeveloperBox 96board EE suport on U-Boot.
> >
> > This series includes not only DeveloperBox support but also some fixes
> > for the issues which I faced while porting U-Boot on the DeveloperBox.
> > First 3 patches are fixes, next 1 patch is a code cleanup for generic
> > gpio for arm. The next 7 patches adding DeveloperBox devices
> > and board support. The last 3 patches are related to the UEFI capsule
> > update (including bugfixes).
> >
> > Previous version is here:
> >
> >  https://lists.denx.de/pipermail/u-boot/2021-May/449305.html
> >
> >
>
> The default debug level is set to 7.  I think it would be better to set it
> to something more reasonable for the final commit.

Yes, it was for the development value. It should be removed from
defconfig at last, because it depends on the builder's choice.

>  Unfortunately I don't
> have time for a more detailed review, but I did manage to run this on my
> Synquacer and managed to run a full linux distro with EFI.
>
> Tested-by: Ilias Apalodimas 

Thanks for testing!

Thank you,

>
> > Changes in v4
> > -
> >
> > I dropped a PCI bugfix because it has been merged. And add I2C driver
> > and enable RTC and EBBR support on the configuration.
> >
> > [06/14]:
> >   - Add Jaehoon's reviewed-by (Thanks!)
> > [09/14]:
> >   - Add a new i2c driver.
> > [10/14]:
> >   - Add i2c0 and RTC node.
> > [11/14]:
> >   - Add I2C and RTC configuration.
> >   - Enable RTC and Date command.
> >   - Remove I2C0 node before booting linux to hide it same as EDK2 does.
> >   - Add some configurations to make it EBBR compliant.
> > [14/14]:
> >   - Add some config options for EBBR.
> >
> >
> > BTW, should I split fixes from this series? (since I didn't expect this took
> > so long...)
> >
> >
> > DeveloperBox
> > 
> >
> > DeveloperBox is a certified 96boards Enterprise Edition board. The 
> > board/SoC has: -
> > * Socionext SC2A11 24-cores ARM Cortex-A53 on tbe Mini-ATX form factor 
> > motherboard
> > * 4 DIMM slots (4GB DDR4-2400 UDIMM shipped by default)
> > * 1 4xPCIe Gen2 slot and 2 1xPCIe Gen2 slots
> >   (1x slots are connected via PCIe bridge chip)
> > * 4 USB-3.0 ports
> > * 2 SATA ports
> > * 1 GbE network port
> > * 1 USB-UART serial port (micro USB)
> > * 64MB SPI NOR Flash
> > * 8GB eMMC Flash Storage
> > * 96boards LS connector
> >
> > The DeveloperBox schematic can be found here: -
> > https://www.96boards.org/documentation/enterprise/developerbox/hardware-docs/mzsc2am_v03_20180115_a.pdf
> >
> > And the other documents can be found here: -
> > https://www.96boards.org/documentation/enterprise/developerbox/
> >
> >
> > Currently, the U-Boot port supports: -
> > * USB
> > * eMMC
> > * SPI-NOR
> > * SATA
> > * GbE
> >
> > The DeveloperBox boots the TF-A and EDK2 as a main bootloader by default.
> > The DeveloperBox U-Boot port will replace the EDK2 and boot from TF-A as
> > BL33, but no need to combine with it.
> >
> >
> > Thank you,
> >
> > ---
> >
> > Jassi Brar (4):
> >   mmc: synquacer: Add SynQuacer F_SDH30 SDHCI driver
> >   spi: synquacer: Add HSSPI SPI controller driver for SynQuacer
> >   net: synquacer: Add netsec driver
> >   i2c: synquacer: SNI Synquacer I2C controller
> >
> > Masami Hiramatsu (10):
> >   ata: ahci-pci: Use scsi_ops to initialize ops
> >   dm: pci: Skip setting VGA bridge bits if parent device is the host bus
> >   efi: Fix to use null handle to create new handle for efi_fmp_raw
> >   gpio: Introduce CONFIG_GPIO_EXTRA_HEADER to cleanup #ifdefs
> >   pci: synquacer: Add SynQuacer ECAM based PCIe driver
> >   ARM: dts: synquacer: Add device trees for DeveloperBox
> >   board: synquacer: Add DeveloperBox 96boards EE support
> >   dfu_mtd: Ignore non-implemented lock device failure
> >   doc: qemu: arm64: Fix the documentation of capsule update
> >   configs: synquacer: Enable EFI capsule update support
> >
> >
> >  arch/arm/Kconfig   |  108 ++
> >  arch/arm/dts/Makefile  |2
> >  arch/arm/dts/synquacer-sc2a11-caches.dtsi  |   73 +
> >  .../dts/synquacer-sc2a11-developerbox-u-boot.dtsi  |   75 +
> >  arch/arm/dts/synquacer-sc2a11-developerbox.dts |   56 +
> >  arch/arm/dts/synquacer-sc2a11.dtsi |  595 ++
> >  arch/arm/include/asm/gpio.h|8
> >  board/socionext/developerbox/Kconfig   |   36 +
> >  board/socionext/developerbox/MAINTAINERS   |   14
> >  board/socionext/developerbox/Makefile  |9
> >  board/socionext/developerbox/developerbox.c|  146 +++
> >  configs/synquacer_developerbox_defconfig   |  131 ++
> >  

Re: [PATCH] sunxi: Bring back SD card as MMC device 0

2021-05-23 Thread Andre Przywara
On Mon, 26 Apr 2021 17:52:51 +0530
Jagan Teki  wrote:

Hi Jagan,

> On Mon, Apr 26, 2021 at 4:57 PM Andre Przywara  wrote:
> >
> > On Sun, 25 Apr 2021 18:03:05 +0530
> > Jagan Teki  wrote:
> >
> > Hi Jagan,
> >
> > thanks for your input!
> >  
> > > On Sun, Apr 25, 2021 at 3:30 PM Andre Przywara  
> > > wrote:  
> > > >
> > > > On Fri, 16 Apr 2021 12:08:09 +0100
> > > > Andre Przywara  wrote:
> > > >
> > > > Hi,
> > > >  
> > > > > Commit 2243d19e5618 ("mmc: mmc-uclass: Use dev_seq() to read aliases
> > > > > node's index") now actually enforces U-Boot's device enumeration 
> > > > > policy,
> > > > > where explicitly named devices come first, then any other non-named
> > > > > devices follow, without filling gaps.
> > > > >
> > > > > For quite a while we have had an "mmc1 = " alias in our
> > > > > sunxi-u-boot.dtsi, which now leads to the problem that the SD card
> > > > > (which was always mmc device 0) now gets to be number 2.
> > > > > I guess this breaks quite some boot scripts, and is confusing at 
> > > > > least.
> > > > >
> > > > > Just add an explicit mmc0 alias in the very same file to fix this and
> > > > > restore the old behaviour.  
> > > >
> > > > Can someone please say if this is the right solution?
> > > > I think the SD card has always been mmc device 0 in U-Boot, so I think
> > > > it's worth keeping that. Just not sure if this is the right way of
> > > > fixing that?  
> > >
> > > Playing with aliases always gets confused and might get a different
> > > behavior, IMHO.  
> >
> > I am not so sure about that, since aliases force a fixed numbering, so
> > it should be less confusing. We have the same problem in the kernel
> > now, and Samuel sent some patches to have aliases in the mainline DTs
> > as well [1].  
> 
> Okay.
> 
> >  
> > > Detect the dev number by U-Boot itself and look at
> > > traverse bootenv by all possible dev numbers in sunxi-common.h, but  
> >
> > OK, I will have a look at how the automatic distro boot behaves with
> > this change. My concern was more the interactive user, who is used to
> > have the SD card at device 0 (I certainly am).
> >  
> > > this has one slide effect that we mark mmc2 as devnum 1 for the sake
> > > of fastboot so if we mark fastboot number for specific board properly
> > > (by static or runtime) then explicit aliases wouldn't required.  
> >
> > Ah, good point, thanks for the heads up. I guess this is the actual
> > reason for the alias in our -u-boot.dtsi? Maybe we find a different way
> > to let fastboot find the eMMC? Then we can drop the extra mmc1 alias,
> > get our numbering back, and can cope with the incoming aliases from the
> > mainline DTs as well?  
> 
> Agreed.

So I had a look at fastboot, and posted an RFC[1] to try and fix this
properly. This seems to somewhat work, but there are more assumptions
in (sunxi) U-Boot about the eMMC being device 1 (boot source,
distro_boot scripts, ...). I agree that we should remove this
assumption, but this requires more work and scrutiny to find all those
cases.

For now the change in numbering breaks right, left, and centre: boot.scr
cannot be found anymore, fastboot cannot find the SD card, custom
scripts stop working.

So I would very much like to merge this patch here, to fix the
currently bad user experience and get a clean v2021.07 release.
We can meanwhile look into a proper solution for this problem, to
become more robust against enumeration changes (for instance due to
aliases).

Thanks,
Andre


[RFC PATCH 3/3] sunxi: Drop sunxi FASTBOOT_FLASH_MMC_DEV defaults

2021-05-23 Thread Andre Przywara
Now that we have a runtime function to decide the default MMC device to
use on Allwinner boards, we don't need the hardcoded Kconfig variable
anymore (we do the same logic at runtime now).

Drop the sunxi defaults, and since there is only one other user left,
use one generic default of 0 now. An "int" type KConfig variable needs a
default anyway, (even when this is never used), otherwise *every* user
has to specify one.

Signed-off-by: Andre Przywara 
---
 drivers/fastboot/Kconfig | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/fastboot/Kconfig b/drivers/fastboot/Kconfig
index 2d1836a80e0..06536e249c4 100644
--- a/drivers/fastboot/Kconfig
+++ b/drivers/fastboot/Kconfig
@@ -98,9 +98,7 @@ endchoice
 config FASTBOOT_FLASH_MMC_DEV
int "Define FASTBOOT MMC FLASH default device"
depends on FASTBOOT_FLASH_MMC
-   default 0 if ARCH_ROCKCHIP
-   default 0 if ARCH_SUNXI && MMC_SUNXI_SLOT_EXTRA = -1
-   default 1 if ARCH_SUNXI && MMC_SUNXI_SLOT_EXTRA != -1
+   default 0
help
  The fastboot "flash" command requires additional information
  regarding the non-volatile storage device. Define this to
-- 
2.17.5



[RFC PATCH 1/3] fastboot: Allow runtime determination of MMC device

2021-05-23 Thread Andre Przywara
At the moment the fastboot code relies on the Kconfig variable
CONFIG_FASTBOOT_FLASH_MMC_DEV to point to the MMC device to use for the
flash command. This value needs to be the *U-Boot device number*, which
recently got more dynamic, and depends on other MMC nodes in the
devicetree, but also on mmc aliases defined. This leads to situations
where it's hard to fix this number at compile time, because a WiFi
device might enumerate before the wanted eMMC device, for instance.

To avoid this fragile situation, allow this value to be determined at
runtime. This decision is probably platform specific, so introduce a
weak function that returns the needed number, and use that everywhere
instead of the Kconfig variable.

For now the default implementation just returns this very Kconfig
variable, but this can be overwritten by platforms later.

No functional change at this point.

Signed-off-by: Andre Przywara 
---
 drivers/fastboot/fb_command.c |  6 +++---
 drivers/fastboot/fb_common.c  |  3 ++-
 drivers/fastboot/fb_mmc.c | 12 
 include/fastboot.h|  7 +++
 4 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/drivers/fastboot/fb_command.c b/drivers/fastboot/fb_command.c
index 3a5db5b08fc..77184901505 100644
--- a/drivers/fastboot/fb_command.c
+++ b/drivers/fastboot/fb_command.c
@@ -452,7 +452,7 @@ static void oem_format(char *cmd_parameter, char *response)
fastboot_fail("partitions not set", response);
} else {
sprintf(cmdbuf, "gpt write mmc %x $partitions",
-   CONFIG_FASTBOOT_FLASH_MMC_DEV);
+   fastboot_get_mmc_device());
if (run_command(cmdbuf, 0))
fastboot_fail("", response);
else
@@ -479,7 +479,7 @@ static void oem_partconf(char *cmd_parameter, char 
*response)
 
/* execute 'mmc partconfg' command with cmd_parameter arguments*/
snprintf(cmdbuf, sizeof(cmdbuf), "mmc partconf %x %s 0",
-CONFIG_FASTBOOT_FLASH_MMC_DEV, cmd_parameter);
+fastboot_get_mmc_device(), cmd_parameter);
printf("Execute: %s\n", cmdbuf);
if (run_command(cmdbuf, 0))
fastboot_fail("Cannot set oem partconf", response);
@@ -506,7 +506,7 @@ static void oem_bootbus(char *cmd_parameter, char *response)
 
/* execute 'mmc bootbus' command with cmd_parameter arguments*/
snprintf(cmdbuf, sizeof(cmdbuf), "mmc bootbus %x %s",
-CONFIG_FASTBOOT_FLASH_MMC_DEV, cmd_parameter);
+fastboot_get_mmc_device(), cmd_parameter);
printf("Execute: %s\n", cmdbuf);
if (run_command(cmdbuf, 0))
fastboot_fail("Cannot set oem bootbus", response);
diff --git a/drivers/fastboot/fb_common.c b/drivers/fastboot/fb_common.c
index cbcc3683c47..a64fefc7d72 100644
--- a/drivers/fastboot/fb_common.c
+++ b/drivers/fastboot/fb_common.c
@@ -101,7 +101,8 @@ int __weak fastboot_set_reboot_flag(enum 
fastboot_reboot_reason reason)
if (reason >= FASTBOOT_REBOOT_REASONS_COUNT)
return -EINVAL;
 
-   return bcb_write_reboot_reason(CONFIG_FASTBOOT_FLASH_MMC_DEV, "misc", 
boot_cmds[reason]);
+   return bcb_write_reboot_reason(fastboot_get_mmc_device(), "misc",
+  boot_cmds[reason]);
 #else
 return -EINVAL;
 #endif
diff --git a/drivers/fastboot/fb_mmc.c b/drivers/fastboot/fb_mmc.c
index 2f3837e5591..c97e88a3bbd 100644
--- a/drivers/fastboot/fb_mmc.c
+++ b/drivers/fastboot/fb_mmc.c
@@ -76,13 +76,18 @@ static int raw_part_get_info_by_name(struct blk_desc 
*dev_desc,
return 0;
 }
 
+int __weak fastboot_get_mmc_device(void)
+{
+   return CONFIG_FASTBOOT_FLASH_MMC_DEV;
+}
+
 static int do_get_part_info(struct blk_desc **dev_desc, const char *name,
struct disk_partition *info)
 {
int ret;
 
/* First try partition names on the default device */
-   *dev_desc = blk_get_dev("mmc", CONFIG_FASTBOOT_FLASH_MMC_DEV);
+   *dev_desc = blk_get_dev("mmc", fastboot_get_mmc_device());
if (*dev_desc) {
ret = part_get_info_by_name(*dev_desc, name, info);
if (ret >= 0)
@@ -489,8 +494,7 @@ int fastboot_mmc_get_part_info(const char *part_name,
 
 static struct blk_desc *fastboot_mmc_get_dev(char *response)
 {
-   struct blk_desc *ret = blk_get_dev("mmc",
-  CONFIG_FASTBOOT_FLASH_MMC_DEV);
+   struct blk_desc *ret = blk_get_dev("mmc", fastboot_get_mmc_device());
 
if (!ret || ret->type == DEV_TYPE_UNKNOWN) {
pr_err("invalid mmc device\n");
@@ -641,7 +645,7 @@ void fastboot_mmc_erase(const char *cmd, char *response)
struct blk_desc *dev_desc;
struct disk_partition info;
lbaint_t blks, blks_start, blks_size, grp_size;
-   struct mmc *mmc = find_mmc_device(CONFIG_FASTBOOT_FLASH_MMC_DEV);
+   struct mmc *mmc = 

[RFC PATCH 2/3] sunxi: Implement fastboot_get_mmc_device()

2021-05-23 Thread Andre Przywara
The default MMC device to use for the fastboot flash command is hard to
decide at runtime, since the numbering of the MMC devices depends on
devicetree nodes. On the hardware side, the eMMC is connected to device
2, but this might be U-Boot's device 1 or 2, depending on whether the DT
contains a WiFi node for the hardware MMC1 device.

To avoid hardcoding this for each board, let's scan all MMC devices, and
try to find the eMMC device, given that this is enabled. If not, we use
the SD card.

Signed-off-by: Andre Przywara 
---
 board/sunxi/board.c | 37 +
 1 file changed, 37 insertions(+)

diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index 21651a1bfca..5f64887e48b 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -625,6 +625,43 @@ int board_mmc_init(struct bd_info *bis)
 }
 #endif
 
+#ifdef CONFIG_FASTBOOT_FLASH_MMC
+int fastboot_get_mmc_device(void)
+{
+   struct udevice *dev;
+   static int mmc_dev = -1;
+   int sd_card = -1;
+
+   if (mmc_dev != -1)
+   return mmc_dev;
+
+   for (uclass_first_device(UCLASS_MMC, );
+dev;
+uclass_next_device()) {
+   struct mmc *mmc = mmc_get_mmc_dev(dev);
+
+   mmc_init(mmc);
+   if (!mmc->has_init)
+   continue;
+
+   if (IS_SD(mmc)) {
+   sd_card = dev->seq_;
+   continue;
+   } else {
+   mmc_dev =  dev->seq_;
+   break;
+   }
+   }
+
+   if (mmc_dev == -1)
+   mmc_dev = sd_card;
+   if (mmc_dev == -1)
+   mmc_dev = 0;
+
+   return mmc_dev;
+}
+#endif
+
 #ifdef CONFIG_SPL_BUILD
 
 static void sunxi_spl_store_dram_size(phys_addr_t dram_size)
-- 
2.17.5



[RFC PATCH 0/3] fastboot: sunxi: Determine MMC device at runtime

2021-05-23 Thread Andre Przywara
At the moment the fastboot code relies on the Kconfig variable
CONFIG_FASTBOOT_FLASH_MMC_DEV to point to the MMC device to use for the
flash command. This value needs to be the *U-Boot device number*, which
is picked by the U-Boot device model at runtime. This makes it quite
tricky and fragile to fix this variable at compile time, as other DT
nodes and aliases influence the enumeration process.

To make this process more robust, allow the device number to be picked at
runtime, which sounds like a better fit to find this device number. Patch
1/3 introduces a weak function for that purpose.
Patch 2/3 then implements this function for the Allwinner platform. The
code follows the idea behind the existing Kconfig defaults: Use the eMMC
device, if that exists, or the SD card otherwise. This patch is actually
not sunxi specific, so might be adopted by other platforms as well.
Patch 3/3 then drops the existing Kconfig defaults for sunxi, to clean
this up and remove the implicit assumption that the eMMC device is always
device 1 (as least for the fastboot code).

I would be curious if others think this is the right way forward.
The fact that the U-Boot device numbers are determined at runtime
seems to conflict with the idea of a Kconfig variable in the first place,
hence this series. This brings us one step closer to the end goal of
removing the "eMMC is device 1" assumption.

I am looking forward to any comments on this series!

Cheers,
Andre

Andre Przywara (3):
  fastboot: Allow runtime determination of MMC device
  sunxi: Implement fastboot_get_mmc_device()
  sunxi: Drop sunxi FASTBOOT_FLASH_MMC_DEV defaults

 board/sunxi/board.c   | 37 +++
 drivers/fastboot/Kconfig  |  4 +---
 drivers/fastboot/fb_command.c |  6 +++---
 drivers/fastboot/fb_common.c  |  3 ++-
 drivers/fastboot/fb_mmc.c | 12 
 include/fastboot.h|  7 +++
 6 files changed, 58 insertions(+), 11 deletions(-)

-- 
2.17.5



[PATCH] spi: stm32_qspi: Fix short data write operation

2021-05-23 Thread Daniil Stas
TCF flag only means that all data was sent to FIFO. To check if the
data was sent out of FIFO we should also wait for the BUSY flag to be
cleared. Otherwise there is a race condition which can lead to
inability to write short (one byte long) data.

Signed-off-by: Daniil Stas 
Cc: Patrick Delaunay 
Cc: Patrice Chotard 
---
 drivers/spi/stm32_qspi.c | 29 +++--
 1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/drivers/spi/stm32_qspi.c b/drivers/spi/stm32_qspi.c
index 4acc9047b9..8f4aabc3d1 100644
--- a/drivers/spi/stm32_qspi.c
+++ b/drivers/spi/stm32_qspi.c
@@ -148,23 +148,24 @@ static int _stm32_qspi_wait_cmd(struct stm32_qspi_priv 
*priv,
const struct spi_mem_op *op)
 {
u32 sr;
-   int ret;
-
-   if (!op->data.nbytes)
-   return _stm32_qspi_wait_for_not_busy(priv);
+   int ret = 0;
 
-   ret = readl_poll_timeout(>regs->sr, sr,
-sr & STM32_QSPI_SR_TCF,
-STM32_QSPI_CMD_TIMEOUT_US);
-   if (ret) {
-   log_err("cmd timeout (stat:%#x)\n", sr);
-   } else if (readl(>regs->sr) & STM32_QSPI_SR_TEF) {
-   log_err("transfer error (stat:%#x)\n", sr);
-   ret = -EIO;
+   if (op->data.nbytes) {
+   ret = readl_poll_timeout(>regs->sr, sr,
+sr & STM32_QSPI_SR_TCF,
+STM32_QSPI_CMD_TIMEOUT_US);
+   if (ret) {
+   log_err("cmd timeout (stat:%#x)\n", sr);
+   } else if (readl(>regs->sr) & STM32_QSPI_SR_TEF) {
+   log_err("transfer error (stat:%#x)\n", sr);
+   ret = -EIO;
+   }
+   /* clear flags */
+   writel(STM32_QSPI_FCR_CTCF | STM32_QSPI_FCR_CTEF, 
>regs->fcr);
}
 
-   /* clear flags */
-   writel(STM32_QSPI_FCR_CTCF | STM32_QSPI_FCR_CTEF, >regs->fcr);
+   if (!ret)
+   ret = _stm32_qspi_wait_for_not_busy(priv);
 
return ret;
 }
-- 
2.31.0



[PATCH] net: dwc_eth_qos: Fix needless phy auto-negotiation restarts

2021-05-23 Thread Daniil Stas
Disabling clk_ck clock leads to link up status loss in phy, which
leads to auto-negotiation restart before each network command
execution.

This issue is especially big for PXE boot protocol because of
auto-negotiation restarts before each configuration filename trial.

To avoid this issue don't disable clk_ck clock after it was enabled.

Signed-off-by: Daniil Stas 
Cc: Ramon Fried 
Cc: Joe Hershberger 
Cc: Patrick Delaunay 
Cc: Patrice Chotard 
---
 drivers/net/dwc_eth_qos.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/dwc_eth_qos.c b/drivers/net/dwc_eth_qos.c
index e8242ca4e1..2f088c758f 100644
--- a/drivers/net/dwc_eth_qos.c
+++ b/drivers/net/dwc_eth_qos.c
@@ -321,6 +321,7 @@ struct eqos_priv {
void *rx_pkt;
bool started;
bool reg_access_ok;
+   bool clk_ck_enabled;
 };
 
 /*
@@ -591,12 +592,13 @@ static int eqos_start_clks_stm32(struct udevice *dev)
goto err_disable_clk_rx;
}
 
-   if (clk_valid(>clk_ck)) {
+   if (clk_valid(>clk_ck) && !eqos->clk_ck_enabled) {
ret = clk_enable(>clk_ck);
if (ret < 0) {
pr_err("clk_enable(clk_ck) failed: %d", ret);
goto err_disable_clk_tx;
}
+   eqos->clk_ck_enabled = true;
}
 #endif
 
@@ -648,8 +650,6 @@ static void eqos_stop_clks_stm32(struct udevice *dev)
clk_disable(>clk_tx);
clk_disable(>clk_rx);
clk_disable(>clk_master_bus);
-   if (clk_valid(>clk_ck))
-   clk_disable(>clk_ck);
 #endif
 
debug("%s: OK\n", __func__);
-- 
2.31.0



Re: [PATCH] test: Remove duplicate macro

2021-05-23 Thread Heinrich Schuchardt

On 5/23/21 7:00 PM, Sean Anderson wrote:

ut_asserteq_strn is defined twice. Remove one definition.

Fixes: 33d7edfd5f ("test: Add a way to check part of a console line or skip it")
Signed-off-by: Sean Anderson 


Reviewed-by: Heinrich Schuchardt 


[PATCH 2/2] arm: imx8m: add support for Advantech RSB-3720

2021-05-23 Thread Ying-Chun Liu
From: "Ying-Chun Liu (PaulLiu)" 

Add initial support for Advantech RSB-3720 board.
The initial support includes:
 - MMC
 - eMMC
 - I2C
 - FEC
 - Serial console

Signed-off-by: Darren Huang 
Signed-off-by: Kevin12.Chen 
Signed-off-by: Phill.Liu 
Signed-off-by: Tim Liang 
Signed-off-by: wei.zeng 
Signed-off-by: Ying-Chun Liu (PaulLiu) 
Cc: uboot-imx 
---
 arch/arm/dts/Makefile |3 +
 arch/arm/mach-imx/imx8m/Kconfig   |   15 +
 board/freescale/imx8mp_rsb3720a1/Kconfig  |   14 +
 board/freescale/imx8mp_rsb3720a1/MAINTAINERS  |7 +
 board/freescale/imx8mp_rsb3720a1/Makefile |   24 +
 .../imx8mp_rsb3720a1/imx8mp_rsb3720a1.c   |  391 
 .../imx8mp_rsb3720a1/imximage-8mp-lpddr4.cfg  |   11 +
 .../lpddr4_timing_rsb3720a1_4G.c  | 1848 
 .../lpddr4_timing_rsb3720a1_6G.c  | 1875 +
 board/freescale/imx8mp_rsb3720a1/spl.c|  270 +++
 configs/imx8mp_rsb3720a1_4G_defconfig |  158 ++
 configs/imx8mp_rsb3720a1_6G_defconfig |  159 ++
 include/configs/imx8mp_rsb3720.h  |  273 +++
 13 files changed, 5048 insertions(+)
 create mode 100644 board/freescale/imx8mp_rsb3720a1/Kconfig
 create mode 100644 board/freescale/imx8mp_rsb3720a1/MAINTAINERS
 create mode 100644 board/freescale/imx8mp_rsb3720a1/Makefile
 create mode 100644 board/freescale/imx8mp_rsb3720a1/imx8mp_rsb3720a1.c
 create mode 100644 board/freescale/imx8mp_rsb3720a1/imximage-8mp-lpddr4.cfg
 create mode 100644 
board/freescale/imx8mp_rsb3720a1/lpddr4_timing_rsb3720a1_4G.c
 create mode 100644 
board/freescale/imx8mp_rsb3720a1/lpddr4_timing_rsb3720a1_6G.c
 create mode 100644 board/freescale/imx8mp_rsb3720a1/spl.c
 create mode 100644 configs/imx8mp_rsb3720a1_4G_defconfig
 create mode 100644 configs/imx8mp_rsb3720a1_6G_defconfig
 create mode 100644 include/configs/imx8mp_rsb3720.h

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 096068261d..4e7306dc15 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -1102,6 +1102,9 @@ dtb-$(CONFIG_TARGET_DURIAN) += phytium-durian.dtb
 dtb-$(CONFIG_TARGET_PRESIDIO_ASIC) += ca-presidio-engboard.dtb
 
 dtb-$(CONFIG_TARGET_IMX8MM_CL_IOT_GATE) += imx8mm-cl-iot-gate.dtb
+ifneq 
($(CONFIG_TARGET_IMX8MP_RSB3720A1_4G)$(CONFIG_TARGET_IMX8MP_RSB3720A1_6G),)
+dtb-y += imx8mp-rsb3720-a1.dtb
+endif
 
 targets += $(dtb-y)
 
diff --git a/arch/arm/mach-imx/imx8m/Kconfig b/arch/arm/mach-imx/imx8m/Kconfig
index 0669363c0f..042efb1695 100644
--- a/arch/arm/mach-imx/imx8m/Kconfig
+++ b/arch/arm/mach-imx/imx8m/Kconfig
@@ -137,6 +137,20 @@ config TARGET_IMX8MM_CL_IOT_GATE
select IMX8MM
select SUPPORT_SPL
select IMX8M_LPDDR4
+
+config TARGET_IMX8MP_RSB3720A1_4G
+   bool "Support i.MX8MP RSB3720A1 4G"
+   select BINMAN
+   select IMX8MP
+   select SUPPORT_SPL
+   select IMX8M_LPDDR4
+
+config TARGET_IMX8MP_RSB3720A1_6G
+   bool "Support i.MX8MP RSB3720A1 6G"
+   select BINMAN
+   select IMX8MP
+   select SUPPORT_SPL
+   select IMX8M_LPDDR4
 endchoice
 
 source "board/beacon/imx8mm/Kconfig"
@@ -147,6 +161,7 @@ source "board/freescale/imx8mq_evk/Kconfig"
 source "board/freescale/imx8mm_evk/Kconfig"
 source "board/freescale/imx8mn_evk/Kconfig"
 source "board/freescale/imx8mp_evk/Kconfig"
+source "board/freescale/imx8mp_rsb3720a1/Kconfig"
 source "board/gateworks/venice/Kconfig"
 source "board/google/imx8mq_phanbell/Kconfig"
 source "board/phytec/phycore_imx8mm/Kconfig"
diff --git a/board/freescale/imx8mp_rsb3720a1/Kconfig 
b/board/freescale/imx8mp_rsb3720a1/Kconfig
new file mode 100644
index 00..62c391ccca
--- /dev/null
+++ b/board/freescale/imx8mp_rsb3720a1/Kconfig
@@ -0,0 +1,14 @@
+if TARGET_IMX8MP_RSB3720A1_4G || TARGET_IMX8MP_RSB3720A1_6G
+
+config SYS_BOARD
+   default "imx8mp_rsb3720a1"
+
+config SYS_VENDOR
+   default "freescale"
+
+config SYS_CONFIG_NAME
+   default "imx8mp_rsb3720"
+
+source "board/freescale/common/Kconfig"
+
+endif
diff --git a/board/freescale/imx8mp_rsb3720a1/MAINTAINERS 
b/board/freescale/imx8mp_rsb3720a1/MAINTAINERS
new file mode 100644
index 00..e806b770a5
--- /dev/null
+++ b/board/freescale/imx8mp_rsb3720a1/MAINTAINERS
@@ -0,0 +1,7 @@
+i.MX8MP RSB3720 BOARD
+M: Ying-Chun Liu (PaulLiu) 
+S: Maintained
+F: board/freescale/imx8mp_rsb3720a1/
+F: include/configs/imx8mp_rsb3720a1.h
+F: configs/imx8mp_rsb3720a1_4G_defconfig
+F: configs/imx8mp_rsb3720a1_6G_defconfig
diff --git a/board/freescale/imx8mp_rsb3720a1/Makefile 
b/board/freescale/imx8mp_rsb3720a1/Makefile
new file mode 100644
index 00..ae5b8b83eb
--- /dev/null
+++ b/board/freescale/imx8mp_rsb3720a1/Makefile
@@ -0,0 +1,24 @@
+#
+# Copyright 2019 NXP
+# Copyright 2021 Linaro
+#
+# SPDX-License-Identifier:  GPL-2.0+
+#
+
+ifdef CONFIG_TARGET_IMX8MP_RSB3720A1_6G
+obj-y += imx8mp_rsb3720a1.o
+
+ifdef CONFIG_SPL_BUILD
+obj-y += spl.o
+obj-$(CONFIG_IMX8M_LPDDR4) += 

Re: [PATCH] include/linux/byteorder: fix cpu_to_be32_array()

2021-05-23 Thread Heinrich Schuchardt

On 5/23/21 9:40 PM, Tom Rini wrote:

On Thu, May 20, 2021 at 05:36:03PM +0200, Heinrich Schuchardt wrote:


In cpu_to_be32_array() and be32_to_cpu_array() we should not compare an int
counter to a size_t parameter. Correct the type of the counter.

Signed-off-by: Heinrich Schuchardt 
---
  include/linux/byteorder/generic.h | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/byteorder/generic.h 
b/include/linux/byteorder/generic.h
index 8fae186d1a..bee0ff6033 100644
--- a/include/linux/byteorder/generic.h
+++ b/include/linux/byteorder/generic.h
@@ -190,7 +190,7 @@ static inline void be64_add_cpu(__be64 *var, u64 val)

  static inline void cpu_to_be32_array(__be32 *dst, const u32 *src, size_t len)
  {
-   int i;
+   size_t i;

for (i = 0; i < len; i++)
dst[i] = cpu_to_be32(src[i]);
@@ -198,7 +198,7 @@ static inline void cpu_to_be32_array(__be32 *dst, const u32 
*src, size_t len)

  static inline void be32_to_cpu_array(u32 *dst, const __be32 *src, size_t len)
  {
-   int i;
+   size_t i;

for (i = 0; i < len; i++)
dst[i] = be32_to_cpu(src[i]);


This was fixed in what commit from Linux?  Thanks!



include/linux/byteorder/generic.h in Linux is equally broken. This
should not stop you from merging this patch.

I will create a patch for Linux.

Best regards

Heinrich



Re: [PATCH] include/linux/byteorder: fix cpu_to_be32_array()

2021-05-23 Thread Tom Rini
On Thu, May 20, 2021 at 05:36:03PM +0200, Heinrich Schuchardt wrote:

> In cpu_to_be32_array() and be32_to_cpu_array() we should not compare an int
> counter to a size_t parameter. Correct the type of the counter.
> 
> Signed-off-by: Heinrich Schuchardt 
> ---
>  include/linux/byteorder/generic.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/byteorder/generic.h 
> b/include/linux/byteorder/generic.h
> index 8fae186d1a..bee0ff6033 100644
> --- a/include/linux/byteorder/generic.h
> +++ b/include/linux/byteorder/generic.h
> @@ -190,7 +190,7 @@ static inline void be64_add_cpu(__be64 *var, u64 val)
> 
>  static inline void cpu_to_be32_array(__be32 *dst, const u32 *src, size_t len)
>  {
> - int i;
> + size_t i;
> 
>   for (i = 0; i < len; i++)
>   dst[i] = cpu_to_be32(src[i]);
> @@ -198,7 +198,7 @@ static inline void cpu_to_be32_array(__be32 *dst, const 
> u32 *src, size_t len)
> 
>  static inline void be32_to_cpu_array(u32 *dst, const __be32 *src, size_t len)
>  {
> - int i;
> + size_t i;
> 
>   for (i = 0; i < len; i++)
>   dst[i] = be32_to_cpu(src[i]);

This was fixed in what commit from Linux?  Thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PULL] u-boot-sh/master

2021-05-23 Thread Tom Rini
On Fri, May 21, 2021 at 05:01:34PM +0200, Marek Vasut wrote:

> The following changes since commit 27c2236f8acfa311eed2c8f8d210824fadd25483:
> 
>   Merge tag 'xilinx-for-v2021.07-rc3' of
> https://source.denx.de/u-boot/custodians/u-boot-microblaze (2021-05-19
> 11:50:25 -0400)
> 
> are available in the Git repository at:
> 
>   git://source.denx.de/u-boot-sh.git master
> 
> for you to fetch changes up to 6fc323c1ae7312db4e04891b83bbe60f3b68c56b:
> 
>   pinctrl: renesas: Implement unlock register masks (2021-05-21 15:00:17
> +0200)
> 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


[PATCH] test: Remove duplicate macro

2021-05-23 Thread Sean Anderson
ut_asserteq_strn is defined twice. Remove one definition.

Fixes: 33d7edfd5f ("test: Add a way to check part of a console line or skip it")
Signed-off-by: Sean Anderson 
---

 include/test/ut.h | 17 -
 1 file changed, 17 deletions(-)

diff --git a/include/test/ut.h b/include/test/ut.h
index fbbba286ee..656e25fe57 100644
--- a/include/test/ut.h
+++ b/include/test/ut.h
@@ -177,23 +177,6 @@ int ut_check_console_dump(struct unit_test_state *uts, int 
total_bytes);
}   \
 }
 
-/*
- * Assert that two string expressions are equal, up to length of the
- * first
- */
-#define ut_asserteq_strn(expr1, expr2) {   \
-   const char *_val1 = (expr1), *_val2 = (expr2);  \
-   int _len = strlen(_val1);   \
-   \
-   if (memcmp(_val1, _val2, _len)) {   \
-   ut_failf(uts, __FILE__, __LINE__, __func__, \
-#expr1 " = " #expr2,   \
-"Expected \"%.*s\", got \"%.*s\"", \
-_len, _val1, _len, _val2); \
-   return CMD_RET_FAILURE; \
-   }   \
-}
-
 /* Assert that two memory areas are equal */
 #define ut_asserteq_mem(expr1, expr2, len) {   \
const u8 *_val1 = (u8 *)(expr1), *_val2 = (u8 *)(expr2);\
-- 
2.31.0



[PATCHv2 25/27] ppc: Remove T4160RDB board

2021-05-23 Thread Tom Rini
This board has not been converted to CONFIG_DM_PCI by the deadline and is
also missing conversion to CONFIG_DM.  Remove it.  As this is the last
ARCH_T4160 platform, remove that support as well.

Signed-off-by: Tom Rini 
---
Changes in v2:
- Only remove T4160 support and not T4240RDB as well.
---
 arch/powerpc/cpu/mpc85xx/Kconfig  |  36 +---
 arch/powerpc/cpu/mpc85xx/Makefile |   2 -
 arch/powerpc/cpu/mpc85xx/fdt.c|   5 +-
 .../powerpc/cpu/mpc85xx/fsl_corenet2_serdes.c |   2 +-
 arch/powerpc/cpu/mpc85xx/speed.c  |   3 +-
 arch/powerpc/cpu/mpc85xx/t4240_serdes.c   | 202 --
 arch/powerpc/include/asm/config_mpc85xx.h |   5 +-
 arch/powerpc/include/asm/fsl_secure_boot.h|   1 -
 arch/powerpc/include/asm/immap_85xx.h |   4 +-
 board/freescale/t4rdb/Kconfig |   2 +-
 board/freescale/t4rdb/MAINTAINERS |   1 -
 board/freescale/t4rdb/Makefile|   1 -
 configs/T4160RDB_defconfig|  57 -
 drivers/ddr/fsl/Kconfig   |   3 +-
 drivers/net/Kconfig   |   1 -
 drivers/net/fm/Makefile   |   1 -
 16 files changed, 10 insertions(+), 316 deletions(-)
 delete mode 100644 configs/T4160RDB_defconfig

diff --git a/arch/powerpc/cpu/mpc85xx/Kconfig b/arch/powerpc/cpu/mpc85xx/Kconfig
index 876f768e8601..395423582a8e 100644
--- a/arch/powerpc/cpu/mpc85xx/Kconfig
+++ b/arch/powerpc/cpu/mpc85xx/Kconfig
@@ -161,13 +161,6 @@ config TARGET_T2080RDB
imply CMD_SATA
imply PANIC_HANG
 
-config TARGET_T4160RDB
-   bool "Support T4160RDB"
-   select ARCH_T4160
-   select SUPPORT_SPL
-   select PHYS_64BIT
-   imply PANIC_HANG
-
 config TARGET_T4240RDB
bool "Support T4240RDB"
select ARCH_T4240
@@ -732,29 +725,6 @@ config ARCH_T2080
imply CMD_REGINFO
imply FSL_SATA
 
-config ARCH_T4160
-   bool
-   select E500MC
-   select E6500
-   select FSL_LAW
-   select SYS_FSL_DDR_VER_47
-   select SYS_FSL_ERRATUM_A004468
-   select SYS_FSL_ERRATUM_A005871
-   select SYS_FSL_ERRATUM_A006379
-   select SYS_FSL_ERRATUM_A006593
-   select SYS_FSL_ERRATUM_A007186
-   select SYS_FSL_ERRATUM_A007798
-   select SYS_FSL_ERRATUM_A009942
-   select SYS_FSL_HAS_DDR3
-   select SYS_FSL_HAS_SEC
-   select SYS_FSL_QORIQ_CHASSIS2
-   select SYS_FSL_SEC_BE
-   select SYS_FSL_SEC_COMPAT_4
-   select SYS_PPC64
-   select FSL_IFC
-   imply CMD_NAND
-   imply CMD_REGINFO
-
 config ARCH_T4240
bool
select E500MC
@@ -823,8 +793,7 @@ config NXP_ESBC
 config MAX_CPUS
int "Maximum number of CPUs permitted for MPC85xx"
default 12 if ARCH_T4240
-   default 8 if ARCH_P4080 || \
-ARCH_T4160
+   default 8 if ARCH_P4080
default 4 if ARCH_B4860 || \
 ARCH_P2041 || \
 ARCH_P3041 || \
@@ -877,7 +846,6 @@ config SYS_CCSRBAR_DEFAULT
ARCH_T1040  || \
ARCH_T1042  || \
ARCH_T2080  || \
-   ARCH_T4160  || \
ARCH_T4240
default 0xe000 if ARCH_QEMU_E500
help
@@ -1062,7 +1030,6 @@ config SYS_FSL_NUM_LAWS
ARCH_P4080  || \
ARCH_P5040  || \
ARCH_T2080  || \
-   ARCH_T4160  || \
ARCH_T4240
default 16 if   ARCH_T1024  || \
ARCH_T1040  || \
@@ -1142,7 +1109,6 @@ config SYS_FSL_IFC_CLK_DIV
ARCH_T1024  || \
ARCH_T1040  || \
ARCH_T1042  || \
-   ARCH_T4160  || \
ARCH_T4240
default 1
help
diff --git a/arch/powerpc/cpu/mpc85xx/Makefile 
b/arch/powerpc/cpu/mpc85xx/Makefile
index bbaae0d8454f..993e4873184f 100644
--- a/arch/powerpc/cpu/mpc85xx/Makefile
+++ b/arch/powerpc/cpu/mpc85xx/Makefile
@@ -42,7 +42,6 @@ obj-$(CONFIG_ARCH_P3041) += p3041_ids.o
 obj-$(CONFIG_ARCH_P4080) += p4080_ids.o
 obj-$(CONFIG_ARCH_P5040) += p5040_ids.o
 obj-$(CONFIG_ARCH_T4240) += t4240_ids.o
-obj-$(CONFIG_ARCH_T4160) += t4240_ids.o
 obj-$(CONFIG_ARCH_B4420) += b4860_ids.o
 obj-$(CONFIG_ARCH_B4860) += b4860_ids.o
 obj-$(CONFIG_ARCH_T1040) += t1040_ids.o
@@ -74,7 +73,6 @@ obj-$(CONFIG_ARCH_P3041) += p3041_serdes.o
 obj-$(CONFIG_ARCH_P4080) += p4080_serdes.o
 obj-$(CONFIG_ARCH_P5040) += p5040_serdes.o
 obj-$(CONFIG_ARCH_T4240) += t4240_serdes.o
-obj-$(CONFIG_ARCH_T4160) += t4240_serdes.o
 obj-$(CONFIG_ARCH_B4420) += b4860_serdes.o
 obj-$(CONFIG_ARCH_B4860) += b4860_serdes.o
 obj-$(CONFIG_ARCH_BSC9132) += bsc9132_serdes.o
diff --git a/arch/powerpc/cpu/mpc85xx/fdt.c 

[PATCH 1/2] arm: dts: add imx8mp-rsb3720-a1 dts file

2021-05-23 Thread Ying-Chun Liu
From: "Ying-Chun Liu (PaulLiu)" 

Add board dts for imx8mm-cl-iot-gate

Signed-off-by: Darren Huang 
Signed-off-by: Kevin12.Chen 
Signed-off-by: Phill.Liu 
Signed-off-by: Tim Liang 
Signed-off-by: wei.zeng 
Signed-off-by: Ying-Chun Liu (PaulLiu) 
Cc: uboot-imx 
---
 arch/arm/dts/imx8mp-rsb3720-a1-u-boot.dtsi | 257 ++
 arch/arm/dts/imx8mp-rsb3720-a1.dts | 539 +
 2 files changed, 796 insertions(+)
 create mode 100644 arch/arm/dts/imx8mp-rsb3720-a1-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx8mp-rsb3720-a1.dts

diff --git a/arch/arm/dts/imx8mp-rsb3720-a1-u-boot.dtsi 
b/arch/arm/dts/imx8mp-rsb3720-a1-u-boot.dtsi
new file mode 100644
index 00..9304e3f2cd
--- /dev/null
+++ b/arch/arm/dts/imx8mp-rsb3720-a1-u-boot.dtsi
@@ -0,0 +1,257 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2019 NXP
+ * Copyright 2021 Linaro
+ */
+
+/ {
+   binman: binman {
+   multiple-images;
+   };
+
+   firmware {
+   optee {
+   compatible = "linaro,optee-tz";
+   method = "smc";
+   };
+   };
+};
+
+&{/soc@0} {
+   u-boot,dm-pre-reloc;
+   u-boot,dm-spl;
+};
+
+ {
+   u-boot,dm-spl;
+   u-boot,dm-pre-reloc;
+   /delete-property/ assigned-clocks;
+   /delete-property/ assigned-clock-parents;
+   /delete-property/ assigned-clock-rates;
+
+};
+
+_32k {
+   u-boot,dm-spl;
+   u-boot,dm-pre-reloc;
+};
+
+_24m {
+   u-boot,dm-spl;
+   u-boot,dm-pre-reloc;
+};
+
+ {
+   u-boot,dm-spl;
+   u-boot,dm-pre-reloc;
+};
+
+ {
+   u-boot,dm-spl;
+};
+
+ {
+   u-boot,dm-spl;
+};
+
+ {
+   u-boot,dm-spl;
+};
+
+_reg_usdhc2_vmmc {
+   u-boot,dm-spl;
+};
+
+_usdhc2_vmmc {
+   u-boot,dm-spl;
+};
+
+_usdhc2_gpio {
+   u-boot,dm-spl;
+};
+
+_usdhc2 {
+   u-boot,dm-spl;
+};
+
+_usdhc3 {
+   u-boot,dm-spl;
+};
+
+ {
+   u-boot,dm-spl;
+};
+
+ {
+   u-boot,dm-spl;
+};
+
+ {
+   u-boot,dm-spl;
+};
+
+ {
+   u-boot,dm-spl;
+};
+
+ {
+   u-boot,dm-spl;
+};
+
+ {
+   u-boot,dm-spl;
+};
+
+ {
+   u-boot,dm-spl;
+};
+
+ {
+   u-boot,dm-spl;
+};
+
+ {
+   u-boot,dm-spl;
+};
+
+_i2c1 {
+   u-boot,dm-spl;
+};
+
+ {
+   u-boot,dm-spl;
+   assigned-clocks = < IMX8MP_CLK_USDHC1>;
+   assigned-clock-rates = <4>;
+   assigned-clock-parents = < IMX8MP_SYS_PLL1_400M>;
+};
+
+ {
+   u-boot,dm-spl;
+   sd-uhs-sdr104;
+   sd-uhs-ddr50;
+   assigned-clocks = < IMX8MP_CLK_USDHC2>;
+   assigned-clock-rates = <4>;
+   assigned-clock-parents = < IMX8MP_SYS_PLL1_400M>;
+};
+
+ {
+   u-boot,dm-spl;
+   mmc-hs400-1_8v;
+   mmc-hs400-enhanced-strobe;
+   assigned-clocks = < IMX8MP_CLK_USDHC3>;
+   assigned-clock-rates = <4>;
+   assigned-clock-parents = < IMX8MP_SYS_PLL1_400M>;
+};
+
+ {
+u-boot-spl-ddr {
+   filename = "u-boot-spl-ddr.bin";
+   pad-byte = <0xff>;
+   align-size = <4>;
+   align = <4>;
+
+   u-boot-spl {
+   align-end = <4>;
+   };
+
+   blob_1: blob-ext@1 {
+   filename = "lpddr4_pmu_train_1d_imem_202006.bin";
+   size = <0x8000>;
+   };
+
+   blob_2: blob-ext@2 {
+   filename = "lpddr4_pmu_train_1d_dmem_202006.bin";
+   size = <0x4000>;
+   };
+
+   blob_3: blob-ext@3 {
+   filename = "lpddr4_pmu_train_2d_imem_202006.bin";
+   size = <0x8000>;
+   };
+
+   blob_4: blob-ext@4 {
+   filename = "lpddr4_pmu_train_2d_dmem_202006.bin";
+   size = <0x4000>;
+   };
+   };
+
+   flash {
+   mkimage {
+   args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 
0x92";
+
+   blob {
+   filename = "u-boot-spl-ddr.bin";
+   };
+   };
+   };
+
+   itb {
+   filename = "u-boot.itb";
+
+   fit {
+   description = "Configuration to load ATF before U-Boot";
+   #address-cells = <1>;
+   fit,external-offset = ;
+
+   images {
+   uboot {
+   description = "U-Boot (64-bit)";
+   type = "standalone";
+   arch = "arm64";
+   compression = "none";
+   load = ;
+
+   uboot_blob: blob-ext {
+   filename = "u-boot-nodtb.bin";
+   };
+   

[PATCH 0/2] arm: imx8m: add support for Advantech RSB-3720

2021-05-23 Thread Ying-Chun Liu
From: "Ying-Chun Liu (PaulLiu)" 

Add initial support for Advantech RSB-3720 board.
The initial support includes:
 - MMC
 - eMMC
 - I2C
 - FEC
 - Serial console

Ying-Chun Liu (PaulLiu) (2):
  arm: dts: add imx8mp-rsb3720-a1 dts file
  arm: imx8m: add support for Advantech RSB-3720

 arch/arm/dts/Makefile |3 +
 arch/arm/dts/imx8mp-rsb3720-a1-u-boot.dtsi|  257 +++
 arch/arm/dts/imx8mp-rsb3720-a1.dts|  539 +
 arch/arm/mach-imx/imx8m/Kconfig   |   15 +
 board/freescale/imx8mp_rsb3720a1/Kconfig  |   14 +
 board/freescale/imx8mp_rsb3720a1/MAINTAINERS  |7 +
 board/freescale/imx8mp_rsb3720a1/Makefile |   24 +
 .../imx8mp_rsb3720a1/imx8mp_rsb3720a1.c   |  391 
 .../imx8mp_rsb3720a1/imximage-8mp-lpddr4.cfg  |   11 +
 .../lpddr4_timing_rsb3720a1_4G.c  | 1848 
 .../lpddr4_timing_rsb3720a1_6G.c  | 1875 +
 board/freescale/imx8mp_rsb3720a1/spl.c|  270 +++
 configs/imx8mp_rsb3720a1_4G_defconfig |  158 ++
 configs/imx8mp_rsb3720a1_6G_defconfig |  159 ++
 include/configs/imx8mp_rsb3720.h  |  273 +++
 15 files changed, 5844 insertions(+)
 create mode 100644 arch/arm/dts/imx8mp-rsb3720-a1-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx8mp-rsb3720-a1.dts
 create mode 100644 board/freescale/imx8mp_rsb3720a1/Kconfig
 create mode 100644 board/freescale/imx8mp_rsb3720a1/MAINTAINERS
 create mode 100644 board/freescale/imx8mp_rsb3720a1/Makefile
 create mode 100644 board/freescale/imx8mp_rsb3720a1/imx8mp_rsb3720a1.c
 create mode 100644 board/freescale/imx8mp_rsb3720a1/imximage-8mp-lpddr4.cfg
 create mode 100644 
board/freescale/imx8mp_rsb3720a1/lpddr4_timing_rsb3720a1_4G.c
 create mode 100644 
board/freescale/imx8mp_rsb3720a1/lpddr4_timing_rsb3720a1_6G.c
 create mode 100644 board/freescale/imx8mp_rsb3720a1/spl.c
 create mode 100644 configs/imx8mp_rsb3720a1_4G_defconfig
 create mode 100644 configs/imx8mp_rsb3720a1_6G_defconfig
 create mode 100644 include/configs/imx8mp_rsb3720.h

-- 
2.30.2



Re: [PATCH v4 00/14] arm64: synquacer: Add SynQuacer/DeveloperBox support

2021-05-23 Thread Ilias Apalodimas
Hi Masami,

On Wed, May 19, 2021 at 02:44:21PM +0900, Masami Hiramatsu wrote:
> Hi,
> 
> Here is the 4th version of the series (including some fixes for build
> errors) to add SynQuacer/DeveloperBox 96board EE suport on U-Boot.
> 
> This series includes not only DeveloperBox support but also some fixes
> for the issues which I faced while porting U-Boot on the DeveloperBox.
> First 3 patches are fixes, next 1 patch is a code cleanup for generic
> gpio for arm. The next 7 patches adding DeveloperBox devices
> and board support. The last 3 patches are related to the UEFI capsule
> update (including bugfixes).
> 
> Previous version is here:
> 
>  https://lists.denx.de/pipermail/u-boot/2021-May/449305.html
> 
> 

The default debug level is set to 7.  I think it would be better to set it
to something more reasonable for the final commit.  Unfortunately I don't
have time for a more detailed review, but I did manage to run this on my
Synquacer and managed to run a full linux distro with EFI.

Tested-by: Ilias Apalodimas 

> Changes in v4
> -
> 
> I dropped a PCI bugfix because it has been merged. And add I2C driver
> and enable RTC and EBBR support on the configuration.
> 
> [06/14]:
>   - Add Jaehoon's reviewed-by (Thanks!)
> [09/14]:
>   - Add a new i2c driver.
> [10/14]:
>   - Add i2c0 and RTC node.
> [11/14]:
>   - Add I2C and RTC configuration.
>   - Enable RTC and Date command.
>   - Remove I2C0 node before booting linux to hide it same as EDK2 does.
>   - Add some configurations to make it EBBR compliant.
> [14/14]:
>   - Add some config options for EBBR.
> 
> 
> BTW, should I split fixes from this series? (since I didn't expect this took
> so long...)
> 
> 
> DeveloperBox
> 
> 
> DeveloperBox is a certified 96boards Enterprise Edition board. The board/SoC 
> has: -
> * Socionext SC2A11 24-cores ARM Cortex-A53 on tbe Mini-ATX form factor 
> motherboard
> * 4 DIMM slots (4GB DDR4-2400 UDIMM shipped by default)
> * 1 4xPCIe Gen2 slot and 2 1xPCIe Gen2 slots
>   (1x slots are connected via PCIe bridge chip)
> * 4 USB-3.0 ports
> * 2 SATA ports
> * 1 GbE network port
> * 1 USB-UART serial port (micro USB)
> * 64MB SPI NOR Flash
> * 8GB eMMC Flash Storage
> * 96boards LS connector
> 
> The DeveloperBox schematic can be found here: -
> https://www.96boards.org/documentation/enterprise/developerbox/hardware-docs/mzsc2am_v03_20180115_a.pdf
> 
> And the other documents can be found here: -
> https://www.96boards.org/documentation/enterprise/developerbox/
> 
> 
> Currently, the U-Boot port supports: -
> * USB
> * eMMC
> * SPI-NOR
> * SATA
> * GbE
> 
> The DeveloperBox boots the TF-A and EDK2 as a main bootloader by default.
> The DeveloperBox U-Boot port will replace the EDK2 and boot from TF-A as
> BL33, but no need to combine with it.
> 
> 
> Thank you,
> 
> ---
> 
> Jassi Brar (4):
>   mmc: synquacer: Add SynQuacer F_SDH30 SDHCI driver
>   spi: synquacer: Add HSSPI SPI controller driver for SynQuacer
>   net: synquacer: Add netsec driver
>   i2c: synquacer: SNI Synquacer I2C controller
> 
> Masami Hiramatsu (10):
>   ata: ahci-pci: Use scsi_ops to initialize ops
>   dm: pci: Skip setting VGA bridge bits if parent device is the host bus
>   efi: Fix to use null handle to create new handle for efi_fmp_raw
>   gpio: Introduce CONFIG_GPIO_EXTRA_HEADER to cleanup #ifdefs
>   pci: synquacer: Add SynQuacer ECAM based PCIe driver
>   ARM: dts: synquacer: Add device trees for DeveloperBox
>   board: synquacer: Add DeveloperBox 96boards EE support
>   dfu_mtd: Ignore non-implemented lock device failure
>   doc: qemu: arm64: Fix the documentation of capsule update
>   configs: synquacer: Enable EFI capsule update support
> 
> 
>  arch/arm/Kconfig   |  108 ++
>  arch/arm/dts/Makefile  |2 
>  arch/arm/dts/synquacer-sc2a11-caches.dtsi  |   73 +
>  .../dts/synquacer-sc2a11-developerbox-u-boot.dtsi  |   75 +
>  arch/arm/dts/synquacer-sc2a11-developerbox.dts |   56 +
>  arch/arm/dts/synquacer-sc2a11.dtsi |  595 ++
>  arch/arm/include/asm/gpio.h|8 
>  board/socionext/developerbox/Kconfig   |   36 +
>  board/socionext/developerbox/MAINTAINERS   |   14 
>  board/socionext/developerbox/Makefile  |9 
>  board/socionext/developerbox/developerbox.c|  146 +++
>  configs/synquacer_developerbox_defconfig   |  131 ++
>  doc/board/emulation/qemu_capsule_update.rst|   11 
>  doc/board/index.rst|1 
>  doc/board/socionext/developerbox.rst   |   87 ++
>  doc/board/socionext/index.rst  |9 
>  drivers/ata/ahci-pci.c |2 
>  drivers/dfu/dfu_mtd.c  |2 
>  drivers/i2c/Kconfig|7 
>