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 a81b1061df9ff4e9a5a585b32c8f55c37ece659c..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;
@@ -113,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 */