[PATCH 0/5] board: sl28: various fixes

Give the sl28 board some love and fix various issues. Most of them were due to the transition to the upstream device trees.
Michael Walle (5): board: sl28: fix linking with disabled watchdog board: sl28: increase SPL_SYS_MALLOC_SIZE board: sl28: fix network on variant 3 doc: board: sl28: fix table board: sl28: fix USB0
arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi | 4 ++++ board/kontron/sl28/sl28.c | 3 ++- board/kontron/sl28/spl.c | 3 ++- configs/kontron_sl28_defconfig | 3 ++- doc/board/kontron/sl28.rst | 14 ++++++++------ 5 files changed, 18 insertions(+), 9 deletions(-)

We don't have a reference to the driver used by uclass_get_device_by_driver() in stop_recovery_watchdog(). Fix it by not calling that function if the watchdog driver isn't enabled.
Signed-off-by: Michael Walle mwalle@kernel.org --- board/kontron/sl28/sl28.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/board/kontron/sl28/sl28.c b/board/kontron/sl28/sl28.c index adfec8ba237..0baf5c63f18 100644 --- a/board/kontron/sl28/sl28.c +++ b/board/kontron/sl28/sl28.c @@ -156,7 +156,8 @@ int fsl_board_late_init(void) * If the watchdog isn't enabled at reset (which is a configuration * option) disabling it doesn't hurt either. */ - if (!IS_ENABLED(CONFIG_WATCHDOG_AUTOSTART)) + if (IS_ENABLED(CONFIG_WDT_SL28CPLD) && + !IS_ENABLED(CONFIG_WATCHDOG_AUTOSTART)) stop_recovery_watchdog();
return 0;

Hi,
Am Fr., 13. Dez. 2024 um 11:23 Uhr schrieb Michael Walle mwalle@kernel.org:
We don't have a reference to the driver used by uclass_get_device_by_driver() in stop_recovery_watchdog(). Fix it by not calling that function if the watchdog driver isn't enabled.
Signed-off-by: Michael Walle mwalle@kernel.org
Reviewed-by: Heiko Thiery heiko.thiery@gmail.com
board/kontron/sl28/sl28.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/board/kontron/sl28/sl28.c b/board/kontron/sl28/sl28.c index adfec8ba237..0baf5c63f18 100644 --- a/board/kontron/sl28/sl28.c +++ b/board/kontron/sl28/sl28.c @@ -156,7 +156,8 @@ int fsl_board_late_init(void) * If the watchdog isn't enabled at reset (which is a configuration * option) disabling it doesn't hurt either. */
if (!IS_ENABLED(CONFIG_WATCHDOG_AUTOSTART))
if (IS_ENABLED(CONFIG_WDT_SL28CPLD) &&
!IS_ENABLED(CONFIG_WATCHDOG_AUTOSTART)) stop_recovery_watchdog(); return 0;
-- 2.39.5

Increase the malloc size to 2MiB because our FIT image exceeds the 1MiB limit either if BL31 mode is enabled or if another device tree is added to the image.
Signed-off-by: Michael Walle mwalle@kernel.org --- configs/kontron_sl28_defconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/configs/kontron_sl28_defconfig b/configs/kontron_sl28_defconfig index 35894a10cbe..eae06b546da 100644 --- a/configs/kontron_sl28_defconfig +++ b/configs/kontron_sl28_defconfig @@ -54,6 +54,7 @@ CONFIG_SPL_MAX_SIZE=0x20000 CONFIG_SPL_BOARD_INIT=y # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set CONFIG_SPL_SYS_MALLOC=y +CONFIG_SPL_SYS_MALLOC_SIZE=0x200000 CONFIG_SPL_SYS_MMCSD_RAW_MODE=y CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x900 CONFIG_SPL_MPC8XXX_INIT_DDR=y

Hi
Am Fr., 13. Dez. 2024 um 11:23 Uhr schrieb Michael Walle mwalle@kernel.org:
Increase the malloc size to 2MiB because our FIT image exceeds the 1MiB limit either if BL31 mode is enabled or if another device tree is added to the image.
Signed-off-by: Michael Walle mwalle@kernel.org
Tested-by: Heiko Thiery heiko.thiery@gmail.com
Thanks
configs/kontron_sl28_defconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/configs/kontron_sl28_defconfig b/configs/kontron_sl28_defconfig index 35894a10cbe..eae06b546da 100644 --- a/configs/kontron_sl28_defconfig +++ b/configs/kontron_sl28_defconfig @@ -54,6 +54,7 @@ CONFIG_SPL_MAX_SIZE=0x20000 CONFIG_SPL_BOARD_INIT=y # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set CONFIG_SPL_SYS_MALLOC=y +CONFIG_SPL_SYS_MALLOC_SIZE=0x200000 CONFIG_SPL_SYS_MMCSD_RAW_MODE=y CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x900 CONFIG_SPL_MPC8XXX_INIT_DDR=y -- 2.39.5

Network is broken on variant 3 boards since commit 61ff13283c3b ("board: sl28: move to OF_UPSTREAM") because it was removing the variant 3 handling. That is because at that time the var3 device tree was not upstream. FWIW variant 3 is actually the same as the base variant, but I've missed that the -u-boot.dtsi is not inlcuded in this case which will set the ethernet alias. Now that the var3 device tree is upstream, just re-add it to the SPL handling again.
Fixes: 61ff13283c3b ("board: sl28: move to OF_UPSTREAM") Signed-off-by: Michael Walle mwalle@kernel.org --- board/kontron/sl28/spl.c | 3 ++- configs/kontron_sl28_defconfig | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/board/kontron/sl28/spl.c b/board/kontron/sl28/spl.c index 45a4fc65120..6b31f5e3a7c 100644 --- a/board/kontron/sl28/spl.c +++ b/board/kontron/sl28/spl.c @@ -50,9 +50,10 @@ int board_fit_config_name_match(const char *name) return strcmp(name, "freescale/fsl-ls1028a-kontron-sl28-var1"); case 2: return strcmp(name, "freescale/fsl-ls1028a-kontron-sl28-var2"); + case 3: + return strcmp(name, "freescale/fsl-ls1028a-kontron-sl28-var3"); case 4: return strcmp(name, "freescale/fsl-ls1028a-kontron-sl28-var4"); - case 3: default: return strcmp(name, "freescale/fsl-ls1028a-kontron-sl28"); } diff --git a/configs/kontron_sl28_defconfig b/configs/kontron_sl28_defconfig index eae06b546da..1f684093252 100644 --- a/configs/kontron_sl28_defconfig +++ b/configs/kontron_sl28_defconfig @@ -78,7 +78,7 @@ CONFIG_CMD_RNG=y CONFIG_OF_CONTROL=y CONFIG_SPL_OF_CONTROL=y CONFIG_OF_UPSTREAM=y -CONFIG_OF_LIST="freescale/fsl-ls1028a-kontron-sl28 freescale/fsl-ls1028a-kontron-sl28-var1 freescale/fsl-ls1028a-kontron-sl28-var2 freescale/fsl-ls1028a-kontron-sl28-var4" +CONFIG_OF_LIST="freescale/fsl-ls1028a-kontron-sl28 freescale/fsl-ls1028a-kontron-sl28-var1 freescale/fsl-ls1028a-kontron-sl28-var2 freescale/fsl-ls1028a-kontron-sl28-var3 freescale/fsl-ls1028a-kontron-sl28-var4" CONFIG_ENV_OVERWRITE=y CONFIG_ENV_IS_IN_SPI_FLASH=y CONFIG_SYS_REDUNDAND_ENVIRONMENT=y

Hi,
Am Fr., 13. Dez. 2024 um 11:23 Uhr schrieb Michael Walle mwalle@kernel.org:
Network is broken on variant 3 boards since commit 61ff13283c3b ("board: sl28: move to OF_UPSTREAM") because it was removing the variant 3 handling. That is because at that time the var3 device tree was not upstream. FWIW variant 3 is actually the same as the base variant, but I've missed that the -u-boot.dtsi is not inlcuded in this case which will set the ethernet alias. Now that the var3 device tree is upstream, just re-add it to the SPL handling again.
Fixes: 61ff13283c3b ("board: sl28: move to OF_UPSTREAM") Signed-off-by: Michael Walle mwalle@kernel.org
Reviewed-by: Heiko Thiery heiko.thiery@gmail.com
board/kontron/sl28/spl.c | 3 ++- configs/kontron_sl28_defconfig | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/board/kontron/sl28/spl.c b/board/kontron/sl28/spl.c index 45a4fc65120..6b31f5e3a7c 100644 --- a/board/kontron/sl28/spl.c +++ b/board/kontron/sl28/spl.c @@ -50,9 +50,10 @@ int board_fit_config_name_match(const char *name) return strcmp(name, "freescale/fsl-ls1028a-kontron-sl28-var1"); case 2: return strcmp(name, "freescale/fsl-ls1028a-kontron-sl28-var2");
case 3:
return strcmp(name, "freescale/fsl-ls1028a-kontron-sl28-var3"); case 4: return strcmp(name, "freescale/fsl-ls1028a-kontron-sl28-var4");
case 3: default: return strcmp(name, "freescale/fsl-ls1028a-kontron-sl28"); }
diff --git a/configs/kontron_sl28_defconfig b/configs/kontron_sl28_defconfig index eae06b546da..1f684093252 100644 --- a/configs/kontron_sl28_defconfig +++ b/configs/kontron_sl28_defconfig @@ -78,7 +78,7 @@ CONFIG_CMD_RNG=y CONFIG_OF_CONTROL=y CONFIG_SPL_OF_CONTROL=y CONFIG_OF_UPSTREAM=y -CONFIG_OF_LIST="freescale/fsl-ls1028a-kontron-sl28 freescale/fsl-ls1028a-kontron-sl28-var1 freescale/fsl-ls1028a-kontron-sl28-var2 freescale/fsl-ls1028a-kontron-sl28-var4" +CONFIG_OF_LIST="freescale/fsl-ls1028a-kontron-sl28 freescale/fsl-ls1028a-kontron-sl28-var1 freescale/fsl-ls1028a-kontron-sl28-var2 freescale/fsl-ls1028a-kontron-sl28-var3 freescale/fsl-ls1028a-kontron-sl28-var4" CONFIG_ENV_OVERWRITE=y CONFIG_ENV_IS_IN_SPI_FLASH=y CONFIG_SYS_REDUNDAND_ENVIRONMENT=y -- 2.39.5

Convert the table to a correct reST table syntax.
Signed-off-by: Michael Walle mwalle@kernel.org --- doc/board/kontron/sl28.rst | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/doc/board/kontron/sl28.rst b/doc/board/kontron/sl28.rst index 2cb8ec62be4..5d47ce6c158 100644 --- a/doc/board/kontron/sl28.rst +++ b/doc/board/kontron/sl28.rst @@ -65,12 +65,14 @@ wdt command flags The `wdt start` as well as the `wdt expire` command take a flags argument. The supported bitmask is as follows.
-| Bit | Description | -| --- | ----------------------------- | -| 0 | Enable failsafe mode | -| 1 | Lock the control register | -| 2 | Disable board reset | -| 3 | Enable WDT_TIME_OUT# line | +=== ============================== +Bit Description +=== ============================== + 0 Enable failsafe mode + 1 Lock the control register + 2 Disable board reset + 3 Enable WDT_TIME_OUT# line +=== ==============================
For example, you can use `wdt expire 1` to issue a reset and boot into the failsafe bootloader.

Since commit 61ff13283c3b ("board: sl28: move to OF_UPSTREAM") USB0 is broken because the former u-boot soc dtsi was setting dr_mode to "host" but the linux device tree isn't. That is because linux fully supports OTG but u-boot doesn't. Therefore, u-boot only ever enabled host mode and never OTG mode. Add it to our board "-u-boot.dtsi" to fix it.
Fixes: 61ff13283c3b ("board: sl28: move to OF_UPSTREAM") Reported-by: Heiko Thiery heiko.thiery@gmail.com Signed-off-by: Michael Walle mwalle@kernel.org --- arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi b/arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi index aacf181e2dd..4202d1e5654 100644 --- a/arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi +++ b/arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi @@ -203,3 +203,7 @@ &sysclk { bootph-all; }; + +&usb0 { + dr_mode = "host"; +};

Hi,
Am Fr., 13. Dez. 2024 um 11:23 Uhr schrieb Michael Walle mwalle@kernel.org:
Since commit 61ff13283c3b ("board: sl28: move to OF_UPSTREAM") USB0 is broken because the former u-boot soc dtsi was setting dr_mode to "host" but the linux device tree isn't. That is because linux fully supports OTG but u-boot doesn't. Therefore, u-boot only ever enabled host mode and never OTG mode. Add it to our board "-u-boot.dtsi" to fix it.
Fixes: 61ff13283c3b ("board: sl28: move to OF_UPSTREAM") Reported-by: Heiko Thiery heiko.thiery@gmail.com Signed-off-by: Michael Walle mwalle@kernel.org
Tested-by: Heiko Thiery heiko.thiery@gmail.com
Thank you
arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi b/arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi index aacf181e2dd..4202d1e5654 100644 --- a/arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi +++ b/arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi @@ -203,3 +203,7 @@ &sysclk { bootph-all; };
+&usb0 {
dr_mode = "host";
+};
2.39.5

From: Peng Fan peng.fan@nxp.com
On Fri, 13 Dec 2024 11:23:16 +0100, Michael Walle wrote:
Give the sl28 board some love and fix various issues. Most of them were due to the transition to the upstream device trees.
Michael Walle (5): board: sl28: fix linking with disabled watchdog board: sl28: increase SPL_SYS_MALLOC_SIZE board: sl28: fix network on variant 3 doc: board: sl28: fix table board: sl28: fix USB0
[...]
Applied, thanks!
[1/5] board: sl28: fix linking with disabled watchdog commit: 781a7c660cee194566d8e21f20c156e40bcea322 [2/5] board: sl28: increase SPL_SYS_MALLOC_SIZE commit: 6c849340b7ab5953e061885c4f7152bd93e3ba49 [3/5] board: sl28: fix network on variant 3 commit: ad7ebf1b989baf32e8917695a1611ea051356e35 [4/5] doc: board: sl28: fix table commit: 079ae2734c4641b148932c1758a2524492d35772 [5/5] board: sl28: fix USB0 commit: 56aa021f080096e8a0ac24b31c3ff40662c8b81b
Best regards,
participants (3)
-
Heiko Thiery
-
Michael Walle
-
Peng Fan (OSS)