Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/36422 )
Change subject: lib/Kconfig: Flip the meaning of RAMSTAGE_CBMEM_TOP_ARG ......................................................................
lib/Kconfig: Flip the meaning of RAMSTAGE_CBMEM_TOP_ARG
Now that only a few exceptions have their own cbmem_top implementation, flip the meanining of RAMSTAGE_CBMEM_TOP_ARG around.
Change-Id: Ie7467629e58700e4d29f6e735840c22ed687f880 Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- M src/arch/arm/Kconfig M src/arch/arm64/Kconfig M src/arch/mips/Kconfig M src/arch/ppc64/Kconfig M src/arch/riscv/Kconfig M src/arch/x86/Kconfig M src/lib/Kconfig M src/lib/Makefile.inc M src/soc/nvidia/tegra124/Kconfig M src/soc/nvidia/tegra210/Kconfig 10 files changed, 11 insertions(+), 11 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/22/36422/1
diff --git a/src/arch/arm/Kconfig b/src/arch/arm/Kconfig index d668039..47c333b 100644 --- a/src/arch/arm/Kconfig +++ b/src/arch/arm/Kconfig @@ -17,7 +17,6 @@ config ARCH_RAMSTAGE_ARM bool select ARCH_ARM - select RAMSTAGE_CBMEM_TOP_ARG if !SOC_NVIDIA_TEGRA124
source src/arch/arm/armv4/Kconfig source src/arch/arm/armv7/Kconfig diff --git a/src/arch/arm64/Kconfig b/src/arch/arm64/Kconfig index 0438ded..3d1d184 100644 --- a/src/arch/arm64/Kconfig +++ b/src/arch/arm64/Kconfig @@ -17,7 +17,6 @@ config ARCH_RAMSTAGE_ARM64 bool select ARCH_ARM64 - select RAMSTAGE_CBMEM_TOP_ARG if !SOC_NVIDIA_TEGRA210
source src/arch/arm64/armv8/Kconfig
diff --git a/src/arch/mips/Kconfig b/src/arch/mips/Kconfig index 321bfc9..9df514b 100644 --- a/src/arch/mips/Kconfig +++ b/src/arch/mips/Kconfig @@ -22,7 +22,6 @@ default n select BOOTBLOCK_CUSTOM select C_ENVIRONMENT_BOOTBLOCK - select RAMSTAGE_CBMEM_TOP_ARG
config ARCH_VERSTAGE_MIPS bool diff --git a/src/arch/ppc64/Kconfig b/src/arch/ppc64/Kconfig index da9c155..0699e91 100644 --- a/src/arch/ppc64/Kconfig +++ b/src/arch/ppc64/Kconfig @@ -1,6 +1,5 @@ config ARCH_PPC64 bool - select RAMSTAGE_CBMEM_TOP_ARG
config ARCH_BOOTBLOCK_PPC64 bool diff --git a/src/arch/riscv/Kconfig b/src/arch/riscv/Kconfig index f2ca571..cb534db 100644 --- a/src/arch/riscv/Kconfig +++ b/src/arch/riscv/Kconfig @@ -86,6 +86,7 @@ config ARCH_ROMSTAGE_RISCV bool default n + select CUSTOM_CBMEM_TOP
config ARCH_RAMSTAGE_RISCV bool diff --git a/src/arch/x86/Kconfig b/src/arch/x86/Kconfig index 8ce5977..502e774 100644 --- a/src/arch/x86/Kconfig +++ b/src/arch/x86/Kconfig @@ -16,7 +16,6 @@ default n select PCI select RELOCATABLE_MODULES - select RAMSTAGE_CBMEM_TOP_ARG
# stage selectors for x86
diff --git a/src/lib/Kconfig b/src/lib/Kconfig index aede4b3..a882b72 100644 --- a/src/lib/Kconfig +++ b/src/lib/Kconfig @@ -24,11 +24,10 @@ help Selected by features that require `libhwbase` in ramstage.
-config RAMSTAGE_CBMEM_TOP_ARG +config CUSTOM_CBMEM_TOP bool help - Select this if stages run after romstage get the cbmem_top - pointer the function arguments when called from romstage. + Select this if a platform has a custom implementation of cbmem_top.
config FLATTENED_DEVICE_TREE bool diff --git a/src/lib/Makefile.inc b/src/lib/Makefile.inc index 5b9d827..5aecf4e 100644 --- a/src/lib/Makefile.inc +++ b/src/lib/Makefile.inc @@ -149,18 +149,15 @@ ramstage-$(CONFIG_PAYLOAD_FIT_SUPPORT) += fit.c ramstage-$(CONFIG_PAYLOAD_FIT_SUPPORT) += fit_payload.c
-romstage-$(CONFIG_RAMSTAGE_CBMEM_TOP_ARG) += cbmem_top.c romstage-y += cbmem_common.c romstage-y += imd_cbmem.c romstage-y += imd.c
-ramstage-$(CONFIG_RAMSTAGE_CBMEM_TOP_ARG) += cbmem_top.c ramstage-y += cbmem_common.c ramstage-y += imd_cbmem.c ramstage-y += imd.c
postcar-$(CONFIG_VENDOR_EMULATION) += ramdetect.c -postcar-$(CONFIG_RAMSTAGE_CBMEM_TOP_ARG) += cbmem_top.c postcar-y += cbmem_common.c postcar-$(CONFIG_CONSOLE_CBMEM) += cbmem_console.c postcar-y += imd_cbmem.c @@ -187,6 +184,12 @@ romstage-$(CONFIG_CBMEM_STAGE_CACHE) += cbmem_stage_cache.c postcar-$(CONFIG_CBMEM_STAGE_CACHE) += cbmem_stage_cache.c
+ifneq ($(CONFIG_CUSTOM_CBMEM_TOP),y) +ramstage-y += cbmem_top.c +romstage-y += cbmem_top.c +postcar-y += cbmem_top.c +endif + romstage-y += boot_device.c ramstage-y += boot_device.c
diff --git a/src/soc/nvidia/tegra124/Kconfig b/src/soc/nvidia/tegra124/Kconfig index c962aea..0df23e9 100644 --- a/src/soc/nvidia/tegra124/Kconfig +++ b/src/soc/nvidia/tegra124/Kconfig @@ -12,6 +12,7 @@ select MAINBOARD_HAS_NATIVE_VGA_INIT select MAINBOARD_FORCE_NATIVE_VGA_INIT select HAVE_LINEAR_FRAMEBUFFER + select CUSTOM_CBMEM_TOP
if SOC_NVIDIA_TEGRA124
diff --git a/src/soc/nvidia/tegra210/Kconfig b/src/soc/nvidia/tegra210/Kconfig index 0e1efd7..d3d99dc 100644 --- a/src/soc/nvidia/tegra210/Kconfig +++ b/src/soc/nvidia/tegra210/Kconfig @@ -10,6 +10,7 @@ select HAVE_UART_SPECIAL select ARM64_USE_ARM_TRUSTED_FIRMWARE select GENERIC_GPIO_LIB + select CUSTOM_CBMEM_TOP
if SOC_NVIDIA_TEGRA210
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36422 )
Change subject: lib/Kconfig: Flip the meaning of RAMSTAGE_CBMEM_TOP_ARG ......................................................................
Patch Set 1: Code-Review+2
Frans Hendriks has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36422 )
Change subject: lib/Kconfig: Flip the meaning of RAMSTAGE_CBMEM_TOP_ARG ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/36422/1//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/36422/1//COMMIT_MSG@10 PS1, Line 10: implementation, flip the meanining of RAMSTAGE_CBMEM_TOP_ARG around. meaning
Aaron Durbin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36422 )
Change subject: lib/Kconfig: Flip the meaning of RAMSTAGE_CBMEM_TOP_ARG ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/36422/1/src/lib/Makefile.inc File src/lib/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/36422/1/src/lib/Makefile.inc@188 PS1, Line 188: y Why wouldn't these just be stage-$(CONFIG_CUSTOM_CBMEM_TOP) += cbmem_top.c ?
Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36422 )
Change subject: lib/Kconfig: Flip the meaning of RAMSTAGE_CBMEM_TOP_ARG ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/36422/1/src/lib/Makefile.inc File src/lib/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/36422/1/src/lib/Makefile.inc@188 PS1, Line 188: y
Why wouldn't these just be stage-$(CONFIG_CUSTOM_CBMEM_TOP) += cbmem_top.c ?
if*n*eq
Aaron Durbin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36422 )
Change subject: lib/Kconfig: Flip the meaning of RAMSTAGE_CBMEM_TOP_ARG ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/36422/1/src/lib/Makefile.inc File src/lib/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/36422/1/src/lib/Makefile.inc@188 PS1, Line 188: y
Why wouldn't these just be stage-$(CONFIG_CUSTOM_CBMEM_TOP) += cbmem_top.c ? […]
Oh. Then I was off in my other comment about where to place _cbmem_top_ptr. That object can live within a common compilation unit such as this one and always include it w/ some guards for conditional compilation?
Hello ron minnich, Julius Werner, build bot (Jenkins), Nico Huber, Philipp Hug, Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/36422
to look at the new patch set (#2).
Change subject: lib/Kconfig: Flip the meaning of RAMSTAGE_CBMEM_TOP_ARG ......................................................................
lib/Kconfig: Flip the meaning of RAMSTAGE_CBMEM_TOP_ARG
Now that only a few exceptions don't pass cbmem_top via calling arguments, default to doing that.
Change-Id: Ie7467629e58700e4d29f6e735840c22ed687f880 Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- M src/arch/arm/Kconfig M src/arch/arm64/Kconfig M src/arch/mips/Kconfig M src/arch/ppc64/Kconfig M src/arch/riscv/Kconfig M src/arch/x86/Kconfig M src/lib/Kconfig M src/lib/Makefile.inc M src/lib/cbmem_top.c M src/soc/nvidia/tegra210/Kconfig 10 files changed, 8 insertions(+), 12 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/22/36422/2
Hello ron minnich, Julius Werner, build bot (Jenkins), Nico Huber, Philipp Hug, Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/36422
to look at the new patch set (#3).
Change subject: lib/Kconfig: Flip the meaning of RAMSTAGE_CBMEM_TOP_ARG ......................................................................
lib/Kconfig: Flip the meaning of RAMSTAGE_CBMEM_TOP_ARG
Now that only a few exceptions don't pass cbmem_top via calling arguments, default to doing that.
Change-Id: Ie7467629e58700e4d29f6e735840c22ed687f880 Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- M src/arch/arm/Kconfig M src/arch/arm64/Kconfig M src/arch/mips/Kconfig M src/arch/ppc64/Kconfig M src/arch/riscv/Kconfig M src/arch/x86/Kconfig M src/lib/Kconfig M src/lib/Makefile.inc M src/lib/imd_cbmem.c M src/soc/nvidia/tegra210/Kconfig 10 files changed, 9 insertions(+), 13 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/22/36422/3
Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36422 )
Change subject: lib/Kconfig: Flip the meaning of RAMSTAGE_CBMEM_TOP_ARG ......................................................................
Patch Set 7:
(2 comments)
https://review.coreboot.org/c/coreboot/+/36422/1//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/36422/1//COMMIT_MSG@10 PS1, Line 10: implementation, flip the meanining of RAMSTAGE_CBMEM_TOP_ARG around.
meaning
Done
https://review.coreboot.org/c/coreboot/+/36422/1/src/lib/Makefile.inc File src/lib/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/36422/1/src/lib/Makefile.inc@188 PS1, Line 188: y
Oh. Then I was off in my other comment about where to place _cbmem_top_ptr. […]
Done
Hello ron minnich, Julius Werner, build bot (Jenkins), Nico Huber, Philipp Hug, Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/36422
to look at the new patch set (#9).
Change subject: lib/Kconfig: Remove RAMSTAGE_CBMEM_TOP_ARG ......................................................................
lib/Kconfig: Remove RAMSTAGE_CBMEM_TOP_ARG
All targets now have the _cbmem_top_ptr symbol populated via calling arguments or in the nvidia/tegra210 case worked around by populating it with cbmem_top_chipset explicitly at the start of ramstage, so the Kconfig guarding this behavior can be removed.
Change-Id: Ie7467629e58700e4d29f6e735840c22ed687f880 Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- M src/arch/arm/Kconfig M src/arch/arm64/Kconfig M src/arch/mips/Kconfig M src/arch/ppc64/Kconfig M src/arch/riscv/Kconfig M src/arch/x86/Kconfig M src/lib/Kconfig M src/lib/imd_cbmem.c 8 files changed, 2 insertions(+), 16 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/22/36422/9
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36422 )
Change subject: lib/Kconfig: Remove RAMSTAGE_CBMEM_TOP_ARG ......................................................................
Patch Set 12: Code-Review+1
Michael Niewöhner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36422 )
Change subject: lib/Kconfig: Remove RAMSTAGE_CBMEM_TOP_ARG ......................................................................
Patch Set 13: Code-Review+1
Aaron Durbin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36422 )
Change subject: lib/Kconfig: Remove RAMSTAGE_CBMEM_TOP_ARG ......................................................................
Patch Set 14: Code-Review+2
Michael Niewöhner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36422 )
Change subject: lib/Kconfig: Remove RAMSTAGE_CBMEM_TOP_ARG ......................................................................
Patch Set 16: Code-Review+2
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36422 )
Change subject: lib/Kconfig: Remove RAMSTAGE_CBMEM_TOP_ARG ......................................................................
Patch Set 17: Code-Review+2
Nico Huber has submitted this change. ( https://review.coreboot.org/c/coreboot/+/36422 )
Change subject: lib/Kconfig: Remove RAMSTAGE_CBMEM_TOP_ARG ......................................................................
lib/Kconfig: Remove RAMSTAGE_CBMEM_TOP_ARG
All targets now have the _cbmem_top_ptr symbol populated via calling arguments or in the nvidia/tegra210 case worked around by populating it with cbmem_top_chipset explicitly at the start of ramstage, so the Kconfig guarding this behavior can be removed.
Change-Id: Ie7467629e58700e4d29f6e735840c22ed687f880 Signed-off-by: Arthur Heymans arthur@aheymans.xyz Reviewed-on: https://review.coreboot.org/c/coreboot/+/36422 Reviewed-by: Nico Huber nico.h@gmx.de Reviewed-by: Michael Niewöhner Reviewed-by: Aaron Durbin adurbin@chromium.org Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/arch/arm/Kconfig M src/arch/arm64/Kconfig M src/arch/mips/Kconfig M src/arch/ppc64/Kconfig M src/arch/riscv/Kconfig M src/arch/x86/Kconfig M src/lib/Kconfig M src/lib/imd_cbmem.c 8 files changed, 2 insertions(+), 16 deletions(-)
Approvals: build bot (Jenkins): Verified Nico Huber: Looks good to me, approved Aaron Durbin: Looks good to me, approved Michael Niewöhner: Looks good to me, approved
diff --git a/src/arch/arm/Kconfig b/src/arch/arm/Kconfig index 9e10378..47c333b 100644 --- a/src/arch/arm/Kconfig +++ b/src/arch/arm/Kconfig @@ -17,7 +17,6 @@ config ARCH_RAMSTAGE_ARM bool select ARCH_ARM - select RAMSTAGE_CBMEM_TOP_ARG
source src/arch/arm/armv4/Kconfig source src/arch/arm/armv7/Kconfig diff --git a/src/arch/arm64/Kconfig b/src/arch/arm64/Kconfig index c7eafe6..3d1d184 100644 --- a/src/arch/arm64/Kconfig +++ b/src/arch/arm64/Kconfig @@ -17,7 +17,6 @@ config ARCH_RAMSTAGE_ARM64 bool select ARCH_ARM64 - select RAMSTAGE_CBMEM_TOP_ARG
source src/arch/arm64/armv8/Kconfig
diff --git a/src/arch/mips/Kconfig b/src/arch/mips/Kconfig index 321bfc9..9df514b 100644 --- a/src/arch/mips/Kconfig +++ b/src/arch/mips/Kconfig @@ -22,7 +22,6 @@ default n select BOOTBLOCK_CUSTOM select C_ENVIRONMENT_BOOTBLOCK - select RAMSTAGE_CBMEM_TOP_ARG
config ARCH_VERSTAGE_MIPS bool diff --git a/src/arch/ppc64/Kconfig b/src/arch/ppc64/Kconfig index da9c155..0699e91 100644 --- a/src/arch/ppc64/Kconfig +++ b/src/arch/ppc64/Kconfig @@ -1,6 +1,5 @@ config ARCH_PPC64 bool - select RAMSTAGE_CBMEM_TOP_ARG
config ARCH_BOOTBLOCK_PPC64 bool diff --git a/src/arch/riscv/Kconfig b/src/arch/riscv/Kconfig index 9ee781b..f2ca571 100644 --- a/src/arch/riscv/Kconfig +++ b/src/arch/riscv/Kconfig @@ -90,7 +90,6 @@ config ARCH_RAMSTAGE_RISCV bool default n - select RAMSTAGE_CBMEM_TOP_ARG
config RISCV_USE_ARCH_TIMER bool diff --git a/src/arch/x86/Kconfig b/src/arch/x86/Kconfig index 37b7d2d..c5a5642 100644 --- a/src/arch/x86/Kconfig +++ b/src/arch/x86/Kconfig @@ -16,7 +16,6 @@ default n select PCI select RELOCATABLE_MODULES - select RAMSTAGE_CBMEM_TOP_ARG
# stage selectors for x86
diff --git a/src/lib/Kconfig b/src/lib/Kconfig index b94ac49..cb1e4a5 100644 --- a/src/lib/Kconfig +++ b/src/lib/Kconfig @@ -24,12 +24,6 @@ help Selected by features that require `libhwbase` in ramstage.
-config RAMSTAGE_CBMEM_TOP_ARG - bool - help - Select this if stages run after romstage get the cbmem_top - pointer as the function arguments when called from romstage. - config FLATTENED_DEVICE_TREE bool help diff --git a/src/lib/imd_cbmem.c b/src/lib/imd_cbmem.c index cbd4b8f..38620d2 100644 --- a/src/lib/imd_cbmem.c +++ b/src/lib/imd_cbmem.c @@ -51,16 +51,14 @@
void *cbmem_top(void) { - if (ENV_ROMSTAGE - || ((ENV_POSTCAR || ENV_RAMSTAGE) - && !CONFIG(RAMSTAGE_CBMEM_TOP_ARG))) { + if (ENV_ROMSTAGE) { MAYBE_STATIC_BSS void *top = NULL; if (top) return top; top = cbmem_top_chipset(); return top; } - if ((ENV_POSTCAR || ENV_RAMSTAGE) && CONFIG(RAMSTAGE_CBMEM_TOP_ARG)) + if (ENV_POSTCAR || ENV_RAMSTAGE) return (void *)_cbmem_top_ptr;
dead_code();