···11+* ARM L2 Cache Controller22+33+ARM cores often have a separate level 2 cache controller. There are various44+implementations of the L2 cache controller with compatible programming models.55+The ARM L2 cache representation in the device tree should be done as follows:66+77+Required properties:88+99+- compatible : should be one of:1010+ "arm,pl310-cache"1111+ "arm,l220-cache"1212+ "arm,l210-cache"1313+- cache-unified : Specifies the cache is a unified cache.1414+- cache-level : Should be set to 2 for a level 2 cache.1515+- reg : Physical base address and size of cache controller's memory mapped1616+ registers.1717+1818+Optional properties:1919+2020+- arm,data-latency : Cycles of latency for Data RAM accesses. Specifies 3 cells of2121+ read, write and setup latencies. Minimum valid values are 1. Controllers2222+ without setup latency control should use a value of 0.2323+- arm,tag-latency : Cycles of latency for Tag RAM accesses. Specifies 3 cells of2424+ read, write and setup latencies. Controllers without setup latency control2525+ should use 0. Controllers without separate read and write Tag RAM latency2626+ values should only use the first cell.2727+- arm,dirty-latency : Cycles of latency for Dirty RAMs. This is a single cell.2828+- arm,filter-ranges : <start length> Starting address and length of window to2929+ filter. Addresses in the filter window are directed to the M1 port. Other3030+ addresses will go to the M0 port.3131+- interrupts : 1 combined interrupt.3232+3333+Example:3434+3535+L2: cache-controller {3636+ compatible = "arm,pl310-cache";3737+ reg = <0xfff12000 0x1000>;3838+ arm,data-latency = <1 1 1>;3939+ arm,tag-latency = <2 2 2>;4040+ arm,filter-latency = <0x80000000 0x8000000>;4141+ cache-unified;4242+ cache-level = <2>;4343+ interrupts = <45>;4444+};
+43-12
arch/arm/Kconfig
···33 default y44 select HAVE_AOUT55 select HAVE_DMA_API_DEBUG66- select HAVE_IDE66+ select HAVE_IDE if PCI || ISA || PCMCIA77 select HAVE_MEMBLOCK88 select RTC_LIB99 select SYS_SUPPORTS_APM_EMULATION···195195 The base address of exception vectors.196196197197config ARM_PATCH_PHYS_VIRT198198- bool "Patch physical to virtual translations at runtime"198198+ bool "Patch physical to virtual translations at runtime" if EMBEDDED199199+ default y199200 depends on !XIP_KERNEL && MMU200201 depends on !ARCH_REALVIEW || !SPARSEMEM201202 help···205204 kernel in system memory.206205207206 This can only be used with non-XIP MMU kernels where the base208208- of physical memory is at a 16MB boundary, or theoretically 64K209209- for the MSM machine class.207207+ of physical memory is at a 16MB boundary.210208211211-config ARM_PATCH_PHYS_VIRT_16BIT212212- def_bool y213213- depends on ARM_PATCH_PHYS_VIRT && ARCH_MSM214214- help215215- This option extends the physical to virtual translation patching216216- to allow physical memory down to a theoretical minimum of 64K217217- boundaries.209209+ Only disable this option if you know that you do not require210210+ this feature (eg, building a kernel for a single machine) and211211+ you need to shrink the kernel to the minimal size.212212+218213219214source "init/Kconfig"220215···298301 select ARCH_REQUIRE_GPIOLIB299302 select HAVE_CLK300303 select CLKDEV_LOOKUP301301- select ARM_PATCH_PHYS_VIRT if MMU302304 help303305 This enables support for systems based on the Atmel AT91RM9200,304306 AT91SAM9 and AT91CAP9 processors.···381385 select CPU_SA110382386 select FOOTBRIDGE383387 select GENERIC_CLOCKEVENTS388388+ select HAVE_IDE384389 help385390 Support for systems based on the DC21285 companion chip386391 ("FootBridge"), such as the Simtec CATS and the Rebel NetWinder.···628631 select SPARSE_IRQ629632 select AUTO_ZRELADDR630633 select MULTI_IRQ_HANDLER634634+ select ARM_CPU_SUSPEND if PM635635+ select HAVE_IDE631636 help632637 Support for Intel/Marvell's PXA2xx/PXA3xx processor line.633638···670671 select NO_IOPORT671672 select ARCH_SPARSEMEM_ENABLE672673 select ARCH_USES_GETTIMEOFFSET674674+ select HAVE_IDE673675 help674676 On the Acorn Risc-PC, Linux can support the internal IDE disk and675677 CD-ROM interface, serial and parallel port, and the floppy drive.···689689 select HAVE_SCHED_CLOCK690690 select TICK_ONESHOT691691 select ARCH_REQUIRE_GPIOLIB692692+ select HAVE_IDE692693 help693694 Support for StrongARM 11x0 based boards.694695···13761375 MACH_REALVIEW_PB11MP || MACH_REALVIEW_PBX || ARCH_OMAP4 || \13771376 ARCH_EXYNOS4 || ARCH_TEGRA || ARCH_U8500 || ARCH_VEXPRESS_CA9X4 || \13781377 ARCH_MSM_SCORPIONMP || ARCH_SHMOBILE13781378+ depends on MMU13791379 select USE_GENERIC_SMP_HELPERS13801380 select HAVE_ARM_SCU if !ARCH_MSM_SCORPIONMP13811381 help···14081406 savings.1409140714101408 If you don't know what to do here, say Y.14091409+14101410+config ARM_CPU_TOPOLOGY14111411+ bool "Support cpu topology definition"14121412+ depends on SMP && CPU_V714131413+ default y14141414+ help14151415+ Support ARM cpu topology definition. The MPIDR register defines14161416+ affinity between processors which is then used to describe the cpu14171417+ topology of an ARM System.14181418+14191419+config SCHED_MC14201420+ bool "Multi-core scheduler support"14211421+ depends on ARM_CPU_TOPOLOGY14221422+ help14231423+ Multi-core scheduler support improves the CPU scheduler's decision14241424+ making when dealing with multi-core CPU chips at a cost of slightly14251425+ increased overhead in some places. If unsure say N here.14261426+14271427+config SCHED_SMT14281428+ bool "SMT scheduler support"14291429+ depends on ARM_CPU_TOPOLOGY14301430+ help14311431+ Improves the CPU scheduler's decision making when dealing with14321432+ MultiThreading at a cost of slightly increased overhead in some14331433+ places. If unsure say N here.1411143414121435config HAVE_ARM_SCU14131436 bool···15091482 depends on CPU_V7 && !CPU_V6 && !CPU_V6K && EXPERIMENTAL15101483 select AEABI15111484 select ARM_ASM_UNIFIED14851485+ select ARM_UNWIND15121486 help15131487 By enabling this option, the kernel will be compiled in15141488 Thumb-2 mode. A compiler/assembler that understand the unified···21282100 depends on CPU_ARM920T || CPU_ARM926T || CPU_SA1100 || \21292101 CPU_V6 || CPU_V6K || CPU_V7 || CPU_XSC3 || CPU_XSCALE21302102 def_bool y21032103+21042104+config ARM_CPU_SUSPEND21052105+ def_bool PM_SLEEP2131210621322107endmenu21332108
+60-31
arch/arm/Kconfig.debug
···65656666# These options are only for real kernel hackers who want to get their hands dirty.6767config DEBUG_LL6868- bool "Kernel low-level debugging functions"6868+ bool "Kernel low-level debugging functions (read help!)"6969 depends on DEBUG_KERNEL7070 help7171 Say Y here to include definitions of printascii, printch, printhex7272 in the kernel. This is helpful if you are debugging code that7373 executes before the console is initialized.7474+7575+ Note that selecting this option will limit the kernel to a single7676+ UART definition, as specified below. Attempting to boot the kernel7777+ image on a different platform *will not work*, so this option should7878+ not be enabled for kernels that are intended to be portable.7979+8080+choice8181+ prompt "Kernel low-level debugging port"8282+ depends on DEBUG_LL8383+8484+ config DEBUG_LL_UART_NONE8585+ bool "No low-level debugging UART"8686+ help8787+ Say Y here if your platform doesn't provide a UART option8888+ below. This relies on your platform choosing the right UART8989+ definition internally in order for low-level debugging to9090+ work.9191+9292+ config DEBUG_ICEDCC9393+ bool "Kernel low-level debugging via EmbeddedICE DCC channel"9494+ help9595+ Say Y here if you want the debug print routines to direct9696+ their output to the EmbeddedICE macrocell's DCC channel using9797+ co-processor 14. This is known to work on the ARM9 style ICE9898+ channel and on the XScale with the PEEDI.9999+100100+ Note that the system will appear to hang during boot if there101101+ is nothing connected to read from the DCC.102102+103103+ config DEBUG_FOOTBRIDGE_COM1104104+ bool "Kernel low-level debugging messages via footbridge 8250 at PCI COM1"105105+ depends on FOOTBRIDGE106106+ help107107+ Say Y here if you want the debug print routines to direct108108+ their output to the 8250 at PCI COM1.109109+110110+ config DEBUG_DC21285_PORT111111+ bool "Kernel low-level debugging messages via footbridge serial port"112112+ depends on FOOTBRIDGE113113+ help114114+ Say Y here if you want the debug print routines to direct115115+ their output to the serial port in the DC21285 (Footbridge).116116+117117+ config DEBUG_CLPS711X_UART1118118+ bool "Kernel low-level debugging messages via UART1"119119+ depends on ARCH_CLPS711X120120+ help121121+ Say Y here if you want the debug print routines to direct122122+ their output to the first serial port on these devices.123123+124124+ config DEBUG_CLPS711X_UART2125125+ bool "Kernel low-level debugging messages via UART2"126126+ depends on ARCH_CLPS711X127127+ help128128+ Say Y here if you want the debug print routines to direct129129+ their output to the second serial port on these devices.130130+131131+endchoice7413275133config EARLY_PRINTK76134 bool "Early printk"···13880 kernel low-level debugging functions. Add earlyprintk to your13981 kernel parameters to enable this console.14082141141-config DEBUG_ICEDCC142142- bool "Kernel low-level debugging via EmbeddedICE DCC channel"143143- depends on DEBUG_LL144144- help145145- Say Y here if you want the debug print routines to direct their146146- output to the EmbeddedICE macrocell's DCC channel using147147- co-processor 14. This is known to work on the ARM9 style ICE148148- channel and on the XScale with the PEEDI.149149-150150- It does include a timeout to ensure that the system does not151151- totally freeze when there is nothing connected to read.152152-15383config OC_ETM15484 bool "On-chip ETM and ETB"155155- select ARM_AMBA8585+ depends on ARM_AMBA15686 help15787 Enables the on-chip embedded trace macrocell and embedded trace15888 buffer driver that will allow you to collect traces of the15989 kernel code.160160-161161-config DEBUG_DC21285_PORT162162- bool "Kernel low-level debugging messages via footbridge serial port"163163- depends on DEBUG_LL && FOOTBRIDGE164164- help165165- Say Y here if you want the debug print routines to direct their166166- output to the serial port in the DC21285 (Footbridge). Saying N167167- will cause the debug messages to appear on the first 16550168168- serial port.169169-170170-config DEBUG_CLPS711X_UART2171171- bool "Kernel low-level debugging messages via UART2"172172- depends on DEBUG_LL && ARCH_CLPS711X173173- help174174- Say Y here if you want the debug print routines to direct their175175- output to the second serial port on these devices. Saying N will176176- cause the debug messages to appear on the first serial port.1779017891config DEBUG_S3C_UART17992 depends on PLAT_SAMSUNG
+3
arch/arm/Makefile
···128128ifeq ($(CONFIG_ARCH_SA1100),y)129129textofs-$(CONFIG_SA1111) := 0x00208000130130endif131131+textofs-$(CONFIG_ARCH_MSM7X30) := 0x00208000132132+textofs-$(CONFIG_ARCH_MSM8X60) := 0x00208000133133+textofs-$(CONFIG_ARCH_MSM8960) := 0x00208000131134132135# Machine directory name. This list is sorted alphanumerically133136# by CONFIG_* macro name.
+14-3
arch/arm/common/gic.c
···180180 return -EINVAL;181181182182 mask = 0xff << shift;183183- bit = 1 << (cpu + shift);183183+ bit = 1 << (cpu_logical_map(cpu) + shift);184184185185 spin_lock(&irq_controller_lock);186186 val = readl_relaxed(reg) & ~mask;···259259 unsigned int irq_start)260260{261261 unsigned int gic_irqs, irq_limit, i;262262+ u32 cpumask;262263 void __iomem *base = gic->dist_base;263263- u32 cpumask = 1 << smp_processor_id();264264+ u32 cpu = 0;264265266266+#ifdef CONFIG_SMP267267+ cpu = cpu_logical_map(smp_processor_id());268268+#endif269269+270270+ cpumask = 1 << cpu;265271 cpumask |= cpumask << 8;266272 cpumask |= cpumask << 16;267273···388382#ifdef CONFIG_SMP389383void gic_raise_softirq(const struct cpumask *mask, unsigned int irq)390384{391391- unsigned long map = *cpus_addr(*mask);385385+ int cpu;386386+ unsigned long map = 0;387387+388388+ /* Convert our logical CPU mask into a physical one. */389389+ for_each_cpu(cpu, mask)390390+ map |= 1 << cpu_logical_map(cpu);392391393392 /*394393 * Ensure that stores to Normal memory are visible to the
+2-1
arch/arm/common/vic.c
···346346347347 /* Identify which VIC cell this one is, by reading the ID */348348 for (i = 0; i < 4; i++) {349349- u32 addr = ((u32)base & PAGE_MASK) + 0xfe0 + (i * 4);349349+ void __iomem *addr;350350+ addr = (void __iomem *)((u32)base & PAGE_MASK) + 0xfe0 + (i * 4);350351 cellid |= (readl(addr) & 0xff) << (8 * i);351352 }352353 vendor = (cellid >> 12) & 0xff;
···161161162162 /* Private internal data */163163 const char *card_desc; /* Card description */164164- CONST unsigned int podaddr; /* Base Linux address for card */165164 CONST loader_t loader; /* loader program */166165 u64 dma_mask;167166};
+19
arch/arm/include/asm/exception.h
···11+/*22+ * Annotations for marking C functions as exception handlers.33+ *44+ * These should only be used for C functions that are called from the low55+ * level exception entry code and not any intervening C code.66+ */77+#ifndef __ASM_ARM_EXCEPTION_H88+#define __ASM_ARM_EXCEPTION_H99+1010+#include <linux/ftrace.h>1111+1212+#define __exception __attribute__((section(".exception.text")))1313+#ifdef CONFIG_FUNCTION_GRAPH_TRACER1414+#define __exception_irq_entry __irq_entry1515+#else1616+#define __exception_irq_entry __exception1717+#endif1818+1919+#endif /* __ASM_ARM_EXCEPTION_H */
+42
arch/arm/include/asm/hardware/cache-l2x0.h
···5252#define L2X0_LOCKDOWN_WAY_D_BASE 0x9005353#define L2X0_LOCKDOWN_WAY_I_BASE 0x9045454#define L2X0_LOCKDOWN_STRIDE 0x085555+#define L2X0_ADDR_FILTER_START 0xC005656+#define L2X0_ADDR_FILTER_END 0xC045557#define L2X0_TEST_OPERATION 0xF005658#define L2X0_LINE_DATA 0xF105759#define L2X0_LINE_TAG 0xF30···6765#define L2X0_CACHE_ID_PART_MASK (0xf << 6)6866#define L2X0_CACHE_ID_PART_L210 (1 << 6)6967#define L2X0_CACHE_ID_PART_L310 (3 << 6)6868+#define L2X0_CACHE_ID_RTL_MASK 0x3f6969+#define L2X0_CACHE_ID_RTL_R0P0 0x07070+#define L2X0_CACHE_ID_RTL_R1P0 0x27171+#define L2X0_CACHE_ID_RTL_R2P0 0x47272+#define L2X0_CACHE_ID_RTL_R3P0 0x57373+#define L2X0_CACHE_ID_RTL_R3P1 0x67474+#define L2X0_CACHE_ID_RTL_R3P2 0x870757176#define L2X0_AUX_CTRL_MASK 0xc0000fff7777+#define L2X0_AUX_CTRL_DATA_RD_LATENCY_SHIFT 07878+#define L2X0_AUX_CTRL_DATA_RD_LATENCY_MASK 0x77979+#define L2X0_AUX_CTRL_DATA_WR_LATENCY_SHIFT 38080+#define L2X0_AUX_CTRL_DATA_WR_LATENCY_MASK (0x7 << 3)8181+#define L2X0_AUX_CTRL_TAG_LATENCY_SHIFT 68282+#define L2X0_AUX_CTRL_TAG_LATENCY_MASK (0x7 << 6)8383+#define L2X0_AUX_CTRL_DIRTY_LATENCY_SHIFT 98484+#define L2X0_AUX_CTRL_DIRTY_LATENCY_MASK (0x7 << 9)7285#define L2X0_AUX_CTRL_ASSOCIATIVITY_SHIFT 167386#define L2X0_AUX_CTRL_WAY_SIZE_SHIFT 177487#define L2X0_AUX_CTRL_WAY_SIZE_MASK (0x7 << 17)···9477#define L2X0_AUX_CTRL_INSTR_PREFETCH_SHIFT 299578#define L2X0_AUX_CTRL_EARLY_BRESP_SHIFT 3096798080+#define L2X0_LATENCY_CTRL_SETUP_SHIFT 08181+#define L2X0_LATENCY_CTRL_RD_SHIFT 48282+#define L2X0_LATENCY_CTRL_WR_SHIFT 88383+8484+#define L2X0_ADDR_FILTER_EN 18585+9786#ifndef __ASSEMBLY__9887extern void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask);8888+extern int l2x0_of_init(__u32 aux_val, __u32 aux_mask);8989+9090+struct l2x0_regs {9191+ unsigned long phy_base;9292+ unsigned long aux_ctrl;9393+ /*9494+ * Whether the following registers need to be saved/restored9595+ * depends on platform9696+ */9797+ unsigned long tag_latency;9898+ unsigned long data_latency;9999+ unsigned long filter_start;100100+ unsigned long filter_end;101101+ unsigned long prefetch_ctrl;102102+ unsigned long pwr_ctrl;103103+};104104+105105+extern struct l2x0_regs l2x0_saved_regs;106106+99107#endif100108101109#endif
+27
arch/arm/include/asm/io.h
···110110#include <mach/io.h>111111112112/*113113+ * This is the limit of PC card/PCI/ISA IO space, which is by default114114+ * 64K if we have PC card, PCI or ISA support. Otherwise, default to115115+ * zero to prevent ISA/PCI drivers claiming IO space (and potentially116116+ * oopsing.)117117+ *118118+ * Only set this larger if you really need inb() et.al. to operate over119119+ * a larger address space. Note that SOC_COMMON ioremaps each sockets120120+ * IO space area, and so inb() et.al. must be defined to operate as per121121+ * readb() et.al. on such platforms.122122+ */123123+#ifndef IO_SPACE_LIMIT124124+#if defined(CONFIG_PCMCIA_SOC_COMMON) || defined(CONFIG_PCMCIA_SOC_COMMON_MODULE)125125+#define IO_SPACE_LIMIT ((resource_size_t)0xffffffff)126126+#elif defined(CONFIG_PCI) || defined(CONFIG_ISA) || defined(CONFIG_PCCARD)127127+#define IO_SPACE_LIMIT ((resource_size_t)0xffff)128128+#else129129+#define IO_SPACE_LIMIT ((resource_size_t)0)130130+#endif131131+#endif132132+133133+/*113134 * IO port access primitives114135 * -------------------------115136 *···281260#define ioread16(p) ({ unsigned int __v = le16_to_cpu((__force __le16)__raw_readw(p)); __iormb(); __v; })282261#define ioread32(p) ({ unsigned int __v = le32_to_cpu((__force __le32)__raw_readl(p)); __iormb(); __v; })283262263263+#define ioread16be(p) ({ unsigned int __v = be16_to_cpu((__force __be16)__raw_readw(p)); __iormb(); __v; })264264+#define ioread32be(p) ({ unsigned int __v = be32_to_cpu((__force __be32)__raw_readl(p)); __iormb(); __v; })265265+284266#define iowrite8(v,p) ({ __iowmb(); (void)__raw_writeb(v, p); })285267#define iowrite16(v,p) ({ __iowmb(); (void)__raw_writew((__force __u16)cpu_to_le16(v), p); })286268#define iowrite32(v,p) ({ __iowmb(); (void)__raw_writel((__force __u32)cpu_to_le32(v), p); })269269+270270+#define iowrite16be(v,p) ({ __iowmb(); (void)__raw_writew((__force __u16)cpu_to_be16(v), p); })271271+#define iowrite32be(v,p) ({ __iowmb(); (void)__raw_writel((__force __u32)cpu_to_be32(v), p); })287272288273#define ioread8_rep(p,d,c) __raw_readsb(p,d,c)289274#define ioread16_rep(p,d,c) __raw_readsw(p,d,c)
+4
arch/arm/include/asm/localtimer.h
···2424 */2525asmlinkage void do_local_timer(struct pt_regs *);26262727+/*2828+ * Called from C code2929+ */3030+void handle_local_timer(struct pt_regs *);27312832#ifdef CONFIG_LOCAL_TIMERS2933
-7
arch/arm/include/asm/memory.h
···160160 * so that all we need to do is modify the 8-bit constant field.161161 */162162#define __PV_BITS_31_24 0x81000000163163-#define __PV_BITS_23_16 0x00810000164163165164extern unsigned long __pv_phys_offset;166165#define PHYS_OFFSET __pv_phys_offset···177178{178179 unsigned long t;179180 __pv_stub(x, t, "add", __PV_BITS_31_24);180180-#ifdef CONFIG_ARM_PATCH_PHYS_VIRT_16BIT181181- __pv_stub(t, t, "add", __PV_BITS_23_16);182182-#endif183181 return t;184182}185183···184188{185189 unsigned long t;186190 __pv_stub(x, t, "sub", __PV_BITS_31_24);187187-#ifdef CONFIG_ARM_PATCH_PHYS_VIRT_16BIT188188- __pv_stub(t, t, "sub", __PV_BITS_23_16);189189-#endif190191 return t;191192}192193#else
-4
arch/arm/include/asm/module.h
···31313232/* Add __virt_to_phys patching state as well */3333#ifdef CONFIG_ARM_PATCH_PHYS_VIRT3434-#ifdef CONFIG_ARM_PATCH_PHYS_VIRT_16BIT3535-#define MODULE_ARCH_VERMAGIC_P2V "p2v16 "3636-#else3734#define MODULE_ARCH_VERMAGIC_P2V "p2v8 "3838-#endif3935#else4036#define MODULE_ARCH_VERMAGIC_P2V ""4137#endif
+7
arch/arm/include/asm/outercache.h
···3434 void (*sync)(void);3535#endif3636 void (*set_debug)(unsigned long);3737+ void (*resume)(void);3738};38393940#ifdef CONFIG_OUTER_CACHE···7372{7473 if (outer_cache.disable)7574 outer_cache.disable();7575+}7676+7777+static inline void outer_resume(void)7878+{7979+ if (outer_cache.resume)8080+ outer_cache.resume();7681}77827883#else
+1-41
arch/arm/include/asm/page.h
···151151#define clear_page(page) memset((void *)(page), 0, PAGE_SIZE)152152extern void copy_page(void *to, const void *from);153153154154-typedef unsigned long pteval_t;155155-156156-#undef STRICT_MM_TYPECHECKS157157-158158-#ifdef STRICT_MM_TYPECHECKS159159-/*160160- * These are used to make use of C type-checking..161161- */162162-typedef struct { pteval_t pte; } pte_t;163163-typedef struct { unsigned long pmd; } pmd_t;164164-typedef struct { unsigned long pgd[2]; } pgd_t;165165-typedef struct { unsigned long pgprot; } pgprot_t;166166-167167-#define pte_val(x) ((x).pte)168168-#define pmd_val(x) ((x).pmd)169169-#define pgd_val(x) ((x).pgd[0])170170-#define pgprot_val(x) ((x).pgprot)171171-172172-#define __pte(x) ((pte_t) { (x) } )173173-#define __pmd(x) ((pmd_t) { (x) } )174174-#define __pgprot(x) ((pgprot_t) { (x) } )175175-176176-#else177177-/*178178- * .. while these make it easier on the compiler179179- */180180-typedef pteval_t pte_t;181181-typedef unsigned long pmd_t;182182-typedef unsigned long pgd_t[2];183183-typedef unsigned long pgprot_t;184184-185185-#define pte_val(x) (x)186186-#define pmd_val(x) (x)187187-#define pgd_val(x) ((x)[0])188188-#define pgprot_val(x) (x)189189-190190-#define __pte(x) (x)191191-#define __pmd(x) (x)192192-#define __pgprot(x) (x)193193-194194-#endif /* STRICT_MM_TYPECHECKS */154154+#include <asm/pgtable-2level-types.h>195155196156#endif /* CONFIG_MMU */197157
···11+/*22+ * arch/arm/include/asm/pgtable-2level-types.h33+ *44+ * Copyright (C) 1995-2003 Russell King55+ *66+ * This program is free software; you can redistribute it and/or modify77+ * it under the terms of the GNU General Public License version 2 as88+ * published by the Free Software Foundation.99+ *1010+ * This program is distributed in the hope that it will be useful,1111+ * but WITHOUT ANY WARRANTY; without even the implied warranty of1212+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1313+ * GNU General Public License for more details.1414+ *1515+ * You should have received a copy of the GNU General Public License1616+ * along with this program; if not, write to the Free Software1717+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1818+ */1919+#ifndef _ASM_PGTABLE_2LEVEL_TYPES_H2020+#define _ASM_PGTABLE_2LEVEL_TYPES_H2121+2222+#include <asm/types.h>2323+2424+typedef u32 pteval_t;2525+typedef u32 pmdval_t;2626+2727+#undef STRICT_MM_TYPECHECKS2828+2929+#ifdef STRICT_MM_TYPECHECKS3030+/*3131+ * These are used to make use of C type-checking..3232+ */3333+typedef struct { pteval_t pte; } pte_t;3434+typedef struct { pmdval_t pmd; } pmd_t;3535+typedef struct { pmdval_t pgd[2]; } pgd_t;3636+typedef struct { pteval_t pgprot; } pgprot_t;3737+3838+#define pte_val(x) ((x).pte)3939+#define pmd_val(x) ((x).pmd)4040+#define pgd_val(x) ((x).pgd[0])4141+#define pgprot_val(x) ((x).pgprot)4242+4343+#define __pte(x) ((pte_t) { (x) } )4444+#define __pmd(x) ((pmd_t) { (x) } )4545+#define __pgprot(x) ((pgprot_t) { (x) } )4646+4747+#else4848+/*4949+ * .. while these make it easier on the compiler5050+ */5151+typedef pteval_t pte_t;5252+typedef pmdval_t pmd_t;5353+typedef pmdval_t pgd_t[2];5454+typedef pteval_t pgprot_t;5555+5656+#define pte_val(x) (x)5757+#define pmd_val(x) (x)5858+#define pgd_val(x) ((x)[0])5959+#define pgprot_val(x) (x)6060+6161+#define __pte(x) (x)6262+#define __pmd(x) (x)6363+#define __pgprot(x) (x)6464+6565+#endif /* STRICT_MM_TYPECHECKS */6666+6767+#endif /* _ASM_PGTABLE_2LEVEL_TYPES_H */
+143
arch/arm/include/asm/pgtable-2level.h
···11+/*22+ * arch/arm/include/asm/pgtable-2level.h33+ *44+ * Copyright (C) 1995-2002 Russell King55+ *66+ * This program is free software; you can redistribute it and/or modify77+ * it under the terms of the GNU General Public License version 2 as88+ * published by the Free Software Foundation.99+ */1010+#ifndef _ASM_PGTABLE_2LEVEL_H1111+#define _ASM_PGTABLE_2LEVEL_H1212+1313+/*1414+ * Hardware-wise, we have a two level page table structure, where the first1515+ * level has 4096 entries, and the second level has 256 entries. Each entry1616+ * is one 32-bit word. Most of the bits in the second level entry are used1717+ * by hardware, and there aren't any "accessed" and "dirty" bits.1818+ *1919+ * Linux on the other hand has a three level page table structure, which can2020+ * be wrapped to fit a two level page table structure easily - using the PGD2121+ * and PTE only. However, Linux also expects one "PTE" table per page, and2222+ * at least a "dirty" bit.2323+ *2424+ * Therefore, we tweak the implementation slightly - we tell Linux that we2525+ * have 2048 entries in the first level, each of which is 8 bytes (iow, two2626+ * hardware pointers to the second level.) The second level contains two2727+ * hardware PTE tables arranged contiguously, preceded by Linux versions2828+ * which contain the state information Linux needs. We, therefore, end up2929+ * with 512 entries in the "PTE" level.3030+ *3131+ * This leads to the page tables having the following layout:3232+ *3333+ * pgd pte3434+ * | |3535+ * +--------+3636+ * | | +------------+ +03737+ * +- - - - + | Linux pt 0 |3838+ * | | +------------+ +10243939+ * +--------+ +0 | Linux pt 1 |4040+ * | |-----> +------------+ +20484141+ * +- - - - + +4 | h/w pt 0 |4242+ * | |-----> +------------+ +30724343+ * +--------+ +8 | h/w pt 1 |4444+ * | | +------------+ +40964545+ *4646+ * See L_PTE_xxx below for definitions of bits in the "Linux pt", and4747+ * PTE_xxx for definitions of bits appearing in the "h/w pt".4848+ *4949+ * PMD_xxx definitions refer to bits in the first level page table.5050+ *5151+ * The "dirty" bit is emulated by only granting hardware write permission5252+ * iff the page is marked "writable" and "dirty" in the Linux PTE. This5353+ * means that a write to a clean page will cause a permission fault, and5454+ * the Linux MM layer will mark the page dirty via handle_pte_fault().5555+ * For the hardware to notice the permission change, the TLB entry must5656+ * be flushed, and ptep_set_access_flags() does that for us.5757+ *5858+ * The "accessed" or "young" bit is emulated by a similar method; we only5959+ * allow accesses to the page if the "young" bit is set. Accesses to the6060+ * page will cause a fault, and handle_pte_fault() will set the young bit6161+ * for us as long as the page is marked present in the corresponding Linux6262+ * PTE entry. Again, ptep_set_access_flags() will ensure that the TLB is6363+ * up to date.6464+ *6565+ * However, when the "young" bit is cleared, we deny access to the page6666+ * by clearing the hardware PTE. Currently Linux does not flush the TLB6767+ * for us in this case, which means the TLB will retain the transation6868+ * until either the TLB entry is evicted under pressure, or a context6969+ * switch which changes the user space mapping occurs.7070+ */7171+#define PTRS_PER_PTE 5127272+#define PTRS_PER_PMD 17373+#define PTRS_PER_PGD 20487474+7575+#define PTE_HWTABLE_PTRS (PTRS_PER_PTE)7676+#define PTE_HWTABLE_OFF (PTE_HWTABLE_PTRS * sizeof(pte_t))7777+#define PTE_HWTABLE_SIZE (PTRS_PER_PTE * sizeof(u32))7878+7979+/*8080+ * PMD_SHIFT determines the size of the area a second-level page table can map8181+ * PGDIR_SHIFT determines what a third-level page table entry can map8282+ */8383+#define PMD_SHIFT 218484+#define PGDIR_SHIFT 218585+8686+#define PMD_SIZE (1UL << PMD_SHIFT)8787+#define PMD_MASK (~(PMD_SIZE-1))8888+#define PGDIR_SIZE (1UL << PGDIR_SHIFT)8989+#define PGDIR_MASK (~(PGDIR_SIZE-1))9090+9191+/*9292+ * section address mask and size definitions.9393+ */9494+#define SECTION_SHIFT 209595+#define SECTION_SIZE (1UL << SECTION_SHIFT)9696+#define SECTION_MASK (~(SECTION_SIZE-1))9797+9898+/*9999+ * ARMv6 supersection address mask and size definitions.100100+ */101101+#define SUPERSECTION_SHIFT 24102102+#define SUPERSECTION_SIZE (1UL << SUPERSECTION_SHIFT)103103+#define SUPERSECTION_MASK (~(SUPERSECTION_SIZE-1))104104+105105+#define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE)106106+107107+/*108108+ * "Linux" PTE definitions.109109+ *110110+ * We keep two sets of PTEs - the hardware and the linux version.111111+ * This allows greater flexibility in the way we map the Linux bits112112+ * onto the hardware tables, and allows us to have YOUNG and DIRTY113113+ * bits.114114+ *115115+ * The PTE table pointer refers to the hardware entries; the "Linux"116116+ * entries are stored 1024 bytes below.117117+ */118118+#define L_PTE_PRESENT (_AT(pteval_t, 1) << 0)119119+#define L_PTE_YOUNG (_AT(pteval_t, 1) << 1)120120+#define L_PTE_FILE (_AT(pteval_t, 1) << 2) /* only when !PRESENT */121121+#define L_PTE_DIRTY (_AT(pteval_t, 1) << 6)122122+#define L_PTE_RDONLY (_AT(pteval_t, 1) << 7)123123+#define L_PTE_USER (_AT(pteval_t, 1) << 8)124124+#define L_PTE_XN (_AT(pteval_t, 1) << 9)125125+#define L_PTE_SHARED (_AT(pteval_t, 1) << 10) /* shared(v6), coherent(xsc3) */126126+127127+/*128128+ * These are the memory types, defined to be compatible with129129+ * pre-ARMv6 CPUs cacheable and bufferable bits: XXCB130130+ */131131+#define L_PTE_MT_UNCACHED (_AT(pteval_t, 0x00) << 2) /* 0000 */132132+#define L_PTE_MT_BUFFERABLE (_AT(pteval_t, 0x01) << 2) /* 0001 */133133+#define L_PTE_MT_WRITETHROUGH (_AT(pteval_t, 0x02) << 2) /* 0010 */134134+#define L_PTE_MT_WRITEBACK (_AT(pteval_t, 0x03) << 2) /* 0011 */135135+#define L_PTE_MT_MINICACHE (_AT(pteval_t, 0x06) << 2) /* 0110 (sa1100, xscale) */136136+#define L_PTE_MT_WRITEALLOC (_AT(pteval_t, 0x07) << 2) /* 0111 */137137+#define L_PTE_MT_DEV_SHARED (_AT(pteval_t, 0x04) << 2) /* 0100 */138138+#define L_PTE_MT_DEV_NONSHARED (_AT(pteval_t, 0x0c) << 2) /* 1100 */139139+#define L_PTE_MT_DEV_WC (_AT(pteval_t, 0x09) << 2) /* 1001 */140140+#define L_PTE_MT_DEV_CACHED (_AT(pteval_t, 0x0b) << 2) /* 1011 */141141+#define L_PTE_MT_MASK (_AT(pteval_t, 0x0f) << 2)142142+143143+#endif /* _ASM_PGTABLE_2LEVEL_H */
···2424#include <mach/vmalloc.h>2525#include <asm/pgtable-hwdef.h>26262727+#include <asm/pgtable-2level.h>2828+2729/*2830 * Just any arbitrary offset to the start of the vmalloc VM area: the2931 * current 8MB value just means that there will be a 8MB "hole" after the···4341#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))4442#endif45434646-/*4747- * Hardware-wise, we have a two level page table structure, where the first4848- * level has 4096 entries, and the second level has 256 entries. Each entry4949- * is one 32-bit word. Most of the bits in the second level entry are used5050- * by hardware, and there aren't any "accessed" and "dirty" bits.5151- *5252- * Linux on the other hand has a three level page table structure, which can5353- * be wrapped to fit a two level page table structure easily - using the PGD5454- * and PTE only. However, Linux also expects one "PTE" table per page, and5555- * at least a "dirty" bit.5656- *5757- * Therefore, we tweak the implementation slightly - we tell Linux that we5858- * have 2048 entries in the first level, each of which is 8 bytes (iow, two5959- * hardware pointers to the second level.) The second level contains two6060- * hardware PTE tables arranged contiguously, preceded by Linux versions6161- * which contain the state information Linux needs. We, therefore, end up6262- * with 512 entries in the "PTE" level.6363- *6464- * This leads to the page tables having the following layout:6565- *6666- * pgd pte6767- * | |6868- * +--------+6969- * | | +------------+ +07070- * +- - - - + | Linux pt 0 |7171- * | | +------------+ +10247272- * +--------+ +0 | Linux pt 1 |7373- * | |-----> +------------+ +20487474- * +- - - - + +4 | h/w pt 0 |7575- * | |-----> +------------+ +30727676- * +--------+ +8 | h/w pt 1 |7777- * | | +------------+ +40967878- *7979- * See L_PTE_xxx below for definitions of bits in the "Linux pt", and8080- * PTE_xxx for definitions of bits appearing in the "h/w pt".8181- *8282- * PMD_xxx definitions refer to bits in the first level page table.8383- *8484- * The "dirty" bit is emulated by only granting hardware write permission8585- * iff the page is marked "writable" and "dirty" in the Linux PTE. This8686- * means that a write to a clean page will cause a permission fault, and8787- * the Linux MM layer will mark the page dirty via handle_pte_fault().8888- * For the hardware to notice the permission change, the TLB entry must8989- * be flushed, and ptep_set_access_flags() does that for us.9090- *9191- * The "accessed" or "young" bit is emulated by a similar method; we only9292- * allow accesses to the page if the "young" bit is set. Accesses to the9393- * page will cause a fault, and handle_pte_fault() will set the young bit9494- * for us as long as the page is marked present in the corresponding Linux9595- * PTE entry. Again, ptep_set_access_flags() will ensure that the TLB is9696- * up to date.9797- *9898- * However, when the "young" bit is cleared, we deny access to the page9999- * by clearing the hardware PTE. Currently Linux does not flush the TLB100100- * for us in this case, which means the TLB will retain the transation101101- * until either the TLB entry is evicted under pressure, or a context102102- * switch which changes the user space mapping occurs.103103- */104104-#define PTRS_PER_PTE 512105105-#define PTRS_PER_PMD 1106106-#define PTRS_PER_PGD 2048107107-108108-#define PTE_HWTABLE_PTRS (PTRS_PER_PTE)109109-#define PTE_HWTABLE_OFF (PTE_HWTABLE_PTRS * sizeof(pte_t))110110-#define PTE_HWTABLE_SIZE (PTRS_PER_PTE * sizeof(u32))111111-112112-/*113113- * PMD_SHIFT determines the size of the area a second-level page table can map114114- * PGDIR_SHIFT determines what a third-level page table entry can map115115- */116116-#define PMD_SHIFT 21117117-#define PGDIR_SHIFT 21118118-11944#define LIBRARY_TEXT_START 0x0c0000001204512146#ifndef __ASSEMBLY__···53124#define pte_ERROR(pte) __pte_error(__FILE__, __LINE__, pte)54125#define pmd_ERROR(pmd) __pmd_error(__FILE__, __LINE__, pmd)55126#define pgd_ERROR(pgd) __pgd_error(__FILE__, __LINE__, pgd)5656-#endif /* !__ASSEMBLY__ */5757-5858-#define PMD_SIZE (1UL << PMD_SHIFT)5959-#define PMD_MASK (~(PMD_SIZE-1))6060-#define PGDIR_SIZE (1UL << PGDIR_SHIFT)6161-#define PGDIR_MASK (~(PGDIR_SIZE-1))6212763128/*64129 * This is the lowest virtual address we can permit any user space···60137 * non-high vector CPUs.61138 */62139#define FIRST_USER_ADDRESS PAGE_SIZE6363-6464-#define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE)6565-6666-/*6767- * section address mask and size definitions.6868- */6969-#define SECTION_SHIFT 207070-#define SECTION_SIZE (1UL << SECTION_SHIFT)7171-#define SECTION_MASK (~(SECTION_SIZE-1))7272-7373-/*7474- * ARMv6 supersection address mask and size definitions.7575- */7676-#define SUPERSECTION_SHIFT 247777-#define SUPERSECTION_SIZE (1UL << SUPERSECTION_SHIFT)7878-#define SUPERSECTION_MASK (~(SUPERSECTION_SIZE-1))7979-8080-/*8181- * "Linux" PTE definitions.8282- *8383- * We keep two sets of PTEs - the hardware and the linux version.8484- * This allows greater flexibility in the way we map the Linux bits8585- * onto the hardware tables, and allows us to have YOUNG and DIRTY8686- * bits.8787- *8888- * The PTE table pointer refers to the hardware entries; the "Linux"8989- * entries are stored 1024 bytes below.9090- */9191-#define L_PTE_PRESENT (_AT(pteval_t, 1) << 0)9292-#define L_PTE_YOUNG (_AT(pteval_t, 1) << 1)9393-#define L_PTE_FILE (_AT(pteval_t, 1) << 2) /* only when !PRESENT */9494-#define L_PTE_DIRTY (_AT(pteval_t, 1) << 6)9595-#define L_PTE_RDONLY (_AT(pteval_t, 1) << 7)9696-#define L_PTE_USER (_AT(pteval_t, 1) << 8)9797-#define L_PTE_XN (_AT(pteval_t, 1) << 9)9898-#define L_PTE_SHARED (_AT(pteval_t, 1) << 10) /* shared(v6), coherent(xsc3) */9999-100100-/*101101- * These are the memory types, defined to be compatible with102102- * pre-ARMv6 CPUs cacheable and bufferable bits: XXCB103103- */104104-#define L_PTE_MT_UNCACHED (_AT(pteval_t, 0x00) << 2) /* 0000 */105105-#define L_PTE_MT_BUFFERABLE (_AT(pteval_t, 0x01) << 2) /* 0001 */106106-#define L_PTE_MT_WRITETHROUGH (_AT(pteval_t, 0x02) << 2) /* 0010 */107107-#define L_PTE_MT_WRITEBACK (_AT(pteval_t, 0x03) << 2) /* 0011 */108108-#define L_PTE_MT_MINICACHE (_AT(pteval_t, 0x06) << 2) /* 0110 (sa1100, xscale) */109109-#define L_PTE_MT_WRITEALLOC (_AT(pteval_t, 0x07) << 2) /* 0111 */110110-#define L_PTE_MT_DEV_SHARED (_AT(pteval_t, 0x04) << 2) /* 0100 */111111-#define L_PTE_MT_DEV_NONSHARED (_AT(pteval_t, 0x0c) << 2) /* 1100 */112112-#define L_PTE_MT_DEV_WC (_AT(pteval_t, 0x09) << 2) /* 1001 */113113-#define L_PTE_MT_DEV_CACHED (_AT(pteval_t, 0x0b) << 2) /* 1011 */114114-#define L_PTE_MT_MASK (_AT(pteval_t, 0x0f) << 2)115115-116116-#ifndef __ASSEMBLY__117140118141/*119142 * The pgprot_* and protection_map entries will be fixed up in runtime···196327197328static inline pte_t *pmd_page_vaddr(pmd_t pmd)198329{199199- return __va(pmd_val(pmd) & PAGE_MASK);330330+ return __va(pmd_val(pmd) & PHYS_MASK & (s32)PAGE_MASK);200331}201332202202-#define pmd_page(pmd) pfn_to_page(__phys_to_pfn(pmd_val(pmd)))333333+#define pmd_page(pmd) pfn_to_page(__phys_to_pfn(pmd_val(pmd) & PHYS_MASK))203334204335/* we don't need complex calculations here as the pmd is folded into the pgd */205336#define pmd_addr_end(addr,end) (end)···220351#define pte_offset_map(pmd,addr) (__pte_map(pmd) + pte_index(addr))221352#define pte_unmap(pte) __pte_unmap(pte)222353223223-#define pte_pfn(pte) (pte_val(pte) >> PAGE_SHIFT)354354+#define pte_pfn(pte) ((pte_val(pte) & PHYS_MASK) >> PAGE_SHIFT)224355#define pfn_pte(pfn,prot) __pte(__pfn_to_phys(pfn) | pgprot_val(prot))225356226357#define pte_page(pte) pfn_to_page(pte_pfn(pte))
+11
arch/arm/include/asm/smp.h
···3333asmlinkage void do_IPI(int ipinr, struct pt_regs *regs);34343535/*3636+ * Called from C code, this handles an IPI.3737+ */3838+void handle_IPI(int ipinr, struct pt_regs *regs);3939+4040+/*3641 * Setup the set of possible CPUs (via set_cpu_possible)3742 */3843extern void smp_init_cpus(void);···6964 * Initialize cpu_possible map, and enable coherency7065 */7166extern void platform_smp_prepare_cpus(unsigned int);6767+6868+/*6969+ * Logical CPU mapping.7070+ */7171+extern int __cpu_logical_map[NR_CPUS];7272+#define cpu_logical_map(cpu) __cpu_logical_map[cpu]72737374/*7475 * Initial data for bringing up a secondary CPU.
···471471 * these operations. This is typically used when we are removing472472 * PMD entries.473473 */474474-static inline void flush_pmd_entry(pmd_t *pmd)474474+static inline void flush_pmd_entry(void *pmd)475475{476476 const unsigned int __tlb_flag = __cpu_tlb_flags;477477···487487 dsb();488488}489489490490-static inline void clean_pmd_entry(pmd_t *pmd)490490+static inline void clean_pmd_entry(void *pmd)491491{492492 const unsigned int __tlb_flag = __cpu_tlb_flags;493493
···3939 */4040static struct sys_timer *system_timer;41414242-#if defined(CONFIG_RTC_DRV_CMOS) || defined(CONFIG_RTC_DRV_CMOS_MODULE)4242+#if defined(CONFIG_RTC_DRV_CMOS) || defined(CONFIG_RTC_DRV_CMOS_MODULE) || \4343+ defined(CONFIG_NVRAM) || defined(CONFIG_NVRAM_MODULE)4344/* this needs a better home */4445DEFINE_SPINLOCK(rtc_lock);4545-4646-#ifdef CONFIG_RTC_DRV_CMOS_MODULE4746EXPORT_SYMBOL(rtc_lock);4848-#endif4947#endif /* pc-style 'CMOS' RTC support */50485149/* change this if you have some constant time drift */
+148
arch/arm/kernel/topology.c
···11+/*22+ * arch/arm/kernel/topology.c33+ *44+ * Copyright (C) 2011 Linaro Limited.55+ * Written by: Vincent Guittot66+ *77+ * based on arch/sh/kernel/topology.c88+ *99+ * This file is subject to the terms and conditions of the GNU General Public1010+ * License. See the file "COPYING" in the main directory of this archive1111+ * for more details.1212+ */1313+1414+#include <linux/cpu.h>1515+#include <linux/cpumask.h>1616+#include <linux/init.h>1717+#include <linux/percpu.h>1818+#include <linux/node.h>1919+#include <linux/nodemask.h>2020+#include <linux/sched.h>2121+2222+#include <asm/cputype.h>2323+#include <asm/topology.h>2424+2525+#define MPIDR_SMP_BITMASK (0x3 << 30)2626+#define MPIDR_SMP_VALUE (0x2 << 30)2727+2828+#define MPIDR_MT_BITMASK (0x1 << 24)2929+3030+/*3131+ * These masks reflect the current use of the affinity levels.3232+ * The affinity level can be up to 16 bits according to ARM ARM3333+ */3434+3535+#define MPIDR_LEVEL0_MASK 0x33636+#define MPIDR_LEVEL0_SHIFT 03737+3838+#define MPIDR_LEVEL1_MASK 0xF3939+#define MPIDR_LEVEL1_SHIFT 84040+4141+#define MPIDR_LEVEL2_MASK 0xFF4242+#define MPIDR_LEVEL2_SHIFT 164343+4444+struct cputopo_arm cpu_topology[NR_CPUS];4545+4646+const struct cpumask *cpu_coregroup_mask(unsigned int cpu)4747+{4848+ return &cpu_topology[cpu].core_sibling;4949+}5050+5151+/*5252+ * store_cpu_topology is called at boot when only one cpu is running5353+ * and with the mutex cpu_hotplug.lock locked, when several cpus have booted,5454+ * which prevents simultaneous write access to cpu_topology array5555+ */5656+void store_cpu_topology(unsigned int cpuid)5757+{5858+ struct cputopo_arm *cpuid_topo = &cpu_topology[cpuid];5959+ unsigned int mpidr;6060+ unsigned int cpu;6161+6262+ /* If the cpu topology has been already set, just return */6363+ if (cpuid_topo->core_id != -1)6464+ return;6565+6666+ mpidr = read_cpuid_mpidr();6767+6868+ /* create cpu topology mapping */6969+ if ((mpidr & MPIDR_SMP_BITMASK) == MPIDR_SMP_VALUE) {7070+ /*7171+ * This is a multiprocessor system7272+ * multiprocessor format & multiprocessor mode field are set7373+ */7474+7575+ if (mpidr & MPIDR_MT_BITMASK) {7676+ /* core performance interdependency */7777+ cpuid_topo->thread_id = (mpidr >> MPIDR_LEVEL0_SHIFT)7878+ & MPIDR_LEVEL0_MASK;7979+ cpuid_topo->core_id = (mpidr >> MPIDR_LEVEL1_SHIFT)8080+ & MPIDR_LEVEL1_MASK;8181+ cpuid_topo->socket_id = (mpidr >> MPIDR_LEVEL2_SHIFT)8282+ & MPIDR_LEVEL2_MASK;8383+ } else {8484+ /* largely independent cores */8585+ cpuid_topo->thread_id = -1;8686+ cpuid_topo->core_id = (mpidr >> MPIDR_LEVEL0_SHIFT)8787+ & MPIDR_LEVEL0_MASK;8888+ cpuid_topo->socket_id = (mpidr >> MPIDR_LEVEL1_SHIFT)8989+ & MPIDR_LEVEL1_MASK;9090+ }9191+ } else {9292+ /*9393+ * This is an uniprocessor system9494+ * we are in multiprocessor format but uniprocessor system9595+ * or in the old uniprocessor format9696+ */9797+ cpuid_topo->thread_id = -1;9898+ cpuid_topo->core_id = 0;9999+ cpuid_topo->socket_id = -1;100100+ }101101+102102+ /* update core and thread sibling masks */103103+ for_each_possible_cpu(cpu) {104104+ struct cputopo_arm *cpu_topo = &cpu_topology[cpu];105105+106106+ if (cpuid_topo->socket_id == cpu_topo->socket_id) {107107+ cpumask_set_cpu(cpuid, &cpu_topo->core_sibling);108108+ if (cpu != cpuid)109109+ cpumask_set_cpu(cpu,110110+ &cpuid_topo->core_sibling);111111+112112+ if (cpuid_topo->core_id == cpu_topo->core_id) {113113+ cpumask_set_cpu(cpuid,114114+ &cpu_topo->thread_sibling);115115+ if (cpu != cpuid)116116+ cpumask_set_cpu(cpu,117117+ &cpuid_topo->thread_sibling);118118+ }119119+ }120120+ }121121+ smp_wmb();122122+123123+ printk(KERN_INFO "CPU%u: thread %d, cpu %d, socket %d, mpidr %x\n",124124+ cpuid, cpu_topology[cpuid].thread_id,125125+ cpu_topology[cpuid].core_id,126126+ cpu_topology[cpuid].socket_id, mpidr);127127+}128128+129129+/*130130+ * init_cpu_topology is called at boot when only one cpu is running131131+ * which prevent simultaneous write access to cpu_topology array132132+ */133133+void init_cpu_topology(void)134134+{135135+ unsigned int cpu;136136+137137+ /* init core mask */138138+ for_each_possible_cpu(cpu) {139139+ struct cputopo_arm *cpu_topo = &(cpu_topology[cpu]);140140+141141+ cpu_topo->thread_id = -1;142142+ cpu_topo->core_id = -1;143143+ cpu_topo->socket_id = -1;144144+ cpumask_clear(&cpu_topo->core_sibling);145145+ cpumask_clear(&cpu_topo->thread_sibling);146146+ }147147+ smp_wmb();148148+}
···1313#ifndef __ASM_ARM_ARCH_IO_H1414#define __ASM_ARM_ARCH_IO_H15151616-#define IO_SPACE_LIMIT 0xffff1717-1816u8 __inb8(unsigned int port);1917void __outb8(u8 val, unsigned int port);2018
+1
arch/arm/mach-exynos4/Kconfig
···1212config CPU_EXYNOS42101313 bool1414 select S3C_PL330_DMA1515+ select ARM_CPU_SUSPEND if PM1516 help1617 Enable EXYNOS4210 CPU support1718
+4-6
arch/arm/mach-exynos4/platsmp.c
···193193 ncores = scu_base ? scu_get_core_count(scu_base) : 1;194194195195 /* sanity check */196196- if (ncores > NR_CPUS) {197197- printk(KERN_WARNING198198- "EXYNOS4: no. of cores (%d) greater than configured "199199- "maximum of %d - clipping\n",200200- ncores, NR_CPUS);201201- ncores = NR_CPUS;196196+ if (ncores > nr_cpu_ids) {197197+ pr_warn("SMP: %u cores greater than maximum (%u), clipping\n",198198+ ncores, nr_cpu_ids);199199+ ncores = nr_cpu_ids;202200 }203201204202 for (i = 0; i < ncores; i++)
-2
arch/arm/mach-footbridge/include/mach/io.h
···2323#define PCIO_SIZE 0x001000002424#define PCIO_BASE MMU_IO(0xff000000, 0x7c000000)25252626-#define IO_SPACE_LIMIT 0xffff2727-2826/*2927 * Translation of various region addresses to virtual addresses3028 */
-2
arch/arm/mach-integrator/include/mach/io.h
···2020#ifndef __ASM_ARM_ARCH_IO_H2121#define __ASM_ARM_ARCH_IO_H22222323-#define IO_SPACE_LIMIT 0xffff2424-2523/*2624 * WARNING: this has to mirror definitions in platform.h2725 */
-2
arch/arm/mach-ixp4xx/include/mach/io.h
···17171818#include <mach/hardware.h>19192020-#define IO_SPACE_LIMIT 0x0000ffff2121-2220extern int (*ixp4xx_pci_read)(u32 addr, u32 cmd, u32* data);2321extern int ixp4xx_pci_write(u32 addr, u32 cmd, u32 data);2422
···156156{157157 unsigned int i, ncores = get_core_count();158158159159+ if (ncores > nr_cpu_ids) {160160+ pr_warn("SMP: %u cores greater than maximum (%u), clipping\n",161161+ ncores, nr_cpu_ids);162162+ ncores = nr_cpu_ids;163163+ }164164+159165 for (i = 0; i < ncores; i++)160166 set_cpu_possible(i, true);161167
+2
arch/arm/mach-omap2/Kconfig
···3636 select ARM_L1_CACHE_SHIFT_6 if !ARCH_OMAP43737 select ARCH_HAS_OPP3838 select PM_OPP if PM3939+ select ARM_CPU_SUSPEND if PM39404041config ARCH_OMAP44142 bool "TI OMAP4"···5150 select ARCH_HAS_OPP5251 select PM_OPP if PM5352 select USB_ARCH_HAS_EHCI5353+ select ARM_CPU_SUSPEND if PM54545555comment "OMAP Core Type"5656 depends on ARCH_OMAP2
+4-6
arch/arm/mach-omap2/omap-smp.c
···109109 ncores = scu_get_core_count(scu_base);110110111111 /* sanity check */112112- if (ncores > NR_CPUS) {113113- printk(KERN_WARNING114114- "OMAP4: no. of cores (%d) greater than configured "115115- "maximum of %d - clipping\n",116116- ncores, NR_CPUS);117117- ncores = NR_CPUS;112112+ if (ncores > nr_cpu_ids) {113113+ pr_warn("SMP: %u cores greater than maximum (%u), clipping\n",114114+ ncores, nr_cpu_ids);115115+ ncores = nr_cpu_ids;118116 }119117120118 for (i = 0; i < ncores; i++)
···1010#ifndef __ASM_ARM_ARCH_IO_H1111#define __ASM_ARM_ARCH_IO_H12121313-#define IO_SPACE_LIMIT 0xffffffff1414-1513/*1616- * We don't actually have real ISA nor PCI buses, but there is so many 1717- * drivers out there that might just work if we fake them...1414+ * __io() is required to be an equivalent mapping to __mem_pci() for1515+ * SOC_COMMON to work.1816 */1917#define __io(a) __typesafe_io(a)2018#define __mem_pci(a) (a)
+6
arch/arm/mach-shmobile/platsmp.c
···5656 unsigned int ncores = shmobile_smp_get_core_count();5757 unsigned int i;58585959+ if (ncores > nr_cpu_ids) {6060+ pr_warn("SMP: %u cores greater than maximum (%u), clipping\n",6161+ ncores, nr_cpu_ids);6262+ ncores = nr_cpu_ids;6363+ }6464+5965 for (i = 0; i < ncores; i++)6066 set_cpu_possible(i, true);6167
+4-4
arch/arm/mach-tegra/platsmp.c
···114114{115115 unsigned int i, ncores = scu_get_core_count(scu_base);116116117117- if (ncores > NR_CPUS) {118118- printk(KERN_ERR "Tegra: no. of cores (%u) greater than configured (%u), clipping\n",119119- ncores, NR_CPUS);120120- ncores = NR_CPUS;117117+ if (ncores > nr_cpu_ids) {118118+ pr_warn("SMP: %u cores greater than maximum (%u), clipping\n",119119+ ncores, nr_cpu_ids);120120+ ncores = nr_cpu_ids;121121 }122122123123 for (i = 0; i < ncores; i++)
+4-6
arch/arm/mach-ux500/platsmp.c
···156156 ncores = scu_base ? scu_get_core_count(scu_base) : 1;157157158158 /* sanity check */159159- if (ncores > NR_CPUS) {160160- printk(KERN_WARNING161161- "U8500: no. of cores (%d) greater than configured "162162- "maximum of %d - clipping\n",163163- ncores, NR_CPUS);164164- ncores = NR_CPUS;159159+ if (ncores > nr_cpu_ids) {160160+ pr_warn("SMP: %u cores greater than maximum (%u), clipping\n",161161+ ncores, nr_cpu_ids);162162+ ncores = nr_cpu_ids;165163 }166164167165 for (i = 0; i < ncores; i++)
+6
arch/arm/mach-vexpress/ct-ca9x4.c
···221221{222222 int i, ncores = scu_get_core_count(MMIO_P2V(A9_MPCORE_SCU));223223224224+ if (ncores > nr_cpu_ids) {225225+ pr_warn("SMP: %u cores greater than maximum (%u), clipping\n",226226+ ncores, nr_cpu_ids);227227+ ncores = nr_cpu_ids;228228+ }229229+224230 for (i = 0; i < ncores; ++i)225231 set_cpu_possible(i, true);226232
···12121313struct mem_type {1414 pteval_t prot_pte;1515- unsigned int prot_l1;1616- unsigned int prot_sect;1515+ pmdval_t prot_l1;1616+ pmdval_t prot_sect;1717 unsigned int domain;1818};1919
+10-8
arch/arm/mm/mmu.c
···6060struct cachepolicy {6161 const char policy[16];6262 unsigned int cr_mask;6363- unsigned int pmd;6363+ pmdval_t pmd;6464 pteval_t pte;6565};6666···288288{289289 struct cachepolicy *cp;290290 unsigned int cr = get_cr();291291- unsigned int user_pgprot, kern_pgprot, vecs_pgprot;291291+ pteval_t user_pgprot, kern_pgprot, vecs_pgprot;292292 int cpu_arch = cpu_architecture();293293 int i;294294···863863 /*864864 * Clear out all the mappings below the kernel image.865865 */866866- for (addr = 0; addr < MODULES_VADDR; addr += PGDIR_SIZE)866866+ for (addr = 0; addr < MODULES_VADDR; addr += PMD_SIZE)867867 pmd_clear(pmd_off_k(addr));868868869869#ifdef CONFIG_XIP_KERNEL870870 /* The XIP kernel is mapped in the module area -- skip over it */871871- addr = ((unsigned long)_etext + PGDIR_SIZE - 1) & PGDIR_MASK;871871+ addr = ((unsigned long)_etext + PMD_SIZE - 1) & PMD_MASK;872872#endif873873- for ( ; addr < PAGE_OFFSET; addr += PGDIR_SIZE)873873+ for ( ; addr < PAGE_OFFSET; addr += PMD_SIZE)874874 pmd_clear(pmd_off_k(addr));875875876876 /*···885885 * memory bank, up to the end of the vmalloc region.886886 */887887 for (addr = __phys_to_virt(end);888888- addr < VMALLOC_END; addr += PGDIR_SIZE)888888+ addr < VMALLOC_END; addr += PMD_SIZE)889889 pmd_clear(pmd_off_k(addr));890890}891891+892892+#define SWAPPER_PG_DIR_SIZE (PTRS_PER_PGD * sizeof(pgd_t))891893892894/*893895 * Reserve the special regions of memory···900898 * Reserve the page tables. These are already in use,901899 * and can only be in node 0.902900 */903903- memblock_reserve(__pa(swapper_pg_dir), PTRS_PER_PGD * sizeof(pgd_t));901901+ memblock_reserve(__pa(swapper_pg_dir), SWAPPER_PG_DIR_SIZE);904902905903#ifdef CONFIG_SA1111906904 /*···928926 */929927 vectors_page = early_alloc(PAGE_SIZE);930928931931- for (addr = VMALLOC_END; addr; addr += PGDIR_SIZE)929929+ for (addr = VMALLOC_END; addr; addr += PMD_SIZE)932930 pmd_clear(pmd_off_k(addr));933931934932 /*