Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branches 'arnd-randcfg-fixes', 'debug', 'io' (early part), 'l2x0', 'p2v', 'pgt' (early part) and 'smp' into for-linus

+1282 -721
+44
Documentation/devicetree/bindings/arm/l2cc.txt
··· 1 + * ARM L2 Cache Controller 2 + 3 + ARM cores often have a separate level 2 cache controller. There are various 4 + implementations of the L2 cache controller with compatible programming models. 5 + The ARM L2 cache representation in the device tree should be done as follows: 6 + 7 + Required properties: 8 + 9 + - compatible : should be one of: 10 + "arm,pl310-cache" 11 + "arm,l220-cache" 12 + "arm,l210-cache" 13 + - cache-unified : Specifies the cache is a unified cache. 14 + - cache-level : Should be set to 2 for a level 2 cache. 15 + - reg : Physical base address and size of cache controller's memory mapped 16 + registers. 17 + 18 + Optional properties: 19 + 20 + - arm,data-latency : Cycles of latency for Data RAM accesses. Specifies 3 cells of 21 + read, write and setup latencies. Minimum valid values are 1. Controllers 22 + without setup latency control should use a value of 0. 23 + - arm,tag-latency : Cycles of latency for Tag RAM accesses. Specifies 3 cells of 24 + read, write and setup latencies. Controllers without setup latency control 25 + should use 0. Controllers without separate read and write Tag RAM latency 26 + values should only use the first cell. 27 + - arm,dirty-latency : Cycles of latency for Dirty RAMs. This is a single cell. 28 + - arm,filter-ranges : <start length> Starting address and length of window to 29 + filter. Addresses in the filter window are directed to the M1 port. Other 30 + addresses will go to the M0 port. 31 + - interrupts : 1 combined interrupt. 32 + 33 + Example: 34 + 35 + L2: cache-controller { 36 + compatible = "arm,pl310-cache"; 37 + reg = <0xfff12000 0x1000>; 38 + arm,data-latency = <1 1 1>; 39 + arm,tag-latency = <2 2 2>; 40 + arm,filter-latency = <0x80000000 0x8000000>; 41 + cache-unified; 42 + cache-level = <2>; 43 + interrupts = <45>; 44 + };
+43 -12
arch/arm/Kconfig
··· 3 3 default y 4 4 select HAVE_AOUT 5 5 select HAVE_DMA_API_DEBUG 6 - select HAVE_IDE 6 + select HAVE_IDE if PCI || ISA || PCMCIA 7 7 select HAVE_MEMBLOCK 8 8 select RTC_LIB 9 9 select SYS_SUPPORTS_APM_EMULATION ··· 195 195 The base address of exception vectors. 196 196 197 197 config ARM_PATCH_PHYS_VIRT 198 - bool "Patch physical to virtual translations at runtime" 198 + bool "Patch physical to virtual translations at runtime" if EMBEDDED 199 + default y 199 200 depends on !XIP_KERNEL && MMU 200 201 depends on !ARCH_REALVIEW || !SPARSEMEM 201 202 help ··· 205 204 kernel in system memory. 206 205 207 206 This can only be used with non-XIP MMU kernels where the base 208 - of physical memory is at a 16MB boundary, or theoretically 64K 209 - for the MSM machine class. 207 + of physical memory is at a 16MB boundary. 210 208 211 - config ARM_PATCH_PHYS_VIRT_16BIT 212 - def_bool y 213 - depends on ARM_PATCH_PHYS_VIRT && ARCH_MSM 214 - help 215 - This option extends the physical to virtual translation patching 216 - to allow physical memory down to a theoretical minimum of 64K 217 - boundaries. 209 + Only disable this option if you know that you do not require 210 + this feature (eg, building a kernel for a single machine) and 211 + you need to shrink the kernel to the minimal size. 212 + 218 213 219 214 source "init/Kconfig" 220 215 ··· 298 301 select ARCH_REQUIRE_GPIOLIB 299 302 select HAVE_CLK 300 303 select CLKDEV_LOOKUP 301 - select ARM_PATCH_PHYS_VIRT if MMU 302 304 help 303 305 This enables support for systems based on the Atmel AT91RM9200, 304 306 AT91SAM9 and AT91CAP9 processors. ··· 381 385 select CPU_SA110 382 386 select FOOTBRIDGE 383 387 select GENERIC_CLOCKEVENTS 388 + select HAVE_IDE 384 389 help 385 390 Support for systems based on the DC21285 companion chip 386 391 ("FootBridge"), such as the Simtec CATS and the Rebel NetWinder. ··· 628 631 select SPARSE_IRQ 629 632 select AUTO_ZRELADDR 630 633 select MULTI_IRQ_HANDLER 634 + select ARM_CPU_SUSPEND if PM 635 + select HAVE_IDE 631 636 help 632 637 Support for Intel/Marvell's PXA2xx/PXA3xx processor line. 633 638 ··· 670 671 select NO_IOPORT 671 672 select ARCH_SPARSEMEM_ENABLE 672 673 select ARCH_USES_GETTIMEOFFSET 674 + select HAVE_IDE 673 675 help 674 676 On the Acorn Risc-PC, Linux can support the internal IDE disk and 675 677 CD-ROM interface, serial and parallel port, and the floppy drive. ··· 689 689 select HAVE_SCHED_CLOCK 690 690 select TICK_ONESHOT 691 691 select ARCH_REQUIRE_GPIOLIB 692 + select HAVE_IDE 692 693 help 693 694 Support for StrongARM 11x0 based boards. 694 695 ··· 1376 1375 MACH_REALVIEW_PB11MP || MACH_REALVIEW_PBX || ARCH_OMAP4 || \ 1377 1376 ARCH_EXYNOS4 || ARCH_TEGRA || ARCH_U8500 || ARCH_VEXPRESS_CA9X4 || \ 1378 1377 ARCH_MSM_SCORPIONMP || ARCH_SHMOBILE 1378 + depends on MMU 1379 1379 select USE_GENERIC_SMP_HELPERS 1380 1380 select HAVE_ARM_SCU if !ARCH_MSM_SCORPIONMP 1381 1381 help ··· 1408 1406 savings. 1409 1407 1410 1408 If you don't know what to do here, say Y. 1409 + 1410 + config ARM_CPU_TOPOLOGY 1411 + bool "Support cpu topology definition" 1412 + depends on SMP && CPU_V7 1413 + default y 1414 + help 1415 + Support ARM cpu topology definition. The MPIDR register defines 1416 + affinity between processors which is then used to describe the cpu 1417 + topology of an ARM System. 1418 + 1419 + config SCHED_MC 1420 + bool "Multi-core scheduler support" 1421 + depends on ARM_CPU_TOPOLOGY 1422 + help 1423 + Multi-core scheduler support improves the CPU scheduler's decision 1424 + making when dealing with multi-core CPU chips at a cost of slightly 1425 + increased overhead in some places. If unsure say N here. 1426 + 1427 + config SCHED_SMT 1428 + bool "SMT scheduler support" 1429 + depends on ARM_CPU_TOPOLOGY 1430 + help 1431 + Improves the CPU scheduler's decision making when dealing with 1432 + MultiThreading at a cost of slightly increased overhead in some 1433 + places. If unsure say N here. 1411 1434 1412 1435 config HAVE_ARM_SCU 1413 1436 bool ··· 1509 1482 depends on CPU_V7 && !CPU_V6 && !CPU_V6K && EXPERIMENTAL 1510 1483 select AEABI 1511 1484 select ARM_ASM_UNIFIED 1485 + select ARM_UNWIND 1512 1486 help 1513 1487 By enabling this option, the kernel will be compiled in 1514 1488 Thumb-2 mode. A compiler/assembler that understand the unified ··· 2128 2100 depends on CPU_ARM920T || CPU_ARM926T || CPU_SA1100 || \ 2129 2101 CPU_V6 || CPU_V6K || CPU_V7 || CPU_XSC3 || CPU_XSCALE 2130 2102 def_bool y 2103 + 2104 + config ARM_CPU_SUSPEND 2105 + def_bool PM_SLEEP 2131 2106 2132 2107 endmenu 2133 2108
+60 -31
arch/arm/Kconfig.debug
··· 65 65 66 66 # These options are only for real kernel hackers who want to get their hands dirty. 67 67 config DEBUG_LL 68 - bool "Kernel low-level debugging functions" 68 + bool "Kernel low-level debugging functions (read help!)" 69 69 depends on DEBUG_KERNEL 70 70 help 71 71 Say Y here to include definitions of printascii, printch, printhex 72 72 in the kernel. This is helpful if you are debugging code that 73 73 executes before the console is initialized. 74 + 75 + Note that selecting this option will limit the kernel to a single 76 + UART definition, as specified below. Attempting to boot the kernel 77 + image on a different platform *will not work*, so this option should 78 + not be enabled for kernels that are intended to be portable. 79 + 80 + choice 81 + prompt "Kernel low-level debugging port" 82 + depends on DEBUG_LL 83 + 84 + config DEBUG_LL_UART_NONE 85 + bool "No low-level debugging UART" 86 + help 87 + Say Y here if your platform doesn't provide a UART option 88 + below. This relies on your platform choosing the right UART 89 + definition internally in order for low-level debugging to 90 + work. 91 + 92 + config DEBUG_ICEDCC 93 + bool "Kernel low-level debugging via EmbeddedICE DCC channel" 94 + help 95 + Say Y here if you want the debug print routines to direct 96 + their output to the EmbeddedICE macrocell's DCC channel using 97 + co-processor 14. This is known to work on the ARM9 style ICE 98 + channel and on the XScale with the PEEDI. 99 + 100 + Note that the system will appear to hang during boot if there 101 + is nothing connected to read from the DCC. 102 + 103 + config DEBUG_FOOTBRIDGE_COM1 104 + bool "Kernel low-level debugging messages via footbridge 8250 at PCI COM1" 105 + depends on FOOTBRIDGE 106 + help 107 + Say Y here if you want the debug print routines to direct 108 + their output to the 8250 at PCI COM1. 109 + 110 + config DEBUG_DC21285_PORT 111 + bool "Kernel low-level debugging messages via footbridge serial port" 112 + depends on FOOTBRIDGE 113 + help 114 + Say Y here if you want the debug print routines to direct 115 + their output to the serial port in the DC21285 (Footbridge). 116 + 117 + config DEBUG_CLPS711X_UART1 118 + bool "Kernel low-level debugging messages via UART1" 119 + depends on ARCH_CLPS711X 120 + help 121 + Say Y here if you want the debug print routines to direct 122 + their output to the first serial port on these devices. 123 + 124 + config DEBUG_CLPS711X_UART2 125 + bool "Kernel low-level debugging messages via UART2" 126 + depends on ARCH_CLPS711X 127 + help 128 + Say Y here if you want the debug print routines to direct 129 + their output to the second serial port on these devices. 130 + 131 + endchoice 74 132 75 133 config EARLY_PRINTK 76 134 bool "Early printk" ··· 138 80 kernel low-level debugging functions. Add earlyprintk to your 139 81 kernel parameters to enable this console. 140 82 141 - config DEBUG_ICEDCC 142 - bool "Kernel low-level debugging via EmbeddedICE DCC channel" 143 - depends on DEBUG_LL 144 - help 145 - Say Y here if you want the debug print routines to direct their 146 - output to the EmbeddedICE macrocell's DCC channel using 147 - co-processor 14. This is known to work on the ARM9 style ICE 148 - channel and on the XScale with the PEEDI. 149 - 150 - It does include a timeout to ensure that the system does not 151 - totally freeze when there is nothing connected to read. 152 - 153 83 config OC_ETM 154 84 bool "On-chip ETM and ETB" 155 - select ARM_AMBA 85 + depends on ARM_AMBA 156 86 help 157 87 Enables the on-chip embedded trace macrocell and embedded trace 158 88 buffer driver that will allow you to collect traces of the 159 89 kernel code. 160 - 161 - config DEBUG_DC21285_PORT 162 - bool "Kernel low-level debugging messages via footbridge serial port" 163 - depends on DEBUG_LL && FOOTBRIDGE 164 - help 165 - Say Y here if you want the debug print routines to direct their 166 - output to the serial port in the DC21285 (Footbridge). Saying N 167 - will cause the debug messages to appear on the first 16550 168 - serial port. 169 - 170 - config DEBUG_CLPS711X_UART2 171 - bool "Kernel low-level debugging messages via UART2" 172 - depends on DEBUG_LL && ARCH_CLPS711X 173 - help 174 - Say Y here if you want the debug print routines to direct their 175 - output to the second serial port on these devices. Saying N will 176 - cause the debug messages to appear on the first serial port. 177 90 178 91 config DEBUG_S3C_UART 179 92 depends on PLAT_SAMSUNG
+3
arch/arm/Makefile
··· 128 128 ifeq ($(CONFIG_ARCH_SA1100),y) 129 129 textofs-$(CONFIG_SA1111) := 0x00208000 130 130 endif 131 + textofs-$(CONFIG_ARCH_MSM7X30) := 0x00208000 132 + textofs-$(CONFIG_ARCH_MSM8X60) := 0x00208000 133 + textofs-$(CONFIG_ARCH_MSM8960) := 0x00208000 131 134 132 135 # Machine directory name. This list is sorted alphanumerically 133 136 # by CONFIG_* macro name.
+14 -3
arch/arm/common/gic.c
··· 180 180 return -EINVAL; 181 181 182 182 mask = 0xff << shift; 183 - bit = 1 << (cpu + shift); 183 + bit = 1 << (cpu_logical_map(cpu) + shift); 184 184 185 185 spin_lock(&irq_controller_lock); 186 186 val = readl_relaxed(reg) & ~mask; ··· 259 259 unsigned int irq_start) 260 260 { 261 261 unsigned int gic_irqs, irq_limit, i; 262 + u32 cpumask; 262 263 void __iomem *base = gic->dist_base; 263 - u32 cpumask = 1 << smp_processor_id(); 264 + u32 cpu = 0; 264 265 266 + #ifdef CONFIG_SMP 267 + cpu = cpu_logical_map(smp_processor_id()); 268 + #endif 269 + 270 + cpumask = 1 << cpu; 265 271 cpumask |= cpumask << 8; 266 272 cpumask |= cpumask << 16; 267 273 ··· 388 382 #ifdef CONFIG_SMP 389 383 void gic_raise_softirq(const struct cpumask *mask, unsigned int irq) 390 384 { 391 - unsigned long map = *cpus_addr(*mask); 385 + int cpu; 386 + unsigned long map = 0; 387 + 388 + /* Convert our logical CPU mask into a physical one. */ 389 + for_each_cpu(cpu, mask) 390 + map |= 1 << cpu_logical_map(cpu); 392 391 393 392 /* 394 393 * Ensure that stores to Normal memory are visible to the
+2 -1
arch/arm/common/vic.c
··· 346 346 347 347 /* Identify which VIC cell this one is, by reading the ID */ 348 348 for (i = 0; i < 4; i++) { 349 - u32 addr = ((u32)base & PAGE_MASK) + 0xfe0 + (i * 4); 349 + void __iomem *addr; 350 + addr = (void __iomem *)((u32)base & PAGE_MASK) + 0xfe0 + (i * 4); 350 351 cellid |= (readl(addr) & 0xff) << (8 * i); 351 352 } 352 353 vendor = (cellid >> 12) & 0xff;
+6
arch/arm/include/asm/cputype.h
··· 8 8 #define CPUID_CACHETYPE 1 9 9 #define CPUID_TCM 2 10 10 #define CPUID_TLBTYPE 3 11 + #define CPUID_MPIDR 5 11 12 12 13 #define CPUID_EXT_PFR0 "c1, 0" 13 14 #define CPUID_EXT_PFR1 "c1, 1" ··· 69 68 static inline unsigned int __attribute_const__ read_cpuid_tcmstatus(void) 70 69 { 71 70 return read_cpuid(CPUID_TCM); 71 + } 72 + 73 + static inline unsigned int __attribute_const__ read_cpuid_mpidr(void) 74 + { 75 + return read_cpuid(CPUID_MPIDR); 72 76 } 73 77 74 78 /*
+1 -1
arch/arm/include/asm/dma-mapping.h
··· 32 32 33 33 static inline void *dma_to_virt(struct device *dev, dma_addr_t addr) 34 34 { 35 - return (void *)__bus_to_virt(addr); 35 + return (void *)__bus_to_virt((unsigned long)addr); 36 36 } 37 37 38 38 static inline dma_addr_t virt_to_dma(struct device *dev, void *addr)
-1
arch/arm/include/asm/ecard.h
··· 161 161 162 162 /* Private internal data */ 163 163 const char *card_desc; /* Card description */ 164 - CONST unsigned int podaddr; /* Base Linux address for card */ 165 164 CONST loader_t loader; /* loader program */ 166 165 u64 dma_mask; 167 166 };
+19
arch/arm/include/asm/exception.h
··· 1 + /* 2 + * Annotations for marking C functions as exception handlers. 3 + * 4 + * These should only be used for C functions that are called from the low 5 + * level exception entry code and not any intervening C code. 6 + */ 7 + #ifndef __ASM_ARM_EXCEPTION_H 8 + #define __ASM_ARM_EXCEPTION_H 9 + 10 + #include <linux/ftrace.h> 11 + 12 + #define __exception __attribute__((section(".exception.text"))) 13 + #ifdef CONFIG_FUNCTION_GRAPH_TRACER 14 + #define __exception_irq_entry __irq_entry 15 + #else 16 + #define __exception_irq_entry __exception 17 + #endif 18 + 19 + #endif /* __ASM_ARM_EXCEPTION_H */
+42
arch/arm/include/asm/hardware/cache-l2x0.h
··· 52 52 #define L2X0_LOCKDOWN_WAY_D_BASE 0x900 53 53 #define L2X0_LOCKDOWN_WAY_I_BASE 0x904 54 54 #define L2X0_LOCKDOWN_STRIDE 0x08 55 + #define L2X0_ADDR_FILTER_START 0xC00 56 + #define L2X0_ADDR_FILTER_END 0xC04 55 57 #define L2X0_TEST_OPERATION 0xF00 56 58 #define L2X0_LINE_DATA 0xF10 57 59 #define L2X0_LINE_TAG 0xF30 ··· 67 65 #define L2X0_CACHE_ID_PART_MASK (0xf << 6) 68 66 #define L2X0_CACHE_ID_PART_L210 (1 << 6) 69 67 #define L2X0_CACHE_ID_PART_L310 (3 << 6) 68 + #define L2X0_CACHE_ID_RTL_MASK 0x3f 69 + #define L2X0_CACHE_ID_RTL_R0P0 0x0 70 + #define L2X0_CACHE_ID_RTL_R1P0 0x2 71 + #define L2X0_CACHE_ID_RTL_R2P0 0x4 72 + #define L2X0_CACHE_ID_RTL_R3P0 0x5 73 + #define L2X0_CACHE_ID_RTL_R3P1 0x6 74 + #define L2X0_CACHE_ID_RTL_R3P2 0x8 70 75 71 76 #define L2X0_AUX_CTRL_MASK 0xc0000fff 77 + #define L2X0_AUX_CTRL_DATA_RD_LATENCY_SHIFT 0 78 + #define L2X0_AUX_CTRL_DATA_RD_LATENCY_MASK 0x7 79 + #define L2X0_AUX_CTRL_DATA_WR_LATENCY_SHIFT 3 80 + #define L2X0_AUX_CTRL_DATA_WR_LATENCY_MASK (0x7 << 3) 81 + #define L2X0_AUX_CTRL_TAG_LATENCY_SHIFT 6 82 + #define L2X0_AUX_CTRL_TAG_LATENCY_MASK (0x7 << 6) 83 + #define L2X0_AUX_CTRL_DIRTY_LATENCY_SHIFT 9 84 + #define L2X0_AUX_CTRL_DIRTY_LATENCY_MASK (0x7 << 9) 72 85 #define L2X0_AUX_CTRL_ASSOCIATIVITY_SHIFT 16 73 86 #define L2X0_AUX_CTRL_WAY_SIZE_SHIFT 17 74 87 #define L2X0_AUX_CTRL_WAY_SIZE_MASK (0x7 << 17) ··· 94 77 #define L2X0_AUX_CTRL_INSTR_PREFETCH_SHIFT 29 95 78 #define L2X0_AUX_CTRL_EARLY_BRESP_SHIFT 30 96 79 80 + #define L2X0_LATENCY_CTRL_SETUP_SHIFT 0 81 + #define L2X0_LATENCY_CTRL_RD_SHIFT 4 82 + #define L2X0_LATENCY_CTRL_WR_SHIFT 8 83 + 84 + #define L2X0_ADDR_FILTER_EN 1 85 + 97 86 #ifndef __ASSEMBLY__ 98 87 extern void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask); 88 + extern int l2x0_of_init(__u32 aux_val, __u32 aux_mask); 89 + 90 + struct l2x0_regs { 91 + unsigned long phy_base; 92 + unsigned long aux_ctrl; 93 + /* 94 + * Whether the following registers need to be saved/restored 95 + * depends on platform 96 + */ 97 + unsigned long tag_latency; 98 + unsigned long data_latency; 99 + unsigned long filter_start; 100 + unsigned long filter_end; 101 + unsigned long prefetch_ctrl; 102 + unsigned long pwr_ctrl; 103 + }; 104 + 105 + extern struct l2x0_regs l2x0_saved_regs; 106 + 99 107 #endif 100 108 101 109 #endif
+27
arch/arm/include/asm/io.h
··· 110 110 #include <mach/io.h> 111 111 112 112 /* 113 + * This is the limit of PC card/PCI/ISA IO space, which is by default 114 + * 64K if we have PC card, PCI or ISA support. Otherwise, default to 115 + * zero to prevent ISA/PCI drivers claiming IO space (and potentially 116 + * oopsing.) 117 + * 118 + * Only set this larger if you really need inb() et.al. to operate over 119 + * a larger address space. Note that SOC_COMMON ioremaps each sockets 120 + * IO space area, and so inb() et.al. must be defined to operate as per 121 + * readb() et.al. on such platforms. 122 + */ 123 + #ifndef IO_SPACE_LIMIT 124 + #if defined(CONFIG_PCMCIA_SOC_COMMON) || defined(CONFIG_PCMCIA_SOC_COMMON_MODULE) 125 + #define IO_SPACE_LIMIT ((resource_size_t)0xffffffff) 126 + #elif defined(CONFIG_PCI) || defined(CONFIG_ISA) || defined(CONFIG_PCCARD) 127 + #define IO_SPACE_LIMIT ((resource_size_t)0xffff) 128 + #else 129 + #define IO_SPACE_LIMIT ((resource_size_t)0) 130 + #endif 131 + #endif 132 + 133 + /* 113 134 * IO port access primitives 114 135 * ------------------------- 115 136 * ··· 281 260 #define ioread16(p) ({ unsigned int __v = le16_to_cpu((__force __le16)__raw_readw(p)); __iormb(); __v; }) 282 261 #define ioread32(p) ({ unsigned int __v = le32_to_cpu((__force __le32)__raw_readl(p)); __iormb(); __v; }) 283 262 263 + #define ioread16be(p) ({ unsigned int __v = be16_to_cpu((__force __be16)__raw_readw(p)); __iormb(); __v; }) 264 + #define ioread32be(p) ({ unsigned int __v = be32_to_cpu((__force __be32)__raw_readl(p)); __iormb(); __v; }) 265 + 284 266 #define iowrite8(v,p) ({ __iowmb(); (void)__raw_writeb(v, p); }) 285 267 #define iowrite16(v,p) ({ __iowmb(); (void)__raw_writew((__force __u16)cpu_to_le16(v), p); }) 286 268 #define iowrite32(v,p) ({ __iowmb(); (void)__raw_writel((__force __u32)cpu_to_le32(v), p); }) 269 + 270 + #define iowrite16be(v,p) ({ __iowmb(); (void)__raw_writew((__force __u16)cpu_to_be16(v), p); }) 271 + #define iowrite32be(v,p) ({ __iowmb(); (void)__raw_writel((__force __u32)cpu_to_be32(v), p); }) 287 272 288 273 #define ioread8_rep(p,d,c) __raw_readsb(p,d,c) 289 274 #define ioread16_rep(p,d,c) __raw_readsw(p,d,c)
+4
arch/arm/include/asm/localtimer.h
··· 24 24 */ 25 25 asmlinkage void do_local_timer(struct pt_regs *); 26 26 27 + /* 28 + * Called from C code 29 + */ 30 + void handle_local_timer(struct pt_regs *); 27 31 28 32 #ifdef CONFIG_LOCAL_TIMERS 29 33
-7
arch/arm/include/asm/memory.h
··· 160 160 * so that all we need to do is modify the 8-bit constant field. 161 161 */ 162 162 #define __PV_BITS_31_24 0x81000000 163 - #define __PV_BITS_23_16 0x00810000 164 163 165 164 extern unsigned long __pv_phys_offset; 166 165 #define PHYS_OFFSET __pv_phys_offset ··· 177 178 { 178 179 unsigned long t; 179 180 __pv_stub(x, t, "add", __PV_BITS_31_24); 180 - #ifdef CONFIG_ARM_PATCH_PHYS_VIRT_16BIT 181 - __pv_stub(t, t, "add", __PV_BITS_23_16); 182 - #endif 183 181 return t; 184 182 } 185 183 ··· 184 188 { 185 189 unsigned long t; 186 190 __pv_stub(x, t, "sub", __PV_BITS_31_24); 187 - #ifdef CONFIG_ARM_PATCH_PHYS_VIRT_16BIT 188 - __pv_stub(t, t, "sub", __PV_BITS_23_16); 189 - #endif 190 191 return t; 191 192 } 192 193 #else
-4
arch/arm/include/asm/module.h
··· 31 31 32 32 /* Add __virt_to_phys patching state as well */ 33 33 #ifdef CONFIG_ARM_PATCH_PHYS_VIRT 34 - #ifdef CONFIG_ARM_PATCH_PHYS_VIRT_16BIT 35 - #define MODULE_ARCH_VERMAGIC_P2V "p2v16 " 36 - #else 37 34 #define MODULE_ARCH_VERMAGIC_P2V "p2v8 " 38 - #endif 39 35 #else 40 36 #define MODULE_ARCH_VERMAGIC_P2V "" 41 37 #endif
+7
arch/arm/include/asm/outercache.h
··· 34 34 void (*sync)(void); 35 35 #endif 36 36 void (*set_debug)(unsigned long); 37 + void (*resume)(void); 37 38 }; 38 39 39 40 #ifdef CONFIG_OUTER_CACHE ··· 73 72 { 74 73 if (outer_cache.disable) 75 74 outer_cache.disable(); 75 + } 76 + 77 + static inline void outer_resume(void) 78 + { 79 + if (outer_cache.resume) 80 + outer_cache.resume(); 76 81 } 77 82 78 83 #else
+1 -41
arch/arm/include/asm/page.h
··· 151 151 #define clear_page(page) memset((void *)(page), 0, PAGE_SIZE) 152 152 extern void copy_page(void *to, const void *from); 153 153 154 - typedef unsigned long pteval_t; 155 - 156 - #undef STRICT_MM_TYPECHECKS 157 - 158 - #ifdef STRICT_MM_TYPECHECKS 159 - /* 160 - * These are used to make use of C type-checking.. 161 - */ 162 - typedef struct { pteval_t pte; } pte_t; 163 - typedef struct { unsigned long pmd; } pmd_t; 164 - typedef struct { unsigned long pgd[2]; } pgd_t; 165 - typedef struct { unsigned long pgprot; } pgprot_t; 166 - 167 - #define pte_val(x) ((x).pte) 168 - #define pmd_val(x) ((x).pmd) 169 - #define pgd_val(x) ((x).pgd[0]) 170 - #define pgprot_val(x) ((x).pgprot) 171 - 172 - #define __pte(x) ((pte_t) { (x) } ) 173 - #define __pmd(x) ((pmd_t) { (x) } ) 174 - #define __pgprot(x) ((pgprot_t) { (x) } ) 175 - 176 - #else 177 - /* 178 - * .. while these make it easier on the compiler 179 - */ 180 - typedef pteval_t pte_t; 181 - typedef unsigned long pmd_t; 182 - typedef unsigned long pgd_t[2]; 183 - typedef unsigned long pgprot_t; 184 - 185 - #define pte_val(x) (x) 186 - #define pmd_val(x) (x) 187 - #define pgd_val(x) ((x)[0]) 188 - #define pgprot_val(x) (x) 189 - 190 - #define __pte(x) (x) 191 - #define __pmd(x) (x) 192 - #define __pgprot(x) (x) 193 - 194 - #endif /* STRICT_MM_TYPECHECKS */ 154 + #include <asm/pgtable-2level-types.h> 195 155 196 156 #endif /* CONFIG_MMU */ 197 157
+2 -2
arch/arm/include/asm/pgalloc.h
··· 105 105 } 106 106 107 107 static inline void __pmd_populate(pmd_t *pmdp, phys_addr_t pte, 108 - unsigned long prot) 108 + pmdval_t prot) 109 109 { 110 - unsigned long pmdval = (pte + PTE_HWTABLE_OFF) | prot; 110 + pmdval_t pmdval = (pte + PTE_HWTABLE_OFF) | prot; 111 111 pmdp[0] = __pmd(pmdval); 112 112 pmdp[1] = __pmd(pmdval + 256 * sizeof(pte_t)); 113 113 flush_pmd_entry(pmdp);
+93
arch/arm/include/asm/pgtable-2level-hwdef.h
··· 1 + /* 2 + * arch/arm/include/asm/pgtable-2level-hwdef.h 3 + * 4 + * Copyright (C) 1995-2002 Russell King 5 + * 6 + * This program is free software; you can redistribute it and/or modify 7 + * it under the terms of the GNU General Public License version 2 as 8 + * published by the Free Software Foundation. 9 + */ 10 + #ifndef _ASM_PGTABLE_2LEVEL_HWDEF_H 11 + #define _ASM_PGTABLE_2LEVEL_HWDEF_H 12 + 13 + /* 14 + * Hardware page table definitions. 15 + * 16 + * + Level 1 descriptor (PMD) 17 + * - common 18 + */ 19 + #define PMD_TYPE_MASK (_AT(pmdval_t, 3) << 0) 20 + #define PMD_TYPE_FAULT (_AT(pmdval_t, 0) << 0) 21 + #define PMD_TYPE_TABLE (_AT(pmdval_t, 1) << 0) 22 + #define PMD_TYPE_SECT (_AT(pmdval_t, 2) << 0) 23 + #define PMD_BIT4 (_AT(pmdval_t, 1) << 4) 24 + #define PMD_DOMAIN(x) (_AT(pmdval_t, (x)) << 5) 25 + #define PMD_PROTECTION (_AT(pmdval_t, 1) << 9) /* v5 */ 26 + /* 27 + * - section 28 + */ 29 + #define PMD_SECT_BUFFERABLE (_AT(pmdval_t, 1) << 2) 30 + #define PMD_SECT_CACHEABLE (_AT(pmdval_t, 1) << 3) 31 + #define PMD_SECT_XN (_AT(pmdval_t, 1) << 4) /* v6 */ 32 + #define PMD_SECT_AP_WRITE (_AT(pmdval_t, 1) << 10) 33 + #define PMD_SECT_AP_READ (_AT(pmdval_t, 1) << 11) 34 + #define PMD_SECT_TEX(x) (_AT(pmdval_t, (x)) << 12) /* v5 */ 35 + #define PMD_SECT_APX (_AT(pmdval_t, 1) << 15) /* v6 */ 36 + #define PMD_SECT_S (_AT(pmdval_t, 1) << 16) /* v6 */ 37 + #define PMD_SECT_nG (_AT(pmdval_t, 1) << 17) /* v6 */ 38 + #define PMD_SECT_SUPER (_AT(pmdval_t, 1) << 18) /* v6 */ 39 + #define PMD_SECT_AF (_AT(pmdval_t, 0)) 40 + 41 + #define PMD_SECT_UNCACHED (_AT(pmdval_t, 0)) 42 + #define PMD_SECT_BUFFERED (PMD_SECT_BUFFERABLE) 43 + #define PMD_SECT_WT (PMD_SECT_CACHEABLE) 44 + #define PMD_SECT_WB (PMD_SECT_CACHEABLE | PMD_SECT_BUFFERABLE) 45 + #define PMD_SECT_MINICACHE (PMD_SECT_TEX(1) | PMD_SECT_CACHEABLE) 46 + #define PMD_SECT_WBWA (PMD_SECT_TEX(1) | PMD_SECT_CACHEABLE | PMD_SECT_BUFFERABLE) 47 + #define PMD_SECT_NONSHARED_DEV (PMD_SECT_TEX(2)) 48 + 49 + /* 50 + * - coarse table (not used) 51 + */ 52 + 53 + /* 54 + * + Level 2 descriptor (PTE) 55 + * - common 56 + */ 57 + #define PTE_TYPE_MASK (_AT(pteval_t, 3) << 0) 58 + #define PTE_TYPE_FAULT (_AT(pteval_t, 0) << 0) 59 + #define PTE_TYPE_LARGE (_AT(pteval_t, 1) << 0) 60 + #define PTE_TYPE_SMALL (_AT(pteval_t, 2) << 0) 61 + #define PTE_TYPE_EXT (_AT(pteval_t, 3) << 0) /* v5 */ 62 + #define PTE_BUFFERABLE (_AT(pteval_t, 1) << 2) 63 + #define PTE_CACHEABLE (_AT(pteval_t, 1) << 3) 64 + 65 + /* 66 + * - extended small page/tiny page 67 + */ 68 + #define PTE_EXT_XN (_AT(pteval_t, 1) << 0) /* v6 */ 69 + #define PTE_EXT_AP_MASK (_AT(pteval_t, 3) << 4) 70 + #define PTE_EXT_AP0 (_AT(pteval_t, 1) << 4) 71 + #define PTE_EXT_AP1 (_AT(pteval_t, 2) << 4) 72 + #define PTE_EXT_AP_UNO_SRO (_AT(pteval_t, 0) << 4) 73 + #define PTE_EXT_AP_UNO_SRW (PTE_EXT_AP0) 74 + #define PTE_EXT_AP_URO_SRW (PTE_EXT_AP1) 75 + #define PTE_EXT_AP_URW_SRW (PTE_EXT_AP1|PTE_EXT_AP0) 76 + #define PTE_EXT_TEX(x) (_AT(pteval_t, (x)) << 6) /* v5 */ 77 + #define PTE_EXT_APX (_AT(pteval_t, 1) << 9) /* v6 */ 78 + #define PTE_EXT_COHERENT (_AT(pteval_t, 1) << 9) /* XScale3 */ 79 + #define PTE_EXT_SHARED (_AT(pteval_t, 1) << 10) /* v6 */ 80 + #define PTE_EXT_NG (_AT(pteval_t, 1) << 11) /* v6 */ 81 + 82 + /* 83 + * - small page 84 + */ 85 + #define PTE_SMALL_AP_MASK (_AT(pteval_t, 0xff) << 4) 86 + #define PTE_SMALL_AP_UNO_SRO (_AT(pteval_t, 0x00) << 4) 87 + #define PTE_SMALL_AP_UNO_SRW (_AT(pteval_t, 0x55) << 4) 88 + #define PTE_SMALL_AP_URO_SRW (_AT(pteval_t, 0xaa) << 4) 89 + #define PTE_SMALL_AP_URW_SRW (_AT(pteval_t, 0xff) << 4) 90 + 91 + #define PHYS_MASK (~0UL) 92 + 93 + #endif
+67
arch/arm/include/asm/pgtable-2level-types.h
··· 1 + /* 2 + * arch/arm/include/asm/pgtable-2level-types.h 3 + * 4 + * Copyright (C) 1995-2003 Russell King 5 + * 6 + * This program is free software; you can redistribute it and/or modify 7 + * it under the terms of the GNU General Public License version 2 as 8 + * published by the Free Software Foundation. 9 + * 10 + * This program is distributed in the hope that it will be useful, 11 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 + * GNU General Public License for more details. 14 + * 15 + * You should have received a copy of the GNU General Public License 16 + * along with this program; if not, write to the Free Software 17 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 + */ 19 + #ifndef _ASM_PGTABLE_2LEVEL_TYPES_H 20 + #define _ASM_PGTABLE_2LEVEL_TYPES_H 21 + 22 + #include <asm/types.h> 23 + 24 + typedef u32 pteval_t; 25 + typedef u32 pmdval_t; 26 + 27 + #undef STRICT_MM_TYPECHECKS 28 + 29 + #ifdef STRICT_MM_TYPECHECKS 30 + /* 31 + * These are used to make use of C type-checking.. 32 + */ 33 + typedef struct { pteval_t pte; } pte_t; 34 + typedef struct { pmdval_t pmd; } pmd_t; 35 + typedef struct { pmdval_t pgd[2]; } pgd_t; 36 + typedef struct { pteval_t pgprot; } pgprot_t; 37 + 38 + #define pte_val(x) ((x).pte) 39 + #define pmd_val(x) ((x).pmd) 40 + #define pgd_val(x) ((x).pgd[0]) 41 + #define pgprot_val(x) ((x).pgprot) 42 + 43 + #define __pte(x) ((pte_t) { (x) } ) 44 + #define __pmd(x) ((pmd_t) { (x) } ) 45 + #define __pgprot(x) ((pgprot_t) { (x) } ) 46 + 47 + #else 48 + /* 49 + * .. while these make it easier on the compiler 50 + */ 51 + typedef pteval_t pte_t; 52 + typedef pmdval_t pmd_t; 53 + typedef pmdval_t pgd_t[2]; 54 + typedef pteval_t pgprot_t; 55 + 56 + #define pte_val(x) (x) 57 + #define pmd_val(x) (x) 58 + #define pgd_val(x) ((x)[0]) 59 + #define pgprot_val(x) (x) 60 + 61 + #define __pte(x) (x) 62 + #define __pmd(x) (x) 63 + #define __pgprot(x) (x) 64 + 65 + #endif /* STRICT_MM_TYPECHECKS */ 66 + 67 + #endif /* _ASM_PGTABLE_2LEVEL_TYPES_H */
+143
arch/arm/include/asm/pgtable-2level.h
··· 1 + /* 2 + * arch/arm/include/asm/pgtable-2level.h 3 + * 4 + * Copyright (C) 1995-2002 Russell King 5 + * 6 + * This program is free software; you can redistribute it and/or modify 7 + * it under the terms of the GNU General Public License version 2 as 8 + * published by the Free Software Foundation. 9 + */ 10 + #ifndef _ASM_PGTABLE_2LEVEL_H 11 + #define _ASM_PGTABLE_2LEVEL_H 12 + 13 + /* 14 + * Hardware-wise, we have a two level page table structure, where the first 15 + * level has 4096 entries, and the second level has 256 entries. Each entry 16 + * is one 32-bit word. Most of the bits in the second level entry are used 17 + * by hardware, and there aren't any "accessed" and "dirty" bits. 18 + * 19 + * Linux on the other hand has a three level page table structure, which can 20 + * be wrapped to fit a two level page table structure easily - using the PGD 21 + * and PTE only. However, Linux also expects one "PTE" table per page, and 22 + * at least a "dirty" bit. 23 + * 24 + * Therefore, we tweak the implementation slightly - we tell Linux that we 25 + * have 2048 entries in the first level, each of which is 8 bytes (iow, two 26 + * hardware pointers to the second level.) The second level contains two 27 + * hardware PTE tables arranged contiguously, preceded by Linux versions 28 + * which contain the state information Linux needs. We, therefore, end up 29 + * with 512 entries in the "PTE" level. 30 + * 31 + * This leads to the page tables having the following layout: 32 + * 33 + * pgd pte 34 + * | | 35 + * +--------+ 36 + * | | +------------+ +0 37 + * +- - - - + | Linux pt 0 | 38 + * | | +------------+ +1024 39 + * +--------+ +0 | Linux pt 1 | 40 + * | |-----> +------------+ +2048 41 + * +- - - - + +4 | h/w pt 0 | 42 + * | |-----> +------------+ +3072 43 + * +--------+ +8 | h/w pt 1 | 44 + * | | +------------+ +4096 45 + * 46 + * See L_PTE_xxx below for definitions of bits in the "Linux pt", and 47 + * PTE_xxx for definitions of bits appearing in the "h/w pt". 48 + * 49 + * PMD_xxx definitions refer to bits in the first level page table. 50 + * 51 + * The "dirty" bit is emulated by only granting hardware write permission 52 + * iff the page is marked "writable" and "dirty" in the Linux PTE. This 53 + * means that a write to a clean page will cause a permission fault, and 54 + * the Linux MM layer will mark the page dirty via handle_pte_fault(). 55 + * For the hardware to notice the permission change, the TLB entry must 56 + * be flushed, and ptep_set_access_flags() does that for us. 57 + * 58 + * The "accessed" or "young" bit is emulated by a similar method; we only 59 + * allow accesses to the page if the "young" bit is set. Accesses to the 60 + * page will cause a fault, and handle_pte_fault() will set the young bit 61 + * for us as long as the page is marked present in the corresponding Linux 62 + * PTE entry. Again, ptep_set_access_flags() will ensure that the TLB is 63 + * up to date. 64 + * 65 + * However, when the "young" bit is cleared, we deny access to the page 66 + * by clearing the hardware PTE. Currently Linux does not flush the TLB 67 + * for us in this case, which means the TLB will retain the transation 68 + * until either the TLB entry is evicted under pressure, or a context 69 + * switch which changes the user space mapping occurs. 70 + */ 71 + #define PTRS_PER_PTE 512 72 + #define PTRS_PER_PMD 1 73 + #define PTRS_PER_PGD 2048 74 + 75 + #define PTE_HWTABLE_PTRS (PTRS_PER_PTE) 76 + #define PTE_HWTABLE_OFF (PTE_HWTABLE_PTRS * sizeof(pte_t)) 77 + #define PTE_HWTABLE_SIZE (PTRS_PER_PTE * sizeof(u32)) 78 + 79 + /* 80 + * PMD_SHIFT determines the size of the area a second-level page table can map 81 + * PGDIR_SHIFT determines what a third-level page table entry can map 82 + */ 83 + #define PMD_SHIFT 21 84 + #define PGDIR_SHIFT 21 85 + 86 + #define PMD_SIZE (1UL << PMD_SHIFT) 87 + #define PMD_MASK (~(PMD_SIZE-1)) 88 + #define PGDIR_SIZE (1UL << PGDIR_SHIFT) 89 + #define PGDIR_MASK (~(PGDIR_SIZE-1)) 90 + 91 + /* 92 + * section address mask and size definitions. 93 + */ 94 + #define SECTION_SHIFT 20 95 + #define SECTION_SIZE (1UL << SECTION_SHIFT) 96 + #define SECTION_MASK (~(SECTION_SIZE-1)) 97 + 98 + /* 99 + * ARMv6 supersection address mask and size definitions. 100 + */ 101 + #define SUPERSECTION_SHIFT 24 102 + #define SUPERSECTION_SIZE (1UL << SUPERSECTION_SHIFT) 103 + #define SUPERSECTION_MASK (~(SUPERSECTION_SIZE-1)) 104 + 105 + #define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE) 106 + 107 + /* 108 + * "Linux" PTE definitions. 109 + * 110 + * We keep two sets of PTEs - the hardware and the linux version. 111 + * This allows greater flexibility in the way we map the Linux bits 112 + * onto the hardware tables, and allows us to have YOUNG and DIRTY 113 + * bits. 114 + * 115 + * The PTE table pointer refers to the hardware entries; the "Linux" 116 + * entries are stored 1024 bytes below. 117 + */ 118 + #define L_PTE_PRESENT (_AT(pteval_t, 1) << 0) 119 + #define L_PTE_YOUNG (_AT(pteval_t, 1) << 1) 120 + #define L_PTE_FILE (_AT(pteval_t, 1) << 2) /* only when !PRESENT */ 121 + #define L_PTE_DIRTY (_AT(pteval_t, 1) << 6) 122 + #define L_PTE_RDONLY (_AT(pteval_t, 1) << 7) 123 + #define L_PTE_USER (_AT(pteval_t, 1) << 8) 124 + #define L_PTE_XN (_AT(pteval_t, 1) << 9) 125 + #define L_PTE_SHARED (_AT(pteval_t, 1) << 10) /* shared(v6), coherent(xsc3) */ 126 + 127 + /* 128 + * These are the memory types, defined to be compatible with 129 + * pre-ARMv6 CPUs cacheable and bufferable bits: XXCB 130 + */ 131 + #define L_PTE_MT_UNCACHED (_AT(pteval_t, 0x00) << 2) /* 0000 */ 132 + #define L_PTE_MT_BUFFERABLE (_AT(pteval_t, 0x01) << 2) /* 0001 */ 133 + #define L_PTE_MT_WRITETHROUGH (_AT(pteval_t, 0x02) << 2) /* 0010 */ 134 + #define L_PTE_MT_WRITEBACK (_AT(pteval_t, 0x03) << 2) /* 0011 */ 135 + #define L_PTE_MT_MINICACHE (_AT(pteval_t, 0x06) << 2) /* 0110 (sa1100, xscale) */ 136 + #define L_PTE_MT_WRITEALLOC (_AT(pteval_t, 0x07) << 2) /* 0111 */ 137 + #define L_PTE_MT_DEV_SHARED (_AT(pteval_t, 0x04) << 2) /* 0100 */ 138 + #define L_PTE_MT_DEV_NONSHARED (_AT(pteval_t, 0x0c) << 2) /* 1100 */ 139 + #define L_PTE_MT_DEV_WC (_AT(pteval_t, 0x09) << 2) /* 1001 */ 140 + #define L_PTE_MT_DEV_CACHED (_AT(pteval_t, 0x0b) << 2) /* 1011 */ 141 + #define L_PTE_MT_MASK (_AT(pteval_t, 0x0f) << 2) 142 + 143 + #endif /* _ASM_PGTABLE_2LEVEL_H */
+1 -76
arch/arm/include/asm/pgtable-hwdef.h
··· 10 10 #ifndef _ASMARM_PGTABLE_HWDEF_H 11 11 #define _ASMARM_PGTABLE_HWDEF_H 12 12 13 - /* 14 - * Hardware page table definitions. 15 - * 16 - * + Level 1 descriptor (PMD) 17 - * - common 18 - */ 19 - #define PMD_TYPE_MASK (3 << 0) 20 - #define PMD_TYPE_FAULT (0 << 0) 21 - #define PMD_TYPE_TABLE (1 << 0) 22 - #define PMD_TYPE_SECT (2 << 0) 23 - #define PMD_BIT4 (1 << 4) 24 - #define PMD_DOMAIN(x) ((x) << 5) 25 - #define PMD_PROTECTION (1 << 9) /* v5 */ 26 - /* 27 - * - section 28 - */ 29 - #define PMD_SECT_BUFFERABLE (1 << 2) 30 - #define PMD_SECT_CACHEABLE (1 << 3) 31 - #define PMD_SECT_XN (1 << 4) /* v6 */ 32 - #define PMD_SECT_AP_WRITE (1 << 10) 33 - #define PMD_SECT_AP_READ (1 << 11) 34 - #define PMD_SECT_TEX(x) ((x) << 12) /* v5 */ 35 - #define PMD_SECT_APX (1 << 15) /* v6 */ 36 - #define PMD_SECT_S (1 << 16) /* v6 */ 37 - #define PMD_SECT_nG (1 << 17) /* v6 */ 38 - #define PMD_SECT_SUPER (1 << 18) /* v6 */ 39 - 40 - #define PMD_SECT_UNCACHED (0) 41 - #define PMD_SECT_BUFFERED (PMD_SECT_BUFFERABLE) 42 - #define PMD_SECT_WT (PMD_SECT_CACHEABLE) 43 - #define PMD_SECT_WB (PMD_SECT_CACHEABLE | PMD_SECT_BUFFERABLE) 44 - #define PMD_SECT_MINICACHE (PMD_SECT_TEX(1) | PMD_SECT_CACHEABLE) 45 - #define PMD_SECT_WBWA (PMD_SECT_TEX(1) | PMD_SECT_CACHEABLE | PMD_SECT_BUFFERABLE) 46 - #define PMD_SECT_NONSHARED_DEV (PMD_SECT_TEX(2)) 47 - 48 - /* 49 - * - coarse table (not used) 50 - */ 51 - 52 - /* 53 - * + Level 2 descriptor (PTE) 54 - * - common 55 - */ 56 - #define PTE_TYPE_MASK (3 << 0) 57 - #define PTE_TYPE_FAULT (0 << 0) 58 - #define PTE_TYPE_LARGE (1 << 0) 59 - #define PTE_TYPE_SMALL (2 << 0) 60 - #define PTE_TYPE_EXT (3 << 0) /* v5 */ 61 - #define PTE_BUFFERABLE (1 << 2) 62 - #define PTE_CACHEABLE (1 << 3) 63 - 64 - /* 65 - * - extended small page/tiny page 66 - */ 67 - #define PTE_EXT_XN (1 << 0) /* v6 */ 68 - #define PTE_EXT_AP_MASK (3 << 4) 69 - #define PTE_EXT_AP0 (1 << 4) 70 - #define PTE_EXT_AP1 (2 << 4) 71 - #define PTE_EXT_AP_UNO_SRO (0 << 4) 72 - #define PTE_EXT_AP_UNO_SRW (PTE_EXT_AP0) 73 - #define PTE_EXT_AP_URO_SRW (PTE_EXT_AP1) 74 - #define PTE_EXT_AP_URW_SRW (PTE_EXT_AP1|PTE_EXT_AP0) 75 - #define PTE_EXT_TEX(x) ((x) << 6) /* v5 */ 76 - #define PTE_EXT_APX (1 << 9) /* v6 */ 77 - #define PTE_EXT_COHERENT (1 << 9) /* XScale3 */ 78 - #define PTE_EXT_SHARED (1 << 10) /* v6 */ 79 - #define PTE_EXT_NG (1 << 11) /* v6 */ 80 - 81 - /* 82 - * - small page 83 - */ 84 - #define PTE_SMALL_AP_MASK (0xff << 4) 85 - #define PTE_SMALL_AP_UNO_SRO (0x00 << 4) 86 - #define PTE_SMALL_AP_UNO_SRW (0x55 << 4) 87 - #define PTE_SMALL_AP_URO_SRW (0xaa << 4) 88 - #define PTE_SMALL_AP_URW_SRW (0xff << 4) 13 + #include <asm/pgtable-2level-hwdef.h> 89 14 90 15 #endif
+5 -136
arch/arm/include/asm/pgtable.h
··· 24 24 #include <mach/vmalloc.h> 25 25 #include <asm/pgtable-hwdef.h> 26 26 27 + #include <asm/pgtable-2level.h> 28 + 27 29 /* 28 30 * Just any arbitrary offset to the start of the vmalloc VM area: the 29 31 * current 8MB value just means that there will be a 8MB "hole" after the ··· 43 41 #define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)) 44 42 #endif 45 43 46 - /* 47 - * Hardware-wise, we have a two level page table structure, where the first 48 - * level has 4096 entries, and the second level has 256 entries. Each entry 49 - * is one 32-bit word. Most of the bits in the second level entry are used 50 - * by hardware, and there aren't any "accessed" and "dirty" bits. 51 - * 52 - * Linux on the other hand has a three level page table structure, which can 53 - * be wrapped to fit a two level page table structure easily - using the PGD 54 - * and PTE only. However, Linux also expects one "PTE" table per page, and 55 - * at least a "dirty" bit. 56 - * 57 - * Therefore, we tweak the implementation slightly - we tell Linux that we 58 - * have 2048 entries in the first level, each of which is 8 bytes (iow, two 59 - * hardware pointers to the second level.) The second level contains two 60 - * hardware PTE tables arranged contiguously, preceded by Linux versions 61 - * which contain the state information Linux needs. We, therefore, end up 62 - * with 512 entries in the "PTE" level. 63 - * 64 - * This leads to the page tables having the following layout: 65 - * 66 - * pgd pte 67 - * | | 68 - * +--------+ 69 - * | | +------------+ +0 70 - * +- - - - + | Linux pt 0 | 71 - * | | +------------+ +1024 72 - * +--------+ +0 | Linux pt 1 | 73 - * | |-----> +------------+ +2048 74 - * +- - - - + +4 | h/w pt 0 | 75 - * | |-----> +------------+ +3072 76 - * +--------+ +8 | h/w pt 1 | 77 - * | | +------------+ +4096 78 - * 79 - * See L_PTE_xxx below for definitions of bits in the "Linux pt", and 80 - * PTE_xxx for definitions of bits appearing in the "h/w pt". 81 - * 82 - * PMD_xxx definitions refer to bits in the first level page table. 83 - * 84 - * The "dirty" bit is emulated by only granting hardware write permission 85 - * iff the page is marked "writable" and "dirty" in the Linux PTE. This 86 - * means that a write to a clean page will cause a permission fault, and 87 - * the Linux MM layer will mark the page dirty via handle_pte_fault(). 88 - * For the hardware to notice the permission change, the TLB entry must 89 - * be flushed, and ptep_set_access_flags() does that for us. 90 - * 91 - * The "accessed" or "young" bit is emulated by a similar method; we only 92 - * allow accesses to the page if the "young" bit is set. Accesses to the 93 - * page will cause a fault, and handle_pte_fault() will set the young bit 94 - * for us as long as the page is marked present in the corresponding Linux 95 - * PTE entry. Again, ptep_set_access_flags() will ensure that the TLB is 96 - * up to date. 97 - * 98 - * However, when the "young" bit is cleared, we deny access to the page 99 - * by clearing the hardware PTE. Currently Linux does not flush the TLB 100 - * for us in this case, which means the TLB will retain the transation 101 - * until either the TLB entry is evicted under pressure, or a context 102 - * switch which changes the user space mapping occurs. 103 - */ 104 - #define PTRS_PER_PTE 512 105 - #define PTRS_PER_PMD 1 106 - #define PTRS_PER_PGD 2048 107 - 108 - #define PTE_HWTABLE_PTRS (PTRS_PER_PTE) 109 - #define PTE_HWTABLE_OFF (PTE_HWTABLE_PTRS * sizeof(pte_t)) 110 - #define PTE_HWTABLE_SIZE (PTRS_PER_PTE * sizeof(u32)) 111 - 112 - /* 113 - * PMD_SHIFT determines the size of the area a second-level page table can map 114 - * PGDIR_SHIFT determines what a third-level page table entry can map 115 - */ 116 - #define PMD_SHIFT 21 117 - #define PGDIR_SHIFT 21 118 - 119 44 #define LIBRARY_TEXT_START 0x0c000000 120 45 121 46 #ifndef __ASSEMBLY__ ··· 53 124 #define pte_ERROR(pte) __pte_error(__FILE__, __LINE__, pte) 54 125 #define pmd_ERROR(pmd) __pmd_error(__FILE__, __LINE__, pmd) 55 126 #define pgd_ERROR(pgd) __pgd_error(__FILE__, __LINE__, pgd) 56 - #endif /* !__ASSEMBLY__ */ 57 - 58 - #define PMD_SIZE (1UL << PMD_SHIFT) 59 - #define PMD_MASK (~(PMD_SIZE-1)) 60 - #define PGDIR_SIZE (1UL << PGDIR_SHIFT) 61 - #define PGDIR_MASK (~(PGDIR_SIZE-1)) 62 127 63 128 /* 64 129 * This is the lowest virtual address we can permit any user space ··· 60 137 * non-high vector CPUs. 61 138 */ 62 139 #define FIRST_USER_ADDRESS PAGE_SIZE 63 - 64 - #define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE) 65 - 66 - /* 67 - * section address mask and size definitions. 68 - */ 69 - #define SECTION_SHIFT 20 70 - #define SECTION_SIZE (1UL << SECTION_SHIFT) 71 - #define SECTION_MASK (~(SECTION_SIZE-1)) 72 - 73 - /* 74 - * ARMv6 supersection address mask and size definitions. 75 - */ 76 - #define SUPERSECTION_SHIFT 24 77 - #define SUPERSECTION_SIZE (1UL << SUPERSECTION_SHIFT) 78 - #define SUPERSECTION_MASK (~(SUPERSECTION_SIZE-1)) 79 - 80 - /* 81 - * "Linux" PTE definitions. 82 - * 83 - * We keep two sets of PTEs - the hardware and the linux version. 84 - * This allows greater flexibility in the way we map the Linux bits 85 - * onto the hardware tables, and allows us to have YOUNG and DIRTY 86 - * bits. 87 - * 88 - * The PTE table pointer refers to the hardware entries; the "Linux" 89 - * entries are stored 1024 bytes below. 90 - */ 91 - #define L_PTE_PRESENT (_AT(pteval_t, 1) << 0) 92 - #define L_PTE_YOUNG (_AT(pteval_t, 1) << 1) 93 - #define L_PTE_FILE (_AT(pteval_t, 1) << 2) /* only when !PRESENT */ 94 - #define L_PTE_DIRTY (_AT(pteval_t, 1) << 6) 95 - #define L_PTE_RDONLY (_AT(pteval_t, 1) << 7) 96 - #define L_PTE_USER (_AT(pteval_t, 1) << 8) 97 - #define L_PTE_XN (_AT(pteval_t, 1) << 9) 98 - #define L_PTE_SHARED (_AT(pteval_t, 1) << 10) /* shared(v6), coherent(xsc3) */ 99 - 100 - /* 101 - * These are the memory types, defined to be compatible with 102 - * pre-ARMv6 CPUs cacheable and bufferable bits: XXCB 103 - */ 104 - #define L_PTE_MT_UNCACHED (_AT(pteval_t, 0x00) << 2) /* 0000 */ 105 - #define L_PTE_MT_BUFFERABLE (_AT(pteval_t, 0x01) << 2) /* 0001 */ 106 - #define L_PTE_MT_WRITETHROUGH (_AT(pteval_t, 0x02) << 2) /* 0010 */ 107 - #define L_PTE_MT_WRITEBACK (_AT(pteval_t, 0x03) << 2) /* 0011 */ 108 - #define L_PTE_MT_MINICACHE (_AT(pteval_t, 0x06) << 2) /* 0110 (sa1100, xscale) */ 109 - #define L_PTE_MT_WRITEALLOC (_AT(pteval_t, 0x07) << 2) /* 0111 */ 110 - #define L_PTE_MT_DEV_SHARED (_AT(pteval_t, 0x04) << 2) /* 0100 */ 111 - #define L_PTE_MT_DEV_NONSHARED (_AT(pteval_t, 0x0c) << 2) /* 1100 */ 112 - #define L_PTE_MT_DEV_WC (_AT(pteval_t, 0x09) << 2) /* 1001 */ 113 - #define L_PTE_MT_DEV_CACHED (_AT(pteval_t, 0x0b) << 2) /* 1011 */ 114 - #define L_PTE_MT_MASK (_AT(pteval_t, 0x0f) << 2) 115 - 116 - #ifndef __ASSEMBLY__ 117 140 118 141 /* 119 142 * The pgprot_* and protection_map entries will be fixed up in runtime ··· 196 327 197 328 static inline pte_t *pmd_page_vaddr(pmd_t pmd) 198 329 { 199 - return __va(pmd_val(pmd) & PAGE_MASK); 330 + return __va(pmd_val(pmd) & PHYS_MASK & (s32)PAGE_MASK); 200 331 } 201 332 202 - #define pmd_page(pmd) pfn_to_page(__phys_to_pfn(pmd_val(pmd))) 333 + #define pmd_page(pmd) pfn_to_page(__phys_to_pfn(pmd_val(pmd) & PHYS_MASK)) 203 334 204 335 /* we don't need complex calculations here as the pmd is folded into the pgd */ 205 336 #define pmd_addr_end(addr,end) (end) ··· 220 351 #define pte_offset_map(pmd,addr) (__pte_map(pmd) + pte_index(addr)) 221 352 #define pte_unmap(pte) __pte_unmap(pte) 222 353 223 - #define pte_pfn(pte) (pte_val(pte) >> PAGE_SHIFT) 354 + #define pte_pfn(pte) ((pte_val(pte) & PHYS_MASK) >> PAGE_SHIFT) 224 355 #define pfn_pte(pfn,prot) __pte(__pfn_to_phys(pfn) | pgprot_val(prot)) 225 356 226 357 #define pte_page(pte) pfn_to_page(pte_pfn(pte))
+11
arch/arm/include/asm/smp.h
··· 33 33 asmlinkage void do_IPI(int ipinr, struct pt_regs *regs); 34 34 35 35 /* 36 + * Called from C code, this handles an IPI. 37 + */ 38 + void handle_IPI(int ipinr, struct pt_regs *regs); 39 + 40 + /* 36 41 * Setup the set of possible CPUs (via set_cpu_possible) 37 42 */ 38 43 extern void smp_init_cpus(void); ··· 69 64 * Initialize cpu_possible map, and enable coherency 70 65 */ 71 66 extern void platform_smp_prepare_cpus(unsigned int); 67 + 68 + /* 69 + * Logical CPU mapping. 70 + */ 71 + extern int __cpu_logical_map[NR_CPUS]; 72 + #define cpu_logical_map(cpu) __cpu_logical_map[cpu] 72 73 73 74 /* 74 75 * Initial data for bringing up a secondary CPU.
-7
arch/arm/include/asm/system.h
··· 62 62 63 63 #include <asm/outercache.h> 64 64 65 - #define __exception __attribute__((section(".exception.text"))) 66 - #ifdef CONFIG_FUNCTION_GRAPH_TRACER 67 - #define __exception_irq_entry __irq_entry 68 - #else 69 - #define __exception_irq_entry __exception 70 - #endif 71 - 72 65 struct thread_info; 73 66 struct task_struct; 74 67
+2 -2
arch/arm/include/asm/tlbflush.h
··· 471 471 * these operations. This is typically used when we are removing 472 472 * PMD entries. 473 473 */ 474 - static inline void flush_pmd_entry(pmd_t *pmd) 474 + static inline void flush_pmd_entry(void *pmd) 475 475 { 476 476 const unsigned int __tlb_flag = __cpu_tlb_flags; 477 477 ··· 487 487 dsb(); 488 488 } 489 489 490 - static inline void clean_pmd_entry(pmd_t *pmd) 490 + static inline void clean_pmd_entry(void *pmd) 491 491 { 492 492 const unsigned int __tlb_flag = __cpu_tlb_flags; 493 493
+33
arch/arm/include/asm/topology.h
··· 1 1 #ifndef _ASM_ARM_TOPOLOGY_H 2 2 #define _ASM_ARM_TOPOLOGY_H 3 3 4 + #ifdef CONFIG_ARM_CPU_TOPOLOGY 5 + 6 + #include <linux/cpumask.h> 7 + 8 + struct cputopo_arm { 9 + int thread_id; 10 + int core_id; 11 + int socket_id; 12 + cpumask_t thread_sibling; 13 + cpumask_t core_sibling; 14 + }; 15 + 16 + extern struct cputopo_arm cpu_topology[NR_CPUS]; 17 + 18 + #define topology_physical_package_id(cpu) (cpu_topology[cpu].socket_id) 19 + #define topology_core_id(cpu) (cpu_topology[cpu].core_id) 20 + #define topology_core_cpumask(cpu) (&cpu_topology[cpu].core_sibling) 21 + #define topology_thread_cpumask(cpu) (&cpu_topology[cpu].thread_sibling) 22 + 23 + #define mc_capable() (cpu_topology[0].socket_id != -1) 24 + #define smt_capable() (cpu_topology[0].thread_id != -1) 25 + 26 + void init_cpu_topology(void); 27 + void store_cpu_topology(unsigned int cpuid); 28 + const struct cpumask *cpu_coregroup_mask(unsigned int cpu); 29 + 30 + #else 31 + 32 + static inline void init_cpu_topology(void) { } 33 + static inline void store_cpu_topology(unsigned int cpuid) { } 34 + 35 + #endif 36 + 4 37 #include <asm-generic/topology.h> 5 38 6 39 #endif /* _ASM_ARM_TOPOLOGY_H */
+2 -1
arch/arm/kernel/Makefile
··· 29 29 obj-$(CONFIG_ARTHUR) += arthur.o 30 30 obj-$(CONFIG_ISA_DMA) += dma-isa.o 31 31 obj-$(CONFIG_PCI) += bios32.o isa.o 32 - obj-$(CONFIG_PM_SLEEP) += sleep.o 32 + obj-$(CONFIG_ARM_CPU_SUSPEND) += sleep.o 33 33 obj-$(CONFIG_HAVE_SCHED_CLOCK) += sched_clock.o 34 34 obj-$(CONFIG_SMP) += smp.o smp_tlb.o 35 35 obj-$(CONFIG_HAVE_ARM_SCU) += smp_scu.o ··· 66 66 obj-$(CONFIG_CPU_HAS_PMU) += pmu.o 67 67 obj-$(CONFIG_HW_PERF_EVENTS) += perf_event.o 68 68 AFLAGS_iwmmxt.o := -Wa,-mcpu=iwmmxt 69 + obj-$(CONFIG_ARM_CPU_TOPOLOGY) += topology.o 69 70 70 71 ifneq ($(CONFIG_ARCH_EBSA110),y) 71 72 obj-y += io.o
+12
arch/arm/kernel/asm-offsets.c
··· 20 20 #include <asm/thread_info.h> 21 21 #include <asm/memory.h> 22 22 #include <asm/procinfo.h> 23 + #include <asm/hardware/cache-l2x0.h> 23 24 #include <linux/kbuild.h> 24 25 25 26 /* ··· 93 92 DEFINE(S_OLD_R0, offsetof(struct pt_regs, ARM_ORIG_r0)); 94 93 DEFINE(S_FRAME_SIZE, sizeof(struct pt_regs)); 95 94 BLANK(); 95 + #ifdef CONFIG_CACHE_L2X0 96 + DEFINE(L2X0_R_PHY_BASE, offsetof(struct l2x0_regs, phy_base)); 97 + DEFINE(L2X0_R_AUX_CTRL, offsetof(struct l2x0_regs, aux_ctrl)); 98 + DEFINE(L2X0_R_TAG_LATENCY, offsetof(struct l2x0_regs, tag_latency)); 99 + DEFINE(L2X0_R_DATA_LATENCY, offsetof(struct l2x0_regs, data_latency)); 100 + DEFINE(L2X0_R_FILTER_START, offsetof(struct l2x0_regs, filter_start)); 101 + DEFINE(L2X0_R_FILTER_END, offsetof(struct l2x0_regs, filter_end)); 102 + DEFINE(L2X0_R_PREFETCH_CTRL, offsetof(struct l2x0_regs, prefetch_ctrl)); 103 + DEFINE(L2X0_R_PWR_CTRL, offsetof(struct l2x0_regs, pwr_ctrl)); 104 + BLANK(); 105 + #endif 96 106 #ifdef CONFIG_CPU_HAS_ASID 97 107 DEFINE(MM_CONTEXT_ID, offsetof(struct mm_struct, context.id)); 98 108 BLANK();
+4 -5
arch/arm/kernel/bios32.c
··· 412 412 printk(KERN_INFO "PCI: bus%d: Fast back to back transfers %sabled\n", 413 413 bus->number, (features & PCI_COMMAND_FAST_BACK) ? "en" : "dis"); 414 414 } 415 + #ifdef CONFIG_HOTPLUG 416 + EXPORT_SYMBOL(pcibios_fixup_bus); 417 + #endif 415 418 416 419 /* 417 420 * Convert from Linux-centric to bus-centric addresses for bridge devices. ··· 434 431 region->start = res->start - offset; 435 432 region->end = res->end - offset; 436 433 } 434 + EXPORT_SYMBOL(pcibios_resource_to_bus); 437 435 438 436 void __devinit 439 437 pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, ··· 451 447 res->start = region->start + offset; 452 448 res->end = region->end + offset; 453 449 } 454 - 455 - #ifdef CONFIG_HOTPLUG 456 - EXPORT_SYMBOL(pcibios_fixup_bus); 457 - EXPORT_SYMBOL(pcibios_resource_to_bus); 458 450 EXPORT_SYMBOL(pcibios_bus_to_resource); 459 - #endif 460 451 461 452 /* 462 453 * Swizzle the device pin each time we cross a bridge.
+13 -23
arch/arm/kernel/ecard.c
··· 237 237 238 238 memcpy(dst_pgd, src_pgd, sizeof(pgd_t) * (IO_SIZE / PGDIR_SIZE)); 239 239 240 - src_pgd = pgd_offset(mm, EASI_BASE); 240 + src_pgd = pgd_offset(mm, (unsigned long)EASI_BASE); 241 241 dst_pgd = pgd_offset(mm, EASI_START); 242 242 243 243 memcpy(dst_pgd, src_pgd, sizeof(pgd_t) * (EASI_SIZE / PGDIR_SIZE)); ··· 674 674 #define ecard_probeirqhw() (0) 675 675 #endif 676 676 677 - #ifndef IO_EC_MEMC8_BASE 678 - #define IO_EC_MEMC8_BASE 0 679 - #endif 680 - 681 - static unsigned int __ecard_address(ecard_t *ec, card_type_t type, card_speed_t speed) 677 + static void __iomem *__ecard_address(ecard_t *ec, card_type_t type, card_speed_t speed) 682 678 { 683 - unsigned long address = 0; 679 + void __iomem *address = NULL; 684 680 int slot = ec->slot_no; 685 681 686 682 if (ec->slot_no == 8) 687 - return IO_EC_MEMC8_BASE; 683 + return ECARD_MEMC8_BASE; 688 684 689 685 ectcr &= ~(1 << slot); 690 686 691 687 switch (type) { 692 688 case ECARD_MEMC: 693 689 if (slot < 4) 694 - address = IO_EC_MEMC_BASE + (slot << 12); 690 + address = ECARD_MEMC_BASE + (slot << 14); 695 691 break; 696 692 697 693 case ECARD_IOC: 698 694 if (slot < 4) 699 - address = IO_EC_IOC_BASE + (slot << 12); 700 - #ifdef IO_EC_IOC4_BASE 695 + address = ECARD_IOC_BASE + (slot << 14); 701 696 else 702 - address = IO_EC_IOC4_BASE + ((slot - 4) << 12); 703 - #endif 697 + address = ECARD_IOC4_BASE + ((slot - 4) << 14); 704 698 if (address) 705 - address += speed << 17; 699 + address += speed << 19; 706 700 break; 707 701 708 - #ifdef IO_EC_EASI_BASE 709 702 case ECARD_EASI: 710 - address = IO_EC_EASI_BASE + (slot << 22); 703 + address = ECARD_EASI_BASE + (slot << 24); 711 704 if (speed == ECARD_FAST) 712 705 ectcr |= 1 << slot; 713 706 break; 714 - #endif 707 + 715 708 default: 716 709 break; 717 710 } ··· 983 990 ecard_t **ecp; 984 991 ecard_t *ec; 985 992 struct ex_ecid cid; 993 + void __iomem *addr; 986 994 int i, rc; 987 995 988 996 ec = ecard_alloc_card(type, slot); ··· 993 999 } 994 1000 995 1001 rc = -ENODEV; 996 - if ((ec->podaddr = __ecard_address(ec, type, ECARD_SYNC)) == 0) 1002 + if ((addr = __ecard_address(ec, type, ECARD_SYNC)) == NULL) 997 1003 goto nodev; 998 1004 999 1005 cid.r_zero = 1; ··· 1013 1019 ec->cid.fiqmask = cid.r_fiqmask; 1014 1020 ec->cid.fiqoff = ecard_gets24(cid.r_fiqoff); 1015 1021 ec->fiqaddr = 1016 - ec->irqaddr = (void __iomem *)ioaddr(ec->podaddr); 1022 + ec->irqaddr = addr; 1017 1023 1018 1024 if (ec->cid.is) { 1019 1025 ec->irqmask = ec->cid.irqmask; ··· 1042 1048 set_irq_flags(ec->irq, IRQF_VALID); 1043 1049 } 1044 1050 1045 - #ifdef IO_EC_MEMC8_BASE 1046 1051 if (slot == 8) 1047 1052 ec->irq = 11; 1048 - #endif 1049 1053 #ifdef CONFIG_ARCH_RPC 1050 1054 /* On RiscPC, only first two slots have DMA capability */ 1051 1055 if (slot < 2) ··· 1089 1097 ecard_probe(slot, ECARD_IOC); 1090 1098 } 1091 1099 1092 - #ifdef IO_EC_MEMC8_BASE 1093 1100 ecard_probe(8, ECARD_IOC); 1094 - #endif 1095 1101 1096 1102 irqhw = ecard_probeirqhw(); 1097 1103
+52 -83
arch/arm/kernel/head.S
··· 21 21 #include <asm/memory.h> 22 22 #include <asm/thread_info.h> 23 23 #include <asm/system.h> 24 + #include <asm/pgtable.h> 24 25 25 26 #ifdef CONFIG_DEBUG_LL 26 27 #include <mach/debug-macro.S> ··· 39 38 #error KERNEL_RAM_VADDR must start at 0xXXXX8000 40 39 #endif 41 40 41 + #define PG_DIR_SIZE 0x4000 42 + #define PMD_ORDER 2 43 + 42 44 .globl swapper_pg_dir 43 - .equ swapper_pg_dir, KERNEL_RAM_VADDR - 0x4000 45 + .equ swapper_pg_dir, KERNEL_RAM_VADDR - PG_DIR_SIZE 44 46 45 47 .macro pgtbl, rd, phys 46 - add \rd, \phys, #TEXT_OFFSET - 0x4000 48 + add \rd, \phys, #TEXT_OFFSET - PG_DIR_SIZE 47 49 .endm 48 50 49 51 #ifdef CONFIG_XIP_KERNEL ··· 152 148 pgtbl r4, r8 @ page table address 153 149 154 150 /* 155 - * Clear the 16K level 1 swapper page table 151 + * Clear the swapper page table 156 152 */ 157 153 mov r0, r4 158 154 mov r3, #0 159 - add r6, r0, #0x4000 155 + add r6, r0, #PG_DIR_SIZE 160 156 1: str r3, [r0], #4 161 157 str r3, [r0], #4 162 158 str r3, [r0], #4 ··· 175 171 sub r0, r0, r3 @ virt->phys offset 176 172 add r5, r5, r0 @ phys __enable_mmu 177 173 add r6, r6, r0 @ phys __enable_mmu_end 178 - mov r5, r5, lsr #20 179 - mov r6, r6, lsr #20 174 + mov r5, r5, lsr #SECTION_SHIFT 175 + mov r6, r6, lsr #SECTION_SHIFT 180 176 181 - 1: orr r3, r7, r5, lsl #20 @ flags + kernel base 182 - str r3, [r4, r5, lsl #2] @ identity mapping 183 - teq r5, r6 184 - addne r5, r5, #1 @ next section 185 - bne 1b 177 + 1: orr r3, r7, r5, lsl #SECTION_SHIFT @ flags + kernel base 178 + str r3, [r4, r5, lsl #PMD_ORDER] @ identity mapping 179 + cmp r5, r6 180 + addlo r5, r5, #1 @ next section 181 + blo 1b 186 182 187 183 /* 188 184 * Now setup the pagetables for our kernel direct 189 185 * mapped region. 190 186 */ 191 187 mov r3, pc 192 - mov r3, r3, lsr #20 193 - orr r3, r7, r3, lsl #20 194 - add r0, r4, #(KERNEL_START & 0xff000000) >> 18 195 - str r3, [r0, #(KERNEL_START & 0x00f00000) >> 18]! 188 + mov r3, r3, lsr #SECTION_SHIFT 189 + orr r3, r7, r3, lsl #SECTION_SHIFT 190 + add r0, r4, #(KERNEL_START & 0xff000000) >> (SECTION_SHIFT - PMD_ORDER) 191 + str r3, [r0, #((KERNEL_START & 0x00f00000) >> SECTION_SHIFT) << PMD_ORDER]! 196 192 ldr r6, =(KERNEL_END - 1) 197 - add r0, r0, #4 198 - add r6, r4, r6, lsr #18 193 + add r0, r0, #1 << PMD_ORDER 194 + add r6, r4, r6, lsr #(SECTION_SHIFT - PMD_ORDER) 199 195 1: cmp r0, r6 200 - add r3, r3, #1 << 20 201 - strls r3, [r0], #4 196 + add r3, r3, #1 << SECTION_SHIFT 197 + strls r3, [r0], #1 << PMD_ORDER 202 198 bls 1b 203 199 204 200 #ifdef CONFIG_XIP_KERNEL ··· 207 203 */ 208 204 add r3, r8, #TEXT_OFFSET 209 205 orr r3, r3, r7 210 - add r0, r4, #(KERNEL_RAM_VADDR & 0xff000000) >> 18 211 - str r3, [r0, #(KERNEL_RAM_VADDR & 0x00f00000) >> 18]! 206 + add r0, r4, #(KERNEL_RAM_VADDR & 0xff000000) >> (SECTION_SHIFT - PMD_ORDER) 207 + str r3, [r0, #(KERNEL_RAM_VADDR & 0x00f00000) >> (SECTION_SHIFT - PMD_ORDER)]! 212 208 ldr r6, =(_end - 1) 213 209 add r0, r0, #4 214 - add r6, r4, r6, lsr #18 210 + add r6, r4, r6, lsr #(SECTION_SHIFT - PMD_ORDER) 215 211 1: cmp r0, r6 216 212 add r3, r3, #1 << 20 217 213 strls r3, [r0], #4 ··· 222 218 * Then map boot params address in r2 or 223 219 * the first 1MB of ram if boot params address is not specified. 224 220 */ 225 - mov r0, r2, lsr #20 226 - movs r0, r0, lsl #20 221 + mov r0, r2, lsr #SECTION_SHIFT 222 + movs r0, r0, lsl #SECTION_SHIFT 227 223 moveq r0, r8 228 224 sub r3, r0, r8 229 225 add r3, r3, #PAGE_OFFSET 230 - add r3, r4, r3, lsr #18 226 + add r3, r4, r3, lsr #(SECTION_SHIFT - PMD_ORDER) 231 227 orr r6, r7, r0 232 228 str r6, [r3] 233 229 ··· 240 236 */ 241 237 addruart r7, r3 242 238 243 - mov r3, r3, lsr #20 244 - mov r3, r3, lsl #2 239 + mov r3, r3, lsr #SECTION_SHIFT 240 + mov r3, r3, lsl #PMD_ORDER 245 241 246 242 add r0, r4, r3 247 243 rsb r3, r3, #0x4000 @ PTRS_PER_PGD*sizeof(long) 248 244 cmp r3, #0x0800 @ limit to 512MB 249 245 movhi r3, #0x0800 250 246 add r6, r0, r3 251 - mov r3, r7, lsr #20 247 + mov r3, r7, lsr #SECTION_SHIFT 252 248 ldr r7, [r10, #PROCINFO_IO_MMUFLAGS] @ io_mmuflags 253 - orr r3, r7, r3, lsl #20 249 + orr r3, r7, r3, lsl #SECTION_SHIFT 254 250 1: str r3, [r0], #4 255 - add r3, r3, #1 << 20 256 - teq r0, r6 257 - bne 1b 251 + add r3, r3, #1 << SECTION_SHIFT 252 + cmp r0, r6 253 + blo 1b 258 254 259 255 #else /* CONFIG_DEBUG_ICEDCC */ 260 256 /* we don't need any serial debugging mappings for ICEDCC */ ··· 266 262 * If we're using the NetWinder or CATS, we also need to map 267 263 * in the 16550-type serial port for the debug messages 268 264 */ 269 - add r0, r4, #0xff000000 >> 18 265 + add r0, r4, #0xff000000 >> (SECTION_SHIFT - PMD_ORDER) 270 266 orr r3, r7, #0x7c000000 271 267 str r3, [r0] 272 268 #endif ··· 276 272 * Similar reasons here - for debug. This is 277 273 * only for Acorn RiscPC architectures. 278 274 */ 279 - add r0, r4, #0x02000000 >> 18 275 + add r0, r4, #0x02000000 >> (SECTION_SHIFT - PMD_ORDER) 280 276 orr r3, r7, #0x02000000 281 277 str r3, [r0] 282 - add r0, r4, #0xd8000000 >> 18 278 + add r0, r4, #0xd8000000 >> (SECTION_SHIFT - PMD_ORDER) 283 279 str r3, [r0] 284 280 #endif 285 281 #endif ··· 492 488 add r5, r5, r3 @ adjust table end address 493 489 add r7, r7, r3 @ adjust __pv_phys_offset address 494 490 str r8, [r7] @ save computed PHYS_OFFSET to __pv_phys_offset 495 - #ifndef CONFIG_ARM_PATCH_PHYS_VIRT_16BIT 496 491 mov r6, r3, lsr #24 @ constant for add/sub instructions 497 492 teq r3, r6, lsl #24 @ must be 16MiB aligned 498 - #else 499 - mov r6, r3, lsr #16 @ constant for add/sub instructions 500 - teq r3, r6, lsl #16 @ must be 64kiB aligned 501 - #endif 502 493 THUMB( it ne @ cross section branch ) 503 494 bne __error 504 495 str r6, [r7, #4] @ save to __pv_offset ··· 509 510 .text 510 511 __fixup_a_pv_table: 511 512 #ifdef CONFIG_THUMB2_KERNEL 512 - #ifdef CONFIG_ARM_PATCH_PHYS_VIRT_16BIT 513 - lsls r0, r6, #24 514 - lsr r6, #8 515 - beq 1f 516 - clz r7, r0 517 - lsr r0, #24 518 - lsl r0, r7 519 - bic r0, 0x0080 520 - lsrs r7, #1 521 - orrcs r0, #0x0080 522 - orr r0, r0, r7, lsl #12 523 - #endif 524 - 1: lsls r6, #24 525 - beq 4f 513 + lsls r6, #24 514 + beq 2f 526 515 clz r7, r6 527 516 lsr r6, #24 528 517 lsl r6, r7 ··· 519 532 orrcs r6, #0x0080 520 533 orr r6, r6, r7, lsl #12 521 534 orr r6, #0x4000 522 - b 4f 523 - 2: @ at this point the C flag is always clear 524 - add r7, r3 525 - #ifdef CONFIG_ARM_PATCH_PHYS_VIRT_16BIT 526 - ldrh ip, [r7] 527 - tst ip, 0x0400 @ the i bit tells us LS or MS byte 528 - beq 3f 529 - cmp r0, #0 @ set C flag, and ... 530 - biceq ip, 0x0400 @ immediate zero value has a special encoding 531 - streqh ip, [r7] @ that requires the i bit cleared 532 - #endif 533 - 3: ldrh ip, [r7, #2] 535 + b 2f 536 + 1: add r7, r3 537 + ldrh ip, [r7, #2] 534 538 and ip, 0x8f00 535 - orrcc ip, r6 @ mask in offset bits 31-24 536 - orrcs ip, r0 @ mask in offset bits 23-16 539 + orr ip, r6 @ mask in offset bits 31-24 537 540 strh ip, [r7, #2] 538 - 4: cmp r4, r5 541 + 2: cmp r4, r5 539 542 ldrcc r7, [r4], #4 @ use branch for delay slot 540 - bcc 2b 543 + bcc 1b 541 544 bx lr 542 545 #else 543 - #ifdef CONFIG_ARM_PATCH_PHYS_VIRT_16BIT 544 - and r0, r6, #255 @ offset bits 23-16 545 - mov r6, r6, lsr #8 @ offset bits 31-24 546 - #else 547 - mov r0, #0 @ just in case... 548 - #endif 549 - b 3f 550 - 2: ldr ip, [r7, r3] 546 + b 2f 547 + 1: ldr ip, [r7, r3] 551 548 bic ip, ip, #0x000000ff 552 - tst ip, #0x400 @ rotate shift tells us LS or MS byte 553 - orrne ip, ip, r6 @ mask in offset bits 31-24 554 - orreq ip, ip, r0 @ mask in offset bits 23-16 549 + orr ip, ip, r6 @ mask in offset bits 31-24 555 550 str ip, [r7, r3] 556 - 3: cmp r4, r5 551 + 2: cmp r4, r5 557 552 ldrcc r7, [r4], #4 @ use branch for delay slot 558 - bcc 2b 553 + bcc 1b 559 554 mov pc, lr 560 555 #endif 561 556 ENDPROC(__fixup_a_pv_table)
+1 -1
arch/arm/kernel/irq.c
··· 35 35 #include <linux/list.h> 36 36 #include <linux/kallsyms.h> 37 37 #include <linux/proc_fs.h> 38 - #include <linux/ftrace.h> 39 38 39 + #include <asm/exception.h> 40 40 #include <asm/system.h> 41 41 #include <asm/mach/arch.h> 42 42 #include <asm/mach/irq.h>
+1 -1
arch/arm/kernel/module.c
··· 33 33 * recompiling the whole kernel when CONFIG_XIP_KERNEL is turned on/off. 34 34 */ 35 35 #undef MODULES_VADDR 36 - #define MODULES_VADDR (((unsigned long)_etext + ~PGDIR_MASK) & PGDIR_MASK) 36 + #define MODULES_VADDR (((unsigned long)_etext + ~PMD_MASK) & PMD_MASK) 37 37 #endif 38 38 39 39 #ifdef CONFIG_MMU
+31 -1
arch/arm/kernel/smp.c
··· 16 16 #include <linux/cache.h> 17 17 #include <linux/profile.h> 18 18 #include <linux/errno.h> 19 - #include <linux/ftrace.h> 20 19 #include <linux/mm.h> 21 20 #include <linux/err.h> 22 21 #include <linux/cpu.h> ··· 30 31 #include <asm/cacheflush.h> 31 32 #include <asm/cpu.h> 32 33 #include <asm/cputype.h> 34 + #include <asm/exception.h> 35 + #include <asm/topology.h> 33 36 #include <asm/mmu_context.h> 34 37 #include <asm/pgtable.h> 35 38 #include <asm/pgalloc.h> ··· 40 39 #include <asm/tlbflush.h> 41 40 #include <asm/ptrace.h> 42 41 #include <asm/localtimer.h> 42 + #include <asm/smp_plat.h> 43 43 44 44 /* 45 45 * as from 2.5, kernels no longer have an init_tasks structure ··· 261 259 } 262 260 #endif /* CONFIG_HOTPLUG_CPU */ 263 261 262 + int __cpu_logical_map[NR_CPUS]; 263 + 264 + void __init smp_setup_processor_id(void) 265 + { 266 + int i; 267 + u32 cpu = is_smp() ? read_cpuid_mpidr() & 0xff : 0; 268 + 269 + cpu_logical_map(0) = cpu; 270 + for (i = 1; i < NR_CPUS; ++i) 271 + cpu_logical_map(i) = i == cpu ? 0 : i; 272 + 273 + printk(KERN_INFO "Booting Linux on physical CPU %d\n", cpu); 274 + } 275 + 264 276 /* 265 277 * Called by both boot and secondaries to move global data into 266 278 * per-processor storage. ··· 284 268 struct cpuinfo_arm *cpu_info = &per_cpu(cpu_data, cpuid); 285 269 286 270 cpu_info->loops_per_jiffy = loops_per_jiffy; 271 + 272 + store_cpu_topology(cpuid); 287 273 } 288 274 289 275 /* ··· 375 357 void __init smp_prepare_cpus(unsigned int max_cpus) 376 358 { 377 359 unsigned int ncores = num_possible_cpus(); 360 + 361 + init_cpu_topology(); 378 362 379 363 smp_store_cpu_info(smp_processor_id()); 380 364 ··· 479 459 480 460 #ifdef CONFIG_LOCAL_TIMERS 481 461 asmlinkage void __exception_irq_entry do_local_timer(struct pt_regs *regs) 462 + { 463 + handle_local_timer(regs); 464 + } 465 + 466 + void handle_local_timer(struct pt_regs *regs) 482 467 { 483 468 struct pt_regs *old_regs = set_irq_regs(regs); 484 469 int cpu = smp_processor_id(); ··· 591 566 * Main handler for inter-processor interrupts 592 567 */ 593 568 asmlinkage void __exception_irq_entry do_IPI(int ipinr, struct pt_regs *regs) 569 + { 570 + handle_IPI(ipinr, regs); 571 + } 572 + 573 + void handle_IPI(int ipinr, struct pt_regs *regs) 594 574 { 595 575 unsigned int cpu = smp_processor_id(); 596 576 struct pt_regs *old_regs = set_irq_regs(regs);
+1 -1
arch/arm/kernel/smp_scu.c
··· 34 34 /* 35 35 * Enable the SCU 36 36 */ 37 - void __init scu_enable(void __iomem *scu_base) 37 + void scu_enable(void __iomem *scu_base) 38 38 { 39 39 u32 scu_ctrl; 40 40
+2 -4
arch/arm/kernel/time.c
··· 39 39 */ 40 40 static struct sys_timer *system_timer; 41 41 42 - #if defined(CONFIG_RTC_DRV_CMOS) || defined(CONFIG_RTC_DRV_CMOS_MODULE) 42 + #if defined(CONFIG_RTC_DRV_CMOS) || defined(CONFIG_RTC_DRV_CMOS_MODULE) || \ 43 + defined(CONFIG_NVRAM) || defined(CONFIG_NVRAM_MODULE) 43 44 /* this needs a better home */ 44 45 DEFINE_SPINLOCK(rtc_lock); 45 - 46 - #ifdef CONFIG_RTC_DRV_CMOS_MODULE 47 46 EXPORT_SYMBOL(rtc_lock); 48 - #endif 49 47 #endif /* pc-style 'CMOS' RTC support */ 50 48 51 49 /* change this if you have some constant time drift */
+148
arch/arm/kernel/topology.c
··· 1 + /* 2 + * arch/arm/kernel/topology.c 3 + * 4 + * Copyright (C) 2011 Linaro Limited. 5 + * Written by: Vincent Guittot 6 + * 7 + * based on arch/sh/kernel/topology.c 8 + * 9 + * This file is subject to the terms and conditions of the GNU General Public 10 + * License. See the file "COPYING" in the main directory of this archive 11 + * for more details. 12 + */ 13 + 14 + #include <linux/cpu.h> 15 + #include <linux/cpumask.h> 16 + #include <linux/init.h> 17 + #include <linux/percpu.h> 18 + #include <linux/node.h> 19 + #include <linux/nodemask.h> 20 + #include <linux/sched.h> 21 + 22 + #include <asm/cputype.h> 23 + #include <asm/topology.h> 24 + 25 + #define MPIDR_SMP_BITMASK (0x3 << 30) 26 + #define MPIDR_SMP_VALUE (0x2 << 30) 27 + 28 + #define MPIDR_MT_BITMASK (0x1 << 24) 29 + 30 + /* 31 + * These masks reflect the current use of the affinity levels. 32 + * The affinity level can be up to 16 bits according to ARM ARM 33 + */ 34 + 35 + #define MPIDR_LEVEL0_MASK 0x3 36 + #define MPIDR_LEVEL0_SHIFT 0 37 + 38 + #define MPIDR_LEVEL1_MASK 0xF 39 + #define MPIDR_LEVEL1_SHIFT 8 40 + 41 + #define MPIDR_LEVEL2_MASK 0xFF 42 + #define MPIDR_LEVEL2_SHIFT 16 43 + 44 + struct cputopo_arm cpu_topology[NR_CPUS]; 45 + 46 + const struct cpumask *cpu_coregroup_mask(unsigned int cpu) 47 + { 48 + return &cpu_topology[cpu].core_sibling; 49 + } 50 + 51 + /* 52 + * store_cpu_topology is called at boot when only one cpu is running 53 + * and with the mutex cpu_hotplug.lock locked, when several cpus have booted, 54 + * which prevents simultaneous write access to cpu_topology array 55 + */ 56 + void store_cpu_topology(unsigned int cpuid) 57 + { 58 + struct cputopo_arm *cpuid_topo = &cpu_topology[cpuid]; 59 + unsigned int mpidr; 60 + unsigned int cpu; 61 + 62 + /* If the cpu topology has been already set, just return */ 63 + if (cpuid_topo->core_id != -1) 64 + return; 65 + 66 + mpidr = read_cpuid_mpidr(); 67 + 68 + /* create cpu topology mapping */ 69 + if ((mpidr & MPIDR_SMP_BITMASK) == MPIDR_SMP_VALUE) { 70 + /* 71 + * This is a multiprocessor system 72 + * multiprocessor format & multiprocessor mode field are set 73 + */ 74 + 75 + if (mpidr & MPIDR_MT_BITMASK) { 76 + /* core performance interdependency */ 77 + cpuid_topo->thread_id = (mpidr >> MPIDR_LEVEL0_SHIFT) 78 + & MPIDR_LEVEL0_MASK; 79 + cpuid_topo->core_id = (mpidr >> MPIDR_LEVEL1_SHIFT) 80 + & MPIDR_LEVEL1_MASK; 81 + cpuid_topo->socket_id = (mpidr >> MPIDR_LEVEL2_SHIFT) 82 + & MPIDR_LEVEL2_MASK; 83 + } else { 84 + /* largely independent cores */ 85 + cpuid_topo->thread_id = -1; 86 + cpuid_topo->core_id = (mpidr >> MPIDR_LEVEL0_SHIFT) 87 + & MPIDR_LEVEL0_MASK; 88 + cpuid_topo->socket_id = (mpidr >> MPIDR_LEVEL1_SHIFT) 89 + & MPIDR_LEVEL1_MASK; 90 + } 91 + } else { 92 + /* 93 + * This is an uniprocessor system 94 + * we are in multiprocessor format but uniprocessor system 95 + * or in the old uniprocessor format 96 + */ 97 + cpuid_topo->thread_id = -1; 98 + cpuid_topo->core_id = 0; 99 + cpuid_topo->socket_id = -1; 100 + } 101 + 102 + /* update core and thread sibling masks */ 103 + for_each_possible_cpu(cpu) { 104 + struct cputopo_arm *cpu_topo = &cpu_topology[cpu]; 105 + 106 + if (cpuid_topo->socket_id == cpu_topo->socket_id) { 107 + cpumask_set_cpu(cpuid, &cpu_topo->core_sibling); 108 + if (cpu != cpuid) 109 + cpumask_set_cpu(cpu, 110 + &cpuid_topo->core_sibling); 111 + 112 + if (cpuid_topo->core_id == cpu_topo->core_id) { 113 + cpumask_set_cpu(cpuid, 114 + &cpu_topo->thread_sibling); 115 + if (cpu != cpuid) 116 + cpumask_set_cpu(cpu, 117 + &cpuid_topo->thread_sibling); 118 + } 119 + } 120 + } 121 + smp_wmb(); 122 + 123 + printk(KERN_INFO "CPU%u: thread %d, cpu %d, socket %d, mpidr %x\n", 124 + cpuid, cpu_topology[cpuid].thread_id, 125 + cpu_topology[cpuid].core_id, 126 + cpu_topology[cpuid].socket_id, mpidr); 127 + } 128 + 129 + /* 130 + * init_cpu_topology is called at boot when only one cpu is running 131 + * which prevent simultaneous write access to cpu_topology array 132 + */ 133 + void init_cpu_topology(void) 134 + { 135 + unsigned int cpu; 136 + 137 + /* init core mask */ 138 + for_each_possible_cpu(cpu) { 139 + struct cputopo_arm *cpu_topo = &(cpu_topology[cpu]); 140 + 141 + cpu_topo->thread_id = -1; 142 + cpu_topo->core_id = -1; 143 + cpu_topo->socket_id = -1; 144 + cpumask_clear(&cpu_topo->core_sibling); 145 + cpumask_clear(&cpu_topo->thread_sibling); 146 + } 147 + smp_wmb(); 148 + }
+1
arch/arm/kernel/traps.c
··· 27 27 28 28 #include <linux/atomic.h> 29 29 #include <asm/cacheflush.h> 30 + #include <asm/exception.h> 30 31 #include <asm/system.h> 31 32 #include <asm/unistd.h> 32 33 #include <asm/traps.h>
+1
arch/arm/lib/uaccess_with_memcpy.c
··· 17 17 #include <linux/sched.h> 18 18 #include <linux/hardirq.h> /* for in_atomic() */ 19 19 #include <linux/gfp.h> 20 + #include <linux/highmem.h> 20 21 #include <asm/current.h> 21 22 #include <asm/page.h> 22 23
-2
arch/arm/mach-ebsa110/include/mach/io.h
··· 13 13 #ifndef __ASM_ARM_ARCH_IO_H 14 14 #define __ASM_ARM_ARCH_IO_H 15 15 16 - #define IO_SPACE_LIMIT 0xffff 17 - 18 16 u8 __inb8(unsigned int port); 19 17 void __outb8(u8 val, unsigned int port); 20 18
+1
arch/arm/mach-exynos4/Kconfig
··· 12 12 config CPU_EXYNOS4210 13 13 bool 14 14 select S3C_PL330_DMA 15 + select ARM_CPU_SUSPEND if PM 15 16 help 16 17 Enable EXYNOS4210 CPU support 17 18
+4 -6
arch/arm/mach-exynos4/platsmp.c
··· 193 193 ncores = scu_base ? scu_get_core_count(scu_base) : 1; 194 194 195 195 /* sanity check */ 196 - if (ncores > NR_CPUS) { 197 - printk(KERN_WARNING 198 - "EXYNOS4: no. of cores (%d) greater than configured " 199 - "maximum of %d - clipping\n", 200 - ncores, NR_CPUS); 201 - ncores = NR_CPUS; 196 + if (ncores > nr_cpu_ids) { 197 + pr_warn("SMP: %u cores greater than maximum (%u), clipping\n", 198 + ncores, nr_cpu_ids); 199 + ncores = nr_cpu_ids; 202 200 } 203 201 204 202 for (i = 0; i < ncores; i++)
-2
arch/arm/mach-footbridge/include/mach/io.h
··· 23 23 #define PCIO_SIZE 0x00100000 24 24 #define PCIO_BASE MMU_IO(0xff000000, 0x7c000000) 25 25 26 - #define IO_SPACE_LIMIT 0xffff 27 - 28 26 /* 29 27 * Translation of various region addresses to virtual addresses 30 28 */
-2
arch/arm/mach-integrator/include/mach/io.h
··· 20 20 #ifndef __ASM_ARM_ARCH_IO_H 21 21 #define __ASM_ARM_ARCH_IO_H 22 22 23 - #define IO_SPACE_LIMIT 0xffff 24 - 25 23 /* 26 24 * WARNING: this has to mirror definitions in platform.h 27 25 */
-2
arch/arm/mach-ixp4xx/include/mach/io.h
··· 17 17 18 18 #include <mach/hardware.h> 19 19 20 - #define IO_SPACE_LIMIT 0x0000ffff 21 - 22 20 extern int (*ixp4xx_pci_read)(u32 addr, u32 cmd, u32* data); 23 21 extern int ixp4xx_pci_write(u32 addr, u32 cmd, u32 data); 24 22
+22
arch/arm/mach-msm/board-msm7x30.c
··· 24 24 #include <linux/smsc911x.h> 25 25 #include <linux/usb/msm_hsusb.h> 26 26 #include <linux/clkdev.h> 27 + #include <linux/memblock.h> 27 28 28 29 #include <asm/mach-types.h> 29 30 #include <asm/mach/arch.h> ··· 42 41 #include "proc_comm.h" 43 42 44 43 extern struct sys_timer msm_timer; 44 + 45 + static void __init msm7x30_fixup(struct machine_desc *desc, struct tag *tag, 46 + char **cmdline, struct meminfo *mi) 47 + { 48 + for (; tag->hdr.size; tag = tag_next(tag)) 49 + if (tag->hdr.tag == ATAG_MEM && tag->u.mem.start == 0x200000) { 50 + tag->u.mem.start = 0; 51 + tag->u.mem.size += SZ_2M; 52 + } 53 + } 54 + 55 + static void __init msm7x30_reserve(void) 56 + { 57 + memblock_remove(0x0, SZ_2M); 58 + } 45 59 46 60 static int hsusb_phy_init_seq[] = { 47 61 0x30, 0x32, /* Enable and set Pre-Emphasis Depth to 20% */ ··· 123 107 124 108 MACHINE_START(MSM7X30_SURF, "QCT MSM7X30 SURF") 125 109 .boot_params = PLAT_PHYS_OFFSET + 0x100, 110 + .fixup = msm7x30_fixup, 111 + .reserve = msm7x30_reserve, 126 112 .map_io = msm7x30_map_io, 127 113 .init_irq = msm7x30_init_irq, 128 114 .init_machine = msm7x30_init, ··· 133 115 134 116 MACHINE_START(MSM7X30_FFA, "QCT MSM7X30 FFA") 135 117 .boot_params = PLAT_PHYS_OFFSET + 0x100, 118 + .fixup = msm7x30_fixup, 119 + .reserve = msm7x30_reserve, 136 120 .map_io = msm7x30_map_io, 137 121 .init_irq = msm7x30_init_irq, 138 122 .init_machine = msm7x30_init, ··· 143 123 144 124 MACHINE_START(MSM7X30_FLUID, "QCT MSM7X30 FLUID") 145 125 .boot_params = PLAT_PHYS_OFFSET + 0x100, 126 + .fixup = msm7x30_fixup, 127 + .reserve = msm7x30_reserve, 146 128 .map_io = msm7x30_map_io, 147 129 .init_irq = msm7x30_init_irq, 148 130 .init_machine = msm7x30_init,
+22
arch/arm/mach-msm/board-msm8960.c
··· 20 20 #include <linux/io.h> 21 21 #include <linux/irq.h> 22 22 #include <linux/clkdev.h> 23 + #include <linux/memblock.h> 23 24 24 25 #include <asm/mach-types.h> 25 26 #include <asm/mach/arch.h> 26 27 #include <asm/hardware/gic.h> 28 + #include <asm/setup.h> 27 29 28 30 #include <mach/board.h> 29 31 #include <mach/msm_iomap.h> 30 32 31 33 #include "devices.h" 34 + 35 + static void __init msm8960_fixup(struct machine_desc *desc, struct tag *tag, 36 + char **cmdline, struct meminfo *mi) 37 + { 38 + for (; tag->hdr.size; tag = tag_next(tag)) 39 + if (tag->hdr.tag == ATAG_MEM && 40 + tag->u.mem.start == 0x40200000) { 41 + tag->u.mem.start = 0x40000000; 42 + tag->u.mem.size += SZ_2M; 43 + } 44 + } 45 + 46 + static void __init msm8960_reserve(void) 47 + { 48 + memblock_remove(0x40000000, SZ_2M); 49 + } 32 50 33 51 static void __init msm8960_map_io(void) 34 52 { ··· 94 76 } 95 77 96 78 MACHINE_START(MSM8960_SIM, "QCT MSM8960 SIMULATOR") 79 + .fixup = msm8960_fixup, 80 + .reserve = msm8960_reserve, 97 81 .map_io = msm8960_map_io, 98 82 .init_irq = msm8960_init_irq, 99 83 .timer = &msm_timer, ··· 103 83 MACHINE_END 104 84 105 85 MACHINE_START(MSM8960_RUMI3, "QCT MSM8960 RUMI3") 86 + .fixup = msm8960_fixup, 87 + .reserve = msm8960_reserve, 106 88 .map_io = msm8960_map_io, 107 89 .init_irq = msm8960_init_irq, 108 90 .timer = &msm_timer,
+25
arch/arm/mach-msm/board-msm8x60.c
··· 20 20 #include <linux/platform_device.h> 21 21 #include <linux/io.h> 22 22 #include <linux/irq.h> 23 + #include <linux/memblock.h> 23 24 24 25 #include <asm/mach-types.h> 25 26 #include <asm/mach/arch.h> 26 27 #include <asm/hardware/gic.h> 28 + #include <asm/setup.h> 27 29 28 30 #include <mach/board.h> 29 31 #include <mach/msm_iomap.h> 30 32 33 + static void __init msm8x60_fixup(struct machine_desc *desc, struct tag *tag, 34 + char **cmdline, struct meminfo *mi) 35 + { 36 + for (; tag->hdr.size; tag = tag_next(tag)) 37 + if (tag->hdr.tag == ATAG_MEM && 38 + tag->u.mem.start == 0x40200000) { 39 + tag->u.mem.start = 0x40000000; 40 + tag->u.mem.size += SZ_2M; 41 + } 42 + } 43 + 44 + static void __init msm8x60_reserve(void) 45 + { 46 + memblock_remove(0x40000000, SZ_2M); 47 + } 31 48 32 49 static void __init msm8x60_map_io(void) 33 50 { ··· 82 65 } 83 66 84 67 MACHINE_START(MSM8X60_RUMI3, "QCT MSM8X60 RUMI3") 68 + .fixup = msm8x60_fixup, 69 + .reserve = msm8x60_reserve, 85 70 .map_io = msm8x60_map_io, 86 71 .init_irq = msm8x60_init_irq, 87 72 .init_machine = msm8x60_init, ··· 91 72 MACHINE_END 92 73 93 74 MACHINE_START(MSM8X60_SURF, "QCT MSM8X60 SURF") 75 + .fixup = msm8x60_fixup, 76 + .reserve = msm8x60_reserve, 94 77 .map_io = msm8x60_map_io, 95 78 .init_irq = msm8x60_init_irq, 96 79 .init_machine = msm8x60_init, ··· 100 79 MACHINE_END 101 80 102 81 MACHINE_START(MSM8X60_SIM, "QCT MSM8X60 SIMULATOR") 82 + .fixup = msm8x60_fixup, 83 + .reserve = msm8x60_reserve, 103 84 .map_io = msm8x60_map_io, 104 85 .init_irq = msm8x60_init_irq, 105 86 .init_machine = msm8x60_init, ··· 109 86 MACHINE_END 110 87 111 88 MACHINE_START(MSM8X60_FFA, "QCT MSM8X60 FFA") 89 + .fixup = msm8x60_fixup, 90 + .reserve = msm8x60_reserve, 112 91 .map_io = msm8x60_map_io, 113 92 .init_irq = msm8x60_init_irq, 114 93 .init_machine = msm8x60_init,
+3 -3
arch/arm/mach-msm/include/mach/memory.h
··· 22 22 #elif defined(CONFIG_ARCH_QSD8X50) 23 23 #define PLAT_PHYS_OFFSET UL(0x20000000) 24 24 #elif defined(CONFIG_ARCH_MSM7X30) 25 - #define PLAT_PHYS_OFFSET UL(0x00200000) 25 + #define PLAT_PHYS_OFFSET UL(0x00000000) 26 26 #elif defined(CONFIG_ARCH_MSM8X60) 27 - #define PLAT_PHYS_OFFSET UL(0x40200000) 27 + #define PLAT_PHYS_OFFSET UL(0x40000000) 28 28 #elif defined(CONFIG_ARCH_MSM8960) 29 - #define PLAT_PHYS_OFFSET UL(0x40200000) 29 + #define PLAT_PHYS_OFFSET UL(0x40000000) 30 30 #else 31 31 #define PLAT_PHYS_OFFSET UL(0x10000000) 32 32 #endif
+6
arch/arm/mach-msm/platsmp.c
··· 156 156 { 157 157 unsigned int i, ncores = get_core_count(); 158 158 159 + if (ncores > nr_cpu_ids) { 160 + pr_warn("SMP: %u cores greater than maximum (%u), clipping\n", 161 + ncores, nr_cpu_ids); 162 + ncores = nr_cpu_ids; 163 + } 164 + 159 165 for (i = 0; i < ncores; i++) 160 166 set_cpu_possible(i, true); 161 167
+2
arch/arm/mach-omap2/Kconfig
··· 36 36 select ARM_L1_CACHE_SHIFT_6 if !ARCH_OMAP4 37 37 select ARCH_HAS_OPP 38 38 select PM_OPP if PM 39 + select ARM_CPU_SUSPEND if PM 39 40 40 41 config ARCH_OMAP4 41 42 bool "TI OMAP4" ··· 51 50 select ARCH_HAS_OPP 52 51 select PM_OPP if PM 53 52 select USB_ARCH_HAS_EHCI 53 + select ARM_CPU_SUSPEND if PM 54 54 55 55 comment "OMAP Core Type" 56 56 depends on ARCH_OMAP2
+4 -6
arch/arm/mach-omap2/omap-smp.c
··· 109 109 ncores = scu_get_core_count(scu_base); 110 110 111 111 /* sanity check */ 112 - if (ncores > NR_CPUS) { 113 - printk(KERN_WARNING 114 - "OMAP4: no. of cores (%d) greater than configured " 115 - "maximum of %d - clipping\n", 116 - ncores, NR_CPUS); 117 - ncores = NR_CPUS; 112 + if (ncores > nr_cpu_ids) { 113 + pr_warn("SMP: %u cores greater than maximum (%u), clipping\n", 114 + ncores, nr_cpu_ids); 115 + ncores = nr_cpu_ids; 118 116 } 119 117 120 118 for (i = 0; i < ncores; i++)
+2
arch/arm/mach-pxa/irq.c
··· 19 19 #include <linux/io.h> 20 20 #include <linux/irq.h> 21 21 22 + #include <asm/exception.h> 23 + 22 24 #include <mach/hardware.h> 23 25 #include <mach/irqs.h> 24 26 #include <mach/gpio.h>
+4 -6
arch/arm/mach-realview/platsmp.c
··· 52 52 ncores = scu_base ? scu_get_core_count(scu_base) : 1; 53 53 54 54 /* sanity check */ 55 - if (ncores > NR_CPUS) { 56 - printk(KERN_WARNING 57 - "Realview: no. of cores (%d) greater than configured " 58 - "maximum of %d - clipping\n", 59 - ncores, NR_CPUS); 60 - ncores = NR_CPUS; 55 + if (ncores > nr_cpu_ids) { 56 + pr_warn("SMP: %u cores greater than maximum (%u), clipping\n", 57 + ncores, nr_cpu_ids); 58 + ncores = nr_cpu_ids; 61 59 } 62 60 63 61 for (i = 0; i < ncores; i++)
+12 -13
arch/arm/mach-rpc/include/mach/hardware.h
··· 36 36 37 37 #define EASI_SIZE 0x08000000 /* EASI I/O */ 38 38 #define EASI_START 0x08000000 39 - #define EASI_BASE 0xe5000000 39 + #define EASI_BASE IOMEM(0xe5000000) 40 40 41 41 #define IO_START 0x03000000 /* I/O */ 42 42 #define IO_SIZE 0x01000000 ··· 51 51 /* 52 52 * IO Addresses 53 53 */ 54 - #define VIDC_BASE IOMEM(0xe0400000) 55 - #define EXPMASK_BASE 0xe0360000 56 - #define IOMD_BASE IOMEM(0xe0200000) 57 - #define IOC_BASE IOMEM(0xe0200000) 58 - #define PCIO_BASE IOMEM(0xe0010000) 59 - #define FLOPPYDMA_BASE IOMEM(0xe002a000) 54 + #define ECARD_EASI_BASE (EASI_BASE) 55 + #define VIDC_BASE (IO_BASE + 0x00400000) 56 + #define EXPMASK_BASE (IO_BASE + 0x00360000) 57 + #define ECARD_IOC4_BASE (IO_BASE + 0x00270000) 58 + #define ECARD_IOC_BASE (IO_BASE + 0x00240000) 59 + #define IOMD_BASE (IO_BASE + 0x00200000) 60 + #define IOC_BASE (IO_BASE + 0x00200000) 61 + #define ECARD_MEMC8_BASE (IO_BASE + 0x0002b000) 62 + #define FLOPPYDMA_BASE (IO_BASE + 0x0002a000) 63 + #define PCIO_BASE (IO_BASE + 0x00010000) 64 + #define ECARD_MEMC_BASE (IO_BASE + 0x00000000) 60 65 61 66 #define vidc_writel(val) __raw_writel(val, VIDC_BASE) 62 - 63 - #define IO_EC_EASI_BASE 0x81400000 64 - #define IO_EC_IOC4_BASE 0x8009c000 65 - #define IO_EC_IOC_BASE 0x80090000 66 - #define IO_EC_MEMC8_BASE 0x8000ac00 67 - #define IO_EC_MEMC_BASE 0x80000000 68 67 69 68 #define NETSLOT_BASE 0x0302b000 70 69 #define NETSLOT_SIZE 0x00001000
+8 -185
arch/arm/mach-rpc/include/mach/io.h
··· 15 15 16 16 #include <mach/hardware.h> 17 17 18 - #define IO_SPACE_LIMIT 0xffffffff 18 + #define IO_SPACE_LIMIT 0xffff 19 19 20 20 /* 21 - * We use two different types of addressing - PC style addresses, and ARM 22 - * addresses. PC style accesses the PC hardware with the normal PC IO 23 - * addresses, eg 0x3f8 for serial#1. ARM addresses are 0x80000000+ 24 - * and are translated to the start of IO. Note that all addresses are 25 - * shifted left! 26 - */ 27 - #define __PORT_PCIO(x) (!((x) & 0x80000000)) 28 - 29 - /* 30 - * Dynamic IO functions. 31 - */ 32 - static inline void __outb (unsigned int value, unsigned int port) 33 - { 34 - unsigned long temp; 35 - __asm__ __volatile__( 36 - "tst %2, #0x80000000\n\t" 37 - "mov %0, %4\n\t" 38 - "addeq %0, %0, %3\n\t" 39 - "strb %1, [%0, %2, lsl #2] @ outb" 40 - : "=&r" (temp) 41 - : "r" (value), "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE) 42 - : "cc"); 43 - } 44 - 45 - static inline void __outw (unsigned int value, unsigned int port) 46 - { 47 - unsigned long temp; 48 - __asm__ __volatile__( 49 - "tst %2, #0x80000000\n\t" 50 - "mov %0, %4\n\t" 51 - "addeq %0, %0, %3\n\t" 52 - "str %1, [%0, %2, lsl #2] @ outw" 53 - : "=&r" (temp) 54 - : "r" (value|value<<16), "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE) 55 - : "cc"); 56 - } 57 - 58 - static inline void __outl (unsigned int value, unsigned int port) 59 - { 60 - unsigned long temp; 61 - __asm__ __volatile__( 62 - "tst %2, #0x80000000\n\t" 63 - "mov %0, %4\n\t" 64 - "addeq %0, %0, %3\n\t" 65 - "str %1, [%0, %2, lsl #2] @ outl" 66 - : "=&r" (temp) 67 - : "r" (value), "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE) 68 - : "cc"); 69 - } 70 - 71 - #define DECLARE_DYN_IN(sz,fnsuffix,instr) \ 72 - static inline unsigned sz __in##fnsuffix (unsigned int port) \ 73 - { \ 74 - unsigned long temp, value; \ 75 - __asm__ __volatile__( \ 76 - "tst %2, #0x80000000\n\t" \ 77 - "mov %0, %4\n\t" \ 78 - "addeq %0, %0, %3\n\t" \ 79 - "ldr" instr " %1, [%0, %2, lsl #2] @ in" #fnsuffix \ 80 - : "=&r" (temp), "=r" (value) \ 81 - : "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE) \ 82 - : "cc"); \ 83 - return (unsigned sz)value; \ 84 - } 85 - 86 - static inline void __iomem *__deprecated __ioaddr(unsigned int port) 87 - { 88 - void __iomem *ret; 89 - if (__PORT_PCIO(port)) 90 - ret = PCIO_BASE; 91 - else 92 - ret = IO_BASE; 93 - return ret + (port << 2); 94 - } 95 - 96 - #define DECLARE_IO(sz,fnsuffix,instr) \ 97 - DECLARE_DYN_IN(sz,fnsuffix,instr) 98 - 99 - DECLARE_IO(char,b,"b") 100 - DECLARE_IO(short,w,"") 101 - DECLARE_IO(int,l,"") 102 - 103 - #undef DECLARE_IO 104 - #undef DECLARE_DYN_IN 105 - 106 - /* 107 - * Constant address IO functions 21 + * We need PC style IO addressing for: 22 + * - floppy (at 0x3f2,0x3f4,0x3f5,0x3f7) 23 + * - parport (at 0x278-0x27a, 0x27b-0x27f, 0x778-0x77a) 24 + * - 8250 serial (only for compile) 108 25 * 109 - * These have to be macros for the 'J' constraint to work - 110 - * +/-4096 immediate operand. 26 + * These peripherals are found in an area of MMIO which looks very much 27 + * like an ISA bus, but with registers at the low byte of each word. 111 28 */ 112 - #define __outbc(value,port) \ 113 - ({ \ 114 - if (__PORT_PCIO((port))) \ 115 - __asm__ __volatile__( \ 116 - "strb %0, [%1, %2] @ outbc" \ 117 - : : "r" (value), "r" (PCIO_BASE), "Jr" ((port) << 2)); \ 118 - else \ 119 - __asm__ __volatile__( \ 120 - "strb %0, [%1, %2] @ outbc" \ 121 - : : "r" (value), "r" (IO_BASE), "r" ((port) << 2)); \ 122 - }) 123 - 124 - #define __inbc(port) \ 125 - ({ \ 126 - unsigned char result; \ 127 - if (__PORT_PCIO((port))) \ 128 - __asm__ __volatile__( \ 129 - "ldrb %0, [%1, %2] @ inbc" \ 130 - : "=r" (result) : "r" (PCIO_BASE), "Jr" ((port) << 2)); \ 131 - else \ 132 - __asm__ __volatile__( \ 133 - "ldrb %0, [%1, %2] @ inbc" \ 134 - : "=r" (result) : "r" (IO_BASE), "r" ((port) << 2)); \ 135 - result; \ 136 - }) 137 - 138 - #define __outwc(value,port) \ 139 - ({ \ 140 - unsigned long __v = value; \ 141 - if (__PORT_PCIO((port))) \ 142 - __asm__ __volatile__( \ 143 - "str %0, [%1, %2] @ outwc" \ 144 - : : "r" (__v|__v<<16), "r" (PCIO_BASE), "Jr" ((port) << 2)); \ 145 - else \ 146 - __asm__ __volatile__( \ 147 - "str %0, [%1, %2] @ outwc" \ 148 - : : "r" (__v|__v<<16), "r" (IO_BASE), "r" ((port) << 2)); \ 149 - }) 150 - 151 - #define __inwc(port) \ 152 - ({ \ 153 - unsigned short result; \ 154 - if (__PORT_PCIO((port))) \ 155 - __asm__ __volatile__( \ 156 - "ldr %0, [%1, %2] @ inwc" \ 157 - : "=r" (result) : "r" (PCIO_BASE), "Jr" ((port) << 2)); \ 158 - else \ 159 - __asm__ __volatile__( \ 160 - "ldr %0, [%1, %2] @ inwc" \ 161 - : "=r" (result) : "r" (IO_BASE), "r" ((port) << 2)); \ 162 - result & 0xffff; \ 163 - }) 164 - 165 - #define __outlc(value,port) \ 166 - ({ \ 167 - unsigned long __v = value; \ 168 - if (__PORT_PCIO((port))) \ 169 - __asm__ __volatile__( \ 170 - "str %0, [%1, %2] @ outlc" \ 171 - : : "r" (__v), "r" (PCIO_BASE), "Jr" ((port) << 2)); \ 172 - else \ 173 - __asm__ __volatile__( \ 174 - "str %0, [%1, %2] @ outlc" \ 175 - : : "r" (__v), "r" (IO_BASE), "r" ((port) << 2)); \ 176 - }) 177 - 178 - #define __inlc(port) \ 179 - ({ \ 180 - unsigned long result; \ 181 - if (__PORT_PCIO((port))) \ 182 - __asm__ __volatile__( \ 183 - "ldr %0, [%1, %2] @ inlc" \ 184 - : "=r" (result) : "r" (PCIO_BASE), "Jr" ((port) << 2)); \ 185 - else \ 186 - __asm__ __volatile__( \ 187 - "ldr %0, [%1, %2] @ inlc" \ 188 - : "=r" (result) : "r" (IO_BASE), "r" ((port) << 2)); \ 189 - result; \ 190 - }) 191 - 192 - #define inb(p) (__builtin_constant_p((p)) ? __inbc(p) : __inb(p)) 193 - #define inw(p) (__builtin_constant_p((p)) ? __inwc(p) : __inw(p)) 194 - #define inl(p) (__builtin_constant_p((p)) ? __inlc(p) : __inl(p)) 195 - #define outb(v,p) (__builtin_constant_p((p)) ? __outbc(v,p) : __outb(v,p)) 196 - #define outw(v,p) (__builtin_constant_p((p)) ? __outwc(v,p) : __outw(v,p)) 197 - #define outl(v,p) (__builtin_constant_p((p)) ? __outlc(v,p) : __outl(v,p)) 198 - 199 - /* the following macro is deprecated */ 200 - #define ioaddr(port) ((unsigned long)__ioaddr((port))) 201 - 202 - #define insb(p,d,l) __raw_readsb(__ioaddr(p),d,l) 203 - #define insw(p,d,l) __raw_readsw(__ioaddr(p),d,l) 204 - 205 - #define outsb(p,d,l) __raw_writesb(__ioaddr(p),d,l) 206 - #define outsw(p,d,l) __raw_writesw(__ioaddr(p),d,l) 29 + #define __io(a) (PCIO_BASE + ((a) << 2)) 207 30 208 31 /* 209 32 * 1:1 mapping for ioremapped regions.
+1 -1
arch/arm/mach-rpc/riscpc.c
··· 74 74 .length = IO_SIZE , 75 75 .type = MT_DEVICE 76 76 }, { /* EASI space */ 77 - .virtual = EASI_BASE, 77 + .virtual = (unsigned long)EASI_BASE, 78 78 .pfn = __phys_to_pfn(EASI_START), 79 79 .length = EASI_SIZE, 80 80 .type = MT_DEVICE
-2
arch/arm/mach-s3c2410/include/mach/io.h
··· 199 199 #define outw(v,p) (__builtin_constant_p((p)) ? __outwc(v,p) : __outw(v,p)) 200 200 #define outl(v,p) (__builtin_constant_p((p)) ? __outlc(v,p) : __outl(v,p)) 201 201 #define __ioaddr(p) (__builtin_constant_p((p)) ? __ioaddr(p) : __ioaddrc(p)) 202 - /* the following macro is deprecated */ 203 - #define ioaddr(port) __ioaddr((port)) 204 202 205 203 #define insb(p,d,l) __raw_readsb(__ioaddr(p),d,l) 206 204 #define insw(p,d,l) __raw_readsw(__ioaddr(p),d,l)
+2 -4
arch/arm/mach-sa1100/include/mach/io.h
··· 10 10 #ifndef __ASM_ARM_ARCH_IO_H 11 11 #define __ASM_ARM_ARCH_IO_H 12 12 13 - #define IO_SPACE_LIMIT 0xffffffff 14 - 15 13 /* 16 - * We don't actually have real ISA nor PCI buses, but there is so many 17 - * drivers out there that might just work if we fake them... 14 + * __io() is required to be an equivalent mapping to __mem_pci() for 15 + * SOC_COMMON to work. 18 16 */ 19 17 #define __io(a) __typesafe_io(a) 20 18 #define __mem_pci(a) (a)
+6
arch/arm/mach-shmobile/platsmp.c
··· 56 56 unsigned int ncores = shmobile_smp_get_core_count(); 57 57 unsigned int i; 58 58 59 + if (ncores > nr_cpu_ids) { 60 + pr_warn("SMP: %u cores greater than maximum (%u), clipping\n", 61 + ncores, nr_cpu_ids); 62 + ncores = nr_cpu_ids; 63 + } 64 + 59 65 for (i = 0; i < ncores; i++) 60 66 set_cpu_possible(i, true); 61 67
+4 -4
arch/arm/mach-tegra/platsmp.c
··· 114 114 { 115 115 unsigned int i, ncores = scu_get_core_count(scu_base); 116 116 117 - if (ncores > NR_CPUS) { 118 - printk(KERN_ERR "Tegra: no. of cores (%u) greater than configured (%u), clipping\n", 119 - ncores, NR_CPUS); 120 - ncores = NR_CPUS; 117 + if (ncores > nr_cpu_ids) { 118 + pr_warn("SMP: %u cores greater than maximum (%u), clipping\n", 119 + ncores, nr_cpu_ids); 120 + ncores = nr_cpu_ids; 121 121 } 122 122 123 123 for (i = 0; i < ncores; i++)
+4 -6
arch/arm/mach-ux500/platsmp.c
··· 156 156 ncores = scu_base ? scu_get_core_count(scu_base) : 1; 157 157 158 158 /* sanity check */ 159 - if (ncores > NR_CPUS) { 160 - printk(KERN_WARNING 161 - "U8500: no. of cores (%d) greater than configured " 162 - "maximum of %d - clipping\n", 163 - ncores, NR_CPUS); 164 - ncores = NR_CPUS; 159 + if (ncores > nr_cpu_ids) { 160 + pr_warn("SMP: %u cores greater than maximum (%u), clipping\n", 161 + ncores, nr_cpu_ids); 162 + ncores = nr_cpu_ids; 165 163 } 166 164 167 165 for (i = 0; i < ncores; i++)
+6
arch/arm/mach-vexpress/ct-ca9x4.c
··· 221 221 { 222 222 int i, ncores = scu_get_core_count(MMIO_P2V(A9_MPCORE_SCU)); 223 223 224 + if (ncores > nr_cpu_ids) { 225 + pr_warn("SMP: %u cores greater than maximum (%u), clipping\n", 226 + ncores, nr_cpu_ids); 227 + ncores = nr_cpu_ids; 228 + } 229 + 224 230 for (i = 0; i < ncores; ++i) 225 231 set_cpu_possible(i, true); 226 232
-2
arch/arm/mach-vexpress/include/mach/io.h
··· 20 20 #ifndef __ASM_ARM_ARCH_IO_H 21 21 #define __ASM_ARM_ARCH_IO_H 22 22 23 - #define IO_SPACE_LIMIT 0xffffffff 24 - 25 23 #define __io(a) __typesafe_io(a) 26 24 #define __mem_pci(a) (a) 27 25
-2
arch/arm/mach-vt8500/include/mach/io.h
··· 20 20 #ifndef __ASM_ARM_ARCH_IO_H 21 21 #define __ASM_ARM_ARCH_IO_H 22 22 23 - #define IO_SPACE_LIMIT 0xffff 24 - 25 23 #define __io(a) __typesafe_io((a) + 0xf0000000) 26 24 #define __mem_pci(a) (a) 27 25
+10 -10
arch/arm/mm/alignment.c
··· 86 86 #define UM_FIXUP (1 << 1) 87 87 #define UM_SIGNAL (1 << 2) 88 88 89 - #ifdef CONFIG_PROC_FS 90 - static const char *usermode_action[] = { 91 - "ignored", 92 - "warn", 93 - "fixup", 94 - "fixup+warn", 95 - "signal", 96 - "signal+warn" 97 - }; 98 - 99 89 /* Return true if and only if the ARMv6 unaligned access model is in use. */ 100 90 static bool cpu_is_v6_unaligned(void) 101 91 { ··· 112 122 113 123 return new_usermode; 114 124 } 125 + 126 + #ifdef CONFIG_PROC_FS 127 + static const char *usermode_action[] = { 128 + "ignored", 129 + "warn", 130 + "fixup", 131 + "fixup+warn", 132 + "signal", 133 + "signal+warn" 134 + }; 115 135 116 136 static int alignment_proc_show(struct seq_file *m, void *v) 117 137 {
+214 -2
arch/arm/mm/cache-l2x0.c
··· 16 16 * along with this program; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 18 */ 19 + #include <linux/err.h> 19 20 #include <linux/init.h> 20 21 #include <linux/spinlock.h> 21 22 #include <linux/io.h> 23 + #include <linux/of.h> 24 + #include <linux/of_address.h> 22 25 23 26 #include <asm/cacheflush.h> 24 27 #include <asm/hardware/cache-l2x0.h> ··· 33 30 static uint32_t l2x0_way_mask; /* Bitmask of active ways */ 34 31 static uint32_t l2x0_size; 35 32 33 + struct l2x0_regs l2x0_saved_regs; 34 + 35 + struct l2x0_of_data { 36 + void (*setup)(const struct device_node *, __u32 *, __u32 *); 37 + void (*save)(void); 38 + void (*resume)(void); 39 + }; 40 + 36 41 static inline void cache_wait_way(void __iomem *reg, unsigned long mask) 37 42 { 38 43 /* wait for cache operation by line or way to complete */ 39 44 while (readl_relaxed(reg) & mask) 40 - ; 45 + cpu_relax(); 41 46 } 42 47 43 48 #ifdef CONFIG_CACHE_PL310 ··· 288 277 spin_unlock_irqrestore(&l2x0_lock, flags); 289 278 } 290 279 291 - static void __init l2x0_unlock(__u32 cache_id) 280 + static void l2x0_unlock(__u32 cache_id) 292 281 { 293 282 int lockregs; 294 283 int i; ··· 364 353 /* l2x0 controller is disabled */ 365 354 writel_relaxed(aux, l2x0_base + L2X0_AUX_CTRL); 366 355 356 + l2x0_saved_regs.aux_ctrl = aux; 357 + 367 358 l2x0_inv_all(); 368 359 369 360 /* enable L2X0 */ ··· 385 372 printk(KERN_INFO "l2x0: %d ways, CACHE_ID 0x%08x, AUX_CTRL 0x%08x, Cache size: %d B\n", 386 373 ways, cache_id, aux, l2x0_size); 387 374 } 375 + 376 + #ifdef CONFIG_OF 377 + static void __init l2x0_of_setup(const struct device_node *np, 378 + __u32 *aux_val, __u32 *aux_mask) 379 + { 380 + u32 data[2] = { 0, 0 }; 381 + u32 tag = 0; 382 + u32 dirty = 0; 383 + u32 val = 0, mask = 0; 384 + 385 + of_property_read_u32(np, "arm,tag-latency", &tag); 386 + if (tag) { 387 + mask |= L2X0_AUX_CTRL_TAG_LATENCY_MASK; 388 + val |= (tag - 1) << L2X0_AUX_CTRL_TAG_LATENCY_SHIFT; 389 + } 390 + 391 + of_property_read_u32_array(np, "arm,data-latency", 392 + data, ARRAY_SIZE(data)); 393 + if (data[0] && data[1]) { 394 + mask |= L2X0_AUX_CTRL_DATA_RD_LATENCY_MASK | 395 + L2X0_AUX_CTRL_DATA_WR_LATENCY_MASK; 396 + val |= ((data[0] - 1) << L2X0_AUX_CTRL_DATA_RD_LATENCY_SHIFT) | 397 + ((data[1] - 1) << L2X0_AUX_CTRL_DATA_WR_LATENCY_SHIFT); 398 + } 399 + 400 + of_property_read_u32(np, "arm,dirty-latency", &dirty); 401 + if (dirty) { 402 + mask |= L2X0_AUX_CTRL_DIRTY_LATENCY_MASK; 403 + val |= (dirty - 1) << L2X0_AUX_CTRL_DIRTY_LATENCY_SHIFT; 404 + } 405 + 406 + *aux_val &= ~mask; 407 + *aux_val |= val; 408 + *aux_mask &= ~mask; 409 + } 410 + 411 + static void __init pl310_of_setup(const struct device_node *np, 412 + __u32 *aux_val, __u32 *aux_mask) 413 + { 414 + u32 data[3] = { 0, 0, 0 }; 415 + u32 tag[3] = { 0, 0, 0 }; 416 + u32 filter[2] = { 0, 0 }; 417 + 418 + of_property_read_u32_array(np, "arm,tag-latency", tag, ARRAY_SIZE(tag)); 419 + if (tag[0] && tag[1] && tag[2]) 420 + writel_relaxed( 421 + ((tag[0] - 1) << L2X0_LATENCY_CTRL_RD_SHIFT) | 422 + ((tag[1] - 1) << L2X0_LATENCY_CTRL_WR_SHIFT) | 423 + ((tag[2] - 1) << L2X0_LATENCY_CTRL_SETUP_SHIFT), 424 + l2x0_base + L2X0_TAG_LATENCY_CTRL); 425 + 426 + of_property_read_u32_array(np, "arm,data-latency", 427 + data, ARRAY_SIZE(data)); 428 + if (data[0] && data[1] && data[2]) 429 + writel_relaxed( 430 + ((data[0] - 1) << L2X0_LATENCY_CTRL_RD_SHIFT) | 431 + ((data[1] - 1) << L2X0_LATENCY_CTRL_WR_SHIFT) | 432 + ((data[2] - 1) << L2X0_LATENCY_CTRL_SETUP_SHIFT), 433 + l2x0_base + L2X0_DATA_LATENCY_CTRL); 434 + 435 + of_property_read_u32_array(np, "arm,filter-ranges", 436 + filter, ARRAY_SIZE(filter)); 437 + if (filter[1]) { 438 + writel_relaxed(ALIGN(filter[0] + filter[1], SZ_1M), 439 + l2x0_base + L2X0_ADDR_FILTER_END); 440 + writel_relaxed((filter[0] & ~(SZ_1M - 1)) | L2X0_ADDR_FILTER_EN, 441 + l2x0_base + L2X0_ADDR_FILTER_START); 442 + } 443 + } 444 + 445 + static void __init pl310_save(void) 446 + { 447 + u32 l2x0_revision = readl_relaxed(l2x0_base + L2X0_CACHE_ID) & 448 + L2X0_CACHE_ID_RTL_MASK; 449 + 450 + l2x0_saved_regs.tag_latency = readl_relaxed(l2x0_base + 451 + L2X0_TAG_LATENCY_CTRL); 452 + l2x0_saved_regs.data_latency = readl_relaxed(l2x0_base + 453 + L2X0_DATA_LATENCY_CTRL); 454 + l2x0_saved_regs.filter_end = readl_relaxed(l2x0_base + 455 + L2X0_ADDR_FILTER_END); 456 + l2x0_saved_regs.filter_start = readl_relaxed(l2x0_base + 457 + L2X0_ADDR_FILTER_START); 458 + 459 + if (l2x0_revision >= L2X0_CACHE_ID_RTL_R2P0) { 460 + /* 461 + * From r2p0, there is Prefetch offset/control register 462 + */ 463 + l2x0_saved_regs.prefetch_ctrl = readl_relaxed(l2x0_base + 464 + L2X0_PREFETCH_CTRL); 465 + /* 466 + * From r3p0, there is Power control register 467 + */ 468 + if (l2x0_revision >= L2X0_CACHE_ID_RTL_R3P0) 469 + l2x0_saved_regs.pwr_ctrl = readl_relaxed(l2x0_base + 470 + L2X0_POWER_CTRL); 471 + } 472 + } 473 + 474 + static void l2x0_resume(void) 475 + { 476 + if (!(readl_relaxed(l2x0_base + L2X0_CTRL) & 1)) { 477 + /* restore aux ctrl and enable l2 */ 478 + l2x0_unlock(readl_relaxed(l2x0_base + L2X0_CACHE_ID)); 479 + 480 + writel_relaxed(l2x0_saved_regs.aux_ctrl, l2x0_base + 481 + L2X0_AUX_CTRL); 482 + 483 + l2x0_inv_all(); 484 + 485 + writel_relaxed(1, l2x0_base + L2X0_CTRL); 486 + } 487 + } 488 + 489 + static void pl310_resume(void) 490 + { 491 + u32 l2x0_revision; 492 + 493 + if (!(readl_relaxed(l2x0_base + L2X0_CTRL) & 1)) { 494 + /* restore pl310 setup */ 495 + writel_relaxed(l2x0_saved_regs.tag_latency, 496 + l2x0_base + L2X0_TAG_LATENCY_CTRL); 497 + writel_relaxed(l2x0_saved_regs.data_latency, 498 + l2x0_base + L2X0_DATA_LATENCY_CTRL); 499 + writel_relaxed(l2x0_saved_regs.filter_end, 500 + l2x0_base + L2X0_ADDR_FILTER_END); 501 + writel_relaxed(l2x0_saved_regs.filter_start, 502 + l2x0_base + L2X0_ADDR_FILTER_START); 503 + 504 + l2x0_revision = readl_relaxed(l2x0_base + L2X0_CACHE_ID) & 505 + L2X0_CACHE_ID_RTL_MASK; 506 + 507 + if (l2x0_revision >= L2X0_CACHE_ID_RTL_R2P0) { 508 + writel_relaxed(l2x0_saved_regs.prefetch_ctrl, 509 + l2x0_base + L2X0_PREFETCH_CTRL); 510 + if (l2x0_revision >= L2X0_CACHE_ID_RTL_R3P0) 511 + writel_relaxed(l2x0_saved_regs.pwr_ctrl, 512 + l2x0_base + L2X0_POWER_CTRL); 513 + } 514 + } 515 + 516 + l2x0_resume(); 517 + } 518 + 519 + static const struct l2x0_of_data pl310_data = { 520 + pl310_of_setup, 521 + pl310_save, 522 + pl310_resume, 523 + }; 524 + 525 + static const struct l2x0_of_data l2x0_data = { 526 + l2x0_of_setup, 527 + NULL, 528 + l2x0_resume, 529 + }; 530 + 531 + static const struct of_device_id l2x0_ids[] __initconst = { 532 + { .compatible = "arm,pl310-cache", .data = (void *)&pl310_data }, 533 + { .compatible = "arm,l220-cache", .data = (void *)&l2x0_data }, 534 + { .compatible = "arm,l210-cache", .data = (void *)&l2x0_data }, 535 + {} 536 + }; 537 + 538 + int __init l2x0_of_init(__u32 aux_val, __u32 aux_mask) 539 + { 540 + struct device_node *np; 541 + struct l2x0_of_data *data; 542 + struct resource res; 543 + 544 + np = of_find_matching_node(NULL, l2x0_ids); 545 + if (!np) 546 + return -ENODEV; 547 + 548 + if (of_address_to_resource(np, 0, &res)) 549 + return -ENODEV; 550 + 551 + l2x0_base = ioremap(res.start, resource_size(&res)); 552 + if (!l2x0_base) 553 + return -ENOMEM; 554 + 555 + l2x0_saved_regs.phy_base = res.start; 556 + 557 + data = of_match_node(l2x0_ids, np)->data; 558 + 559 + /* L2 configuration can only be changed if the cache is disabled */ 560 + if (!(readl_relaxed(l2x0_base + L2X0_CTRL) & 1)) { 561 + if (data->setup) 562 + data->setup(np, &aux_val, &aux_mask); 563 + } 564 + 565 + if (data->save) 566 + data->save(); 567 + 568 + l2x0_init(l2x0_base, aux_val, aux_mask); 569 + 570 + outer_cache.resume = data->resume; 571 + return 0; 572 + } 573 + #endif
+3 -3
arch/arm/mm/dma-mapping.c
··· 123 123 #endif 124 124 125 125 #define CONSISTENT_OFFSET(x) (((unsigned long)(x) - CONSISTENT_BASE) >> PAGE_SHIFT) 126 - #define CONSISTENT_PTE_INDEX(x) (((unsigned long)(x) - CONSISTENT_BASE) >> PGDIR_SHIFT) 127 - #define NUM_CONSISTENT_PTES (CONSISTENT_DMA_SIZE >> PGDIR_SHIFT) 126 + #define CONSISTENT_PTE_INDEX(x) (((unsigned long)(x) - CONSISTENT_BASE) >> PMD_SHIFT) 127 + #define NUM_CONSISTENT_PTES (CONSISTENT_DMA_SIZE >> PMD_SHIFT) 128 128 129 129 /* 130 130 * These are the page tables (2MB each) covering uncached, DMA consistent allocations ··· 183 183 } 184 184 185 185 consistent_pte[i++] = pte; 186 - base += (1 << PGDIR_SHIFT); 186 + base += PMD_SIZE; 187 187 } while (base < CONSISTENT_END); 188 188 189 189 return ret;
+1
arch/arm/mm/fault.c
··· 20 20 #include <linux/highmem.h> 21 21 #include <linux/perf_event.h> 22 22 23 + #include <asm/exception.h> 23 24 #include <asm/system.h> 24 25 #include <asm/pgtable.h> 25 26 #include <asm/tlbflush.h>
+2 -2
arch/arm/mm/mm.h
··· 12 12 13 13 struct mem_type { 14 14 pteval_t prot_pte; 15 - unsigned int prot_l1; 16 - unsigned int prot_sect; 15 + pmdval_t prot_l1; 16 + pmdval_t prot_sect; 17 17 unsigned int domain; 18 18 }; 19 19
+10 -8
arch/arm/mm/mmu.c
··· 60 60 struct cachepolicy { 61 61 const char policy[16]; 62 62 unsigned int cr_mask; 63 - unsigned int pmd; 63 + pmdval_t pmd; 64 64 pteval_t pte; 65 65 }; 66 66 ··· 288 288 { 289 289 struct cachepolicy *cp; 290 290 unsigned int cr = get_cr(); 291 - unsigned int user_pgprot, kern_pgprot, vecs_pgprot; 291 + pteval_t user_pgprot, kern_pgprot, vecs_pgprot; 292 292 int cpu_arch = cpu_architecture(); 293 293 int i; 294 294 ··· 863 863 /* 864 864 * Clear out all the mappings below the kernel image. 865 865 */ 866 - for (addr = 0; addr < MODULES_VADDR; addr += PGDIR_SIZE) 866 + for (addr = 0; addr < MODULES_VADDR; addr += PMD_SIZE) 867 867 pmd_clear(pmd_off_k(addr)); 868 868 869 869 #ifdef CONFIG_XIP_KERNEL 870 870 /* The XIP kernel is mapped in the module area -- skip over it */ 871 - addr = ((unsigned long)_etext + PGDIR_SIZE - 1) & PGDIR_MASK; 871 + addr = ((unsigned long)_etext + PMD_SIZE - 1) & PMD_MASK; 872 872 #endif 873 - for ( ; addr < PAGE_OFFSET; addr += PGDIR_SIZE) 873 + for ( ; addr < PAGE_OFFSET; addr += PMD_SIZE) 874 874 pmd_clear(pmd_off_k(addr)); 875 875 876 876 /* ··· 885 885 * memory bank, up to the end of the vmalloc region. 886 886 */ 887 887 for (addr = __phys_to_virt(end); 888 - addr < VMALLOC_END; addr += PGDIR_SIZE) 888 + addr < VMALLOC_END; addr += PMD_SIZE) 889 889 pmd_clear(pmd_off_k(addr)); 890 890 } 891 + 892 + #define SWAPPER_PG_DIR_SIZE (PTRS_PER_PGD * sizeof(pgd_t)) 891 893 892 894 /* 893 895 * Reserve the special regions of memory ··· 900 898 * Reserve the page tables. These are already in use, 901 899 * and can only be in node 0. 902 900 */ 903 - memblock_reserve(__pa(swapper_pg_dir), PTRS_PER_PGD * sizeof(pgd_t)); 901 + memblock_reserve(__pa(swapper_pg_dir), SWAPPER_PG_DIR_SIZE); 904 902 905 903 #ifdef CONFIG_SA1111 906 904 /* ··· 928 926 */ 929 927 vectors_page = early_alloc(PAGE_SIZE); 930 928 931 - for (addr = VMALLOC_END; addr; addr += PGDIR_SIZE) 929 + for (addr = VMALLOC_END; addr; addr += PMD_SIZE) 932 930 pmd_clear(pmd_off_k(addr)); 933 931 934 932 /*
+1 -1
arch/arm/mm/proc-v7.S
··· 218 218 /* Suspend/resume support: derived from arch/arm/mach-s5pv210/sleep.S */ 219 219 .globl cpu_v7_suspend_size 220 220 .equ cpu_v7_suspend_size, 4 * 9 221 - #ifdef CONFIG_PM_SLEEP 221 + #ifdef CONFIG_ARM_CPU_SUSPEND 222 222 ENTRY(cpu_v7_do_suspend) 223 223 stmfd sp!, {r4 - r11, lr} 224 224 mrc p15, 0, r4, c13, c0, 0 @ FCSE/PID
+1
arch/arm/plat-omap/Kconfig
··· 14 14 select CLKDEV_LOOKUP 15 15 select CLKSRC_MMIO 16 16 select GENERIC_IRQ_CHIP 17 + select HAVE_IDE 17 18 help 18 19 "Systems based on omap7xx, omap15xx or omap16xx" 19 20
+1 -1
arch/arm/vfp/Makefile
··· 7 7 # ccflags-y := -DDEBUG 8 8 # asflags-y := -DDEBUG 9 9 10 - KBUILD_AFLAGS :=$(KBUILD_AFLAGS:-msoft-float=-Wa,-mfpu=softvfp+vfp) 10 + KBUILD_AFLAGS :=$(KBUILD_AFLAGS:-msoft-float=-Wa,-mfpu=softvfp+vfp -mfloat-abi=soft) 11 11 LDFLAGS +=--no-warn-mismatch 12 12 13 13 obj-y += vfp.o
+2 -2
lib/Kconfig.debug
··· 1081 1081 depends on FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT 1082 1082 depends on !X86_64 1083 1083 select STACKTRACE 1084 - select FRAME_POINTER if !PPC && !S390 && !MICROBLAZE 1084 + select FRAME_POINTER if !PPC && !S390 && !MICROBLAZE && !ARM_UNWIND 1085 1085 help 1086 1086 Provide stacktrace filter for fault-injection capabilities 1087 1087 ··· 1091 1091 depends on DEBUG_KERNEL 1092 1092 depends on STACKTRACE_SUPPORT 1093 1093 depends on PROC_FS 1094 - select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE 1094 + select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM_UNWIND 1095 1095 select KALLSYMS 1096 1096 select KALLSYMS_ALL 1097 1097 select STACKTRACE