summaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/x86/Kconfig19
-rw-r--r--src/arch/x86/bootblock.ld9
2 files changed, 27 insertions, 1 deletions
diff --git a/src/arch/x86/Kconfig b/src/arch/x86/Kconfig
index 6af3fa8b69..207654d8a9 100644
--- a/src/arch/x86/Kconfig
+++ b/src/arch/x86/Kconfig
@@ -340,4 +340,23 @@ config MEMLAYOUT_LD_FILE
string
default "src/arch/x86/memlayout.ld"
+# Some EC need an "EC firmware pointer" (a data structure hinting the address
+# of its firmware blobs) being put at a fixed position. Its space
+# (__section__(".ecfw_ptr")) should be reserved if it lies in the range of a
+# stage. Different EC may have different format and/or value for it. The actual
+# address of EC firmware pointer should be provided in the Kconfig of the EC
+# requiring it, and its value could be filled by linking a read-only global
+# data object to the section above.
+
+config ECFW_PTR_ADDR
+ hex
+ help
+ Address of reserved space for EC firmware pointer, which should not
+ overlap other data such as reset vector or FIT pointer if present.
+
+config ECFW_PTR_SIZE
+ int
+ help
+ Size of reserved space for EC firmware pointer
+
endif
diff --git a/src/arch/x86/bootblock.ld b/src/arch/x86/bootblock.ld
index 4ab2275998..0b908bbec6 100644
--- a/src/arch/x86/bootblock.ld
+++ b/src/arch/x86/bootblock.ld
@@ -31,7 +31,7 @@ SECTIONS {
*/
PROGRAM_SZ = SIZEOF(.text) + 512;
- . = MIN(_ID_SECTION, _FIT_POINTER) - EARLYASM_SZ;
+ . = MIN(_ECFW_PTR, MIN(_ID_SECTION, _FIT_POINTER)) - EARLYASM_SZ;
. = CONFIG(SIPI_VECTOR_IN_ROM) ? ALIGN(4096) : ALIGN(16);
BOOTBLOCK_TOP = .;
.init (.) : {
@@ -56,6 +56,13 @@ SECTIONS {
_ID_SECTION_END = SIZEOF(.fit_pointer) && SIZEOF(.id) > 0x28 ? 0xffffff80 : _X86_RESET_VECTOR;
_ID_SECTION = _ID_SECTION_END - SIZEOF(.id);
+ . = _ECFW_PTR;
+ .ecfw_ptr (.): {
+ ASSERT((SIZEOF(.ecfw_ptr) == CONFIG_ECFW_PTR_SIZE), "Size of ecfw_ptr is incorrect");
+ KEEP(*(.ecfw_ptr));
+ }
+ _ECFW_PTR = SIZEOF(.ecfw_ptr) ? CONFIG_ECFW_PTR_ADDR : _X86_RESET_VECTOR;
+
. = _FIT_POINTER;
.fit_pointer (.): {
KEEP(*(.fit_pointer));