blob: 805a6fd6797b0dab47beab5aa0eea3286800ac10 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Simon Glass0e724032012-12-13 20:49:12 +00002/*
3 * Copyright (c) 2012 The Chromium OS Authors.
4 * (C) Copyright 2002-2010
5 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
Simon Glass0e724032012-12-13 20:49:12 +00006 */
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__
Simon Glassaa4bce92022-03-04 08:43:00 -070023#include <event_internal.h>
Stefan Roese85bddff2019-04-12 16:42:28 +020024#include <fdtdec.h>
Simon Glass1bb49232015-11-08 23:47:48 -070025#include <membuff.h>
Simon Glassdd6ab882014-02-26 15:59:18 -070026#include <linux/list.h>
Rasmus Villemoesb8cfd9e2021-05-18 11:19:47 +020027#include <linux/build_bug.h>
28#include <asm-offsets.h>
Simon Glassdd6ab882014-02-26 15:59:18 -070029
Simon Glassde0115a2020-11-04 09:57:19 -070030struct acpi_ctx;
Simon Glasscfd6a002020-10-03 11:31:33 -060031struct driver_rt;
32
Heinrich Schuchardt50d92862020-10-05 08:30:09 +020033typedef struct global_data gd_t;
34
35/**
36 * struct global_data - global data structure
37 */
38struct global_data {
39 /**
40 * @bd: board information
41 */
Masahiro Yamadad788bba2020-02-25 02:22:27 +090042 struct bd_info *bd;
Heinrich Schuchardt50d92862020-10-05 08:30:09 +020043 /**
44 * @flags: global data flags
45 *
46 * See &enum gd_flags
47 */
Simon Glass0e724032012-12-13 20:49:12 +000048 unsigned long flags;
Heinrich Schuchardt50d92862020-10-05 08:30:09 +020049 /**
50 * @baudrate: baud rate of the serial interface
51 */
Simon Glass059c54f2013-03-05 14:40:05 +000052 unsigned int baudrate;
Heinrich Schuchardt50d92862020-10-05 08:30:09 +020053 /**
54 * @cpu_clk: CPU clock rate in Hz
55 */
56 unsigned long cpu_clk;
57 /**
58 * @bus_clk: platform clock rate in Hz
59 */
Simon Glass0e724032012-12-13 20:49:12 +000060 unsigned long bus_clk;
Heinrich Schuchardt50d92862020-10-05 08:30:09 +020061 /**
62 * @pci_clk: PCI clock rate in Hz
63 */
Simon Glass0e724032012-12-13 20:49:12 +000064 /* We cannot bracket this with CONFIG_PCI due to mpc5xxx */
65 unsigned long pci_clk;
Heinrich Schuchardt50d92862020-10-05 08:30:09 +020066 /**
67 * @mem_clk: memory clock rate in Hz
68 */
Simon Glass0e724032012-12-13 20:49:12 +000069 unsigned long mem_clk;
Simon Glass03fbd252022-01-23 07:04:08 -070070#if defined(CONFIG_LCD) || defined(CONFIG_DM_VIDEO)
Heinrich Schuchardt50d92862020-10-05 08:30:09 +020071 /**
72 * @fb_base: base address of frame buffer memory
73 */
74 unsigned long fb_base;
Simon Glass0e724032012-12-13 20:49:12 +000075#endif
Simon Glass49badb92017-12-04 13:48:23 -070076#if defined(CONFIG_POST)
Heinrich Schuchardt50d92862020-10-05 08:30:09 +020077 /**
78 * @post_log_word: active POST tests
79 *
80 * @post_log_word is a bit mask defining which POST tests are recorded
81 * (see constants POST_*).
82 */
83 unsigned long post_log_word;
84 /**
85 * @post_log_res: POST results
86 *
87 * @post_log_res is a bit mask with the POST results. A bit with value 1
88 * indicates successful execution.
89 */
90 unsigned long post_log_res;
91 /**
92 * @post_init_f_time: time in ms when post_init_f() started
93 */
94 unsigned long post_init_f_time;
Simon Glass0e724032012-12-13 20:49:12 +000095#endif
96#ifdef CONFIG_BOARD_TYPES
Heinrich Schuchardt50d92862020-10-05 08:30:09 +020097 /**
98 * @board_type: board type
99 *
100 * If a U-Boot configuration supports multiple board types, the actual
101 * board type may be stored in this field.
102 */
Simon Glass0e724032012-12-13 20:49:12 +0000103 unsigned long board_type;
104#endif
Heinrich Schuchardt50d92862020-10-05 08:30:09 +0200105 /**
106 * @have_console: console is available
107 *
108 * A value of 1 indicates that serial_init() was called and a console
109 * is available.
110 * A value of 0 indicates that console input and output drivers shall
111 * not be called.
112 */
113 unsigned long have_console;
Simon Glasse304a5e2016-10-17 20:12:36 -0600114#if CONFIG_IS_ENABLED(PRE_CONSOLE_BUFFER)
Heinrich Schuchardt50d92862020-10-05 08:30:09 +0200115 /**
116 * @precon_buf_idx: pre-console buffer index
117 *
118 * @precon_buf_idx indicates the current position of the buffer used to
119 * collect output before the console becomes available
120 */
121 unsigned long precon_buf_idx;
Simon Glass0e724032012-12-13 20:49:12 +0000122#endif
Heinrich Schuchardt50d92862020-10-05 08:30:09 +0200123 /**
124 * @env_addr: address of environment structure
125 *
126 * @env_addr contains the address of the structure holding the
127 * environment variables.
128 */
129 unsigned long env_addr;
130 /**
131 * @env_valid: environment is valid
132 *
133 * See &enum env_valid
134 */
135 unsigned long env_valid;
136 /**
137 * @env_has_init: bit mask indicating environment locations
138 *
139 * &enum env_location defines which bit relates to which location
140 */
141 unsigned long env_has_init;
142 /**
143 * @env_load_prio: priority of the loaded environment
144 */
145 int env_load_prio;
146 /**
147 * @ram_base: base address of RAM used by U-Boot
148 */
149 unsigned long ram_base;
150 /**
151 * @ram_top: top address of RAM used by U-Boot
152 */
Bin Mengf936cf62021-01-31 20:35:59 +0800153 phys_addr_t ram_top;
Heinrich Schuchardt50d92862020-10-05 08:30:09 +0200154 /**
155 * @relocaddr: start address of U-Boot in RAM
156 *
157 * After relocation this field indicates the address to which U-Boot
158 * has been relocated. It can be displayed using the bdinfo command.
159 * Its value is needed to display the source code when debugging with
160 * GDB using the 'add-symbol-file u-boot <relocaddr>' command.
161 */
162 unsigned long relocaddr;
163 /**
164 * @ram_size: RAM size in bytes
165 */
166 phys_size_t ram_size;
167 /**
168 * @mon_len: monitor length in bytes
169 */
170 unsigned long mon_len;
171 /**
172 * @irq_sp: IRQ stack pointer
173 */
174 unsigned long irq_sp;
175 /**
176 * @start_addr_sp: initial stack pointer address
177 */
178 unsigned long start_addr_sp;
179 /**
180 * @reloc_off: relocation offset
181 */
Simon Glass0e724032012-12-13 20:49:12 +0000182 unsigned long reloc_off;
Heinrich Schuchardt50d92862020-10-05 08:30:09 +0200183 /**
184 * @new_gd: pointer to relocated global data
185 */
186 struct global_data *new_gd;
Simon Glassdd6ab882014-02-26 15:59:18 -0700187
188#ifdef CONFIG_DM
Heinrich Schuchardt50d92862020-10-05 08:30:09 +0200189 /**
190 * @dm_root: root instance for Driver Model
191 */
192 struct udevice *dm_root;
193 /**
194 * @dm_root_f: pre-relocation root instance
195 */
196 struct udevice *dm_root_f;
197 /**
Heinrich Schuchardt18000fe2021-01-24 21:48:00 +0100198 * @uclass_root_s:
199 * head of core tree when uclasses are not in read-only memory.
200 *
201 * When uclasses are in read-only memory, @uclass_root_s is not used and
202 * @uclass_root points to the root node generated by dtoc.
Heinrich Schuchardt50d92862020-10-05 08:30:09 +0200203 */
Simon Glass784cd9e2020-12-19 10:40:17 -0700204 struct list_head uclass_root_s;
205 /**
Heinrich Schuchardt18000fe2021-01-24 21:48:00 +0100206 * @uclass_root:
207 * pointer to head of core tree, if uclasses are in read-only memory and
208 * cannot be adjusted to use @uclass_root as a list head.
209 *
210 * When not in read-only memory, @uclass_root_s is used to hold the
211 * uclass root, and @uclass_root points to the address of
212 * @uclass_root_s.
Simon Glass784cd9e2020-12-19 10:40:17 -0700213 */
214 struct list_head *uclass_root;
Simon Glass8beeb282021-03-15 17:25:36 +1300215# if CONFIG_IS_ENABLED(OF_PLATDATA_DRIVER_RT)
Simon Glass9286eb92020-11-29 17:07:05 -0700216 /** @dm_driver_rt: Dynamic info about the driver */
Simon Glasscfd6a002020-10-03 11:31:33 -0600217 struct driver_rt *dm_driver_rt;
218# endif
Simon Glass8beeb282021-03-15 17:25:36 +1300219#if CONFIG_IS_ENABLED(OF_PLATDATA_RT)
220 /** @dm_udevice_rt: Dynamic info about the udevice */
221 struct udevice_rt *dm_udevice_rt;
Simon Glass8dee67a2021-03-15 17:25:38 +1300222 /**
223 * @dm_priv_base: Base address of the priv/plat region used when
224 * udevices and uclasses are in read-only memory. This is NULL if not
225 * used
226 */
227 void *dm_priv_base;
Simon Glass8beeb282021-03-15 17:25:36 +1300228# endif
Simon Glassdd6ab882014-02-26 15:59:18 -0700229#endif
Thomas Choufb798b12015-10-09 13:46:34 +0800230#ifdef CONFIG_TIMER
Heinrich Schuchardt50d92862020-10-05 08:30:09 +0200231 /**
232 * @timer: timer instance for Driver Model
233 */
234 struct udevice *timer;
Thomas Choufb798b12015-10-09 13:46:34 +0800235#endif
Heinrich Schuchardt50d92862020-10-05 08:30:09 +0200236 /**
237 * @fdt_blob: U-Boot's own device tree, NULL if none
238 */
239 const void *fdt_blob;
240 /**
241 * @new_fdt: relocated device tree
242 */
243 void *new_fdt;
244 /**
245 * @fdt_size: space reserved for relocated device space
246 */
247 unsigned long fdt_size;
Simon Glassbed6bc72021-12-16 20:59:33 -0700248 /**
249 * @fdt_src: Source of FDT
250 */
251 enum fdt_source_t fdt_src;
Simon Glass40916e62020-10-03 09:25:22 -0600252#if CONFIG_IS_ENABLED(OF_LIVE)
Heinrich Schuchardt50d92862020-10-05 08:30:09 +0200253 /**
254 * @of_root: root node of the live tree
255 */
Simon Glassa6eedb82017-05-18 20:08:53 -0600256 struct device_node *of_root;
257#endif
Jean-Jacques Hiblot7c530e32018-12-07 14:50:52 +0100258
259#if CONFIG_IS_ENABLED(MULTI_DTB_FIT)
Heinrich Schuchardt50d92862020-10-05 08:30:09 +0200260 /**
261 * @multi_dtb_fit: pointer to uncompressed multi-dtb FIT image
262 */
263 const void *multi_dtb_fit;
Jean-Jacques Hiblot7c530e32018-12-07 14:50:52 +0100264#endif
Heinrich Schuchardt50d92862020-10-05 08:30:09 +0200265 /**
266 * @jt: jump table
267 *
268 * The jump table contains pointers to exported functions. A pointer to
269 * the jump table is passed to standalone applications.
270 */
271 struct jt_funcs *jt;
272 /**
273 * @env_buf: buffer for env_get() before reloc
274 */
275 char env_buf[32];
Simon Glass209a1a62013-06-11 11:14:42 -0700276#ifdef CONFIG_TRACE
Heinrich Schuchardt50d92862020-10-05 08:30:09 +0200277 /**
278 * @trace_buff: trace buffer
279 *
280 * When tracing function in U-Boot this field points to the buffer
281 * recording the function calls.
282 */
283 void *trace_buff;
Simon Glass209a1a62013-06-11 11:14:42 -0700284#endif
Tom Rini52b2e262021-08-18 23:12:24 -0400285#if CONFIG_IS_ENABLED(SYS_I2C_LEGACY)
Heinrich Schuchardt50d92862020-10-05 08:30:09 +0200286 /**
287 * @cur_i2c_bus: currently used I2C bus
288 */
289 int cur_i2c_bus;
Heiko Schochere7d9c4f2012-01-16 21:12:23 +0000290#endif
Heinrich Schuchardt50d92862020-10-05 08:30:09 +0200291 /**
292 * @timebase_h: high 32 bits of timer
293 */
Peng Fan9a60a9e2017-05-09 10:32:03 +0800294 unsigned int timebase_h;
Heinrich Schuchardt50d92862020-10-05 08:30:09 +0200295 /**
296 * @timebase_l: low 32 bits of timer
297 */
Peng Fan9a60a9e2017-05-09 10:32:03 +0800298 unsigned int timebase_l;
Andy Yan1fa20e4d2017-07-24 17:43:34 +0800299#if CONFIG_VAL(SYS_MALLOC_F_LEN)
Heinrich Schuchardt50d92862020-10-05 08:30:09 +0200300 /**
301 * @malloc_base: base address of early malloc()
302 */
303 unsigned long malloc_base;
304 /**
305 * @malloc_limit: limit address of early malloc()
306 */
307 unsigned long malloc_limit;
308 /**
309 * @malloc_ptr: current address of early malloc()
310 */
311 unsigned long malloc_ptr;
Simon Glass863e4042014-07-10 22:23:28 -0600312#endif
Bin Mengf1b81fc2014-12-30 22:53:21 +0800313#ifdef CONFIG_PCI
Heinrich Schuchardt50d92862020-10-05 08:30:09 +0200314 /**
315 * @hose: PCI hose for early use
316 */
317 struct pci_controller *hose;
318 /**
319 * @pci_ram_top: top of region accessible to PCI
320 */
321 phys_addr_t pci_ram_top;
Bin Mengf1b81fc2014-12-30 22:53:21 +0800322#endif
323#ifdef CONFIG_PCI_BOOTDELAY
Heinrich Schuchardt50d92862020-10-05 08:30:09 +0200324 /**
325 * @pcidelay_done: delay time before scanning of PIC hose expired
326 *
327 * If CONFIG_PCI_BOOTDELAY=y, pci_hose_scan() waits for the number of
328 * milliseconds defined by environment variable pcidelay before
329 * scanning. Once this delay has expired the flag @pcidelay_done
330 * is set to 1.
331 */
Bin Mengf1b81fc2014-12-30 22:53:21 +0800332 int pcidelay_done;
333#endif
Heinrich Schuchardt50d92862020-10-05 08:30:09 +0200334 /**
335 * @cur_serial_dev: current serial device
336 */
337 struct udevice *cur_serial_dev;
338 /**
339 * @arch: architecture-specific data
340 */
341 struct arch_global_data arch;
Simon Glass1bb49232015-11-08 23:47:48 -0700342#ifdef CONFIG_CONSOLE_RECORD
Heinrich Schuchardt50d92862020-10-05 08:30:09 +0200343 /**
344 * @console_out: output buffer for console recording
345 *
346 * This buffer is used to collect output during console recording.
347 */
348 struct membuff console_out;
349 /**
350 * @console_in: input buffer for console recording
351 *
352 * If console recording is activated, this buffer can be used to
353 * emulate input.
354 */
355 struct membuff console_in;
Simon Glass1bb49232015-11-08 23:47:48 -0700356#endif
Simon Glassfce58f52016-01-18 19:52:21 -0700357#ifdef CONFIG_DM_VIDEO
Heinrich Schuchardt50d92862020-10-05 08:30:09 +0200358 /**
359 * @video_top: top of video frame buffer area
360 */
361 ulong video_top;
362 /**
363 * @video_bottom: bottom of video frame buffer area
364 */
365 ulong video_bottom;
Simon Glassfce58f52016-01-18 19:52:21 -0700366#endif
Simon Glass88200332017-05-22 05:05:25 -0600367#ifdef CONFIG_BOOTSTAGE
Heinrich Schuchardt50d92862020-10-05 08:30:09 +0200368 /**
369 * @bootstage: boot stage information
370 */
371 struct bootstage_data *bootstage;
372 /**
373 * @new_bootstage: relocated boot stage information
374 */
375 struct bootstage_data *new_bootstage;
Simon Glass88200332017-05-22 05:05:25 -0600376#endif
Simon Glassd95645d2017-12-04 13:48:24 -0700377#ifdef CONFIG_LOG
Heinrich Schuchardt50d92862020-10-05 08:30:09 +0200378 /**
379 * @log_drop_count: number of dropped log messages
380 *
381 * This counter is incremented for each log message which can not
382 * be processed because logging is not yet available as signaled by
383 * flag %GD_FLG_LOG_READY in @flags.
384 */
385 int log_drop_count;
386 /**
387 * @default_log_level: default logging level
388 *
389 * For logging devices without filters @default_log_level defines the
390 * logging level, cf. &enum log_level_t.
391 */
392 int default_log_level;
393 /**
394 * @log_head: list of logging devices
395 */
396 struct list_head log_head;
397 /**
398 * @log_fmt: bit mask for logging format
399 *
400 * The @log_fmt bit mask selects the fields to be shown in log messages.
401 * &enum log_fmt defines the bits of the bit mask.
402 */
403 int log_fmt;
Heinrich Schuchardtfdf55992020-10-17 14:31:57 +0200404
405 /**
406 * @processing_msg: a log message is being processed
407 *
408 * This flag is used to suppress the creation of additional messages
409 * while another message is being processed.
410 */
411 bool processing_msg;
Heinrich Schuchardt0fc9f4f2020-10-17 14:31:58 +0200412 /**
413 * @logc_prev: logging category of previous message
414 *
415 * This value is used as logging category for continuation messages.
416 */
417 int logc_prev;
418 /**
Heinrich Schuchardt14e77222020-10-30 18:50:31 +0100419 * @logl_prev: logging level of the previous message
Heinrich Schuchardt0fc9f4f2020-10-17 14:31:58 +0200420 *
421 * This value is used as logging level for continuation messages.
422 */
423 int logl_prev;
Simon Glass5fc47e32021-01-20 20:10:53 -0700424 /**
425 * @log_cont: Previous log line did not finished wtih \n
426 *
427 * This allows for chained log messages on the same line
428 */
429 bool log_cont;
Simon Glassd95645d2017-12-04 13:48:24 -0700430#endif
Simon Glassa815dab2018-11-15 18:43:52 -0700431#if CONFIG_IS_ENABLED(BLOBLIST)
Heinrich Schuchardt50d92862020-10-05 08:30:09 +0200432 /**
433 * @bloblist: blob list information
434 */
435 struct bloblist_hdr *bloblist;
436 /**
437 * @new_bloblist: relocated blob list information
438 */
439 struct bloblist_hdr *new_bloblist;
Ovidiu Panaitc1b30d52020-11-28 10:43:20 +0200440#endif
441#if CONFIG_IS_ENABLED(HANDOFF)
Heinrich Schuchardt50d92862020-10-05 08:30:09 +0200442 /**
443 * @spl_handoff: SPL hand-off information
444 */
Simon Glasse14f1a22018-11-15 18:44:09 -0700445 struct spl_handoff *spl_handoff;
Simon Glassa815dab2018-11-15 18:43:52 -0700446#endif
Stefan Roese85bddff2019-04-12 16:42:28 +0200447#if defined(CONFIG_TRANSLATION_OFFSET)
Heinrich Schuchardt50d92862020-10-05 08:30:09 +0200448 /**
449 * @translation_offset: optional translation offset
450 *
451 * See CONFIG_TRANSLATION_OFFSET.
452 */
453 fdt_addr_t translation_offset;
Stefan Roese85bddff2019-04-12 16:42:28 +0200454#endif
Simon Glassde0115a2020-11-04 09:57:19 -0700455#ifdef CONFIG_GENERATE_ACPI_TABLE
456 /**
457 * @acpi_ctx: ACPI context pointer
458 */
459 struct acpi_ctx *acpi_ctx;
Simon Glassb33f2f92021-12-01 09:02:37 -0700460 /**
461 * @acpi_start: Start address of ACPI tables
462 */
463 ulong acpi_start;
Simon Glassde0115a2020-11-04 09:57:19 -0700464#endif
Simon Glassa05eb042021-02-04 21:17:20 -0700465#if CONFIG_IS_ENABLED(GENERATE_SMBIOS_TABLE)
466 /**
467 * @smbios_version: Points to SMBIOS type 0 version
468 */
469 char *smbios_version;
470#endif
Simon Glassaa4bce92022-03-04 08:43:00 -0700471#if CONFIG_IS_ENABLED(EVENT)
472 /**
473 * @event_state: Points to the current state of events
474 */
475 struct event_state event_state;
476#endif
AKASHI Takahiroe04f4fb2022-03-08 20:36:46 +0900477 /**
478 * @dmtag_list: List of DM tags
479 */
480 struct list_head dmtag_list;
Heinrich Schuchardt50d92862020-10-05 08:30:09 +0200481};
Rasmus Villemoesb8cfd9e2021-05-18 11:19:47 +0200482#ifndef DO_DEPS_ONLY
483static_assert(sizeof(struct global_data) == GD_SIZE);
484#endif
Simon Glass0e724032012-12-13 20:49:12 +0000485
Heinrich Schuchardt50d92862020-10-05 08:30:09 +0200486/**
487 * gd_board_type() - retrieve board type
488 *
489 * Return: global board type
490 */
Simon Glassb4de3f32017-03-31 08:40:24 -0600491#ifdef CONFIG_BOARD_TYPES
492#define gd_board_type() gd->board_type
493#else
494#define gd_board_type() 0
495#endif
496
Simon Glass40916e62020-10-03 09:25:22 -0600497/* These macros help avoid #ifdefs in the code */
498#if CONFIG_IS_ENABLED(OF_LIVE)
499#define gd_of_root() gd->of_root
500#define gd_of_root_ptr() &gd->of_root
501#define gd_set_of_root(_root) gd->of_root = (_root)
502#else
503#define gd_of_root() NULL
504#define gd_of_root_ptr() NULL
505#define gd_set_of_root(_root)
506#endif
507
Simon Glass8beeb282021-03-15 17:25:36 +1300508#if CONFIG_IS_ENABLED(OF_PLATDATA_DRIVER_RT)
Simon Glasscfd6a002020-10-03 11:31:33 -0600509#define gd_set_dm_driver_rt(dyn) gd->dm_driver_rt = dyn
510#define gd_dm_driver_rt() gd->dm_driver_rt
511#else
512#define gd_set_dm_driver_rt(dyn)
513#define gd_dm_driver_rt() NULL
514#endif
515
Simon Glass8beeb282021-03-15 17:25:36 +1300516#if CONFIG_IS_ENABLED(OF_PLATDATA_RT)
517#define gd_set_dm_udevice_rt(dyn) gd->dm_udevice_rt = dyn
518#define gd_dm_udevice_rt() gd->dm_udevice_rt
Simon Glass8dee67a2021-03-15 17:25:38 +1300519#define gd_set_dm_priv_base(dyn) gd->dm_priv_base = dyn
520#define gd_dm_priv_base() gd->dm_priv_base
Simon Glass8beeb282021-03-15 17:25:36 +1300521#else
522#define gd_set_dm_udevice_rt(dyn)
523#define gd_dm_udevice_rt() NULL
Simon Glass8dee67a2021-03-15 17:25:38 +1300524#define gd_set_dm_priv_base(dyn)
525#define gd_dm_priv_base() NULL
Simon Glass8beeb282021-03-15 17:25:36 +1300526#endif
527
Simon Glassde0115a2020-11-04 09:57:19 -0700528#ifdef CONFIG_GENERATE_ACPI_TABLE
529#define gd_acpi_ctx() gd->acpi_ctx
Simon Glassb33f2f92021-12-01 09:02:37 -0700530#define gd_acpi_start() gd->acpi_start
531#define gd_set_acpi_start(addr) gd->acpi_start = addr
Simon Glassde0115a2020-11-04 09:57:19 -0700532#else
533#define gd_acpi_ctx() NULL
Simon Glassb33f2f92021-12-01 09:02:37 -0700534#define gd_acpi_start() 0UL
535#define gd_set_acpi_start(addr)
Simon Glassde0115a2020-11-04 09:57:19 -0700536#endif
537
Simon Glass69daf5a2021-12-16 20:59:25 -0700538#if CONFIG_IS_ENABLED(MULTI_DTB_FIT)
539#define gd_multi_dtb_fit() gd->multi_dtb_fit
540#define gd_set_multi_dtb_fit(_dtb) gd->multi_dtb_fit = _dtb
541#else
542#define gd_multi_dtb_fit() NULL
543#define gd_set_multi_dtb_fit(_dtb)
544#endif
545
Simon Glassaa4bce92022-03-04 08:43:00 -0700546#if CONFIG_IS_ENABLED(EVENT_DYNAMIC)
547#define gd_event_state() ((struct event_state *)&gd->event_state)
548#else
549#define gd_event_state() NULL
550#endif
551
Heinrich Schuchardt1e5c4fe2020-10-05 08:30:08 +0200552/**
553 * enum gd_flags - global data flags
554 *
555 * See field flags of &struct global_data.
Simon Glass0e724032012-12-13 20:49:12 +0000556 */
Heinrich Schuchardt1e5c4fe2020-10-05 08:30:08 +0200557enum gd_flags {
558 /**
559 * @GD_FLG_RELOC: code was relocated to RAM
560 */
561 GD_FLG_RELOC = 0x00001,
562 /**
563 * @GD_FLG_DEVINIT: devices have been initialized
564 */
565 GD_FLG_DEVINIT = 0x00002,
566 /**
567 * @GD_FLG_SILENT: silent mode
568 */
569 GD_FLG_SILENT = 0x00004,
570 /**
571 * @GD_FLG_POSTFAIL: critical POST test failed
572 */
573 GD_FLG_POSTFAIL = 0x00008,
574 /**
575 * @GD_FLG_POSTSTOP: POST sequence aborted
576 */
577 GD_FLG_POSTSTOP = 0x00010,
578 /**
579 * @GD_FLG_LOGINIT: log Buffer has been initialized
580 */
581 GD_FLG_LOGINIT = 0x00020,
582 /**
583 * @GD_FLG_DISABLE_CONSOLE: disable console (in & out)
584 */
585 GD_FLG_DISABLE_CONSOLE = 0x00040,
586 /**
587 * @GD_FLG_ENV_READY: environment imported into hash table
588 */
589 GD_FLG_ENV_READY = 0x00080,
590 /**
591 * @GD_FLG_SERIAL_READY: pre-relocation serial console ready
592 */
593 GD_FLG_SERIAL_READY = 0x00100,
594 /**
595 * @GD_FLG_FULL_MALLOC_INIT: full malloc() is ready
596 */
597 GD_FLG_FULL_MALLOC_INIT = 0x00200,
598 /**
599 * @GD_FLG_SPL_INIT: spl_init() has been called
600 */
601 GD_FLG_SPL_INIT = 0x00400,
602 /**
603 * @GD_FLG_SKIP_RELOC: don't relocate
604 */
605 GD_FLG_SKIP_RELOC = 0x00800,
606 /**
607 * @GD_FLG_RECORD: record console
608 */
609 GD_FLG_RECORD = 0x01000,
610 /**
Simon Glassd6ed4af2021-05-08 06:59:56 -0600611 * @GD_FLG_RECORD_OVF: record console overflow
612 */
613 GD_FLG_RECORD_OVF = 0x02000,
614 /**
Heinrich Schuchardt1e5c4fe2020-10-05 08:30:08 +0200615 * @GD_FLG_ENV_DEFAULT: default variable flag
616 */
Simon Glassd6ed4af2021-05-08 06:59:56 -0600617 GD_FLG_ENV_DEFAULT = 0x04000,
Heinrich Schuchardt1e5c4fe2020-10-05 08:30:08 +0200618 /**
619 * @GD_FLG_SPL_EARLY_INIT: early SPL initialization is done
620 */
Simon Glassd6ed4af2021-05-08 06:59:56 -0600621 GD_FLG_SPL_EARLY_INIT = 0x08000,
Heinrich Schuchardt1e5c4fe2020-10-05 08:30:08 +0200622 /**
623 * @GD_FLG_LOG_READY: log system is ready for use
624 */
Simon Glassd6ed4af2021-05-08 06:59:56 -0600625 GD_FLG_LOG_READY = 0x10000,
Heinrich Schuchardt1e5c4fe2020-10-05 08:30:08 +0200626 /**
627 * @GD_FLG_WDT_READY: watchdog is ready for use
628 */
Simon Glassd6ed4af2021-05-08 06:59:56 -0600629 GD_FLG_WDT_READY = 0x20000,
Heinrich Schuchardt1e5c4fe2020-10-05 08:30:08 +0200630 /**
631 * @GD_FLG_SKIP_LL_INIT: don't perform low-level initialization
632 */
Simon Glassd6ed4af2021-05-08 06:59:56 -0600633 GD_FLG_SKIP_LL_INIT = 0x40000,
Heinrich Schuchardt1e5c4fe2020-10-05 08:30:08 +0200634 /**
635 * @GD_FLG_SMP_READY: SMP initialization is complete
636 */
Simon Glassd6ed4af2021-05-08 06:59:56 -0600637 GD_FLG_SMP_READY = 0x80000,
Heinrich Schuchardt1e5c4fe2020-10-05 08:30:08 +0200638};
639
640#endif /* __ASSEMBLY__ */
Simon Glass0e724032012-12-13 20:49:12 +0000641
642#endif /* __ASM_GENERIC_GBL_DATA_H */