1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * (C) Copyright 2002-2010
4 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
7 #ifndef __ASM_GBL_DATA_H
8 #define __ASM_GBL_DATA_H
14 #include <asm/types.h>
15 #include <linux/types.h>
17 /* Architecture-specific global data */
18 struct arch_global_data {
19 #if defined(CONFIG_FSL_ESDHC) || defined(CONFIG_FSL_ESDHC_IMX)
23 #if defined(CONFIG_FSL_ESDHC)
27 #if defined(CONFIG_U_QE)
32 #endif /* CONFIG_U_QE */
34 #ifdef CONFIG_AT91FAMILY
35 /* "static data" needed by at91's clock.c */
36 unsigned long cpu_clk_rate_hz;
37 unsigned long main_clk_rate_hz;
38 unsigned long mck_rate_hz;
39 unsigned long plla_rate_hz;
40 unsigned long pllb_rate_hz;
41 unsigned long at91_pllb_usb_init;
43 /* "static data" needed by most of timer.c on ARM platforms */
44 unsigned long timer_rate_hz;
47 unsigned long lastinc;
48 unsigned long long timer_reset_value;
49 #if !(CONFIG_IS_ENABLED(SYS_ICACHE_OFF) && CONFIG_IS_ENABLED(SYS_DCACHE_OFF))
50 unsigned long tlb_addr;
51 unsigned long tlb_size;
52 #if defined(CONFIG_ARM64)
53 unsigned long tlb_fillptr;
54 unsigned long tlb_emerg;
55 unsigned int first_block_level;
59 #ifdef CFG_SYS_MEM_RESERVE_SECURE
60 #define MEM_RESERVE_SECURE_SECURED 0x1
61 #define MEM_RESERVE_SECURE_MAINTAINED 0x2
62 #define MEM_RESERVE_SECURE_ADDR_MASK (~0x3)
65 * This variable needs maintenance if the RAM base is not zero,
66 * or if RAM splits into non-consecutive banks. It also has a
67 * flag indicating the secure memory is marked as secure by MMU.
68 * Flags used: 0x1 secured
71 phys_addr_t secure_ram;
72 unsigned long tlb_allocated;
74 #ifdef CONFIG_RESV_RAM
76 * Reserved RAM for memory resident, eg. Management Complex (MC)
77 * driver which continues to run after U-Boot exits.
82 #ifdef CONFIG_ARCH_OMAP2PLUS
87 #if defined(CONFIG_FSL_LSCH3) && defined(CONFIG_SYS_FSL_HAS_DP_DDR)
88 unsigned long mem2_clk;
91 #ifdef CONFIG_ARCH_IMX8
92 struct udevice *scu_dev;
96 struct udevice *ele_dev;
102 #ifdef CONFIG_ARCH_IMX8ULP
103 bool m33_handshake_done;
107 #include <asm-generic/global_data.h>
109 #if defined(__clang__) || defined(LTO_ENABLE)
111 #define DECLARE_GLOBAL_DATA_PTR
114 static inline gd_t *get_gd(void)
119 __asm__ volatile("mov %0, x18\n" : "=r" (gd_ptr));
121 __asm__ volatile("mov %0, r9\n" : "=r" (gd_ptr));
130 #define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("x18")
132 #define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("r9")
136 static inline void set_gd(volatile gd_t *gd_ptr)
139 __asm__ volatile("ldr x18, %0\n" : : "m"(gd_ptr));
140 #elif __ARM_ARCH >= 7
141 __asm__ volatile("ldr r9, %0\n" : : "m"(gd_ptr));
143 __asm__ volatile("mov r9, %0\n" : : "r"(gd_ptr));
147 #endif /* __ASSEMBLY__ */
149 #endif /* __ASM_GBL_DATA_H */