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