Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Simon Glass | 0e72403 | 2012-12-13 20:49:12 +0000 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (c) 2012 The Chromium OS Authors. |
| 4 | * (C) Copyright 2002-2010 |
| 5 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. |
Simon Glass | 0e72403 | 2012-12-13 20:49:12 +0000 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #ifndef __ASM_GENERIC_GBL_DATA_H |
| 9 | #define __ASM_GENERIC_GBL_DATA_H |
| 10 | /* |
| 11 | * The following data structure is placed in some memory which is |
| 12 | * available very early after boot (like DPRAM on MPC8xx/MPC82xx, or |
| 13 | * some locked parts of the data cache) to allow for a minimum set of |
| 14 | * global variables during system initialization (until we have set |
| 15 | * up the memory controller so that we can use RAM). |
| 16 | * |
| 17 | * Keep it *SMALL* and remember to set GENERATED_GBL_DATA_SIZE > sizeof(gd_t) |
| 18 | * |
| 19 | * Each architecture has its own private fields. For now all are private |
| 20 | */ |
| 21 | |
| 22 | #ifndef __ASSEMBLY__ |
Stefan Roese | 85bddff | 2019-04-12 16:42:28 +0200 | [diff] [blame] | 23 | #include <fdtdec.h> |
Simon Glass | 1bb4923 | 2015-11-08 23:47:48 -0700 | [diff] [blame] | 24 | #include <membuff.h> |
Simon Glass | dd6ab88 | 2014-02-26 15:59:18 -0700 | [diff] [blame] | 25 | #include <linux/list.h> |
| 26 | |
Simon Glass | cfd6a00 | 2020-10-03 11:31:33 -0600 | [diff] [blame] | 27 | struct driver_rt; |
| 28 | |
Heinrich Schuchardt | 50d9286 | 2020-10-05 08:30:09 +0200 | [diff] [blame] | 29 | typedef struct global_data gd_t; |
| 30 | |
| 31 | /** |
| 32 | * struct global_data - global data structure |
| 33 | */ |
| 34 | struct global_data { |
| 35 | /** |
| 36 | * @bd: board information |
| 37 | */ |
Masahiro Yamada | d788bba | 2020-02-25 02:22:27 +0900 | [diff] [blame] | 38 | struct bd_info *bd; |
Heinrich Schuchardt | 50d9286 | 2020-10-05 08:30:09 +0200 | [diff] [blame] | 39 | /** |
| 40 | * @flags: global data flags |
| 41 | * |
| 42 | * See &enum gd_flags |
| 43 | */ |
Simon Glass | 0e72403 | 2012-12-13 20:49:12 +0000 | [diff] [blame] | 44 | unsigned long flags; |
Heinrich Schuchardt | 50d9286 | 2020-10-05 08:30:09 +0200 | [diff] [blame] | 45 | /** |
| 46 | * @baudrate: baud rate of the serial interface |
| 47 | */ |
Simon Glass | 059c54f | 2013-03-05 14:40:05 +0000 | [diff] [blame] | 48 | unsigned int baudrate; |
Heinrich Schuchardt | 50d9286 | 2020-10-05 08:30:09 +0200 | [diff] [blame] | 49 | /** |
| 50 | * @cpu_clk: CPU clock rate in Hz |
| 51 | */ |
| 52 | unsigned long cpu_clk; |
| 53 | /** |
| 54 | * @bus_clk: platform clock rate in Hz |
| 55 | */ |
Simon Glass | 0e72403 | 2012-12-13 20:49:12 +0000 | [diff] [blame] | 56 | unsigned long bus_clk; |
Heinrich Schuchardt | 50d9286 | 2020-10-05 08:30:09 +0200 | [diff] [blame] | 57 | /** |
| 58 | * @pci_clk: PCI clock rate in Hz |
| 59 | */ |
Simon Glass | 0e72403 | 2012-12-13 20:49:12 +0000 | [diff] [blame] | 60 | /* We cannot bracket this with CONFIG_PCI due to mpc5xxx */ |
| 61 | unsigned long pci_clk; |
Heinrich Schuchardt | 50d9286 | 2020-10-05 08:30:09 +0200 | [diff] [blame] | 62 | /** |
| 63 | * @mem_clk: memory clock rate in Hz |
| 64 | */ |
Simon Glass | 0e72403 | 2012-12-13 20:49:12 +0000 | [diff] [blame] | 65 | unsigned long mem_clk; |
Heiko Schocher | 70bd818 | 2019-07-22 06:49:04 +0200 | [diff] [blame] | 66 | #if defined(CONFIG_LCD) || defined(CONFIG_VIDEO) || defined(CONFIG_DM_VIDEO) |
Heinrich Schuchardt | 50d9286 | 2020-10-05 08:30:09 +0200 | [diff] [blame] | 67 | /** |
| 68 | * @fb_base: base address of frame buffer memory |
| 69 | */ |
| 70 | unsigned long fb_base; |
Simon Glass | 0e72403 | 2012-12-13 20:49:12 +0000 | [diff] [blame] | 71 | #endif |
Simon Glass | 49badb9 | 2017-12-04 13:48:23 -0700 | [diff] [blame] | 72 | #if defined(CONFIG_POST) |
Heinrich Schuchardt | 50d9286 | 2020-10-05 08:30:09 +0200 | [diff] [blame] | 73 | /** |
| 74 | * @post_log_word: active POST tests |
| 75 | * |
| 76 | * @post_log_word is a bit mask defining which POST tests are recorded |
| 77 | * (see constants POST_*). |
| 78 | */ |
| 79 | unsigned long post_log_word; |
| 80 | /** |
| 81 | * @post_log_res: POST results |
| 82 | * |
| 83 | * @post_log_res is a bit mask with the POST results. A bit with value 1 |
| 84 | * indicates successful execution. |
| 85 | */ |
| 86 | unsigned long post_log_res; |
| 87 | /** |
| 88 | * @post_init_f_time: time in ms when post_init_f() started |
| 89 | */ |
| 90 | unsigned long post_init_f_time; |
Simon Glass | 0e72403 | 2012-12-13 20:49:12 +0000 | [diff] [blame] | 91 | #endif |
| 92 | #ifdef CONFIG_BOARD_TYPES |
Heinrich Schuchardt | 50d9286 | 2020-10-05 08:30:09 +0200 | [diff] [blame] | 93 | /** |
| 94 | * @board_type: board type |
| 95 | * |
| 96 | * If a U-Boot configuration supports multiple board types, the actual |
| 97 | * board type may be stored in this field. |
| 98 | */ |
Simon Glass | 0e72403 | 2012-12-13 20:49:12 +0000 | [diff] [blame] | 99 | unsigned long board_type; |
| 100 | #endif |
Heinrich Schuchardt | 50d9286 | 2020-10-05 08:30:09 +0200 | [diff] [blame] | 101 | /** |
| 102 | * @have_console: console is available |
| 103 | * |
| 104 | * A value of 1 indicates that serial_init() was called and a console |
| 105 | * is available. |
| 106 | * A value of 0 indicates that console input and output drivers shall |
| 107 | * not be called. |
| 108 | */ |
| 109 | unsigned long have_console; |
Simon Glass | e304a5e | 2016-10-17 20:12:36 -0600 | [diff] [blame] | 110 | #if CONFIG_IS_ENABLED(PRE_CONSOLE_BUFFER) |
Heinrich Schuchardt | 50d9286 | 2020-10-05 08:30:09 +0200 | [diff] [blame] | 111 | /** |
| 112 | * @precon_buf_idx: pre-console buffer index |
| 113 | * |
| 114 | * @precon_buf_idx indicates the current position of the buffer used to |
| 115 | * collect output before the console becomes available |
| 116 | */ |
| 117 | unsigned long precon_buf_idx; |
Simon Glass | 0e72403 | 2012-12-13 20:49:12 +0000 | [diff] [blame] | 118 | #endif |
Heinrich Schuchardt | 50d9286 | 2020-10-05 08:30:09 +0200 | [diff] [blame] | 119 | /** |
| 120 | * @env_addr: address of environment structure |
| 121 | * |
| 122 | * @env_addr contains the address of the structure holding the |
| 123 | * environment variables. |
| 124 | */ |
| 125 | unsigned long env_addr; |
| 126 | /** |
| 127 | * @env_valid: environment is valid |
| 128 | * |
| 129 | * See &enum env_valid |
| 130 | */ |
| 131 | unsigned long env_valid; |
| 132 | /** |
| 133 | * @env_has_init: bit mask indicating environment locations |
| 134 | * |
| 135 | * &enum env_location defines which bit relates to which location |
| 136 | */ |
| 137 | unsigned long env_has_init; |
| 138 | /** |
| 139 | * @env_load_prio: priority of the loaded environment |
| 140 | */ |
| 141 | int env_load_prio; |
| 142 | /** |
| 143 | * @ram_base: base address of RAM used by U-Boot |
| 144 | */ |
| 145 | unsigned long ram_base; |
| 146 | /** |
| 147 | * @ram_top: top address of RAM used by U-Boot |
| 148 | */ |
| 149 | unsigned long ram_top; |
| 150 | /** |
| 151 | * @relocaddr: start address of U-Boot in RAM |
| 152 | * |
| 153 | * After relocation this field indicates the address to which U-Boot |
| 154 | * has been relocated. It can be displayed using the bdinfo command. |
| 155 | * Its value is needed to display the source code when debugging with |
| 156 | * GDB using the 'add-symbol-file u-boot <relocaddr>' command. |
| 157 | */ |
| 158 | unsigned long relocaddr; |
| 159 | /** |
| 160 | * @ram_size: RAM size in bytes |
| 161 | */ |
| 162 | phys_size_t ram_size; |
| 163 | /** |
| 164 | * @mon_len: monitor length in bytes |
| 165 | */ |
| 166 | unsigned long mon_len; |
| 167 | /** |
| 168 | * @irq_sp: IRQ stack pointer |
| 169 | */ |
| 170 | unsigned long irq_sp; |
| 171 | /** |
| 172 | * @start_addr_sp: initial stack pointer address |
| 173 | */ |
| 174 | unsigned long start_addr_sp; |
| 175 | /** |
| 176 | * @reloc_off: relocation offset |
| 177 | */ |
Simon Glass | 0e72403 | 2012-12-13 20:49:12 +0000 | [diff] [blame] | 178 | unsigned long reloc_off; |
Heinrich Schuchardt | 50d9286 | 2020-10-05 08:30:09 +0200 | [diff] [blame] | 179 | /** |
| 180 | * @new_gd: pointer to relocated global data |
| 181 | */ |
| 182 | struct global_data *new_gd; |
Simon Glass | dd6ab88 | 2014-02-26 15:59:18 -0700 | [diff] [blame] | 183 | |
| 184 | #ifdef CONFIG_DM |
Heinrich Schuchardt | 50d9286 | 2020-10-05 08:30:09 +0200 | [diff] [blame] | 185 | /** |
| 186 | * @dm_root: root instance for Driver Model |
| 187 | */ |
| 188 | struct udevice *dm_root; |
| 189 | /** |
| 190 | * @dm_root_f: pre-relocation root instance |
| 191 | */ |
| 192 | struct udevice *dm_root_f; |
| 193 | /** |
| 194 | * @uclass_root: head of core tree |
| 195 | */ |
| 196 | struct list_head uclass_root; |
Simon Glass | cfd6a00 | 2020-10-03 11:31:33 -0600 | [diff] [blame] | 197 | # if CONFIG_IS_ENABLED(OF_PLATDATA) |
| 198 | /** Dynamic info about the driver */ |
| 199 | struct driver_rt *dm_driver_rt; |
| 200 | # endif |
Simon Glass | dd6ab88 | 2014-02-26 15:59:18 -0700 | [diff] [blame] | 201 | #endif |
Thomas Chou | fb798b1 | 2015-10-09 13:46:34 +0800 | [diff] [blame] | 202 | #ifdef CONFIG_TIMER |
Heinrich Schuchardt | 50d9286 | 2020-10-05 08:30:09 +0200 | [diff] [blame] | 203 | /** |
| 204 | * @timer: timer instance for Driver Model |
| 205 | */ |
| 206 | struct udevice *timer; |
Thomas Chou | fb798b1 | 2015-10-09 13:46:34 +0800 | [diff] [blame] | 207 | #endif |
Heinrich Schuchardt | 50d9286 | 2020-10-05 08:30:09 +0200 | [diff] [blame] | 208 | /** |
| 209 | * @fdt_blob: U-Boot's own device tree, NULL if none |
| 210 | */ |
| 211 | const void *fdt_blob; |
| 212 | /** |
| 213 | * @new_fdt: relocated device tree |
| 214 | */ |
| 215 | void *new_fdt; |
| 216 | /** |
| 217 | * @fdt_size: space reserved for relocated device space |
| 218 | */ |
| 219 | unsigned long fdt_size; |
Simon Glass | 40916e6 | 2020-10-03 09:25:22 -0600 | [diff] [blame] | 220 | #if CONFIG_IS_ENABLED(OF_LIVE) |
Heinrich Schuchardt | 50d9286 | 2020-10-05 08:30:09 +0200 | [diff] [blame] | 221 | /** |
| 222 | * @of_root: root node of the live tree |
| 223 | */ |
Simon Glass | a6eedb8 | 2017-05-18 20:08:53 -0600 | [diff] [blame] | 224 | struct device_node *of_root; |
| 225 | #endif |
Jean-Jacques Hiblot | 7c530e3 | 2018-12-07 14:50:52 +0100 | [diff] [blame] | 226 | |
| 227 | #if CONFIG_IS_ENABLED(MULTI_DTB_FIT) |
Heinrich Schuchardt | 50d9286 | 2020-10-05 08:30:09 +0200 | [diff] [blame] | 228 | /** |
| 229 | * @multi_dtb_fit: pointer to uncompressed multi-dtb FIT image |
| 230 | */ |
| 231 | const void *multi_dtb_fit; |
Jean-Jacques Hiblot | 7c530e3 | 2018-12-07 14:50:52 +0100 | [diff] [blame] | 232 | #endif |
Heinrich Schuchardt | 50d9286 | 2020-10-05 08:30:09 +0200 | [diff] [blame] | 233 | /** |
| 234 | * @jt: jump table |
| 235 | * |
| 236 | * The jump table contains pointers to exported functions. A pointer to |
| 237 | * the jump table is passed to standalone applications. |
| 238 | */ |
| 239 | struct jt_funcs *jt; |
| 240 | /** |
| 241 | * @env_buf: buffer for env_get() before reloc |
| 242 | */ |
| 243 | char env_buf[32]; |
Simon Glass | 209a1a6 | 2013-06-11 11:14:42 -0700 | [diff] [blame] | 244 | #ifdef CONFIG_TRACE |
Heinrich Schuchardt | 50d9286 | 2020-10-05 08:30:09 +0200 | [diff] [blame] | 245 | /** |
| 246 | * @trace_buff: trace buffer |
| 247 | * |
| 248 | * When tracing function in U-Boot this field points to the buffer |
| 249 | * recording the function calls. |
| 250 | */ |
| 251 | void *trace_buff; |
Simon Glass | 209a1a6 | 2013-06-11 11:14:42 -0700 | [diff] [blame] | 252 | #endif |
Heiko Schocher | e7d9c4f | 2012-01-16 21:12:23 +0000 | [diff] [blame] | 253 | #if defined(CONFIG_SYS_I2C) |
Heinrich Schuchardt | 50d9286 | 2020-10-05 08:30:09 +0200 | [diff] [blame] | 254 | /** |
| 255 | * @cur_i2c_bus: currently used I2C bus |
| 256 | */ |
| 257 | int cur_i2c_bus; |
Heiko Schocher | e7d9c4f | 2012-01-16 21:12:23 +0000 | [diff] [blame] | 258 | #endif |
Heinrich Schuchardt | 50d9286 | 2020-10-05 08:30:09 +0200 | [diff] [blame] | 259 | /** |
| 260 | * @timebase_h: high 32 bits of timer |
| 261 | */ |
Peng Fan | 9a60a9e | 2017-05-09 10:32:03 +0800 | [diff] [blame] | 262 | unsigned int timebase_h; |
Heinrich Schuchardt | 50d9286 | 2020-10-05 08:30:09 +0200 | [diff] [blame] | 263 | /** |
| 264 | * @timebase_l: low 32 bits of timer |
| 265 | */ |
Peng Fan | 9a60a9e | 2017-05-09 10:32:03 +0800 | [diff] [blame] | 266 | unsigned int timebase_l; |
Andy Yan | 1fa20e4d | 2017-07-24 17:43:34 +0800 | [diff] [blame] | 267 | #if CONFIG_VAL(SYS_MALLOC_F_LEN) |
Heinrich Schuchardt | 50d9286 | 2020-10-05 08:30:09 +0200 | [diff] [blame] | 268 | /** |
| 269 | * @malloc_base: base address of early malloc() |
| 270 | */ |
| 271 | unsigned long malloc_base; |
| 272 | /** |
| 273 | * @malloc_limit: limit address of early malloc() |
| 274 | */ |
| 275 | unsigned long malloc_limit; |
| 276 | /** |
| 277 | * @malloc_ptr: current address of early malloc() |
| 278 | */ |
| 279 | unsigned long malloc_ptr; |
Simon Glass | 863e404 | 2014-07-10 22:23:28 -0600 | [diff] [blame] | 280 | #endif |
Bin Meng | f1b81fc | 2014-12-30 22:53:21 +0800 | [diff] [blame] | 281 | #ifdef CONFIG_PCI |
Heinrich Schuchardt | 50d9286 | 2020-10-05 08:30:09 +0200 | [diff] [blame] | 282 | /** |
| 283 | * @hose: PCI hose for early use |
| 284 | */ |
| 285 | struct pci_controller *hose; |
| 286 | /** |
| 287 | * @pci_ram_top: top of region accessible to PCI |
| 288 | */ |
| 289 | phys_addr_t pci_ram_top; |
Bin Meng | f1b81fc | 2014-12-30 22:53:21 +0800 | [diff] [blame] | 290 | #endif |
| 291 | #ifdef CONFIG_PCI_BOOTDELAY |
Heinrich Schuchardt | 50d9286 | 2020-10-05 08:30:09 +0200 | [diff] [blame] | 292 | /** |
| 293 | * @pcidelay_done: delay time before scanning of PIC hose expired |
| 294 | * |
| 295 | * If CONFIG_PCI_BOOTDELAY=y, pci_hose_scan() waits for the number of |
| 296 | * milliseconds defined by environment variable pcidelay before |
| 297 | * scanning. Once this delay has expired the flag @pcidelay_done |
| 298 | * is set to 1. |
| 299 | */ |
Bin Meng | f1b81fc | 2014-12-30 22:53:21 +0800 | [diff] [blame] | 300 | int pcidelay_done; |
| 301 | #endif |
Heinrich Schuchardt | 50d9286 | 2020-10-05 08:30:09 +0200 | [diff] [blame] | 302 | /** |
| 303 | * @cur_serial_dev: current serial device |
| 304 | */ |
| 305 | struct udevice *cur_serial_dev; |
| 306 | /** |
| 307 | * @arch: architecture-specific data |
| 308 | */ |
| 309 | struct arch_global_data arch; |
Simon Glass | 1bb4923 | 2015-11-08 23:47:48 -0700 | [diff] [blame] | 310 | #ifdef CONFIG_CONSOLE_RECORD |
Heinrich Schuchardt | 50d9286 | 2020-10-05 08:30:09 +0200 | [diff] [blame] | 311 | /** |
| 312 | * @console_out: output buffer for console recording |
| 313 | * |
| 314 | * This buffer is used to collect output during console recording. |
| 315 | */ |
| 316 | struct membuff console_out; |
| 317 | /** |
| 318 | * @console_in: input buffer for console recording |
| 319 | * |
| 320 | * If console recording is activated, this buffer can be used to |
| 321 | * emulate input. |
| 322 | */ |
| 323 | struct membuff console_in; |
Simon Glass | 1bb4923 | 2015-11-08 23:47:48 -0700 | [diff] [blame] | 324 | #endif |
Simon Glass | fce58f5 | 2016-01-18 19:52:21 -0700 | [diff] [blame] | 325 | #ifdef CONFIG_DM_VIDEO |
Heinrich Schuchardt | 50d9286 | 2020-10-05 08:30:09 +0200 | [diff] [blame] | 326 | /** |
| 327 | * @video_top: top of video frame buffer area |
| 328 | */ |
| 329 | ulong video_top; |
| 330 | /** |
| 331 | * @video_bottom: bottom of video frame buffer area |
| 332 | */ |
| 333 | ulong video_bottom; |
Simon Glass | fce58f5 | 2016-01-18 19:52:21 -0700 | [diff] [blame] | 334 | #endif |
Simon Glass | 8820033 | 2017-05-22 05:05:25 -0600 | [diff] [blame] | 335 | #ifdef CONFIG_BOOTSTAGE |
Heinrich Schuchardt | 50d9286 | 2020-10-05 08:30:09 +0200 | [diff] [blame] | 336 | /** |
| 337 | * @bootstage: boot stage information |
| 338 | */ |
| 339 | struct bootstage_data *bootstage; |
| 340 | /** |
| 341 | * @new_bootstage: relocated boot stage information |
| 342 | */ |
| 343 | struct bootstage_data *new_bootstage; |
Simon Glass | 8820033 | 2017-05-22 05:05:25 -0600 | [diff] [blame] | 344 | #endif |
Simon Glass | d95645d | 2017-12-04 13:48:24 -0700 | [diff] [blame] | 345 | #ifdef CONFIG_LOG |
Heinrich Schuchardt | 50d9286 | 2020-10-05 08:30:09 +0200 | [diff] [blame] | 346 | /** |
| 347 | * @log_drop_count: number of dropped log messages |
| 348 | * |
| 349 | * This counter is incremented for each log message which can not |
| 350 | * be processed because logging is not yet available as signaled by |
| 351 | * flag %GD_FLG_LOG_READY in @flags. |
| 352 | */ |
| 353 | int log_drop_count; |
| 354 | /** |
| 355 | * @default_log_level: default logging level |
| 356 | * |
| 357 | * For logging devices without filters @default_log_level defines the |
| 358 | * logging level, cf. &enum log_level_t. |
| 359 | */ |
| 360 | int default_log_level; |
| 361 | /** |
| 362 | * @log_head: list of logging devices |
| 363 | */ |
| 364 | struct list_head log_head; |
| 365 | /** |
| 366 | * @log_fmt: bit mask for logging format |
| 367 | * |
| 368 | * The @log_fmt bit mask selects the fields to be shown in log messages. |
| 369 | * &enum log_fmt defines the bits of the bit mask. |
| 370 | */ |
| 371 | int log_fmt; |
Heinrich Schuchardt | fdf5599 | 2020-10-17 14:31:57 +0200 | [diff] [blame] | 372 | |
| 373 | /** |
| 374 | * @processing_msg: a log message is being processed |
| 375 | * |
| 376 | * This flag is used to suppress the creation of additional messages |
| 377 | * while another message is being processed. |
| 378 | */ |
| 379 | bool processing_msg; |
Heinrich Schuchardt | 0fc9f4f | 2020-10-17 14:31:58 +0200 | [diff] [blame] | 380 | /** |
| 381 | * @logc_prev: logging category of previous message |
| 382 | * |
| 383 | * This value is used as logging category for continuation messages. |
| 384 | */ |
| 385 | int logc_prev; |
| 386 | /** |
| 387 | * @logl_pref: logging level of the previous message |
| 388 | * |
| 389 | * This value is used as logging level for continuation messages. |
| 390 | */ |
| 391 | int logl_prev; |
Simon Glass | d95645d | 2017-12-04 13:48:24 -0700 | [diff] [blame] | 392 | #endif |
Simon Glass | a815dab | 2018-11-15 18:43:52 -0700 | [diff] [blame] | 393 | #if CONFIG_IS_ENABLED(BLOBLIST) |
Heinrich Schuchardt | 50d9286 | 2020-10-05 08:30:09 +0200 | [diff] [blame] | 394 | /** |
| 395 | * @bloblist: blob list information |
| 396 | */ |
| 397 | struct bloblist_hdr *bloblist; |
| 398 | /** |
| 399 | * @new_bloblist: relocated blob list information |
| 400 | */ |
| 401 | struct bloblist_hdr *new_bloblist; |
Simon Glass | e14f1a2 | 2018-11-15 18:44:09 -0700 | [diff] [blame] | 402 | # ifdef CONFIG_SPL |
Heinrich Schuchardt | 50d9286 | 2020-10-05 08:30:09 +0200 | [diff] [blame] | 403 | /** |
| 404 | * @spl_handoff: SPL hand-off information |
| 405 | */ |
Simon Glass | e14f1a2 | 2018-11-15 18:44:09 -0700 | [diff] [blame] | 406 | struct spl_handoff *spl_handoff; |
| 407 | # endif |
Simon Glass | a815dab | 2018-11-15 18:43:52 -0700 | [diff] [blame] | 408 | #endif |
Stefan Roese | 85bddff | 2019-04-12 16:42:28 +0200 | [diff] [blame] | 409 | #if defined(CONFIG_TRANSLATION_OFFSET) |
Heinrich Schuchardt | 50d9286 | 2020-10-05 08:30:09 +0200 | [diff] [blame] | 410 | /** |
| 411 | * @translation_offset: optional translation offset |
| 412 | * |
| 413 | * See CONFIG_TRANSLATION_OFFSET. |
| 414 | */ |
| 415 | fdt_addr_t translation_offset; |
Stefan Roese | 85bddff | 2019-04-12 16:42:28 +0200 | [diff] [blame] | 416 | #endif |
Marek Vasut | 55ec91b | 2019-06-09 03:46:21 +0200 | [diff] [blame] | 417 | #if CONFIG_IS_ENABLED(WDT) |
Heinrich Schuchardt | 50d9286 | 2020-10-05 08:30:09 +0200 | [diff] [blame] | 418 | /** |
| 419 | * @watchdog_dev: watchdog device |
| 420 | */ |
Stefan Roese | 502acb0 | 2019-04-11 15:58:44 +0200 | [diff] [blame] | 421 | struct udevice *watchdog_dev; |
| 422 | #endif |
Heinrich Schuchardt | 50d9286 | 2020-10-05 08:30:09 +0200 | [diff] [blame] | 423 | }; |
Simon Glass | 0e72403 | 2012-12-13 20:49:12 +0000 | [diff] [blame] | 424 | |
Heinrich Schuchardt | 50d9286 | 2020-10-05 08:30:09 +0200 | [diff] [blame] | 425 | /** |
| 426 | * gd_board_type() - retrieve board type |
| 427 | * |
| 428 | * Return: global board type |
| 429 | */ |
Simon Glass | b4de3f3 | 2017-03-31 08:40:24 -0600 | [diff] [blame] | 430 | #ifdef CONFIG_BOARD_TYPES |
| 431 | #define gd_board_type() gd->board_type |
| 432 | #else |
| 433 | #define gd_board_type() 0 |
| 434 | #endif |
| 435 | |
Simon Glass | 40916e6 | 2020-10-03 09:25:22 -0600 | [diff] [blame] | 436 | /* These macros help avoid #ifdefs in the code */ |
| 437 | #if CONFIG_IS_ENABLED(OF_LIVE) |
| 438 | #define gd_of_root() gd->of_root |
| 439 | #define gd_of_root_ptr() &gd->of_root |
| 440 | #define gd_set_of_root(_root) gd->of_root = (_root) |
| 441 | #else |
| 442 | #define gd_of_root() NULL |
| 443 | #define gd_of_root_ptr() NULL |
| 444 | #define gd_set_of_root(_root) |
| 445 | #endif |
| 446 | |
Simon Glass | cfd6a00 | 2020-10-03 11:31:33 -0600 | [diff] [blame] | 447 | #if CONFIG_IS_ENABLED(OF_PLATDATA) |
| 448 | #define gd_set_dm_driver_rt(dyn) gd->dm_driver_rt = dyn |
| 449 | #define gd_dm_driver_rt() gd->dm_driver_rt |
| 450 | #else |
| 451 | #define gd_set_dm_driver_rt(dyn) |
| 452 | #define gd_dm_driver_rt() NULL |
| 453 | #endif |
| 454 | |
Heinrich Schuchardt | 1e5c4fe | 2020-10-05 08:30:08 +0200 | [diff] [blame] | 455 | /** |
| 456 | * enum gd_flags - global data flags |
| 457 | * |
| 458 | * See field flags of &struct global_data. |
Simon Glass | 0e72403 | 2012-12-13 20:49:12 +0000 | [diff] [blame] | 459 | */ |
Heinrich Schuchardt | 1e5c4fe | 2020-10-05 08:30:08 +0200 | [diff] [blame] | 460 | enum gd_flags { |
| 461 | /** |
| 462 | * @GD_FLG_RELOC: code was relocated to RAM |
| 463 | */ |
| 464 | GD_FLG_RELOC = 0x00001, |
| 465 | /** |
| 466 | * @GD_FLG_DEVINIT: devices have been initialized |
| 467 | */ |
| 468 | GD_FLG_DEVINIT = 0x00002, |
| 469 | /** |
| 470 | * @GD_FLG_SILENT: silent mode |
| 471 | */ |
| 472 | GD_FLG_SILENT = 0x00004, |
| 473 | /** |
| 474 | * @GD_FLG_POSTFAIL: critical POST test failed |
| 475 | */ |
| 476 | GD_FLG_POSTFAIL = 0x00008, |
| 477 | /** |
| 478 | * @GD_FLG_POSTSTOP: POST sequence aborted |
| 479 | */ |
| 480 | GD_FLG_POSTSTOP = 0x00010, |
| 481 | /** |
| 482 | * @GD_FLG_LOGINIT: log Buffer has been initialized |
| 483 | */ |
| 484 | GD_FLG_LOGINIT = 0x00020, |
| 485 | /** |
| 486 | * @GD_FLG_DISABLE_CONSOLE: disable console (in & out) |
| 487 | */ |
| 488 | GD_FLG_DISABLE_CONSOLE = 0x00040, |
| 489 | /** |
| 490 | * @GD_FLG_ENV_READY: environment imported into hash table |
| 491 | */ |
| 492 | GD_FLG_ENV_READY = 0x00080, |
| 493 | /** |
| 494 | * @GD_FLG_SERIAL_READY: pre-relocation serial console ready |
| 495 | */ |
| 496 | GD_FLG_SERIAL_READY = 0x00100, |
| 497 | /** |
| 498 | * @GD_FLG_FULL_MALLOC_INIT: full malloc() is ready |
| 499 | */ |
| 500 | GD_FLG_FULL_MALLOC_INIT = 0x00200, |
| 501 | /** |
| 502 | * @GD_FLG_SPL_INIT: spl_init() has been called |
| 503 | */ |
| 504 | GD_FLG_SPL_INIT = 0x00400, |
| 505 | /** |
| 506 | * @GD_FLG_SKIP_RELOC: don't relocate |
| 507 | */ |
| 508 | GD_FLG_SKIP_RELOC = 0x00800, |
| 509 | /** |
| 510 | * @GD_FLG_RECORD: record console |
| 511 | */ |
| 512 | GD_FLG_RECORD = 0x01000, |
| 513 | /** |
| 514 | * @GD_FLG_ENV_DEFAULT: default variable flag |
| 515 | */ |
| 516 | GD_FLG_ENV_DEFAULT = 0x02000, |
| 517 | /** |
| 518 | * @GD_FLG_SPL_EARLY_INIT: early SPL initialization is done |
| 519 | */ |
| 520 | GD_FLG_SPL_EARLY_INIT = 0x04000, |
| 521 | /** |
| 522 | * @GD_FLG_LOG_READY: log system is ready for use |
| 523 | */ |
| 524 | GD_FLG_LOG_READY = 0x08000, |
| 525 | /** |
| 526 | * @GD_FLG_WDT_READY: watchdog is ready for use |
| 527 | */ |
| 528 | GD_FLG_WDT_READY = 0x10000, |
| 529 | /** |
| 530 | * @GD_FLG_SKIP_LL_INIT: don't perform low-level initialization |
| 531 | */ |
| 532 | GD_FLG_SKIP_LL_INIT = 0x20000, |
| 533 | /** |
| 534 | * @GD_FLG_SMP_READY: SMP initialization is complete |
| 535 | */ |
| 536 | GD_FLG_SMP_READY = 0x40000, |
| 537 | }; |
| 538 | |
| 539 | #endif /* __ASSEMBLY__ */ |
Simon Glass | 0e72403 | 2012-12-13 20:49:12 +0000 | [diff] [blame] | 540 | |
| 541 | #endif /* __ASM_GENERIC_GBL_DATA_H */ |