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