[PATCH 06/11] vexpress64: move hardware setting from defconfig to Kconfig

Andre Przywara andre.przywara at arm.com
Fri Mar 4 17:30:13 CET 2022


The defconfigs for the Arm Juno board and the FVP model are quite large,
setting a lot of platform-fixed variables like SYS_TEXT_BASE.
As those values are not really a user choice, let's provide default
values for them in our Kconfig file, so a lot of cruft can be removed
from the defconfig files.
This also moves the driver selection out of there, since this is again
not something a user should really decide on. Instead we allow users to
enable or disable subsystems, and select the appropriate drivers based
on that in the Kconfig file.

Signed-off-by: Andre Przywara <andre.przywara at arm.com>
---
 arch/arm/Kconfig                       |  4 +++
 board/armltd/vexpress64/Kconfig        | 41 ++++++++++++++++++++++++--
 configs/vexpress_aemv8a_juno_defconfig | 21 ++-----------
 configs/vexpress_aemv8a_semi_defconfig | 10 -------
 4 files changed, 44 insertions(+), 32 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index afb42e62d8..a46522db9d 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1243,6 +1243,10 @@ config ARCH_VEXPRESS64
 	select PL01X_SERIAL
 	select OF_CONTROL
 	select CLK
+	select BLK
+	select MTD_NOR_FLASH if MTD
+	select FLASH_CFI_DRIVER if MTD
+	select ENV_IS_IN_FLASH if MTD
 
 config TARGET_TOTAL_COMPUTE
 	bool "Support Total Compute Platform"
diff --git a/board/armltd/vexpress64/Kconfig b/board/armltd/vexpress64/Kconfig
index 34126446a7..512bbbe72e 100644
--- a/board/armltd/vexpress64/Kconfig
+++ b/board/armltd/vexpress64/Kconfig
@@ -15,15 +15,24 @@ choice
 config TARGET_VEXPRESS64_BASE_FVP
 	bool "Support Versatile Express ARMv8a FVP BASE model"
 	select SEMIHOSTING
+	select VIRTIO_BLK if VIRTIO_MMIO
+	select VIRTIO_NET if VIRTIO_MMIO
+	select DM_ETH if VIRTIO_NET
 	select LINUX_KERNEL_IMAGE_HEADER
 	select POSITION_INDEPENDENT
 	select OF_BOARD
 
 config TARGET_VEXPRESS64_JUNO
 	bool "Support Versatile Express Juno Development Platform"
-	select DM_ETH
-	select USB
-	select BLK
+	select PCIE_ECAM_GENERIC if PCI
+	select SATA_SIL
+	select SMC911X if DM_ETH
+	select SMC911X_32_BIT if SMC911X
+	select CMD_USB if USB
+	select USB_EHCI_HCD if USB
+	select USB_EHCI_GENERIC if USB
+	select USB_OHCI_HCD if USB
+	select USB_OHCI_GENERIC if USB
 	imply OF_HAS_PRIOR_STAGE
 
 endchoice
@@ -38,4 +47,30 @@ config JUNO_DTB_PART
 config LNX_KRNL_IMG_TEXT_OFFSET_BASE
 	default SYS_TEXT_BASE
 
+config SYS_TEXT_BASE
+	default 0x88000000 if TARGET_VEXPRESS64_BASE_FVP
+	default 0xe0000000 if TARGET_VEXPRESS64_JUNO
+
+config SYS_MALLOC_LEN
+	default 0x810000 if TARGET_VEXPRESS64_JUNO
+	default 0x840000 if TARGET_VEXPRESS64_BASE_FVP
+
+config SYS_MALLOC_F_LEN
+	default 0x2000
+
+config SYS_LOAD_ADDR
+	default 0x90000000
+
+config ENV_ADDR
+	default 0x0BFC0000 if TARGET_VEXPRESS64_JUNO
+	default 0x0FFC0000 if TARGET_VEXPRESS64_BASE_FVP
+
+config ENV_SIZE
+	default 0x10000 if TARGET_VEXPRESS64_JUNO
+	default 0x40000
+
+config ENV_SECT_SIZE
+	default 0x10000 if TARGET_VEXPRESS64_JUNO
+	default 0x40000
+
 endif
diff --git a/configs/vexpress_aemv8a_juno_defconfig b/configs/vexpress_aemv8a_juno_defconfig
index 2fcbcce308..a0d3370ae2 100644
--- a/configs/vexpress_aemv8a_juno_defconfig
+++ b/configs/vexpress_aemv8a_juno_defconfig
@@ -1,19 +1,13 @@
 CONFIG_ARM=y
 CONFIG_ARCH_VEXPRESS64=y
-CONFIG_SYS_TEXT_BASE=0xe0000000
-CONFIG_SYS_MALLOC_LEN=0x810000
-CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_NR_DRAM_BANKS=2
 CONFIG_SYS_MEMTEST_START=0x80000000
 CONFIG_SYS_MEMTEST_END=0xff000000
-CONFIG_ENV_SIZE=0x10000
-CONFIG_ENV_SECT_SIZE=0x10000
 CONFIG_DEFAULT_DEVICE_TREE="juno-r2"
 CONFIG_IDENT_STRING=" vexpress_aemv8a"
 CONFIG_TARGET_VEXPRESS64_JUNO=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_REMAKE_ELF=y
-CONFIG_SYS_LOAD_ADDR=0x90000000
 CONFIG_BOOTDELAY=1
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyAMA0,115200n8 root=/dev/sda2 rw rootwait earlycon=pl011,0x7ff80000 debug user_debug=31 androidboot.hardware=juno loglevel=9"
@@ -28,28 +22,17 @@ CONFIG_CMD_ARMFLASH=y
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_PCI=y
 CONFIG_CMD_SATA=y
-CONFIG_CMD_USB=y
 # CONFIG_CMD_ITEST is not set
 # CONFIG_CMD_SETEXPR is not set
 # CONFIG_CMD_NFS is not set
 CONFIG_CMD_CACHE=y
 # CONFIG_CMD_SLEEP is not set
 CONFIG_CMD_UBI=y
-CONFIG_ENV_IS_IN_FLASH=y
-CONFIG_ENV_ADDR=0xBFC0000
-CONFIG_SATA_SIL=y
 # CONFIG_MMC is not set
 CONFIG_MTD=y
-CONFIG_MTD_NOR_FLASH=y
-CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
 CONFIG_SYS_FLASH_PROTECTION=y
 CONFIG_SYS_FLASH_CFI=y
-CONFIG_SMC911X=y
-CONFIG_SMC911X_32_BIT=y
+CONFIG_DM_ETH=y
 CONFIG_PCI=y
-CONFIG_PCIE_ECAM_GENERIC=y
-CONFIG_USB_EHCI_HCD=y
-CONFIG_USB_EHCI_GENERIC=y
-CONFIG_USB_OHCI_HCD=y
-CONFIG_USB_OHCI_GENERIC=y
+CONFIG_USB=y
diff --git a/configs/vexpress_aemv8a_semi_defconfig b/configs/vexpress_aemv8a_semi_defconfig
index cbabc2f96a..3e2d076837 100644
--- a/configs/vexpress_aemv8a_semi_defconfig
+++ b/configs/vexpress_aemv8a_semi_defconfig
@@ -1,19 +1,13 @@
 CONFIG_ARM=y
 # CONFIG_ARM64_CRC32 is not set
 CONFIG_ARCH_VEXPRESS64=y
-CONFIG_SYS_TEXT_BASE=0x88000000
-CONFIG_SYS_MALLOC_LEN=0x840000
-CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_NR_DRAM_BANKS=2
 CONFIG_SYS_MEMTEST_START=0x80000000
 CONFIG_SYS_MEMTEST_END=0xff000000
-CONFIG_ENV_SIZE=0x40000
-CONFIG_ENV_SECT_SIZE=0x40000
 CONFIG_DEFAULT_DEVICE_TREE="fvp-base-revc"
 CONFIG_IDENT_STRING=" vexpress_aemv8a"
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_REMAKE_ELF=y
-CONFIG_SYS_LOAD_ADDR=0x90000000
 CONFIG_ANDROID_BOOT_IMAGE=y
 CONFIG_BOOTDELAY=1
 CONFIG_USE_BOOTARGS=y
@@ -37,12 +31,8 @@ CONFIG_CMD_CACHE=y
 CONFIG_CMD_UBI=y
 # CONFIG_ISO_PARTITION is not set
 # CONFIG_EFI_PARTITION is not set
-CONFIG_ENV_IS_IN_FLASH=y
-CONFIG_ENV_ADDR=0xFFC0000
 # CONFIG_MMC is not set
 CONFIG_MTD=y
-CONFIG_MTD_NOR_FLASH=y
-CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
 CONFIG_SYS_FLASH_PROTECTION=y
 CONFIG_SYS_FLASH_CFI=y
-- 
2.25.1



More information about the U-Boot mailing list