Skip to contentSkip to conversation

board: sl28: various fixes

PATCH Applied Michael Walle 3 participants 11 messages Dec 13, 2024 – Dec 15, 2024 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

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
#1 lore raw

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
index adfec8ba237..0baf5c63f18 100644
@@ -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
Reviewed-by on v1 1/5
#2 lore raw

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() in stop_recovery_watchdog(). Fix it by not calling that function if the watchdog driver isn't enabled.

Quoted 21 lines
---
 board/kontron/sl28/sl28.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
board/kontron/sl28/sl28.c +2 -2
index adfec8ba237..0baf5c63f18 100644
@@ -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

#3 lore raw

PATCH 2/5 board: sl28: increase SPL_SYS_MALLOC_SIZE

In reply to Michael Walle

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.

---
 configs/kontron_sl28_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/kontron_sl28_defconfig +1 -0
index 35894a10cbe..eae06b546da 100644
@@ -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
Tested-by on v1 2/5
#4 lore raw

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.

Thanks

Quoted 19 lines
---
 configs/kontron_sl28_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/kontron_sl28_defconfig +1 -1
index 35894a10cbe..eae06b546da 100644
@@ -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

#5 lore raw

PATCH 3/5 board: sl28: fix network on variant 3

In reply to Michael Walle

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")
---
 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
index 45a4fc65120..6b31f5e3a7c 100644
@@ -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
index eae06b546da..1f684093252 100644
@@ -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
Reviewed-by on v1 3/5
#6 lore raw

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 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")
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
index 45a4fc65120..6b31f5e3a7c 100644
@@ -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
index eae06b546da..1f684093252 100644
@@ -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

#7 lore raw

PATCH 4/5 doc: board: sl28: fix table

In reply to Michael Walle

Convert 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
index 2cb8ec62be4..5d47ce6c158 100644
@@ -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
#8 lore raw

PATCH 5/5 board: sl28: fix USB0

In reply to Michael Walle

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")
---
 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
index aacf181e2dd..4202d1e5654 100644
@@ -203,3 +203,7 @@
 &sysclk {
 	bootph-all;
 };
+
+&usb0 {
+	dr_mode = "host";
+};
Signature · 1 line
2.39.5
Tested-by on v1 5/5
#9 lore raw

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 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")

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
index aacf181e2dd..4202d1e5654 100644
@@ -203,3 +203,7 @@
 &sysclk {
        bootph-all;
 };
+
+&usb0 {
+       dr_mode = "host";
+};
--

2.39.5

#10 lore raw
In reply to Michael Walle

From: 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: 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,

Signature · 1 line
Peng Fan <[email protected]>