blob: 549c2f90411c4255d1fa566e233edb45593375d3 [file] [log] [blame]
Patrick Georgi11f00792020-03-04 15:10:45 +01001/* SPDX-License-Identifier: GPL-2.0-only */
Aaron Durbin956c4f22015-09-05 13:31:14 -05002
3#include <memlayout.h>
4#include <arch/header.ld>
5
6SECTIONS
7{
8 /*
9 * It would be good to lay down RAMSTAGE, ROMSTAGE, etc consecutively
10 * like other architectures/chipsets it's not possible because of
11 * the linking games played during romstage creation by trying
12 * to find the final landing place in CBFS for XIP. Therefore,
13 * conditionalize with macros.
14 */
15#if ENV_RAMSTAGE
Arthur Heymans0c629872022-03-30 19:34:10 +020016 /* Relocated at runtime in cbmem so the address does not matter. */
17 RAMSTAGE(64M, 8M)
Aaron Durbin956c4f22015-09-05 13:31:14 -050018
19#elif ENV_ROMSTAGE
Aaron Durbin294ce852015-09-15 17:04:13 -050020 /* The 1M size is not allocated. It's just for basic size checking.
21 * Link at 32MiB address and rely on cbfstool to relocate to XIP. */
Andrey Petrovccd300b2016-02-28 22:04:51 -080022 ROMSTAGE(CONFIG_ROMSTAGE_ADDR, 1M)
Aaron Durbin956c4f22015-09-05 13:31:14 -050023
Arthur Heymans28de28d2022-05-15 21:46:44 +020024 INCLUDE "romstage/arch/x86/car.ld"
Julius Werner21a40532020-04-21 16:03:53 -070025#elif ENV_SEPARATE_VERSTAGE
Aaron Durbin75c51d92015-09-29 16:31:20 -050026 /* The 1M size is not allocated. It's just for basic size checking.
27 * Link at 32MiB address and rely on cbfstool to relocate to XIP. */
Andrey Petrovccd300b2016-02-28 22:04:51 -080028 VERSTAGE(CONFIG_VERSTAGE_ADDR, 1M)
Aaron Durbin75c51d92015-09-29 16:31:20 -050029
Arthur Heymans28de28d2022-05-15 21:46:44 +020030 INCLUDE "verstage/arch/x86/car.ld"
Aaron Durbineb907b32016-01-21 00:08:17 -060031#elif ENV_BOOTBLOCK
Aaron Durbineb907b32016-01-21 00:08:17 -060032
Arthur Heymans28de28d2022-05-15 21:46:44 +020033 INCLUDE "bootblock/arch/x86/car.ld"
Aaron Durbineb907b32016-01-21 00:08:17 -060034
Aaron Durbin7f8afe02016-03-18 12:21:23 -050035#elif ENV_POSTCAR
36 POSTCAR(32M, 1M)
Aaron Durbin956c4f22015-09-05 13:31:14 -050037#endif
38}
Aaron Durbineb907b32016-01-21 00:08:17 -060039
40#if ENV_BOOTBLOCK
Arthur Heymans28de28d2022-05-15 21:46:44 +020041 INCLUDE "bootblock/arch/x86/bootblock.ld"
Aaron Durbineb907b32016-01-21 00:08:17 -060042#endif /* ENV_BOOTBLOCK */