Merge branch 'fixes' of git://git.armlinux.org.uk/~rmk/linux-arm

Pull ARM fixes from Russell King:
"These are a number of updates to fix a few problems found in the ARM
nommu code over the last couple of years, caused mostly by changes on
the mmu side"

* 'fixes' of git://git.armlinux.org.uk/~rmk/linux-arm:
ARM: 8573/1: domain: move {set,get}_domain under config guard
ARM: 8572/1: nommu: change memory reserve for the vectors
ARM: 8571/1: nommu: fix PMSAv7 setup

Changed files
+20 -8
arch
arm
include
asm
kernel
mm
+11
arch/arm/include/asm/domain.h
··· 84 84 85 85 #ifndef __ASSEMBLY__ 86 86 87 + #ifdef CONFIG_CPU_CP15_MMU 87 88 static inline unsigned int get_domain(void) 88 89 { 89 90 unsigned int domain; ··· 104 103 : : "r" (val) : "memory"); 105 104 isb(); 106 105 } 106 + #else 107 + static inline unsigned int get_domain(void) 108 + { 109 + return 0; 110 + } 111 + 112 + static inline void set_domain(unsigned val) 113 + { 114 + } 115 + #endif 107 116 108 117 #ifdef CONFIG_CPU_USE_DOMAINS 109 118 #define modify_domain(dom,type) \
+1 -1
arch/arm/kernel/head-nommu.S
··· 236 236 mov r0, #CONFIG_VECTORS_BASE @ Cover from VECTORS_BASE 237 237 ldr r5,=(MPU_AP_PL1RW_PL0NA | MPU_RGN_NORMAL) 238 238 /* Writing N to bits 5:1 (RSR_SZ) --> region size 2^N+1 */ 239 - mov r6, #(((PAGE_SHIFT - 1) << MPU_RSR_SZ) | 1 << MPU_RSR_EN) 239 + mov r6, #(((2 * PAGE_SHIFT - 1) << MPU_RSR_SZ) | 1 << MPU_RSR_EN) 240 240 241 241 setup_region r0, r5, r6, MPU_DATA_SIDE @ VECTORS_BASE, PL0 NA, enabled 242 242 beq 3f @ Memory-map not unified
+8 -7
arch/arm/mm/nommu.c
··· 87 87 /* MPU initialisation functions */ 88 88 void __init sanity_check_meminfo_mpu(void) 89 89 { 90 - int i; 91 90 phys_addr_t phys_offset = PHYS_OFFSET; 92 91 phys_addr_t aligned_region_size, specified_mem_size, rounded_mem_size; 93 92 struct memblock_region *reg; ··· 109 110 } else { 110 111 /* 111 112 * memblock auto merges contiguous blocks, remove 112 - * all blocks afterwards 113 + * all blocks afterwards in one go (we can't remove 114 + * blocks separately while iterating) 113 115 */ 114 116 pr_notice("Ignoring RAM after %pa, memory at %pa ignored\n", 115 - &mem_start, &reg->base); 116 - memblock_remove(reg->base, reg->size); 117 + &mem_end, &reg->base); 118 + memblock_remove(reg->base, 0 - reg->base); 119 + break; 117 120 } 118 121 } 119 122 ··· 145 144 pr_warn("Truncating memory from %pa to %pa (MPU region constraints)", 146 145 &specified_mem_size, &aligned_region_size); 147 146 memblock_remove(mem_start + aligned_region_size, 148 - specified_mem_size - aligned_round_size); 147 + specified_mem_size - aligned_region_size); 149 148 150 149 mem_end = mem_start + aligned_region_size; 151 150 } ··· 262 261 return; 263 262 264 263 region_err = mpu_setup_region(MPU_RAM_REGION, PHYS_OFFSET, 265 - ilog2(meminfo.bank[0].size), 264 + ilog2(memblock.memory.regions[0].size), 266 265 MPU_AP_PL1RW_PL0RW | MPU_RGN_NORMAL); 267 266 if (region_err) { 268 267 panic("MPU region initialization failure! %d", region_err); ··· 286 285 * some architectures which the DRAM is the exception vector to trap, 287 286 * alloc_page breaks with error, although it is not NULL, but "0." 288 287 */ 289 - memblock_reserve(CONFIG_VECTORS_BASE, PAGE_SIZE); 288 + memblock_reserve(CONFIG_VECTORS_BASE, 2 * PAGE_SIZE); 290 289 #else /* ifndef CONFIG_CPU_V7M */ 291 290 /* 292 291 * There is no dedicated vector page on V7-M. So nothing needs to be