Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/48156 )
Change subject: arch/x86: Don't use .bss from car.ld if not running XIP
......................................................................
arch/x86: Don't use .bss from car.ld if not running XIP
Some platform run early stages like romstage and verstage from CAR
instead of XIP. This allows to link them like other arch inside the
_program region.
Change-Id: I6cf51f943dde5f642d75ba4c5d3be520dc56370a
Signed-off-by: Arthur Heymans <arthur(a)aheymans.xyz>
---
M src/arch/x86/assembly_entry.S
M src/arch/x86/car.ld
M src/include/rules.h
M src/lib/program.ld
4 files changed, 12 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/56/48156/1
diff --git a/src/arch/x86/assembly_entry.S b/src/arch/x86/assembly_entry.S
index 31670c2..7d7d3fc 100644
--- a/src/arch/x86/assembly_entry.S
+++ b/src/arch/x86/assembly_entry.S
@@ -36,6 +36,7 @@
mov $_STACK_TOP, %esp
/* clear .bss section as it is not shared */
+#if ENV_STAGE_XIP
cld
xor %eax, %eax
movl $(_ebss), %ecx
@@ -43,6 +44,7 @@
sub %edi, %ecx
shrl $2, %ecx
rep stosl
+#endif
#if ((ENV_SEPARATE_VERSTAGE && CONFIG(VERSTAGE_DEBUG_SPINLOOP)) \
|| (ENV_ROMSTAGE && CONFIG(ROMSTAGE_DEBUG_SPINLOOP)))
diff --git a/src/arch/x86/car.ld b/src/arch/x86/car.ld
index c291efb..38128d1 100644
--- a/src/arch/x86/car.ld
+++ b/src/arch/x86/car.ld
@@ -62,6 +62,7 @@
* cbmem console. This is useful for clearing this area on a per-stage
* basis when more than one stage uses cache-as-ram. */
+#if ENV_STAGE_HAS_CAR_XIP_BSS
. = ALIGN(ARCH_POINTER_ALIGN_SIZE);
_bss = .;
/* Allow global uninitialized variables for stages without CAR teardown. */
@@ -71,6 +72,7 @@
*(.sbss.*)
. = ALIGN(ARCH_POINTER_ALIGN_SIZE);
_ebss = .;
+#endif
#if ENV_ROMSTAGE && CONFIG(ASAN_IN_ROMSTAGE)
_shadow_size = (_ebss - _car_region_start) >> 3;
diff --git a/src/include/rules.h b/src/include/rules.h
index 6ebb37e..f503914 100644
--- a/src/include/rules.h
+++ b/src/include/rules.h
@@ -261,14 +261,21 @@
#if ENV_X86
/* Indicates memory layout is determined with arch/x86/car.ld. */
#define ENV_CACHE_AS_RAM (ENV_ROMSTAGE_OR_BEFORE && !CONFIG(RESET_VECTOR_IN_RAM))
+/* Indicates if the stage runs XIP. */
+#define ENV_STAGE_XIP (ENV_CACHE_AS_RAM && \
+ !((ENV_ROMSTAGE || ENV_SEPARATE_VERSTAGE) && CONFIG(NO_XIP_EARLY_STAGES)))
/* No .data sections with execute-in-place from ROM. */
#define ENV_STAGE_HAS_DATA_SECTION !ENV_CACHE_AS_RAM
#else
/* Both .data and .bss, sometimes SRAM not DRAM. */
#define ENV_STAGE_HAS_DATA_SECTION 1
#define ENV_CACHE_AS_RAM 0
+#define ENV_STAGE_XIP 0
#endif
+/* Indicates if the stages uses the _bss region defined in arch/x86/car.ld */
+#define ENV_STAGE_HAS_CAR_XIP_BSS ENV_STAGE_XIP
+
/* Currently rmodules, ramstage and smm have heap. */
#define ENV_STAGE_HAS_HEAP_SECTION (ENV_RMODULE || ENV_RAMSTAGE || ENV_SMM)
diff --git a/src/lib/program.ld b/src/lib/program.ld
index 3b6aa2e..ff3c672 100644
--- a/src/lib/program.ld
+++ b/src/lib/program.ld
@@ -103,7 +103,7 @@
}
#endif
-#if !ENV_CACHE_AS_RAM
+#if !ENV_STAGE_HAS_CAR_XIP_BSS
.bss . : {
. = ALIGN(ARCH_POINTER_ALIGN_SIZE);
_bss = .;
--
To view, visit https://review.coreboot.org/c/coreboot/+/48156
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I6cf51f943dde5f642d75ba4c5d3be520dc56370a
Gerrit-Change-Number: 48156
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Julius Werner <jwerner(a)chromium.org>
Gerrit-MessageType: newchange
Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/36613 )
Change subject: Kconfig: Allow x86 to compress pre-ram stages if not run XIP
......................................................................
Kconfig: Allow x86 to compress pre-ram stages if not run XIP
Change-Id: Iac24d243c4bd4cb8c1db14a8e9fc43f508c2cd5d
Signed-off-by: Arthur Heymans <arthur(a)aheymans.xyz>
---
M src/Kconfig
M src/arch/x86/Makefile.inc
2 files changed, 3 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/13/36613/1
diff --git a/src/Kconfig b/src/Kconfig
index 793927a..df86246 100644
--- a/src/Kconfig
+++ b/src/Kconfig
@@ -160,7 +160,7 @@
config COMPRESS_PRERAM_STAGES
bool "Compress romstage and verstage with LZ4"
- depends on !ARCH_X86 && (HAVE_ROMSTAGE || HAVE_VERSTAGE)
+ depends on HAVE_ROMSTAGE || HAVE_VERSTAGE
# Default value set at the end of the file
help
Compress romstage and (if it exists) verstage with LZ4 to save flash
@@ -1217,7 +1217,7 @@
default y if !UNCOMPRESSED_RAMSTAGE
config COMPRESS_PRERAM_STAGES
- depends on !ARCH_X86
+ depends on NO_XIP_EARLY_STAGES
default y
config INCLUDE_CONFIG_FILE
diff --git a/src/arch/x86/Makefile.inc b/src/arch/x86/Makefile.inc
index 447fd57..db4f054 100644
--- a/src/arch/x86/Makefile.inc
+++ b/src/arch/x86/Makefile.inc
@@ -119,6 +119,7 @@
ifeq ($(CONFIG_C_ENVIRONMENT_BOOTBLOCK),y)
bootblock-y += bootblock_crt0.S
+bootblock-y += memmove.c
ifeq ($(CONFIG_ARCH_BOOTBLOCK_X86_32),y)
$(eval $(call early_x86_stage,bootblock,elf32-i386))
--
To view, visit https://review.coreboot.org/c/coreboot/+/36613
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Iac24d243c4bd4cb8c1db14a8e9fc43f508c2cd5d
Gerrit-Change-Number: 36613
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-MessageType: newchange
Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/48158 )
Change subject: soc/intel/apollolake: LZ4 Compress FSP-M
......................................................................
soc/intel/apollolake: LZ4 Compress FSP-M
FSP-M is not run XIP so it can be compressed. This more than halves
the binary size. 364544 bytes -> 168616 bytes.
On the up/squared this also results in a 83ms speedup.
TESTED: up/squared boots.
Change-Id: Ic76b51f0f3007b59ccb9f76b6a57bb9265dab833
Signed-off-by: Arthur Heymans <arthur(a)aheymans.xyz>
---
M src/soc/intel/apollolake/Kconfig
1 file changed, 1 insertion(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/58/48158/1
diff --git a/src/soc/intel/apollolake/Kconfig b/src/soc/intel/apollolake/Kconfig
index 4f762a9..bf7cd0b 100644
--- a/src/soc/intel/apollolake/Kconfig
+++ b/src/soc/intel/apollolake/Kconfig
@@ -46,6 +46,7 @@
select MRC_SETTINGS_PROTECT
select MRC_SETTINGS_VARIABLE_DATA
select NO_XIP_EARLY_STAGES
+ select FSP_COMPRESS_FSP_M_LZ4
select PARALLEL_MP
select PARALLEL_MP_AP_WORK
select PCIEXP_ASPM
--
To view, visit https://review.coreboot.org/c/coreboot/+/48158
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ic76b51f0f3007b59ccb9f76b6a57bb9265dab833
Gerrit-Change-Number: 48158
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Andrey Petrov <andrey.petrov(a)gmail.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-MessageType: newchange