board: sl28: various fixes
cover 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(-)
Signature · 1 line
2.39.5
PATCH 1/5 board: sl28: fix linking with disabled watchdog
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.
--- board/kontron/sl28/sl28.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
board/kontron/sl28/sl28.c +2 -1
@@ -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 ;
Signature · 1 line
2.39.5
Re: [PATCH 1/5] board: sl28: fix linking with disabled watchdog
Hi,
Am Fr., 13. Dez. 2024 um 11:23 Uhr schrieb Michael Walle <[email protected]>:
Quoted 6 lines
We don't have a reference to the driver used by
uclass_get_device_by_driver()instop_recovery_watchdog(). Fix it by not calling that function if the watchdog driver isn't enabled.Signed-off-by Michael Walle <[email protected]>
Quoted 21 lines
--- board/kontron/sl28/sl28.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)board/kontron/sl28/sl28.c +2
-2@@ -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
PATCH 2/5 board: sl28: increase SPL_SYS_MALLOC_SIZE
In reply to Michael WalleIncrease 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.
--- configs/kontron_sl28_defconfig | 1 + 1 file changed, 1 insertion(+)
configs/kontron_sl28_defconfig +1 -0
@@ -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
Signature · 1 line
2.39.5
Re: [PATCH 2/5] board: sl28: increase SPL_SYS_MALLOC_SIZE
Hi
Am Fr., 13. Dez. 2024 um 11:23 Uhr schrieb Michael Walle <[email protected]>:
Quoted 6 lines
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 <[email protected]>
Thanks
Quoted 19 lines
--- configs/kontron_sl28_defconfig | 1 + 1 file changed, 1 insertion(+)configs/kontron_sl28_defconfig +1
-1@@ -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
PATCH 3/5 board: sl28: fix network on variant 3
In reply to Michael WalleNetwork 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.
--- board/kontron/sl28/spl.c | 3 ++- configs/kontron_sl28_defconfig | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-)
board/kontron/sl28/spl.c +2 -1
@@ -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" ); }
configs/kontron_sl28_defconfig +1 -1
@@ -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
Signature · 1 line
2.39.5
Re: [PATCH 3/5] board: sl28: fix network on variant 3
Hi,
Am Fr., 13. Dez. 2024 um 11:23 Uhr schrieb Michael Walle <[email protected]>:
Quoted 11 lines
Network is broken on variant 3 boards since commit
61ff13283c3b("board:
sl28: move toOF_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.dtsiis 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 <[email protected]>
Quoted 37 lines
--- board/kontron/sl28/spl.c | 3 ++- configs/kontron_sl28_defconfig | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-)board/kontron/sl28/spl.c +2
-1@@ -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" ); }configs/kontron_sl28_defconfig +1
-2@@ -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
PATCH 4/5 doc: board: sl28: fix table
In reply to Michael WalleConvert the table to a correct reST table syntax.
--- doc/board/kontron/sl28.rst | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
doc/board/kontron/sl28.rst +8 -6
@@ -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.
Signature · 1 line
2.39.5
PATCH 5/5 board: sl28: fix USB0
In reply to Michael WalleSince 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.
--- arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi | 4 ++++ 1 file changed, 4 insertions(+)
arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi +4 -0
@@ -203,3 +203,7 @@ &sysclk { bootph-all; }; + +&usb0 { + dr_mode = "host"; +};
Signature · 1 line
2.39.5
Re: [PATCH 5/5] board: sl28: fix USB0
Hi,
Am Fr., 13. Dez. 2024 um 11:23 Uhr schrieb Michael Walle <[email protected]>:
Quoted 10 lines
Since commit
61ff13283c3b("board: sl28: move toOF_UPSTREAM") USB0 is broken because the former u-boot soc dtsi was settingdr_modeto "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 <[email protected]>Signed-off-by Michael Walle <[email protected]>
Thank you
Quoted 19 lines
--- arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi | 4 ++++ 1 file changed, 4 insertions(+)arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi +4
-1@@ -203,3 +203,7 @@ &sysclk { bootph-all; }; + +&usb0 { + dr_mode = "host"; +}; --2.39.5
Peng Fan (OSS)
AppliedFrom: Peng Fan <[email protected]>
Quoted 11 lines · Michael Walle
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: increaseSPL_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: 56aa021f080096e8a0ac24b31c3ff40662c8b81bBest regards,
Signature · 1 line
Peng Fan <[email protected]>