Patrick Georgi | 11f0079 | 2020-03-04 15:10:45 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Aaron Durbin | 956c4f2 | 2015-09-05 13:31:14 -0500 | [diff] [blame] | 2 | |
| 3 | #include <memlayout.h> |
| 4 | #include <arch/header.ld> |
| 5 | |
| 6 | SECTIONS |
| 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älkki | 18a8ba4 | 2020-07-02 21:48:38 +0300 | [diff] [blame] | 16 | RAMSTAGE(CONFIG_RAMBASE, 8M) |
Aaron Durbin | 956c4f2 | 2015-09-05 13:31:14 -0500 | [diff] [blame] | 17 | |
| 18 | #elif ENV_ROMSTAGE |
Aaron Durbin | 294ce85 | 2015-09-15 17:04:13 -0500 | [diff] [blame] | 19 | /* 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 Petrov | ccd300b | 2016-02-28 22:04:51 -0800 | [diff] [blame] | 21 | ROMSTAGE(CONFIG_ROMSTAGE_ADDR, 1M) |
Aaron Durbin | 956c4f2 | 2015-09-05 13:31:14 -0500 | [diff] [blame] | 22 | |
Furquan Shaikh | 31be15c | 2020-06-10 15:25:52 -0700 | [diff] [blame] | 23 | #include "car.ld" |
Julius Werner | 21a4053 | 2020-04-21 16:03:53 -0700 | [diff] [blame] | 24 | #elif ENV_SEPARATE_VERSTAGE |
Aaron Durbin | 75c51d9 | 2015-09-29 16:31:20 -0500 | [diff] [blame] | 25 | /* 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 Petrov | ccd300b | 2016-02-28 22:04:51 -0800 | [diff] [blame] | 27 | VERSTAGE(CONFIG_VERSTAGE_ADDR, 1M) |
Aaron Durbin | 75c51d9 | 2015-09-29 16:31:20 -0500 | [diff] [blame] | 28 | |
Furquan Shaikh | 31be15c | 2020-06-10 15:25:52 -0700 | [diff] [blame] | 29 | #include "car.ld" |
Aaron Durbin | eb907b3 | 2016-01-21 00:08:17 -0600 | [diff] [blame] | 30 | #elif ENV_BOOTBLOCK |
Marshall Dawson | 67910db | 2019-11-01 17:30:05 -0600 | [diff] [blame] | 31 | BOOTBLOCK(CONFIG_X86_RESET_VECTOR - CONFIG_C_ENV_BOOTBLOCK_SIZE + 0x10, |
Aaron Durbin | 65ac3d8 | 2016-02-11 14:36:19 -0600 | [diff] [blame] | 32 | CONFIG_C_ENV_BOOTBLOCK_SIZE) |
Aaron Durbin | eb907b3 | 2016-01-21 00:08:17 -0600 | [diff] [blame] | 33 | |
Furquan Shaikh | 31be15c | 2020-06-10 15:25:52 -0700 | [diff] [blame] | 34 | #include "car.ld" |
Aaron Durbin | eb907b3 | 2016-01-21 00:08:17 -0600 | [diff] [blame] | 35 | |
Aaron Durbin | 7f8afe0 | 2016-03-18 12:21:23 -0500 | [diff] [blame] | 36 | #elif ENV_POSTCAR |
| 37 | POSTCAR(32M, 1M) |
Aaron Durbin | 956c4f2 | 2015-09-05 13:31:14 -0500 | [diff] [blame] | 38 | #endif |
| 39 | } |
Aaron Durbin | eb907b3 | 2016-01-21 00:08:17 -0600 | [diff] [blame] | 40 | |
| 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 Werner | cd49cce | 2019-03-05 16:53:33 -0800 | [diff] [blame] | 46 | #if CONFIG(CPU_INTEL_FIRMWARE_INTERFACE_TABLE) |
Aaron Durbin | eb907b3 | 2016-01-21 00:08:17 -0600 | [diff] [blame] | 47 | #include <cpu/intel/fit/fit.ld> |
| 48 | #endif |
| 49 | #endif /* ENV_BOOTBLOCK */ |