[PATCH] x86: Ensure the e820 map is installed in all cases

2021-07-10 Thread Simon Glass
This is a revert of a recent logic change in setup_zimage(). We do
actually need to install this information always. Change it to install
from the Coreboot tables if available, else the normal source.

Fixes: e7bae8283fe ("x86: Allow installing an e820 when booting from coreboot")
Signed-off-by: Simon Glass 
---

 arch/x86/lib/zimage.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/x86/lib/zimage.c b/arch/x86/lib/zimage.c
index 90fc8a466d7..cf4210cd4ba 100644
--- a/arch/x86/lib/zimage.c
+++ b/arch/x86/lib/zimage.c
@@ -313,12 +313,12 @@ int setup_zimage(struct boot_params *setup_base, char 
*cmd_line, int auto_boot,
int bootproto = get_boot_protocol(hdr, false);
 
log_debug("Setup E820 entries\n");
-   if (ll_boot_init()) {
-   setup_base->e820_entries = install_e820_map(
-   ARRAY_SIZE(setup_base->e820_map), setup_base->e820_map);
-   } else if (IS_ENABLED(CONFIG_COREBOOT_SYSINFO)) {
+   if (IS_ENABLED(CONFIG_COREBOOT_SYSINFO)) {
setup_base->e820_entries = cb_install_e820_map(
ARRAY_SIZE(setup_base->e820_map), setup_base->e820_map);
+   } else {
+   setup_base->e820_entries = install_e820_map(
+   ARRAY_SIZE(setup_base->e820_map), setup_base->e820_map);
}
 
if (bootproto == 0x0100) {
-- 
2.32.0.93.g670b81a890-goog



[PATCH 15/17] i2c: Create a new Kconfig for I2C

2021-07-10 Thread Simon Glass
At present we have CONFIG_SPL_I2C but not CONFIG_I2C. The reason
CONFIG_I2C is not strictly necessary is that:

a) We have CONFIG_SYS_I2C_LEGACY and CONFIG_DM_I2C for the two possible
   i2c stacks
b) In U-Boot proper, we always build drivers/i2c/ regardless of the
   options

Still, it is better to have CONFIG_I2C - it makes U-Boot proper similar to
SPL/TPL, so we can (in a future commit) simplify the Makefile rules.

Enable it by default, since as above, we have separate options
(SYS_I2C_LEGACY and DM_I2C) to control whether it is 'really' enabled.

Once we have migrated I2C to driver model, we can drop SYS_I2C_LEGACY and
make DM_I2C become I2C. For now, this lets us simplify the Makefile rules.

Signed-off-by: Simon Glass 
---

 drivers/i2c/Kconfig | 26 --
 1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/Kconfig b/drivers/i2c/Kconfig
index d6d2b67b8eb..63d03a3cebf 100644
--- a/drivers/i2c/Kconfig
+++ b/drivers/i2c/Kconfig
@@ -2,7 +2,29 @@
 # I2C subsystem configuration
 #
 
-menu "I2C support"
+menuconfig I2C
+   bool "I2C support"
+   default y
+   help
+ Note:
+ This is a stand-in for an option to enable I2C support. In fact this
+ simply enables building of the I2C directory for U-Boot. The actual
+ I2C feature is enabled by DM_I2C (for driver model) and
+ the #define CONFIG_SYS_I2C_LEGACY (for the legacy I2C stack).
+
+ So at present there is no need to ever disable this option.
+
+ Eventually it will:
+
+ Enable support for the I2C (Inter-Integrated Circuit) bus in U-Boot.
+ I2C works with a clock and data line which can be driven by a
+ one or more masters or slaves. It is a fairly complex bus but is
+ widely used as it only needs two lines for communication. Speeds of
+ 400kbps are typical but up to 3.4Mbps is supported by some
+ hardware. Enable this option to build the drivers in drivers/i2c as
+ part of a U-Boot build.
+
+if I2C
 
 config DM_I2C
bool "Enable Driver Model for I2C drivers"
@@ -528,4 +550,4 @@ config SYS_I2C_IHS
 
 source "drivers/i2c/muxes/Kconfig"
 
-endmenu
+endif
-- 
2.32.0.93.g670b81a890-goog



[PATCH 17/17] Makefile: Move drivers/i2c/ into drivers/Makefile

2021-07-10 Thread Simon Glass
This rule should not be in the top-level Makefile. Now that we have a
consistent set of I2C Kconfigs for U-Boot proper, SPL and TPL, we can move
it.

Make use of the existing SPL/TPL rule in drivers/Makefile instead.

Signed-off-by: Simon Glass 
---

 Makefile | 1 -
 drivers/Makefile | 4 
 2 files changed, 5 deletions(-)

diff --git a/Makefile b/Makefile
index 8cae2718377..f7c6dab6bc6 100644
--- a/Makefile
+++ b/Makefile
@@ -808,7 +808,6 @@ libs-y += disk/
 libs-y += drivers/
 libs-y += drivers/dma/
 libs-y += drivers/gpio/
-libs-y += drivers/i2c/
 libs-y += drivers/net/
 libs-y += drivers/net/phy/
 libs-y += drivers/power/ \
diff --git a/drivers/Makefile b/drivers/Makefile
index af56c2ceb97..aea10f13a4b 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -9,11 +9,7 @@ obj-$(CONFIG_$(SPL_TPL_)GPIO) += gpio/
 obj-$(CONFIG_$(SPL_TPL_)DRIVERS_MISC) += misc/
 obj-$(CONFIG_$(SPL_TPL_)SYSRESET) += sysreset/
 obj-$(CONFIG_$(SPL_TPL_)FIRMWARE) +=firmware/
-
-# This is needed for now, until we drop the i2c/ rule in the top-level Makefile
-ifdef CONFIG_SPL_BUILD
 obj-$(CONFIG_$(SPL_TPL_)I2C) += i2c/
-endif
 obj-$(CONFIG_$(SPL_TPL_)INPUT) += input/
 obj-$(CONFIG_$(SPL_TPL_)LED) += led/
 obj-$(CONFIG_$(SPL_TPL_)MMC_SUPPORT) += mmc/
-- 
2.32.0.93.g670b81a890-goog



[PATCH 12/17] i2c: Rename CONFIG_SYS_I2C to CONFIG_SYS_I2C_LEGACY

2021-07-10 Thread Simon Glass
It is quite confusing that CONFIG_SYS_I2C selects the legacy I2C and
CONFIG_DM_I2C selects the current I2C. The deadline to migrate I2C is less
than a year away.

Also we want to have a CONFIG_I2C for U-Boot proper just like we have
CONFIG_SPL_I2C for SPL, so we can simplify the Makefile rules.

Rename this symbol so it is clear it is going away.

Signed-off-by: Simon Glass 
---

 README|  7 --
 arch/arm/cpu/armv8/fsl-layerscape/soc.c   |  2 +-
 arch/arm/cpu/armv8/fsl-layerscape/spl.c   |  2 +-
 .../include/asm/arch-fsl-layerscape/config.h  |  2 +-
 arch/arm/mach-kirkwood/include/mach/config.h  |  2 +-
 board/Arcturus/ucp1020/spl.c  |  2 +-
 board/compulab/common/Makefile|  2 +-
 board/compulab/common/eeprom.h|  2 +-
 board/freescale/p1_p2_rdb_pc/spl.c|  2 +-
 board/renesas/draak/draak.c   |  2 +-
 board/renesas/salvator-x/salvator-x.c |  4 ++--
 board/renesas/ulcb/ulcb.c |  2 +-
 board/somlabs/visionsom-6ull/visionsom-6ull.c |  2 +-
 board/tqc/tqma6/tqma6.c   |  4 ++--
 cmd/date.c|  4 ++--
 cmd/eeprom.c  |  2 +-
 cmd/i2c.c | 24 +--
 common/board_f.c  |  4 ++--
 common/stdio.c|  2 +-
 drivers/i2c/Makefile  |  2 +-
 include/asm-generic/global_data.h |  2 +-
 include/config_fallbacks.h|  4 ++--
 include/configs/M5208EVBE.h   |  2 +-
 include/configs/M52277EVB.h   |  2 +-
 include/configs/M5235EVB.h|  2 +-
 include/configs/M5253DEMO.h   |  2 +-
 include/configs/M5275EVB.h|  2 +-
 include/configs/M53017EVB.h   |  2 +-
 include/configs/M5329EVB.h|  2 +-
 include/configs/M5373EVB.h|  2 +-
 include/configs/M54451EVB.h   |  2 +-
 include/configs/M54455EVB.h   |  2 +-
 include/configs/MPC8349EMDS.h |  2 +-
 include/configs/MPC8349EMDS_SDRAM.h   |  2 +-
 include/configs/MPC837XERDB.h |  2 +-
 include/configs/MPC8540ADS.h  |  2 +-
 include/configs/MPC8548CDS.h  |  2 +-
 include/configs/MPC8560ADS.h  |  2 +-
 include/configs/P1010RDB.h|  2 +-
 include/configs/P2041RDB.h|  2 +-
 include/configs/T102xRDB.h|  2 +-
 include/configs/T104xRDB.h|  2 +-
 include/configs/T208xQDS.h|  2 +-
 include/configs/T208xRDB.h|  2 +-
 include/configs/T4240RDB.h|  2 +-
 include/configs/UCP1020.h |  2 +-
 include/configs/astro_mcf5373l.h  |  2 +-
 include/configs/bur_am335x_common.h   |  2 +-
 include/configs/cl-som-imx7.h |  2 +-
 include/configs/cm_fx6.h  |  2 +-
 include/configs/colibri_pxa270.h  |  2 +-
 include/configs/corenet_ds.h  |  2 +-
 include/configs/db-88f6720.h  |  2 +-
 include/configs/db-88f6820-gp.h   |  2 +-
 include/configs/db-mv784mp-gp.h   |  2 +-
 include/configs/devkit3250.h  |  2 +-
 include/configs/ds414.h   |  2 +-
 include/configs/eb_cpu5282.h  |  2 +-
 include/configs/edminiv2.h|  2 +-
 include/configs/el6x_common.h |  2 +-
 include/configs/embestmx6boards.h |  2 +-
 include/configs/ethernut5.h   |  2 +-
 include/configs/flea3.h   |  2 +-
 include/configs/gw_ventana.h  |  2 +-
 include/configs/ids8313.h |  2 +-
 include/configs/imx8mp_evk.h  |  2 +-
 include/configs/imx8mq_evk.h  |  2 +-
 include/configs/imx8mq_phanbell.h |  2 +-
 include/configs/km/km-mpc83xx.h   |  2 +-
 include/configs/km/km_arm.h   |  2 +-
 include/configs/km/pg-wcom-ls102xa.h  |  2 +-
 include/configs/kzm9g.h   |  2 +-
 include/configs/legoev3.h |  2 +-
 include/configs/ls1012a_common.h  |  2 +-
 include/configs/ls1021aiot.h  |  2 +-
 include/configs/ls1021aqds.h  |  2 +-
 include/configs/ls1021atsn.h  |  2 +-
 include/configs/ls1021atwr.h  |  2 +-
 include/configs/ls1028a_common.h  |  2 +-
 include/configs/ls1043a_common.h  |  2 +-
 include/configs/ls1046a_common.h  |  2 +-
 include/configs/ls1088a_common.h  |  2 +-
 include/configs/ls2080a_common.h  |  2 +-
 

[PATCH 11/17] Rename DRIVERS_MISC_SUPPORT to DRIVERS_MISC

2021-07-10 Thread Simon Glass
Rename these options so that CONFIG_IS_ENABLED can be used with them.

Signed-off-by: Simon Glass 
---

 arch/Kconfig |  4 ++--
 arch/arm/mach-rockchip/Kconfig   | 10 +-
 arch/arm/mach-rockchip/rk3288/Kconfig|  2 +-
 arch/arm/mach-stm32/Kconfig  |  2 +-
 arch/arm/mach-stm32mp/Kconfig|  2 +-
 cmd/Kconfig  |  2 +-
 common/spl/Kconfig   |  4 ++--
 configs/P1010RDB-PA_36BIT_NAND_defconfig |  4 ++--
 configs/P1010RDB-PA_36BIT_SDCARD_defconfig   |  2 +-
 configs/P1010RDB-PA_36BIT_SPIFLASH_defconfig |  2 +-
 configs/P1010RDB-PA_NAND_defconfig   |  4 ++--
 configs/P1010RDB-PA_SDCARD_defconfig |  2 +-
 configs/P1010RDB-PA_SPIFLASH_defconfig   |  2 +-
 configs/P1010RDB-PB_36BIT_NAND_defconfig |  4 ++--
 configs/P1010RDB-PB_36BIT_SDCARD_defconfig   |  2 +-
 configs/P1010RDB-PB_36BIT_SPIFLASH_defconfig |  2 +-
 configs/P1010RDB-PB_NAND_defconfig   |  4 ++--
 configs/P1010RDB-PB_SDCARD_defconfig |  2 +-
 configs/P1010RDB-PB_SPIFLASH_defconfig   |  2 +-
 configs/T1024RDB_NAND_defconfig  |  2 +-
 configs/T1024RDB_SDCARD_defconfig|  2 +-
 configs/T1024RDB_SPIFLASH_defconfig  |  2 +-
 configs/T1042D4RDB_NAND_defconfig|  2 +-
 configs/T1042D4RDB_SDCARD_defconfig  |  2 +-
 configs/T1042D4RDB_SPIFLASH_defconfig|  2 +-
 configs/T2080QDS_NAND_defconfig  |  2 +-
 configs/T2080QDS_SDCARD_defconfig|  2 +-
 configs/T2080QDS_SPIFLASH_defconfig  |  2 +-
 configs/T2080RDB_NAND_defconfig  |  2 +-
 configs/T2080RDB_SDCARD_defconfig|  2 +-
 configs/T2080RDB_SPIFLASH_defconfig  |  2 +-
 configs/T2080RDB_revD_NAND_defconfig |  2 +-
 configs/T2080RDB_revD_SDCARD_defconfig   |  2 +-
 configs/T2080RDB_revD_SPIFLASH_defconfig |  2 +-
 configs/T4240RDB_SDCARD_defconfig|  2 +-
 configs/am335x_guardian_defconfig|  2 +-
 configs/am43xx_evm_defconfig |  2 +-
 configs/am43xx_hs_evm_defconfig  |  2 +-
 configs/am64x_evm_a53_defconfig  |  2 +-
 configs/am64x_evm_r5_defconfig   |  2 +-
 configs/am65x_evm_a53_defconfig  |  2 +-
 configs/am65x_evm_r5_defconfig   |  2 +-
 configs/am65x_evm_r5_usbdfu_defconfig|  2 +-
 configs/am65x_evm_r5_usbmsc_defconfig|  2 +-
 configs/am65x_hs_evm_a53_defconfig   |  2 +-
 configs/am65x_hs_evm_r5_defconfig|  2 +-
 configs/cgtqmx8_defconfig|  2 +-
 configs/deneb_defconfig  |  2 +-
 configs/evb-px30_defconfig   |  2 +-
 configs/evb-px5_defconfig|  2 +-
 configs/evb-rk3308_defconfig |  2 +-
 configs/evb-rk3328_defconfig |  4 ++--
 configs/firefly-px30_defconfig   |  2 +-
 configs/giedi_defconfig  |  2 +-
 configs/imx8mm-cl-iot-gate_defconfig |  2 +-
 configs/imx8mm-icore-mx8mm-ctouch2_defconfig |  2 +-
 configs/imx8mm-icore-mx8mm-edimm2.2_defconfig|  2 +-
 configs/imx8mm_beacon_defconfig  |  2 +-
 configs/imx8mm_evk_defconfig |  2 +-
 configs/imx8mm_venice_defconfig  |  2 +-
 configs/imx8mn_beacon_2g_defconfig   |  2 +-
 configs/imx8mn_beacon_defconfig  |  2 +-
 configs/imx8mn_ddr4_evk_defconfig|  2 +-
 configs/imx8mn_evk_defconfig |  2 +-
 configs/imx8mp_evk_defconfig |  2 +-
 configs/imx8qm_mek_defconfig |  2 +-
 configs/imx8qm_rom7720_a1_4G_defconfig   |  2 +-
 configs/imx8qxp_mek_defconfig|  2 +-
 configs/j7200_evm_a72_defconfig  |  2 +-
 configs/j7200_evm_r5_defconfig   |  2 +-
 configs/j721e_evm_a72_defconfig  |  2 +-
 configs/j721e_evm_r5_defconfig   |  2 +-
 configs/j721e_hs_evm_a72_defconfig   |  2 +-
 configs/j721e_hs_evm_r5_defconfig|  2 +-
 configs/lion-rk3368_defconfig|  4 ++--
 configs/ls1021aqds_nand_defconfig|  2 +-
 configs/ls1021aqds_sdcard_ifc_defconfig  |  2 +-
 configs/ls1021aqds_sdcard_qspi_defconfig |  2 +-
 

[PATCH 14/17] i2c: Drop unused CONFIG_I2C

2021-07-10 Thread Simon Glass
This actually does nothing but is defined by a few dozen boards. Drop it,
so we can define a real one.

Signed-off-by: Simon Glass 
---

 include/configs/bur_am335x_common.h| 1 -
 include/configs/siemens-am33x-common.h | 1 -
 include/configs/ti_armv7_common.h  | 1 -
 scripts/config_whitelist.txt   | 1 -
 4 files changed, 4 deletions(-)

diff --git a/include/configs/bur_am335x_common.h 
b/include/configs/bur_am335x_common.h
index 042cb4637ba..51585fcb371 100644
--- a/include/configs/bur_am335x_common.h
+++ b/include/configs/bur_am335x_common.h
@@ -19,7 +19,6 @@
 #define CONFIG_SYS_NS16550_CLK (4800)
 #define CONFIG_SYS_NS16550_COM10x44e09000
 
-#define CONFIG_I2C
 #define CONFIG_SYS_I2C_LEGACY
 
 #endif /* CONFIG_DM */
diff --git a/include/configs/siemens-am33x-common.h 
b/include/configs/siemens-am33x-common.h
index abd5e2bacfd..a4b4c48d4c4 100644
--- a/include/configs/siemens-am33x-common.h
+++ b/include/configs/siemens-am33x-common.h
@@ -73,7 +73,6 @@
 
 
 /* I2C Configuration */
-#define CONFIG_I2C
 #define CONFIG_SYS_I2C_LEGACY
 
 /* Defines for SPL */
diff --git a/include/configs/ti_armv7_common.h 
b/include/configs/ti_armv7_common.h
index fe4689cf1da..4fcf741c0a0 100644
--- a/include/configs/ti_armv7_common.h
+++ b/include/configs/ti_armv7_common.h
@@ -88,7 +88,6 @@
 
 /* If DM_I2C, enable non-DM I2C support */
 #if !CONFIG_IS_ENABLED(DM_I2C)
-#define CONFIG_I2C
 #define CONFIG_SYS_I2C_LEGACY
 #endif
 
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index b7c235a9895..8ebcc489187 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -708,7 +708,6 @@ CONFIG_HUSH_INIT_VAR
 CONFIG_HVBOOT
 CONFIG_HWCONFIG
 CONFIG_HW_ENV_SETTINGS
-CONFIG_I2C
 CONFIG_I2C_ENV_EEPROM_BUS
 CONFIG_I2C_GSC
 CONFIG_I2C_MBB_TIMEOUT
-- 
2.32.0.93.g670b81a890-goog



[PATCH 10/17] Rename GPIO_SUPPORT to GPIO

2021-07-10 Thread Simon Glass
Rename these options so that CONFIG_IS_ENABLED can be used with them.

Signed-off-by: Simon Glass 
---

 arch/Kconfig| 4 ++--
 arch/arm/Kconfig| 2 +-
 arch/arm/mach-exynos/Kconfig| 2 +-
 arch/arm/mach-imx/mx6/Kconfig   | 2 +-
 arch/arm/mach-mvebu/Kconfig | 2 +-
 arch/arm/mach-omap2/Kconfig | 6 +++---
 arch/arm/mach-omap2/am33xx/Kconfig  | 4 ++--
 arch/arm/mach-rockchip/rk3399/rk3399.c  | 4 ++--
 arch/arm/mach-stm32/Kconfig | 2 +-
 arch/arm/mach-stm32mp/Kconfig   | 2 +-
 arch/arm/mach-tegra/Kconfig | 2 +-
 common/spl/Kconfig  | 4 ++--
 configs/am335x_guardian_defconfig   | 2 +-
 configs/am335x_igep003x_defconfig   | 2 +-
 configs/am335x_shc_defconfig| 2 +-
 configs/am335x_shc_ict_defconfig| 2 +-
 configs/am335x_shc_netboot_defconfig| 2 +-
 configs/am335x_shc_sdboot_defconfig | 2 +-
 configs/am335x_sl50_defconfig   | 2 +-
 configs/am64x_evm_r5_defconfig  | 2 +-
 configs/am65x_evm_r5_defconfig  | 2 +-
 configs/am65x_evm_r5_usbdfu_defconfig   | 2 +-
 configs/am65x_evm_r5_usbmsc_defconfig   | 2 +-
 configs/am65x_hs_evm_r5_defconfig   | 2 +-
 configs/apalis_imx6_defconfig   | 2 +-
 configs/axm_defconfig   | 2 +-
 configs/bg0900_defconfig| 2 +-
 configs/brppt1_mmc_defconfig| 2 +-
 configs/brppt1_nand_defconfig   | 2 +-
 configs/brppt1_spi_defconfig| 2 +-
 configs/brppt2_defconfig| 2 +-
 configs/brsmarc1_defconfig  | 2 +-
 configs/brxre1_defconfig| 2 +-
 configs/cgtqmx8_defconfig   | 2 +-
 configs/chromebook_bob_defconfig| 2 +-
 configs/ci20_mmc_defconfig  | 2 +-
 configs/cl-som-imx7_defconfig   | 2 +-
 configs/cm_fx6_defconfig| 2 +-
 configs/cm_t335_defconfig   | 2 +-
 configs/colibri_imx6_defconfig  | 2 +-
 configs/controlcenterdc_defconfig   | 2 +-
 configs/corvus_defconfig| 2 +-
 configs/deneb_defconfig | 2 +-
 configs/dh_imx6_defconfig   | 2 +-
 configs/display5_defconfig  | 2 +-
 configs/display5_factory_defconfig  | 2 +-
 configs/draco_defconfig | 2 +-
 configs/etamin_defconfig| 2 +-
 configs/gardena-smart-gateway-at91sam_defconfig | 2 +-
 configs/ge_b1x5v2_defconfig | 2 +-
 configs/giedi_defconfig | 2 +-
 configs/gwventana_emmc_defconfig| 2 +-
 configs/gwventana_gw5904_defconfig  | 2 +-
 configs/gwventana_nand_defconfig| 2 +-
 configs/imx28_xea_defconfig | 2 +-
 configs/imx6dl_icore_nand_defconfig | 2 +-
 configs/imx6q_icore_nand_defconfig  | 2 +-
 configs/imx6q_logic_defconfig   | 2 +-
 configs/imx6qdl_icore_mipi_defconfig| 2 +-
 configs/imx6qdl_icore_mmc_defconfig | 2 +-
 configs/imx6qdl_icore_nand_defconfig| 2 +-
 configs/imx6qdl_icore_rqs_defconfig | 2 +-
 configs/imx6ul_geam_mmc_defconfig   | 2 +-
 configs/imx6ul_geam_nand_defconfig  | 2 +-
 configs/imx6ul_isiot_emmc_defconfig | 2 +-
 configs/imx6ul_isiot_nand_defconfig | 2 +-
 configs/imx7_cm_defconfig   | 2 +-
 configs/imx8mm-cl-iot-gate_defconfig| 2 +-
 configs/imx8mm-icore-mx8mm-ctouch2_defconfig| 2 +-
 configs/imx8mm-icore-mx8mm-edimm2.2_defconfig   | 2 +-
 configs/imx8mm_beacon_defconfig | 2 +-
 configs/imx8mm_evk_defconfig| 2 +-
 configs/imx8mm_venice_defconfig | 2 +-
 configs/imx8mn_beacon_2g_defconfig  | 2 +-
 configs/imx8mn_beacon_defconfig | 2 +-
 configs/imx8mn_ddr4_evk_defconfig   | 2 +-
 configs/imx8mn_evk_defconfig| 2 +-
 configs/imx8mp_evk_defconfig| 2 +-
 configs/imx8mq_cm_defconfig | 2 +-
 configs/imx8qm_mek_defconfig| 2 +-
 configs/imx8qm_rom7720_a1_4G_defconfig  | 2 +-
 configs/imx8qxp_mek_defconfig   | 2 +-
 configs/imxrt1020-evk_defconfig | 2 +-
 configs/imxrt1050-evk_defconfig | 2 +-
 configs/j7200_evm_a72_defconfig | 2 +-
 configs/j7200_evm_r5_defconfig  | 2 +-
 configs/j721e_evm_a72_defconfig | 2 +-
 

[PATCH 13/17] i2c: Fix the migration warning

2021-07-10 Thread Simon Glass
While there is a CONFIG_I2C it does not really mean anything and is
defined by only a few dozen boards. This should key off
CONFIG_SYS_I2C_LEGACY instead.

Fix it.

Signed-off-by: Simon Glass 
---

 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 60dbab1609e..8cae2718377 100644
--- a/Makefile
+++ b/Makefile
@@ -1128,7 +1128,7 @@ endif
$(call deprecated,CONFIG_WDT,DM watchdog,v2019.10,\
$(CONFIG_WATCHDOG)$(CONFIG_HW_WATCHDOG))
$(call deprecated,CONFIG_DM_ETH,Ethernet drivers,v2020.07,$(CONFIG_NET))
-   $(call deprecated,CONFIG_DM_I2C,I2C drivers,v2022.04,$(CONFIG_I2C))
+   $(call deprecated,CONFIG_DM_I2C,I2C 
drivers,v2022.04,$(CONFIG_SYS_I2C_LEGACY))
@# Check that this build does not use CONFIG options that we do not
@# know about unless they are in Kconfig. All the existing CONFIG
@# options are whitelisted, so new ones should not be added.
-- 
2.32.0.93.g670b81a890-goog



[PATCH 08/17] Rename SPL_WATCHDOG_SUPPORT to SPL_WATCHDOG

2021-07-10 Thread Simon Glass
Rename this option so that CONFIG_IS_ENABLED can be used with it.

Signed-off-by: Simon Glass 
---

 arch/arm/Kconfig| 2 +-
 arch/arm/mach-imx/mx6/Kconfig   | 2 +-
 arch/arm/mach-omap2/am33xx/Kconfig  | 4 ++--
 arch/arm/mach-stm32mp/Kconfig   | 2 +-
 common/spl/Kconfig  | 2 +-
 common/spl/spl.c| 2 +-
 configs/am335x_baltos_defconfig | 2 +-
 configs/am335x_igep003x_defconfig   | 2 +-
 configs/am335x_shc_defconfig| 2 +-
 configs/am335x_shc_ict_defconfig| 2 +-
 configs/am335x_shc_netboot_defconfig| 2 +-
 configs/am335x_shc_sdboot_defconfig | 2 +-
 configs/am335x_sl50_defconfig   | 2 +-
 configs/brppt1_mmc_defconfig| 2 +-
 configs/brppt1_nand_defconfig   | 2 +-
 configs/brppt1_spi_defconfig| 2 +-
 configs/cgtqmx8_defconfig   | 2 +-
 configs/chiliboard_defconfig| 2 +-
 configs/cm_fx6_defconfig| 2 +-
 configs/cm_t335_defconfig   | 2 +-
 configs/deneb_defconfig | 2 +-
 configs/dh_imx6_defconfig   | 2 +-
 configs/display5_defconfig  | 2 +-
 configs/display5_factory_defconfig  | 2 +-
 configs/draco_defconfig | 2 +-
 configs/etamin_defconfig| 2 +-
 configs/giedi_defconfig | 2 +-
 configs/gwventana_emmc_defconfig| 2 +-
 configs/gwventana_gw5904_defconfig  | 2 +-
 configs/gwventana_nand_defconfig| 2 +-
 configs/imx6dl_icore_nand_defconfig | 2 +-
 configs/imx6q_icore_nand_defconfig  | 2 +-
 configs/imx6q_logic_defconfig   | 2 +-
 configs/imx6qdl_icore_mipi_defconfig| 2 +-
 configs/imx6qdl_icore_mmc_defconfig | 2 +-
 configs/imx6qdl_icore_nand_defconfig| 2 +-
 configs/imx6qdl_icore_rqs_defconfig | 2 +-
 configs/imx6ul_geam_mmc_defconfig   | 2 +-
 configs/imx6ul_geam_nand_defconfig  | 2 +-
 configs/imx6ul_isiot_emmc_defconfig | 2 +-
 configs/imx6ul_isiot_nand_defconfig | 2 +-
 configs/imx8mm-cl-iot-gate_defconfig| 2 +-
 configs/imx8mm_beacon_defconfig | 2 +-
 configs/imx8mm_evk_defconfig| 2 +-
 configs/imx8mm_venice_defconfig | 2 +-
 configs/imx8mn_ddr4_evk_defconfig   | 2 +-
 configs/imx8mn_evk_defconfig| 2 +-
 configs/imx8mp_evk_defconfig| 2 +-
 configs/imx8qm_mek_defconfig| 2 +-
 configs/imx8qm_rom7720_a1_4G_defconfig  | 2 +-
 configs/kp_imx6q_tpc_defconfig  | 2 +-
 configs/liteboard_defconfig | 2 +-
 configs/ls1021aqds_nand_defconfig   | 2 +-
 configs/ls1021aqds_sdcard_ifc_defconfig | 2 +-
 configs/ls1021aqds_sdcard_qspi_defconfig| 2 +-
 configs/ls1021atsn_sdcard_defconfig | 2 +-
 configs/ls1021atwr_sdcard_ifc_SECURE_BOOT_defconfig | 2 +-
 configs/ls1021atwr_sdcard_ifc_defconfig | 2 +-
 configs/ls1021atwr_sdcard_qspi_defconfig| 2 +-
 configs/ls1043aqds_nand_defconfig   | 2 +-
 configs/ls1043aqds_sdcard_ifc_defconfig | 2 +-
 configs/ls1043aqds_sdcard_qspi_defconfig| 2 +-
 configs/ls1043ardb_nand_SECURE_BOOT_defconfig   | 2 +-
 configs/ls1043ardb_nand_defconfig   | 2 +-
 configs/ls1043ardb_sdcard_SECURE_BOOT_defconfig | 2 +-
 configs/ls1043ardb_sdcard_defconfig | 2 +-
 configs/ls1046aqds_sdcard_ifc_defconfig | 2 +-
 configs/ls1046aqds_sdcard_qspi_defconfig| 2 +-
 configs/ls1046ardb_emmc_defconfig   | 2 +-
 configs/ls1046ardb_qspi_spl_defconfig   | 2 +-
 configs/ls1046ardb_sdcard_SECURE_BOOT_defconfig | 2 +-
 configs/ls1046ardb_sdcard_defconfig | 2 +-
 configs/m53menlo_defconfig  | 2 +-
 configs/mt7629_rfb_defconfig| 2 +-
 configs/mx6cuboxi_defconfig | 2 +-
 configs/mx6memcal_defconfig | 2 +-
 configs/mx6sabreauto_defconfig  | 2 +-
 configs/mx6sabresd_defconfig| 2 +-
 configs/mx6slevk_spl_defconfig  | 2 +-
 configs/mx6ul_14x14_evk_defconfig   | 2 +-
 configs/mx6ul_9x9_evk_defconfig | 2 +-
 configs/myir_mys_6ulx_defconfig 

[PATCH 09/17] Rename SPL_USB_HOST_SUPPORT to SPL_USB_HOST

2021-07-10 Thread Simon Glass
Rename this option so that CONFIG_IS_ENABLED can be used with it.

Signed-off-by: Simon Glass 
---

 arch/arm/mach-imx/mx6/Kconfig | 2 +-
 common/Makefile   | 2 +-
 common/spl/Kconfig| 4 ++--
 configs/am43xx_evm_defconfig  | 2 +-
 configs/am43xx_evm_usbhost_boot_defconfig | 2 +-
 configs/am43xx_hs_evm_defconfig   | 2 +-
 configs/am64x_evm_a53_defconfig   | 2 +-
 configs/am64x_evm_r5_defconfig| 2 +-
 configs/am65x_evm_a53_defconfig   | 2 +-
 configs/am65x_evm_r5_usbmsc_defconfig | 2 +-
 configs/apalis_imx6_defconfig | 2 +-
 configs/colibri_imx6_defconfig| 2 +-
 configs/display5_factory_defconfig| 2 +-
 configs/ge_b1x5v2_defconfig   | 2 +-
 configs/imx6q_logic_defconfig | 2 +-
 configs/imx7_cm_defconfig | 2 +-
 configs/mx6memcal_defconfig   | 2 +-
 configs/mx6sabreauto_defconfig| 2 +-
 configs/mx6sabresd_defconfig  | 2 +-
 configs/mx6ul_14x14_evk_defconfig | 2 +-
 configs/myir_mys_6ulx_defconfig   | 2 +-
 configs/phycore_pcl063_defconfig  | 2 +-
 configs/phycore_pcl063_ull_defconfig  | 2 +-
 configs/pico-dwarf-imx6ul_defconfig   | 2 +-
 configs/pico-dwarf-imx7d_defconfig| 2 +-
 configs/pico-hobbit-imx6ul_defconfig  | 2 +-
 configs/pico-hobbit-imx7d_defconfig   | 2 +-
 configs/pico-imx6_defconfig   | 2 +-
 configs/pico-imx6ul_defconfig | 2 +-
 configs/pico-imx7d_bl33_defconfig | 2 +-
 configs/pico-imx7d_defconfig  | 2 +-
 configs/pico-nymph-imx7d_defconfig| 2 +-
 configs/pico-pi-imx6ul_defconfig  | 2 +-
 configs/pico-pi-imx7d_defconfig   | 2 +-
 configs/seeed_npi_imx6ull_defconfig   | 2 +-
 configs/variscite_dart6ul_defconfig   | 2 +-
 configs/vining_2000_defconfig | 2 +-
 drivers/Makefile  | 2 +-
 drivers/usb/cdns3/Kconfig | 2 +-
 drivers/usb/cdns3/core.c  | 6 +++---
 drivers/usb/dwc3/dwc3-generic.c   | 4 ++--
 drivers/usb/mtu3/mtu3_plat.c  | 4 ++--
 include/configs/am43xx_evm.h  | 2 +-
 tools/buildman/README | 2 +-
 44 files changed, 49 insertions(+), 49 deletions(-)

diff --git a/arch/arm/mach-imx/mx6/Kconfig b/arch/arm/mach-imx/mx6/Kconfig
index aec83e81b6f..5be4fb198f8 100644
--- a/arch/arm/mach-imx/mx6/Kconfig
+++ b/arch/arm/mach-imx/mx6/Kconfig
@@ -313,7 +313,7 @@ config TARGET_MX6DL_MAMOJ
select SPL_SEPARATE_BSS if SPL
select SPL_SERIAL_SUPPORT if SPL
select SPL_USB_GADGET if SPL
-   select SPL_USB_HOST_SUPPORT if SPL
+   select SPL_USB_HOST if SPL
select SPL_USB_SDP_SUPPORT if SPL
select SPL_WATCHDOG if SPL
select SUPPORT_SPL
diff --git a/common/Makefile b/common/Makefile
index 829ea5fb426..9063ed93910 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -72,7 +72,7 @@ obj-$(CONFIG_SPL_LOAD_FIT) += common_fit.o
 obj-$(CONFIG_SPL_NET_SUPPORT) += miiphyutil.o
 obj-$(CONFIG_$(SPL_TPL_)OF_LIBFDT) += fdt_support.o
 
-ifdef CONFIG_SPL_USB_HOST_SUPPORT
+ifdef CONFIG_SPL_USB_HOST
 obj-y += usb.o
 obj-y += usb_hub.o
 obj-$(CONFIG_SPL_USB_STORAGE) += usb_storage.o
diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index 762a969315e..2648107dd45 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -1182,7 +1182,7 @@ config SPL_THERMAL
  automatic power-off when the temperature gets too high or low. Other
  devices may be discrete but connected on a suitable bus.
 
-config SPL_USB_HOST_SUPPORT
+config SPL_USB_HOST
bool "Support USB host drivers"
select HAVE_BLOCK_DEVICE
help
@@ -1195,7 +1195,7 @@ config SPL_USB_HOST_SUPPORT
 
 config SPL_USB_STORAGE
bool "Support loading from USB"
-   depends on SPL_USB_HOST_SUPPORT && !(BLK && !DM_USB)
+   depends on SPL_USB_HOST && !(BLK && !DM_USB)
help
  Enable support for USB devices in SPL. This allows use of USB
  devices such as hard drives and flash drivers for loading U-Boot.
diff --git a/configs/am43xx_evm_defconfig b/configs/am43xx_evm_defconfig
index e5abd2a71de..8901717f76c 100644
--- a/configs/am43xx_evm_defconfig
+++ b/configs/am43xx_evm_defconfig
@@ -23,7 +23,7 @@ CONFIG_SPL_NAND_BASE=y
 CONFIG_SPL_NET_SUPPORT=y
 CONFIG_SPL_NET_VCI_STRING="AM43xx U-Boot SPL"
 CONFIG_SPL_OS_BOOT=y
-CONFIG_SPL_USB_HOST_SUPPORT=y
+CONFIG_SPL_USB_HOST=y
 CONFIG_SPL_USB_GADGET=y
 CONFIG_SPL_USB_ETHER=y
 CONFIG_CMD_SPL=y
diff --git a/configs/am43xx_evm_usbhost_boot_defconfig 
b/configs/am43xx_evm_usbhost_boot_defconfig
index b1be0272e71..8d1642d2941 100644
--- a/configs/am43xx_evm_usbhost_boot_defconfig
+++ b/configs/am43xx_evm_usbhost_boot_defconfig
@@ -19,7 +19,7 @@ CONFIG_SPL_NAND_DRIVERS=y
 CONFIG_SPL_NAND_ECC=y
 CONFIG_SPL_NAND_BASE=y
 CONFIG_SPL_OS_BOOT=y

[PATCH 06/17] Rename SPL_ETH_SUPPORT to SPL_ETH

2021-07-10 Thread Simon Glass
Rename this option so that CONFIG_IS_ENABLED can be used with it.

Signed-off-by: Simon Glass 
---

 arch/arm/mach-omap2/boot-common.c | 2 +-
 board/siemens/draco/board.c   | 2 +-
 board/siemens/pxm2/board.c| 4 ++--
 board/tcl/sl50/board.c| 6 +++---
 board/ti/am335x/board.c   | 4 ++--
 board/vscom/baltos/board.c| 6 +++---
 common/spl/Kconfig| 6 +++---
 common/spl/spl_net.c  | 4 ++--
 configs/am335x_evm_defconfig  | 2 +-
 configs/am335x_guardian_defconfig | 2 +-
 configs/am43xx_evm_defconfig  | 2 +-
 configs/am43xx_hs_evm_defconfig   | 2 +-
 doc/SPL/README.am335x-network | 2 +-
 drivers/Makefile  | 4 ++--
 include/configs/topic_miami.h | 2 +-
 15 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/arch/arm/mach-omap2/boot-common.c 
b/arch/arm/mach-omap2/boot-common.c
index 1268a325038..f4d63896b6c 100644
--- a/arch/arm/mach-omap2/boot-common.c
+++ b/arch/arm/mach-omap2/boot-common.c
@@ -104,7 +104,7 @@ void save_omap_boot_params(void)
sys_boot_device = 1;
break;
 #endif
-#if defined(BOOT_DEVICE_CPGMAC) && !defined(CONFIG_SPL_ETH_SUPPORT)
+#if defined(BOOT_DEVICE_CPGMAC) && !defined(CONFIG_SPL_ETH)
case BOOT_DEVICE_CPGMAC:
sys_boot_device = 1;
break;
diff --git a/board/siemens/draco/board.c b/board/siemens/draco/board.c
index 01fdfb5cb4d..af35bc188e3 100644
--- a/board/siemens/draco/board.c
+++ b/board/siemens/draco/board.c
@@ -288,7 +288,7 @@ int board_late_init(void)
 #endif
 
 #if (defined(CONFIG_DRIVER_TI_CPSW) && !defined(CONFIG_SPL_BUILD)) || \
-   (defined(CONFIG_SPL_ETH_SUPPORT) && defined(CONFIG_SPL_BUILD))
+   (defined(CONFIG_SPL_ETH) && defined(CONFIG_SPL_BUILD))
 static void cpsw_control(int enabled)
 {
/* VTP can be added here */
diff --git a/board/siemens/pxm2/board.c b/board/siemens/pxm2/board.c
index b5e9b4242cd..de52838d771 100644
--- a/board/siemens/pxm2/board.c
+++ b/board/siemens/pxm2/board.c
@@ -171,7 +171,7 @@ int read_eeprom(void)
 }
 
 #if (defined(CONFIG_DRIVER_TI_CPSW) && !defined(CONFIG_SPL_BUILD)) || \
-   (defined(CONFIG_SPL_ETH_SUPPORT) && defined(CONFIG_SPL_BUILD))
+   (defined(CONFIG_SPL_ETH) && defined(CONFIG_SPL_BUILD))
 static void cpsw_control(int enabled)
 {
/* VTP can be added here */
@@ -220,7 +220,7 @@ int board_eth_init(struct bd_info *bis)
 {
int n = 0;
 #if (defined(CONFIG_DRIVER_TI_CPSW) && !defined(CONFIG_SPL_BUILD)) || \
-   (defined(CONFIG_SPL_ETH_SUPPORT) && defined(CONFIG_SPL_BUILD))
+   (defined(CONFIG_SPL_ETH) && defined(CONFIG_SPL_BUILD))
struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE;
 #ifdef CONFIG_FACTORYSET
int rv;
diff --git a/board/tcl/sl50/board.c b/board/tcl/sl50/board.c
index 4821925c026..d2136084991 100644
--- a/board/tcl/sl50/board.c
+++ b/board/tcl/sl50/board.c
@@ -250,7 +250,7 @@ int board_late_init(void)
 #endif
 
 #if (defined(CONFIG_DRIVER_TI_CPSW) && !defined(CONFIG_SPL_BUILD)) || \
-   (defined(CONFIG_SPL_ETH_SUPPORT) && defined(CONFIG_SPL_BUILD))
+   (defined(CONFIG_SPL_ETH) && defined(CONFIG_SPL_BUILD))
 static void cpsw_control(int enabled)
 {
/* VTP can be added here */
@@ -302,7 +302,7 @@ static struct cpsw_platform_data cpsw_data = {
  * Build in only these cases to avoid warnings about unused variables
  * when we build an SPL that has neither option but full U-Boot will.
  */
-#if ((defined(CONFIG_SPL_ETH_SUPPORT) || defined(CONFIG_SPL_USB_ETHER)) \
+#if ((defined(CONFIG_SPL_ETH) || defined(CONFIG_SPL_USB_ETHER)) \
&& defined(CONFIG_SPL_BUILD)) || \
((defined(CONFIG_DRIVER_TI_CPSW) || \
  defined(CONFIG_USB_ETHER) && defined(CONFIG_MUSB_GADGET)) && \
@@ -324,7 +324,7 @@ int board_eth_init(struct bd_info *bis)
mac_addr[5] = (mac_lo & 0xFF00) >> 8;
 
 #if (defined(CONFIG_DRIVER_TI_CPSW) && !defined(CONFIG_SPL_BUILD)) || \
-   (defined(CONFIG_SPL_ETH_SUPPORT) && defined(CONFIG_SPL_BUILD))
+   (defined(CONFIG_SPL_ETH) && defined(CONFIG_SPL_BUILD))
if (!env_get("ethaddr")) {
printf(" not set. Validating first E-fuse MAC\n");
 
diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c
index 5c156a5d1d8..555c0aa4492 100644
--- a/board/ti/am335x/board.c
+++ b/board/ti/am335x/board.c
@@ -588,7 +588,7 @@ void sdram_init(void)
 #endif
 
 #if defined(CONFIG_CLOCK_SYNTHESIZER) && (!defined(CONFIG_SPL_BUILD) || \
-   (defined(CONFIG_SPL_ETH_SUPPORT) && defined(CONFIG_SPL_BUILD)))
+   (defined(CONFIG_SPL_ETH) && defined(CONFIG_SPL_BUILD)))
 static void request_and_set_gpio(int gpio, char *name, int val)
 {
int ret;
@@ -724,7 +724,7 @@ int board_init(void)
 #endif
 
 #if defined(CONFIG_CLOCK_SYNTHESIZER) && (!defined(CONFIG_SPL_BUILD) || \
-   (defined(CONFIG_SPL_ETH_SUPPORT) && defined(CONFIG_SPL_BUILD)))
+   (defined(CONFIG_SPL_ETH) && 

[PATCH 07/17] Rename SPL_MUSB_NEW_SUPPORT to SPL_MUSB_NEW

2021-07-10 Thread Simon Glass
Rename this option so that CONFIG_IS_ENABLED can be used with it.

Signed-off-by: Simon Glass 
---

 arch/arm/mach-omap2/am33xx/board.c   | 2 +-
 arch/arm/mach-omap2/boot-common.c| 2 +-
 common/spl/Kconfig   | 2 +-
 configs/am335x_boneblack_vboot_defconfig | 2 +-
 configs/am335x_evm_defconfig | 2 +-
 configs/am335x_guardian_defconfig| 2 +-
 drivers/Makefile | 2 +-
 7 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-omap2/am33xx/board.c 
b/arch/arm/mach-omap2/am33xx/board.c
index 62178f1e700..c05f04efa72 100644
--- a/arch/arm/mach-omap2/am33xx/board.c
+++ b/arch/arm/mach-omap2/am33xx/board.c
@@ -205,7 +205,7 @@ int cpu_mmc_init(struct bd_info *bis)
 #if (defined(CONFIG_USB_MUSB_GADGET) || defined(CONFIG_USB_MUSB_HOST)) && \
(defined(CONFIG_AM335X_USB0) || defined(CONFIG_AM335X_USB1)) && \
(!CONFIG_IS_ENABLED(DM_USB) || !CONFIG_IS_ENABLED(OF_CONTROL)) && \
-   (!defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_MUSB_NEW_SUPPORT))
+   (!defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_MUSB_NEW))
 
 static struct musb_hdrc_config musb_config = {
.multipoint = 1,
diff --git a/arch/arm/mach-omap2/boot-common.c 
b/arch/arm/mach-omap2/boot-common.c
index f4d63896b6c..b3b727a9ef5 100644
--- a/arch/arm/mach-omap2/boot-common.c
+++ b/arch/arm/mach-omap2/boot-common.c
@@ -205,7 +205,7 @@ void spl_board_init(void)
 #if defined(CONFIG_SPL_I2C_SUPPORT) && !CONFIG_IS_ENABLED(DM_I2C)
i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE);
 #endif
-#if defined(CONFIG_AM33XX) && defined(CONFIG_SPL_MUSB_NEW_SUPPORT)
+#if defined(CONFIG_AM33XX) && defined(CONFIG_SPL_MUSB_NEW)
arch_misc_init();
 #endif
 #if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index 66e15f58525..0924466d481 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -751,7 +751,7 @@ config SPL_MTD_SUPPORT
  devices. See SPL_NAND_SUPPORT and SPL_ONENAND_SUPPORT for how
  to enable specific MTD drivers.
 
-config SPL_MUSB_NEW_SUPPORT
+config SPL_MUSB_NEW
bool "Support new Mentor Graphics USB"
help
  Enable support for Mentor Graphics USB in SPL. This is a new
diff --git a/configs/am335x_boneblack_vboot_defconfig 
b/configs/am335x_boneblack_vboot_defconfig
index 498174a1fa2..34d54e68233 100644
--- a/configs/am335x_boneblack_vboot_defconfig
+++ b/configs/am335x_boneblack_vboot_defconfig
@@ -19,7 +19,7 @@ CONFIG_AUTOBOOT_STOP_STR=" "
 CONFIG_BOOTCOMMAND="if test ${boot_fit} -eq 1; then run update_to_fit; fi; run 
findfdt; run init_console; run envboot; run distro_bootcmd"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_ARCH_MISC_INIT=y
-CONFIG_SPL_MUSB_NEW_SUPPORT=y
+CONFIG_SPL_MUSB_NEW=y
 # CONFIG_SPL_NAND_SUPPORT is not set
 CONFIG_SPL_NET_SUPPORT=y
 CONFIG_SPL_NET_VCI_STRING="AM33xx U-Boot SPL"
diff --git a/configs/am335x_evm_defconfig b/configs/am335x_evm_defconfig
index 9149d4adb3f..2b0cc566cf9 100644
--- a/configs/am335x_evm_defconfig
+++ b/configs/am335x_evm_defconfig
@@ -17,7 +17,7 @@ CONFIG_SPL_FIT_IMAGE_TINY=y
 CONFIG_SPL_ETH=y
 # CONFIG_SPL_FS_EXT4 is not set
 CONFIG_SPL_MTD_SUPPORT=y
-CONFIG_SPL_MUSB_NEW_SUPPORT=y
+CONFIG_SPL_MUSB_NEW=y
 CONFIG_SPL_NAND_DRIVERS=y
 CONFIG_SPL_NAND_ECC=y
 CONFIG_SPL_NAND_BASE=y
diff --git a/configs/am335x_guardian_defconfig 
b/configs/am335x_guardian_defconfig
index f211731edc8..49e73aee13b 100644
--- a/configs/am335x_guardian_defconfig
+++ b/configs/am335x_guardian_defconfig
@@ -30,7 +30,7 @@ CONFIG_SPL_SEPARATE_BSS=y
 CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_ETH=y
 CONFIG_SPL_I2C_SUPPORT=y
-CONFIG_SPL_MUSB_NEW_SUPPORT=y
+CONFIG_SPL_MUSB_NEW=y
 CONFIG_SPL_NAND_DRIVERS=y
 CONFIG_SPL_NAND_ECC=y
 CONFIG_SPL_NAND_BASE=y
diff --git a/drivers/Makefile b/drivers/Makefile
index ec84be12cf0..7b82db4aa94 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -53,7 +53,7 @@ obj-$(CONFIG_SPL_DMA) += dma/
 obj-$(CONFIG_SPL_ETH) += net/
 obj-$(CONFIG_SPL_ETH) += net/phy/
 obj-$(CONFIG_SPL_USB_ETHER) += net/phy/
-obj-$(CONFIG_SPL_MUSB_NEW_SUPPORT) += usb/musb-new/
+obj-$(CONFIG_SPL_MUSB_NEW) += usb/musb-new/
 obj-$(CONFIG_SPL_USB_GADGET) += usb/gadget/
 obj-$(CONFIG_SPL_USB_GADGET) += usb/common/
 obj-$(CONFIG_SPL_USB_GADGET) += usb/gadget/udc/
-- 
2.32.0.93.g670b81a890-goog



[PATCH 04/17] Rename SPL_POWER_SUPPORT to SPL_POWER

2021-07-10 Thread Simon Glass
Rename this option so that CONFIG_IS_ENABLED can be used with it.

Signed-off-by: Simon Glass 
---

 arch/arm/Kconfig| 2 +-
 arch/arm/mach-omap2/Kconfig | 6 +++---
 arch/arm/mach-omap2/am33xx/Kconfig  | 4 ++--
 board/engicam/stm32mp1/spl.c| 2 +-
 board/phytec/phycore_rk3288/phycore-rk3288.c| 2 +-
 board/st/stm32mp1/spl.c | 4 ++--
 common/spl/Kconfig  | 2 +-
 configs/am335x_baltos_defconfig | 2 +-
 configs/am335x_guardian_defconfig   | 2 +-
 configs/am335x_igep003x_defconfig   | 2 +-
 configs/am335x_pdu001_defconfig | 2 +-
 configs/am335x_shc_defconfig| 2 +-
 configs/am335x_shc_ict_defconfig| 2 +-
 configs/am335x_shc_netboot_defconfig| 2 +-
 configs/am335x_shc_sdboot_defconfig | 2 +-
 configs/am335x_sl50_defconfig   | 2 +-
 configs/am3517_evm_defconfig| 2 +-
 configs/am64x_evm_r5_defconfig  | 2 +-
 configs/am65x_evm_r5_defconfig  | 2 +-
 configs/am65x_evm_r5_usbdfu_defconfig   | 2 +-
 configs/am65x_evm_r5_usbmsc_defconfig   | 2 +-
 configs/am65x_hs_evm_r5_defconfig   | 2 +-
 configs/brppt1_mmc_defconfig| 2 +-
 configs/brppt1_nand_defconfig   | 2 +-
 configs/brppt1_spi_defconfig| 2 +-
 configs/brsmarc1_defconfig  | 2 +-
 configs/brxre1_defconfig| 2 +-
 configs/cgtqmx8_defconfig   | 2 +-
 configs/chiliboard_defconfig| 2 +-
 configs/cm_t335_defconfig   | 2 +-
 configs/cm_t43_defconfig| 2 +-
 configs/deneb_defconfig | 2 +-
 configs/giedi_defconfig | 2 +-
 configs/gwventana_emmc_defconfig| 2 +-
 configs/gwventana_gw5904_defconfig  | 2 +-
 configs/gwventana_nand_defconfig| 2 +-
 configs/imx8mm-cl-iot-gate_defconfig| 2 +-
 configs/imx8mm-icore-mx8mm-ctouch2_defconfig| 2 +-
 configs/imx8mm-icore-mx8mm-edimm2.2_defconfig   | 2 +-
 configs/imx8mm_beacon_defconfig | 2 +-
 configs/imx8mm_evk_defconfig| 2 +-
 configs/imx8mm_venice_defconfig | 2 +-
 configs/imx8mn_beacon_2g_defconfig  | 2 +-
 configs/imx8mn_beacon_defconfig | 2 +-
 configs/imx8mn_evk_defconfig| 2 +-
 configs/imx8mp_evk_defconfig| 2 +-
 configs/imx8qm_mek_defconfig| 2 +-
 configs/imx8qm_rom7720_a1_4G_defconfig  | 2 +-
 configs/imx8qxp_mek_defconfig   | 2 +-
 configs/j7200_evm_a72_defconfig | 2 +-
 configs/j7200_evm_r5_defconfig  | 2 +-
 configs/j721e_evm_a72_defconfig | 2 +-
 configs/j721e_evm_r5_defconfig  | 2 +-
 configs/j721e_hs_evm_a72_defconfig  | 2 +-
 configs/j721e_hs_evm_r5_defconfig   | 2 +-
 configs/k2e_evm_defconfig   | 2 +-
 configs/k2g_evm_defconfig   | 2 +-
 configs/k2hk_evm_defconfig  | 2 +-
 configs/k2l_evm_defconfig   | 2 +-
 configs/kp_imx6q_tpc_defconfig  | 2 +-
 configs/nanopi-r2s-rk3328_defconfig | 2 +-
 configs/odroid-go2_defconfig| 2 +-
 configs/omap35_logic_somlv_defconfig| 2 +-
 configs/omap3_logic_somlv_defconfig | 2 +-
 configs/phycore-am335x-r2-regor_defconfig   | 2 +-
 configs/phycore-am335x-r2-wega_defconfig| 2 +-
 configs/phycore-imx8mm_defconfig| 2 +-
 configs/phycore-imx8mp_defconfig| 2 +-
 configs/puma-rk3399_defconfig   | 2 +-
 configs/roc-cc-rk3328_defconfig | 2 +-
 configs/rock-pi-e-rk3328_defconfig  | 2 +-
 configs/rock64-rk3328_defconfig | 

[PATCH 05/17] Rename SPL_CRYPTO_SUPPORT to SPL_CRYPTO

2021-07-10 Thread Simon Glass
Rename this option so that CONFIG_IS_ENABLED can be used with it.

Signed-off-by: Simon Glass 
---

 common/Kconfig.boot  | 2 +-
 common/spl/Kconfig   | 2 +-
 configs/ls1021atwr_sdcard_ifc_SECURE_BOOT_defconfig  | 2 +-
 configs/ls1043ardb_nand_SECURE_BOOT_defconfig| 2 +-
 configs/ls1043ardb_sdcard_SECURE_BOOT_defconfig  | 2 +-
 configs/ls1046ardb_sdcard_SECURE_BOOT_defconfig  | 2 +-
 configs/ls1088ardb_sdcard_qspi_SECURE_BOOT_defconfig | 2 +-
 drivers/Makefile | 2 +-
 8 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/common/Kconfig.boot b/common/Kconfig.boot
index 89a3161f1fa..b2527a3b791 100644
--- a/common/Kconfig.boot
+++ b/common/Kconfig.boot
@@ -184,7 +184,7 @@ config SPL_FIT_SIGNATURE
depends on SPL_LOAD_FIT || SPL_LOAD_FIT_FULL
select FIT_SIGNATURE
select SPL_FIT
-   select SPL_CRYPTO_SUPPORT
+   select SPL_CRYPTO
select SPL_HASH_SUPPORT
select SPL_RSA
select SPL_RSA_VERIFY
diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index 6117bc86c77..e17db3a74a9 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -501,7 +501,7 @@ config SPL_CPU
  may improve boot performance. Enable this option to build the
  drivers in drivers/cpu as part of an SPL build.
 
-config SPL_CRYPTO_SUPPORT
+config SPL_CRYPTO
bool "Support crypto drivers"
help
  Enable crypto drivers in SPL. These drivers can be used to
diff --git a/configs/ls1021atwr_sdcard_ifc_SECURE_BOOT_defconfig 
b/configs/ls1021atwr_sdcard_ifc_SECURE_BOOT_defconfig
index 1f807d6b24d..c84c5f6b8b9 100644
--- a/configs/ls1021atwr_sdcard_ifc_SECURE_BOOT_defconfig
+++ b/configs/ls1021atwr_sdcard_ifc_SECURE_BOOT_defconfig
@@ -30,7 +30,7 @@ CONFIG_MISC_INIT_R=y
 CONFIG_SPL_FSL_PBL=y
 CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
 CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0xe8
-CONFIG_SPL_CRYPTO_SUPPORT=y
+CONFIG_SPL_CRYPTO=y
 CONFIG_SPL_HASH_SUPPORT=y
 CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
diff --git a/configs/ls1043ardb_nand_SECURE_BOOT_defconfig 
b/configs/ls1043ardb_nand_SECURE_BOOT_defconfig
index 5c687508a91..79e9e8567c7 100644
--- a/configs/ls1043ardb_nand_SECURE_BOOT_defconfig
+++ b/configs/ls1043ardb_nand_SECURE_BOOT_defconfig
@@ -26,7 +26,7 @@ CONFIG_MISC_INIT_R=y
 CONFIG_SPL_FSL_PBL=y
 CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
 CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0xf0
-CONFIG_SPL_CRYPTO_SUPPORT=y
+CONFIG_SPL_CRYPTO=y
 CONFIG_SPL_HASH_SUPPORT=y
 CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
diff --git a/configs/ls1043ardb_sdcard_SECURE_BOOT_defconfig 
b/configs/ls1043ardb_sdcard_SECURE_BOOT_defconfig
index 9bf2dbb2d29..1b6f053ef21 100644
--- a/configs/ls1043ardb_sdcard_SECURE_BOOT_defconfig
+++ b/configs/ls1043ardb_sdcard_SECURE_BOOT_defconfig
@@ -26,7 +26,7 @@ CONFIG_MISC_INIT_R=y
 CONFIG_SPL_FSL_PBL=y
 CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
 CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x110
-CONFIG_SPL_CRYPTO_SUPPORT=y
+CONFIG_SPL_CRYPTO=y
 CONFIG_SPL_HASH_SUPPORT=y
 CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
diff --git a/configs/ls1046ardb_sdcard_SECURE_BOOT_defconfig 
b/configs/ls1046ardb_sdcard_SECURE_BOOT_defconfig
index bf578388e8d..b0087bbe50a 100644
--- a/configs/ls1046ardb_sdcard_SECURE_BOOT_defconfig
+++ b/configs/ls1046ardb_sdcard_SECURE_BOOT_defconfig
@@ -26,7 +26,7 @@ CONFIG_MISC_INIT_R=y
 CONFIG_SPL_FSL_PBL=y
 CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
 CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x110
-CONFIG_SPL_CRYPTO_SUPPORT=y
+CONFIG_SPL_CRYPTO=y
 CONFIG_SPL_HASH_SUPPORT=y
 CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
diff --git a/configs/ls1088ardb_sdcard_qspi_SECURE_BOOT_defconfig 
b/configs/ls1088ardb_sdcard_qspi_SECURE_BOOT_defconfig
index 997f505778b..ba2ddf1a21c 100644
--- a/configs/ls1088ardb_sdcard_qspi_SECURE_BOOT_defconfig
+++ b/configs/ls1088ardb_sdcard_qspi_SECURE_BOOT_defconfig
@@ -31,7 +31,7 @@ CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_MISC_INIT_R=y
 CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
 CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x8b0
-CONFIG_SPL_CRYPTO_SUPPORT=y
+CONFIG_SPL_CRYPTO=y
 CONFIG_SPL_HASH_SUPPORT=y
 CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
diff --git a/drivers/Makefile b/drivers/Makefile
index 1285ab1bb9f..f80de5c4ce4 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -39,7 +39,7 @@ ifdef CONFIG_SPL_BUILD
 obj-$(CONFIG_SPL_BOOTCOUNT_LIMIT) += bootcount/
 obj-$(CONFIG_SPL_CACHE_SUPPORT) += cache/
 obj-$(CONFIG_SPL_CPU) += cpu/
-obj-$(CONFIG_SPL_CRYPTO_SUPPORT) += crypto/
+obj-$(CONFIG_SPL_CRYPTO) += crypto/
 obj-$(CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT) += ddr/fsl/
 obj-$(CONFIG_ARMADA_38X) += ddr/marvell/a38x/
 obj-$(CONFIG_ARMADA_XP) += ddr/marvell/axp/
-- 
2.32.0.93.g670b81a890-goog



[PATCH 03/17] Makefile: Move phy rules into drivers/phy

2021-07-10 Thread Simon Glass
These don't belong in the drivers Makefile so move them down into
the correct place.

Signed-off-by: Simon Glass 
---

 drivers/Makefile | 3 ---
 drivers/phy/Makefile | 4 
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/Makefile b/drivers/Makefile
index 3510daba29f..ebd07867290 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -93,9 +93,6 @@ obj-$(CONFIG_NVME) += nvme/
 obj-$(CONFIG_PCI_ENDPOINT) += pci_endpoint/
 obj-y += dfu/
 obj-$(CONFIG_PCH) += pch/
-obj-y += phy/allwinner/
-obj-y += phy/marvell/
-obj-y += phy/rockchip/
 obj-y += rtc/
 obj-y += scsi/
 obj-y += sound/
diff --git a/drivers/phy/Makefile b/drivers/phy/Makefile
index 3c4a673a83b..5cc3efcfe95 100644
--- a/drivers/phy/Makefile
+++ b/drivers/phy/Makefile
@@ -3,6 +3,10 @@
 # Copyright (C) 2017 Texas Instruments Incorporated - http://www.ti.com/
 # Written by Jean-Jacques Hiblot  
 
+obj-y += allwinner/
+obj-y += marvell/
+obj-y += rockchip/
+
 obj-$(CONFIG_$(SPL_)PHY) += phy-uclass.o
 obj-$(CONFIG_$(SPL_)NOP_PHY) += nop-phy.o
 obj-$(CONFIG_MIPI_DPHY_HELPERS) += phy-core-mipi-dphy.o
-- 
2.32.0.93.g670b81a890-goog



[PATCH 02/17] Makefile: Sort the subdirectories

2021-07-10 Thread Simon Glass
Adjust the subdirectories included in this file so that they are in
alphabetical order. This makes it easier to follow.

Signed-off-by: Simon Glass 
---

 Makefile | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index 0d3192cebad..60dbab1609e 100644
--- a/Makefile
+++ b/Makefile
@@ -795,9 +795,13 @@ c_flags := $(KBUILD_CFLAGS) $(cpp_flags)
 
 HAVE_VENDOR_COMMON_LIB = $(if $(wildcard 
$(srctree)/board/$(VENDOR)/common/Makefile),y,n)
 
-libs-y += lib/
+libs-$(CONFIG_API) += api/
 libs-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/
+libs-y += cmd/
+libs-y += common/
 libs-$(CONFIG_OF_EMBED) += dts/
+libs-y += env/
+libs-y += lib/
 libs-y += fs/
 libs-y += net/
 libs-y += disk/
@@ -834,10 +838,6 @@ libs-y += drivers/usb/musb/
 libs-y += drivers/usb/musb-new/
 libs-y += drivers/usb/phy/
 libs-y += drivers/usb/ulpi/
-libs-y += cmd/
-libs-y += common/
-libs-y += env/
-libs-$(CONFIG_API) += api/
 ifdef CONFIG_POST
 libs-y += post/
 endif
-- 
2.32.0.93.g670b81a890-goog



[PATCH 01/17] README: Fix hyphenation in the directory docs

2021-07-10 Thread Simon Glass
Hyphens are missing in various places where the intent is to create an
adjective. Fix it.

Signed-off-by: Simon Glass 
---

 README | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/README b/README
index 1472b40bc45..63ac8d3fcf6 100644
--- a/README
+++ b/README
@@ -128,7 +128,7 @@ Examples:
 Directory Hierarchy:
 
 
-/arch  Architecture specific files
+/arch  Architecture-specific files
   /arc Files generic to ARC architecture
   /arm Files generic to ARM architecture
   /m68kFiles generic to m68k architecture
@@ -142,16 +142,16 @@ Directory Hierarchy:
   /sh  Files generic to SH architecture
   /x86 Files generic to x86 architecture
   /xtensa  Files generic to Xtensa architecture
-/api   Machine/arch independent API for external apps
-/board Board dependent files
+/api   Machine/arch-independent API for external apps
+/board Board-dependent files
 /cmd   U-Boot commands functions
-/commonMisc architecture independent functions
+/commonMisc architecture-independent functions
 /configs   Board default configuration files
 /disk  Code for disk drive partition handling
-/doc   Documentation (don't expect too much)
-/drivers   Commonly used device drivers
-/dts   Contains Makefile for building internal U-Boot fdt.
-/env   Environment files
+/doc   Documentation (a mix of ReST and READMEs)
+/drivers   Device drivers
+/dts   Makefile for building internal U-Boot fdt.
+/env   Environment support
 /examples  Example code for standalone applications, etc.
 /fsFilesystem code (cramfs, ext2, jffs2, etc.)
 /include   Header Files
@@ -161,7 +161,7 @@ Directory Hierarchy:
 /post  Power On Self Test
 /scripts   Various build scripts and Makefiles
 /test  Various unit test files
-/tools Tools to build S-Record or U-Boot images, etc.
+/tools Tools to build and sign FIT images, etc.
 
 Software Configuration:
 ===
-- 
2.32.0.93.g670b81a890-goog



[PATCH 00/17] Makefile: Start simplifying Makefile rules (Part A)

2021-07-10 Thread Simon Glass
At present a few of the Makefiles have confusing layouts, with separate
sections for U-Boot proper and SPL/TPL. It is generally possible to have
a simple rule of the form:

   obj-$(CONFIG_$(SPL_TPL_)TIMER) += timer/

so that timer/ is built for the different U-Boot phases based on which of
CONFIG_TIMER, CONFIG_SPL_TIMER and CONFIG_SPL_TIMER are set.

Moving towards this requires rationalisation of the Kconfig options, such
as dropping the old _SUPPORT suffix sometimes applied to SPL options. It
is also easier if there is single Kconfig option which controls each
feature, at least each one that involves building a directory.

This series starts the process of tidying this up, renaming some SPL
options and updated I2C to suit.

Note: The $(SPL_TPL) option is going to become confusing when we also have
VPL (Verifying Program Loader). We may want to consider renaming it, e.g.
to $(PHASE).


Simon Glass (17):
  README: Fix hyphenation in the directory docs
  Makefile: Sort the subdirectories
  Makefile: Move phy rules into drivers/phy
  Rename SPL_POWER_SUPPORT to SPL_POWER
  Rename SPL_CRYPTO_SUPPORT to SPL_CRYPTO
  Rename SPL_ETH_SUPPORT to SPL_ETH
  Rename SPL_MUSB_NEW_SUPPORT to SPL_MUSB_NEW
  Rename SPL_WATCHDOG_SUPPORT to SPL_WATCHDOG
  Rename SPL_USB_HOST_SUPPORT to SPL_USB_HOST
  Rename GPIO_SUPPORT to GPIO
  Rename DRIVERS_MISC_SUPPORT to DRIVERS_MISC
  i2c: Rename CONFIG_SYS_I2C to CONFIG_SYS_I2C_LEGACY
  i2c: Fix the migration warning
  i2c: Drop unused CONFIG_I2C
  i2c: Create a new Kconfig for I2C
  i2c: Rename SPL/TPL_I2C_SUPPORT to I2C
  Makefile: Move drivers/i2c/ into drivers/Makefile

 Makefile  | 13 
 README| 25 ---
 arch/Kconfig  |  8 ++---
 arch/arm/Kconfig  |  6 ++--
 arch/arm/cpu/armv8/fsl-layerscape/soc.c   |  2 +-
 arch/arm/cpu/armv8/fsl-layerscape/spl.c   |  4 +--
 .../include/asm/arch-fsl-layerscape/config.h  |  2 +-
 arch/arm/mach-exynos/Kconfig  |  2 +-
 arch/arm/mach-imx/mx6/Kconfig |  6 ++--
 arch/arm/mach-kirkwood/include/mach/config.h  |  2 +-
 arch/arm/mach-mvebu/Kconfig   |  2 +-
 arch/arm/mach-omap2/Kconfig   | 18 +--
 arch/arm/mach-omap2/am33xx/Kconfig| 16 +-
 arch/arm/mach-omap2/am33xx/board.c|  2 +-
 arch/arm/mach-omap2/boot-common.c |  6 ++--
 arch/arm/mach-rockchip/Kconfig| 10 +++---
 arch/arm/mach-rockchip/rk3288/Kconfig |  2 +-
 arch/arm/mach-rockchip/rk3399/rk3399.c|  4 +--
 arch/arm/mach-stm32/Kconfig   |  4 +--
 arch/arm/mach-stm32mp/Kconfig |  6 ++--
 arch/arm/mach-sunxi/board.c   |  2 +-
 arch/arm/mach-tegra/Kconfig   |  2 +-
 arch/powerpc/cpu/mpc83xx/Kconfig  | 14 
 arch/riscv/cpu/fu740/Kconfig  |  2 +-
 board/Arcturus/ucp1020/spl.c  |  2 +-
 board/compulab/common/Makefile|  2 +-
 board/compulab/common/eeprom.h|  2 +-
 board/engicam/stm32mp1/spl.c  |  2 +-
 board/freescale/ls1021aqds/ls1021aqds.c   |  2 +-
 board/freescale/p1_p2_rdb_pc/spl.c|  2 +-
 board/phytec/phycore_rk3288/phycore-rk3288.c  |  2 +-
 board/renesas/draak/draak.c   |  2 +-
 board/renesas/salvator-x/salvator-x.c |  4 +--
 board/renesas/ulcb/ulcb.c |  2 +-
 board/siemens/draco/board.c   |  2 +-
 board/siemens/pxm2/board.c|  4 +--
 board/somlabs/visionsom-6ull/visionsom-6ull.c |  2 +-
 board/st/stm32mp1/spl.c   |  4 +--
 board/tcl/sl50/board.c|  6 ++--
 board/ti/am335x/board.c   |  4 +--
 board/tqc/tqma6/tqma6.c   |  4 +--
 board/vscom/baltos/board.c|  6 ++--
 cmd/Kconfig   |  2 +-
 cmd/date.c|  4 +--
 cmd/eeprom.c  |  2 +-
 cmd/i2c.c | 24 +++---
 common/Kconfig.boot   |  2 +-
 common/Makefile   |  2 +-
 common/board_f.c  |  4 +--
 common/spl/Kconfig| 32 +--
 common/spl/spl.c  |  2 +-
 common/spl/spl_net.c  |  4 +--
 common/stdio.c|  2 +-
 configs/A10-OLinuXino-Lime_defconfig  |  2 +-
 configs/A10s-OLinuXino-M_defconfig|  2 +-
 configs/A13-OLinuXino_defconfig   |  2 +-
 configs/A20-OLinuXino-Lime2-eMMC_defconfig|  2 +-
 configs/A20-OLinuXino-Lime2_defconfig |  2 +-
 configs/A20-OLinuXino-Lime_defconfig  |  2 +-
 

Re: Broken arc toolchain

2021-07-10 Thread Alexey Brodkin
Hi Tom and Simon,

So there're a couple of things involved indeed.

  1.  As Tom correctly mentioned we used to use SNSP pre-built tools for ARC in 
TravisCI previously. And frankly the reason was we needed something GCC 8.x 
based while on some other arches such a new GCC triggered extra problems, see 
https://lists.denx.de/pipermail/u-boot/2018-May/329577.html. So I updated ARC 
pre-built versions and we kept using it.
  2.  Now, that particular "mcpu" was never added into upstream GCC because we 
wanted to re-implement it a bit nicer, thus any up-to-date vanilla GCC won't 
accept it as opposed to tools built from SNPS' GCC port [which has it 
https://github.com/foss-for-synopsys-dwc-arc-processors/gcc/commit/84a3ee3844f9967a1b6c5923b9da4e6720c1d5bb].
  3.  IIRC "-mcpu=hs4x_rel31" is basically an umbrella option for some options 
combination based on generic "-mcpu=hs4x" so we may probably update HSDK-4xD 
flags to be buildable by vanialla GGC.

But anyways the simples short-term solution is to use our pre-built tools, 
latest of which are avaialble here 
https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/releases/tag/arc-2021.03-release.
 And for U-Boot elf32 version is what I would suggest to use, so please use 
https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/releases/download/arc-2021.03-release/arc_gnu_2021.03_prebuilt_elf32_le_linux_install.tar.gz.

Moreover since by default for ARC we use U-Boot built-in libgcc the same one 
little-endian toolchain might be safely used for building our big-endian 
configs equally well.

If more info or actions needed, please let me know.

-Alexey



From: Tom Rini
Sent: Saturday, July 10, 2021 11:22 PM
To: Simon Glass
Cc: U-Boot Mailing List; Alexey Brodkin; Eugeniy Paltsev
Subject: Re: Broken arc toolchain

On Sat, Jul 10, 2021 at 02:11:30PM -0600, Simon Glass wrote:

> Hi,
>
> I see this:
>
> $ buildman --fetch-arch arc
>
> Downloading toolchain for arch 'arc'
> Checking: https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/9.2.0/
> Downloading: 
> https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/9.2.0/x86_64-gcc-9.2.0-nolibc-arc-linux.tar.xz
>  Unpacking to: /home/sglass/.buildman-toolchains
> Testing
>   - looking in
> '/home/sglass/.buildman-toolchains/gcc-9.2.0-nolibc/arc-linux/.'
>   - looking in
> '/home/sglass/.buildman-toolchains/gcc-9.2.0-nolibc/arc-linux/bin'
>  - found
> '/home/sglass/.buildman-toolchains/gcc-9.2.0-nolibc/arc-linux/bin/arc-linux-gcc'
>   - looking in
> '/home/sglass/.buildman-toolchains/gcc-9.2.0-nolibc/arc-linux/usr/bin'
> Tool chain test:  OK, arch='arc', priority 5
>
> $ buildman -A hsdk_4xd
> /home/sglass/.buildman-toolchains/gcc-9.2.0-nolibc/arc-linux/bin/arc-linux-
> $ buildman hsdk_4xd
> ...
> arc-linux-gcc: error: unrecognized argument in option '-mcpu=hs4x_rel31
>
>
> Do you have any thoughts on what is wrong, please?

There's two parts.  The first part is I keep forgetting to update
buildman to fetch the latest toolchains from kernel.org, it should be
grabbing 11.1.0 now, not 9.2.0.  The second part is that arc, nds32 and
xtensa have non-standard toolchain locations, see
tools/docker/Dockerfile for where to fetch.

--
Tom


[PATCH v2 6/6] configs: synquacer: Enable UEFI secure boot

2021-07-10 Thread Masami Hiramatsu
Enable UEFI secure boot on synquacer. Note that unless user
setup their keys, the secure boot will not work.

Signed-off-by: Masami Hiramatsu 
---
 configs/synquacer_developerbox_defconfig |1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/synquacer_developerbox_defconfig 
b/configs/synquacer_developerbox_defconfig
index 208c939412..fba8fa2deb 100644
--- a/configs/synquacer_developerbox_defconfig
+++ b/configs/synquacer_developerbox_defconfig
@@ -115,6 +115,7 @@ CONFIG_EFI_CAPSULE_FIRMWARE=y
 CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y
 CONFIG_EFI_CAPSULE_FIRMWARE_FIT=y
 CONFIG_EFI_CAPSULE_FMP_HEADER=y
+CONFIG_EFI_SECURE_BOOT=y
 CONFIG_FLASH_CFI_MTD=y
 CONFIG_CMD_DFU=y
 CONFIG_DFU_TFTP=y



[PATCH v2 5/6] configs: synquacer: Drop Ext2/4 support by default

2021-07-10 Thread Masami Hiramatsu
Since the U-Boot for the SynQuacer DeveloperBox is designed for
compatible with EDK2 boot, we don't need to support Ext2/4 fs
support by default. Drop it.

Signed-off-by: Masami Hiramatsu 
---
 configs/synquacer_developerbox_defconfig |2 --
 1 file changed, 2 deletions(-)

diff --git a/configs/synquacer_developerbox_defconfig 
b/configs/synquacer_developerbox_defconfig
index bea13be874..208c939412 100644
--- a/configs/synquacer_developerbox_defconfig
+++ b/configs/synquacer_developerbox_defconfig
@@ -41,8 +41,6 @@ CONFIG_CMD_SATA=y
 CONFIG_CMD_NVME=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_FS_GENERIC=y
-CONFIG_CMD_EXT2=y
-CONFIG_CMD_EXT4=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_MTDPARTS=y
 CONFIG_CMD_LOG=y



[PATCH v2 4/6] configs: synquacer: Remove mtdparts settings and update DFU setting

2021-07-10 Thread Masami Hiramatsu
Since MTD partitions are based on the devicetree name,
remove unneeded mtdparts settings and update DFU setting.

Signed-off-by: Masami Hiramatsu 
---
 configs/synquacer_developerbox_defconfig |2 --
 include/configs/synquacer.h  |2 +-
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/configs/synquacer_developerbox_defconfig 
b/configs/synquacer_developerbox_defconfig
index fe30f0169f..bea13be874 100644
--- a/configs/synquacer_developerbox_defconfig
+++ b/configs/synquacer_developerbox_defconfig
@@ -45,8 +45,6 @@ CONFIG_CMD_EXT2=y
 CONFIG_CMD_EXT4=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_MTDPARTS=y
-CONFIG_MTDPARTS_DEFAULT="nor1:448k(BootStrap-BL1),576k(Flash-Writer),512k(SCP-BL2),480k(FIP-TFA),32k(Stg2-Tables),1m@2m(U-Boot),1m@3m(UBoot-Env),2m@5m(Ex-OPTEE)"
-CONFIG_MTDIDS_DEFAULT="nor1=nor1"
 CONFIG_CMD_LOG=y
 CONFIG_PARTITION_TYPE_GUID=y
 CONFIG_EFI_PARTITION=y
diff --git a/include/configs/synquacer.h b/include/configs/synquacer.h
index 8fe10d7485..4503cf3f6d 100644
--- a/include/configs/synquacer.h
+++ b/include/configs/synquacer.h
@@ -62,7 +62,7 @@
 /* #define CONFIG_SYS_PCI_64BIT1 */
 
 #define DEFAULT_DFU_ALT_INFO "dfu_alt_info="   \
-   "mtd nor1=u-boot.bin raw 20 10;"\
+   "mtd mx66u51235f=u-boot.bin raw 20 10;" \
"fip.bin raw 18 78000;" \
"optee.bin raw 50 10\0"
 



[PATCH v2 3/6] dts: synquacer: Add partition information to the spi-nor

2021-07-10 Thread Masami Hiramatsu
Add partition information to the spi-nor flash.
This is required for accessing NOR flash via mtdparts.

Signed-off-by: Masami Hiramatsu 
---
 Changes in v2:
  - Add new lines to separate the partitions.
---
 .../dts/synquacer-sc2a11-developerbox-u-boot.dtsi  |   49 
 1 file changed, 49 insertions(+)

diff --git a/arch/arm/dts/synquacer-sc2a11-developerbox-u-boot.dtsi 
b/arch/arm/dts/synquacer-sc2a11-developerbox-u-boot.dtsi
index 2f13a42235..7a56116d6f 100644
--- a/arch/arm/dts/synquacer-sc2a11-developerbox-u-boot.dtsi
+++ b/arch/arm/dts/synquacer-sc2a11-developerbox-u-boot.dtsi
@@ -31,6 +31,55 @@
spi-max-frequency = <3125>;
spi-rx-bus-width = <0x1>;
spi-tx-bus-width = <0x1>;
+
+   partitions {
+   compatible = "fixed-partitions";
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   partition@0 {
+   label = "BootStrap-BL1";
+   reg = <0x0 0x7>;
+   read-only;
+   };
+
+   partition@7 {
+   label = "Flash-Writer";
+   reg = <0x7 0x9>;
+   read-only;
+   };
+
+   partition@10 {
+   label = "SCP-BL2";
+   reg = <0x10 0x8>;
+   read-only;
+   };
+
+   partition@18 {
+   label = "FIP-TFA";
+   reg = <0x18 0x78000>;
+   };
+
+   partition@1f8000 {
+   label = "Stage2Tables";
+   reg = <0x1f8000 0x8000>;
+   };
+
+   partition@20 {
+   label = "U-Boot";
+   reg = <0x20 0x10>;
+   };
+
+   partition@30 {
+   label = "UBoot-Env";
+   reg = <0x30 0x10>;
+   };
+
+   partition@50 {
+   label = "Ex-OPTEE";
+   reg = <0x50 0x20>;
+   };
+   };
};
};
 



[PATCH v2 2/6] configs: synquacer: Make U-Boot binary position independent

2021-07-10 Thread Masami Hiramatsu
Make the U-Boot binary for SynQuacer position independent so
that the previous bootloader (SCP firmware or BL2) can load
the U-Boot anywhere.

Signed-off-by: Masami Hiramatsu 
---
 Changes in v2:
   - Fix a typo in the changelog.
---
 configs/synquacer_developerbox_defconfig |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/configs/synquacer_developerbox_defconfig 
b/configs/synquacer_developerbox_defconfig
index d42db9a1d6..fe30f0169f 100644
--- a/configs/synquacer_developerbox_defconfig
+++ b/configs/synquacer_developerbox_defconfig
@@ -1,11 +1,13 @@
 CONFIG_ARM=y
 CONFIG_ARCH_SYNQUACER=y
-CONFIG_SYS_TEXT_BASE=0x0820
+CONFIG_SYS_TEXT_BASE=0x
 CONFIG_ENV_SIZE=0x3
 CONFIG_ENV_OFFSET=0x30
 CONFIG_DEBUG_UART_BASE=0x2a40
 CONFIG_DEBUG_UART_CLOCK=6250
 CONFIG_ENV_SECT_SIZE=0x1
+CONFIG_POSITION_INDEPENDENT=y
+CONFIG_INIT_SP_RELATIVE=y
 CONFIG_DM_GPIO=y
 CONFIG_TARGET_DEVELOPERBOX=y
 CONFIG_DEFAULT_DEVICE_TREE="synquacer-sc2a11-developerbox"



[PATCH v2 1/6] board: synquacer: Initialize SCBM SMMU at board_init()

2021-07-10 Thread Masami Hiramatsu
Since the SCBM SMMU is not only connected to the NETSEC
but also shared with the F_SDH30 (eMMC controller), that
should be initialized at board level instead of NETSEC.

Move the SMMU initialization code into board support
and call it from board_init().

Without this fix, if the NETSEC is disabled, the Linux
eMMC ADMA cause an error because SMMU is not initialized.

Signed-off-by: Masami Hiramatsu 
---
 board/socionext/developerbox/developerbox.c |   15 +++
 drivers/net/sni_netsec.c|7 ---
 2 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/board/socionext/developerbox/developerbox.c 
b/board/socionext/developerbox/developerbox.c
index 34335baec3..9552bfcdc3 100644
--- a/board/socionext/developerbox/developerbox.c
+++ b/board/socionext/developerbox/developerbox.c
@@ -62,6 +62,19 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #define LOAD_OFFSET 0x100
 
+/* SCBM System MMU is used for eMMC and NETSEC */
+#define SCBM_SMMU_ADDR (0x52e0UL)
+#define SMMU_SCR0_OFFS (0x0)
+#define SMMU_SCR0_SHCFG_INNER  (0x2 << 22)
+#define SMMU_SCR0_MTCFG(0x1 << 20)
+#define SMMU_SCR0_MEMATTR_INNER_OUTER_WB   (0xf << 16)
+
+static void synquacer_setup_scbm_smmu(void)
+{
+   writel(SMMU_SCR0_SHCFG_INNER | SMMU_SCR0_MTCFG | 
SMMU_SCR0_MEMATTR_INNER_OUTER_WB,
+  SCBM_SMMU_ADDR + SMMU_SCR0_OFFS);
+}
+
 /*
  * Miscellaneous platform dependent initialisations
  */
@@ -71,6 +84,8 @@ int board_init(void)
 
gd->env_addr = (ulong)_environment[0];
 
+   synquacer_setup_scbm_smmu();
+
return 0;
 }
 
diff --git a/drivers/net/sni_netsec.c b/drivers/net/sni_netsec.c
index a9ebf6af9c..4901321d0c 100644
--- a/drivers/net/sni_netsec.c
+++ b/drivers/net/sni_netsec.c
@@ -1059,18 +1059,11 @@ static int netsec_of_to_plat(struct udevice *dev)
return 0;
 }
 
-#define SMMU_SCR0_SHCFG_INNER (0x2 << 22)
-#define SMMU_SCR0_MTCFG   (0x1 << 20)
-#define SMMU_SCR0_MEMATTR_INNER_OUTER_WB  (0xf << 16)
-
 static int netsec_probe(struct udevice *dev)
 {
struct netsec_priv *priv = dev_get_priv(dev);
int ret;
 
-   writel(SMMU_SCR0_SHCFG_INNER | SMMU_SCR0_MTCFG | 
SMMU_SCR0_MEMATTR_INNER_OUTER_WB,
-  (phys_addr_t)0x52E0);
-
netsec_reset_hardware(priv, true);
 
ret = netsec_mdiobus_init(priv, dev->name);



[PATCH v2 0/6] arm64: synquacer: DeveloperBox updates

2021-07-10 Thread Masami Hiramatsu
Hi,

Here is the 2nd version of the series to update the DeveloperBox support.
This version is just fixing coding style and typo. So no functional
changes.



[1/6] board: synquacer: Initialize SCBM SMMU at board_init()
   - This is a driver cleanup, split the SMMU setup from the driver.

[2/6] configs: synquacer: Make U-Boot binary position independent
  - This makes U-Boot position independent for usability.

[3/6] dts: synquacer: Add partition information to the spi-nor
[4/6] configs: synquacer: Remove mtdparts settings and update DFU setting
  - These are the fixes according to the MTD subsystem update.
(Thanks Marek!)

[5/6] configs: synquacer: Drop Ext2/4 support by default
[6/6] configs: synquacer: Enable UEFI secure boot
  - These are making U-Boot more likely to EDK2 behaviors.


Thank you,

---

Masami Hiramatsu (6):
  board: synquacer: Initialize SCBM SMMU at board_init()
  configs: synquacer: Make U-Boot binary position independent
  dts: synquacer: Add partition information to the spi-nor
  configs: synquacer: Remove mtdparts settings and update DFU setting
  configs: synquacer: Drop Ext2/4 support by default
  configs: synquacer: Enable UEFI secure boot


 .../dts/synquacer-sc2a11-developerbox-u-boot.dtsi  |   49 
 board/socionext/developerbox/developerbox.c|   15 ++
 configs/synquacer_developerbox_defconfig   |9 ++--
 drivers/net/sni_netsec.c   |7 ---
 include/configs/synquacer.h|2 -
 5 files changed, 69 insertions(+), 13 deletions(-)

--
Masami Hiramatsu 


Re: RFC: Devices for files and partitions

2021-07-10 Thread Simon Glass
Hi,

On Thu, 8 Jul 2021 at 23:33, Heinrich Schuchardt  wrote:
>
> On 7/9/21 4:44 AM, AKASHI Takahiro wrote:
> > On Tue, Jul 06, 2021 at 05:05:19PM -0600, Simon Glass wrote:
> >> Hi,
> >>
> >> At present U-Boot avoids the concept of 'opening' a file. Being in a
> >> bootloader environment, it is normally better to take the action
> >> immediately and avoid any caching, for example, since there is no
> >> background task to clean up afterwards.
> >>
> >> Having said that, the concept of a file is quite useful, for example
> >> to write the output of a command to a file, or to open a file and read
> >> it a line at a time.
> >>
> >> Another case has come to light in that EFI wants to access files using
> >> a file handle. This currently uses parallel data structures and does
> >> not map very well in U-Boot.
>
> Not having a file descriptor slows down file operation because for each
> individual access to a file we
>
> * read the partition table
> * look up the file in the directory structure
>
> If you only use the 'load' command, this does not matter because there
> is only a single read. But in the UEFI sub-system we use multiple API calls:
>
> * open the volume
> * open the file
> * read the file size (for buffer allocation)
> * read the file
>
> The file descriptors in the UEFI sub-system only hold device, partition
> ID, file path.

Arguably that is a potential benefit, dependent on us implementing
(write-through?) caching of this info.

>
> >>
> >> Finally, partitions has a similar issue, where defining them as a
> >> device can have benefits, e.g. to specify the device to use directly,
> >> rather than with the 'type dev:part' approach, perhaps providing them
> >> in the devicetree, etc.
> >>
> >> For the above reasons, I propose that we implement, as an option,
> >> support for files and partitions within driver model.
>
> With partitions as devices we will have to read the partition table only
> once when the block device is probed. - For the UEFI sub-system we need
> all block devices to be probed before calling the UEFI binary (e.g. GRUB).

It would be better if UEFI could support lazy probing, but that's
off-topic here.

>
> >
> > +1
> >
> > # Nobody has commented yet :)

Thank you for commenting.

> >
> > Regarding a "file (or file descriptor)", we have already implemented
> > the same concept in efi_loader. So technically, it won't be a hard-work.
> > Regarding "partitions as udevice," I have posted an experimental
> > patch [1]. So it must also be feasible.
>
> Our UEFI file descriptor is not helpful because it does not buffer the
> relevant data to speed up file access. E.g. for the FAT driver a file
> descriptor could buffer some information from the directory entry (file
> attributes, dates) and some from the FAT table (assigned extends).
>
> >
> > One of my concerns is what benefit end users may enjoy.
>
> Improved performance.

With a bit of effort, yes, with UEFI at least, by the sound of it.

I'm not sure how much difference it would make for non-EFI use though.

To me this is an internal thing, a bit like driver model, where the
benefit is easier development and scripting, which might benefit end
users indirectly through faster time-to-market and fewer bugs?

Takahiro, since you have already started this work, do you want to
continue it? I think the original patch needed a test.

>
> Best regards
>
> Heinrich
>
> >
> > -Takahiro Akashi
> >
> > [1] https://lists.denx.de/pipermail/u-boot/2019-February/357937.html
> >  https://lists.denx.de/pipermail/u-boot/2019-February/357934.html
> >
> >> Regards,
> >> Simon

Regards,
Simon

>


Re: [PATCH 0/5] stm32mp1: handle TF-A boot with FIP

2021-07-10 Thread Simon Glass
Hi Patrick,

On Thu, 8 Jul 2021 at 03:17, Patrick Delaunay
 wrote:
>
>
> In next TF-A version the stm32mp1 platform will support the Firmware
> Image Package (FIP) [1], a container filled with:
> - the U-Boot binary = u-boot-nodtb.bin
> - the U-Boot device tree = u-boot.dtb
> - the Secure OS (OP-TEE) or the secure monitor (SP_MIN)

That sounds like a job for FIT?

>
> Upstream is in progress on TF-A side.
>
> Each part of the FIP is loaded by TF-A BL2 and U-Boot
> is executed with its device tree address as parameter (nt_fw_dtb = r2
> introduced by commit 4ac345220afa ("board: stm32mp1: use FDT address
> provided by TF-A at boot time")
>
> This FIP container simplifies the OP-TEE management (same number of partition
> with or without OP-TEE, OP-TEE dynamically updates the U-Boot device tree
> to add the required OP-TEE nodes) and allow support of generic TF-A
> features as PKI [2].
>
> This serie allows to generate U-Boot configured for the TF-A BL2 image
> types:
> - STM32IMAGE: stm32mp15_trusted_defconfig (current behavior)
> - FIP: stm32mp15_defconfig (NEW)
>
> The FIP will be the STMicroelectronics recommended image type for
> STM32MP15x and the STM32IMAGE support should be marked deprecated in a
> future TF-A release or even removed.
>
> To prepare this migration, the serie move all the specific code or
> device tree nodes for TF-A load of STM32IMAGE under compilation
> flag CONFIG_STM32MP15x_STM32IMAGE.
>
> [1] 4.11. Firmware Image Package (FIP)
> fiphttps://trustedfirmware-a.readthedocs.io/en/latest/design/firmware-design.html
>
> [2] Authentication Framework & Chain of Trust
> https://trustedfirmware-a.readthedocs.io/en/latest/design/auth-framework.html
>
>


Regards,
Simon


Re: [PATCH 1/5] efi_loader: increase eventlog buffer size

2021-07-10 Thread Simon Glass
Hi Masahisa,

On Wed, 7 Jul 2021 at 20:21, Masahisa Kojima  wrote:
>
> On Wed, 7 Jul 2021 at 22:47, Heinrich Schuchardt  wrote:
> >
> >
> >
> > On 7/7/21 3:36 PM, Masahisa Kojima wrote:
> > > This is a preperation to add eventlog support
> > > described in TCG PC Client PFP spec.
> > >
> > > Signed-off-by: Masahisa Kojima 
> > > ---
> > >   lib/efi_loader/Kconfig | 2 +-
> > >   1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig
> > > index b2ab48a048..a87bf3cc98 100644
> > > --- a/lib/efi_loader/Kconfig
> > > +++ b/lib/efi_loader/Kconfig
> > > @@ -327,7 +327,7 @@ config EFI_TCG2_PROTOCOL
> > >   config EFI_TCG2_PROTOCOL_EVENTLOG_SIZE
> > >   int "EFI_TCG2_PROTOCOL EventLog size"
> > >   depends on EFI_TCG2_PROTOCOL
> > > - default 4096
> > > + default 16384
> >
> > I found this text in EDK II:
> >
> > Minimum length(in bytes) of the system preboot TCG event log area(LAML)
> > ---
> >
> > For PC Client Implementation spec up to and including 1.2 the minimum
> > log size is 64KB. (SecurityPkg/SecurityPkg.dec)
>
> Thank you for your feedback.
> I have not checked this.
> TCG spec also says "The Log Area Minimum Length for the TCG event log
> MUST be at least 64KB." in ACPI chapter.
> I will update to set 64KB as default.
>

Is this the same as the BLOBLISTT_TPM2_TCG_LOG thing? If so, can we
put this in the bloblist? We want to avoid adding code in EFI which is
in U-Boot.


- Simon

> Thanks,
> Masahisa Kojima
>
> >
> > Why should ours be smaller?
> >
> > Best regards
> >
> > Heinrich
> >
> > >   help
> > >   Define the size of the EventLog for EFI_TCG2_PROTOCOL. Note 
> > > that
> > >   this is going to be allocated twice. One for the eventlog 
> > > it self
> > >


Re: [PATCH] gpio: mcp230xx: Introduce new driver

2021-07-10 Thread Simon Glass
Hi Sebastian,

On Tue, 6 Jul 2021 at 10:34, Sebastian Reichel
 wrote:
>
> Introduce driver for I2C based MCP230xx GPIO chips, which are
> quite common and already well supported by the Linux kernel.
>
> Signed-off-by: Sebastian Reichel 
> ---
>  drivers/gpio/Kconfig |  10 ++
>  drivers/gpio/Makefile|   1 +
>  drivers/gpio/mcp230xx_gpio.c | 235 +++
>  3 files changed, 246 insertions(+)
>  create mode 100644 drivers/gpio/mcp230xx_gpio.c

Reviewed-by: Simon Glass 

a few nits below

>
> diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
> index de4dc51d4b48..f93e736639bb 100644
> --- a/drivers/gpio/Kconfig
> +++ b/drivers/gpio/Kconfig
> @@ -179,6 +179,16 @@ config LPC32XX_GPIO
> help
>   Support for the LPC32XX GPIO driver.
>
> +config MCP230XX_GPIO
> +   bool "MCP230XX GPIO driver"
> +   depends on DM
> +   help
> + Support for Microchip's MCP230XX I2C connected GPIO devices.
> + The following chips are supported:
> +  - MCP23008
> +  - MCP23017
> +  - MCP23018
> +
>  config MSCC_SGPIO
> bool "Microsemi Serial GPIO driver"
> depends on DM_GPIO && SOC_VCOREIII
> diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile
> index 8541ba0b0aec..00ffcc753534 100644
> --- a/drivers/gpio/Makefile
> +++ b/drivers/gpio/Makefile
> @@ -24,6 +24,7 @@ obj-$(CONFIG_KIRKWOOD_GPIO)   += kw_gpio.o
>  obj-$(CONFIG_KONA_GPIO)+= kona_gpio.o
>  obj-$(CONFIG_MARVELL_GPIO) += mvgpio.o
>  obj-$(CONFIG_MARVELL_MFP)  += mvmfp.o
> +obj-$(CONFIG_MCP230XX_GPIO)+= mcp230xx_gpio.o
>  obj-$(CONFIG_MXC_GPIO) += mxc_gpio.o
>  obj-$(CONFIG_MXS_GPIO) += mxs_gpio.o
>  obj-$(CONFIG_PCA953X)  += pca953x.o
> diff --git a/drivers/gpio/mcp230xx_gpio.c b/drivers/gpio/mcp230xx_gpio.c
> new file mode 100644
> index ..44def86ca7d9
> --- /dev/null
> +++ b/drivers/gpio/mcp230xx_gpio.c
> @@ -0,0 +1,235 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +/*
> + * Copyright (C) 2021, Collabora Ltd.
> + * Copyright (C) 2021, General Electric Company
> + * Author(s): Sebastian Reichel 
> + */
> +
> +#define LOG_CATEGORY UCLASS_GPIO
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +enum mcp230xx_type {
> +   UNKNOWN = 0,
> +   MCP23008,
> +   MCP23017,
> +   MCP23018,
> +};
> +
> +#define MCP230XX_IODIR 0x00
> +#define MCP230XX_GPPU 0x06
> +#define MCP230XX_GPIO 0x09
> +#define MCP230XX_OLAT 0x0a
> +
> +#define BANKSIZE 8
> +
> +static int mcp230xx_read(struct udevice *dev, uint reg, uint offset)
> +{
> +   struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev);
> +   int bank = offset / BANKSIZE;
> +   int mask = 1 << (offset % BANKSIZE);
> +   int shift = (uc_priv->gpio_count / BANKSIZE) - 1;
> +   int ret;
> +
> +   ret = dm_i2c_reg_read(dev, (reg << shift) + bank);
> +   if (ret < 0)
> +   return ret;

blank line before final return

> +   return !!(ret & mask);
> +}
> +
> +static int mcp230xx_write(struct udevice *dev, uint reg, uint offset, bool 
> val)
> +{
> +   struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev);
> +   int bank = offset / BANKSIZE;
> +   int mask = 1 << (offset % BANKSIZE);
> +   int shift = (uc_priv->gpio_count / BANKSIZE) - 1;
> +   int regval;
> +
> +   regval = dm_i2c_reg_read(dev, (reg << shift) + bank);

Can I suggest adding something like

int i2c_reg_clrset(struct udevice *dev, uint offset, u32 clr, u32 set)

which would be useful in this situation. If you do that, add a test in
test/dm/i2c.c

> +   if (regval  < 0)
> +   return regval;
> +
> +   regval &= ~mask;
> +   if (val)
> +   regval |= mask;
> +
> +   return dm_i2c_reg_write(dev, (reg << shift) + bank, regval);

To my eye this would be better as

   reg << shift | bank

because + indicates addition. I suspect it is actually ORing in the addres?

> +}
> +
> +static int mcp230xx_get_value(struct udevice *dev, uint offset)
> +{
> +   int ret;
> +
> +   ret = mcp230xx_read(dev, MCP230XX_GPIO, offset);
> +   if (ret < 0) {
> +   dev_err(dev, "%s error: %d\n", __func__, ret);
> +   return ret;
> +   }
> +
> +   return ret;
> +}
> +
> +static int mcp230xx_set_value(struct udevice *dev, uint offset, int val)
> +{
> +   int ret;
> +
> +   ret = mcp230xx_write(dev, MCP230XX_GPIO, offset, val);
> +   if (ret < 0) {
> +   dev_err(dev, "%s error: %d\n", __func__, ret);
> +   return ret;
> +   }
> +
> +   return ret;
> +}
> +
> +static int mcp230xx_get_flags(struct udevice *dev, unsigned int offset,
> + ulong *flags)
> +{
> +   int direction, pullup;
> +
> +   pullup = mcp230xx_read(dev, MCP230XX_GPPU, offset);
> +   if (pullup < 0) {
> +   dev_err(dev, "%s error: %d\n", __func__, pullup);

Re: [PATCH 2/2] tpm2: Add a TPMv2 MMIO TIS driver

2021-07-10 Thread Simon Glass
Hi Ilias,

On Wed, 7 Jul 2021 at 10:26, Ilias Apalodimas
 wrote:
>
> Add support for devices that expose a TPMv2 though MMIO.
> Apart from those devices, we can use the driver in our QEMU setups and
> test TPM related code which is difficult to achieve using the sandbox
> driver (e.g test the EFI TCG2 protocol).
>
> It's worth noting that a previous patch added TPMv2 TIS core functions,
> which the current driver is consuming.
>
> Signed-off-by: Ilias Apalodimas 
> ---
> Changes since v1:
> - split off the tis core code into a different file
>  drivers/tpm/Kconfig |   9 +++
>  drivers/tpm/Makefile|   1 +
>  drivers/tpm/tpm2_tis_mmio.c | 156 
>  3 files changed, 166 insertions(+)
>  create mode 100644 drivers/tpm/tpm2_tis_mmio.c

Looks good to me

>
> diff --git a/drivers/tpm/Kconfig b/drivers/tpm/Kconfig
> index 9eebab5cfd90..406ee8716e1e 100644
> --- a/drivers/tpm/Kconfig
> +++ b/drivers/tpm/Kconfig
> @@ -161,6 +161,15 @@ config TPM2_FTPM_TEE
> help
>   This driver supports firmware TPM running in TEE.
>
> +config TPM2_MMIO
> +   bool "MMIO based TPM2 Interface"
> +   depends on TPM_V2
> +   help
> + This driver supports firmware TPM2.0 MMIO interface.
> + The usual TPM operations and the 'tpm' command can be used to talk
> + to the device using the standard TPM Interface Specification (TIS)
> + protocol.
> +
>  endif # TPM_V2
>
>  endmenu
> diff --git a/drivers/tpm/Makefile b/drivers/tpm/Makefile
> index f64d20067f88..1065c1874f58 100644
> --- a/drivers/tpm/Makefile
> +++ b/drivers/tpm/Makefile
> @@ -14,3 +14,4 @@ obj-$(CONFIG_$(SPL_TPL_)TPM2_CR50_I2C) += cr50_i2c.o
>  obj-$(CONFIG_TPM2_TIS_SANDBOX) += tpm2_tis_sandbox.o
>  obj-$(CONFIG_TPM2_TIS_SPI) += tpm2_tis_spi.o
>  obj-$(CONFIG_TPM2_FTPM_TEE) += tpm2_ftpm_tee.o
> +obj-$(CONFIG_TPM2_MMIO) += tpm2_tis_core.o tpm2_tis_mmio.o
> diff --git a/drivers/tpm/tpm2_tis_mmio.c b/drivers/tpm/tpm2_tis_mmio.c
> new file mode 100644
> index ..2183a2807162
> --- /dev/null
> +++ b/drivers/tpm/tpm2_tis_mmio.c
> @@ -0,0 +1,156 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * driver for mmio TCG/TIS TPM (trusted platform module).
> + *
> + * Specifications at www.trustedcomputinggroup.org
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include "tpm_tis.h"
> +#include "tpm_internal.h"
> +
> +struct tpm_tis_chip_data {
> +   unsigned int pcr_count;
> +   unsigned int pcr_select_min;
> +   unsigned int time_before_first_cmd_ms;
> +   void __iomem *iobase;
> +};

comments

> +
> +static int mmio_read_bytes(struct udevice *udev, u32 addr, u16 len,
> +  u8 *result)
> +{
> +   struct tpm_tis_chip_data *drv_data = (void 
> *)dev_get_driver_data(udev);
> +
> +   while (len--)
> +   *result++ = ioread8(drv_data->iobase + addr);

We normally put a blank line before the final return

> +   return 0;
> +}
> +
> +static int mmio_write_bytes(struct udevice *udev, u32 addr, u16 len,
> +   const u8 *value)
> +{
> +   struct tpm_tis_chip_data *drv_data = (void 
> *)dev_get_driver_data(udev);
> +
> +   while (len--)
> +   iowrite8(*value++, drv_data->iobase + addr);
> +   return 0;
> +}
> +
> +static int mmio_read16(struct udevice *udev, u32 addr, u16 *result)
> +{
> +   struct tpm_tis_chip_data *drv_data = (void 
> *)dev_get_driver_data(udev);
> +
> +   *result = ioread16(drv_data->iobase + addr);
> +   return 0;
> +}
> +
> +static int mmio_read32(struct udevice *udev, u32 addr, u32 *result)
> +{
> +   struct tpm_tis_chip_data *drv_data = (void 
> *)dev_get_driver_data(udev);
> +
> +   *result = ioread32(drv_data->iobase + addr);
> +   return 0;
> +}
> +
> +static int mmio_write32(struct udevice *udev, u32 addr, u32 value)
> +{
> +   struct tpm_tis_chip_data *drv_data = (void 
> *)dev_get_driver_data(udev);
> +
> +   iowrite32(value, drv_data->iobase + addr);
> +   return 0;
> +}
> +
> +static struct tpm_tis_phy_ops phy_ops = {

Should be a uclass interface.

> +   .read_bytes = mmio_read_bytes,
> +   .write_bytes = mmio_write_bytes,
> +   .read16 = mmio_read16,
> +   .read32 = mmio_read32,
> +   .write32 = mmio_write32,
> +};
> +
> +static int tpm_tis_probe(struct udevice *udev)
> +{
> +   struct tpm_tis_chip_data *drv_data = (void 
> *)dev_get_driver_data(udev);
> +   struct tpm_chip_priv *priv = dev_get_uclass_priv(udev);
> +   int ret = 0;
> +   fdt_addr_t ioaddr;
> +   u64 sz;
> +
> +   ioaddr = dev_read_addr(udev);
> +   if (ioaddr == FDT_ADDR_T_NONE)
> +   return -EINVAL;

consider this for easier debugging:

   return log_msg_ret("ioaddr", -EINVAL);

> +
> +   ret = dev_read_u64(udev, "reg", );
> +   if (ret)
> +   

Re: [PATCH 1/2 v2] tpm2: Introduce TIS tpm core

2021-07-10 Thread Simon Glass
Hi Ilias,

On Wed, 7 Jul 2021 at 10:26, Ilias Apalodimas
 wrote:
>
> There's a lot of code duplication in U-Boot right now.  All the TPM TIS

You mean in the TPM code I think.

> compatible drivers we have at the moment have their own copy of a TIS
> implementation.
>
> So let's create a common layer which implements the core TIS functions.
> Any driver added from now own, which is compatible with the TIS spec, will
> only have to provide the underlying bus communication mechanisms.
>
> Signed-off-by: Ilias Apalodimas 
> ---
> Changes since v1:
> -
>  drivers/tpm/tpm2_tis_core.c | 545 
>  drivers/tpm/tpm_tis.h   |  40 +++
>  include/tpm-v2.h|   1 +
>  3 files changed, 586 insertions(+)
>  create mode 100644 drivers/tpm/tpm2_tis_core.c

[..]

> diff --git a/drivers/tpm/tpm_tis.h b/drivers/tpm/tpm_tis.h
> index 2a160fe05c9a..fde3bb71f7c2 100644
> --- a/drivers/tpm/tpm_tis.h
> +++ b/drivers/tpm/tpm_tis.h
> @@ -21,6 +21,37 @@
>  #include 
>  #include 
>
> +struct tpm_tis_phy_ops {
> +   int (*read_bytes)(struct udevice *udev, u32 addr, u16 len,
> + u8 *result);
> +   int (*write_bytes)(struct udevice *udev, u32 addr, u16 len,
> +  const u8 *value);
> +   int (*read16)(struct udevice *udev, u32 addr, u16 *result);
> +   int (*read32)(struct udevice *udev, u32 addr, u32 *result);
> +   int (*write32)(struct udevice *udev, u32 addr, u32 src);

A few points:

- these need comments
- can we use uint instead of u32 for the value args? We should use
native types where we can
- it seems like this should be a driver interface - see for example
how cros_ec.c works. It has a shared code library and the drivers each
implement an interface similar to the above, but on different buses.
In general function pointers are a sign we should be using a driver

> +};
> +
> +enum tis_int_flags {
> +   TPM_GLOBAL_INT_ENABLE = 0x8000,
> +   TPM_INTF_BURST_COUNT_STATIC = 0x100,
> +   TPM_INTF_CMD_READY_INT = 0x080,
> +   TPM_INTF_INT_EDGE_FALLING = 0x040,
> +   TPM_INTF_INT_EDGE_RISING = 0x020,
> +   TPM_INTF_INT_LEVEL_LOW = 0x010,
> +   TPM_INTF_INT_LEVEL_HIGH = 0x008,
> +   TPM_INTF_LOCALITY_CHANGE_INT = 0x004,
> +   TPM_INTF_STS_VALID_INT = 0x002,
> +   TPM_INTF_DATA_AVAIL_INT = 0x001,
> +};
> +
> +#define TPM_ACCESS(l)   (0x | ((l) << 12))
> +#define TPM_INT_ENABLE(l)   (0x0008 | ((l) << 12))
> +#define TPM_STS(l)  (0x0018 | ((l) << 12))
> +#define TPM_DATA_FIFO(l)(0x0024 | ((l) << 12))
> +#define TPM_DID_VID(l)  (0x0F00 | ((l) << 12))
> +#define TPM_RID(l)  (0x0F04 | ((l) << 12))
> +#define TPM_INTF_CAPS(l)(0x0014 | ((l) << 12))
> +
>  enum tpm_timeout {
> TPM_TIMEOUT_MS  = 5,
> TIS_SHORT_TIMEOUT_MS= 750,
> @@ -43,6 +74,7 @@ struct tpm_chip {
> u8 rid;
> unsigned long timeout_a, timeout_b, timeout_c, timeout_d;  /* msec */
> ulong chip_type;
> +   struct tpm_tis_phy_ops *phy_ops;
>  };
>
>  struct tpm_input_header {
> @@ -130,4 +162,12 @@ enum tis_status {
>  };
>  #endif
>
> +int tpm_tis_open(struct udevice *udev);
> +int tpm_tis_close(struct udevice *udev);
> +int tpm_tis_cleanup(struct udevice *udev);
> +int tpm_tis_send(struct udevice *udev, const u8 *buf, size_t len);
> +int tpm_tis_recv(struct udevice *udev, u8 *buf, size_t count);
> +int tpm_tis_get_desc(struct udevice *udev, char *buf, int size);
> +int tpm_tis_init(struct udevice *udev);
> +void tpm_tis_ops_register(struct udevice *udev, struct tpm_tis_phy_ops *ops);

comments on all of these

>  #endif
> diff --git a/include/tpm-v2.h b/include/tpm-v2.h
> index 247b38696766..3e48e358613f 100644
> --- a/include/tpm-v2.h
> +++ b/include/tpm-v2.h
> @@ -378,6 +378,7 @@ enum {
> TPM_STS_DATA_EXPECT = 1 << 3,
> TPM_STS_SELF_TEST_DONE  = 1 << 2,
> TPM_STS_RESPONSE_RETRY  = 1 << 1,
> +   TPM_STS_READ_ZERO   = 0x23

Does this below in another patch?

>  };
>
>  enum {
> --
> 2.32.0.rc0
>

I feel that this API could be useful in reducing code duplication, but
in fact it has just created more, so far as I can see from this series
:-) So I think you should convert at least one driver to show its
value (and not make things any worse).

Regards,
Simon


Re: [PATCH 5/6] MIPS: malta: add support for PCI driver model

2021-07-10 Thread Simon Glass
() Hi Daniel,

On Tue, 6 Jul 2021 at 08:22, Daniel Schwierzeck
 wrote:
>
> As almost all peripherals are connected via PCI dependent on the
> used core card, PCI setup is always required. Thus run pci_init()
> including PCI scanning and probing and core card specific setups
> in board_early_init_r().
>
> Also prepare support for dynamically managing the status of the
> different PCI DT nodes dependent on used core card via option
> CONFIG_OF_BOARD_FIXUP. Before this feature can be enabled,
> the call order of the fix_fdt() init hook in board_init_f
> needs to be changed. Otherwise rw_fdt_blob points to a read-only
> NOR flash address. Thus this options needs to stay disabled
> until the board_init_f problem could be solved. This breaks
> running the default U-Boot image on real HW using the FPGA core
> card but Qemu emulation still works. Currently Qemu is more
> important as MIPS CI tests depend on Malta and the deadline
> for PCI DM conversion will be enforced soon.
>
> Signed-off-by: Daniel Schwierzeck 
> ---
>
>  board/imgtec/malta/malta.c | 84 +-
>  1 file changed, 83 insertions(+), 1 deletion(-)
>
> diff --git a/board/imgtec/malta/malta.c b/board/imgtec/malta/malta.c
> index c04f727961..e78d5a7fbc 100644
> --- a/board/imgtec/malta/malta.c
> +++ b/board/imgtec/malta/malta.c
> @@ -4,7 +4,8 @@
>   * Copyright (C) 2013 Imagination Technologies
>   */
>
> -#include 
> +#include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -24,6 +25,9 @@
>
>  DECLARE_GLOBAL_DATA_PTR;
>
> +#define MALTA_GT_PATH   "/pci0@1be0"
> +#define MALTA_MSC_PATH  "/pci0@1bd0"
> +
>  enum core_card {
> CORE_UNKNOWN,
> CORE_LV,
> @@ -120,10 +124,12 @@ int checkboard(void)
> return 0;
>  }
>
> +#if !IS_ENABLED(CONFIG_DM_ETH)
>  int board_eth_init(struct bd_info *bis)
>  {
> return pci_eth_init(bis);
>  }
> +#endif
>
>  void _machine_restart(void)
>  {
> @@ -167,6 +173,81 @@ int misc_init_r(void)
> return 0;
>  }
>
> +#if IS_ENABLED(CONFIG_OF_BOARD_FIXUP)
> +/*
> + * TODO: currently doesn't work because rw_fdt_blob points to a
> + * NOR flash address. This needs some changes in board_init_f.
> + */
> +int board_fix_fdt(void *rw_fdt_blob)
> +{
> +   int node = -1;
> +
> +   switch (malta_sys_con()) {
> +   case SYSCON_GT64120:
> +   node =  fdt_path_offset(rw_fdt_blob, MALTA_GT_PATH);
> +   break;
> +   default:
> +   case SYSCON_MSC01:
> +   node =  fdt_path_offset(rw_fdt_blob,
);
> +   break;
> +   }
> +
> +   return fdt_status_okay(rw_fdt_blob, node);
> +}
> +#endif
> +
> +#if IS_ENABLED(CONFIG_DM_PCI)
> +int board_early_init_r(void)
> +{
> +   struct udevice *dev;
> +   u32 val32;
> +   u8 val8;
> +   int ret;
> +
> +   pci_init();
> +
> +   ret = dm_pci_find_device(PCI_VENDOR_ID_INTEL,
> +PCI_DEVICE_ID_INTEL_82371AB_0, 0, );

This feels a bit wonky to me. How about a sysinfo driver for your
board which does this init? Then you could just probe it.

As to finding PCI devices, your sysinfo driver could have a few
phandle properties to point to the two devices you need.

But if these are really SYSCON devices, why not use the SYSCON
devices, give them a unique ID (perhaps you already have with
SYSCON_MSC01) and then call syscon_get_regmap_by_driver_data() ?


> +   if (ret)
> +   panic("Failed to find PIIX4 PCI bridge\n");
> +
> +   /* setup PCI interrupt routing */
> +   dm_pci_write_config8(dev, PCI_CFG_PIIX4_PIRQRCA, 10);
> +   dm_pci_write_config8(dev, PCI_CFG_PIIX4_PIRQRCB, 10);
> +   dm_pci_write_config8(dev, PCI_CFG_PIIX4_PIRQRCC, 11);
> +   dm_pci_write_config8(dev, PCI_CFG_PIIX4_PIRQRCD, 11);

This feels like it should be in DT.

I don't know if this is at all similar to x86, but see
create_pirq_routing_table()  and intel,irq-router.txt for some ideas.

> +
> +   /* mux SERIRQ onto SERIRQ pin */
> +   dm_pci_read_config32(dev, PCI_CFG_PIIX4_GENCFG, );
> +   val32 |= PCI_CFG_PIIX4_GENCFG_SERIRQ;
> +   dm_pci_write_config32(dev, PCI_CFG_PIIX4_GENCFG, val32);
> +

dm_pci_clrset_config32() can do these three in one line, similar below.


> +   /* enable SERIRQ - Linux currently depends upon this */
> +   dm_pci_read_config8(dev, PCI_CFG_PIIX4_SERIRQC, );
> +   val8 |= PCI_CFG_PIIX4_SERIRQC_EN | PCI_CFG_PIIX4_SERIRQC_CONT;
> +   dm_pci_write_config8(dev, PCI_CFG_PIIX4_SERIRQC, val8);
> +
> +   ret = dm_pci_find_device(PCI_VENDOR_ID_INTEL,
> +PCI_DEVICE_ID_INTEL_82371AB, 0, );
> +   if (ret)
> +   panic("Failed to find PIIX4 IDE controller\n");
> +
> +   /* enable bus master & IO access */
> +   val32 |= PCI_COMMAND_MASTER | PCI_COMMAND_IO;
> +   dm_pci_write_config32(dev, PCI_COMMAND, val32);
> +
> +   /* set latency */
> +   dm_pci_write_config8(dev, PCI_LATENCY_TIMER, 

Re: [PATCH] sunxi: Load sun8i secure monitor to SRAM A2

2021-07-10 Thread Andre Przywara
On Sun, 18 Apr 2021 22:21:41 -0500
Samuel Holland  wrote:

Hi Samuel,

> Most sun6i-derived SoCs contain SRAM A2, a secure SRAM area for ARISC
> SCP firmware. H3 has a smaller SRAM than other SoCs (A31/A33/A23/A83T).
> 
> On sun8i SoCs which do not have SRAM B, we can use part of this SRAM for
> the secure monitor. Follow the design of 64-bit SoCs and use the first
> part for the monitor, and the last 16 KiB for the SCP firmware. With
> this change, the monitor no longer needs to reserve a region in DRAM.

So this commit message reads a bit more innocent than the patch is, can
you amend this? It took me a while to see what it really does ...

For a start, I'd suggest to rename the subject to "Move secure
monitor...".
And it's good to explain where we come from (SRAM B vs. SRAM A2), but I
would like to see an explicit list of SoCs that get changed, because
all those different sun8i.h, cpu_sun4i.h and CONFIG_SUN8I parts are
super confusing to the casual reader.

Maybe something along the lines of:
So far for the H3, A23, and A33 SoCs, we use DRAM to hold the secure
monitor. And while those SoCs do not have the secure SRAM B like older
SoCs, there is enough (secure) SRAM A2 to put the monitor code and data
in there instead 

Regardless of that, the patch is nice, I always disliked reserving a
small piece of DRAM somewhere in the middle of it.
If I see this correctly, this just leaves the R40 using DRAM for the
secure monitor (with V3s and A83T not using PSCI)?

Cheers,
Andre

> 
> Signed-off-by: Samuel Holland 
> ---
>  arch/arm/include/asm/arch-sunxi/cpu_sun4i.h | 11 +++
>  include/configs/sun8i.h |  7 +++
>  2 files changed, 18 insertions(+)
> 
> diff --git a/arch/arm/include/asm/arch-sunxi/cpu_sun4i.h 
> b/arch/arm/include/asm/arch-sunxi/cpu_sun4i.h
> index 02ce73954d..d4c795d89c 100644
> --- a/arch/arm/include/asm/arch-sunxi/cpu_sun4i.h
> +++ b/arch/arm/include/asm/arch-sunxi/cpu_sun4i.h
> @@ -11,7 +11,18 @@
>  #define SUNXI_SRAM_A1_BASE   0x
>  #define SUNXI_SRAM_A1_SIZE   (16 * 1024) /* 16 kiB */
>  
> +#if defined(CONFIG_SUNXI_GEN_SUN6I) && \
> +!defined(CONFIG_MACH_SUN8I_R40) && \
> +!defined(CONFIG_MACH_SUN8I_V3S)
> +#define SUNXI_SRAM_A2_BASE   0x0004
> +#ifdef CONFIG_MACH_SUN8I_H3
> +#define SUNXI_SRAM_A2_SIZE   (48 * 1024) /* 16+32 kiB */
> +#else
> +#define SUNXI_SRAM_A2_SIZE   (80 * 1024) /* 16+64 kiB */
> +#endif
> +#else
>  #define SUNXI_SRAM_A2_BASE   0x4000  /* 16 kiB */
> +#endif
>  #define SUNXI_SRAM_A3_BASE   0x8000  /* 13 kiB */
>  #define SUNXI_SRAM_A4_BASE   0xb400  /* 3 kiB */
>  #define SUNXI_SRAM_D_BASE0x0001  /* 4 kiB */
> diff --git a/include/configs/sun8i.h b/include/configs/sun8i.h
> index 9b4675e4c3..545d27996c 100644
> --- a/include/configs/sun8i.h
> +++ b/include/configs/sun8i.h
> @@ -12,6 +12,13 @@
>   * A23 specific configuration
>   */
>  
> +/*
> + * Skip the first 16 KiB of SRAM A2, which is not usable, as only certain 
> bytes
> + * are writable. Reserve the last 17 KiB for the resume shim and SCP 
> firmware.
> + */
> +#define CONFIG_ARMV7_SECURE_BASE (SUNXI_SRAM_A2_BASE + 16 * 1024)
> +#define CONFIG_ARMV7_SECURE_MAX_SIZE (SUNXI_SRAM_A2_SIZE - 33 * 1024)
> +
>  /*
>   * Include common sunxi configuration where most the settings are
>   */



Re: [EXT] Re: [PATCH 4/4] imx8mq_evk: Enable the USB3.0 host port

2021-07-10 Thread Patrick Wildt
Am Wed, Mar 03, 2021 at 08:53:52AM + schrieb Bough Chen:
> > -Original Message-
> > From: Ye Li
> > Sent: 2021年2月27日 14:05
> > To: feste...@gmail.com; Bough Chen 
> > Cc: Peng Fan ; u-boot@lists.denx.de; dl-uboot-imx
> > ; sba...@denx.de
> > Subject: Re: [EXT] Re: [PATCH 4/4] imx8mq_evk: Enable the USB3.0 host port
> > 
> > Hi Fabio,
> > 
> > On Thu, 2021-02-25 at 10:49 -0300, Fabio Estevam wrote:
> > > Caution: EXT Email
> > >
> > > Hi Ye Li,
> > >
> > > On Thu, Feb 25, 2021 at 10:34 AM Ye Li  wrote:
> > >
> > > >
> > > > Sure, I have tested it on 8mq evk. I can reproduce the two issues
> > > > you met.
> > > > The first issue is caused by the ALIGN. The implementation of
> > > > standard ALIGN requires the aligned size to be power of 2. But the
> > > > ALIGN in imx8mimage does not have this requirement. So below result
> > > > is wrong by using the standard ALIGN. Your fix should be OK for this
> > > > issue.
> > > Good, could you please reply to my ALIGN macro patch with your
> > > Tested-by tag then?
> > >
> > Replied it.
> > 
> > > >
> > > > For the second issue, I did not debug into it. But our vendor tree
> > > > also uses off-on-delay-us in both u-boot and kernel. So it is likely
> > > > caused by other change.
> > > Considering we are already at 2021.04-rc2, I think it would be safer
> > > to go with my patch that removes off-on-delay-us.
> > >
> > > What do you think?
> > >
> > > Thanks
> > My debug shows the issue is triggered by below commit:
> > 
> > commit 9098682200e6cca4b776638a51200dafa16f50fb
> > Author: Haibo Chen 
> > Date:   Tue Sep 22 18:11:43 2020 +0800
> > 
> > mmc: fsl_esdhc_imx: remove the 1ms delay before sending command
> > 
> > This 1ms delay before sending command already exist from the beginning
> > of the fsl_esdhc driver added in year 2008. Now this driver has been
> > split for two files: fsl_esdhc.c and fsl_esdhc_imx.c.
> > fsl_esdhc_imx.c
> > only for i.MX series. i.MX series esdhc/usdhc do not need this 1ms delay
> > before sending any command. So remove this 1ms, this will save a lot
> > time if handling a large mmc data.
> > 
> > Signed-off-by: Haibo Chen 
> > 
> > 
> > The first "go idle" command in mmc_get_op_cond seems not put SD card to
> > idle status, but if adding a delay before it (like 1ms delay), then 
> > everything
> > works. This commit removed 1ms delay in sending command, so the issue is
> > triggered.  The root cause might be "startup-delay-us"
> > needed for this regulator to reach a threshold voltage for SD working.
> > Below change also can fix the issue.
> > 
> > --- a/arch/arm/dts/imx8mq-evk-u-boot.dtsi
> > +++ b/arch/arm/dts/imx8mq-evk-u-boot.dtsi
> > @@ -1,6 +1,7 @@
> >  // SPDX-License-Identifier: (GPL-2.0 OR MIT)
> > 
> >  _usdhc2_vmmc {
> > +   startup-delay-us = <1000>;
> > u-boot,off-on-delay-us = <2>;
> >  };
> > 
> > 
> > @Haibo, Could you help looking into the issue. What's your opinion to add 
> > the
> > startup-delay-us or revert your commit?
> > 
> 
> Hi Fabio,
> 
> I co-debug with Ye, and find the issue is also related with clock 
> enable/disable. For current logic on imx usdhc, hardware automatically gate 
> off the card clock when idle.
> So before the first command "go idle", there is no clock on the clock line, 
> which not align with the sd spec.
> Refer to SD3.0 spec 6.4.1 Power UP
> The host shall supply power to the card so that the voltage is reached to 
> Vdd_min within 250ms and
> start to supply at least 74 SD clocks to the SD card with keeping CMD line to 
> high. In case of SPI
> mode, CS shall be held to high during 74 clock cycles
> 
> if we give the card the correct clock rate before the first "go idle" 
> command, this issue gone.
> Please try to apply the patch I send on 2021/1/27   [PATCH] mmc: 
> fsl_esdhc_imx: use VENDORSPEC_FRC_SDCLK_ON to control card clock output 
> 
> > Best regards,
> > Ye Li

Hi,

is this patchset still being reviewed?  I think the discussion has moved
to some SD card problem, which is fixed now?  Would be nice if USB 3.0
worked on i.MX8MQ platforms.

I can also have a look at reviewing the functionality, but I don't think
I can spot U-Boot coding style issues.

Best regards,
Patrick


[PATCH 2/2] board: mntre: imx8mq: Add MNT Reform 2 board support

2021-07-10 Thread Patrick Wildt
The MNT Reform 2 is a modular DIY laptop.  In its initial version it
is based on the BoundaryDevices i.MX8MQ SoM.  Some parts have been
lifted from BoundaryDevices official U-Boot downstream project.

Signed-off-by: Patrick Wildt 
---
 arch/arm/dts/imx8mq-mnt-reform2-u-boot.dtsi   |   11 +
 arch/arm/mach-imx/imx8m/Kconfig   |6 +
 board/mntre/imx8mq_reform2/Kconfig|   12 +
 board/mntre/imx8mq_reform2/MAINTAINERS|7 +
 board/mntre/imx8mq_reform2/Makefile   |   12 +
 board/mntre/imx8mq_reform2/imx8mq_reform2.c   |  215 
 board/mntre/imx8mq_reform2/lpddr4_timing.c| 1014 +
 .../mntre/imx8mq_reform2/lpddr4_timing_ch2.h  |   95 ++
 board/mntre/imx8mq_reform2/spl.c  |  260 +
 configs/imx8mq_reform2_defconfig  |   56 +
 include/configs/imx8mq_reform2.h  |  149 +++
 11 files changed, 1837 insertions(+)
 create mode 100644 arch/arm/dts/imx8mq-mnt-reform2-u-boot.dtsi
 create mode 100644 board/mntre/imx8mq_reform2/Kconfig
 create mode 100644 board/mntre/imx8mq_reform2/MAINTAINERS
 create mode 100644 board/mntre/imx8mq_reform2/Makefile
 create mode 100644 board/mntre/imx8mq_reform2/imx8mq_reform2.c
 create mode 100644 board/mntre/imx8mq_reform2/lpddr4_timing.c
 create mode 100644 board/mntre/imx8mq_reform2/lpddr4_timing_ch2.h
 create mode 100644 board/mntre/imx8mq_reform2/spl.c
 create mode 100644 configs/imx8mq_reform2_defconfig
 create mode 100644 include/configs/imx8mq_reform2.h

diff --git a/arch/arm/dts/imx8mq-mnt-reform2-u-boot.dtsi 
b/arch/arm/dts/imx8mq-mnt-reform2-u-boot.dtsi
new file mode 100644
index 00..7e928e875b
--- /dev/null
+++ b/arch/arm/dts/imx8mq-mnt-reform2-u-boot.dtsi
@@ -0,0 +1,11 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+
+ {
+   mmc-hs400-1_8v;
+};
+
+ {
+   cd-gpios = < 12 GPIO_ACTIVE_LOW>;
+   sd-uhs-sdr104;
+   sd-uhs-ddr50;
+};
diff --git a/arch/arm/mach-imx/imx8m/Kconfig b/arch/arm/mach-imx/imx8m/Kconfig
index 0669363c0f..623c852ae4 100644
--- a/arch/arm/mach-imx/imx8m/Kconfig
+++ b/arch/arm/mach-imx/imx8m/Kconfig
@@ -44,6 +44,11 @@ config TARGET_IMX8MQ_PHANBELL
 select IMX8MQ
 select IMX8M_LPDDR4
 
+config TARGET_IMX8MQ_REFORM2
+   bool "imx8mq_reform2"
+   select IMX8MQ
+   select IMX8M_LPDDR4
+
 config TARGET_IMX8MM_EVK
bool "imx8mm LPDDR4 EVK board"
select BINMAN
@@ -149,6 +154,7 @@ source "board/freescale/imx8mn_evk/Kconfig"
 source "board/freescale/imx8mp_evk/Kconfig"
 source "board/gateworks/venice/Kconfig"
 source "board/google/imx8mq_phanbell/Kconfig"
+source "board/mntre/imx8mq_reform2/Kconfig"
 source "board/phytec/phycore_imx8mm/Kconfig"
 source "board/phytec/phycore_imx8mp/Kconfig"
 source "board/ronetix/imx8mq-cm/Kconfig"
diff --git a/board/mntre/imx8mq_reform2/Kconfig 
b/board/mntre/imx8mq_reform2/Kconfig
new file mode 100644
index 00..8070ef377b
--- /dev/null
+++ b/board/mntre/imx8mq_reform2/Kconfig
@@ -0,0 +1,12 @@
+if TARGET_IMX8MQ_REFORM2
+
+config SYS_BOARD
+   default "imx8mq_reform2"
+
+config SYS_VENDOR
+   default "mntre"
+
+config SYS_CONFIG_NAME
+   default "imx8mq_reform2"
+
+endif
diff --git a/board/mntre/imx8mq_reform2/MAINTAINERS 
b/board/mntre/imx8mq_reform2/MAINTAINERS
new file mode 100644
index 00..946f287ecf
--- /dev/null
+++ b/board/mntre/imx8mq_reform2/MAINTAINERS
@@ -0,0 +1,7 @@
+REFORM2 IMX8MQ BOARD
+M: Lukas F. Hartmann 
+M: Patrick Wildt 
+S: Maintained
+F: board/mntre/imx8mq_reform2/
+F: include/configs/imx8mq_reform2.h
+F: configs/imx8mq_reform2_defconfig
diff --git a/board/mntre/imx8mq_reform2/Makefile 
b/board/mntre/imx8mq_reform2/Makefile
new file mode 100644
index 00..2efd56bb4a
--- /dev/null
+++ b/board/mntre/imx8mq_reform2/Makefile
@@ -0,0 +1,12 @@
+#
+# Copyright 2017 NXP
+#
+# SPDX-License-Identifier:  GPL-2.0+
+#
+
+obj-y += imx8mq_reform2.o
+
+ifdef CONFIG_SPL_BUILD
+obj-y += spl.o
+obj-$(CONFIG_IMX8M_LPDDR4) += lpddr4_timing.o
+endif
diff --git a/board/mntre/imx8mq_reform2/imx8mq_reform2.c 
b/board/mntre/imx8mq_reform2/imx8mq_reform2.c
new file mode 100644
index 00..c46af349eb
--- /dev/null
+++ b/board/mntre/imx8mq_reform2/imx8mq_reform2.c
@@ -0,0 +1,215 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2018 NXP
+ * Copyright (C) 2018, Boundary Devices 
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#define UART_PAD_CTRL  (PAD_CTL_DSE6 | PAD_CTL_FSEL1)
+
+#define WDOG_PAD_CTRL  (PAD_CTL_DSE6 | PAD_CTL_HYS | PAD_CTL_PUE)
+
+static iomux_v3_cfg_t const wdog_pads[] = {
+   IMX8MQ_PAD_GPIO1_IO02__WDOG1_WDOG_B | MUX_PAD_CTRL(WDOG_PAD_CTRL),
+};
+
+static iomux_v3_cfg_t const uart_pads[] = {
+   IMX8MQ_PAD_UART1_RXD__UART1_RX | 

[PATCH 1/2] arm: dts: imx8mq: add MNT Reform 2

2021-07-10 Thread Patrick Wildt
Device tree taken from v4 of the MNT Reform 2 series on the Linux ARM
Kernel Architecture mailing list:

https://patchwork.kernel.org/project/linux-arm-kernel/list/?series=500045

Signed-off-by: Patrick Wildt 
---
 arch/arm/dts/Makefile |   1 +
 arch/arm/dts/imx8mq-mnt-reform2.dts   | 164 +++
 arch/arm/dts/imx8mq-nitrogen-som.dtsi | 275 ++
 3 files changed, 440 insertions(+)
 create mode 100644 arch/arm/dts/imx8mq-mnt-reform2.dts
 create mode 100644 arch/arm/dts/imx8mq-nitrogen-som.dtsi

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 59d8078558..e01924c797 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -873,6 +873,7 @@ dtb-$(CONFIG_ARCH_IMX8M) += \
imx8mq-evk.dtb \
imx8mm-beacon-kit.dtb \
imx8mn-beacon-kit.dtb \
+   imx8mq-mnt-reform2.dtb \
imx8mq-phanbell.dtb \
imx8mp-evk.dtb \
imx8mp-phyboard-pollux-rdk.dtb \
diff --git a/arch/arm/dts/imx8mq-mnt-reform2.dts 
b/arch/arm/dts/imx8mq-mnt-reform2.dts
new file mode 100644
index 00..099b0472db
--- /dev/null
+++ b/arch/arm/dts/imx8mq-mnt-reform2.dts
@@ -0,0 +1,164 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+
+/*
+ * Copyright 2019-2021 MNT Research GmbH
+ * Copyright 2021 Lucas Stach 
+ */
+
+/dts-v1/;
+
+#include "imx8mq-nitrogen-som.dtsi"
+
+/ {
+   model = "MNT Reform 2";
+   compatible = "mntre,reform2", "boundary,imx8mq-nitrogen8m-som", 
"fsl,imx8mq";
+
+   pcie1_refclk: clock-pcie1-refclk {
+   compatible = "fixed-clock";
+   #clock-cells = <0>;
+   clock-frequency = <1>;
+   };
+
+   reg_main_5v: regulator-main-5v {
+   compatible = "regulator-fixed";
+   regulator-name = "5V";
+   regulator-min-microvolt = <500>;
+   regulator-max-microvolt = <500>;
+   };
+
+   reg_main_3v3: regulator-main-3v3 {
+   compatible = "regulator-fixed";
+   regulator-name = "3V3";
+   regulator-min-microvolt = <330>;
+   regulator-max-microvolt = <330>;
+   };
+
+   reg_main_usb: regulator-main-usb {
+   compatible = "regulator-fixed";
+   regulator-name = "USB_PWR";
+   regulator-min-microvolt = <500>;
+   regulator-max-microvolt = <500>;
+   vin-supply = <_main_5v>;
+   };
+};
+
+ {
+   status = "okay";
+};
+
+ {
+   pinctrl-names = "default";
+   pinctrl-0 = <_i2c3>;
+   status = "okay";
+
+   rtc@68 {
+   compatible = "nxp,pcf8523";
+   reg = <0x68>;
+   };
+};
+
+ {
+   pinctrl-names = "default";
+   pinctrl-0 = <_pcie1>;
+   reset-gpio = < 23 GPIO_ACTIVE_LOW>;
+   clocks = < IMX8MQ_CLK_PCIE2_ROOT>,
+< IMX8MQ_CLK_PCIE2_AUX>,
+< IMX8MQ_CLK_PCIE2_PHY>,
+<_refclk>;
+   clock-names = "pcie", "pcie_aux", "pcie_phy", "pcie_bus";
+   status = "okay";
+};
+
+_1p8v {
+   vin-supply = <_main_5v>;
+};
+
+_snvs {
+   vin-supply = <_main_5v>;
+};
+
+_arm_dram {
+   vin-supply = <_main_5v>;
+};
+
+_dram_1p1v {
+   vin-supply = <_main_5v>;
+};
+
+_soc_gpu_vpu {
+   vin-supply = <_main_5v>;
+};
+
+_rtc {
+   status = "disabled";
+};
+
+ {
+   pinctrl-names = "default";
+   pinctrl-0 = <_uart2>;
+   status = "okay";
+};
+
+_phy0 {
+   vbus-supply = <_main_usb>;
+   status = "okay";
+};
+
+_phy1 {
+   vbus-supply = <_main_usb>;
+   status = "okay";
+};
+
+_dwc3_0 {
+   dr_mode = "host";
+   status = "okay";
+};
+
+_dwc3_1 {
+   dr_mode = "host";
+   status = "okay";
+};
+
+ {
+   assigned-clocks = < IMX8MQ_CLK_USDHC2>;
+   assigned-clock-rates = <2>;
+   pinctrl-names = "default";
+   pinctrl-0 = <_usdhc2>;
+   vqmmc-supply = <_main_3v3>;
+   vmmc-supply = <_main_3v3>;
+   bus-width = <4>;
+   status = "okay";
+};
+
+ {
+   pinctrl_i2c3: i2c3grp {
+   fsl,pins = <
+   MX8MQ_IOMUXC_I2C3_SCL_I2C3_SCL  
0x407f
+   MX8MQ_IOMUXC_I2C3_SDA_I2C3_SDA  
0x407f
+   >;
+   };
+
+   pinctrl_pcie1: pcie1grp {
+   fsl,pins = <
+   MX8MQ_IOMUXC_SAI5_RXD2_GPIO3_IO23   0x16
+   >;
+   };
+
+   pinctrl_uart2: uart2grp {
+   fsl,pins = <
+   MX8MQ_IOMUXC_UART2_RXD_UART2_DCE_RX 0x45
+   MX8MQ_IOMUXC_UART2_TXD_UART2_DCE_TX 0x45
+   >;
+   };
+
+   pinctrl_usdhc2: usdhc2grp {
+   fsl,pins = <
+   MX8MQ_IOMUXC_SD2_CLK_USDHC2_CLK 0x83
+   MX8MQ_IOMUXC_SD2_CMD_USDHC2_CMD 0xc3
+   

[PATCH 0/2] Add MNT Reform 2 board support

2021-07-10 Thread Patrick Wildt
The MNT Reform 2 is a modular DIY laptop.  In its initial version it
is based on the BoundaryDevices i.MX8MQ SoM.  Some parts have been
lifted from BoundaryDevices official U-Boot downstream project.

The device tree has not yet been merged into mainline Linux, but
it's already available as v4 on the Linux ARM Kernel Architecture
mailing list, which hopefully will now be merged as is.

This U-Boot patchset supports the serial console, the SD card and
eMMC, and Gigabit Ethernet.

Best regards,
Patrick

Patrick Wildt (2):
  arm: dts: imx8mq: add MNT Reform 2
  board: mntre: imx8mq: Add MNT Reform 2 board support

 arch/arm/dts/Makefile |1 +
 arch/arm/dts/imx8mq-mnt-reform2-u-boot.dtsi   |   11 +
 arch/arm/dts/imx8mq-mnt-reform2.dts   |  164 +++
 arch/arm/dts/imx8mq-nitrogen-som.dtsi |  275 +
 arch/arm/mach-imx/imx8m/Kconfig   |6 +
 board/mntre/imx8mq_reform2/Kconfig|   12 +
 board/mntre/imx8mq_reform2/MAINTAINERS|7 +
 board/mntre/imx8mq_reform2/Makefile   |   12 +
 board/mntre/imx8mq_reform2/imx8mq_reform2.c   |  215 
 board/mntre/imx8mq_reform2/lpddr4_timing.c| 1014 +
 .../mntre/imx8mq_reform2/lpddr4_timing_ch2.h  |   95 ++
 board/mntre/imx8mq_reform2/spl.c  |  260 +
 configs/imx8mq_reform2_defconfig  |   56 +
 include/configs/imx8mq_reform2.h  |  149 +++
 14 files changed, 2277 insertions(+)
 create mode 100644 arch/arm/dts/imx8mq-mnt-reform2-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx8mq-mnt-reform2.dts
 create mode 100644 arch/arm/dts/imx8mq-nitrogen-som.dtsi
 create mode 100644 board/mntre/imx8mq_reform2/Kconfig
 create mode 100644 board/mntre/imx8mq_reform2/MAINTAINERS
 create mode 100644 board/mntre/imx8mq_reform2/Makefile
 create mode 100644 board/mntre/imx8mq_reform2/imx8mq_reform2.c
 create mode 100644 board/mntre/imx8mq_reform2/lpddr4_timing.c
 create mode 100644 board/mntre/imx8mq_reform2/lpddr4_timing_ch2.h
 create mode 100644 board/mntre/imx8mq_reform2/spl.c
 create mode 100644 configs/imx8mq_reform2_defconfig
 create mode 100644 include/configs/imx8mq_reform2.h

-- 
2.32.0



Re: Broken arc toolchain

2021-07-10 Thread Tom Rini
On Sat, Jul 10, 2021 at 02:11:30PM -0600, Simon Glass wrote:

> Hi,
> 
> I see this:
> 
> $ buildman --fetch-arch arc
> 
> Downloading toolchain for arch 'arc'
> Checking: https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/9.2.0/
> Downloading: 
> https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/9.2.0/x86_64-gcc-9.2.0-nolibc-arc-linux.tar.xz
>  Unpacking to: /home/sglass/.buildman-toolchains
> Testing
>   - looking in
> '/home/sglass/.buildman-toolchains/gcc-9.2.0-nolibc/arc-linux/.'
>   - looking in
> '/home/sglass/.buildman-toolchains/gcc-9.2.0-nolibc/arc-linux/bin'
>  - found
> '/home/sglass/.buildman-toolchains/gcc-9.2.0-nolibc/arc-linux/bin/arc-linux-gcc'
>   - looking in
> '/home/sglass/.buildman-toolchains/gcc-9.2.0-nolibc/arc-linux/usr/bin'
> Tool chain test:  OK, arch='arc', priority 5
> 
> $ buildman -A hsdk_4xd
> /home/sglass/.buildman-toolchains/gcc-9.2.0-nolibc/arc-linux/bin/arc-linux-
> $ buildman hsdk_4xd
> ...
> arc-linux-gcc: error: unrecognized argument in option '-mcpu=hs4x_rel31
> 
> 
> Do you have any thoughts on what is wrong, please?

There's two parts.  The first part is I keep forgetting to update
buildman to fetch the latest toolchains from kernel.org, it should be
grabbing 11.1.0 now, not 9.2.0.  The second part is that arc, nds32 and
xtensa have non-standard toolchain locations, see
tools/docker/Dockerfile for where to fetch.

-- 
Tom


signature.asc
Description: PGP signature


Broken arc toolchain

2021-07-10 Thread Simon Glass
Hi,

I see this:

$ buildman --fetch-arch arc

Downloading toolchain for arch 'arc'
Checking: https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/9.2.0/
Downloading: 
https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/9.2.0/x86_64-gcc-9.2.0-nolibc-arc-linux.tar.xz
 Unpacking to: /home/sglass/.buildman-toolchains
Testing
  - looking in
'/home/sglass/.buildman-toolchains/gcc-9.2.0-nolibc/arc-linux/.'
  - looking in
'/home/sglass/.buildman-toolchains/gcc-9.2.0-nolibc/arc-linux/bin'
 - found
'/home/sglass/.buildman-toolchains/gcc-9.2.0-nolibc/arc-linux/bin/arc-linux-gcc'
  - looking in
'/home/sglass/.buildman-toolchains/gcc-9.2.0-nolibc/arc-linux/usr/bin'
Tool chain test:  OK, arch='arc', priority 5

$ buildman -A hsdk_4xd
/home/sglass/.buildman-toolchains/gcc-9.2.0-nolibc/arc-linux/bin/arc-linux-
$ buildman hsdk_4xd
...
arc-linux-gcc: error: unrecognized argument in option '-mcpu=hs4x_rel31


Do you have any thoughts on what is wrong, please?

Regards,
Simon


[PATCH] mx6sabresd: Make checkboard respect CONFIG_NXP_BOARD_REVISION

2021-07-10 Thread sbabic
> The default implementation of checkboard() calls the
> nxp_board_rev_string() function
> to retrieve a character representing the revision number of the board.
> However, this
> attempt to retrieve the revision number may fail in certain situations or be
> otherwise undesirable.
> There is already a configuration option to avoid retrieving the
> revision number of
> the board: CONFIG_NXP_BOARD_REVISION. In fact, if this option is enabled, the
> nxp_board_rev_string() function's definition will be omitted entirely,
> meaning that the previous implementation of checkboard() would result
> in a linker error.
> This changeset makes the default implementation of checkboard() respect the
> CONFIG_NXP_BOARD_REVISION configuration option, only attempting to retrieve
> the board revision number if that option is defined.
> Signed-off-by: Cody Gray 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH 11/11] imx: ventana: display 'none' for MMC if board does not have it

2021-07-10 Thread sbabic
> print 'None' instead of just a blank line if nothing is detected:
> MMC:  None
> Signed-off-by: Tim Harvey 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH V2 1/2] spl: mmc: Factor out eMMC boot partition selection code

2021-07-10 Thread sbabic
> Factor out eMMC boot partition selection code into
> default_spl_mmc_emmc_boot_partition() function and implement
> weak spl_mmc_emmc_boot_partition(), so that architecture or
> board code can override the eMMC boot partition selection.
> Signed-off-by: Marek Vasut 
> Cc: Faiz Abbas 
> Cc: Harald Seiler 
> Cc: Lokesh Vutla 
> Cc: Simon Glass 
> Cc: Fabio Estevam 
> Cc: Peng Fan 
> Cc: Stefano Babic 
> Cc: Ye Li 
> Reviewed-by: Jaehoon Chung 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH 9/9] configs: imx8mm_venice_defconfig: add support for gbe switch

2021-07-10 Thread sbabic
> The imx8mm-venice-gw7901 board has an I2C connected KSZ9897S GbE switch
> with an IMX8MM FEC MAC master connected via RGMII_ID.
> Signed-off-by: Tim Harvey 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH 07/11] imx: ventana: put LTC3676 regulators in continuous mode

2021-07-10 Thread sbabic
> In the default pulse-skipping mode regulators that are very lightly
> loaded can fail to regulate properly. Switching them to always use
> continuous mode causes only around 10mW of overall system power
> difference in a lightly loaded system that isn't already operating
> them in continuous mode.
> Signed-off-by: Tim Harvey 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH 1/5] board: gateworks: venice: gsc: fix typo

2021-07-10 Thread sbabic
> Fix typo in error message.
> Signed-off-by: Tim Harvey 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH 4/5] board: gateworks: venice: add ftd_file env vars on boot

2021-07-10 Thread sbabic
> The ftd_file* vars can be used by bootscripts to look for
> appropriate dtb's
> Signed-off-by: Tim Harvey 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH v3 4/9] board: phytec: phycore_imx8mp: Change debug UART

2021-07-10 Thread sbabic
> With the first redesign the debug UART had changed from
> UART2 to UART1.
> As the first hardware revision is considered as alpha and
> will not be supported in future. The old setup will not
> be preserved.
> Signed-off-by: Teresa Remmet 
> Reviewed-by: Fabio Estevam 
> Reviewed-by: Heiko Schocher 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH v3 9/9] board: phytec: imx8mp-phycore: Switch to binman

2021-07-10 Thread sbabic
> Use now binman for image creation.
> Signed-off-by: Teresa Remmet 
> Reviewed-by: Fabio Estevam 
> Reviewed-by: Heiko Schocher 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[RESEND PATCH 4/6] imx8m: Restrict usable memory to space below 4G boundary

2021-07-10 Thread sbabic
> From: Frieder Schrempf 
> Some IPs have their accessible address space restricted by the
> interconnect. Let's make sure U-Boot only ever uses the space below
> the 4G address boundary (which is 3GiB big), even when the effective
> available memory is bigger.
> We implement board_get_usable_ram_top() for all i.MX8M SoCs, as the
> whole family is affected by this.
> Signed-off-by: Frieder Schrempf 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH 04/11] imx: ventana: add legacy uboot image support

2021-07-10 Thread sbabic
> Add Legacy U-Boot image support needed to boot a uImage.
> Signed-off-by: Tim Harvey 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH v3 8/9] arm: dts: imx8mp-phyboard-pollux-rdk-u-boot: Add wdog pinctrl entry

2021-07-10 Thread sbabic
> Add missing pinctrl entry in spl.
> Signed-off-by: Teresa Remmet 
> Reviewed-by: Fabio Estevam 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[RESEND PATCH 1/6] mtd: spi-nor-ids: Add support for Macronix MX25V8035F and MX25R1635F

2021-07-10 Thread sbabic
> From: Frieder Schrempf 
> The MX25V8035F is a 8Mb SPI NOR flash and the MX25R1635F is very
> similar, but has twice the size (16Mb) and supports a wider supply
> voltage range.
> They were tested on the Kontron Electronics i.MX6UL and i.MX8MM SoMs.
> Signed-off-by: Frieder Schrempf 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH 05/11] imx: ventana: add PMIC fix for GW54xx-G

2021-07-10 Thread sbabic
> Substitutions in EOL parts changes the VDD_2P5 voltage rail such that
> the previously unused VGEN6 LDO is needed in place of the lower power
> VGEN5 for the GW54xx-G.
> Signed-off-by: Tim Harvey 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH 3/5] board: gateworks: venice: display DTB used

2021-07-10 Thread sbabic
> Display the DTB file used for U-Boot.
> Signed-off-by: Tim Harvey 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH 4/9] net: add set_promisc function to enable/disable Promiscuous mode

2021-07-10 Thread sbabic
> Enabling promiscuous mode can be useful for DSA switches where each port
> has its own MAC address.
> Signed-off-by: Tim Harvey 
> Reviewed-by: Ramon Fried 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH 06/11] imx: ventana: put PFUZ100 regulators in continuous mode

2021-07-10 Thread sbabic
> In the default 'auto' mode regulators that are very lightly loaded
> can be put in PFM mode and fail to regulator properly. Switching them
> to always use continuous PWM mode has a neglibable affect on system
> power and garuntees proper regulation under lightly loaded circumstances.
> Signed-off-by: Tim Harvey 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH v3 7/9] board: phytec: phycore-imx8mp: Enable DVS1 control

2021-07-10 Thread sbabic
> Enable DVS1 control through PMIC_STBY_REQ.
> Signed-off-by: Teresa Remmet 
> Reviewed-by: Fabio Estevam 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH v2] pci: imx: use reset-gpios if defined by device-tree

2021-07-10 Thread sbabic
> If reset-gpio is defined by device-tree use that if
> CONFIG_PCIE_IMX_PERST_GPIO is not defined.
> Note that after this the following boards which define
> CONFIG_PCIE_IMX_PERST_GPIO in their board header file as well as their
> device-tree should be able to remove CONFIG_PCIE_IMX_PERST_GPIO without
> consequence:
>  - mx6sabresd
>  - mx6sxsabresd
>  - novena
>  - tbs2910
>  - vining_2000
> Note that the ge_bx50v3 board uses CONFIG_PCIE_IMX_PERST_GPIO and does
> not have reset-gpios defined it it's pcie node in the dt thus removing
> CONFIG_PCIE_IMX_PERST_GPIO globally can't be done until that board adds
> reset-gpios.
> Cc: Ian Ray  (maintainer:GE BX50V3 BOARD)
> Cc: Sebastian Reichel  (maintainer:GE BX50V3 
> BOARD)
> Cc: Fabio Estevam  (maintainer:MX6SABRESD BOARD)
> Cc: Marek Vasut  (maintainer:NOVENA BOARD)
> Cc: Soeren Moch  (maintainer:TBS2910 BOARD)
> Cc: Silvio Fricke  (maintainer:VINING_2000 BOARD)
> Signed-off-by: Tim Harvey 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH 03/11] imx: ventana: increase SYS_BOOTM_LEN

2021-07-10 Thread sbabic
> Increase SYS_BOOM_LEN from the default 16M in imx6_common to 64M.
> Signed-off-by: Tim Harvey 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH v3 5/9] board: phytec: phycore_imx8mp: Add fec support

2021-07-10 Thread sbabic
> Enable support for the fec ethernet on phyCORE-i.MX8MP.
> Signed-off-by: Teresa Remmet 
> Reviewed-by: Fabio Estevam 
> Reviewed-by: Heiko Schocher 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH V2 2/2] ARM: imx: Pick correct eMMC boot partition from ROM log

2021-07-10 Thread sbabic
> In case the iMX8M boot from eMMC boot partition and the primary image
> is corrupted, the BootROM is capable of starting a secondary image in
> the other eMMC boot partition as a fallback.
> However, the BootROM leaves the eMMC BOOT_PARTITION_ENABLE setting as
> it was, i.e. pointing to the boot partition containing the corrupted
> image, and the BootROM does not provide any indication that this sort
> of fallback occured.
> According to AN12853 i.MX ROMs Log Events, Rev. 0, May 2020, it is
> possible to determine whether fallback event occurred by parsing the
> ROM event log. In case ROM event ID 0x51 is present, fallback event
> did occur.
> This patch implements ROM event log parsing and search for event ID
> 0x51 for all iMX8M SoCs, and based on that corrects the eMMC boot
> partition selection. This way, the SPL loads the remaining boot
> components from the same eMMC boot partition from which it was
> started, even in case of the fallback.
> Signed-off-by: Marek Vasut 
> Cc: Faiz Abbas 
> Cc: Harald Seiler 
> Cc: Lokesh Vutla 
> Cc: Simon Glass 
> Cc: Fabio Estevam 
> Cc: Peng Fan 
> Cc: Stefano Babic 
> Cc: Ye Li 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH v3 2/9] arm: dts: imx8mp: Add common u-boot dtsi

2021-07-10 Thread sbabic
> Factor out the common node settings for dm-spl and dm-pre-reloc
> and move them to imx8mp-u-boot.dtsi
> Signed-off-by: Teresa Remmet 
> Reviewed-by: Fabio Estevam 
> Reviewed-by: Heiko Schocher 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH 7/9] net: add support for KSZ9477/KSZ9897/KSZ9567 GbE switch

2021-07-10 Thread sbabic
> The Microchip KSZ9477/KSZ9897/KSZ9567 7-Port Gigabit Ethernet Switches
> support SGMII/RGMII/MII/RMII with register access via SPI, I2C, or MDIO.
> This driver currently supports I2C register access but SPI or MDIO register
> access can be easily added at a later time.
> Tagging is not implemented and instead the active port is tracked to
> avoid needing a tag to store port information.
> This was tested with the imx8mm-venice-gw7901 board which has a
> KSZ9897S switch with an IMX8MM FEC MAC master connected via RGMII_ID.
> Signed-off-by: Tim Harvey 
> Reviewed-by: Ramon Fried 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH 3/3] smegw01: Select the CMD_UNZIP option

2021-07-10 Thread sbabic
> Select the CMD_UNZIP option so that the 'gzwrite' command
> can be used to flash .gz image into the eMMC.
> Signed-off-by: Fabio Estevam 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH v3 6/9] board: phytec: phycore_imx8mp: Set VDD_ARM to 0,95V

2021-07-10 Thread sbabic
> Increase VDD_ARM to prevent timing issues as VDD_SOC is
> used in OD mode. Also increase GIC clock.
> Signed-off-by: Teresa Remmet 
> Reviewed-by: Fabio Estevam 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH 01/11] imx: ventana: remove USB_KEYBOARD support

2021-07-10 Thread sbabic
> For some time now having USB_KEYBOARD support has caused usb to be
> initialized on boot. To allow for a quicker bootup we don't want this
> for Ventana and don't really need USB keyboard support so remove it.
> Signed-off-by: Tim Harvey 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[RESEND PATCH 2/6] spi: fsl_qspi: Build driver only if DM_SPI is available

2021-07-10 Thread sbabic
> From: Frieder Schrempf 
> The driver depends on DM_SPI and if it's not available (e. g. in SPL),
> then we should not try to build it as this will fail.
> Signed-off-by: Frieder Schrempf 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH 2/5] board: gateworks: venice: gsc: fix voltage offset

2021-07-10 Thread sbabic
> The voltage offset property is in microvolts so must be scaled
> accordingly.
> Signed-off-by: Tim Harvey 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH 6/9] net: dsa: enable master promisc mode if available and needed

2021-07-10 Thread sbabic
> If ports have their own unique MAC addrs and master has a set_promisc
> function, call it so that packets will be received for ports.
> Signed-off-by: Tim Harvey 
> Reviewed-by: Ramon Fried 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH] arm/mach-imx: Fix macros in mmdc_size.c

2021-07-10 Thread sbabic
> Make macros actually use passed parameter instead of local variables
> that happen
> to be named the same as symbols in macro expansion.
> Signed-off-by: Kacper Kubkowski 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH v3 3/9] arm: dts: imx8mp-phyboard-pollux: Sync dts files with kernel

2021-07-10 Thread sbabic
> This update includes eqos support and some minor changes.
> Synced with kernel commit
> 412627f6ffe3 ("arm64: dts: imx8mp-phyboard-pollux-rdk: Add missing pinctrl 
> entry")
> Signed-off-by: Teresa Remmet 
> Reviewed-by: Fabio Estevam 
> Reviewed-by: Heiko Schocher 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH 02/11] imx: ventana: remove unneeded includes

2021-07-10 Thread sbabic
> remove unnecessary includes
> Signed-off-by: Tim Harvey 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH 2/9] net: fec: use device sequence vs index when fetching fec

2021-07-10 Thread sbabic
> When using uclass_get_device* to get the FEC device we need to use
> device sequence instead of index into UCLASS_ETH. In systems where for
> example a I2C based DSA switch exists it will probe before the FEC
> master and its ports will be registered first and have the first
> indexes yet the FEC's sequence comes from the device-tree alias.
> Take for example the imx8mm-venice-gw7901 board which has an i2c based
> DSA switch:
> u-boot=> net list
> eth1 : lan1 00:0d:8d:aa:00:2f
> eth2 : lan2 00:0d:8d:aa:00:30
> eth3 : lan3 00:0d:8d:aa:00:31
> eth4 : lan4 00:0d:8d:aa:00:32
> eth0 : ethernet@30be 00:0d:8d:aa:00:2e active
> Thus in this case uclass_get_device(UCLASS_ETH, 0, ) returns lan1
> which is wrong but uclass_get_device_seq(UCLASS_ETH, 0, ) returns
> ethernet@30be000 which is correct.
> Signed-off-by: Tim Harvey 
> Reviewed-by: Ramon Fried 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH 10/11] imx: ventana: add support for DLC0700XDP21LF LCD display

2021-07-10 Thread sbabic
> Add LVDS support for DLC0700XDP21LF 7in 1024x600 display
> (equivalent to the DLC-700JMGT4 with new touch controller)
> Signed-off-by: Robert Jones 
> Signed-off-by: Tim Harvey 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH 1/9] board: gateworks: venice: add imx8mm-gw7901 support

2021-07-10 Thread sbabic
> The Gateworks GW7901 is an ARM based single board computer (SBC)
> featuring:
>  - i.MX8M Mini SoC
>  - LPDDR4 DRAM
>  - eMMC FLASH
>  - SPI FRAM
>  - Gateworks System Controller (GSC)
>  - Atmel ATECC Crypto Authentication
>  - USB 2.0
>  - Microchip GbE Switch
>  - Multiple multi-protocol RS232/RS485/RS422 Serial ports
>  - onboard 802.11ac WiFi / BT
>  - microSD socket
>  - miniPCIe socket with PCIe, USB 2.0 and dual SIM sockets
>  - Wide range DC power input
>  - 802.3at PoE
> To add support for this board:
>  - add dts from Linux (accepted for v5.14)
>  - add SPL PMIC config
> Signed-off-by: Tim Harvey 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH 8/9] arm: dts: imx8mm-venice-gw7901.dts: fix dsa switch configuration

2021-07-10 Thread sbabic
> Fix the dsa switch config:
> - remove the unnecessary phy-mode from the switch itself
> - added the necessary fixed-link node to the non-cpu ports required
>   for U-Boot DSA
> Signed-off-by: Tim Harvey 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH v3 1/9] arm: dts: imx8mp: Resync imx8mp device tree include

2021-07-10 Thread sbabic
> Sync imx8mp include with kernel commit:
> d1689cd3c0f4 ("arm64: dts: imx8mp: Use the correct name for child node "snps, 
> dwc3"")
> Signed-off-by: Teresa Remmet 
> Reviewed-by: Fabio Estevam 
> Reviewed-by: Heiko Schocher 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH 5/9] net: fec: add set_promisc function

2021-07-10 Thread sbabic
> Enabling promiscuous mode is necessary if FEC is the master of a DSA
> switch driver where each port has their own MAC address.
> Signed-off-by: Tim Harvey 
> Reviewed-by: Ramon Fried 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH V2] ARM: imx6: Update dhelectronics/dh_imx6/MAINTAINERS file

2021-07-10 Thread sbabic
> Adding new DH electronics mailing list and update list of maintainers.
> Signed-off-by: Christoph Niedermaier 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH 3/9] net: fec: set phy_of_node properly for fixed-link phy

2021-07-10 Thread sbabic
> If the FEC is connected to a fixed-link (upstream switch port for
> example) the phy_of_node should be set to the fixed-link node
> so that speed and other properties can be found properly.
> In addition fix a typo in the debug string.
> Signed-off-by: Tim Harvey 
> Reviewed-by: Ramon Fried 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH 09/11] imx: ventana: display neteowrk PHY

2021-07-10 Thread sbabic
> Add displaying the detected network PHY on boot.
> Signed-off-by: Tim Harvey 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH 1/3] smegw01: Allow booting the Yocto image by default

2021-07-10 Thread sbabic
> On the Yocto image there is a single partition and the kernel
> and dtb are present in the 'boot' directory.
> Change it accordingly so that the board can boot the Yocto
> image by default.
> Use the generic 'load' command instead, which is able to
> read from an ext4 partition.
> Signed-off-by: Fabio Estevam 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[RESEND PATCH 3/6] clk: imx8mm: Add SPI clocks

2021-07-10 Thread sbabic
> From: Frieder Schrempf 
> Add the clocks for the ECSPI controllers. This is ported from
> Linux v5.13-rc4.
> Signed-off-by: Frieder Schrempf 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH 08/11] imx: ventana: add DP83867 PHY LED configuration

2021-07-10 Thread sbabic
> Add DP83867 PHY LED configuration.
> Signed-off-by: Tim Harvey 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH 5/5] board: gateworks: venice: remove forced enable of GSC thermal protection

2021-07-10 Thread sbabic
> The Gateworks System Controller thermal protection feature will disable
> the board primary power supply if the on-board temperature sensor
> reaches 86C. In many cases this could occur before the temperature
> critical components such as CPU, DRAM, eMMC, and power supplies have
> reached their max temperature.
> Remove the forced re-enable of thermal protection so that users can
> knowingly disable it.
> Signed-off-by: Tim Harvey 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


Re: [PATCH] board: dragonboard410c: Load U-Boot directly without LK

2021-07-10 Thread Stephan Gerhold
On Sat, Jul 10, 2021 at 10:07:28PM +0300, Ramon Fried wrote:
> On Wed, Jul 7, 2021 at 12:06 PM Stephan Gerhold  wrote:
> >
> > At the moment the U-Boot port for the DragonBoard 410c is designed
> > to be loaded as an Android boot image after Qualcomm's Little Kernel (LK)
> > bootloader. This is simple to set up but LK is redundant in this case,
> > since everything done by LK can be also done directly by U-Boot.
> >
> > Dropping LK entirely has at least the following advantages:
> >   - Easier installation/board code (no need for Android boot images)
> >   - (Slightly) faster boot
> >   - Boot directly in 64-bit without a round trip to 32-bit for LK
> >
> > So far this was not possible yet because of unsolved problems:
> >
> >   1. Signing tool: The firmware expects a "signed" ELF image with extra
> >  (Qualcomm-specific) ELF headers, usually used for secure boot.
> >  The DragonBoard 410c does not have secure boot by default but the
> >  extra ELF headers are still required.
> >
> >   2. PSCI bug: There seems to be a bug in the PSCI implementation
> >  (part of the TrustZone/tz firmware) that causes all other CPU cores
> >  to be started in 32-bit mode if LK is missing in the boot chain.
> >  This causes Linux to hang early during boot.
> >
> > There is a solution for both problems now:
> >
> >   1. qtestsign (https://github.com/msm8916-mainline/qtestsign)
> >  can be used as a "signing" tool for U-Boot and other firmware.
> >
> >   2. A workaround for the "PSCI bug" is to execute the TZ syscall when
> >  entering U-Boot. That way PSCI is made aware of the 64-bit switch
> >  and starts all other CPU cores in 64-bit mode as well.
> >
> > Simplify the dragonboard410c board by removing all the extra code that
> > is only used to build an Android boot image that can be loaded by LK.
> > This allows dropping the custom linker script, special image magic,
> > as well as most of the special build/installation instructions.
> >
> > CONFIG_REMAKE_ELF is used to build a new ELF image that has both U-Boot
> > and the appended DTB combined. The resulting u-boot.elf can then be
> > passed to the "signing" tool (e.g. qtestsign).
> >
> > The PSCI workaround is placed in the "boot0" hook that is enabled
> > with CONFIG_ENABLE_ARM_SOC_BOOT0_HOOK. The extra check for EL1 allows
> > compatibility with custom firmware that enters U-Boot in EL2 or EL3,
> > e.g. qhypstub (https://github.com/msm8916-mainline/qhypstub).
> >
> > As a first step these changes apply only to DragonBoard410c.
> > Similar changes could likely also work for the DragonBoard 820c.
> >
> > Note that removing LK wouldn't be possible that easily without a lot of
> > work already done three years ago by Ramon Fried. A lot of missing
> > initialization, pinctrl etc was already added back then even though
> > it was not strictly needed yet.
> >
> > Cc: Ramon Fried 
> > Signed-off-by: Stephan Gerhold 
> > ---
> >
> > Related RFC with even more detailed explanations:
> > https://lore.kernel.org/u-boot/yn2f1c926hff+...@gerhold.net/
> >
> > In my tests both U-Boot and Linux are fully functional with this patch.
> > However, I would appreciate further testing, since my testing does
> > likely not represent a typical usage scenario for the DragonBoard 410c.
> >
> > When testing, please pick the following pending patch additionally:
> >   https://lore.kernel.org/u-boot/20210705121847.48432-1-step...@gerhold.net/
> > on top of u-boot/master.
> >
> > ---
> > [...]
>
> Thanks Stephan, it looks very good.
> I started testing it, it builds correctly and I flashed and everything
> seems to work.
> I do have a problem with my TFTP setup, so I didn't boot Linux yet,
> but I will get to it, if it will boot successfully we can merge this
> one.
> 
> U-boot doesn't know how to boot qcom android kernel partitions, I'm
> not sure this is something I even want to start supporting in U-boot.

It's probably not too hard to support this (I actually boot the same
Android boot images on both LK and U-Boot via "fastboot boot", because
this is the workflow I'm used to). But I agree that anything else
(i.e. reading the images from partitions) is not worth the effort.

> Nico, do you think you can change the format of the BOOT partition to
> host a u-boot FIT image ?
> 

Is a "boot" partition with a binary image even useful at all?
I would expect that all typical Linux distributions except Android have
a separate boot partition with a file system, so setting something up
that works with the generic distro configuration (doc/README.distro)
would be probably best. This would also avoid having to re-build the
image just to change the cmdline for example.

Stephan


Re: [PATCH] board: dragonboard410c: Load U-Boot directly without LK

2021-07-10 Thread Ramon Fried
On Wed, Jul 7, 2021 at 12:06 PM Stephan Gerhold  wrote:
>
> At the moment the U-Boot port for the DragonBoard 410c is designed
> to be loaded as an Android boot image after Qualcomm's Little Kernel (LK)
> bootloader. This is simple to set up but LK is redundant in this case,
> since everything done by LK can be also done directly by U-Boot.
>
> Dropping LK entirely has at least the following advantages:
>   - Easier installation/board code (no need for Android boot images)
>   - (Slightly) faster boot
>   - Boot directly in 64-bit without a round trip to 32-bit for LK
>
> So far this was not possible yet because of unsolved problems:
>
>   1. Signing tool: The firmware expects a "signed" ELF image with extra
>  (Qualcomm-specific) ELF headers, usually used for secure boot.
>  The DragonBoard 410c does not have secure boot by default but the
>  extra ELF headers are still required.
>
>   2. PSCI bug: There seems to be a bug in the PSCI implementation
>  (part of the TrustZone/tz firmware) that causes all other CPU cores
>  to be started in 32-bit mode if LK is missing in the boot chain.
>  This causes Linux to hang early during boot.
>
> There is a solution for both problems now:
>
>   1. qtestsign (https://github.com/msm8916-mainline/qtestsign)
>  can be used as a "signing" tool for U-Boot and other firmware.
>
>   2. A workaround for the "PSCI bug" is to execute the TZ syscall when
>  entering U-Boot. That way PSCI is made aware of the 64-bit switch
>  and starts all other CPU cores in 64-bit mode as well.
>
> Simplify the dragonboard410c board by removing all the extra code that
> is only used to build an Android boot image that can be loaded by LK.
> This allows dropping the custom linker script, special image magic,
> as well as most of the special build/installation instructions.
>
> CONFIG_REMAKE_ELF is used to build a new ELF image that has both U-Boot
> and the appended DTB combined. The resulting u-boot.elf can then be
> passed to the "signing" tool (e.g. qtestsign).
>
> The PSCI workaround is placed in the "boot0" hook that is enabled
> with CONFIG_ENABLE_ARM_SOC_BOOT0_HOOK. The extra check for EL1 allows
> compatibility with custom firmware that enters U-Boot in EL2 or EL3,
> e.g. qhypstub (https://github.com/msm8916-mainline/qhypstub).
>
> As a first step these changes apply only to DragonBoard410c.
> Similar changes could likely also work for the DragonBoard 820c.
>
> Note that removing LK wouldn't be possible that easily without a lot of
> work already done three years ago by Ramon Fried. A lot of missing
> initialization, pinctrl etc was already added back then even though
> it was not strictly needed yet.
>
> Cc: Ramon Fried 
> Signed-off-by: Stephan Gerhold 
> ---
>
> Related RFC with even more detailed explanations:
> https://lore.kernel.org/u-boot/yn2f1c926hff+...@gerhold.net/
>
> In my tests both U-Boot and Linux are fully functional with this patch.
> However, I would appreciate further testing, since my testing does
> likely not represent a typical usage scenario for the DragonBoard 410c.
>
> When testing, please pick the following pending patch additionally:
>   https://lore.kernel.org/u-boot/20210705121847.48432-1-step...@gerhold.net/
> on top of u-boot/master.
>
> ---
>  arch/arm/mach-snapdragon/Kconfig  |   1 +
>  arch/arm/mach-snapdragon/include/mach/boot0.h |  54 
>  board/qualcomm/dragonboard410c/MAINTAINERS|   1 +
>  board/qualcomm/dragonboard410c/Makefile   |   2 -
>  .../dragonboard410c/dragonboard410c.c |  13 --
>  board/qualcomm/dragonboard410c/head.S |  33 -
>  .../qualcomm/dragonboard410c/lowlevel_init.S  |  27 
>  board/qualcomm/dragonboard410c/readme.txt |  73 +--
>  board/qualcomm/dragonboard410c/u-boot.lds | 118 --
>  configs/dragonboard410c_defconfig |   2 +-
>  doc/board/index.rst   |   1 +
>  doc/board/qualcomm/dragonboard410c.rst|  45 +++
>  doc/board/qualcomm/index.rst  |   9 ++
>  include/configs/dragonboard410c.h |   3 +
>  14 files changed, 120 insertions(+), 262 deletions(-)
>  create mode 100644 arch/arm/mach-snapdragon/include/mach/boot0.h
>  delete mode 100644 board/qualcomm/dragonboard410c/head.S
>  delete mode 100644 board/qualcomm/dragonboard410c/lowlevel_init.S
>  delete mode 100644 board/qualcomm/dragonboard410c/u-boot.lds
>  create mode 100644 doc/board/qualcomm/dragonboard410c.rst
>  create mode 100644 doc/board/qualcomm/index.rst
>
> diff --git a/arch/arm/mach-snapdragon/Kconfig 
> b/arch/arm/mach-snapdragon/Kconfig
> index e562d693c6..0ec74fa5d3 100644
> --- a/arch/arm/mach-snapdragon/Kconfig
> +++ b/arch/arm/mach-snapdragon/Kconfig
> @@ -15,6 +15,7 @@ choice
>  config TARGET_DRAGONBOARD410C
> bool "96Boards Dragonboard 410C"
> select BOARD_LATE_INIT
> +   select ENABLE_ARM_SOC_BOOT0_HOOK
> help
>   Support for 

[PATCH 11/11] imx: ventana: display 'none' for MMC if board does not have it

2021-07-10 Thread sbabic
> print 'None' instead of just a blank line if nothing is detected:
> MMC:  None
> Signed-off-by: Tim Harvey 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH 07/11] imx: ventana: put LTC3676 regulators in continuous mode

2021-07-10 Thread sbabic
> In the default pulse-skipping mode regulators that are very lightly
> loaded can fail to regulate properly. Switching them to always use
> continuous mode causes only around 10mW of overall system power
> difference in a lightly loaded system that isn't already operating
> them in continuous mode.
> Signed-off-by: Tim Harvey 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH v3 4/9] board: phytec: phycore_imx8mp: Change debug UART

2021-07-10 Thread sbabic
> With the first redesign the debug UART had changed from
> UART2 to UART1.
> As the first hardware revision is considered as alpha and
> will not be supported in future. The old setup will not
> be preserved.
> Signed-off-by: Teresa Remmet 
> Reviewed-by: Fabio Estevam 
> Reviewed-by: Heiko Schocher 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH v3 9/9] board: phytec: imx8mp-phycore: Switch to binman

2021-07-10 Thread sbabic
> Use now binman for image creation.
> Signed-off-by: Teresa Remmet 
> Reviewed-by: Fabio Estevam 
> Reviewed-by: Heiko Schocher 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[RESEND PATCH 4/6] imx8m: Restrict usable memory to space below 4G boundary

2021-07-10 Thread sbabic
> From: Frieder Schrempf 
> Some IPs have their accessible address space restricted by the
> interconnect. Let's make sure U-Boot only ever uses the space below
> the 4G address boundary (which is 3GiB big), even when the effective
> available memory is bigger.
> We implement board_get_usable_ram_top() for all i.MX8M SoCs, as the
> whole family is affected by this.
> Signed-off-by: Frieder Schrempf 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH 04/11] imx: ventana: add legacy uboot image support

2021-07-10 Thread sbabic
> Add Legacy U-Boot image support needed to boot a uImage.
> Signed-off-by: Tim Harvey 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH v3 8/9] arm: dts: imx8mp-phyboard-pollux-rdk-u-boot: Add wdog pinctrl entry

2021-07-10 Thread sbabic
> Add missing pinctrl entry in spl.
> Signed-off-by: Teresa Remmet 
> Reviewed-by: Fabio Estevam 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[RESEND PATCH 1/6] mtd: spi-nor-ids: Add support for Macronix MX25V8035F and MX25R1635F

2021-07-10 Thread sbabic
> From: Frieder Schrempf 
> The MX25V8035F is a 8Mb SPI NOR flash and the MX25R1635F is very
> similar, but has twice the size (16Mb) and supports a wider supply
> voltage range.
> They were tested on the Kontron Electronics i.MX6UL and i.MX8MM SoMs.
> Signed-off-by: Frieder Schrempf 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH 05/11] imx: ventana: add PMIC fix for GW54xx-G

2021-07-10 Thread sbabic
> Substitutions in EOL parts changes the VDD_2P5 voltage rail such that
> the previously unused VGEN6 LDO is needed in place of the lower power
> VGEN5 for the GW54xx-G.
> Signed-off-by: Tim Harvey 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH 06/11] imx: ventana: put PFUZ100 regulators in continuous mode

2021-07-10 Thread sbabic
> In the default 'auto' mode regulators that are very lightly loaded
> can be put in PFM mode and fail to regulator properly. Switching them
> to always use continuous PWM mode has a neglibable affect on system
> power and garuntees proper regulation under lightly loaded circumstances.
> Signed-off-by: Tim Harvey 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH v3 7/9] board: phytec: phycore-imx8mp: Enable DVS1 control

2021-07-10 Thread sbabic
> Enable DVS1 control through PMIC_STBY_REQ.
> Signed-off-by: Teresa Remmet 
> Reviewed-by: Fabio Estevam 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH v2] pci: imx: use reset-gpios if defined by device-tree

2021-07-10 Thread sbabic
> If reset-gpio is defined by device-tree use that if
> CONFIG_PCIE_IMX_PERST_GPIO is not defined.
> Note that after this the following boards which define
> CONFIG_PCIE_IMX_PERST_GPIO in their board header file as well as their
> device-tree should be able to remove CONFIG_PCIE_IMX_PERST_GPIO without
> consequence:
>  - mx6sabresd
>  - mx6sxsabresd
>  - novena
>  - tbs2910
>  - vining_2000
> Note that the ge_bx50v3 board uses CONFIG_PCIE_IMX_PERST_GPIO and does
> not have reset-gpios defined it it's pcie node in the dt thus removing
> CONFIG_PCIE_IMX_PERST_GPIO globally can't be done until that board adds
> reset-gpios.
> Cc: Ian Ray  (maintainer:GE BX50V3 BOARD)
> Cc: Sebastian Reichel  (maintainer:GE BX50V3 
> BOARD)
> Cc: Fabio Estevam  (maintainer:MX6SABRESD BOARD)
> Cc: Marek Vasut  (maintainer:NOVENA BOARD)
> Cc: Soeren Moch  (maintainer:TBS2910 BOARD)
> Cc: Silvio Fricke  (maintainer:VINING_2000 BOARD)
> Signed-off-by: Tim Harvey 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


  1   2   >