Skip to contentSkip to conversation

arch: mvebu: Disable by default unused peripherals in SPL

PATCH In review Pali Rohár 2 participants 5 messages May 24, 2022 – Jul 21, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arch: mvebu: Disable by default unused peripherals in SPL

SPL on mvebu loads proper U-Boot from custom Marvell kwbimage format and therefore support for other binary formats is not required to be present in SPL. Boot source of proper U-Boot is defined by compile time options and therefore it is not required to enable all possible and unused peripherals in SPL by default.

This change decrease size of SPL binaries.

---
 common/spl/Kconfig  | 2 ++
 disk/Kconfig        | 2 ++
 drivers/mmc/Kconfig | 1 +
 drivers/usb/Kconfig | 1 +
 4 files changed, 6 insertions(+)
common/spl/Kconfig +2 -0
index 50ff113cab21..0c8df271aa59 100644
@@ -218,6 +218,7 @@ config SPL_BOOTCOUNT_LIMIT
 
 config SPL_RAW_IMAGE_SUPPORT
 	bool "Support SPL loading and booting of RAW images"
+	default n if ARCH_MVEBU
 	default n if (ARCH_MX6 && (SPL_MMC || SPL_SATA))
 	default y
 	depends on !TI_SECURE_DEVICE
@@ -228,6 +229,7 @@ config SPL_RAW_IMAGE_SUPPORT
 
 config SPL_LEGACY_IMAGE_FORMAT
 	bool "Support SPL loading and booting of Legacy images"
+	default n if ARCH_MVEBU
 	default y if !SPL_LOAD_FIT
 	depends on !TI_SECURE_DEVICE
 	help
disk/Kconfig +2 -0
index 359af3b27e6d..81d8867ed7fc 100644
@@ -60,6 +60,7 @@ config DOS_PARTITION
 config SPL_DOS_PARTITION
 	bool "Enable MS Dos partition table for SPL"
 	depends on SPL
+	default n if ARCH_MVEBU
 	default n if ARCH_SUNXI
 	default y if DOS_PARTITION
 	select SPL_PARTITIONS
@@ -130,6 +131,7 @@ config EFI_PARTITION_ENTRIES_OFF
 config SPL_EFI_PARTITION
 	bool "Enable EFI GPT partition table for SPL"
 	depends on  SPL
+	default n if ARCH_MVEBU
 	default n if ARCH_SUNXI
 	default y if EFI_PARTITION
 	select SPL_PARTITIONS
drivers/mmc/Kconfig +1 -0
index f04cc44e1973..847c0ef0acc7 100644
@@ -45,6 +45,7 @@ config DM_MMC
 config SPL_DM_MMC
 	bool "Enable MMC controllers using Driver Model in SPL"
 	depends on SPL_DM && DM_MMC
+	default n if ARCH_MVEBU && !MVEBU_SPL_BOOT_DEVICE_MMC
 	default y
 	help
 	  This enables the MultiMediaCard (MMC) uclass which supports MMC and
drivers/usb/Kconfig +1 -0
index ab1d061bd0d5..075e9682c435 100644
@@ -50,6 +50,7 @@ config DM_USB
 config SPL_DM_USB
 	bool "Enable driver model for USB host most in SPL"
 	depends on SPL_DM && DM_USB
+	default n if ARCH_MVEBU
 	default y
 
 config DM_USB_GADGET
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Pali Rohár

SPL on mvebu loads proper U-Boot from custom Marvell kwbimage format and therefore support for other binary formats is not required to be present in SPL. Boot source of proper U-Boot is defined by compile time options and therefore it is not required to enable all possible and unused peripherals in SPL by default.

This change decrease size of SPL binaries.

Thanks,
Stefan

Quoted 64 lines
---
  common/spl/Kconfig  | 2 ++
  disk/Kconfig        | 2 ++
  drivers/mmc/Kconfig | 1 +
  drivers/usb/Kconfig | 1 +
  4 files changed, 6 insertions(+)
common/spl/Kconfig +2 -0
index 50ff113cab21..0c8df271aa59 100644
@@ -218,6 +218,7 @@ config SPL_BOOTCOUNT_LIMIT
 
  config SPL_RAW_IMAGE_SUPPORT
  	bool "Support SPL loading and booting of RAW images"
+	default n if ARCH_MVEBU
  	default n if (ARCH_MX6 && (SPL_MMC || SPL_SATA))
  	default y
  	depends on !TI_SECURE_DEVICE
@@ -228,6 +229,7 @@ config SPL_RAW_IMAGE_SUPPORT
 
  config SPL_LEGACY_IMAGE_FORMAT
  	bool "Support SPL loading and booting of Legacy images"
+	default n if ARCH_MVEBU
  	default y if !SPL_LOAD_FIT
  	depends on !TI_SECURE_DEVICE
  	help
disk/Kconfig +2 -0
index 359af3b27e6d..81d8867ed7fc 100644
@@ -60,6 +60,7 @@ config DOS_PARTITION
  config SPL_DOS_PARTITION
  	bool "Enable MS Dos partition table for SPL"
  	depends on SPL
+	default n if ARCH_MVEBU
  	default n if ARCH_SUNXI
  	default y if DOS_PARTITION
  	select SPL_PARTITIONS
@@ -130,6 +131,7 @@ config EFI_PARTITION_ENTRIES_OFF
  config SPL_EFI_PARTITION
  	bool "Enable EFI GPT partition table for SPL"
  	depends on  SPL
+	default n if ARCH_MVEBU
  	default n if ARCH_SUNXI
  	default y if EFI_PARTITION
  	select SPL_PARTITIONS
drivers/mmc/Kconfig +1 -0
index f04cc44e1973..847c0ef0acc7 100644
@@ -45,6 +45,7 @@ config DM_MMC
  config SPL_DM_MMC
  	bool "Enable MMC controllers using Driver Model in SPL"
  	depends on SPL_DM && DM_MMC
+	default n if ARCH_MVEBU && !MVEBU_SPL_BOOT_DEVICE_MMC
  	default y
  	help
  	  This enables the MultiMediaCard (MMC) uclass which supports MMC and
drivers/usb/Kconfig +0 -0
index ab1d061bd0d5..075e9682c435 100644

drivers/usb/Kconfig config DM_USB · line 56

Quoted 7 lines
drivers/usb/Kconfig +1 -0
@@ -50,6 +50,7 @@ config DM_USB
  config SPL_DM_USB
  	bool "Enable driver model for USB host most in SPL"
  	depends on SPL_DM && DM_USB
+	default n if ARCH_MVEBU
  	default y
 
  config DM_USB_GADGET

Viele Grüße,
Stefan Roese

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
#2 lore raw
Quoted 7 lines · Stefan Roese
Quoted 6 lines · Pali Rohár

SPL on mvebu loads proper U-Boot from custom Marvell kwbimage format and therefore support for other binary formats is not required to be present in SPL. Boot source of proper U-Boot is defined by compile time options and therefore it is not required to enable all possible and unused peripherals in SPL by default.

Quoted 8 lines
Quoted 3 lines

This change decrease size of SPL binaries.

Thanks,
Stefan

This patch causes some regressions, like on clearfog:

$ make clearfog_defconfig
$ make -s -j20
===================== WARNING ======================
This board does not use CONFIG_TIMER (Driver Model
for Timer drivers). Please update the board to use
CONFIG_TIMER before the v2023.01 release. Failure to
update by the deadline may result in board removal.
See doc/develop/driver-model/migration.rst for more info.
====================================================
/opt/kernel.org/gcc-11.1.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-ld.bfd: cmd/tlv_eeprom.o: in function `is_checksum_valid':
/home/stefan/git/u-boot/u-boot-marvell/cmd/tlv_eeprom.c:114: undefined reference to `crc32'
/opt/kernel.org/gcc-11.1.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-ld.bfd: cmd/tlv_eeprom.o: in function `update_crc':
/home/stefan/git/u-boot/u-boot-marvell/cmd/tlv_eeprom.c:379: undefined reference to `crc32'
make[1]: *** [scripts/Makefile.spl:525: spl/u-boot-spl] Error 1
make: *** [Makefile:2106: spl/u-boot-spl] Error 2

Could you please have a look?

Thanks,
Stefan

Quoted 64 lines
Quoted 64 lines

---
  common/spl/Kconfig  | 2 ++
  disk/Kconfig        | 2 ++
  drivers/mmc/Kconfig | 1 +
  drivers/usb/Kconfig | 1 +

  4 files changed, 6 insertions(+)
common/spl/Kconfig +0 -0
index 50ff113cab21..0c8df271aa59 100644
@@ -218,6 +218,7 @@ config SPL_BOOTCOUNT_LIMIT

  config SPL_RAW_IMAGE_SUPPORT
      bool "Support SPL loading and booting of RAW images" +    default n if ARCH_MVEBU
      default n if (ARCH_MX6 && (SPL_MMC || SPL_SATA)) default y
      depends on !TI_SECURE_DEVICE

common/spl/Kconfig +0 -0
@@ -228,6 +229,7 @@ config SPL_RAW_IMAGE_SUPPORT

  config SPL_LEGACY_IMAGE_FORMAT
      bool "Support SPL loading and booting of Legacy images" +    default n if ARCH_MVEBU
      default y if !SPL_LOAD_FIT
      depends on !TI_SECURE_DEVICE
      help

disk/Kconfig +0 -0
index 359af3b27e6d..81d8867ed7fc 100644
@@ -60,6 +60,7 @@ config DOS_PARTITION

  config SPL_DOS_PARTITION
      bool "Enable MS Dos partition table for SPL" depends on SPL
+    default n if ARCH_MVEBU
      default n if ARCH_SUNXI
      default y if DOS_PARTITION
      select SPL_PARTITIONS

disk/Kconfig +0 -0
@@ -130,6 +131,7 @@ config EFI_PARTITION_ENTRIES_OFF

  config SPL_EFI_PARTITION
      bool "Enable EFI GPT partition table for SPL" depends on  SPL
+    default n if ARCH_MVEBU
      default n if ARCH_SUNXI
      default y if EFI_PARTITION
      select SPL_PARTITIONS

drivers/mmc/Kconfig +0 -0
index f04cc44e1973..847c0ef0acc7 100644
@@ -45,6 +45,7 @@ config DM_MMC

  config SPL_DM_MMC
      bool "Enable MMC controllers using Driver Model in SPL" depends on SPL_DM && DM_MMC
+    default n if ARCH_MVEBU && !MVEBU_SPL_BOOT_DEVICE_MMC default y
      help
        This enables the MultiMediaCard (MMC) uclass which supports MMC and

drivers/usb/Kconfig +0 -0
index ab1d061bd0d5..075e9682c435 100644
@@ -50,6 +50,7 @@ config DM_USB

  config SPL_DM_USB

Quoted 9 lines
Quoted 5 lines

      bool "Enable driver model for USB host most in SPL" depends on SPL_DM && DM_USB
+    default n if ARCH_MVEBU
      default y
  config DM_USB_GADGET

Viele Grüße,
Stefan Roese

Viele Grüße,
Stefan Roese

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
#3 lore raw
Quoted 41 lines · On Monday 30 May 2022 10:26:37 Stefan Roese wrote:
Quoted 9 lines · Stefan Roese
Quoted 8 lines · Pali Rohár

SPL on mvebu loads proper U-Boot from custom Marvell kwbimage format and therefore support for other binary formats is not required to be present in
SPL. Boot source of proper U-Boot is defined by compile time options and therefore it is not required to enable all possible and unused peripherals
in SPL by default.

Quoted 8 lines
Quoted 3 lines

This change decrease size of SPL binaries.

Thanks,
Stefan

This patch causes some regressions, like on clearfog:

$ make clearfog_defconfig
$ make -s -j20
===================== WARNING ======================
This board does not use CONFIG_TIMER (Driver Model
for Timer drivers). Please update the board to use
CONFIG_TIMER before the v2023.01 release. Failure to
update by the deadline may result in board removal.
See doc/develop/driver-model/migration.rst for more info.
====================================================
/opt/kernel.org/gcc-11.1.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-ld.bfd:
cmd/tlv_eeprom.o: in function `is_checksum_valid':
/home/stefan/git/u-boot/u-boot-marvell/cmd/tlv_eeprom.c:114: undefined
reference to `crc32'
/opt/kernel.org/gcc-11.1.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-ld.bfd:
cmd/tlv_eeprom.o: in function `update_crc':
/home/stefan/git/u-boot/u-boot-marvell/cmd/tlv_eeprom.c:379: undefined
reference to `crc32'
make[1]: *** [scripts/Makefile.spl:525: spl/u-boot-spl] Error 1
make: *** [Makefile:2106: spl/u-boot-spl] Error 2
Quoted 1 line

Could you please have a look?

Yes! It is missing dependency in Kconfig. Now I sent patch which is fixing it:

https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

Quoted 85 lines

Thanks,
Stefan

Quoted 65 lines
Quoted 65 lines

---
  common/spl/Kconfig  | 2 ++
  disk/Kconfig        | 2 ++
  drivers/mmc/Kconfig | 1 +
  drivers/usb/Kconfig | 1 +

  4 files changed, 6 insertions(+)
common/spl/Kconfig +0 -0
index 50ff113cab21..0c8df271aa59 100644
@@ -218,6 +218,7 @@ config SPL_BOOTCOUNT_LIMIT

  config SPL_RAW_IMAGE_SUPPORT
      bool "Support SPL loading and booting of RAW images" +    default n if ARCH_MVEBU
      default n if (ARCH_MX6 && (SPL_MMC || SPL_SATA)) default y
      depends on !TI_SECURE_DEVICE

common/spl/Kconfig +0 -0
@@ -228,6 +229,7 @@ config SPL_RAW_IMAGE_SUPPORT

  config SPL_LEGACY_IMAGE_FORMAT
      bool "Support SPL loading and booting of Legacy images" +    default n if ARCH_MVEBU
      default y if !SPL_LOAD_FIT
      depends on !TI_SECURE_DEVICE
      help

disk/Kconfig +0 -0
index 359af3b27e6d..81d8867ed7fc 100644
@@ -60,6 +60,7 @@ config DOS_PARTITION

  config SPL_DOS_PARTITION
      bool "Enable MS Dos partition table for SPL" depends on SPL
+    default n if ARCH_MVEBU
      default n if ARCH_SUNXI
      default y if DOS_PARTITION
      select SPL_PARTITIONS

disk/Kconfig +0 -0
@@ -130,6 +131,7 @@ config EFI_PARTITION_ENTRIES_OFF

  config SPL_EFI_PARTITION
      bool "Enable EFI GPT partition table for SPL" depends on  SPL
+    default n if ARCH_MVEBU
      default n if ARCH_SUNXI
      default y if EFI_PARTITION
      select SPL_PARTITIONS

drivers/mmc/Kconfig +0 -0
index f04cc44e1973..847c0ef0acc7 100644
@@ -45,6 +45,7 @@ config DM_MMC

  config SPL_DM_MMC
      bool "Enable MMC controllers using Driver Model in SPL" depends on SPL_DM && DM_MMC
+    default n if ARCH_MVEBU && !MVEBU_SPL_BOOT_DEVICE_MMC default y
      help
        This enables the MultiMediaCard (MMC) uclass which supports MMC and

drivers/usb/Kconfig +0 -0
index ab1d061bd0d5..075e9682c435 100644
@@ -50,6 +50,7 @@ config DM_USB

  config SPL_DM_USB

Quoted 9 lines
Quoted 5 lines

      bool "Enable driver model for USB host most in SPL" depends on SPL_DM && DM_USB
+    default n if ARCH_MVEBU
      default y
  config DM_USB_GADGET

Viele Grüße,
Stefan Roese

Viele Grüße,
Stefan Roese

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
#4 lore raw
In reply to Pali Rohár
Quoted 9 lines · Pali Rohár

SPL on mvebu loads proper U-Boot from custom Marvell kwbimage format and therefore support for other binary formats is not required to be present in SPL. Boot source of proper U-Boot is defined by compile time options and therefore it is not required to enable all possible and unused peripherals in SPL by default.

This change decrease size of SPL binaries.

Applied to u-boot-marvell/master

Thanks,
Stefan

Quoted 64 lines
---
  common/spl/Kconfig  | 2 ++
  disk/Kconfig        | 2 ++
  drivers/mmc/Kconfig | 1 +
  drivers/usb/Kconfig | 1 +
  4 files changed, 6 insertions(+)
common/spl/Kconfig +2 -0
index 50ff113cab21..0c8df271aa59 100644
@@ -218,6 +218,7 @@ config SPL_BOOTCOUNT_LIMIT
 
  config SPL_RAW_IMAGE_SUPPORT
  	bool "Support SPL loading and booting of RAW images"
+	default n if ARCH_MVEBU
  	default n if (ARCH_MX6 && (SPL_MMC || SPL_SATA))
  	default y
  	depends on !TI_SECURE_DEVICE
@@ -228,6 +229,7 @@ config SPL_RAW_IMAGE_SUPPORT
 
  config SPL_LEGACY_IMAGE_FORMAT
  	bool "Support SPL loading and booting of Legacy images"
+	default n if ARCH_MVEBU
  	default y if !SPL_LOAD_FIT
  	depends on !TI_SECURE_DEVICE
  	help
disk/Kconfig +2 -0
index 359af3b27e6d..81d8867ed7fc 100644
@@ -60,6 +60,7 @@ config DOS_PARTITION
  config SPL_DOS_PARTITION
  	bool "Enable MS Dos partition table for SPL"
  	depends on SPL
+	default n if ARCH_MVEBU
  	default n if ARCH_SUNXI
  	default y if DOS_PARTITION
  	select SPL_PARTITIONS
@@ -130,6 +131,7 @@ config EFI_PARTITION_ENTRIES_OFF
  config SPL_EFI_PARTITION
  	bool "Enable EFI GPT partition table for SPL"
  	depends on  SPL
+	default n if ARCH_MVEBU
  	default n if ARCH_SUNXI
  	default y if EFI_PARTITION
  	select SPL_PARTITIONS
drivers/mmc/Kconfig +1 -0
index f04cc44e1973..847c0ef0acc7 100644
@@ -45,6 +45,7 @@ config DM_MMC
  config SPL_DM_MMC
  	bool "Enable MMC controllers using Driver Model in SPL"
  	depends on SPL_DM && DM_MMC
+	default n if ARCH_MVEBU && !MVEBU_SPL_BOOT_DEVICE_MMC
  	default y
  	help
  	  This enables the MultiMediaCard (MMC) uclass which supports MMC and
drivers/usb/Kconfig +0 -0
index ab1d061bd0d5..075e9682c435 100644

drivers/usb/Kconfig config DM_USB · line 56

Quoted 7 lines
drivers/usb/Kconfig +1 -0
@@ -50,6 +50,7 @@ config DM_USB
  config SPL_DM_USB
  	bool "Enable driver model for USB host most in SPL"
  	depends on SPL_DM && DM_USB
+	default n if ARCH_MVEBU
  	default y
 
  config DM_USB_GADGET

Viele Grüße,
Stefan Roese

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]