u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] ARM: imx8m: Deduplicate CAAM init with arch_misc_init() call
@ 2022-09-19 19:41 Marek Vasut
  2022-09-19 19:41 ` [PATCH 2/4] ARM: imx8m: phycore_imx8mm: Drop bogus spl_board_init() Marek Vasut
                   ` (4 more replies)
  0 siblings, 5 replies; 30+ messages in thread
From: Marek Vasut @ 2022-09-19 19:41 UTC (permalink / raw)
  To: u-boot
  Cc: Marek Vasut, Fabio Estevam, Frieder Schrempf, Marcel Ziswiler,
	Max Krummenacher, Peng Fan, Stefano Babic, Teresa Remmet

Instead of duplicating code implemented by i.MX8M version of arch_misc_init()
in every board, enable CONFIG_ARCH_MISC_INIT and call arch_misc_init() from
spl_board_init(). This removes the duplication. No functional change.

Signed-off-by: Marek Vasut <marex@denx.de>
---
Cc: Fabio Estevam <festevam@denx.de>
Cc: Frieder Schrempf <frieder.schrempf@kontron.de>
Cc: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Cc: Max Krummenacher <max.krummenacher@toradex.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Teresa Remmet <t.remmet@phytec.de>
---
 board/freescale/imx8mm_evk/spl.c   | 10 +---------
 board/freescale/imx8mn_evk/spl.c   |  7 ++-----
 board/freescale/imx8mp_evk/spl.c   |  8 +-------
 board/kontron/sl-mx8mm/spl.c       |  6 +-----
 board/toradex/verdin-imx8mm/spl.c  |  9 +--------
 configs/imx8mm-mx8menlo_defconfig  |  1 +
 configs/imx8mm_evk_defconfig       |  1 +
 configs/imx8mm_evk_fspi_defconfig  |  1 +
 configs/imx8mp_evk_defconfig       |  1 +
 configs/kontron-sl-mx8mm_defconfig |  1 +
 configs/verdin-imx8mm_defconfig    |  1 +
 11 files changed, 12 insertions(+), 34 deletions(-)

diff --git a/board/freescale/imx8mm_evk/spl.c b/board/freescale/imx8mm_evk/spl.c
index e2eb1426c83..e0e97c7fd9a 100644
--- a/board/freescale/imx8mm_evk/spl.c
+++ b/board/freescale/imx8mm_evk/spl.c
@@ -53,15 +53,7 @@ static void spl_dram_init(void)
 
 void spl_board_init(void)
 {
-	if (IS_ENABLED(CONFIG_FSL_CAAM)) {
-		struct udevice *dev;
-		int ret;
-
-		ret = uclass_get_device_by_driver(UCLASS_MISC, DM_DRIVER_GET(caam_jr), &dev);
-		if (ret)
-			printf("Failed to initialize caam_jr: %d\n", ret);
-	}
-	puts("Normal Boot\n");
+	arch_misc_init();
 }
 
 #ifdef CONFIG_SPL_LOAD_FIT
diff --git a/board/freescale/imx8mn_evk/spl.c b/board/freescale/imx8mn_evk/spl.c
index c0bfb67199a..380abecd746 100644
--- a/board/freescale/imx8mn_evk/spl.c
+++ b/board/freescale/imx8mn_evk/spl.c
@@ -49,11 +49,8 @@ void spl_board_init(void)
 	struct udevice *dev;
 	int ret;
 
-	if (IS_ENABLED(CONFIG_FSL_CAAM)) {
-		ret = uclass_get_device_by_driver(UCLASS_MISC, DM_DRIVER_GET(caam_jr), &dev);
-		if (ret)
-			printf("Failed to initialize caam_jr: %d\n", ret);
-	}
+	arch_misc_init();
+
 	puts("Normal Boot\n");
 
 	ret = uclass_get_device_by_name(UCLASS_CLK,
diff --git a/board/freescale/imx8mp_evk/spl.c b/board/freescale/imx8mp_evk/spl.c
index 719b1f6d7da..f1b285417d0 100644
--- a/board/freescale/imx8mp_evk/spl.c
+++ b/board/freescale/imx8mp_evk/spl.c
@@ -37,14 +37,8 @@ void spl_dram_init(void)
 
 void spl_board_init(void)
 {
-	if (IS_ENABLED(CONFIG_FSL_CAAM)) {
-		struct udevice *dev;
-		int ret;
+	arch_misc_init();
 
-		ret = uclass_get_device_by_driver(UCLASS_MISC, DM_DRIVER_GET(caam_jr), &dev);
-		if (ret)
-			printf("Failed to initialize caam_jr: %d\n", ret);
-	}
 	/*
 	 * Set GIC clock to 500Mhz for OD VDD_SOC. Kernel driver does
 	 * not allow to change it. Should set the clock after PMIC
diff --git a/board/kontron/sl-mx8mm/spl.c b/board/kontron/sl-mx8mm/spl.c
index 09f81351dd4..b884c91aef9 100644
--- a/board/kontron/sl-mx8mm/spl.c
+++ b/board/kontron/sl-mx8mm/spl.c
@@ -205,11 +205,7 @@ void spl_board_init(void)
 	struct udevice *dev;
 	int ret;
 
-	if (IS_ENABLED(CONFIG_FSL_CAAM)) {
-		ret = uclass_get_device_by_driver(UCLASS_MISC, DM_DRIVER_GET(caam_jr), &dev);
-		if (ret)
-			printf("Failed to initialize %s: %d\n", dev->name, ret);
-	}
+	arch_misc_init();
 
 	puts("Normal Boot\n");
 
diff --git a/board/toradex/verdin-imx8mm/spl.c b/board/toradex/verdin-imx8mm/spl.c
index fb9aae6c9c8..59a3d9e0cae 100644
--- a/board/toradex/verdin-imx8mm/spl.c
+++ b/board/toradex/verdin-imx8mm/spl.c
@@ -53,14 +53,7 @@ void spl_dram_init(void)
 
 void spl_board_init(void)
 {
-	if (IS_ENABLED(CONFIG_FSL_CAAM)) {
-		struct udevice *dev;
-		int ret;
-
-		ret = uclass_get_device_by_driver(UCLASS_MISC, DM_DRIVER_GET(caam_jr), &dev);
-		if (ret)
-			printf("Failed to initialize %s: %d\n", dev->name, ret);
-	}
+	arch_misc_init();
 
 	/* Serial download mode */
 	if (is_usb_boot()) {
diff --git a/configs/imx8mm-mx8menlo_defconfig b/configs/imx8mm-mx8menlo_defconfig
index 702162f86de..929ff382f27 100644
--- a/configs/imx8mm-mx8menlo_defconfig
+++ b/configs/imx8mm-mx8menlo_defconfig
@@ -34,6 +34,7 @@ CONFIG_DEFAULT_FDT_FILE="imx8mm-mx8menlo.dtb"
 CONFIG_LOG=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
+CONFIG_ARCH_MISC_INIT=y
 CONFIG_BOARD_LATE_INIT=y
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x910000
diff --git a/configs/imx8mm_evk_defconfig b/configs/imx8mm_evk_defconfig
index 7bcedcd51f5..58b5e468a58 100644
--- a/configs/imx8mm_evk_defconfig
+++ b/configs/imx8mm_evk_defconfig
@@ -23,6 +23,7 @@ CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
 # CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_SYSTEM_SETUP=y
+CONFIG_ARCH_MISC_INIT=y
 CONFIG_BOARD_LATE_INIT=y
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x910000
diff --git a/configs/imx8mm_evk_fspi_defconfig b/configs/imx8mm_evk_fspi_defconfig
index 21fd7e08db1..73c96f634ce 100644
--- a/configs/imx8mm_evk_fspi_defconfig
+++ b/configs/imx8mm_evk_fspi_defconfig
@@ -24,6 +24,7 @@ CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
 # CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_SYSTEM_SETUP=y
+CONFIG_ARCH_MISC_INIT=y
 CONFIG_BOARD_LATE_INIT=y
 CONFIG_SPL_MAX_SIZE=0x25000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
diff --git a/configs/imx8mp_evk_defconfig b/configs/imx8mp_evk_defconfig
index 0be1951e740..406e89e428b 100644
--- a/configs/imx8mp_evk_defconfig
+++ b/configs/imx8mp_evk_defconfig
@@ -28,6 +28,7 @@ CONFIG_SPL_LOAD_FIT=y
 # CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_DEFAULT_FDT_FILE="imx8mp-evk.dtb"
+CONFIG_ARCH_MISC_INIT=y
 CONFIG_BOARD_LATE_INIT=y
 CONFIG_SPL_MAX_SIZE=0x26000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
diff --git a/configs/kontron-sl-mx8mm_defconfig b/configs/kontron-sl-mx8mm_defconfig
index 5387f65926f..43731e4c280 100644
--- a/configs/kontron-sl-mx8mm_defconfig
+++ b/configs/kontron-sl-mx8mm_defconfig
@@ -27,6 +27,7 @@ CONFIG_SPL_LOAD_FIT=y
 # CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_BOARD_TYPES=y
+CONFIG_ARCH_MISC_INIT=y
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x910000
 CONFIG_SPL_BSS_MAX_SIZE=0x2000
diff --git a/configs/verdin-imx8mm_defconfig b/configs/verdin-imx8mm_defconfig
index f65b4a7f307..230fe55d068 100644
--- a/configs/verdin-imx8mm_defconfig
+++ b/configs/verdin-imx8mm_defconfig
@@ -36,6 +36,7 @@ CONFIG_PREBOOT="test -n ${fdtfile} || setenv fdtfile imx8mm-verdin-${variant}-${
 CONFIG_LOG=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
+CONFIG_ARCH_MISC_INIT=y
 CONFIG_BOARD_LATE_INIT=y
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x910000
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 2/4] ARM: imx8m: phycore_imx8mm: Drop bogus spl_board_init()
  2022-09-19 19:41 [PATCH 1/4] ARM: imx8m: Deduplicate CAAM init with arch_misc_init() call Marek Vasut
@ 2022-09-19 19:41 ` Marek Vasut
  2022-09-21  5:31   ` Peng Fan
  2022-10-21 11:42   ` sbabic
  2022-09-19 19:41 ` [PATCH 3/4] ARM: imx8m: verdin-imx8mm: Drop bogus content from spl_board_init() Marek Vasut
                   ` (3 subsequent siblings)
  4 siblings, 2 replies; 30+ messages in thread
From: Marek Vasut @ 2022-09-19 19:41 UTC (permalink / raw)
  To: u-boot; +Cc: Marek Vasut, Fabio Estevam, Peng Fan, Stefano Babic, Teresa Remmet

The current implementation of spl_board_init() is not correct,
the MX8MM BootROM v1 does not support SDP load when re-entered
from U-Boot SPL, it is up to U-Boot to perform the next stage
load using its own internal CI gadget driver and SDP protocol
implementation. Drop the spl_board_init() to let SPL continue
with normal load in case the SDP support is enabled.

Signed-off-by: Marek Vasut <marex@denx.de>
---
Cc: Fabio Estevam <festevam@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Teresa Remmet <t.remmet@phytec.de>
---
 board/phytec/phycore_imx8mm/spl.c | 10 ----------
 configs/phycore-imx8mm_defconfig  |  1 -
 2 files changed, 11 deletions(-)

diff --git a/board/phytec/phycore_imx8mm/spl.c b/board/phytec/phycore_imx8mm/spl.c
index d87ab6d4497..1bae9b1170d 100644
--- a/board/phytec/phycore_imx8mm/spl.c
+++ b/board/phytec/phycore_imx8mm/spl.c
@@ -42,16 +42,6 @@ static void spl_dram_init(void)
 	ddr_init(&dram_timing);
 }
 
-void spl_board_init(void)
-{
-	/* Serial download mode */
-	if (is_usb_boot()) {
-		puts("Back to ROM, SDP\n");
-		restore_boot_params();
-	}
-	puts("Normal Boot\n");
-}
-
 int board_fit_config_name_match(const char *name)
 {
 	return 0;
diff --git a/configs/phycore-imx8mm_defconfig b/configs/phycore-imx8mm_defconfig
index 9b8c09a73ab..e8d7905bb4a 100644
--- a/configs/phycore-imx8mm_defconfig
+++ b/configs/phycore-imx8mm_defconfig
@@ -30,7 +30,6 @@ CONFIG_BOARD_LATE_INIT=y
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x910000
 CONFIG_SPL_BSS_MAX_SIZE=0x2000
-CONFIG_SPL_BOARD_INIT=y
 # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
 CONFIG_SPL_STACK=0x920000
 CONFIG_SYS_SPL_MALLOC=y
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 3/4] ARM: imx8m: verdin-imx8mm: Drop bogus content from spl_board_init()
  2022-09-19 19:41 [PATCH 1/4] ARM: imx8m: Deduplicate CAAM init with arch_misc_init() call Marek Vasut
  2022-09-19 19:41 ` [PATCH 2/4] ARM: imx8m: phycore_imx8mm: Drop bogus spl_board_init() Marek Vasut
@ 2022-09-19 19:41 ` Marek Vasut
  2022-09-21  5:31   ` Peng Fan
  2022-10-21 11:43   ` sbabic
  2022-09-19 19:41 ` [PATCH 4/4] ARM: dts: imx8m: imx8mm-mx8menlo: Enable SPL SDP support Marek Vasut
                   ` (2 subsequent siblings)
  4 siblings, 2 replies; 30+ messages in thread
From: Marek Vasut @ 2022-09-19 19:41 UTC (permalink / raw)
  To: u-boot
  Cc: Marek Vasut, Fabio Estevam, Marcel Ziswiler, Max Krummenacher,
	Peng Fan, Stefano Babic

The current implementation of spl_board_init() USB boot handling is
not correct, the MX8MM BootROM v1 does not support SDP load when
re-entered from U-Boot SPL, it is up to U-Boot to perform the next
stage load using its own internal CI gadget driver and SDP protocol
implementation. Drop the spl_board_init() to let SPL continue with
normal load in case the SDP support is enabled.

Signed-off-by: Marek Vasut <marex@denx.de>
---
Cc: Fabio Estevam <festevam@denx.de>
Cc: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Cc: Max Krummenacher <max.krummenacher@toradex.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
---
 board/toradex/verdin-imx8mm/spl.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/board/toradex/verdin-imx8mm/spl.c b/board/toradex/verdin-imx8mm/spl.c
index 59a3d9e0cae..210665bd6a9 100644
--- a/board/toradex/verdin-imx8mm/spl.c
+++ b/board/toradex/verdin-imx8mm/spl.c
@@ -54,13 +54,6 @@ void spl_dram_init(void)
 void spl_board_init(void)
 {
 	arch_misc_init();
-
-	/* Serial download mode */
-	if (is_usb_boot()) {
-		puts("Back to ROM, SDP\n");
-		restore_boot_params();
-	}
-	puts("Normal Boot\n");
 }
 
 #ifdef CONFIG_SPL_LOAD_FIT
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 4/4] ARM: dts: imx8m: imx8mm-mx8menlo: Enable SPL SDP support
  2022-09-19 19:41 [PATCH 1/4] ARM: imx8m: Deduplicate CAAM init with arch_misc_init() call Marek Vasut
  2022-09-19 19:41 ` [PATCH 2/4] ARM: imx8m: phycore_imx8mm: Drop bogus spl_board_init() Marek Vasut
  2022-09-19 19:41 ` [PATCH 3/4] ARM: imx8m: verdin-imx8mm: Drop bogus content from spl_board_init() Marek Vasut
@ 2022-09-19 19:41 ` Marek Vasut
  2022-09-19 22:02   ` Fabio Estevam
                     ` (2 more replies)
  2022-09-21  5:31 ` [PATCH 1/4] ARM: imx8m: Deduplicate CAAM init with arch_misc_init() call Peng Fan
  2022-10-21 11:42 ` sbabic
  4 siblings, 3 replies; 30+ messages in thread
From: Marek Vasut @ 2022-09-19 19:41 UTC (permalink / raw)
  To: u-boot
  Cc: Marek Vasut, Fabio Estevam, Marcel Ziswiler, Max Krummenacher,
	Peng Fan, Stefano Babic

Enable DM USB, DM PHY and USB gadget support in imx8mm-mx8menlo SPL
to let the board continue SDP loading of second stage after the first
stage was loaded by BootROM SDP implementation. It is not possible to
jump back into BootROM v1 and let the BootROM implementation continue
the SDP loading, all this has to be performed by the U-Boot CI HDRC
controller driver and SDP protocol implementation, both of which fit
into the SPL just barely.

With this patch, it is possible to start both U-Boot SPL and U-Boot
using e.g. uuu on this board as follows:

$ uuu -brun spl flash.bin

Signed-off-by: Marek Vasut <marex@denx.de>
---
Cc: Fabio Estevam <festevam@denx.de>
Cc: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Cc: Max Krummenacher <max.krummenacher@toradex.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
---
 arch/arm/dts/imx8mm-mx8menlo-u-boot.dtsi | 20 ++++++++++++++++++++
 configs/imx8mm-mx8menlo_defconfig        | 17 ++++++++++++++++-
 2 files changed, 36 insertions(+), 1 deletion(-)

diff --git a/arch/arm/dts/imx8mm-mx8menlo-u-boot.dtsi b/arch/arm/dts/imx8mm-mx8menlo-u-boot.dtsi
index 484d493e33c..7f5f8c384e8 100644
--- a/arch/arm/dts/imx8mm-mx8menlo-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-mx8menlo-u-boot.dtsi
@@ -17,6 +17,26 @@
 	};
 };
 
+&aips4 {
+	u-boot,dm-spl;
+};
+
 &i2c4 {
 	/delete-node/ codec@1a;
 };
+
+&reg_usb_otg1_vbus {
+	u-boot,dm-spl;
+};
+
+&usbmisc1 {
+	u-boot,dm-spl;
+};
+
+&usbphynop1 {
+	u-boot,dm-spl;
+};
+
+&usbotg1 {
+	u-boot,dm-spl;
+};
diff --git a/configs/imx8mm-mx8menlo_defconfig b/configs/imx8mm-mx8menlo_defconfig
index 929ff382f27..ad6885942d3 100644
--- a/configs/imx8mm-mx8menlo_defconfig
+++ b/configs/imx8mm-mx8menlo_defconfig
@@ -50,6 +50,9 @@ CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
 CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x300
 CONFIG_SPL_I2C=y
 CONFIG_SPL_POWER=y
+CONFIG_SPL_USB_HOST=y
+CONFIG_SPL_USB_GADGET=y
+CONFIG_SPL_USB_SDP_SUPPORT=y
 CONFIG_SPL_WATCHDOG=y
 CONFIG_SYS_MAXARGS=64
 CONFIG_SYS_CBSIZE=2048
@@ -65,6 +68,8 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
+CONFIG_CMD_USB_SDP=y
+CONFIG_CMD_USB_MASS_STORAGE=y
 CONFIG_CMD_BOOTCOUNT=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_UUID=y
@@ -106,6 +111,8 @@ CONFIG_PHY_MICREL=y
 CONFIG_PHY_MICREL_KSZ90X1=y
 CONFIG_FEC_MXC=y
 CONFIG_MII=y
+CONFIG_SPL_PHY=y
+CONFIG_SPL_NOP_PHY=y
 CONFIG_PINCTRL=y
 CONFIG_SPL_PINCTRL=y
 CONFIG_PINCTRL_IMX8M=y
@@ -125,7 +132,15 @@ CONFIG_SYSRESET_PSCI=y
 CONFIG_SYSRESET_WATCHDOG=y
 CONFIG_DM_THERMAL=y
 CONFIG_USB=y
-# CONFIG_SPL_DM_USB is not set
 CONFIG_USB_EHCI_HCD=y
+CONFIG_MXC_USB_OTG_HACTIVE=y
+# CONFIG_USB_STORAGE is not set
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Menlo"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0525
+CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
+CONFIG_CI_UDC=y
+CONFIG_SDP_LOADADDR=0x40400000
+CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_IMX_WATCHDOG=y
 CONFIG_OF_LIBFDT_OVERLAY=y
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* Re: [PATCH 4/4] ARM: dts: imx8m: imx8mm-mx8menlo: Enable SPL SDP support
  2022-09-19 19:41 ` [PATCH 4/4] ARM: dts: imx8m: imx8mm-mx8menlo: Enable SPL SDP support Marek Vasut
@ 2022-09-19 22:02   ` Fabio Estevam
  2022-09-24 18:38     ` Adam Ford
  2022-09-21  5:30   ` Peng Fan
  2022-10-21 11:43   ` sbabic
  2 siblings, 1 reply; 30+ messages in thread
From: Fabio Estevam @ 2022-09-19 22:02 UTC (permalink / raw)
  To: Marek Vasut
  Cc: u-boot, Marcel Ziswiler, Max Krummenacher, Peng Fan, Stefano Babic

Hi Marek,

On 19/09/2022 16:41, Marek Vasut wrote:
> Enable DM USB, DM PHY and USB gadget support in imx8mm-mx8menlo SPL
> to let the board continue SDP loading of second stage after the first
> stage was loaded by BootROM SDP implementation. It is not possible to
> jump back into BootROM v1 and let the BootROM implementation continue
> the SDP loading, all this has to be performed by the U-Boot CI HDRC
> controller driver and SDP protocol implementation, both of which fit
> into the SPL just barely.
> 
> With this patch, it is possible to start both U-Boot SPL and U-Boot
> using e.g. uuu on this board as follows:
> 
> $ uuu -brun spl flash.bin
> 
> Signed-off-by: Marek Vasut <marex@denx.de>

This is great, I was able to test SPL SDP on an imx8mm-evk after 
applying these
same changes to imx8mm-evk and reducing the SPL size.

For the series:

Reviewed-by: Fabio Estevam <festevam@denx.de>

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 4/4] ARM: dts: imx8m: imx8mm-mx8menlo: Enable SPL SDP support
  2022-09-19 19:41 ` [PATCH 4/4] ARM: dts: imx8m: imx8mm-mx8menlo: Enable SPL SDP support Marek Vasut
  2022-09-19 22:02   ` Fabio Estevam
@ 2022-09-21  5:30   ` Peng Fan
  2022-09-22  2:42     ` Marek Vasut
  2022-10-21 11:43   ` sbabic
  2 siblings, 1 reply; 30+ messages in thread
From: Peng Fan @ 2022-09-21  5:30 UTC (permalink / raw)
  To: Marek Vasut, u-boot
  Cc: Fabio Estevam, Marcel Ziswiler, Max Krummenacher, Peng Fan,
	Stefano Babic



On 9/20/2022 3:41 AM, Marek Vasut wrote:
> Enable DM USB, DM PHY and USB gadget support in imx8mm-mx8menlo SPL
> to let the board continue SDP loading of second stage after the first
> stage was loaded by BootROM SDP implementation. It is not possible to
> jump back into BootROM v1 and let the BootROM implementation continue
> the SDP loading, all this has to be performed by the U-Boot CI HDRC
> controller driver and SDP protocol implementation, both of which fit
> into the SPL just barely.
> 
> With this patch, it is possible to start both U-Boot SPL and U-Boot
> using e.g. uuu on this board as follows:
> 
> $ uuu -brun spl flash.bin
> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> ---
> Cc: Fabio Estevam <festevam@denx.de>
> Cc: Marcel Ziswiler <marcel.ziswiler@toradex.com>
> Cc: Max Krummenacher <max.krummenacher@toradex.com>
> Cc: Peng Fan <peng.fan@nxp.com>
> Cc: Stefano Babic <sbabic@denx.de>
> ---
>   arch/arm/dts/imx8mm-mx8menlo-u-boot.dtsi | 20 ++++++++++++++++++++
>   configs/imx8mm-mx8menlo_defconfig        | 17 ++++++++++++++++-
>   2 files changed, 36 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/dts/imx8mm-mx8menlo-u-boot.dtsi b/arch/arm/dts/imx8mm-mx8menlo-u-boot.dtsi
> index 484d493e33c..7f5f8c384e8 100644
> --- a/arch/arm/dts/imx8mm-mx8menlo-u-boot.dtsi
> +++ b/arch/arm/dts/imx8mm-mx8menlo-u-boot.dtsi
> @@ -17,6 +17,26 @@
>   	};
>   };
>   
> +&aips4 {
> +	u-boot,dm-spl;
> +};
> +
>   &i2c4 {
>   	/delete-node/ codec@1a;
>   };
> +
> +&reg_usb_otg1_vbus {
> +	u-boot,dm-spl;
> +};
> +
> +&usbmisc1 {
> +	u-boot,dm-spl;
> +};
> +
> +&usbphynop1 {
> +	u-boot,dm-spl;
> +};
> +
> +&usbotg1 {
> +	u-boot,dm-spl;
> +};
> diff --git a/configs/imx8mm-mx8menlo_defconfig b/configs/imx8mm-mx8menlo_defconfig
> index 929ff382f27..ad6885942d3 100644
> --- a/configs/imx8mm-mx8menlo_defconfig
> +++ b/configs/imx8mm-mx8menlo_defconfig
> @@ -50,6 +50,9 @@ CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
>   CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x300
>   CONFIG_SPL_I2C=y
>   CONFIG_SPL_POWER=y
> +CONFIG_SPL_USB_HOST=y

Nitpick, would this option required?

Otherwise looks good to me,

Reviewed-by: Peng Fan <peng.fan@nxp.com>

> +CONFIG_SPL_USB_GADGET=y
> +CONFIG_SPL_USB_SDP_SUPPORT=y
>   CONFIG_SPL_WATCHDOG=y
>   CONFIG_SYS_MAXARGS=64
>   CONFIG_SYS_CBSIZE=2048
> @@ -65,6 +68,8 @@ CONFIG_CMD_GPIO=y
>   CONFIG_CMD_I2C=y
>   CONFIG_CMD_MMC=y
>   CONFIG_CMD_USB=y
> +CONFIG_CMD_USB_SDP=y
> +CONFIG_CMD_USB_MASS_STORAGE=y
>   CONFIG_CMD_BOOTCOUNT=y
>   CONFIG_CMD_CACHE=y
>   CONFIG_CMD_UUID=y
> @@ -106,6 +111,8 @@ CONFIG_PHY_MICREL=y
>   CONFIG_PHY_MICREL_KSZ90X1=y
>   CONFIG_FEC_MXC=y
>   CONFIG_MII=y
> +CONFIG_SPL_PHY=y
> +CONFIG_SPL_NOP_PHY=y
>   CONFIG_PINCTRL=y
>   CONFIG_SPL_PINCTRL=y
>   CONFIG_PINCTRL_IMX8M=y
> @@ -125,7 +132,15 @@ CONFIG_SYSRESET_PSCI=y
>   CONFIG_SYSRESET_WATCHDOG=y
>   CONFIG_DM_THERMAL=y
>   CONFIG_USB=y
> -# CONFIG_SPL_DM_USB is not set
>   CONFIG_USB_EHCI_HCD=y
> +CONFIG_MXC_USB_OTG_HACTIVE=y
> +# CONFIG_USB_STORAGE is not set
> +CONFIG_USB_GADGET=y
> +CONFIG_USB_GADGET_MANUFACTURER="Menlo"
> +CONFIG_USB_GADGET_VENDOR_NUM=0x0525
> +CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
> +CONFIG_CI_UDC=y
> +CONFIG_SDP_LOADADDR=0x40400000
> +CONFIG_USB_GADGET_DOWNLOAD=y
>   CONFIG_IMX_WATCHDOG=y
>   CONFIG_OF_LIBFDT_OVERLAY=y

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 1/4] ARM: imx8m: Deduplicate CAAM init with arch_misc_init() call
  2022-09-19 19:41 [PATCH 1/4] ARM: imx8m: Deduplicate CAAM init with arch_misc_init() call Marek Vasut
                   ` (2 preceding siblings ...)
  2022-09-19 19:41 ` [PATCH 4/4] ARM: dts: imx8m: imx8mm-mx8menlo: Enable SPL SDP support Marek Vasut
@ 2022-09-21  5:31 ` Peng Fan
  2022-10-21 11:52   ` Stefano Babic
  2022-10-21 11:42 ` sbabic
  4 siblings, 1 reply; 30+ messages in thread
From: Peng Fan @ 2022-09-21  5:31 UTC (permalink / raw)
  To: Marek Vasut, u-boot
  Cc: Fabio Estevam, Frieder Schrempf, Marcel Ziswiler,
	Max Krummenacher, Peng Fan, Stefano Babic, Teresa Remmet



On 9/20/2022 3:41 AM, Marek Vasut wrote:
> Instead of duplicating code implemented by i.MX8M version of arch_misc_init()
> in every board, enable CONFIG_ARCH_MISC_INIT and call arch_misc_init() from
> spl_board_init(). This removes the duplication. No functional change.
> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> ---
> Cc: Fabio Estevam <festevam@denx.de>
> Cc: Frieder Schrempf <frieder.schrempf@kontron.de>
> Cc: Marcel Ziswiler <marcel.ziswiler@toradex.com>
> Cc: Max Krummenacher <max.krummenacher@toradex.com>
> Cc: Peng Fan <peng.fan@nxp.com>
> Cc: Stefano Babic <sbabic@denx.de>
> Cc: Teresa Remmet <t.remmet@phytec.de>

Reviewed-by: Peng Fan <peng.fan@nxp.com>
> ---
>   board/freescale/imx8mm_evk/spl.c   | 10 +---------
>   board/freescale/imx8mn_evk/spl.c   |  7 ++-----
>   board/freescale/imx8mp_evk/spl.c   |  8 +-------
>   board/kontron/sl-mx8mm/spl.c       |  6 +-----
>   board/toradex/verdin-imx8mm/spl.c  |  9 +--------
>   configs/imx8mm-mx8menlo_defconfig  |  1 +
>   configs/imx8mm_evk_defconfig       |  1 +
>   configs/imx8mm_evk_fspi_defconfig  |  1 +
>   configs/imx8mp_evk_defconfig       |  1 +
>   configs/kontron-sl-mx8mm_defconfig |  1 +
>   configs/verdin-imx8mm_defconfig    |  1 +
>   11 files changed, 12 insertions(+), 34 deletions(-)
> 
> diff --git a/board/freescale/imx8mm_evk/spl.c b/board/freescale/imx8mm_evk/spl.c
> index e2eb1426c83..e0e97c7fd9a 100644
> --- a/board/freescale/imx8mm_evk/spl.c
> +++ b/board/freescale/imx8mm_evk/spl.c
> @@ -53,15 +53,7 @@ static void spl_dram_init(void)
>   
>   void spl_board_init(void)
>   {
> -	if (IS_ENABLED(CONFIG_FSL_CAAM)) {
> -		struct udevice *dev;
> -		int ret;
> -
> -		ret = uclass_get_device_by_driver(UCLASS_MISC, DM_DRIVER_GET(caam_jr), &dev);
> -		if (ret)
> -			printf("Failed to initialize caam_jr: %d\n", ret);
> -	}
> -	puts("Normal Boot\n");
> +	arch_misc_init();
>   }
>   
>   #ifdef CONFIG_SPL_LOAD_FIT
> diff --git a/board/freescale/imx8mn_evk/spl.c b/board/freescale/imx8mn_evk/spl.c
> index c0bfb67199a..380abecd746 100644
> --- a/board/freescale/imx8mn_evk/spl.c
> +++ b/board/freescale/imx8mn_evk/spl.c
> @@ -49,11 +49,8 @@ void spl_board_init(void)
>   	struct udevice *dev;
>   	int ret;
>   
> -	if (IS_ENABLED(CONFIG_FSL_CAAM)) {
> -		ret = uclass_get_device_by_driver(UCLASS_MISC, DM_DRIVER_GET(caam_jr), &dev);
> -		if (ret)
> -			printf("Failed to initialize caam_jr: %d\n", ret);
> -	}
> +	arch_misc_init();
> +
>   	puts("Normal Boot\n");
>   
>   	ret = uclass_get_device_by_name(UCLASS_CLK,
> diff --git a/board/freescale/imx8mp_evk/spl.c b/board/freescale/imx8mp_evk/spl.c
> index 719b1f6d7da..f1b285417d0 100644
> --- a/board/freescale/imx8mp_evk/spl.c
> +++ b/board/freescale/imx8mp_evk/spl.c
> @@ -37,14 +37,8 @@ void spl_dram_init(void)
>   
>   void spl_board_init(void)
>   {
> -	if (IS_ENABLED(CONFIG_FSL_CAAM)) {
> -		struct udevice *dev;
> -		int ret;
> +	arch_misc_init();
>   
> -		ret = uclass_get_device_by_driver(UCLASS_MISC, DM_DRIVER_GET(caam_jr), &dev);
> -		if (ret)
> -			printf("Failed to initialize caam_jr: %d\n", ret);
> -	}
>   	/*
>   	 * Set GIC clock to 500Mhz for OD VDD_SOC. Kernel driver does
>   	 * not allow to change it. Should set the clock after PMIC
> diff --git a/board/kontron/sl-mx8mm/spl.c b/board/kontron/sl-mx8mm/spl.c
> index 09f81351dd4..b884c91aef9 100644
> --- a/board/kontron/sl-mx8mm/spl.c
> +++ b/board/kontron/sl-mx8mm/spl.c
> @@ -205,11 +205,7 @@ void spl_board_init(void)
>   	struct udevice *dev;
>   	int ret;
>   
> -	if (IS_ENABLED(CONFIG_FSL_CAAM)) {
> -		ret = uclass_get_device_by_driver(UCLASS_MISC, DM_DRIVER_GET(caam_jr), &dev);
> -		if (ret)
> -			printf("Failed to initialize %s: %d\n", dev->name, ret);
> -	}
> +	arch_misc_init();
>   
>   	puts("Normal Boot\n");
>   
> diff --git a/board/toradex/verdin-imx8mm/spl.c b/board/toradex/verdin-imx8mm/spl.c
> index fb9aae6c9c8..59a3d9e0cae 100644
> --- a/board/toradex/verdin-imx8mm/spl.c
> +++ b/board/toradex/verdin-imx8mm/spl.c
> @@ -53,14 +53,7 @@ void spl_dram_init(void)
>   
>   void spl_board_init(void)
>   {
> -	if (IS_ENABLED(CONFIG_FSL_CAAM)) {
> -		struct udevice *dev;
> -		int ret;
> -
> -		ret = uclass_get_device_by_driver(UCLASS_MISC, DM_DRIVER_GET(caam_jr), &dev);
> -		if (ret)
> -			printf("Failed to initialize %s: %d\n", dev->name, ret);
> -	}
> +	arch_misc_init();
>   
>   	/* Serial download mode */
>   	if (is_usb_boot()) {
> diff --git a/configs/imx8mm-mx8menlo_defconfig b/configs/imx8mm-mx8menlo_defconfig
> index 702162f86de..929ff382f27 100644
> --- a/configs/imx8mm-mx8menlo_defconfig
> +++ b/configs/imx8mm-mx8menlo_defconfig
> @@ -34,6 +34,7 @@ CONFIG_DEFAULT_FDT_FILE="imx8mm-mx8menlo.dtb"
>   CONFIG_LOG=y
>   # CONFIG_DISPLAY_BOARDINFO is not set
>   CONFIG_DISPLAY_BOARDINFO_LATE=y
> +CONFIG_ARCH_MISC_INIT=y
>   CONFIG_BOARD_LATE_INIT=y
>   CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
>   CONFIG_SPL_BSS_START_ADDR=0x910000
> diff --git a/configs/imx8mm_evk_defconfig b/configs/imx8mm_evk_defconfig
> index 7bcedcd51f5..58b5e468a58 100644
> --- a/configs/imx8mm_evk_defconfig
> +++ b/configs/imx8mm_evk_defconfig
> @@ -23,6 +23,7 @@ CONFIG_FIT_EXTERNAL_OFFSET=0x3000
>   CONFIG_SPL_LOAD_FIT=y
>   # CONFIG_USE_SPL_FIT_GENERATOR is not set
>   CONFIG_OF_SYSTEM_SETUP=y
> +CONFIG_ARCH_MISC_INIT=y
>   CONFIG_BOARD_LATE_INIT=y
>   CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
>   CONFIG_SPL_BSS_START_ADDR=0x910000
> diff --git a/configs/imx8mm_evk_fspi_defconfig b/configs/imx8mm_evk_fspi_defconfig
> index 21fd7e08db1..73c96f634ce 100644
> --- a/configs/imx8mm_evk_fspi_defconfig
> +++ b/configs/imx8mm_evk_fspi_defconfig
> @@ -24,6 +24,7 @@ CONFIG_FIT_EXTERNAL_OFFSET=0x3000
>   CONFIG_SPL_LOAD_FIT=y
>   # CONFIG_USE_SPL_FIT_GENERATOR is not set
>   CONFIG_OF_SYSTEM_SETUP=y
> +CONFIG_ARCH_MISC_INIT=y
>   CONFIG_BOARD_LATE_INIT=y
>   CONFIG_SPL_MAX_SIZE=0x25000
>   CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
> diff --git a/configs/imx8mp_evk_defconfig b/configs/imx8mp_evk_defconfig
> index 0be1951e740..406e89e428b 100644
> --- a/configs/imx8mp_evk_defconfig
> +++ b/configs/imx8mp_evk_defconfig
> @@ -28,6 +28,7 @@ CONFIG_SPL_LOAD_FIT=y
>   # CONFIG_USE_SPL_FIT_GENERATOR is not set
>   CONFIG_OF_SYSTEM_SETUP=y
>   CONFIG_DEFAULT_FDT_FILE="imx8mp-evk.dtb"
> +CONFIG_ARCH_MISC_INIT=y
>   CONFIG_BOARD_LATE_INIT=y
>   CONFIG_SPL_MAX_SIZE=0x26000
>   CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
> diff --git a/configs/kontron-sl-mx8mm_defconfig b/configs/kontron-sl-mx8mm_defconfig
> index 5387f65926f..43731e4c280 100644
> --- a/configs/kontron-sl-mx8mm_defconfig
> +++ b/configs/kontron-sl-mx8mm_defconfig
> @@ -27,6 +27,7 @@ CONFIG_SPL_LOAD_FIT=y
>   # CONFIG_USE_SPL_FIT_GENERATOR is not set
>   CONFIG_OF_BOARD_SETUP=y
>   CONFIG_BOARD_TYPES=y
> +CONFIG_ARCH_MISC_INIT=y
>   CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
>   CONFIG_SPL_BSS_START_ADDR=0x910000
>   CONFIG_SPL_BSS_MAX_SIZE=0x2000
> diff --git a/configs/verdin-imx8mm_defconfig b/configs/verdin-imx8mm_defconfig
> index f65b4a7f307..230fe55d068 100644
> --- a/configs/verdin-imx8mm_defconfig
> +++ b/configs/verdin-imx8mm_defconfig
> @@ -36,6 +36,7 @@ CONFIG_PREBOOT="test -n ${fdtfile} || setenv fdtfile imx8mm-verdin-${variant}-${
>   CONFIG_LOG=y
>   # CONFIG_DISPLAY_BOARDINFO is not set
>   CONFIG_DISPLAY_BOARDINFO_LATE=y
> +CONFIG_ARCH_MISC_INIT=y
>   CONFIG_BOARD_LATE_INIT=y
>   CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
>   CONFIG_SPL_BSS_START_ADDR=0x910000

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 2/4] ARM: imx8m: phycore_imx8mm: Drop bogus spl_board_init()
  2022-09-19 19:41 ` [PATCH 2/4] ARM: imx8m: phycore_imx8mm: Drop bogus spl_board_init() Marek Vasut
@ 2022-09-21  5:31   ` Peng Fan
  2022-10-21 11:42   ` sbabic
  1 sibling, 0 replies; 30+ messages in thread
From: Peng Fan @ 2022-09-21  5:31 UTC (permalink / raw)
  To: Marek Vasut, u-boot; +Cc: Fabio Estevam, Peng Fan, Stefano Babic, Teresa Remmet



On 9/20/2022 3:41 AM, Marek Vasut wrote:
> The current implementation of spl_board_init() is not correct,
> the MX8MM BootROM v1 does not support SDP load when re-entered
> from U-Boot SPL, it is up to U-Boot to perform the next stage
> load using its own internal CI gadget driver and SDP protocol
> implementation. Drop the spl_board_init() to let SPL continue
> with normal load in case the SDP support is enabled.
> 
> Signed-off-by: Marek Vasut <marex@denx.de>

Reviewed-by: Peng Fan <peng.fan@nxp.com>

> ---
> Cc: Fabio Estevam <festevam@denx.de>
> Cc: Peng Fan <peng.fan@nxp.com>
> Cc: Stefano Babic <sbabic@denx.de>
> Cc: Teresa Remmet <t.remmet@phytec.de>
> ---
>   board/phytec/phycore_imx8mm/spl.c | 10 ----------
>   configs/phycore-imx8mm_defconfig  |  1 -
>   2 files changed, 11 deletions(-)
> 
> diff --git a/board/phytec/phycore_imx8mm/spl.c b/board/phytec/phycore_imx8mm/spl.c
> index d87ab6d4497..1bae9b1170d 100644
> --- a/board/phytec/phycore_imx8mm/spl.c
> +++ b/board/phytec/phycore_imx8mm/spl.c
> @@ -42,16 +42,6 @@ static void spl_dram_init(void)
>   	ddr_init(&dram_timing);
>   }
>   
> -void spl_board_init(void)
> -{
> -	/* Serial download mode */
> -	if (is_usb_boot()) {
> -		puts("Back to ROM, SDP\n");
> -		restore_boot_params();
> -	}
> -	puts("Normal Boot\n");
> -}
> -
>   int board_fit_config_name_match(const char *name)
>   {
>   	return 0;
> diff --git a/configs/phycore-imx8mm_defconfig b/configs/phycore-imx8mm_defconfig
> index 9b8c09a73ab..e8d7905bb4a 100644
> --- a/configs/phycore-imx8mm_defconfig
> +++ b/configs/phycore-imx8mm_defconfig
> @@ -30,7 +30,6 @@ CONFIG_BOARD_LATE_INIT=y
>   CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
>   CONFIG_SPL_BSS_START_ADDR=0x910000
>   CONFIG_SPL_BSS_MAX_SIZE=0x2000
> -CONFIG_SPL_BOARD_INIT=y
>   # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
>   CONFIG_SPL_STACK=0x920000
>   CONFIG_SYS_SPL_MALLOC=y

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 3/4] ARM: imx8m: verdin-imx8mm: Drop bogus content from spl_board_init()
  2022-09-19 19:41 ` [PATCH 3/4] ARM: imx8m: verdin-imx8mm: Drop bogus content from spl_board_init() Marek Vasut
@ 2022-09-21  5:31   ` Peng Fan
  2022-10-21 11:43   ` sbabic
  1 sibling, 0 replies; 30+ messages in thread
From: Peng Fan @ 2022-09-21  5:31 UTC (permalink / raw)
  To: Marek Vasut, u-boot
  Cc: Fabio Estevam, Marcel Ziswiler, Max Krummenacher, Peng Fan,
	Stefano Babic



On 9/20/2022 3:41 AM, Marek Vasut wrote:
> The current implementation of spl_board_init() USB boot handling is
> not correct, the MX8MM BootROM v1 does not support SDP load when
> re-entered from U-Boot SPL, it is up to U-Boot to perform the next
> stage load using its own internal CI gadget driver and SDP protocol
> implementation. Drop the spl_board_init() to let SPL continue with
> normal load in case the SDP support is enabled.
> 

Reviewed-by: Peng Fan <peng.fan@nxp.com>

> Signed-off-by: Marek Vasut <marex@denx.de>
> ---
> Cc: Fabio Estevam <festevam@denx.de>
> Cc: Marcel Ziswiler <marcel.ziswiler@toradex.com>
> Cc: Max Krummenacher <max.krummenacher@toradex.com>
> Cc: Peng Fan <peng.fan@nxp.com>
> Cc: Stefano Babic <sbabic@denx.de>
> ---
>   board/toradex/verdin-imx8mm/spl.c | 7 -------
>   1 file changed, 7 deletions(-)
> 
> diff --git a/board/toradex/verdin-imx8mm/spl.c b/board/toradex/verdin-imx8mm/spl.c
> index 59a3d9e0cae..210665bd6a9 100644
> --- a/board/toradex/verdin-imx8mm/spl.c
> +++ b/board/toradex/verdin-imx8mm/spl.c
> @@ -54,13 +54,6 @@ void spl_dram_init(void)
>   void spl_board_init(void)
>   {
>   	arch_misc_init();
> -
> -	/* Serial download mode */
> -	if (is_usb_boot()) {
> -		puts("Back to ROM, SDP\n");
> -		restore_boot_params();
> -	}
> -	puts("Normal Boot\n");
>   }
>   
>   #ifdef CONFIG_SPL_LOAD_FIT

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 4/4] ARM: dts: imx8m: imx8mm-mx8menlo: Enable SPL SDP support
  2022-09-21  5:30   ` Peng Fan
@ 2022-09-22  2:42     ` Marek Vasut
  0 siblings, 0 replies; 30+ messages in thread
From: Marek Vasut @ 2022-09-22  2:42 UTC (permalink / raw)
  To: Peng Fan, u-boot
  Cc: Fabio Estevam, Marcel Ziswiler, Max Krummenacher, Peng Fan,
	Stefano Babic

On 9/21/22 07:30, Peng Fan wrote:

[...]

>> @@ -50,6 +50,9 @@ CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
>>   CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x300
>>   CONFIG_SPL_I2C=y
>>   CONFIG_SPL_POWER=y
>> +CONFIG_SPL_USB_HOST=y
> 
> Nitpick, would this option required?

Sadly, yes, that's all the common EHCI bits also needed by the UDC.

> Otherwise looks good to me,
> 
> Reviewed-by: Peng Fan <peng.fan@nxp.com>

[...]

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 4/4] ARM: dts: imx8m: imx8mm-mx8menlo: Enable SPL SDP support
  2022-09-19 22:02   ` Fabio Estevam
@ 2022-09-24 18:38     ` Adam Ford
  2022-09-24 18:52       ` Michael Nazzareno Trimarchi
  0 siblings, 1 reply; 30+ messages in thread
From: Adam Ford @ 2022-09-24 18:38 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: Marek Vasut, U-Boot Mailing List, Marcel Ziswiler,
	Max Krummenacher, Peng Fan, Stefano Babic

On Mon, Sep 19, 2022 at 5:02 PM Fabio Estevam <festevam@denx.de> wrote:
>
> Hi Marek,
>
> On 19/09/2022 16:41, Marek Vasut wrote:
> > Enable DM USB, DM PHY and USB gadget support in imx8mm-mx8menlo SPL
> > to let the board continue SDP loading of second stage after the first
> > stage was loaded by BootROM SDP implementation. It is not possible to
> > jump back into BootROM v1 and let the BootROM implementation continue
> > the SDP loading, all this has to be performed by the U-Boot CI HDRC
> > controller driver and SDP protocol implementation, both of which fit
> > into the SPL just barely.
> >
> > With this patch, it is possible to start both U-Boot SPL and U-Boot
> > using e.g. uuu on this board as follows:
> >
> > $ uuu -brun spl flash.bin
> >
> > Signed-off-by: Marek Vasut <marex@denx.de>
>
> This is great, I was able to test SPL SDP on an imx8mm-evk after
> applying these
> same changes to imx8mm-evk and reducing the SPL size.

Fabio,

Can you tell me what you did to reduce the SPL size?

adam
>
> For the series:
>
> Reviewed-by: Fabio Estevam <festevam@denx.de>

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 4/4] ARM: dts: imx8m: imx8mm-mx8menlo: Enable SPL SDP support
  2022-09-24 18:38     ` Adam Ford
@ 2022-09-24 18:52       ` Michael Nazzareno Trimarchi
  2022-09-24 18:54         ` Adam Ford
  0 siblings, 1 reply; 30+ messages in thread
From: Michael Nazzareno Trimarchi @ 2022-09-24 18:52 UTC (permalink / raw)
  To: Adam Ford
  Cc: Fabio Estevam, Marek Vasut, U-Boot Mailing List, Marcel Ziswiler,
	Max Krummenacher, Peng Fan, Stefano Babic

On Sat, Sep 24, 2022 at 8:38 PM Adam Ford <aford173@gmail.com> wrote:
>
> On Mon, Sep 19, 2022 at 5:02 PM Fabio Estevam <festevam@denx.de> wrote:
> >
> > Hi Marek,
> >
> > On 19/09/2022 16:41, Marek Vasut wrote:
> > > Enable DM USB, DM PHY and USB gadget support in imx8mm-mx8menlo SPL
> > > to let the board continue SDP loading of second stage after the first
> > > stage was loaded by BootROM SDP implementation. It is not possible to
> > > jump back into BootROM v1 and let the BootROM implementation continue
> > > the SDP loading, all this has to be performed by the U-Boot CI HDRC
> > > controller driver and SDP protocol implementation, both of which fit
> > > into the SPL just barely.
> > >
> > > With this patch, it is possible to start both U-Boot SPL and U-Boot
> > > using e.g. uuu on this board as follows:
> > >
> > > $ uuu -brun spl flash.bin
> > >
> > > Signed-off-by: Marek Vasut <marex@denx.de>
> >
> > This is great, I was able to test SPL SDP on an imx8mm-evk after
> > applying these
> > same changes to imx8mm-evk and reducing the SPL size.
>
> Fabio,
>
> Can you tell me what you did to reduce the SPL size?
>

CONFIG_LTO from the other patch

Michael

> adam
> >
> > For the series:
> >
> > Reviewed-by: Fabio Estevam <festevam@denx.de>



-- 
Michael Nazzareno Trimarchi
Co-Founder & Chief Executive Officer
M. +39 347 913 2170
michael@amarulasolutions.com
__________________________________

Amarula Solutions BV
Joop Geesinkweg 125, 1114 AB, Amsterdam, NL
T. +31 (0)85 111 9172
info@amarulasolutions.com
www.amarulasolutions.com

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 4/4] ARM: dts: imx8m: imx8mm-mx8menlo: Enable SPL SDP support
  2022-09-24 18:52       ` Michael Nazzareno Trimarchi
@ 2022-09-24 18:54         ` Adam Ford
  2022-09-24 19:00           ` Michael Nazzareno Trimarchi
  0 siblings, 1 reply; 30+ messages in thread
From: Adam Ford @ 2022-09-24 18:54 UTC (permalink / raw)
  To: Michael Nazzareno Trimarchi
  Cc: Fabio Estevam, Marek Vasut, U-Boot Mailing List, Marcel Ziswiler,
	Max Krummenacher, Peng Fan, Stefano Babic

On Sat, Sep 24, 2022 at 1:52 PM Michael Nazzareno Trimarchi
<michael@amarulasolutions.com> wrote:
>
> On Sat, Sep 24, 2022 at 8:38 PM Adam Ford <aford173@gmail.com> wrote:
> >
> > On Mon, Sep 19, 2022 at 5:02 PM Fabio Estevam <festevam@denx.de> wrote:
> > >
> > > Hi Marek,
> > >
> > > On 19/09/2022 16:41, Marek Vasut wrote:
> > > > Enable DM USB, DM PHY and USB gadget support in imx8mm-mx8menlo SPL
> > > > to let the board continue SDP loading of second stage after the first
> > > > stage was loaded by BootROM SDP implementation. It is not possible to
> > > > jump back into BootROM v1 and let the BootROM implementation continue
> > > > the SDP loading, all this has to be performed by the U-Boot CI HDRC
> > > > controller driver and SDP protocol implementation, both of which fit
> > > > into the SPL just barely.
> > > >
> > > > With this patch, it is possible to start both U-Boot SPL and U-Boot
> > > > using e.g. uuu on this board as follows:
> > > >
> > > > $ uuu -brun spl flash.bin
> > > >
> > > > Signed-off-by: Marek Vasut <marex@denx.de>
> > >
> > > This is great, I was able to test SPL SDP on an imx8mm-evk after
> > > applying these
> > > same changes to imx8mm-evk and reducing the SPL size.
> >
> > Fabio,
> >
> > Can you tell me what you did to reduce the SPL size?
> >
>
> CONFIG_LTO from the other patch

Bummer.  I was hoping there was more.  I already have LTO enabled.  I
was hoping there was more to it.

adam
>
> Michael
>
> > adam
> > >
> > > For the series:
> > >
> > > Reviewed-by: Fabio Estevam <festevam@denx.de>
>
>
>
> --
> Michael Nazzareno Trimarchi
> Co-Founder & Chief Executive Officer
> M. +39 347 913 2170
> michael@amarulasolutions.com
> __________________________________
>
> Amarula Solutions BV
> Joop Geesinkweg 125, 1114 AB, Amsterdam, NL
> T. +31 (0)85 111 9172
> info@amarulasolutions.com
> www.amarulasolutions.com

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 4/4] ARM: dts: imx8m: imx8mm-mx8menlo: Enable SPL SDP support
  2022-09-24 18:54         ` Adam Ford
@ 2022-09-24 19:00           ` Michael Nazzareno Trimarchi
  2022-09-24 19:10             ` Adam Ford
  0 siblings, 1 reply; 30+ messages in thread
From: Michael Nazzareno Trimarchi @ 2022-09-24 19:00 UTC (permalink / raw)
  To: Adam Ford
  Cc: Fabio Estevam, Marek Vasut, U-Boot Mailing List, Marcel Ziswiler,
	Max Krummenacher, Peng Fan, Stefano Babic

Il sab 24 set 2022, 20:54 Adam Ford <aford173@gmail.com> ha scritto:

> On Sat, Sep 24, 2022 at 1:52 PM Michael Nazzareno Trimarchi
> <michael@amarulasolutions.com> wrote:
> >
> > On Sat, Sep 24, 2022 at 8:38 PM Adam Ford <aford173@gmail.com> wrote:
> > >
> > > On Mon, Sep 19, 2022 at 5:02 PM Fabio Estevam <festevam@denx.de>
> wrote:
> > > >
> > > > Hi Marek,
> > > >
> > > > On 19/09/2022 16:41, Marek Vasut wrote:
> > > > > Enable DM USB, DM PHY and USB gadget support in imx8mm-mx8menlo SPL
> > > > > to let the board continue SDP loading of second stage after the
> first
> > > > > stage was loaded by BootROM SDP implementation. It is not possible
> to
> > > > > jump back into BootROM v1 and let the BootROM implementation
> continue
> > > > > the SDP loading, all this has to be performed by the U-Boot CI HDRC
> > > > > controller driver and SDP protocol implementation, both of which
> fit
> > > > > into the SPL just barely.
> > > > >
> > > > > With this patch, it is possible to start both U-Boot SPL and U-Boot
> > > > > using e.g. uuu on this board as follows:
> > > > >
> > > > > $ uuu -brun spl flash.bin
> > > > >
> > > > > Signed-off-by: Marek Vasut <marex@denx.de>
> > > >
> > > > This is great, I was able to test SPL SDP on an imx8mm-evk after
> > > > applying these
> > > > same changes to imx8mm-evk and reducing the SPL size.
> > >
> > > Fabio,
> > >
> > > Can you tell me what you did to reduce the SPL size?
> > >
> >
> > CONFIG_LTO from the other patch
>
> Bummer.  I was hoping there was more.  I already have LTO enabled.  I
> was hoping there was more to it.
>

What version of U-Boot are you using?

Mainline or some older one. Are you compile under yocto?

Michael



> adam
> >
> > Michael
> >
> > > adam
> > > >
> > > > For the series:
> > > >
> > > > Reviewed-by: Fabio Estevam <festevam@denx.de>
> >
> >
> >
> > --
> > Michael Nazzareno Trimarchi
> > Co-Founder & Chief Executive Officer
> > M. +39 347 913 2170
> > michael@amarulasolutions.com
> > __________________________________
> >
> > Amarula Solutions BV
> > Joop Geesinkweg 125, 1114 AB, Amsterdam, NL
> > T. +31 (0)85 111 9172
> > info@amarulasolutions.com
> > www.amarulasolutions.com
>

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 4/4] ARM: dts: imx8m: imx8mm-mx8menlo: Enable SPL SDP support
  2022-09-24 19:00           ` Michael Nazzareno Trimarchi
@ 2022-09-24 19:10             ` Adam Ford
  2022-09-24 19:19               ` Michael Nazzareno Trimarchi
  2022-09-24 21:47               ` Marek Vasut
  0 siblings, 2 replies; 30+ messages in thread
From: Adam Ford @ 2022-09-24 19:10 UTC (permalink / raw)
  To: Michael Nazzareno Trimarchi
  Cc: Fabio Estevam, Marek Vasut, U-Boot Mailing List, Marcel Ziswiler,
	Max Krummenacher, Peng Fan, Stefano Babic

On Sat, Sep 24, 2022 at 2:00 PM Michael Nazzareno Trimarchi
<michael@amarulasolutions.com> wrote:
>
>
>
> Il sab 24 set 2022, 20:54 Adam Ford <aford173@gmail.com> ha scritto:
>>
>> On Sat, Sep 24, 2022 at 1:52 PM Michael Nazzareno Trimarchi
>> <michael@amarulasolutions.com> wrote:
>> >
>> > On Sat, Sep 24, 2022 at 8:38 PM Adam Ford <aford173@gmail.com> wrote:
>> > >
>> > > On Mon, Sep 19, 2022 at 5:02 PM Fabio Estevam <festevam@denx.de> wrote:
>> > > >
>> > > > Hi Marek,
>> > > >
>> > > > On 19/09/2022 16:41, Marek Vasut wrote:
>> > > > > Enable DM USB, DM PHY and USB gadget support in imx8mm-mx8menlo SPL
>> > > > > to let the board continue SDP loading of second stage after the first
>> > > > > stage was loaded by BootROM SDP implementation. It is not possible to
>> > > > > jump back into BootROM v1 and let the BootROM implementation continue
>> > > > > the SDP loading, all this has to be performed by the U-Boot CI HDRC
>> > > > > controller driver and SDP protocol implementation, both of which fit
>> > > > > into the SPL just barely.
>> > > > >
>> > > > > With this patch, it is possible to start both U-Boot SPL and U-Boot
>> > > > > using e.g. uuu on this board as follows:
>> > > > >
>> > > > > $ uuu -brun spl flash.bin
>> > > > >
>> > > > > Signed-off-by: Marek Vasut <marex@denx.de>
>> > > >
>> > > > This is great, I was able to test SPL SDP on an imx8mm-evk after
>> > > > applying these
>> > > > same changes to imx8mm-evk and reducing the SPL size.
>> > >
>> > > Fabio,
>> > >
>> > > Can you tell me what you did to reduce the SPL size?
>> > >
>> >
>> > CONFIG_LTO from the other patch
>>
>> Bummer.  I was hoping there was more.  I already have LTO enabled.  I
>> was hoping there was more to it.
>
>
> What version of U-Boot are you using?
>
> Mainline or some older one. Are you compile under yocto?

I am using the Mainline with the aarch64 gcc from Ubuntu 22.04.  I am
over by ~1100 bytes with LTO enabled, but I'm going through my SPL
drivers to see what I can either remove or reduce functionality.

adam
>
> Michael
>
>
>>
>> adam
>> >
>> > Michael
>> >
>> > > adam
>> > > >
>> > > > For the series:
>> > > >
>> > > > Reviewed-by: Fabio Estevam <festevam@denx.de>
>> >
>> >
>> >
>> > --
>> > Michael Nazzareno Trimarchi
>> > Co-Founder & Chief Executive Officer
>> > M. +39 347 913 2170
>> > michael@amarulasolutions.com
>> > __________________________________
>> >
>> > Amarula Solutions BV
>> > Joop Geesinkweg 125, 1114 AB, Amsterdam, NL
>> > T. +31 (0)85 111 9172
>> > info@amarulasolutions.com
>> > www.amarulasolutions.com

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 4/4] ARM: dts: imx8m: imx8mm-mx8menlo: Enable SPL SDP support
  2022-09-24 19:10             ` Adam Ford
@ 2022-09-24 19:19               ` Michael Nazzareno Trimarchi
  2022-09-24 21:47               ` Marek Vasut
  1 sibling, 0 replies; 30+ messages in thread
From: Michael Nazzareno Trimarchi @ 2022-09-24 19:19 UTC (permalink / raw)
  To: Adam Ford
  Cc: Fabio Estevam, Marek Vasut, U-Boot Mailing List, Marcel Ziswiler,
	Max Krummenacher, Peng Fan, Stefano Babic

Hi

Il sab 24 set 2022, 21:10 Adam Ford <aford173@gmail.com> ha scritto:

> On Sat, Sep 24, 2022 at 2:00 PM Michael Nazzareno Trimarchi
> <michael@amarulasolutions.com> wrote:
> >
> >
> >
> > Il sab 24 set 2022, 20:54 Adam Ford <aford173@gmail.com> ha scritto:
> >>
> >> On Sat, Sep 24, 2022 at 1:52 PM Michael Nazzareno Trimarchi
> >> <michael@amarulasolutions.com> wrote:
> >> >
> >> > On Sat, Sep 24, 2022 at 8:38 PM Adam Ford <aford173@gmail.com> wrote:
> >> > >
> >> > > On Mon, Sep 19, 2022 at 5:02 PM Fabio Estevam <festevam@denx.de>
> wrote:
> >> > > >
> >> > > > Hi Marek,
> >> > > >
> >> > > > On 19/09/2022 16:41, Marek Vasut wrote:
> >> > > > > Enable DM USB, DM PHY and USB gadget support in imx8mm-mx8menlo
> SPL
> >> > > > > to let the board continue SDP loading of second stage after the
> first
> >> > > > > stage was loaded by BootROM SDP implementation. It is not
> possible to
> >> > > > > jump back into BootROM v1 and let the BootROM implementation
> continue
> >> > > > > the SDP loading, all this has to be performed by the U-Boot CI
> HDRC
> >> > > > > controller driver and SDP protocol implementation, both of
> which fit
> >> > > > > into the SPL just barely.
> >> > > > >
> >> > > > > With this patch, it is possible to start both U-Boot SPL and
> U-Boot
> >> > > > > using e.g. uuu on this board as follows:
> >> > > > >
> >> > > > > $ uuu -brun spl flash.bin
> >> > > > >
> >> > > > > Signed-off-by: Marek Vasut <marex@denx.de>
> >> > > >
> >> > > > This is great, I was able to test SPL SDP on an imx8mm-evk after
> >> > > > applying these
> >> > > > same changes to imx8mm-evk and reducing the SPL size.
> >> > >
> >> > > Fabio,
> >> > >
> >> > > Can you tell me what you did to reduce the SPL size?
> >> > >
> >> >
> >> > CONFIG_LTO from the other patch
> >>
> >> Bummer.  I was hoping there was more.  I already have LTO enabled.  I
> >> was hoping there was more to it.
> >
> >
> > What version of U-Boot are you using?
> >
> > Mainline or some older one. Are you compile under yocto?
>
> I am using the Mainline with the aarch64 gcc from Ubuntu 22.04.  I am
> over by ~1100 bytes with LTO enabled, but I'm going through my SPL
> drivers to see what I can either remove or reduce functionality.
>

I was thinking about an issue was solved by patching U-Boot on increase
size of 3% in yocto toolchain.

Michael

>
> adam
> >
> > Michael
> >
> >
> >>
> >> adam
> >> >
> >> > Michael
> >> >
> >> > > adam
> >> > > >
> >> > > > For the series:
> >> > > >
> >> > > > Reviewed-by: Fabio Estevam <festevam@denx.de>
> >> >
> >> >
> >> >
> >> > --
> >> > Michael Nazzareno Trimarchi
> >> > Co-Founder & Chief Executive Officer
> >> > M. +39 347 913 2170
> >> > michael@amarulasolutions.com
> >> > __________________________________
> >> >
> >> > Amarula Solutions BV
> >> > Joop Geesinkweg 125, 1114 AB, Amsterdam, NL
> >> > T. +31 (0)85 111 9172
> >> > info@amarulasolutions.com
> >> > www.amarulasolutions.com
>

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 4/4] ARM: dts: imx8m: imx8mm-mx8menlo: Enable SPL SDP support
  2022-09-24 19:10             ` Adam Ford
  2022-09-24 19:19               ` Michael Nazzareno Trimarchi
@ 2022-09-24 21:47               ` Marek Vasut
  2022-09-24 21:54                 ` Adam Ford
  1 sibling, 1 reply; 30+ messages in thread
From: Marek Vasut @ 2022-09-24 21:47 UTC (permalink / raw)
  To: Adam Ford, Michael Nazzareno Trimarchi
  Cc: Fabio Estevam, U-Boot Mailing List, Marcel Ziswiler,
	Max Krummenacher, Peng Fan, Stefano Babic

On 9/24/22 21:10, Adam Ford wrote:

Hi,

[...]

> I am using the Mainline with the aarch64 gcc from Ubuntu 22.04.  I am
> over by ~1100 bytes with LTO enabled, but I'm going through my SPL
> drivers to see what I can either remove or reduce functionality.

Try

$ aarch64...readelf -s spl/u-boot-spl | sort -nk 3

That should give you a list of large symbols you might want to inspect.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 4/4] ARM: dts: imx8m: imx8mm-mx8menlo: Enable SPL SDP support
  2022-09-24 21:47               ` Marek Vasut
@ 2022-09-24 21:54                 ` Adam Ford
  2022-09-26 16:58                   ` Tim Harvey
  0 siblings, 1 reply; 30+ messages in thread
From: Adam Ford @ 2022-09-24 21:54 UTC (permalink / raw)
  To: Marek Vasut
  Cc: Michael Nazzareno Trimarchi, Fabio Estevam, U-Boot Mailing List,
	Marcel Ziswiler, Max Krummenacher, Peng Fan, Stefano Babic

On Sat, Sep 24, 2022 at 4:47 PM Marek Vasut <marex@denx.de> wrote:
>
> On 9/24/22 21:10, Adam Ford wrote:
>
> Hi,
>
> [...]
>
> > I am using the Mainline with the aarch64 gcc from Ubuntu 22.04.  I am
> > over by ~1100 bytes with LTO enabled, but I'm going through my SPL
> > drivers to see what I can either remove or reduce functionality.
>
> Try
>
> $ aarch64...readelf -s spl/u-boot-spl | sort -nk 3
>
> That should give you a list of large symbols you might want to inspect.

Thank you!

adam

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 4/4] ARM: dts: imx8m: imx8mm-mx8menlo: Enable SPL SDP support
  2022-09-24 21:54                 ` Adam Ford
@ 2022-09-26 16:58                   ` Tim Harvey
  2022-09-26 17:06                     ` Adam Ford
  0 siblings, 1 reply; 30+ messages in thread
From: Tim Harvey @ 2022-09-26 16:58 UTC (permalink / raw)
  To: Adam Ford
  Cc: Marek Vasut, Michael Nazzareno Trimarchi, Fabio Estevam,
	U-Boot Mailing List, Marcel Ziswiler, Max Krummenacher, Peng Fan,
	Stefano Babic

On Sat, Sep 24, 2022, 2:54 PM Adam Ford <aford173@gmail.com> wrote:
>
> On Sat, Sep 24, 2022 at 4:47 PM Marek Vasut <marex@denx.de> wrote:
> >
> > On 9/24/22 21:10, Adam Ford wrote:
> >
> > Hi,
> >
> > [...]
> >
> > > I am using the Mainline with the aarch64 gcc from Ubuntu 22.04.  I am
> > > over by ~1100 bytes with LTO enabled, but I'm going through my SPL
> > > drivers to see what I can either remove or reduce functionality.
> >
> > Try
> >
> > $ aarch64...readelf -s spl/u-boot-spl | sort -nk 3
> >
> > That should give you a list of large symbols you might want to inspect.
>
> Thank you!
>

Adam,

I'm curious what you find as my SPL for imx8mm_venice_defconfig also
overflows by about 3K when enabling what's needed here for SDP as
well. I have 4 different dram configs which are chewing up about 1K
each.

Best Regards,

Tim

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 4/4] ARM: dts: imx8m: imx8mm-mx8menlo: Enable SPL SDP support
  2022-09-26 16:58                   ` Tim Harvey
@ 2022-09-26 17:06                     ` Adam Ford
  2022-09-26 17:12                       ` Fabio Estevam
  2022-09-26 17:14                       ` Tim Harvey
  0 siblings, 2 replies; 30+ messages in thread
From: Adam Ford @ 2022-09-26 17:06 UTC (permalink / raw)
  To: Tim Harvey
  Cc: Marek Vasut, Michael Nazzareno Trimarchi, Fabio Estevam,
	U-Boot Mailing List, Marcel Ziswiler, Max Krummenacher, Peng Fan,
	Stefano Babic

On Mon, Sep 26, 2022 at 11:59 AM Tim Harvey <tharvey@gateworks.com> wrote:
>
> On Sat, Sep 24, 2022, 2:54 PM Adam Ford <aford173@gmail.com> wrote:
> >
> > On Sat, Sep 24, 2022 at 4:47 PM Marek Vasut <marex@denx.de> wrote:
> > >
> > > On 9/24/22 21:10, Adam Ford wrote:
> > >
> > > Hi,
> > >
> > > [...]
> > >
> > > > I am using the Mainline with the aarch64 gcc from Ubuntu 22.04.  I am
> > > > over by ~1100 bytes with LTO enabled, but I'm going through my SPL
> > > > drivers to see what I can either remove or reduce functionality.
> > >
> > > Try
> > >
> > > $ aarch64...readelf -s spl/u-boot-spl | sort -nk 3
> > >
> > > That should give you a list of large symbols you might want to inspect.
> >
> > Thank you!
> >
>
> Adam,
>
> I'm curious what you find as my SPL for imx8mm_venice_defconfig also
> overflows by about 3K when enabling what's needed here for SDP as
> well. I have 4 different dram configs which are chewing up about 1K
> each.

Tim,

I have it building successfully now, and it loads over USB. I had to
disable BD718x7 PMIC children binding which required a small change to
the PMIC driver [1].  I then removed HS400, HS200 and UHS support in
SPL.  Once I did all that, the code size fit into SPL space.

[1] - https://patchwork.ozlabs.org/project/uboot/patch/20220817112403.68144-2-aford173@gmail.com/

I'll try to push my patch today or tomorrow.  I was doing some other
clean-up, but I might just push that as a small series in itself.

adam
>
> Best Regards,
>
> Tim

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 4/4] ARM: dts: imx8m: imx8mm-mx8menlo: Enable SPL SDP support
  2022-09-26 17:06                     ` Adam Ford
@ 2022-09-26 17:12                       ` Fabio Estevam
  2022-09-26 17:28                         ` Adam Ford
  2022-09-26 20:04                         ` Tim Harvey
  2022-09-26 17:14                       ` Tim Harvey
  1 sibling, 2 replies; 30+ messages in thread
From: Fabio Estevam @ 2022-09-26 17:12 UTC (permalink / raw)
  To: Adam Ford
  Cc: Tim Harvey, Marek Vasut, Michael Nazzareno Trimarchi,
	Fabio Estevam, U-Boot Mailing List, Marcel Ziswiler,
	Max Krummenacher, Peng Fan, Stefano Babic

Hi Adam,

On Mon, Sep 26, 2022 at 2:07 PM Adam Ford <aford173@gmail.com> wrote:

> Tim,
>
> I have it building successfully now, and it loads over USB. I had to
> disable BD718x7 PMIC children binding which required a small change to
> the PMIC driver [1].  I then removed HS400, HS200 and UHS support in
> SPL.  Once I did all that, the code size fit into SPL space.
>
> [1] - https://patchwork.ozlabs.org/project/uboot/patch/20220817112403.68144-2-aford173@gmail.com/
>
> I'll try to push my patch today or tomorrow.  I was doing some other
> clean-up, but I might just push that as a small series in itself.

Ok, great.

Does "ums 0 mmc 0" work for you if you run it, stop it via CTRL+C and rerun it?

On an imx8mm_evk, I get USB errors after the CTRL+C and ums fails to
mount after that.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 4/4] ARM: dts: imx8m: imx8mm-mx8menlo: Enable SPL SDP support
  2022-09-26 17:06                     ` Adam Ford
  2022-09-26 17:12                       ` Fabio Estevam
@ 2022-09-26 17:14                       ` Tim Harvey
  1 sibling, 0 replies; 30+ messages in thread
From: Tim Harvey @ 2022-09-26 17:14 UTC (permalink / raw)
  To: Adam Ford
  Cc: Marek Vasut, Michael Nazzareno Trimarchi, Fabio Estevam,
	U-Boot Mailing List, Marcel Ziswiler, Max Krummenacher, Peng Fan,
	Stefano Babic

On Mon, Sep 26, 2022 at 10:06 AM Adam Ford <aford173@gmail.com> wrote:
>
> On Mon, Sep 26, 2022 at 11:59 AM Tim Harvey <tharvey@gateworks.com> wrote:
> >
> > On Sat, Sep 24, 2022, 2:54 PM Adam Ford <aford173@gmail.com> wrote:
> > >
> > > On Sat, Sep 24, 2022 at 4:47 PM Marek Vasut <marex@denx.de> wrote:
> > > >
> > > > On 9/24/22 21:10, Adam Ford wrote:
> > > >
> > > > Hi,
> > > >
> > > > [...]
> > > >
> > > > > I am using the Mainline with the aarch64 gcc from Ubuntu 22.04.  I am
> > > > > over by ~1100 bytes with LTO enabled, but I'm going through my SPL
> > > > > drivers to see what I can either remove or reduce functionality.
> > > >
> > > > Try
> > > >
> > > > $ aarch64...readelf -s spl/u-boot-spl | sort -nk 3
> > > >
> > > > That should give you a list of large symbols you might want to inspect.
> > >
> > > Thank you!
> > >
> >
> > Adam,
> >
> > I'm curious what you find as my SPL for imx8mm_venice_defconfig also
> > overflows by about 3K when enabling what's needed here for SDP as
> > well. I have 4 different dram configs which are chewing up about 1K
> > each.
>
> Tim,
>
> I have it building successfully now, and it loads over USB. I had to
> disable BD718x7 PMIC children binding which required a small change to
> the PMIC driver [1].  I then removed HS400, HS200 and UHS support in
> SPL.  Once I did all that, the code size fit into SPL space.
>
> [1] - https://patchwork.ozlabs.org/project/uboot/patch/20220817112403.68144-2-aford173@gmail.com/
>
> I'll try to push my patch today or tomorrow.  I was doing some other
> clean-up, but I might just push that as a small series in itself.
>

Adam,

Yes, I have already done those same things for imx8mm_venice but am
still 3K over due to my 4x dram configs. Each dram config must be
about 3K as I only have to remove one of them to successfully build.

Thanks,

Tim

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 4/4] ARM: dts: imx8m: imx8mm-mx8menlo: Enable SPL SDP support
  2022-09-26 17:12                       ` Fabio Estevam
@ 2022-09-26 17:28                         ` Adam Ford
  2022-09-26 17:50                           ` Sean Anderson
  2022-09-26 20:04                         ` Tim Harvey
  1 sibling, 1 reply; 30+ messages in thread
From: Adam Ford @ 2022-09-26 17:28 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: Tim Harvey, Marek Vasut, Michael Nazzareno Trimarchi,
	Fabio Estevam, U-Boot Mailing List, Marcel Ziswiler,
	Max Krummenacher, Peng Fan, Stefano Babic

On Mon, Sep 26, 2022 at 12:12 PM Fabio Estevam <festevam@gmail.com> wrote:
>
> Hi Adam,
>
> On Mon, Sep 26, 2022 at 2:07 PM Adam Ford <aford173@gmail.com> wrote:
>
> > Tim,
> >
> > I have it building successfully now, and it loads over USB. I had to
> > disable BD718x7 PMIC children binding which required a small change to
> > the PMIC driver [1].  I then removed HS400, HS200 and UHS support in
> > SPL.  Once I did all that, the code size fit into SPL space.
> >
> > [1] - https://patchwork.ozlabs.org/project/uboot/patch/20220817112403.68144-2-aford173@gmail.com/
> >
> > I'll try to push my patch today or tomorrow.  I was doing some other
> > clean-up, but I might just push that as a small series in itself.
>
> Ok, great.
>
> Does "ums 0 mmc 0" work for you if you run it, stop it via CTRL+C and rerun it?
>

I didn't try UMS.  I was going to investigate Fastboot, but I'll give
it try this week.

> On an imx8mm_evk, I get USB errors after the CTRL+C and ums fails to
> mount after that.

Do you need to do a USB reset or anything?

adam

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 4/4] ARM: dts: imx8m: imx8mm-mx8menlo: Enable SPL SDP support
  2022-09-26 17:28                         ` Adam Ford
@ 2022-09-26 17:50                           ` Sean Anderson
  0 siblings, 0 replies; 30+ messages in thread
From: Sean Anderson @ 2022-09-26 17:50 UTC (permalink / raw)
  To: Adam Ford, Fabio Estevam
  Cc: Tim Harvey, Marek Vasut, Michael Nazzareno Trimarchi,
	Fabio Estevam, U-Boot Mailing List, Marcel Ziswiler,
	Max Krummenacher, Peng Fan, Stefano Babic

On 9/26/22 1:28 PM, Adam Ford wrote:
> On Mon, Sep 26, 2022 at 12:12 PM Fabio Estevam <festevam@gmail.com> wrote:
>>
>> Hi Adam,
>>
>> On Mon, Sep 26, 2022 at 2:07 PM Adam Ford <aford173@gmail.com> wrote:
>>
>> > Tim,
>> >
>> > I have it building successfully now, and it loads over USB. I had to
>> > disable BD718x7 PMIC children binding which required a small change to
>> > the PMIC driver [1].  I then removed HS400, HS200 and UHS support in
>> > SPL.  Once I did all that, the code size fit into SPL space.
>> >
>> > [1] - https://patchwork.ozlabs.org/project/uboot/patch/20220817112403.68144-2-aford173@gmail.com/
>> >
>> > I'll try to push my patch today or tomorrow.  I was doing some other
>> > clean-up, but I might just push that as a small series in itself.
>>
>> Ok, great.
>>
>> Does "ums 0 mmc 0" work for you if you run it, stop it via CTRL+C and rerun it?
>>
> 
> I didn't try UMS.  I was going to investigate Fastboot, but I'll give
> it try this week.

IMO UMS is the most convenient for development. It does require access
to the console to hit ctrl-c, whereas you can control booting/rebooting
with fastboot (making it nicer for production or for in-field repair).

I have found that both fastboot and UMS are far nice to use than SDP.

--Sean

>> On an imx8mm_evk, I get USB errors after the CTRL+C and ums fails to
>> mount after that.
> 
> Do you need to do a USB reset or anything?
> 
> adam
> 

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 4/4] ARM: dts: imx8m: imx8mm-mx8menlo: Enable SPL SDP support
  2022-09-26 17:12                       ` Fabio Estevam
  2022-09-26 17:28                         ` Adam Ford
@ 2022-09-26 20:04                         ` Tim Harvey
  1 sibling, 0 replies; 30+ messages in thread
From: Tim Harvey @ 2022-09-26 20:04 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: Adam Ford, Marek Vasut, Michael Nazzareno Trimarchi,
	Fabio Estevam, U-Boot Mailing List, Marcel Ziswiler,
	Max Krummenacher, Peng Fan, Stefano Babic

On Mon, Sep 26, 2022 at 10:12 AM Fabio Estevam <festevam@gmail.com> wrote:
>
> Hi Adam,
>
> On Mon, Sep 26, 2022 at 2:07 PM Adam Ford <aford173@gmail.com> wrote:
>
> > Tim,
> >
> > I have it building successfully now, and it loads over USB. I had to
> > disable BD718x7 PMIC children binding which required a small change to
> > the PMIC driver [1].  I then removed HS400, HS200 and UHS support in
> > SPL.  Once I did all that, the code size fit into SPL space.
> >
> > [1] - https://patchwork.ozlabs.org/project/uboot/patch/20220817112403.68144-2-aford173@gmail.com/
> >
> > I'll try to push my patch today or tomorrow.  I was doing some other
> > clean-up, but I might just push that as a small series in itself.
>
> Ok, great.
>
> Does "ums 0 mmc 0" work for you if you run it, stop it via CTRL+C and rerun it?
>
> On an imx8mm_evk, I get USB errors after the CTRL+C and ums fails to
> mount after that.

Fabio,

I see this failure as well. If I CTRL+C and repeat the ums the
attached Linux host shows:
[6307703.733810] usb 3-2: new high-speed USB device number 10 using xhci_hcd
[6307708.933752] usb 3-2: device descriptor read/64, error -110
[6307714.313724] usb 3-2: device descriptor read/64, error -71
[6307714.549708] usb 3-2: new high-speed USB device number 11 using xhci_hcd
[6307719.689650] usb 3-2: device descriptor read/64, error -110
[6307725.061625] usb 3-2: device descriptor read/64, error -71
[6307725.169657] usb usb3-port2: attempt power cycle
[6307725.581584] usb 3-2: new high-speed USB device number 12 using xhci_hcd
[6307730.825577] xhci_hcd 0000:00:14.0: Timeout while waiting for
setup device command
[6307731.033614] usb 3-2: Device not responding to setup address.
[6307731.241528] usb 3-2: device not accepting address 12, error -71
[6307731.373537] usb 3-2: new high-speed USB device number 13 using xhci_hcd
[6307736.453499] xhci_hcd 0000:00:14.0: Timeout while waiting for
setup device command
[6307736.665545] usb 3-2: Device not responding to setup address.
[6307736.873482] usb 3-2: device not accepting address 13, error -71
[6307736.873589] usb usb3-port2: unable to enumerate USB device

Best Regards,

Tim

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH 1/4] ARM: imx8m: Deduplicate CAAM init with arch_misc_init() call
  2022-09-19 19:41 [PATCH 1/4] ARM: imx8m: Deduplicate CAAM init with arch_misc_init() call Marek Vasut
                   ` (3 preceding siblings ...)
  2022-09-21  5:31 ` [PATCH 1/4] ARM: imx8m: Deduplicate CAAM init with arch_misc_init() call Peng Fan
@ 2022-10-21 11:42 ` sbabic
  4 siblings, 0 replies; 30+ messages in thread
From: sbabic @ 2022-10-21 11:42 UTC (permalink / raw)
  To: Marek Vasut, u-boot

> Instead of duplicating code implemented by i.MX8M version of arch_misc_init()
> in every board, enable CONFIG_ARCH_MISC_INIT and call arch_misc_init() from
> spl_board_init(). This removes the duplication. No functional change.
> Signed-off-by: Marek Vasut <marex@denx.de>
> Reviewed-by: Peng Fan <peng.fan@nxp.com>
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: sbabic@denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH 2/4] ARM: imx8m: phycore_imx8mm: Drop bogus spl_board_init()
  2022-09-19 19:41 ` [PATCH 2/4] ARM: imx8m: phycore_imx8mm: Drop bogus spl_board_init() Marek Vasut
  2022-09-21  5:31   ` Peng Fan
@ 2022-10-21 11:42   ` sbabic
  1 sibling, 0 replies; 30+ messages in thread
From: sbabic @ 2022-10-21 11:42 UTC (permalink / raw)
  To: Marek Vasut, u-boot

> The current implementation of spl_board_init() is not correct,
> the MX8MM BootROM v1 does not support SDP load when re-entered
> from U-Boot SPL, it is up to U-Boot to perform the next stage
> load using its own internal CI gadget driver and SDP protocol
> implementation. Drop the spl_board_init() to let SPL continue
> with normal load in case the SDP support is enabled.
> Signed-off-by: Marek Vasut <marex@denx.de>
> Reviewed-by: Peng Fan <peng.fan@nxp.com>
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: sbabic@denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH 3/4] ARM: imx8m: verdin-imx8mm: Drop bogus content from spl_board_init()
  2022-09-19 19:41 ` [PATCH 3/4] ARM: imx8m: verdin-imx8mm: Drop bogus content from spl_board_init() Marek Vasut
  2022-09-21  5:31   ` Peng Fan
@ 2022-10-21 11:43   ` sbabic
  1 sibling, 0 replies; 30+ messages in thread
From: sbabic @ 2022-10-21 11:43 UTC (permalink / raw)
  To: Marek Vasut, u-boot

> The current implementation of spl_board_init() USB boot handling is
> not correct, the MX8MM BootROM v1 does not support SDP load when
> re-entered from U-Boot SPL, it is up to U-Boot to perform the next
> stage load using its own internal CI gadget driver and SDP protocol
> implementation. Drop the spl_board_init() to let SPL continue with
> normal load in case the SDP support is enabled.
> Signed-off-by: Marek Vasut <marex@denx.de>
> Reviewed-by: Peng Fan <peng.fan@nxp.com>
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: sbabic@denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH 4/4] ARM: dts: imx8m: imx8mm-mx8menlo: Enable SPL SDP support
  2022-09-19 19:41 ` [PATCH 4/4] ARM: dts: imx8m: imx8mm-mx8menlo: Enable SPL SDP support Marek Vasut
  2022-09-19 22:02   ` Fabio Estevam
  2022-09-21  5:30   ` Peng Fan
@ 2022-10-21 11:43   ` sbabic
  2 siblings, 0 replies; 30+ messages in thread
From: sbabic @ 2022-10-21 11:43 UTC (permalink / raw)
  To: Marek Vasut, u-boot

> Enable DM USB, DM PHY and USB gadget support in imx8mm-mx8menlo SPL
> to let the board continue SDP loading of second stage after the first
> stage was loaded by BootROM SDP implementation. It is not possible to
> jump back into BootROM v1 and let the BootROM implementation continue
> the SDP loading, all this has to be performed by the U-Boot CI HDRC
> controller driver and SDP protocol implementation, both of which fit
> into the SPL just barely.
> With this patch, it is possible to start both U-Boot SPL and U-Boot
> using e.g. uuu on this board as follows:
> $ uuu -brun spl flash.bin
> Signed-off-by: Marek Vasut <marex@denx.de>
> Reviewed-by: Fabio Estevam <festevam@denx.de>
> Reviewed-by: Peng Fan <peng.fan@nxp.com>
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: sbabic@denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 1/4] ARM: imx8m: Deduplicate CAAM init with arch_misc_init() call
  2022-09-21  5:31 ` [PATCH 1/4] ARM: imx8m: Deduplicate CAAM init with arch_misc_init() call Peng Fan
@ 2022-10-21 11:52   ` Stefano Babic
  0 siblings, 0 replies; 30+ messages in thread
From: Stefano Babic @ 2022-10-21 11:52 UTC (permalink / raw)
  To: Peng Fan, Marek Vasut, u-boot
  Cc: Fabio Estevam, Frieder Schrempf, Marcel Ziswiler,
	Max Krummenacher, Peng Fan, Stefano Babic, Teresa Remmet

Hi Marek,

just for tracking. ARCH_MISC_INIT was missing for imx8mn_ddr4_evk, I 
added myself to have a clean build and applied.

Stefano

On 21.09.22 07:31, Peng Fan wrote:
> 
> 
> On 9/20/2022 3:41 AM, Marek Vasut wrote:
>> Instead of duplicating code implemented by i.MX8M version of 
>> arch_misc_init()
>> in every board, enable CONFIG_ARCH_MISC_INIT and call arch_misc_init() 
>> from
>> spl_board_init(). This removes the duplication. No functional change.
>>
>> Signed-off-by: Marek Vasut <marex@denx.de>
>> ---
>> Cc: Fabio Estevam <festevam@denx.de>
>> Cc: Frieder Schrempf <frieder.schrempf@kontron.de>
>> Cc: Marcel Ziswiler <marcel.ziswiler@toradex.com>
>> Cc: Max Krummenacher <max.krummenacher@toradex.com>
>> Cc: Peng Fan <peng.fan@nxp.com>
>> Cc: Stefano Babic <sbabic@denx.de>
>> Cc: Teresa Remmet <t.remmet@phytec.de>
> 
> Reviewed-by: Peng Fan <peng.fan@nxp.com>
>> ---
>>   board/freescale/imx8mm_evk/spl.c   | 10 +---------
>>   board/freescale/imx8mn_evk/spl.c   |  7 ++-----
>>   board/freescale/imx8mp_evk/spl.c   |  8 +-------
>>   board/kontron/sl-mx8mm/spl.c       |  6 +-----
>>   board/toradex/verdin-imx8mm/spl.c  |  9 +--------
>>   configs/imx8mm-mx8menlo_defconfig  |  1 +
>>   configs/imx8mm_evk_defconfig       |  1 +
>>   configs/imx8mm_evk_fspi_defconfig  |  1 +
>>   configs/imx8mp_evk_defconfig       |  1 +
>>   configs/kontron-sl-mx8mm_defconfig |  1 +
>>   configs/verdin-imx8mm_defconfig    |  1 +
>>   11 files changed, 12 insertions(+), 34 deletions(-)
>>
>> diff --git a/board/freescale/imx8mm_evk/spl.c 
>> b/board/freescale/imx8mm_evk/spl.c
>> index e2eb1426c83..e0e97c7fd9a 100644
>> --- a/board/freescale/imx8mm_evk/spl.c
>> +++ b/board/freescale/imx8mm_evk/spl.c
>> @@ -53,15 +53,7 @@ static void spl_dram_init(void)
>>   void spl_board_init(void)
>>   {
>> -    if (IS_ENABLED(CONFIG_FSL_CAAM)) {
>> -        struct udevice *dev;
>> -        int ret;
>> -
>> -        ret = uclass_get_device_by_driver(UCLASS_MISC, 
>> DM_DRIVER_GET(caam_jr), &dev);
>> -        if (ret)
>> -            printf("Failed to initialize caam_jr: %d\n", ret);
>> -    }
>> -    puts("Normal Boot\n");
>> +    arch_misc_init();
>>   }
>>   #ifdef CONFIG_SPL_LOAD_FIT
>> diff --git a/board/freescale/imx8mn_evk/spl.c 
>> b/board/freescale/imx8mn_evk/spl.c
>> index c0bfb67199a..380abecd746 100644
>> --- a/board/freescale/imx8mn_evk/spl.c
>> +++ b/board/freescale/imx8mn_evk/spl.c
>> @@ -49,11 +49,8 @@ void spl_board_init(void)
>>       struct udevice *dev;
>>       int ret;
>> -    if (IS_ENABLED(CONFIG_FSL_CAAM)) {
>> -        ret = uclass_get_device_by_driver(UCLASS_MISC, 
>> DM_DRIVER_GET(caam_jr), &dev);
>> -        if (ret)
>> -            printf("Failed to initialize caam_jr: %d\n", ret);
>> -    }
>> +    arch_misc_init();
>> +
>>       puts("Normal Boot\n");
>>       ret = uclass_get_device_by_name(UCLASS_CLK,
>> diff --git a/board/freescale/imx8mp_evk/spl.c 
>> b/board/freescale/imx8mp_evk/spl.c
>> index 719b1f6d7da..f1b285417d0 100644
>> --- a/board/freescale/imx8mp_evk/spl.c
>> +++ b/board/freescale/imx8mp_evk/spl.c
>> @@ -37,14 +37,8 @@ void spl_dram_init(void)
>>   void spl_board_init(void)
>>   {
>> -    if (IS_ENABLED(CONFIG_FSL_CAAM)) {
>> -        struct udevice *dev;
>> -        int ret;
>> +    arch_misc_init();
>> -        ret = uclass_get_device_by_driver(UCLASS_MISC, 
>> DM_DRIVER_GET(caam_jr), &dev);
>> -        if (ret)
>> -            printf("Failed to initialize caam_jr: %d\n", ret);
>> -    }
>>       /*
>>        * Set GIC clock to 500Mhz for OD VDD_SOC. Kernel driver does
>>        * not allow to change it. Should set the clock after PMIC
>> diff --git a/board/kontron/sl-mx8mm/spl.c b/board/kontron/sl-mx8mm/spl.c
>> index 09f81351dd4..b884c91aef9 100644
>> --- a/board/kontron/sl-mx8mm/spl.c
>> +++ b/board/kontron/sl-mx8mm/spl.c
>> @@ -205,11 +205,7 @@ void spl_board_init(void)
>>       struct udevice *dev;
>>       int ret;
>> -    if (IS_ENABLED(CONFIG_FSL_CAAM)) {
>> -        ret = uclass_get_device_by_driver(UCLASS_MISC, 
>> DM_DRIVER_GET(caam_jr), &dev);
>> -        if (ret)
>> -            printf("Failed to initialize %s: %d\n", dev->name, ret);
>> -    }
>> +    arch_misc_init();
>>       puts("Normal Boot\n");
>> diff --git a/board/toradex/verdin-imx8mm/spl.c 
>> b/board/toradex/verdin-imx8mm/spl.c
>> index fb9aae6c9c8..59a3d9e0cae 100644
>> --- a/board/toradex/verdin-imx8mm/spl.c
>> +++ b/board/toradex/verdin-imx8mm/spl.c
>> @@ -53,14 +53,7 @@ void spl_dram_init(void)
>>   void spl_board_init(void)
>>   {
>> -    if (IS_ENABLED(CONFIG_FSL_CAAM)) {
>> -        struct udevice *dev;
>> -        int ret;
>> -
>> -        ret = uclass_get_device_by_driver(UCLASS_MISC, 
>> DM_DRIVER_GET(caam_jr), &dev);
>> -        if (ret)
>> -            printf("Failed to initialize %s: %d\n", dev->name, ret);
>> -    }
>> +    arch_misc_init();
>>       /* Serial download mode */
>>       if (is_usb_boot()) {
>> diff --git a/configs/imx8mm-mx8menlo_defconfig 
>> b/configs/imx8mm-mx8menlo_defconfig
>> index 702162f86de..929ff382f27 100644
>> --- a/configs/imx8mm-mx8menlo_defconfig
>> +++ b/configs/imx8mm-mx8menlo_defconfig
>> @@ -34,6 +34,7 @@ CONFIG_DEFAULT_FDT_FILE="imx8mm-mx8menlo.dtb"
>>   CONFIG_LOG=y
>>   # CONFIG_DISPLAY_BOARDINFO is not set
>>   CONFIG_DISPLAY_BOARDINFO_LATE=y
>> +CONFIG_ARCH_MISC_INIT=y
>>   CONFIG_BOARD_LATE_INIT=y
>>   CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
>>   CONFIG_SPL_BSS_START_ADDR=0x910000
>> diff --git a/configs/imx8mm_evk_defconfig b/configs/imx8mm_evk_defconfig
>> index 7bcedcd51f5..58b5e468a58 100644
>> --- a/configs/imx8mm_evk_defconfig
>> +++ b/configs/imx8mm_evk_defconfig
>> @@ -23,6 +23,7 @@ CONFIG_FIT_EXTERNAL_OFFSET=0x3000
>>   CONFIG_SPL_LOAD_FIT=y
>>   # CONFIG_USE_SPL_FIT_GENERATOR is not set
>>   CONFIG_OF_SYSTEM_SETUP=y
>> +CONFIG_ARCH_MISC_INIT=y
>>   CONFIG_BOARD_LATE_INIT=y
>>   CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
>>   CONFIG_SPL_BSS_START_ADDR=0x910000
>> diff --git a/configs/imx8mm_evk_fspi_defconfig 
>> b/configs/imx8mm_evk_fspi_defconfig
>> index 21fd7e08db1..73c96f634ce 100644
>> --- a/configs/imx8mm_evk_fspi_defconfig
>> +++ b/configs/imx8mm_evk_fspi_defconfig
>> @@ -24,6 +24,7 @@ CONFIG_FIT_EXTERNAL_OFFSET=0x3000
>>   CONFIG_SPL_LOAD_FIT=y
>>   # CONFIG_USE_SPL_FIT_GENERATOR is not set
>>   CONFIG_OF_SYSTEM_SETUP=y
>> +CONFIG_ARCH_MISC_INIT=y
>>   CONFIG_BOARD_LATE_INIT=y
>>   CONFIG_SPL_MAX_SIZE=0x25000
>>   CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
>> diff --git a/configs/imx8mp_evk_defconfig b/configs/imx8mp_evk_defconfig
>> index 0be1951e740..406e89e428b 100644
>> --- a/configs/imx8mp_evk_defconfig
>> +++ b/configs/imx8mp_evk_defconfig
>> @@ -28,6 +28,7 @@ CONFIG_SPL_LOAD_FIT=y
>>   # CONFIG_USE_SPL_FIT_GENERATOR is not set
>>   CONFIG_OF_SYSTEM_SETUP=y
>>   CONFIG_DEFAULT_FDT_FILE="imx8mp-evk.dtb"
>> +CONFIG_ARCH_MISC_INIT=y
>>   CONFIG_BOARD_LATE_INIT=y
>>   CONFIG_SPL_MAX_SIZE=0x26000
>>   CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
>> diff --git a/configs/kontron-sl-mx8mm_defconfig 
>> b/configs/kontron-sl-mx8mm_defconfig
>> index 5387f65926f..43731e4c280 100644
>> --- a/configs/kontron-sl-mx8mm_defconfig
>> +++ b/configs/kontron-sl-mx8mm_defconfig
>> @@ -27,6 +27,7 @@ CONFIG_SPL_LOAD_FIT=y
>>   # CONFIG_USE_SPL_FIT_GENERATOR is not set
>>   CONFIG_OF_BOARD_SETUP=y
>>   CONFIG_BOARD_TYPES=y
>> +CONFIG_ARCH_MISC_INIT=y
>>   CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
>>   CONFIG_SPL_BSS_START_ADDR=0x910000
>>   CONFIG_SPL_BSS_MAX_SIZE=0x2000
>> diff --git a/configs/verdin-imx8mm_defconfig 
>> b/configs/verdin-imx8mm_defconfig
>> index f65b4a7f307..230fe55d068 100644
>> --- a/configs/verdin-imx8mm_defconfig
>> +++ b/configs/verdin-imx8mm_defconfig
>> @@ -36,6 +36,7 @@ CONFIG_PREBOOT="test -n ${fdtfile} || setenv fdtfile 
>> imx8mm-verdin-${variant}-${
>>   CONFIG_LOG=y
>>   # CONFIG_DISPLAY_BOARDINFO is not set
>>   CONFIG_DISPLAY_BOARDINFO_LATE=y
>> +CONFIG_ARCH_MISC_INIT=y
>>   CONFIG_BOARD_LATE_INIT=y
>>   CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
>>   CONFIG_SPL_BSS_START_ADDR=0x910000

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


^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2022-10-21 11:52 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-19 19:41 [PATCH 1/4] ARM: imx8m: Deduplicate CAAM init with arch_misc_init() call Marek Vasut
2022-09-19 19:41 ` [PATCH 2/4] ARM: imx8m: phycore_imx8mm: Drop bogus spl_board_init() Marek Vasut
2022-09-21  5:31   ` Peng Fan
2022-10-21 11:42   ` sbabic
2022-09-19 19:41 ` [PATCH 3/4] ARM: imx8m: verdin-imx8mm: Drop bogus content from spl_board_init() Marek Vasut
2022-09-21  5:31   ` Peng Fan
2022-10-21 11:43   ` sbabic
2022-09-19 19:41 ` [PATCH 4/4] ARM: dts: imx8m: imx8mm-mx8menlo: Enable SPL SDP support Marek Vasut
2022-09-19 22:02   ` Fabio Estevam
2022-09-24 18:38     ` Adam Ford
2022-09-24 18:52       ` Michael Nazzareno Trimarchi
2022-09-24 18:54         ` Adam Ford
2022-09-24 19:00           ` Michael Nazzareno Trimarchi
2022-09-24 19:10             ` Adam Ford
2022-09-24 19:19               ` Michael Nazzareno Trimarchi
2022-09-24 21:47               ` Marek Vasut
2022-09-24 21:54                 ` Adam Ford
2022-09-26 16:58                   ` Tim Harvey
2022-09-26 17:06                     ` Adam Ford
2022-09-26 17:12                       ` Fabio Estevam
2022-09-26 17:28                         ` Adam Ford
2022-09-26 17:50                           ` Sean Anderson
2022-09-26 20:04                         ` Tim Harvey
2022-09-26 17:14                       ` Tim Harvey
2022-09-21  5:30   ` Peng Fan
2022-09-22  2:42     ` Marek Vasut
2022-10-21 11:43   ` sbabic
2022-09-21  5:31 ` [PATCH 1/4] ARM: imx8m: Deduplicate CAAM init with arch_misc_init() call Peng Fan
2022-10-21 11:52   ` Stefano Babic
2022-10-21 11:42 ` sbabic

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).