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