From cd259cb08a99812082f8bb2f7ecd23c031bb4e2d Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Mon, 16 May 2022 13:20:18 +0200 Subject: arch/x86/car.ld: Add a Kconfig param to flag AGESA brokenness MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit AGESA has a lot of code in the .data section (initialized data). However there is no such section in CAR stages as the code runs in XIP mode and CAR is too small to contain the data section. When the linker can not match code to a section it will just append it, which is why AGESA worked at all. Follow-up patches will attempt to fix AGESA and set Kconfig parameter to 'n'. After all AGESA sources have been fixed, this can be removed. Change-Id: I311ee17e3c0bd283692194fcee63af4449583d74 Signed-off-by: Arthur Heymans Reviewed-on: https://review.coreboot.org/c/coreboot/+/64387 Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons Reviewed-by: Kyösti Mälkki --- src/arch/x86/car.ld | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/arch/x86/car.ld') diff --git a/src/arch/x86/car.ld b/src/arch/x86/car.ld index 5a46b8b2ec..4e3383cf1e 100644 --- a/src/arch/x86/car.ld +++ b/src/arch/x86/car.ld @@ -115,8 +115,13 @@ _rom_mtrr_base = _rom_mtrr_mask; . = 0xffffff00; .illegal_globals . : { +#if CONFIG(AGESA_BROKEN_DATA_SECTION) *(EXCLUDE_FILE ("*/libagesa.*.a:" "*/romstage*/buildOpts.o" "*/romstage*/agesawrapper.o" "*/vendorcode/amd/agesa/*" "*/vendorcode/amd/cimx/*") .data) *(EXCLUDE_FILE ("*/libagesa.*.a:" "*/romstage*/buildOpts.o" "*/romstage*/agesawrapper.o" "*/vendorcode/amd/agesa/*" "*/vendorcode/amd/cimx/*") .data.*) +#else + *(.data) + *(.data.*) +#endif } _bogus = ASSERT((CONFIG_DCACHE_RAM_SIZE == 0) || (SIZEOF(.car.data) <= CONFIG_DCACHE_RAM_SIZE), "Cache as RAM area is too full"); -- cgit v1.2.3