]> git.sur5r.net Git - u-boot/blobdiff - arch/arm/include/asm/system.h
arm: mmu: Add missing volatile for reading SCTLR register
[u-boot] / arch / arm / include / asm / system.h
index 760e8ab1c8c19a7acb1a2336037e009937b8733a..cfc7834ed9dd012b8550a358babddc7f991e9666 100644 (file)
 #define CR_EE          (1 << 25)       /* Exception (Big) Endian       */
 
 #define PGTABLE_SIZE   (0x10000)
+/* 2MB granularity */
+#define MMU_SECTION_SHIFT      21
 
 #ifndef __ASSEMBLY__
 
+enum dcache_option {
+       DCACHE_OFF = 0x3,
+};
+
 #define isb()                          \
        ({asm volatile(                 \
        "isb" : : : "memory");          \
@@ -188,7 +194,7 @@ void save_boot_params_ret(void);
 static inline unsigned int get_cr(void)
 {
        unsigned int val;
-       asm("mrc p15, 0, %0, c1, c0, 0  @ get CR" : "=r" (val) : : "cc");
+       asm volatile("mrc p15, 0, %0, c1, c0, 0 @ get CR" : "=r" (val) : : "cc");
        return val;
 }
 
@@ -264,16 +270,6 @@ enum {
 #define TTBR0_IRGN_WB                  (1 << 0 | 1 << 6)
 #endif
 
-/**
- * Change the cache settings for a region.
- *
- * \param start                start address of memory region to change
- * \param size         size of memory region to change
- * \param option       dcache option to select
- */
-void mmu_set_region_dcache_behaviour(phys_addr_t start, size_t size,
-                                    enum dcache_option option);
-
 /**
  * Register an update to the page tables, and flush the TLB
  *
@@ -295,4 +291,17 @@ phys_addr_t noncached_alloc(size_t size, size_t align);
 
 #endif /* CONFIG_ARM64 */
 
+#ifndef __ASSEMBLY__
+/**
+ * Change the cache settings for a region.
+ *
+ * \param start                start address of memory region to change
+ * \param size         size of memory region to change
+ * \param option       dcache option to select
+ */
+void mmu_set_region_dcache_behaviour(phys_addr_t start, size_t size,
+                                    enum dcache_option option);
+
+#endif /* __ASSEMBLY__ */
+
 #endif