]>
git.ipfire.org Git - thirdparty/u-boot.git/blob - arch/arm/include/asm/global_data.h
2bb978d668396081c36914359d51c7cdb7457800
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 <linux/types.h>
16 /* Architecture-specific global data */
17 struct arch_global_data
{
18 #if defined(CONFIG_FSL_ESDHC) || defined(CONFIG_FSL_ESDHC_IMX)
22 #if defined(CONFIG_FSL_ESDHC)
26 #if defined(CONFIG_U_QE)
31 #endif /* CONFIG_U_QE */
33 #ifdef CONFIG_AT91FAMILY
34 /* "static data" needed by at91's clock.c */
35 unsigned long cpu_clk_rate_hz
;
36 unsigned long main_clk_rate_hz
;
37 unsigned long mck_rate_hz
;
38 unsigned long plla_rate_hz
;
39 unsigned long pllb_rate_hz
;
40 unsigned long at91_pllb_usb_init
;
42 /* "static data" needed by most of timer.c on ARM platforms */
43 unsigned long timer_rate_hz
;
46 unsigned long lastinc
;
47 unsigned long long timer_reset_value
;
48 #if !(CONFIG_IS_ENABLED(SYS_ICACHE_OFF) && CONFIG_IS_ENABLED(SYS_DCACHE_OFF))
49 unsigned long tlb_addr
;
50 unsigned long tlb_size
;
51 #if defined(CONFIG_ARM64)
52 unsigned long tlb_fillptr
;
53 unsigned long tlb_emerg
;
56 #ifdef CFG_SYS_MEM_RESERVE_SECURE
57 #define MEM_RESERVE_SECURE_SECURED 0x1
58 #define MEM_RESERVE_SECURE_MAINTAINED 0x2
59 #define MEM_RESERVE_SECURE_ADDR_MASK (~0x3)
62 * This variable needs maintenance if the RAM base is not zero,
63 * or if RAM splits into non-consecutive banks. It also has a
64 * flag indicating the secure memory is marked as secure by MMU.
65 * Flags used: 0x1 secured
68 phys_addr_t secure_ram
;
69 unsigned long tlb_allocated
;
71 #ifdef CONFIG_RESV_RAM
73 * Reserved RAM for memory resident, eg. Management Complex (MC)
74 * driver which continues to run after U-Boot exits.
79 #ifdef CONFIG_ARCH_OMAP2PLUS
84 #if defined(CONFIG_FSL_LSCH3) && defined(CONFIG_SYS_FSL_HAS_DP_DDR)
85 unsigned long mem2_clk
;
88 #ifdef CONFIG_ARCH_IMX8
89 struct udevice
*scu_dev
;
93 struct udevice
*ele_dev
;
99 #ifdef CONFIG_ARCH_IMX8ULP
100 bool m33_handshake_done
;
103 ulong smbios_start
; /* Start address of SMBIOS table */
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 */