mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-20 11:55:03 +00:00
global_data: Collect common fields at the top
Move all the fields which are always present to the top of the struct, so we can potentially save some space by taking note of alignment. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
2e9313179a
commit
cd4f9eb514
1 changed files with 82 additions and 84 deletions
|
@ -71,48 +71,6 @@ struct global_data {
|
||||||
* @mem_clk: memory clock rate in Hz
|
* @mem_clk: memory clock rate in Hz
|
||||||
*/
|
*/
|
||||||
unsigned long mem_clk;
|
unsigned long mem_clk;
|
||||||
#if defined(CONFIG_POST)
|
|
||||||
/**
|
|
||||||
* @post_log_word: active POST tests
|
|
||||||
*
|
|
||||||
* @post_log_word is a bit mask defining which POST tests are recorded
|
|
||||||
* (see constants POST_*).
|
|
||||||
*/
|
|
||||||
unsigned long post_log_word;
|
|
||||||
/**
|
|
||||||
* @post_log_res: POST results
|
|
||||||
*
|
|
||||||
* @post_log_res is a bit mask with the POST results. A bit with value 1
|
|
||||||
* indicates successful execution.
|
|
||||||
*/
|
|
||||||
unsigned long post_log_res;
|
|
||||||
/**
|
|
||||||
* @post_init_f_time: time in ms when post_init_f() started
|
|
||||||
*/
|
|
||||||
unsigned long post_init_f_time;
|
|
||||||
#endif
|
|
||||||
#ifdef CONFIG_BOARD_TYPES
|
|
||||||
/**
|
|
||||||
* @board_type: board type
|
|
||||||
*
|
|
||||||
* If a U-Boot configuration supports multiple board types, the actual
|
|
||||||
* board type may be stored in this field.
|
|
||||||
*/
|
|
||||||
unsigned long board_type;
|
|
||||||
#endif
|
|
||||||
#if CONFIG_IS_ENABLED(PRE_CONSOLE_BUFFER)
|
|
||||||
/**
|
|
||||||
* @precon_buf_idx: pre-console buffer index
|
|
||||||
*
|
|
||||||
* @precon_buf_idx indicates the current position of the
|
|
||||||
* buffer used to collect output before the console becomes
|
|
||||||
* available. When negative, the pre-console buffer is
|
|
||||||
* temporarily disabled (used when the pre-console buffer is
|
|
||||||
* being written out, to prevent adding its contents to
|
|
||||||
* itself).
|
|
||||||
*/
|
|
||||||
long precon_buf_idx;
|
|
||||||
#endif
|
|
||||||
/**
|
/**
|
||||||
* @env_addr: address of environment structure
|
* @env_addr: address of environment structure
|
||||||
*
|
*
|
||||||
|
@ -177,7 +135,87 @@ struct global_data {
|
||||||
* @new_gd: pointer to relocated global data
|
* @new_gd: pointer to relocated global data
|
||||||
*/
|
*/
|
||||||
struct global_data *new_gd;
|
struct global_data *new_gd;
|
||||||
|
/**
|
||||||
|
* @fdt_blob: U-Boot's own device tree, NULL if none
|
||||||
|
*/
|
||||||
|
const void *fdt_blob;
|
||||||
|
/**
|
||||||
|
* @fdt_src: Source of FDT
|
||||||
|
*/
|
||||||
|
enum fdt_source_t fdt_src;
|
||||||
|
/**
|
||||||
|
* @jt: jump table
|
||||||
|
*
|
||||||
|
* The jump table contains pointers to exported functions. A pointer to
|
||||||
|
* the jump table is passed to standalone applications.
|
||||||
|
*/
|
||||||
|
struct jt_funcs *jt;
|
||||||
|
/**
|
||||||
|
* @env_buf: buffer for env_get() before reloc
|
||||||
|
*/
|
||||||
|
char env_buf[32];
|
||||||
|
/**
|
||||||
|
* @cur_serial_dev: current serial device
|
||||||
|
*/
|
||||||
|
struct udevice *cur_serial_dev;
|
||||||
|
/**
|
||||||
|
* @arch: architecture-specific data
|
||||||
|
*/
|
||||||
|
struct arch_global_data arch;
|
||||||
|
/**
|
||||||
|
* @dmtag_list: List of DM tags
|
||||||
|
*/
|
||||||
|
struct list_head dmtag_list;
|
||||||
|
/**
|
||||||
|
* @timebase_h: high 32 bits of timer
|
||||||
|
*/
|
||||||
|
unsigned int timebase_h;
|
||||||
|
/**
|
||||||
|
* @timebase_l: low 32 bits of timer
|
||||||
|
*/
|
||||||
|
unsigned int timebase_l;
|
||||||
|
#if defined(CONFIG_POST)
|
||||||
|
/**
|
||||||
|
* @post_log_word: active POST tests
|
||||||
|
*
|
||||||
|
* @post_log_word is a bit mask defining which POST tests are recorded
|
||||||
|
* (see constants POST_*).
|
||||||
|
*/
|
||||||
|
unsigned long post_log_word;
|
||||||
|
/**
|
||||||
|
* @post_log_res: POST results
|
||||||
|
*
|
||||||
|
* @post_log_res is a bit mask with the POST results. A bit with value 1
|
||||||
|
* indicates successful execution.
|
||||||
|
*/
|
||||||
|
unsigned long post_log_res;
|
||||||
|
/**
|
||||||
|
* @post_init_f_time: time in ms when post_init_f() started
|
||||||
|
*/
|
||||||
|
unsigned long post_init_f_time;
|
||||||
|
#endif
|
||||||
|
#ifdef CONFIG_BOARD_TYPES
|
||||||
|
/**
|
||||||
|
* @board_type: board type
|
||||||
|
*
|
||||||
|
* If a U-Boot configuration supports multiple board types, the actual
|
||||||
|
* board type may be stored in this field.
|
||||||
|
*/
|
||||||
|
unsigned long board_type;
|
||||||
|
#endif
|
||||||
|
#if CONFIG_IS_ENABLED(PRE_CONSOLE_BUFFER)
|
||||||
|
/**
|
||||||
|
* @precon_buf_idx: pre-console buffer index
|
||||||
|
*
|
||||||
|
* @precon_buf_idx indicates the current position of the
|
||||||
|
* buffer used to collect output before the console becomes
|
||||||
|
* available. When negative, the pre-console buffer is
|
||||||
|
* temporarily disabled (used when the pre-console buffer is
|
||||||
|
* being written out, to prevent adding its contents to
|
||||||
|
* itself).
|
||||||
|
*/
|
||||||
|
long precon_buf_idx;
|
||||||
|
#endif
|
||||||
#ifdef CONFIG_DM
|
#ifdef CONFIG_DM
|
||||||
/**
|
/**
|
||||||
* @dm_root: root instance for Driver Model
|
* @dm_root: root instance for Driver Model
|
||||||
|
@ -222,38 +260,18 @@ struct global_data {
|
||||||
*/
|
*/
|
||||||
struct udevice *timer;
|
struct udevice *timer;
|
||||||
#endif
|
#endif
|
||||||
/**
|
|
||||||
* @fdt_blob: U-Boot's own device tree, NULL if none
|
|
||||||
*/
|
|
||||||
const void *fdt_blob;
|
|
||||||
/**
|
|
||||||
* @fdt_src: Source of FDT
|
|
||||||
*/
|
|
||||||
enum fdt_source_t fdt_src;
|
|
||||||
#if CONFIG_IS_ENABLED(OF_LIVE)
|
#if CONFIG_IS_ENABLED(OF_LIVE)
|
||||||
/**
|
/**
|
||||||
* @of_root: root node of the live tree
|
* @of_root: root node of the live tree
|
||||||
*/
|
*/
|
||||||
struct device_node *of_root;
|
struct device_node *of_root;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if CONFIG_IS_ENABLED(MULTI_DTB_FIT)
|
#if CONFIG_IS_ENABLED(MULTI_DTB_FIT)
|
||||||
/**
|
/**
|
||||||
* @multi_dtb_fit: pointer to uncompressed multi-dtb FIT image
|
* @multi_dtb_fit: pointer to uncompressed multi-dtb FIT image
|
||||||
*/
|
*/
|
||||||
const void *multi_dtb_fit;
|
const void *multi_dtb_fit;
|
||||||
#endif
|
#endif
|
||||||
/**
|
|
||||||
* @jt: jump table
|
|
||||||
*
|
|
||||||
* The jump table contains pointers to exported functions. A pointer to
|
|
||||||
* the jump table is passed to standalone applications.
|
|
||||||
*/
|
|
||||||
struct jt_funcs *jt;
|
|
||||||
/**
|
|
||||||
* @env_buf: buffer for env_get() before reloc
|
|
||||||
*/
|
|
||||||
char env_buf[32];
|
|
||||||
#ifdef CONFIG_TRACE
|
#ifdef CONFIG_TRACE
|
||||||
/**
|
/**
|
||||||
* @trace_buff: trace buffer
|
* @trace_buff: trace buffer
|
||||||
|
@ -269,18 +287,10 @@ struct global_data {
|
||||||
*/
|
*/
|
||||||
int cur_i2c_bus;
|
int cur_i2c_bus;
|
||||||
#endif
|
#endif
|
||||||
/**
|
#if CONFIG_IS_ENABLED(CMD_BDINFO_EXTRA)
|
||||||
* @timebase_h: high 32 bits of timer
|
|
||||||
*/
|
|
||||||
unsigned int timebase_h;
|
|
||||||
/**
|
|
||||||
* @timebase_l: low 32 bits of timer
|
|
||||||
*/
|
|
||||||
unsigned int timebase_l;
|
|
||||||
/**
|
/**
|
||||||
* @malloc_start: start of malloc() region
|
* @malloc_start: start of malloc() region
|
||||||
*/
|
*/
|
||||||
#if CONFIG_IS_ENABLED(CMD_BDINFO_EXTRA)
|
|
||||||
unsigned long malloc_start;
|
unsigned long malloc_start;
|
||||||
#endif
|
#endif
|
||||||
#if CONFIG_IS_ENABLED(SYS_MALLOC_F)
|
#if CONFIG_IS_ENABLED(SYS_MALLOC_F)
|
||||||
|
@ -297,14 +307,6 @@ struct global_data {
|
||||||
*/
|
*/
|
||||||
unsigned long malloc_ptr;
|
unsigned long malloc_ptr;
|
||||||
#endif
|
#endif
|
||||||
/**
|
|
||||||
* @cur_serial_dev: current serial device
|
|
||||||
*/
|
|
||||||
struct udevice *cur_serial_dev;
|
|
||||||
/**
|
|
||||||
* @arch: architecture-specific data
|
|
||||||
*/
|
|
||||||
struct arch_global_data arch;
|
|
||||||
#ifdef CONFIG_CONSOLE_RECORD
|
#ifdef CONFIG_CONSOLE_RECORD
|
||||||
/**
|
/**
|
||||||
* @console_out: output buffer for console recording
|
* @console_out: output buffer for console recording
|
||||||
|
@ -432,10 +434,6 @@ struct global_data {
|
||||||
*/
|
*/
|
||||||
struct hlist_head cyclic_list;
|
struct hlist_head cyclic_list;
|
||||||
#endif
|
#endif
|
||||||
/**
|
|
||||||
* @dmtag_list: List of DM tags
|
|
||||||
*/
|
|
||||||
struct list_head dmtag_list;
|
|
||||||
#if CONFIG_IS_ENABLED(UPL)
|
#if CONFIG_IS_ENABLED(UPL)
|
||||||
/**
|
/**
|
||||||
* @upl: Universal Payload-handoff information
|
* @upl: Universal Payload-handoff information
|
||||||
|
|
Loading…
Add table
Reference in a new issue