1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * (C) Copyright 2002-2010
7 #ifndef __ASM_GBL_DATA_H
8 #define __ASM_GBL_DATA_H
10 /* Architecture-specific global data */
11 struct arch_global_data {
12 #if defined(CONFIG_FSL_ESDHC) || defined(CONFIG_FSL_ESDHC_IMX)
16 #if defined(CONFIG_U_QE)
21 #endif /* CONFIG_U_QE */
23 #ifdef CONFIG_AT91FAMILY
24 /* "static data" needed by at91's clock.c */
25 unsigned long cpu_clk_rate_hz;
26 unsigned long main_clk_rate_hz;
27 unsigned long mck_rate_hz;
28 unsigned long plla_rate_hz;
29 unsigned long pllb_rate_hz;
30 unsigned long at91_pllb_usb_init;
32 /* "static data" needed by most of timer.c on ARM platforms */
33 unsigned long timer_rate_hz;
36 unsigned long lastinc;
37 unsigned long long timer_reset_value;
38 #if !(CONFIG_IS_ENABLED(SYS_ICACHE_OFF) && CONFIG_IS_ENABLED(SYS_DCACHE_OFF))
39 unsigned long tlb_addr;
40 unsigned long tlb_size;
41 #if defined(CONFIG_ARM64)
42 unsigned long tlb_fillptr;
43 unsigned long tlb_emerg;
46 #ifdef CONFIG_SYS_MEM_RESERVE_SECURE
47 #define MEM_RESERVE_SECURE_SECURED 0x1
48 #define MEM_RESERVE_SECURE_MAINTAINED 0x2
49 #define MEM_RESERVE_SECURE_ADDR_MASK (~0x3)
52 * This variable needs maintenance if the RAM base is not zero,
53 * or if RAM splits into non-consecutive banks. It also has a
54 * flag indicating the secure memory is marked as secure by MMU.
55 * Flags used: 0x1 secured
58 phys_addr_t secure_ram;
59 unsigned long tlb_allocated;
61 #ifdef CONFIG_RESV_RAM
63 * Reserved RAM for memory resident, eg. Management Complex (MC)
64 * driver which continues to run after U-Boot exits.
69 #ifdef CONFIG_ARCH_OMAP2PLUS
74 #if defined(CONFIG_FSL_LSCH3) && defined(CONFIG_SYS_FSL_HAS_DP_DDR)
75 unsigned long mem2_clk;
78 #ifdef CONFIG_ARCH_IMX8
79 struct udevice *scu_dev;
83 #include <asm-generic/global_data.h>
87 #define DECLARE_GLOBAL_DATA_PTR
90 static inline gd_t *get_gd(void)
96 * Make will already error that reserving x18 is not supported at the
97 * time of writing, clang: error: unknown argument: '-ffixed-x18'
99 __asm__ volatile("mov %0, x18\n" : "=r" (gd_ptr));
101 __asm__ volatile("mov %0, r9\n" : "=r" (gd_ptr));
110 #define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("x18")
112 #define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("r9")
116 #endif /* __ASM_GBL_DATA_H */