diff options
| -rw-r--r-- | arch/arm/include/asm/memory.h | 31 | ||||
| -rw-r--r-- | arch/arm/kernel/head-nommu.S | 4 | ||||
| -rw-r--r-- | arch/arm/kernel/head.S | 2 |
3 files changed, 17 insertions, 20 deletions
diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h index 9ecccc865046..6976b03e5213 100644 --- a/arch/arm/include/asm/memory.h +++ b/arch/arm/include/asm/memory.h | |||
| @@ -100,23 +100,19 @@ | |||
| 100 | #define TASK_UNMAPPED_BASE UL(0x00000000) | 100 | #define TASK_UNMAPPED_BASE UL(0x00000000) |
| 101 | #endif | 101 | #endif |
| 102 | 102 | ||
| 103 | #ifndef PHYS_OFFSET | ||
| 104 | #define PHYS_OFFSET UL(CONFIG_DRAM_BASE) | ||
| 105 | #endif | ||
| 106 | |||
| 107 | #ifndef END_MEM | 103 | #ifndef END_MEM |
| 108 | #define END_MEM (UL(CONFIG_DRAM_BASE) + CONFIG_DRAM_SIZE) | 104 | #define END_MEM (UL(CONFIG_DRAM_BASE) + CONFIG_DRAM_SIZE) |
| 109 | #endif | 105 | #endif |
| 110 | 106 | ||
| 111 | #ifndef PAGE_OFFSET | 107 | #ifndef PAGE_OFFSET |
| 112 | #define PAGE_OFFSET (PHYS_OFFSET) | 108 | #define PAGE_OFFSET PLAT_PHYS_OFFSET |
| 113 | #endif | 109 | #endif |
| 114 | 110 | ||
| 115 | /* | 111 | /* |
| 116 | * The module can be at any place in ram in nommu mode. | 112 | * The module can be at any place in ram in nommu mode. |
| 117 | */ | 113 | */ |
| 118 | #define MODULES_END (END_MEM) | 114 | #define MODULES_END (END_MEM) |
| 119 | #define MODULES_VADDR (PHYS_OFFSET) | 115 | #define MODULES_VADDR PAGE_OFFSET |
| 120 | 116 | ||
| 121 | #define XIP_VIRT_ADDR(physaddr) (physaddr) | 117 | #define XIP_VIRT_ADDR(physaddr) (physaddr) |
| 122 | 118 | ||
| @@ -157,6 +153,16 @@ | |||
| 157 | #endif | 153 | #endif |
| 158 | #define ARCH_PGD_MASK ((1 << ARCH_PGD_SHIFT) - 1) | 154 | #define ARCH_PGD_MASK ((1 << ARCH_PGD_SHIFT) - 1) |
| 159 | 155 | ||
| 156 | /* | ||
| 157 | * PLAT_PHYS_OFFSET is the offset (from zero) of the start of physical | ||
| 158 | * memory. This is used for XIP and NoMMU kernels, or by kernels which | ||
| 159 | * have their own mach/memory.h. Assembly code must always use | ||
| 160 | * PLAT_PHYS_OFFSET and not PHYS_OFFSET. | ||
| 161 | */ | ||
| 162 | #ifndef PLAT_PHYS_OFFSET | ||
| 163 | #define PLAT_PHYS_OFFSET UL(CONFIG_PHYS_OFFSET) | ||
| 164 | #endif | ||
| 165 | |||
| 160 | #ifndef __ASSEMBLY__ | 166 | #ifndef __ASSEMBLY__ |
| 161 | 167 | ||
| 162 | /* | 168 | /* |
| @@ -239,6 +245,8 @@ static inline unsigned long __phys_to_virt(phys_addr_t x) | |||
| 239 | 245 | ||
| 240 | #else | 246 | #else |
| 241 | 247 | ||
| 248 | #define PHYS_OFFSET PLAT_PHYS_OFFSET | ||
| 249 | |||
| 242 | static inline phys_addr_t __virt_to_phys(unsigned long x) | 250 | static inline phys_addr_t __virt_to_phys(unsigned long x) |
| 243 | { | 251 | { |
| 244 | return (phys_addr_t)x - PAGE_OFFSET + PHYS_OFFSET; | 252 | return (phys_addr_t)x - PAGE_OFFSET + PHYS_OFFSET; |
| @@ -251,17 +259,6 @@ static inline unsigned long __phys_to_virt(phys_addr_t x) | |||
| 251 | 259 | ||
| 252 | #endif | 260 | #endif |
| 253 | #endif | 261 | #endif |
| 254 | #endif /* __ASSEMBLY__ */ | ||
| 255 | |||
| 256 | #ifndef PHYS_OFFSET | ||
| 257 | #ifdef PLAT_PHYS_OFFSET | ||
| 258 | #define PHYS_OFFSET PLAT_PHYS_OFFSET | ||
| 259 | #else | ||
| 260 | #define PHYS_OFFSET UL(CONFIG_PHYS_OFFSET) | ||
| 261 | #endif | ||
| 262 | #endif | ||
| 263 | |||
| 264 | #ifndef __ASSEMBLY__ | ||
| 265 | 262 | ||
| 266 | /* | 263 | /* |
| 267 | * PFNs are used to describe any physical page; this means | 264 | * PFNs are used to describe any physical page; this means |
diff --git a/arch/arm/kernel/head-nommu.S b/arch/arm/kernel/head-nommu.S index 14235ba64a90..716249cc2ee1 100644 --- a/arch/arm/kernel/head-nommu.S +++ b/arch/arm/kernel/head-nommu.S | |||
| @@ -68,7 +68,7 @@ ENTRY(stext) | |||
| 68 | 68 | ||
| 69 | #ifdef CONFIG_ARM_MPU | 69 | #ifdef CONFIG_ARM_MPU |
| 70 | /* Calculate the size of a region covering just the kernel */ | 70 | /* Calculate the size of a region covering just the kernel */ |
| 71 | ldr r5, =PHYS_OFFSET @ Region start: PHYS_OFFSET | 71 | ldr r5, =PLAT_PHYS_OFFSET @ Region start: PHYS_OFFSET |
| 72 | ldr r6, =(_end) @ Cover whole kernel | 72 | ldr r6, =(_end) @ Cover whole kernel |
| 73 | sub r6, r6, r5 @ Minimum size of region to map | 73 | sub r6, r6, r5 @ Minimum size of region to map |
| 74 | clz r6, r6 @ Region size must be 2^N... | 74 | clz r6, r6 @ Region size must be 2^N... |
| @@ -213,7 +213,7 @@ ENTRY(__setup_mpu) | |||
| 213 | set_region_nr r0, #MPU_RAM_REGION | 213 | set_region_nr r0, #MPU_RAM_REGION |
| 214 | isb | 214 | isb |
| 215 | /* Full access from PL0, PL1, shared for CONFIG_SMP, cacheable */ | 215 | /* Full access from PL0, PL1, shared for CONFIG_SMP, cacheable */ |
| 216 | ldr r0, =PHYS_OFFSET @ RAM starts at PHYS_OFFSET | 216 | ldr r0, =PLAT_PHYS_OFFSET @ RAM starts at PHYS_OFFSET |
| 217 | ldr r5,=(MPU_AP_PL1RW_PL0RW | MPU_RGN_NORMAL) | 217 | ldr r5,=(MPU_AP_PL1RW_PL0RW | MPU_RGN_NORMAL) |
| 218 | 218 | ||
| 219 | setup_region r0, r5, r6, MPU_DATA_SIDE @ PHYS_OFFSET, shared, enabled | 219 | setup_region r0, r5, r6, MPU_DATA_SIDE @ PHYS_OFFSET, shared, enabled |
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S index 11d59b32fb8d..32f317e5828a 100644 --- a/arch/arm/kernel/head.S +++ b/arch/arm/kernel/head.S | |||
| @@ -110,7 +110,7 @@ ENTRY(stext) | |||
| 110 | sub r4, r3, r4 @ (PHYS_OFFSET - PAGE_OFFSET) | 110 | sub r4, r3, r4 @ (PHYS_OFFSET - PAGE_OFFSET) |
| 111 | add r8, r8, r4 @ PHYS_OFFSET | 111 | add r8, r8, r4 @ PHYS_OFFSET |
| 112 | #else | 112 | #else |
| 113 | ldr r8, =PHYS_OFFSET @ always constant in this case | 113 | ldr r8, =PLAT_PHYS_OFFSET @ always constant in this case |
| 114 | #endif | 114 | #endif |
| 115 | 115 | ||
| 116 | /* | 116 | /* |
