blob: 3659cc9f96a6af6888e10daf390d0955d26fd25e [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
Kyösti Mälkki18a8ba42020-07-02 21:48:38 +030016 RAMSTAGE(CONFIG_RAMBASE, 8M)
Aaron Durbin956c4f22015-09-05 13:31:14 -050017
18#elif ENV_ROMSTAGE
Aaron Durbin294ce852015-09-15 17:04:13 -050019 /* The 1M size is not allocated. It's just for basic size checking.
20 * Link at 32MiB address and rely on cbfstool to relocate to XIP. */
Andrey Petrovccd300b2016-02-28 22:04:51 -080021 ROMSTAGE(CONFIG_ROMSTAGE_ADDR, 1M)
Aaron Durbin956c4f22015-09-05 13:31:14 -050022
Furquan Shaikh31be15c2020-06-10 15:25:52 -070023 #include "car.ld"
Julius Werner21a40532020-04-21 16:03:53 -070024#elif ENV_SEPARATE_VERSTAGE
Aaron Durbin75c51d92015-09-29 16:31:20 -050025 /* The 1M size is not allocated. It's just for basic size checking.
26 * Link at 32MiB address and rely on cbfstool to relocate to XIP. */
Andrey Petrovccd300b2016-02-28 22:04:51 -080027 VERSTAGE(CONFIG_VERSTAGE_ADDR, 1M)
Aaron Durbin75c51d92015-09-29 16:31:20 -050028
Furquan Shaikh31be15c2020-06-10 15:25:52 -070029 #include "car.ld"
Aaron Durbineb907b32016-01-21 00:08:17 -060030#elif ENV_BOOTBLOCK
Marshall Dawson67910db2019-11-01 17:30:05 -060031 BOOTBLOCK(CONFIG_X86_RESET_VECTOR - CONFIG_C_ENV_BOOTBLOCK_SIZE + 0x10,
Aaron Durbin65ac3d82016-02-11 14:36:19 -060032 CONFIG_C_ENV_BOOTBLOCK_SIZE)
Aaron Durbineb907b32016-01-21 00:08:17 -060033
Furquan Shaikh31be15c2020-06-10 15:25:52 -070034 #include "car.ld"
Aaron Durbineb907b32016-01-21 00:08:17 -060035
Aaron Durbin7f8afe02016-03-18 12:21:23 -050036#elif ENV_POSTCAR
37 POSTCAR(32M, 1M)
Aaron Durbin956c4f22015-09-05 13:31:14 -050038#endif
39}
Aaron Durbineb907b32016-01-21 00:08:17 -060040
41#if ENV_BOOTBLOCK
42/* Bootblock specific scripts which provide more SECTION directives. */
43#include <cpu/x86/16bit/entry16.ld>
44#include <cpu/x86/16bit/reset16.ld>
45#include <arch/x86/id.ld>
Julius Wernercd49cce2019-03-05 16:53:33 -080046#if CONFIG(CPU_INTEL_FIRMWARE_INTERFACE_TABLE)
Aaron Durbineb907b32016-01-21 00:08:17 -060047#include <cpu/intel/fit/fit.ld>
48#endif
49#endif /* ENV_BOOTBLOCK */