Angel Pons | 32859fc | 2020-04-02 23:48:27 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Kyösti Mälkki | ef84401 | 2013-06-25 23:17:43 +0300 | [diff] [blame] | 2 | |
Kyösti Mälkki | e8792be | 2014-02-26 15:19:04 +0200 | [diff] [blame] | 3 | #ifndef _RULES_H |
| 4 | #define _RULES_H |
| 5 | |
| 6 | /* Useful helpers to tell whether the code is executing in bootblock, |
| 7 | * romstage, ramstage or SMM. |
| 8 | */ |
| 9 | |
Julius Werner | 99f4683 | 2018-05-16 14:14:04 -0700 | [diff] [blame] | 10 | #if defined(__DECOMPRESSOR__) |
| 11 | #define ENV_DECOMPRESSOR 1 |
| 12 | #define ENV_BOOTBLOCK 0 |
| 13 | #define ENV_ROMSTAGE 0 |
| 14 | #define ENV_RAMSTAGE 0 |
| 15 | #define ENV_SMM 0 |
Julius Werner | 21a4053 | 2020-04-21 16:03:53 -0700 | [diff] [blame] | 16 | #define ENV_SEPARATE_VERSTAGE 0 |
Julius Werner | 99f4683 | 2018-05-16 14:14:04 -0700 | [diff] [blame] | 17 | #define ENV_RMODULE 0 |
| 18 | #define ENV_POSTCAR 0 |
| 19 | #define ENV_LIBAGESA 0 |
| 20 | #define ENV_STRING "decompressor" |
| 21 | |
| 22 | #elif defined(__BOOTBLOCK__) |
| 23 | #define ENV_DECOMPRESSOR 0 |
Kyösti Mälkki | e8792be | 2014-02-26 15:19:04 +0200 | [diff] [blame] | 24 | #define ENV_BOOTBLOCK 1 |
| 25 | #define ENV_ROMSTAGE 0 |
| 26 | #define ENV_RAMSTAGE 0 |
| 27 | #define ENV_SMM 0 |
Julius Werner | 21a4053 | 2020-04-21 16:03:53 -0700 | [diff] [blame] | 28 | #define ENV_SEPARATE_VERSTAGE 0 |
Aaron Durbin | dde7629 | 2015-09-05 12:59:26 -0500 | [diff] [blame] | 29 | #define ENV_RMODULE 0 |
Aaron Durbin | 7f8afe0 | 2016-03-18 12:21:23 -0500 | [diff] [blame] | 30 | #define ENV_POSTCAR 0 |
Kyösti Mälkki | a405a58 | 2017-03-02 13:01:58 +0200 | [diff] [blame] | 31 | #define ENV_LIBAGESA 0 |
Ben Gardner | aa5f5b1 | 2015-11-19 10:48:47 -0600 | [diff] [blame] | 32 | #define ENV_STRING "bootblock" |
Kyösti Mälkki | e8792be | 2014-02-26 15:19:04 +0200 | [diff] [blame] | 33 | |
Patrick Georgi | 815f4bf | 2015-04-28 22:43:31 +0200 | [diff] [blame] | 34 | #elif defined(__ROMSTAGE__) |
Julius Werner | 99f4683 | 2018-05-16 14:14:04 -0700 | [diff] [blame] | 35 | #define ENV_DECOMPRESSOR 0 |
Kyösti Mälkki | e8792be | 2014-02-26 15:19:04 +0200 | [diff] [blame] | 36 | #define ENV_BOOTBLOCK 0 |
| 37 | #define ENV_ROMSTAGE 1 |
| 38 | #define ENV_RAMSTAGE 0 |
| 39 | #define ENV_SMM 0 |
Julius Werner | 21a4053 | 2020-04-21 16:03:53 -0700 | [diff] [blame] | 40 | #define ENV_SEPARATE_VERSTAGE 0 |
Aaron Durbin | dde7629 | 2015-09-05 12:59:26 -0500 | [diff] [blame] | 41 | #define ENV_RMODULE 0 |
Aaron Durbin | 7f8afe0 | 2016-03-18 12:21:23 -0500 | [diff] [blame] | 42 | #define ENV_POSTCAR 0 |
Kyösti Mälkki | a405a58 | 2017-03-02 13:01:58 +0200 | [diff] [blame] | 43 | #define ENV_LIBAGESA 0 |
Ben Gardner | aa5f5b1 | 2015-11-19 10:48:47 -0600 | [diff] [blame] | 44 | #define ENV_STRING "romstage" |
Kyösti Mälkki | e8792be | 2014-02-26 15:19:04 +0200 | [diff] [blame] | 45 | |
| 46 | #elif defined(__SMM__) |
Julius Werner | 99f4683 | 2018-05-16 14:14:04 -0700 | [diff] [blame] | 47 | #define ENV_DECOMPRESSOR 0 |
Kyösti Mälkki | e8792be | 2014-02-26 15:19:04 +0200 | [diff] [blame] | 48 | #define ENV_BOOTBLOCK 0 |
| 49 | #define ENV_ROMSTAGE 0 |
| 50 | #define ENV_RAMSTAGE 0 |
| 51 | #define ENV_SMM 1 |
Julius Werner | 21a4053 | 2020-04-21 16:03:53 -0700 | [diff] [blame] | 52 | #define ENV_SEPARATE_VERSTAGE 0 |
Aaron Durbin | dde7629 | 2015-09-05 12:59:26 -0500 | [diff] [blame] | 53 | #define ENV_RMODULE 0 |
Aaron Durbin | 7f8afe0 | 2016-03-18 12:21:23 -0500 | [diff] [blame] | 54 | #define ENV_POSTCAR 0 |
Kyösti Mälkki | a405a58 | 2017-03-02 13:01:58 +0200 | [diff] [blame] | 55 | #define ENV_LIBAGESA 0 |
Ben Gardner | aa5f5b1 | 2015-11-19 10:48:47 -0600 | [diff] [blame] | 56 | #define ENV_STRING "smm" |
Patrick Georgi | cc8171f | 2015-04-28 22:26:23 +0200 | [diff] [blame] | 57 | |
Julius Werner | 21a4053 | 2020-04-21 16:03:53 -0700 | [diff] [blame] | 58 | /* |
| 59 | * NOTE: "verstage" code may either run as a separate stage or linked into the |
| 60 | * bootblock/romstage, depending on the setting of CONFIG_SEPARATE_VERSTAGE. The |
| 61 | * ENV_SEPARATE_VERSTAGE macro will only return true for "verstage" code when |
| 62 | * CONFIG_SEPARATE_VERSTAGE=y, otherwise that code will have ENV_BOOTBLOCK or |
| 63 | * ENV_ROMSTAGE set (depending on the CONFIG_VBOOT_STARTS_IN_... options). |
| 64 | */ |
Patrick Georgi | cc8171f | 2015-04-28 22:26:23 +0200 | [diff] [blame] | 65 | #elif defined(__VERSTAGE__) |
Julius Werner | 99f4683 | 2018-05-16 14:14:04 -0700 | [diff] [blame] | 66 | #define ENV_DECOMPRESSOR 0 |
Patrick Georgi | cc8171f | 2015-04-28 22:26:23 +0200 | [diff] [blame] | 67 | #define ENV_BOOTBLOCK 0 |
| 68 | #define ENV_ROMSTAGE 0 |
| 69 | #define ENV_RAMSTAGE 0 |
| 70 | #define ENV_SMM 0 |
Julius Werner | 21a4053 | 2020-04-21 16:03:53 -0700 | [diff] [blame] | 71 | #define ENV_SEPARATE_VERSTAGE 1 |
Aaron Durbin | dde7629 | 2015-09-05 12:59:26 -0500 | [diff] [blame] | 72 | #define ENV_RMODULE 0 |
Aaron Durbin | 7f8afe0 | 2016-03-18 12:21:23 -0500 | [diff] [blame] | 73 | #define ENV_POSTCAR 0 |
Kyösti Mälkki | a405a58 | 2017-03-02 13:01:58 +0200 | [diff] [blame] | 74 | #define ENV_LIBAGESA 0 |
Ben Gardner | aa5f5b1 | 2015-11-19 10:48:47 -0600 | [diff] [blame] | 75 | #define ENV_STRING "verstage" |
Furquan Shaikh | abde3b5 | 2014-08-26 15:39:51 -0700 | [diff] [blame] | 76 | |
Aaron Durbin | cd96c5c | 2015-09-04 16:28:15 -0500 | [diff] [blame] | 77 | #elif defined(__RAMSTAGE__) |
Julius Werner | 99f4683 | 2018-05-16 14:14:04 -0700 | [diff] [blame] | 78 | #define ENV_DECOMPRESSOR 0 |
Kyösti Mälkki | e8792be | 2014-02-26 15:19:04 +0200 | [diff] [blame] | 79 | #define ENV_BOOTBLOCK 0 |
| 80 | #define ENV_ROMSTAGE 0 |
| 81 | #define ENV_RAMSTAGE 1 |
| 82 | #define ENV_SMM 0 |
Julius Werner | 21a4053 | 2020-04-21 16:03:53 -0700 | [diff] [blame] | 83 | #define ENV_SEPARATE_VERSTAGE 0 |
Aaron Durbin | dde7629 | 2015-09-05 12:59:26 -0500 | [diff] [blame] | 84 | #define ENV_RMODULE 0 |
Aaron Durbin | 7f8afe0 | 2016-03-18 12:21:23 -0500 | [diff] [blame] | 85 | #define ENV_POSTCAR 0 |
Kyösti Mälkki | a405a58 | 2017-03-02 13:01:58 +0200 | [diff] [blame] | 86 | #define ENV_LIBAGESA 0 |
Ben Gardner | aa5f5b1 | 2015-11-19 10:48:47 -0600 | [diff] [blame] | 87 | #define ENV_STRING "ramstage" |
Aaron Durbin | dde7629 | 2015-09-05 12:59:26 -0500 | [diff] [blame] | 88 | |
| 89 | #elif defined(__RMODULE__) |
Julius Werner | 99f4683 | 2018-05-16 14:14:04 -0700 | [diff] [blame] | 90 | #define ENV_DECOMPRESSOR 0 |
Aaron Durbin | dde7629 | 2015-09-05 12:59:26 -0500 | [diff] [blame] | 91 | #define ENV_BOOTBLOCK 0 |
| 92 | #define ENV_ROMSTAGE 0 |
| 93 | #define ENV_RAMSTAGE 0 |
| 94 | #define ENV_SMM 0 |
Julius Werner | 21a4053 | 2020-04-21 16:03:53 -0700 | [diff] [blame] | 95 | #define ENV_SEPARATE_VERSTAGE 0 |
Aaron Durbin | dde7629 | 2015-09-05 12:59:26 -0500 | [diff] [blame] | 96 | #define ENV_RMODULE 1 |
Aaron Durbin | 7f8afe0 | 2016-03-18 12:21:23 -0500 | [diff] [blame] | 97 | #define ENV_POSTCAR 0 |
Kyösti Mälkki | a405a58 | 2017-03-02 13:01:58 +0200 | [diff] [blame] | 98 | #define ENV_LIBAGESA 0 |
Ben Gardner | aa5f5b1 | 2015-11-19 10:48:47 -0600 | [diff] [blame] | 99 | #define ENV_STRING "rmodule" |
Aaron Durbin | cd96c5c | 2015-09-04 16:28:15 -0500 | [diff] [blame] | 100 | |
Aaron Durbin | 7f8afe0 | 2016-03-18 12:21:23 -0500 | [diff] [blame] | 101 | #elif defined(__POSTCAR__) |
Julius Werner | 99f4683 | 2018-05-16 14:14:04 -0700 | [diff] [blame] | 102 | #define ENV_DECOMPRESSOR 0 |
Aaron Durbin | 7f8afe0 | 2016-03-18 12:21:23 -0500 | [diff] [blame] | 103 | #define ENV_BOOTBLOCK 0 |
| 104 | #define ENV_ROMSTAGE 0 |
| 105 | #define ENV_RAMSTAGE 0 |
| 106 | #define ENV_SMM 0 |
Julius Werner | 21a4053 | 2020-04-21 16:03:53 -0700 | [diff] [blame] | 107 | #define ENV_SEPARATE_VERSTAGE 0 |
Aaron Durbin | 7f8afe0 | 2016-03-18 12:21:23 -0500 | [diff] [blame] | 108 | #define ENV_RMODULE 0 |
| 109 | #define ENV_POSTCAR 1 |
Kyösti Mälkki | a405a58 | 2017-03-02 13:01:58 +0200 | [diff] [blame] | 110 | #define ENV_LIBAGESA 0 |
Aaron Durbin | 7f8afe0 | 2016-03-18 12:21:23 -0500 | [diff] [blame] | 111 | #define ENV_STRING "postcar" |
| 112 | |
Kyösti Mälkki | a405a58 | 2017-03-02 13:01:58 +0200 | [diff] [blame] | 113 | #elif defined(__LIBAGESA__) |
Julius Werner | 99f4683 | 2018-05-16 14:14:04 -0700 | [diff] [blame] | 114 | #define ENV_DECOMPRESSOR 0 |
Kyösti Mälkki | a405a58 | 2017-03-02 13:01:58 +0200 | [diff] [blame] | 115 | #define ENV_BOOTBLOCK 0 |
| 116 | #define ENV_ROMSTAGE 0 |
| 117 | #define ENV_RAMSTAGE 0 |
| 118 | #define ENV_SMM 0 |
Julius Werner | 21a4053 | 2020-04-21 16:03:53 -0700 | [diff] [blame] | 119 | #define ENV_SEPARATE_VERSTAGE 0 |
Kyösti Mälkki | a405a58 | 2017-03-02 13:01:58 +0200 | [diff] [blame] | 120 | #define ENV_RMODULE 0 |
| 121 | #define ENV_POSTCAR 0 |
| 122 | #define ENV_LIBAGESA 1 |
| 123 | #define ENV_STRING "libagesa" |
| 124 | |
Aaron Durbin | cd96c5c | 2015-09-04 16:28:15 -0500 | [diff] [blame] | 125 | #else |
| 126 | /* |
| 127 | * Default case of nothing set for random blob generation using |
Kyösti Mälkki | a405a58 | 2017-03-02 13:01:58 +0200 | [diff] [blame] | 128 | * create_class_compiler that isn't bound to a stage. |
Aaron Durbin | cd96c5c | 2015-09-04 16:28:15 -0500 | [diff] [blame] | 129 | */ |
Julius Werner | 99f4683 | 2018-05-16 14:14:04 -0700 | [diff] [blame] | 130 | #define ENV_DECOMPRESSOR 0 |
Aaron Durbin | cd96c5c | 2015-09-04 16:28:15 -0500 | [diff] [blame] | 131 | #define ENV_BOOTBLOCK 0 |
| 132 | #define ENV_ROMSTAGE 0 |
| 133 | #define ENV_RAMSTAGE 0 |
| 134 | #define ENV_SMM 0 |
Julius Werner | 21a4053 | 2020-04-21 16:03:53 -0700 | [diff] [blame] | 135 | #define ENV_SEPARATE_VERSTAGE 0 |
Aaron Durbin | dde7629 | 2015-09-05 12:59:26 -0500 | [diff] [blame] | 136 | #define ENV_RMODULE 0 |
Aaron Durbin | 7f8afe0 | 2016-03-18 12:21:23 -0500 | [diff] [blame] | 137 | #define ENV_POSTCAR 0 |
Kyösti Mälkki | a405a58 | 2017-03-02 13:01:58 +0200 | [diff] [blame] | 138 | #define ENV_LIBAGESA 0 |
Ben Gardner | aa5f5b1 | 2015-11-19 10:48:47 -0600 | [diff] [blame] | 139 | #define ENV_STRING "UNKNOWN" |
Kyösti Mälkki | e8792be | 2014-02-26 15:19:04 +0200 | [diff] [blame] | 140 | #endif |
Kyösti Mälkki | ef84401 | 2013-06-25 23:17:43 +0300 | [diff] [blame] | 141 | |
Julius Werner | d3634c1 | 2015-11-13 13:28:41 -0800 | [diff] [blame] | 142 | /* Define helpers about the current architecture, based on toolchain.inc. */ |
| 143 | |
| 144 | #if defined(__ARCH_arm__) |
| 145 | #define ENV_ARM 1 |
| 146 | #define ENV_ARM64 0 |
| 147 | #if __COREBOOT_ARM_ARCH__ == 4 |
| 148 | #define ENV_ARMV4 1 |
| 149 | #define ENV_ARMV7 0 |
| 150 | #elif __COREBOOT_ARM_ARCH__ == 7 |
| 151 | #define ENV_ARMV4 0 |
| 152 | #define ENV_ARMV7 1 |
Hakim Giydan | 43e5b57 | 2016-09-08 10:13:59 -0700 | [diff] [blame] | 153 | #if defined(__COREBOOT_ARM_V7_A__) |
| 154 | #define ENV_ARMV7_A 1 |
| 155 | #define ENV_ARMV7_M 0 |
| 156 | #define ENV_ARMV7_R 0 |
| 157 | #elif defined(__COREBOOT_ARM_V7_M__) |
| 158 | #define ENV_ARMV7_A 0 |
| 159 | #define ENV_ARMV7_M 1 |
| 160 | #define ENV_ARMV7_R 0 |
| 161 | #elif defined(__COREBOOT_ARM_V7_R__) |
| 162 | #define ENV_ARMV7_A 0 |
| 163 | #define ENV_ARMV7_M 0 |
| 164 | #define ENV_ARMV7_R 1 |
| 165 | #endif |
Julius Werner | d3634c1 | 2015-11-13 13:28:41 -0800 | [diff] [blame] | 166 | #else |
| 167 | #define ENV_ARMV4 0 |
| 168 | #define ENV_ARMV7 0 |
| 169 | #endif |
| 170 | #define ENV_ARMV8 0 |
Julius Werner | d3634c1 | 2015-11-13 13:28:41 -0800 | [diff] [blame] | 171 | #define ENV_RISCV 0 |
| 172 | #define ENV_X86 0 |
| 173 | #define ENV_X86_32 0 |
| 174 | #define ENV_X86_64 0 |
| 175 | |
| 176 | #elif defined(__ARCH_arm64__) |
| 177 | #define ENV_ARM 0 |
| 178 | #define ENV_ARM64 1 |
| 179 | #define ENV_ARMV4 0 |
| 180 | #define ENV_ARMV7 0 |
| 181 | #if __COREBOOT_ARM_ARCH__ == 8 |
| 182 | #define ENV_ARMV8 1 |
| 183 | #else |
| 184 | #define ENV_ARMV8 0 |
| 185 | #endif |
Julius Werner | d3634c1 | 2015-11-13 13:28:41 -0800 | [diff] [blame] | 186 | #define ENV_RISCV 0 |
| 187 | #define ENV_X86 0 |
| 188 | #define ENV_X86_32 0 |
| 189 | #define ENV_X86_64 0 |
| 190 | |
| 191 | #elif defined(__ARCH_riscv__) |
| 192 | #define ENV_ARM 0 |
| 193 | #define ENV_ARM64 0 |
| 194 | #define ENV_ARMV4 0 |
| 195 | #define ENV_ARMV7 0 |
| 196 | #define ENV_ARMV8 0 |
Julius Werner | d3634c1 | 2015-11-13 13:28:41 -0800 | [diff] [blame] | 197 | #define ENV_RISCV 1 |
| 198 | #define ENV_X86 0 |
| 199 | #define ENV_X86_32 0 |
| 200 | #define ENV_X86_64 0 |
| 201 | |
| 202 | #elif defined(__ARCH_x86_32__) |
| 203 | #define ENV_ARM 0 |
| 204 | #define ENV_ARM64 0 |
| 205 | #define ENV_ARMV4 0 |
| 206 | #define ENV_ARMV7 0 |
| 207 | #define ENV_ARMV8 0 |
Julius Werner | d3634c1 | 2015-11-13 13:28:41 -0800 | [diff] [blame] | 208 | #define ENV_RISCV 0 |
| 209 | #define ENV_X86 1 |
| 210 | #define ENV_X86_32 1 |
| 211 | #define ENV_X86_64 0 |
| 212 | |
| 213 | #elif defined(__ARCH_x86_64__) |
| 214 | #define ENV_ARM 0 |
| 215 | #define ENV_ARM64 0 |
| 216 | #define ENV_ARMV4 0 |
| 217 | #define ENV_ARMV7 0 |
| 218 | #define ENV_ARMV8 0 |
Julius Werner | d3634c1 | 2015-11-13 13:28:41 -0800 | [diff] [blame] | 219 | #define ENV_RISCV 0 |
| 220 | #define ENV_X86 1 |
| 221 | #define ENV_X86_32 0 |
| 222 | #define ENV_X86_64 1 |
| 223 | |
| 224 | #else |
| 225 | #define ENV_ARM 0 |
| 226 | #define ENV_ARM64 0 |
| 227 | #define ENV_ARMV4 0 |
| 228 | #define ENV_ARMV7 0 |
| 229 | #define ENV_ARMV8 0 |
Julius Werner | d3634c1 | 2015-11-13 13:28:41 -0800 | [diff] [blame] | 230 | #define ENV_RISCV 0 |
| 231 | #define ENV_X86 0 |
| 232 | #define ENV_X86_32 0 |
| 233 | #define ENV_X86_64 0 |
| 234 | |
| 235 | #endif |
| 236 | |
Subrata Banik | 6302203 | 2019-05-11 20:12:20 +0530 | [diff] [blame] | 237 | #if CONFIG(RAMPAYLOAD) |
| 238 | /* ENV_PAYLOAD_LOADER is set to ENV_POSTCAR when CONFIG_RAMPAYLOAD is enabled */ |
| 239 | #define ENV_PAYLOAD_LOADER ENV_POSTCAR |
| 240 | #else |
Ronald G. Minnich | 4249348 | 2019-05-09 17:09:25 +0000 | [diff] [blame] | 241 | /* ENV_PAYLOAD_LOADER is set when you are in a stage that loads the payload. |
| 242 | * For now, that is the ramstage. */ |
| 243 | #define ENV_PAYLOAD_LOADER ENV_RAMSTAGE |
Subrata Banik | 6302203 | 2019-05-11 20:12:20 +0530 | [diff] [blame] | 244 | #endif |
Ronald G. Minnich | 4249348 | 2019-05-09 17:09:25 +0000 | [diff] [blame] | 245 | |
Kyösti Mälkki | 21160a7 | 2019-08-17 17:29:36 +0300 | [diff] [blame] | 246 | #define ENV_ROMSTAGE_OR_BEFORE \ |
Kyösti Mälkki | f704b54 | 2019-09-14 14:59:38 +0300 | [diff] [blame] | 247 | (ENV_DECOMPRESSOR || ENV_BOOTBLOCK || ENV_ROMSTAGE || \ |
Julius Werner | 21a4053 | 2020-04-21 16:03:53 -0700 | [diff] [blame] | 248 | (ENV_SEPARATE_VERSTAGE && CONFIG(VBOOT_STARTS_IN_BOOTBLOCK))) |
Kyösti Mälkki | 21160a7 | 2019-08-17 17:29:36 +0300 | [diff] [blame] | 249 | |
Kyösti Mälkki | f2cc52b | 2019-08-21 07:15:38 +0300 | [diff] [blame] | 250 | #if CONFIG(ARCH_X86) |
Kyösti Mälkki | 21160a7 | 2019-08-17 17:29:36 +0300 | [diff] [blame] | 251 | /* Indicates memory layout is determined with arch/x86/car.ld. */ |
Martin Roth | 8418fd4 | 2019-04-22 16:26:23 -0600 | [diff] [blame] | 252 | #define ENV_CACHE_AS_RAM (ENV_ROMSTAGE_OR_BEFORE && !CONFIG(RESET_VECTOR_IN_RAM)) |
Kyösti Mälkki | f2cc52b | 2019-08-21 07:15:38 +0300 | [diff] [blame] | 253 | /* No .data sections with execute-in-place from ROM. */ |
| 254 | #define ENV_STAGE_HAS_DATA_SECTION !ENV_CACHE_AS_RAM |
Kyösti Mälkki | a165c07 | 2019-08-22 09:44:44 +0300 | [diff] [blame] | 255 | /* No .bss sections for stage with CAR teardown. */ |
Arthur Heymans | 8601afb | 2019-11-20 22:25:30 +0100 | [diff] [blame] | 256 | #define ENV_STAGE_HAS_BSS_SECTION 1 |
Kyösti Mälkki | f2cc52b | 2019-08-21 07:15:38 +0300 | [diff] [blame] | 257 | #else |
| 258 | /* Both .data and .bss, sometimes SRAM not DRAM. */ |
| 259 | #define ENV_STAGE_HAS_DATA_SECTION 1 |
| 260 | #define ENV_STAGE_HAS_BSS_SECTION 1 |
| 261 | #define ENV_CACHE_AS_RAM 0 |
| 262 | #endif |
| 263 | |
| 264 | /* Currently rmodules, ramstage and smm have heap. */ |
| 265 | #define ENV_STAGE_HAS_HEAP_SECTION (ENV_RMODULE || ENV_RAMSTAGE || ENV_SMM) |
| 266 | |
Patrick Rudolph | a626d27 | 2018-04-18 10:13:32 +0200 | [diff] [blame] | 267 | /** |
| 268 | * For pre-DRAM stages and post-CAR always build with simple device model, ie. |
| 269 | * PCI, PNP and CPU functions operate without use of devicetree. The reason |
| 270 | * post-CAR utilizes __SIMPLE_DEVICE__ is for simplicity. Currently there's |
| 271 | * no known requirement that devicetree would be needed during that stage. |
| 272 | * |
| 273 | * For ramstage individual source file may define __SIMPLE_DEVICE__ |
| 274 | * before including any header files to force that particular source |
| 275 | * be built with simple device model. |
Patrick Rudolph | a626d27 | 2018-04-18 10:13:32 +0200 | [diff] [blame] | 276 | */ |
| 277 | |
Kyösti Mälkki | 21160a7 | 2019-08-17 17:29:36 +0300 | [diff] [blame] | 278 | #if !ENV_RAMSTAGE |
Patrick Rudolph | a626d27 | 2018-04-18 10:13:32 +0200 | [diff] [blame] | 279 | #define __SIMPLE_DEVICE__ |
| 280 | #endif |
| 281 | |
Kyösti Mälkki | e8792be | 2014-02-26 15:19:04 +0200 | [diff] [blame] | 282 | #endif /* _RULES_H */ |