Aaron Durbin (adurbin@chromium.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13691
-gerrit
commit db6afd190ab1ef938e8ef274b2f0852b7bbc97d0 Author: Aaron Durbin adurbin@chromium.org Date: Thu Feb 11 14:36:19 2016 -0600
x86: add option for custom bootblock size for C_ENVIRONMENT_BOOTBLOCK
Certain platforms may need to limit their bootblock size to within a given size because specific constraints. Allow the size to be changed based on HAS_CUSTOM_BOOTBLOCK_SIZE and deferring to CONFIG_CUSTOM_BOOTBLOCK_SIZE as the specific value.
Change-Id: I46cc6315918cde575070fa2d3e2514f28008f575 Signed-off-by: Aaron Durbin adurbin@chromium.org --- src/arch/x86/Kconfig | 4 ++++ src/arch/x86/memlayout.ld | 12 +++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/src/arch/x86/Kconfig b/src/arch/x86/Kconfig index 889e811..8050949 100644 --- a/src/arch/x86/Kconfig +++ b/src/arch/x86/Kconfig @@ -146,3 +146,7 @@ config ID_SECTION_OFFSET config COMPILE_IN_DSDT bool "compile in DSDT and use that over DSDT in CBFS" default n + +# If selected defer to CUSTOM_BOOTBLOCK_SIZE +config HAS_CUSTOM_BOOTBLOCK_SIZE + def_bool n diff --git a/src/arch/x86/memlayout.ld b/src/arch/x86/memlayout.ld index 1ecae8c..161bb27 100644 --- a/src/arch/x86/memlayout.ld +++ b/src/arch/x86/memlayout.ld @@ -45,7 +45,17 @@ SECTIONS #elif ENV_BOOTBLOCK /* This is for C_ENVIRONMENT_BOOTBLOCK. arch/x86/bootblock.ld contains * the logic for the romcc linking. */ - BOOTBLOCK(0xffff0000, 64K) + + /* Allow one to limit the size of bootblock for a given platform. */ + #if IS_ENABLED(CONFIG_HAS_CUSTOM_BOOTBLOCK_SIZE) + #define _BB_SIZE CONFIG_CUSTOM_BOOTBLOCK_SIZE + #else + #define _BB_SIZE 64K + #endif + + BOOTBLOCK(0xffffffff - _BB_SIZE + 1, _BB_SIZE) + + #undef _BB_SIZE
/* Pull in the cache-as-ram rules. */ #include "car.ld"