Clean up architecture-specific Kconfigs
It's an unfortunate side effect of our different-archs-per-stage mechanism that all src/arch/*/Kconfig files are always parsed with no if blocks to exclude them if they're not relevant. This makes it very easy to accidentally rely on a Kconfig default set by a totally different and not applying architecture. This patch moves a few Kconfigs from ARM and X86 that leaked out like this into a common Kconfig file for clarity. It also removes the never-used and never-working BOOTBLOCK_NORMAL mechanism from ARM, and gave ARM64 its own BOOTBLOCK_CUSTOM mechanism so that it doesn't leech off the ARM one (currently not used by any board). In the future, we should maybe prefix all options in the arch/*/Kconfig files with the architecture name (such as X86_BOOTBLOCK_NORMAL and ARM_LPAE are already doing), to make it more apparent when they are used in the wrong place. BUG=None TEST=None (tested together with dependent changes) Change-Id: Ieb2d79bae6c6800be0f93ca3489b658008b1dfae Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/219171 Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
parent
af6852b98f
commit
5528aa9252
8 changed files with 36 additions and 54 deletions
22
src/Kconfig
22
src/Kconfig
|
|
@ -219,6 +219,15 @@ config COVERAGE
|
|||
coverage information in CBMEM for extraction from user space.
|
||||
If unsure, say N.
|
||||
|
||||
config UPDATE_IMAGE
|
||||
bool "Update existing coreboot.rom image"
|
||||
default n
|
||||
help
|
||||
If this option is enabled, no new coreboot.rom file
|
||||
is created. Instead it is expected that there already
|
||||
is a suitable file for further processing.
|
||||
The bootblock will not be modified.
|
||||
|
||||
endmenu
|
||||
|
||||
source src/mainboard/Kconfig
|
||||
|
|
@ -264,6 +273,14 @@ source src/soc/Kconfig
|
|||
|
||||
endmenu
|
||||
|
||||
config CPU_HAS_BOOTBLOCK_INIT
|
||||
bool
|
||||
default n
|
||||
|
||||
config MAINBOARD_HAS_BOOTBLOCK_INIT
|
||||
bool
|
||||
default n
|
||||
|
||||
source src/device/Kconfig
|
||||
|
||||
menu "Generic Drivers"
|
||||
|
|
@ -285,6 +302,11 @@ config HEAP_SIZE
|
|||
hex
|
||||
default 0x4000
|
||||
|
||||
# Not used for the actual stack by ARM, but still needed in some src/lib/ files.
|
||||
config STACK_SIZE
|
||||
hex
|
||||
default 0x1000
|
||||
|
||||
config MAX_CPUS
|
||||
int
|
||||
default 1
|
||||
|
|
|
|||
|
|
@ -26,40 +26,6 @@ config ARM_BOOTBLOCK_CUSTOM
|
|||
bool
|
||||
default n
|
||||
|
||||
choice
|
||||
prompt "Bootblock behaviour"
|
||||
default ARM_BOOTBLOCK_SIMPLE
|
||||
depends on !ARM_BOOTBLOCK_CUSTOM
|
||||
|
||||
config ARM_BOOTBLOCK_SIMPLE
|
||||
bool "Always load fallback"
|
||||
|
||||
config ARM_BOOTBLOCK_NORMAL
|
||||
bool "Switch to normal if non-volatile memory says so"
|
||||
|
||||
endchoice
|
||||
|
||||
config CBMEM_CONSOLE_PRERAM_BASE
|
||||
hex
|
||||
depends on CONSOLE_CBMEM
|
||||
|
||||
config CPU_HAS_BOOTBLOCK_INIT
|
||||
bool
|
||||
default n
|
||||
|
||||
config MAINBOARD_HAS_BOOTBLOCK_INIT
|
||||
bool
|
||||
default n
|
||||
|
||||
config UPDATE_IMAGE
|
||||
bool "Update existing coreboot.rom image"
|
||||
default n
|
||||
help
|
||||
If this option is enabled, no new coreboot.rom file
|
||||
is created. Instead it is expected that there already
|
||||
is a suitable file for further processing.
|
||||
The bootblock will not be modified.
|
||||
|
||||
config ARM_LPAE
|
||||
bool "Enable LPAE"
|
||||
default n
|
||||
|
|
|
|||
|
|
@ -29,9 +29,8 @@ ifeq ($(CONFIG_ARCH_BOOTBLOCK_ARM_V4),y)
|
|||
|
||||
ifneq ($(CONFIG_ARM_BOOTBLOCK_CUSTOM),y)
|
||||
bootblock-y += bootblock.S
|
||||
bootblock-y += bootblock_simple.c
|
||||
endif
|
||||
bootblock-$(CONFIG_ARM_BOOTBLOCK_SIMPLE) += bootblock_simple.c
|
||||
bootblock-$(CONFIG_ARM_BOOTBLOCK_NORMAL) += bootblock_normal.c
|
||||
bootblock-y += cache.c
|
||||
|
||||
bootblock-c-ccopts += $(armv4_flags)
|
||||
|
|
|
|||
|
|
@ -31,9 +31,8 @@ ifeq ($(CONFIG_ARCH_BOOTBLOCK_ARM_V7),y)
|
|||
|
||||
ifneq ($(CONFIG_ARM_BOOTBLOCK_CUSTOM),y)
|
||||
bootblock-y += bootblock.S
|
||||
bootblock-y += bootblock_simple.c
|
||||
endif
|
||||
bootblock-$(CONFIG_ARM_BOOTBLOCK_SIMPLE) += bootblock_simple.c
|
||||
bootblock-$(CONFIG_ARM_BOOTBLOCK_NORMAL) += bootblock_normal.c
|
||||
bootblock-y += cache.c
|
||||
bootblock-y += cpu.S
|
||||
bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += exception.c
|
||||
|
|
|
|||
|
|
@ -21,3 +21,9 @@ config ARCH_SPINTABLE
|
|||
depends on ARCH_RAMSTAGE_ARM64
|
||||
|
||||
source src/arch/arm64/armv8/Kconfig
|
||||
|
||||
# If a custom bootblock is necessary, this option should be "select"-ed by
|
||||
# the thing that needs it, probably the CPU.
|
||||
config ARM64_BOOTBLOCK_CUSTOM
|
||||
bool
|
||||
default n
|
||||
|
|
|
|||
|
|
@ -32,11 +32,10 @@ armv8_asm_flags = $(armv8_flags)
|
|||
################################################################################
|
||||
ifeq ($(CONFIG_ARCH_BOOTBLOCK_ARM_V8_64),y)
|
||||
|
||||
ifneq ($(CONFIG_ARM_BOOTBLOCK_CUSTOM),y)
|
||||
ifneq ($(CONFIG_ARM64_BOOTBLOCK_CUSTOM),y)
|
||||
bootblock-y += bootblock.S
|
||||
bootblock-y += bootblock_simple.c
|
||||
endif
|
||||
bootblock-$(CONFIG_ARM_BOOTBLOCK_SIMPLE) += bootblock_simple.c
|
||||
bootblock-$(CONFIG_ARM_BOOTBLOCK_NORMAL) += bootblock_normal.c
|
||||
bootblock-y += cache.c
|
||||
bootblock-y += cpu.S
|
||||
bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += exception.c
|
||||
|
|
|
|||
|
|
@ -44,10 +44,6 @@ config RAMTOP
|
|||
hex
|
||||
default 0x200000
|
||||
|
||||
config STACK_SIZE
|
||||
hex
|
||||
default 0x1000
|
||||
|
||||
# We had to rename the choice options under arch/ because otherwise
|
||||
# the options would conflict between different architectures despite
|
||||
# the if ARCH_xxx guarding the arch/xxx/Kconfig sourcing.
|
||||
|
|
@ -68,15 +64,6 @@ config BOOTBLOCK_SOURCE
|
|||
default "bootblock_simple.c" if X86_BOOTBLOCK_SIMPLE
|
||||
default "bootblock_normal.c" if X86_BOOTBLOCK_NORMAL
|
||||
|
||||
config UPDATE_IMAGE
|
||||
bool "Update existing coreboot.rom image"
|
||||
default n
|
||||
help
|
||||
If this option is enabled, no new coreboot.rom file
|
||||
is created. Instead it is expected that there already
|
||||
is a suitable file for further processing.
|
||||
The bootblock will not be modified.
|
||||
|
||||
config ROMCC
|
||||
bool
|
||||
default n
|
||||
|
|
|
|||
|
|
@ -251,6 +251,10 @@ config CONSOLE_CBMEM_BUFFER_SIZE
|
|||
value (64K or 0x10000 bytes) is large enough to accommodate
|
||||
even the BIOS_SPEW level.
|
||||
|
||||
config CBMEM_CONSOLE_PRERAM_BASE
|
||||
hex
|
||||
depends on CONSOLE_CBMEM && CONSOLE_FIXED_PRERAM_CBMEM_BUFFER
|
||||
|
||||
config CONSOLE_PRERAM_BUFFER_SIZE
|
||||
depends on CONSOLE_CBMEM
|
||||
hex "Room allocated for console output before RAM is initialized"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue