2020-03-04 15:10:45 +01:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2015-09-05 20:31:14 +02:00
|
|
|
|
|
|
|
#include <memlayout.h>
|
|
|
|
#include <arch/header.ld>
|
|
|
|
|
2023-08-31 00:42:09 +02:00
|
|
|
/*
|
|
|
|
* The bootblock linker script should be included before the Cache-As-RAM linker
|
|
|
|
* script. Indeed, if it is included after and Cache-As-RAM .data section
|
|
|
|
* support is enabled, the definition order of the sections makes the linker
|
|
|
|
* create an image with an almost 4 GB hole.
|
|
|
|
*/
|
|
|
|
#if ENV_BOOTBLOCK
|
|
|
|
INCLUDE "bootblock/arch/x86/bootblock.ld"
|
|
|
|
#endif /* ENV_BOOTBLOCK */
|
|
|
|
|
2015-09-05 20:31:14 +02:00
|
|
|
SECTIONS
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
* It would be good to lay down RAMSTAGE, ROMSTAGE, etc consecutively
|
|
|
|
* like other architectures/chipsets it's not possible because of
|
|
|
|
* the linking games played during romstage creation by trying
|
|
|
|
* to find the final landing place in CBFS for XIP. Therefore,
|
|
|
|
* conditionalize with macros.
|
|
|
|
*/
|
|
|
|
#if ENV_RAMSTAGE
|
2022-03-30 19:34:10 +02:00
|
|
|
/* Relocated at runtime in cbmem so the address does not matter. */
|
|
|
|
RAMSTAGE(64M, 8M)
|
2015-09-05 20:31:14 +02:00
|
|
|
|
|
|
|
#elif ENV_ROMSTAGE
|
2015-09-16 00:04:13 +02:00
|
|
|
/* The 1M size is not allocated. It's just for basic size checking.
|
|
|
|
* Link at 32MiB address and rely on cbfstool to relocate to XIP. */
|
2016-02-29 07:04:51 +01:00
|
|
|
ROMSTAGE(CONFIG_ROMSTAGE_ADDR, 1M)
|
2015-09-05 20:31:14 +02:00
|
|
|
|
2022-05-15 21:46:44 +02:00
|
|
|
INCLUDE "romstage/arch/x86/car.ld"
|
2020-04-22 01:03:53 +02:00
|
|
|
#elif ENV_SEPARATE_VERSTAGE
|
2015-09-29 23:31:20 +02:00
|
|
|
/* The 1M size is not allocated. It's just for basic size checking.
|
|
|
|
* Link at 32MiB address and rely on cbfstool to relocate to XIP. */
|
2016-02-29 07:04:51 +01:00
|
|
|
VERSTAGE(CONFIG_VERSTAGE_ADDR, 1M)
|
2015-09-29 23:31:20 +02:00
|
|
|
|
2022-05-15 21:46:44 +02:00
|
|
|
INCLUDE "verstage/arch/x86/car.ld"
|
2016-01-21 07:08:17 +01:00
|
|
|
#elif ENV_BOOTBLOCK
|
|
|
|
|
2022-05-15 21:46:44 +02:00
|
|
|
INCLUDE "bootblock/arch/x86/car.ld"
|
2016-01-21 07:08:17 +01:00
|
|
|
|
2016-03-18 18:21:23 +01:00
|
|
|
#elif ENV_POSTCAR
|
|
|
|
POSTCAR(32M, 1M)
|
2015-09-05 20:31:14 +02:00
|
|
|
#endif
|
|
|
|
}
|