Merge tag 'u-boot-atmel-fixes-2020.07-a' of https://gitlab.denx.de/u-boot/custodians...
[oweals/u-boot.git] / arch / arm / include / asm / global_data.h
index 287a7bd5b19cb555abaa88b3c24dd3250afa35ff..7c0905d240eb4fde666929ed2c5d5ee5f6e37894 100644 (file)
@@ -9,10 +9,14 @@
 
 /* Architecture-specific global data */
 struct arch_global_data {
-#if defined(CONFIG_FSL_ESDHC)
+#if defined(CONFIG_FSL_ESDHC) || defined(CONFIG_FSL_ESDHC_IMX)
        u32 sdhc_clk;
 #endif
 
+#if defined(CONFIG_FSL_ESDHC)
+       u32 sdhc_per_clk;
+#endif
+
 #if defined(CONFIG_U_QE)
        u32 qe_clk;
        u32 brg_clk;
@@ -35,7 +39,7 @@ struct arch_global_data {
        unsigned int tbl;
        unsigned long lastinc;
        unsigned long long timer_reset_value;
-#if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF))
+#if !(CONFIG_IS_ENABLED(SYS_ICACHE_OFF) && CONFIG_IS_ENABLED(SYS_DCACHE_OFF))
        unsigned long tlb_addr;
        unsigned long tlb_size;
 #if defined(CONFIG_ARM64)
@@ -74,6 +78,10 @@ struct arch_global_data {
 #if defined(CONFIG_FSL_LSCH3) && defined(CONFIG_SYS_FSL_HAS_DP_DDR)
        unsigned long mem2_clk;
 #endif
+
+#ifdef CONFIG_ARCH_IMX8
+       struct udevice *scu_dev;
+#endif
 };
 
 #include <asm-generic/global_data.h>
@@ -109,4 +117,13 @@ static inline gd_t *get_gd(void)
 #endif
 #endif
 
+static inline void set_gd(volatile gd_t *gd_ptr)
+{
+#ifdef CONFIG_ARM64
+       __asm__ volatile("ldr x18, %0\n" : : "m"(gd_ptr));
+#else
+       __asm__ volatile("ldr r9, %0\n" : : "m"(gd_ptr));
+#endif
+}
+
 #endif /* __ASM_GBL_DATA_H */