···5151ff000000 ffbfffff Reserved for future expansion of DMA5252 mapping region.53535454-VMALLOC_END feffffff Free for platform use, recommended.5555- VMALLOC_END must be aligned to a 2MB5656- boundary.5757-5854VMALLOC_START VMALLOC_END-1 vmalloc() / ioremap() space.5955 Memory returned by vmalloc/ioremap will6056 be dynamically placed in this region.6161- VMALLOC_START may be based upon the value6262- of the high_memory variable.5757+ Machine specific static mappings are also5858+ located here through iotable_init().5959+ VMALLOC_START is based upon the value6060+ of the high_memory variable, and VMALLOC_END6161+ is equal to 0xff000000.63626463PAGE_OFFSET high_memory-1 Kernel direct-mapped RAM region.6564 This maps the platforms RAM, and typically
+4
Documentation/devicetree/bindings/arm/gic.txt
···4242- interrupts : Interrupt source of the parent interrupt controller. Only4343 present on secondary GICs.44444545+- cpu-offset : per-cpu offset within the distributor and cpu interface4646+ regions, used when the GIC doesn't have banked registers. The offset is4747+ cpu-offset * cpu-nr.4848+4549Example:46504751 intc: interrupt-controller@fff11000 {
+29
Documentation/devicetree/bindings/arm/vic.txt
···11+* ARM Vectored Interrupt Controller22+33+One or more Vectored Interrupt Controllers (VIC's) can be connected in an ARM44+system for interrupt routing. For multiple controllers they can either be55+nested or have the outputs wire-OR'd together.66+77+Required properties:88+99+- compatible : should be one of1010+ "arm,pl190-vic"1111+ "arm,pl192-vic"1212+- interrupt-controller : Identifies the node as an interrupt controller1313+- #interrupt-cells : The number of cells to define the interrupts. Must be 1 as1414+ the VIC has no configuration options for interrupt sources. The cell is a u321515+ and defines the interrupt number.1616+- reg : The register bank for the VIC.1717+1818+Optional properties:1919+2020+- interrupts : Interrupt source for parent controllers if the VIC is nested.2121+2222+Example:2323+2424+ vic0: interrupt-controller@60000 {2525+ compatible = "arm,pl192-vic";2626+ interrupt-controller;2727+ #interrupt-cells = <1>;2828+ reg = <0x60000 0x1000>;2929+ };
+24-6
arch/arm/Kconfig
···342342 select ARM_AMBA343343 select ARM_GIC344344 select ARM_TIMER_SP804345345+ select CACHE_L2X0345346 select CLKDEV_LOOKUP346347 select CPU_V7347348 select GENERIC_CLOCKEVENTS348349 select HAVE_ARM_SCU350350+ select HAVE_SMP349351 select USE_OF350352 help351353 Support for the Calxeda Highbank SoC based boards.···365363 select CPU_V6K366364 select GENERIC_CLOCKEVENTS367365 select ARM_GIC366366+ select MIGHT_HAVE_CACHE_L2X0368367 select MIGHT_HAVE_PCI369368 select PCI_DOMAINS if PCI370369 help···386383 select GENERIC_CLOCKEVENTS387384 select CLKDEV_LOOKUP388385 select GENERIC_IRQ_CHIP386386+ select MIGHT_HAVE_CACHE_L2X0389387 select USE_OF390388 select ZONE_DMA391389 help···639635 select GENERIC_GPIO640636 select HAVE_CLK641637 select HAVE_SCHED_CLOCK638638+ select HAVE_SMP639639+ select MIGHT_HAVE_CACHE_L2X0642640 select ARCH_HAS_CPUFREQ643641 help644642 This enables support for NVIDIA Tegra based systems (Tegra APX,···710704 select HAVE_CLK711705 select CLKDEV_LOOKUP712706 select HAVE_MACH_CLKDEV707707+ select HAVE_SMP713708 select GENERIC_CLOCKEVENTS709709+ select MIGHT_HAVE_CACHE_L2X0714710 select NO_IOPORT715711 select SPARSE_IRQ716712 select MULTI_IRQ_HANDLER···914906 select CLKDEV_LOOKUP915907 select ARCH_REQUIRE_GPIOLIB916908 select ARCH_HAS_CPUFREQ909909+ select HAVE_SMP910910+ select MIGHT_HAVE_CACHE_L2X0917911 help918912 Support for ST-Ericsson's Ux500 architecture919913···926916 select CPU_ARM926T927917 select CLKDEV_LOOKUP928918 select GENERIC_CLOCKEVENTS919919+ select MIGHT_HAVE_CACHE_L2X0929920 select ARCH_REQUIRE_GPIOLIB930921 help931922 Support for the Nomadik platform by ST-Ericsson···986975 select ARM_GIC987976 select ARM_AMBA988977 select ICST978978+ select MIGHT_HAVE_CACHE_L2X0989979 select USE_OF990980 help991981 Support for Xilinx Zynq ARM Cortex A9 Platform···1453144114541442source "kernel/time/Kconfig"1455144314441444+config HAVE_SMP14451445+ bool14461446+ help14471447+ This option should be selected by machines which have an SMP-14481448+ capable CPU.14491449+14501450+ The only effect of this option is to make the SMP-related14511451+ options available to the user for configuration.14521452+14561453config SMP14571454 bool "Symmetric Multi-Processing"14581455 depends on CPU_V6K || CPU_V714591456 depends on GENERIC_CLOCKEVENTS14601460- depends on REALVIEW_EB_ARM11MP || REALVIEW_EB_A9MP || \14611461- MACH_REALVIEW_PB11MP || MACH_REALVIEW_PBX || ARCH_OMAP4 || \14621462- ARCH_EXYNOS4 || ARCH_TEGRA || ARCH_U8500 || ARCH_VEXPRESS_CA9X4 || \14631463- ARCH_MSM_SCORPIONMP || ARCH_SHMOBILE || ARCH_HIGHBANK || SOC_IMX6Q14571457+ depends on HAVE_SMP14641458 depends on MMU14651459 select USE_GENERIC_SMP_HELPERS14661460 select HAVE_ARM_SCU if !ARCH_MSM_SCORPIONMP···2006198820071989config XIP_KERNEL20081990 bool "Kernel Execute-In-Place from ROM"20092009- depends on !ZBOOT_ROM19911991+ depends on !ZBOOT_ROM && !ARM_LPAE20101992 help20111993 Execute-In-Place allows the kernel to run from non-volatile storage20121994 directly addressable by the CPU, such as NOR flash. This saves RAM···2036201820372019config KEXEC20382020 bool "Kexec system call (EXPERIMENTAL)"20392039- depends on EXPERIMENTAL20212021+ depends on EXPERIMENTAL && (!SMP || HOTPLUG_CPU)20402022 help20412023 kexec is a system call that implements the ability to shutdown your20422024 current kernel, and to start another kernel. It is like a reboot
···1919 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA2020 */21212222+#include <linux/export.h>2223#include <linux/init.h>2324#include <linux/list.h>2425#include <linux/io.h>2626+#include <linux/irqdomain.h>2727+#include <linux/of.h>2828+#include <linux/of_address.h>2929+#include <linux/of_irq.h>2530#include <linux/syscore_ops.h>2631#include <linux/device.h>2732#include <linux/amba/bus.h>28333434+#include <asm/exception.h>2935#include <asm/mach/irq.h>3036#include <asm/hardware/vic.h>31373232-#ifdef CONFIG_PM3338/**3439 * struct vic_device - VIC PM device3540 * @irq: The IRQ number for the base of the VIC.···4540 * @int_enable: Save for VIC_INT_ENABLE.4641 * @soft_int: Save for VIC_INT_SOFT.4742 * @protect: Save for VIC_PROTECT.4343+ * @domain: The IRQ domain for the VIC.4844 */4945struct vic_device {5046 void __iomem *base;···5650 u32 int_enable;5751 u32 soft_int;5852 u32 protect;5353+ struct irq_domain domain;5954};60556156/* we cannot allocate memory when VICs are initially registered */6257static struct vic_device vic_devices[CONFIG_ARM_VIC_NR];63586459static int vic_id;6565-#endif /* CONFIG_PM */66606761/**6862 * vic_init2 - common initialisation code···162156 return 0;163157}164158late_initcall(vic_pm_init);159159+#endif /* CONFIG_PM */165160166161/**167167- * vic_pm_register - Register a VIC for later power management control162162+ * vic_register() - Register a VIC.168163 * @base: The base address of the VIC.169164 * @irq: The base IRQ for the VIC.170165 * @resume_sources: bitmask of interrupts allowed for resume sources.166166+ * @node: The device tree node associated with the VIC.171167 *172168 * Register the VIC with the system device tree so that it can be notified173169 * of suspend and resume requests and ensure that the correct actions are174170 * taken to re-instate the settings on resume.171171+ *172172+ * This also configures the IRQ domain for the VIC.175173 */176176-static void __init vic_pm_register(void __iomem *base, unsigned int irq, u32 resume_sources)174174+static void __init vic_register(void __iomem *base, unsigned int irq,175175+ u32 resume_sources, struct device_node *node)177176{178177 struct vic_device *v;179178180180- if (vic_id >= ARRAY_SIZE(vic_devices))179179+ if (vic_id >= ARRAY_SIZE(vic_devices)) {181180 printk(KERN_ERR "%s: too few VICs, increase CONFIG_ARM_VIC_NR\n", __func__);182182- else {183183- v = &vic_devices[vic_id];184184- v->base = base;185185- v->resume_sources = resume_sources;186186- v->irq = irq;187187- vic_id++;181181+ return;188182 }183183+184184+ v = &vic_devices[vic_id];185185+ v->base = base;186186+ v->resume_sources = resume_sources;187187+ v->irq = irq;188188+ vic_id++;189189+190190+ v->domain.irq_base = irq;191191+ v->domain.nr_irq = 32;192192+#ifdef CONFIG_OF_IRQ193193+ v->domain.of_node = of_node_get(node);194194+#endif /* CONFIG_OF */195195+ v->domain.ops = &irq_domain_simple_ops;196196+ irq_domain_add(&v->domain);189197}190190-#else191191-static inline void vic_pm_register(void __iomem *base, unsigned int irq, u32 arg1) { }192192-#endif /* CONFIG_PM */193198194199static void vic_ack_irq(struct irq_data *d)195200{196201 void __iomem *base = irq_data_get_irq_chip_data(d);197197- unsigned int irq = d->irq & 31;202202+ unsigned int irq = d->hwirq;198203 writel(1 << irq, base + VIC_INT_ENABLE_CLEAR);199204 /* moreover, clear the soft-triggered, in case it was the reason */200205 writel(1 << irq, base + VIC_INT_SOFT_CLEAR);···214197static void vic_mask_irq(struct irq_data *d)215198{216199 void __iomem *base = irq_data_get_irq_chip_data(d);217217- unsigned int irq = d->irq & 31;200200+ unsigned int irq = d->hwirq;218201 writel(1 << irq, base + VIC_INT_ENABLE_CLEAR);219202}220203221204static void vic_unmask_irq(struct irq_data *d)222205{223206 void __iomem *base = irq_data_get_irq_chip_data(d);224224- unsigned int irq = d->irq & 31;207207+ unsigned int irq = d->hwirq;225208 writel(1 << irq, base + VIC_INT_ENABLE);226209}227210···243226static int vic_set_wake(struct irq_data *d, unsigned int on)244227{245228 struct vic_device *v = vic_from_irq(d->irq);246246- unsigned int off = d->irq & 31;229229+ unsigned int off = d->hwirq;247230 u32 bit = 1 << off;248231249232 if (!v)···318301 * and 020 within the page. We call this "second block".319302 */320303static void __init vic_init_st(void __iomem *base, unsigned int irq_start,321321- u32 vic_sources)304304+ u32 vic_sources, struct device_node *node)322305{323306 unsigned int i;324307 int vic_2nd_block = ((unsigned long)base & ~PAGE_MASK) != 0;···345328 }346329347330 vic_set_irq_sources(base, irq_start, vic_sources);331331+ vic_register(base, irq_start, 0, node);348332}349333350350-/**351351- * vic_init - initialise a vectored interrupt controller352352- * @base: iomem base address353353- * @irq_start: starting interrupt number, must be muliple of 32354354- * @vic_sources: bitmask of interrupt sources to allow355355- * @resume_sources: bitmask of interrupt sources to allow for resume356356- */357357-void __init vic_init(void __iomem *base, unsigned int irq_start,358358- u32 vic_sources, u32 resume_sources)334334+static void __init __vic_init(void __iomem *base, unsigned int irq_start,335335+ u32 vic_sources, u32 resume_sources,336336+ struct device_node *node)359337{360338 unsigned int i;361339 u32 cellid = 0;···368356369357 switch(vendor) {370358 case AMBA_VENDOR_ST:371371- vic_init_st(base, irq_start, vic_sources);359359+ vic_init_st(base, irq_start, vic_sources, node);372360 return;373361 default:374362 printk(KERN_WARNING "VIC: unknown vendor, continuing anyways\n");···387375388376 vic_set_irq_sources(base, irq_start, vic_sources);389377390390- vic_pm_register(base, irq_start, resume_sources);378378+ vic_register(base, irq_start, resume_sources, node);379379+}380380+381381+/**382382+ * vic_init() - initialise a vectored interrupt controller383383+ * @base: iomem base address384384+ * @irq_start: starting interrupt number, must be muliple of 32385385+ * @vic_sources: bitmask of interrupt sources to allow386386+ * @resume_sources: bitmask of interrupt sources to allow for resume387387+ */388388+void __init vic_init(void __iomem *base, unsigned int irq_start,389389+ u32 vic_sources, u32 resume_sources)390390+{391391+ __vic_init(base, irq_start, vic_sources, resume_sources, NULL);392392+}393393+394394+#ifdef CONFIG_OF395395+int __init vic_of_init(struct device_node *node, struct device_node *parent)396396+{397397+ void __iomem *regs;398398+ int irq_base;399399+400400+ if (WARN(parent, "non-root VICs are not supported"))401401+ return -EINVAL;402402+403403+ regs = of_iomap(node, 0);404404+ if (WARN_ON(!regs))405405+ return -EIO;406406+407407+ irq_base = irq_alloc_descs(-1, 0, 32, numa_node_id());408408+ if (WARN_ON(irq_base < 0))409409+ goto out_unmap;410410+411411+ __vic_init(regs, irq_base, ~0, ~0, node);412412+413413+ return 0;414414+415415+ out_unmap:416416+ iounmap(regs);417417+418418+ return -EIO;419419+}420420+#endif /* CONFIG OF */421421+422422+/*423423+ * Handle each interrupt in a single VIC. Returns non-zero if we've424424+ * handled at least one interrupt. This does a single read of the425425+ * status register and handles all interrupts in order from LSB first.426426+ */427427+static int handle_one_vic(struct vic_device *vic, struct pt_regs *regs)428428+{429429+ u32 stat, irq;430430+ int handled = 0;431431+432432+ stat = readl_relaxed(vic->base + VIC_IRQ_STATUS);433433+ while (stat) {434434+ irq = ffs(stat) - 1;435435+ handle_IRQ(irq_domain_to_irq(&vic->domain, irq), regs);436436+ stat &= ~(1 << irq);437437+ handled = 1;438438+ }439439+440440+ return handled;441441+}442442+443443+/*444444+ * Keep iterating over all registered VIC's until there are no pending445445+ * interrupts.446446+ */447447+asmlinkage void __exception_irq_entry vic_handle_irq(struct pt_regs *regs)448448+{449449+ int i, handled;450450+451451+ do {452452+ for (i = 0, handled = 0; i < vic_id; ++i)453453+ handled |= handle_one_vic(&vic_devices[i], regs);454454+ } while (handled);391455}
···11+#ifndef __ASMARM_CTI_H22+#define __ASMARM_CTI_H33+44+#include <asm/io.h>55+66+/* The registers' definition is from section 3.2 of77+ * Embedded Cross Trigger Revision: r0p088+ */99+#define CTICONTROL 0x0001010+#define CTISTATUS 0x0041111+#define CTILOCK 0x0081212+#define CTIPROTECTION 0x00C1313+#define CTIINTACK 0x0101414+#define CTIAPPSET 0x0141515+#define CTIAPPCLEAR 0x0181616+#define CTIAPPPULSE 0x01c1717+#define CTIINEN 0x0201818+#define CTIOUTEN 0x0A01919+#define CTITRIGINSTATUS 0x1302020+#define CTITRIGOUTSTATUS 0x1342121+#define CTICHINSTATUS 0x1382222+#define CTICHOUTSTATUS 0x13c2323+#define CTIPERIPHID0 0xFE02424+#define CTIPERIPHID1 0xFE42525+#define CTIPERIPHID2 0xFE82626+#define CTIPERIPHID3 0xFEC2727+#define CTIPCELLID0 0xFF02828+#define CTIPCELLID1 0xFF42929+#define CTIPCELLID2 0xFF83030+#define CTIPCELLID3 0xFFC3131+3232+/* The below are from section 3.6.4 of3333+ * CoreSight v1.0 Architecture Specification3434+ */3535+#define LOCKACCESS 0xFB03636+#define LOCKSTATUS 0xFB43737+3838+/* write this value to LOCKACCESS will unlock the module, and3939+ * other value will lock the module4040+ */4141+#define LOCKCODE 0xC5ACCE554242+4343+/**4444+ * struct cti - cross trigger interface struct4545+ * @base: mapped virtual address for the cti base4646+ * @irq: irq number for the cti4747+ * @trig_out_for_irq: triger out number which will cause4848+ * the @irq happen4949+ *5050+ * cti struct used to operate cti registers.5151+ */5252+struct cti {5353+ void __iomem *base;5454+ int irq;5555+ int trig_out_for_irq;5656+};5757+5858+/**5959+ * cti_init - initialize the cti instance6060+ * @cti: cti instance6161+ * @base: mapped virtual address for the cti base6262+ * @irq: irq number for the cti6363+ * @trig_out: triger out number which will cause6464+ * the @irq happen6565+ *6666+ * called by machine code to pass the board dependent6767+ * @base, @irq and @trig_out to cti.6868+ */6969+static inline void cti_init(struct cti *cti,7070+ void __iomem *base, int irq, int trig_out)7171+{7272+ cti->base = base;7373+ cti->irq = irq;7474+ cti->trig_out_for_irq = trig_out;7575+}7676+7777+/**7878+ * cti_map_trigger - use the @chan to map @trig_in to @trig_out7979+ * @cti: cti instance8080+ * @trig_in: trigger in number8181+ * @trig_out: trigger out number8282+ * @channel: channel number8383+ *8484+ * This function maps one trigger in of @trig_in to one trigger8585+ * out of @trig_out using the channel @chan.8686+ */8787+static inline void cti_map_trigger(struct cti *cti,8888+ int trig_in, int trig_out, int chan)8989+{9090+ void __iomem *base = cti->base;9191+ unsigned long val;9292+9393+ val = __raw_readl(base + CTIINEN + trig_in * 4);9494+ val |= BIT(chan);9595+ __raw_writel(val, base + CTIINEN + trig_in * 4);9696+9797+ val = __raw_readl(base + CTIOUTEN + trig_out * 4);9898+ val |= BIT(chan);9999+ __raw_writel(val, base + CTIOUTEN + trig_out * 4);100100+}101101+102102+/**103103+ * cti_enable - enable the cti module104104+ * @cti: cti instance105105+ *106106+ * enable the cti module107107+ */108108+static inline void cti_enable(struct cti *cti)109109+{110110+ __raw_writel(0x1, cti->base + CTICONTROL);111111+}112112+113113+/**114114+ * cti_disable - disable the cti module115115+ * @cti: cti instance116116+ *117117+ * enable the cti module118118+ */119119+static inline void cti_disable(struct cti *cti)120120+{121121+ __raw_writel(0, cti->base + CTICONTROL);122122+}123123+124124+/**125125+ * cti_irq_ack - clear the cti irq126126+ * @cti: cti instance127127+ *128128+ * clear the cti irq129129+ */130130+static inline void cti_irq_ack(struct cti *cti)131131+{132132+ void __iomem *base = cti->base;133133+ unsigned long val;134134+135135+ val = __raw_readl(base + CTIINTACK);136136+ val |= BIT(cti->trig_out_for_irq);137137+ __raw_writel(val, base + CTIINTACK);138138+}139139+140140+/**141141+ * cti_unlock - unlock cti module142142+ * @cti: cti instance143143+ *144144+ * unlock the cti module, or else any writes to the cti145145+ * module is not allowed.146146+ */147147+static inline void cti_unlock(struct cti *cti)148148+{149149+ void __iomem *base = cti->base;150150+ unsigned long val;151151+152152+ val = __raw_readl(base + LOCKSTATUS);153153+154154+ if (val & 1) {155155+ val = LOCKCODE;156156+ __raw_writel(val, base + LOCKACCESS);157157+ }158158+}159159+160160+/**161161+ * cti_lock - lock cti module162162+ * @cti: cti instance163163+ *164164+ * lock the cti module, so any writes to the cti165165+ * module will be not allowed.166166+ */167167+static inline void cti_lock(struct cti *cti)168168+{169169+ void __iomem *base = cti->base;170170+ unsigned long val;171171+172172+ val = __raw_readl(base + LOCKSTATUS);173173+174174+ if (!(val & 1)) {175175+ val = ~LOCKCODE;176176+ __raw_writel(val, base + LOCKACCESS);177177+ }178178+}179179+#endif
-57
arch/arm/include/asm/entry-macro-vic2.S
···11-/* arch/arm/include/asm/entry-macro-vic2.S22- *33- * Originally arch/arm/mach-s3c6400/include/mach/entry-macro.S44- *55- * Copyright 2008 Openmoko, Inc.66- * Copyright 2008 Simtec Electronics77- * http://armlinux.simtec.co.uk/88- * Ben Dooks <ben@simtec.co.uk>99- *1010- * Low-level IRQ helper macros for a device with two VICs1111- *1212- * This file is licensed under the terms of the GNU General Public1313- * License version 2. This program is licensed "as is" without any1414- * warranty of any kind, whether express or implied.1515-*/1616-1717-/* This should be included from <mach/entry-macro.S> with the necessary1818- * defines for virtual addresses and IRQ bases for the two vics.1919- *2020- * The code needs the following defined:2121- * IRQ_VIC0_BASE IRQ number of VIC0's first IRQ2222- * IRQ_VIC1_BASE IRQ number of VIC1's first IRQ2323- * VA_VIC0 Virtual address of VIC02424- * VA_VIC1 Virtual address of VIC12525- *2626- * Note, code assumes VIC0's virtual address is an ARM immediate constant2727- * away from VIC1.2828-*/2929-3030-#include <asm/hardware/vic.h>3131-3232- .macro disable_fiq3333- .endm3434-3535- .macro get_irqnr_preamble, base, tmp3636- ldr \base, =VA_VIC03737- .endm3838-3939- .macro arch_ret_to_user, tmp1, tmp24040- .endm4141-4242- .macro get_irqnr_and_base, irqnr, irqstat, base, tmp4343-4444- @ check the vic04545- mov \irqnr, #IRQ_VIC0_BASE + 314646- ldr \irqstat, [ \base, # VIC_IRQ_STATUS ]4747- teq \irqstat, #04848-4949- @ otherwise try vic15050- addeq \tmp, \base, #(VA_VIC1 - VA_VIC0)5151- addeq \irqnr, \irqnr, #(IRQ_VIC1_BASE - IRQ_VIC0_BASE)5252- ldreq \irqstat, [ \tmp, # VIC_IRQ_STATUS ]5353- teqeq \irqstat, #05454-5555- clzne \irqstat, \irqstat5656- subne \irqnr, \irqnr, \irqstat5757- .endm
-60
arch/arm/include/asm/hardware/entry-macro-gic.S
···11-/*22- * arch/arm/include/asm/hardware/entry-macro-gic.S33- *44- * Low-level IRQ helper macros for GIC55- *66- * This file is licensed under the terms of the GNU General Public77- * License version 2. This program is licensed "as is" without any88- * warranty of any kind, whether express or implied.99- */1010-1111-#include <asm/hardware/gic.h>1212-1313-#ifndef HAVE_GET_IRQNR_PREAMBLE1414- .macro get_irqnr_preamble, base, tmp1515- ldr \base, =gic_cpu_base_addr1616- ldr \base, [\base]1717- .endm1818-#endif1919-2020-/*2121- * The interrupt numbering scheme is defined in the2222- * interrupt controller spec. To wit:2323- *2424- * Interrupts 0-15 are IPI2525- * 16-31 are local. We allow 30 to be used for the watchdog.2626- * 32-1020 are global2727- * 1021-1022 are reserved2828- * 1023 is "spurious" (no interrupt)2929- *3030- * A simple read from the controller will tell us the number of the highest3131- * priority enabled interrupt. We then just need to check whether it is in the3232- * valid range for an IRQ (30-1020 inclusive).3333- */3434-3535- .macro get_irqnr_and_base, irqnr, irqstat, base, tmp3636-3737- ldr \irqstat, [\base, #GIC_CPU_INTACK]3838- /* bits 12-10 = src CPU, 9-0 = int # */3939-4040- ldr \tmp, =10214141- bic \irqnr, \irqstat, #0x1c004242- cmp \irqnr, #154343- cmpcc \irqnr, \irqnr4444- cmpne \irqnr, \tmp4545- cmpcs \irqnr, \irqnr4646- .endm4747-4848-/* We assume that irqstat (the raw value of the IRQ acknowledge4949- * register) is preserved from the macro above.5050- * If there is an IPI, we immediately signal end of interrupt on the5151- * controller, since this requires the original irqstat value which5252- * we won't easily be able to recreate later.5353- */5454-5555- .macro test_for_ipi, irqnr, irqstat, base, tmp5656- bic \irqnr, \irqstat, #0x1c005757- cmp \irqnr, #165858- strcc \irqstat, [\base, #GIC_CPU_EOI]5959- cmpcs \irqnr, \irqnr6060- .endm
···11+#ifndef __ASM_IDMAP_H22+#define __ASM_IDMAP_H33+44+#include <linux/compiler.h>55+#include <asm/pgtable.h>66+77+/* Tag a function as requiring to be executed via an identity mapping. */88+#define __idmap __section(.idmap.text) noinline notrace99+1010+extern pgd_t *idmap_pgd;1111+1212+void setup_mm_for_reboot(void);1313+1414+#endif /* __ASM_IDMAP_H */
+5-4
arch/arm/include/asm/mach/arch.h
···3131 unsigned int video_start; /* start of video RAM */3232 unsigned int video_end; /* end of video RAM */33333434- unsigned int reserve_lp0 :1; /* never has lp0 */3535- unsigned int reserve_lp1 :1; /* never has lp1 */3636- unsigned int reserve_lp2 :1; /* never has lp2 */3737- unsigned int soft_reboot :1; /* soft reboot */3434+ unsigned char reserve_lp0 :1; /* never has lp0 */3535+ unsigned char reserve_lp1 :1; /* never has lp1 */3636+ unsigned char reserve_lp2 :1; /* never has lp2 */3737+ char restart_mode; /* default restart mode */3838 void (*fixup)(struct tag *, char **,3939 struct meminfo *);4040 void (*reserve)(void);/* reserve mem blocks */···4646#ifdef CONFIG_MULTI_IRQ_HANDLER4747 void (*handle_irq)(struct pt_regs *);4848#endif4949+ void (*restart)(char, const char *);4950};50515152/*
···140140#define L_PTE_MT_DEV_CACHED (_AT(pteval_t, 0x0b) << 2) /* 1011 */141141#define L_PTE_MT_MASK (_AT(pteval_t, 0x0f) << 2)142142143143+#ifndef __ASSEMBLY__144144+145145+/*146146+ * The "pud_xxx()" functions here are trivial when the pmd is folded into147147+ * the pud: the pud entry is never bad, always exists, and can't be set or148148+ * cleared.149149+ */150150+#define pud_none(pud) (0)151151+#define pud_bad(pud) (0)152152+#define pud_present(pud) (1)153153+#define pud_clear(pudp) do { } while (0)154154+#define set_pud(pud,pudp) do { } while (0)155155+156156+static inline pmd_t *pmd_offset(pud_t *pud, unsigned long addr)157157+{158158+ return (pmd_t *)pud;159159+}160160+161161+#define pmd_bad(pmd) (pmd_val(pmd) & 2)162162+163163+#define copy_pmd(pmdpd,pmdps) \164164+ do { \165165+ pmdpd[0] = pmdps[0]; \166166+ pmdpd[1] = pmdps[1]; \167167+ flush_pmd_entry(pmdpd); \168168+ } while (0)169169+170170+#define pmd_clear(pmdp) \171171+ do { \172172+ pmdp[0] = __pmd(0); \173173+ pmdp[1] = __pmd(0); \174174+ clean_pmd_entry(pmdp); \175175+ } while (0)176176+177177+/* we don't need complex calculations here as the pmd is folded into the pgd */178178+#define pmd_addr_end(addr,end) (end)179179+180180+#define set_pte_ext(ptep,pte,ext) cpu_set_pte_ext(ptep,pte,ext)181181+182182+#endif /* __ASSEMBLY__ */183183+143184#endif /* _ASM_PGTABLE_2LEVEL_H */
+77
arch/arm/include/asm/pgtable-3level-hwdef.h
···11+/*22+ * arch/arm/include/asm/pgtable-3level-hwdef.h33+ *44+ * Copyright (C) 2011 ARM Ltd.55+ * Author: Catalin Marinas <catalin.marinas@arm.com>66+ *77+ * This program is free software; you can redistribute it and/or modify88+ * it under the terms of the GNU General Public License version 2 as99+ * published by the Free Software Foundation.1010+ *1111+ * This program is distributed in the hope that it will be useful,1212+ * but WITHOUT ANY WARRANTY; without even the implied warranty of1313+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1414+ * GNU General Public License for more details.1515+ *1616+ * You should have received a copy of the GNU General Public License1717+ * along with this program; if not, write to the Free Software1818+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1919+ */2020+#ifndef _ASM_PGTABLE_3LEVEL_HWDEF_H2121+#define _ASM_PGTABLE_3LEVEL_HWDEF_H2222+2323+/*2424+ * Hardware page table definitions.2525+ *2626+ * + Level 1/2 descriptor2727+ * - common2828+ */2929+#define PMD_TYPE_MASK (_AT(pmdval_t, 3) << 0)3030+#define PMD_TYPE_FAULT (_AT(pmdval_t, 0) << 0)3131+#define PMD_TYPE_TABLE (_AT(pmdval_t, 3) << 0)3232+#define PMD_TYPE_SECT (_AT(pmdval_t, 1) << 0)3333+#define PMD_BIT4 (_AT(pmdval_t, 0))3434+#define PMD_DOMAIN(x) (_AT(pmdval_t, 0))3535+3636+/*3737+ * - section3838+ */3939+#define PMD_SECT_BUFFERABLE (_AT(pmdval_t, 1) << 2)4040+#define PMD_SECT_CACHEABLE (_AT(pmdval_t, 1) << 3)4141+#define PMD_SECT_S (_AT(pmdval_t, 3) << 8)4242+#define PMD_SECT_AF (_AT(pmdval_t, 1) << 10)4343+#define PMD_SECT_nG (_AT(pmdval_t, 1) << 11)4444+#define PMD_SECT_XN (_AT(pmdval_t, 1) << 54)4545+#define PMD_SECT_AP_WRITE (_AT(pmdval_t, 0))4646+#define PMD_SECT_AP_READ (_AT(pmdval_t, 0))4747+#define PMD_SECT_TEX(x) (_AT(pmdval_t, 0))4848+4949+/*5050+ * AttrIndx[2:0] encoding (mapping attributes defined in the MAIR* registers).5151+ */5252+#define PMD_SECT_UNCACHED (_AT(pmdval_t, 0) << 2) /* strongly ordered */5353+#define PMD_SECT_BUFFERED (_AT(pmdval_t, 1) << 2) /* normal non-cacheable */5454+#define PMD_SECT_WT (_AT(pmdval_t, 2) << 2) /* normal inner write-through */5555+#define PMD_SECT_WB (_AT(pmdval_t, 3) << 2) /* normal inner write-back */5656+#define PMD_SECT_WBWA (_AT(pmdval_t, 7) << 2) /* normal inner write-alloc */5757+5858+/*5959+ * + Level 3 descriptor (PTE)6060+ */6161+#define PTE_TYPE_MASK (_AT(pteval_t, 3) << 0)6262+#define PTE_TYPE_FAULT (_AT(pteval_t, 0) << 0)6363+#define PTE_TYPE_PAGE (_AT(pteval_t, 3) << 0)6464+#define PTE_BUFFERABLE (_AT(pteval_t, 1) << 2) /* AttrIndx[0] */6565+#define PTE_CACHEABLE (_AT(pteval_t, 1) << 3) /* AttrIndx[1] */6666+#define PTE_EXT_SHARED (_AT(pteval_t, 3) << 8) /* SH[1:0], inner shareable */6767+#define PTE_EXT_AF (_AT(pteval_t, 1) << 10) /* Access Flag */6868+#define PTE_EXT_NG (_AT(pteval_t, 1) << 11) /* nG */6969+#define PTE_EXT_XN (_AT(pteval_t, 1) << 54) /* XN */7070+7171+/*7272+ * 40-bit physical address supported.7373+ */7474+#define PHYS_MASK_SHIFT (40)7575+#define PHYS_MASK ((1ULL << PHYS_MASK_SHIFT) - 1)7676+7777+#endif
+70
arch/arm/include/asm/pgtable-3level-types.h
···11+/*22+ * arch/arm/include/asm/pgtable-3level-types.h33+ *44+ * Copyright (C) 2011 ARM Ltd.55+ * Author: Catalin Marinas <catalin.marinas@arm.com>66+ *77+ * This program is free software; you can redistribute it and/or modify88+ * it under the terms of the GNU General Public License version 2 as99+ * published by the Free Software Foundation.1010+ *1111+ * This program is distributed in the hope that it will be useful,1212+ * but WITHOUT ANY WARRANTY; without even the implied warranty of1313+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1414+ * GNU General Public License for more details.1515+ *1616+ * You should have received a copy of the GNU General Public License1717+ * along with this program; if not, write to the Free Software1818+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1919+ */2020+#ifndef _ASM_PGTABLE_3LEVEL_TYPES_H2121+#define _ASM_PGTABLE_3LEVEL_TYPES_H2222+2323+#include <asm/types.h>2424+2525+typedef u64 pteval_t;2626+typedef u64 pmdval_t;2727+typedef u64 pgdval_t;2828+2929+#undef STRICT_MM_TYPECHECKS3030+3131+#ifdef STRICT_MM_TYPECHECKS3232+3333+/*3434+ * These are used to make use of C type-checking..3535+ */3636+typedef struct { pteval_t pte; } pte_t;3737+typedef struct { pmdval_t pmd; } pmd_t;3838+typedef struct { pgdval_t pgd; } pgd_t;3939+typedef struct { pteval_t pgprot; } pgprot_t;4040+4141+#define pte_val(x) ((x).pte)4242+#define pmd_val(x) ((x).pmd)4343+#define pgd_val(x) ((x).pgd)4444+#define pgprot_val(x) ((x).pgprot)4545+4646+#define __pte(x) ((pte_t) { (x) } )4747+#define __pmd(x) ((pmd_t) { (x) } )4848+#define __pgd(x) ((pgd_t) { (x) } )4949+#define __pgprot(x) ((pgprot_t) { (x) } )5050+5151+#else /* !STRICT_MM_TYPECHECKS */5252+5353+typedef pteval_t pte_t;5454+typedef pmdval_t pmd_t;5555+typedef pgdval_t pgd_t;5656+typedef pteval_t pgprot_t;5757+5858+#define pte_val(x) (x)5959+#define pmd_val(x) (x)6060+#define pgd_val(x) (x)6161+#define pgprot_val(x) (x)6262+6363+#define __pte(x) (x)6464+#define __pmd(x) (x)6565+#define __pgd(x) (x)6666+#define __pgprot(x) (x)6767+6868+#endif /* STRICT_MM_TYPECHECKS */6969+7070+#endif /* _ASM_PGTABLE_3LEVEL_TYPES_H */
+155
arch/arm/include/asm/pgtable-3level.h
···11+/*22+ * arch/arm/include/asm/pgtable-3level.h33+ *44+ * Copyright (C) 2011 ARM Ltd.55+ * Author: Catalin Marinas <catalin.marinas@arm.com>66+ *77+ * This program is free software; you can redistribute it and/or modify88+ * it under the terms of the GNU General Public License version 2 as99+ * published by the Free Software Foundation.1010+ *1111+ * This program is distributed in the hope that it will be useful,1212+ * but WITHOUT ANY WARRANTY; without even the implied warranty of1313+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1414+ * GNU General Public License for more details.1515+ *1616+ * You should have received a copy of the GNU General Public License1717+ * along with this program; if not, write to the Free Software1818+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1919+ */2020+#ifndef _ASM_PGTABLE_3LEVEL_H2121+#define _ASM_PGTABLE_3LEVEL_H2222+2323+/*2424+ * With LPAE, there are 3 levels of page tables. Each level has 512 entries of2525+ * 8 bytes each, occupying a 4K page. The first level table covers a range of2626+ * 512GB, each entry representing 1GB. Since we are limited to 4GB input2727+ * address range, only 4 entries in the PGD are used.2828+ *2929+ * There are enough spare bits in a page table entry for the kernel specific3030+ * state.3131+ */3232+#define PTRS_PER_PTE 5123333+#define PTRS_PER_PMD 5123434+#define PTRS_PER_PGD 43535+3636+#define PTE_HWTABLE_PTRS (PTRS_PER_PTE)3737+#define PTE_HWTABLE_OFF (0)3838+#define PTE_HWTABLE_SIZE (PTRS_PER_PTE * sizeof(u64))3939+4040+/*4141+ * PGDIR_SHIFT determines the size a top-level page table entry can map.4242+ */4343+#define PGDIR_SHIFT 304444+4545+/*4646+ * PMD_SHIFT determines the size a middle-level page table entry can map.4747+ */4848+#define PMD_SHIFT 214949+5050+#define PMD_SIZE (1UL << PMD_SHIFT)5151+#define PMD_MASK (~(PMD_SIZE-1))5252+#define PGDIR_SIZE (1UL << PGDIR_SHIFT)5353+#define PGDIR_MASK (~(PGDIR_SIZE-1))5454+5555+/*5656+ * section address mask and size definitions.5757+ */5858+#define SECTION_SHIFT 215959+#define SECTION_SIZE (1UL << SECTION_SHIFT)6060+#define SECTION_MASK (~(SECTION_SIZE-1))6161+6262+#define USER_PTRS_PER_PGD (PAGE_OFFSET / PGDIR_SIZE)6363+6464+/*6565+ * "Linux" PTE definitions for LPAE.6666+ *6767+ * These bits overlap with the hardware bits but the naming is preserved for6868+ * consistency with the classic page table format.6969+ */7070+#define L_PTE_PRESENT (_AT(pteval_t, 3) << 0) /* Valid */7171+#define L_PTE_FILE (_AT(pteval_t, 1) << 2) /* only when !PRESENT */7272+#define L_PTE_BUFFERABLE (_AT(pteval_t, 1) << 2) /* AttrIndx[0] */7373+#define L_PTE_CACHEABLE (_AT(pteval_t, 1) << 3) /* AttrIndx[1] */7474+#define L_PTE_USER (_AT(pteval_t, 1) << 6) /* AP[1] */7575+#define L_PTE_RDONLY (_AT(pteval_t, 1) << 7) /* AP[2] */7676+#define L_PTE_SHARED (_AT(pteval_t, 3) << 8) /* SH[1:0], inner shareable */7777+#define L_PTE_YOUNG (_AT(pteval_t, 1) << 10) /* AF */7878+#define L_PTE_XN (_AT(pteval_t, 1) << 54) /* XN */7979+#define L_PTE_DIRTY (_AT(pteval_t, 1) << 55) /* unused */8080+#define L_PTE_SPECIAL (_AT(pteval_t, 1) << 56) /* unused */8181+8282+/*8383+ * To be used in assembly code with the upper page attributes.8484+ */8585+#define L_PTE_XN_HIGH (1 << (54 - 32))8686+#define L_PTE_DIRTY_HIGH (1 << (55 - 32))8787+8888+/*8989+ * AttrIndx[2:0] encoding (mapping attributes defined in the MAIR* registers).9090+ */9191+#define L_PTE_MT_UNCACHED (_AT(pteval_t, 0) << 2) /* strongly ordered */9292+#define L_PTE_MT_BUFFERABLE (_AT(pteval_t, 1) << 2) /* normal non-cacheable */9393+#define L_PTE_MT_WRITETHROUGH (_AT(pteval_t, 2) << 2) /* normal inner write-through */9494+#define L_PTE_MT_WRITEBACK (_AT(pteval_t, 3) << 2) /* normal inner write-back */9595+#define L_PTE_MT_WRITEALLOC (_AT(pteval_t, 7) << 2) /* normal inner write-alloc */9696+#define L_PTE_MT_DEV_SHARED (_AT(pteval_t, 4) << 2) /* device */9797+#define L_PTE_MT_DEV_NONSHARED (_AT(pteval_t, 4) << 2) /* device */9898+#define L_PTE_MT_DEV_WC (_AT(pteval_t, 1) << 2) /* normal non-cacheable */9999+#define L_PTE_MT_DEV_CACHED (_AT(pteval_t, 3) << 2) /* normal inner write-back */100100+#define L_PTE_MT_MASK (_AT(pteval_t, 7) << 2)101101+102102+/*103103+ * Software PGD flags.104104+ */105105+#define L_PGD_SWAPPER (_AT(pgdval_t, 1) << 55) /* swapper_pg_dir entry */106106+107107+#ifndef __ASSEMBLY__108108+109109+#define pud_none(pud) (!pud_val(pud))110110+#define pud_bad(pud) (!(pud_val(pud) & 2))111111+#define pud_present(pud) (pud_val(pud))112112+113113+#define pud_clear(pudp) \114114+ do { \115115+ *pudp = __pud(0); \116116+ clean_pmd_entry(pudp); \117117+ } while (0)118118+119119+#define set_pud(pudp, pud) \120120+ do { \121121+ *pudp = pud; \122122+ flush_pmd_entry(pudp); \123123+ } while (0)124124+125125+static inline pmd_t *pud_page_vaddr(pud_t pud)126126+{127127+ return __va(pud_val(pud) & PHYS_MASK & (s32)PAGE_MASK);128128+}129129+130130+/* Find an entry in the second-level page table.. */131131+#define pmd_index(addr) (((addr) >> PMD_SHIFT) & (PTRS_PER_PMD - 1))132132+static inline pmd_t *pmd_offset(pud_t *pud, unsigned long addr)133133+{134134+ return (pmd_t *)pud_page_vaddr(*pud) + pmd_index(addr);135135+}136136+137137+#define pmd_bad(pmd) (!(pmd_val(pmd) & 2))138138+139139+#define copy_pmd(pmdpd,pmdps) \140140+ do { \141141+ *pmdpd = *pmdps; \142142+ flush_pmd_entry(pmdpd); \143143+ } while (0)144144+145145+#define pmd_clear(pmdp) \146146+ do { \147147+ *pmdp = __pmd(0); \148148+ clean_pmd_entry(pmdp); \149149+ } while (0)150150+151151+#define set_pte_ext(ptep,pte,ext) cpu_set_pte_ext(ptep,__pte(pte_val(pte)|(ext)))152152+153153+#endif /* __ASSEMBLY__ */154154+155155+#endif /* _ASM_PGTABLE_3LEVEL_H */
···1111#define _ASMARM_PGTABLE_H12121313#include <linux/const.h>1414-#include <asm-generic/4level-fixup.h>1514#include <asm/proc-fns.h>16151716#ifndef CONFIG_MMU18171818+#include <asm-generic/4level-fixup.h>1919#include "pgtable-nommu.h"20202121#else22222323+#include <asm-generic/pgtable-nopud.h>2324#include <asm/memory.h>2424-#include <mach/vmalloc.h>2525#include <asm/pgtable-hwdef.h>26262727+#ifdef CONFIG_ARM_LPAE2828+#include <asm/pgtable-3level.h>2929+#else2730#include <asm/pgtable-2level.h>3131+#endif28322933/*3034 * Just any arbitrary offset to the start of the vmalloc VM area: the···3733 * any out-of-bounds memory accesses will hopefully be caught.3834 * The vmalloc() routines leaves a hole of 4kB between each vmalloced3935 * area for the same reason. ;)4040- *4141- * Note that platforms may override VMALLOC_START, but they must provide4242- * VMALLOC_END. VMALLOC_END defines the (exclusive) limit of this space,4343- * which may not overlap IO space.4436 */4545-#ifndef VMALLOC_START4637#define VMALLOC_OFFSET (8*1024*1024)4738#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))4848-#endif3939+#define VMALLOC_END 0xff000000UL49405041#define LIBRARY_TEXT_START 0x0c0000005142···162163/* to find an entry in a kernel page-table-directory */163164#define pgd_offset_k(addr) pgd_offset(&init_mm, addr)164165165165-/*166166- * The "pgd_xxx()" functions here are trivial for a folded two-level167167- * setup: the pgd is never bad, and a pmd always exists (as it's folded168168- * into the pgd entry)169169- */170170-#define pgd_none(pgd) (0)171171-#define pgd_bad(pgd) (0)172172-#define pgd_present(pgd) (1)173173-#define pgd_clear(pgdp) do { } while (0)174174-#define set_pgd(pgd,pgdp) do { } while (0)175175-#define set_pud(pud,pudp) do { } while (0)176176-177177-178178-/* Find an entry in the second-level page table.. */179179-#define pmd_offset(dir, addr) ((pmd_t *)(dir))180180-181166#define pmd_none(pmd) (!pmd_val(pmd))182167#define pmd_present(pmd) (pmd_val(pmd))183183-#define pmd_bad(pmd) (pmd_val(pmd) & 2)184184-185185-#define copy_pmd(pmdpd,pmdps) \186186- do { \187187- pmdpd[0] = pmdps[0]; \188188- pmdpd[1] = pmdps[1]; \189189- flush_pmd_entry(pmdpd); \190190- } while (0)191191-192192-#define pmd_clear(pmdp) \193193- do { \194194- pmdp[0] = __pmd(0); \195195- pmdp[1] = __pmd(0); \196196- clean_pmd_entry(pmdp); \197197- } while (0)198168199169static inline pte_t *pmd_page_vaddr(pmd_t pmd)200170{···171203}172204173205#define pmd_page(pmd) pfn_to_page(__phys_to_pfn(pmd_val(pmd) & PHYS_MASK))174174-175175-/* we don't need complex calculations here as the pmd is folded into the pgd */176176-#define pmd_addr_end(addr,end) (end)177177-178206179207#ifndef CONFIG_HIGHPTE180208#define __pte_map(pmd) pmd_page_vaddr(*(pmd))···193229#define pte_page(pte) pfn_to_page(pte_pfn(pte))194230#define mk_pte(page,prot) pfn_pte(page_to_pfn(page), prot)195231196196-#define set_pte_ext(ptep,pte,ext) cpu_set_pte_ext(ptep,pte,ext)197232#define pte_clear(mm,addr,ptep) set_pte_ext(ptep, __pte(0), 0)198233199234#if __LINUX_ARM_ARCH__ < 6···309346 remap_pfn_range(vma, from, pfn, size, prot)310347311348#define pgtable_cache_init() do { } while (0)312312-313313-void identity_mapping_add(pgd_t *, unsigned long, unsigned long);314314-void identity_mapping_del(pgd_t *, unsigned long, unsigned long);315349316350#endif /* !__ASSEMBLY__ */317351
+12-3
arch/arm/include/asm/pmu.h
···2727/*2828 * struct arm_pmu_platdata - ARM PMU platform data2929 *3030- * @handle_irq: an optional handler which will be called from the interrupt and3131- * passed the address of the low level handler, and can be used to implement3232- * any platform specific handling before or after calling it.3030+ * @handle_irq: an optional handler which will be called from the3131+ * interrupt and passed the address of the low level handler,3232+ * and can be used to implement any platform specific handling3333+ * before or after calling it.3434+ * @enable_irq: an optional handler which will be called after3535+ * request_irq and be used to handle some platform specific3636+ * irq enablement3737+ * @disable_irq: an optional handler which will be called before3838+ * free_irq and be used to handle some platform specific3939+ * irq disablement3340 */3441struct arm_pmu_platdata {3542 irqreturn_t (*handle_irq)(int irq, void *dev,3643 irq_handler_t pmu_handler);4444+ void (*enable_irq)(int irq);4545+ void (*disable_irq)(int irq);3746};38473948#ifdef CONFIG_CPU_HAS_PMU
+21
arch/arm/include/asm/proc-fns.h
···6565 * Set a possibly extended PTE. Non-extended PTEs should6666 * ignore 'ext'.6767 */6868+#ifdef CONFIG_ARM_LPAE6969+ void (*set_pte_ext)(pte_t *ptep, pte_t pte);7070+#else6871 void (*set_pte_ext)(pte_t *ptep, pte_t pte, unsigned int ext);7272+#endif69737074 /* Suspend/resume */7175 unsigned int suspend_size;···8379extern int cpu_do_idle(void);8480extern void cpu_dcache_clean_area(void *, int);8581extern void cpu_do_switch_mm(unsigned long pgd_phys, struct mm_struct *mm);8282+#ifdef CONFIG_ARM_LPAE8383+extern void cpu_set_pte_ext(pte_t *ptep, pte_t pte);8484+#else8685extern void cpu_set_pte_ext(pte_t *ptep, pte_t pte, unsigned int ext);8686+#endif8787extern void cpu_reset(unsigned long addr) __attribute__((noreturn));88888989/* These three are private to arch/arm/kernel/suspend.c */···115107116108#define cpu_switch_mm(pgd,mm) cpu_do_switch_mm(virt_to_phys(pgd),mm)117109110110+#ifdef CONFIG_ARM_LPAE111111+#define cpu_get_pgd() \112112+ ({ \113113+ unsigned long pg, pg2; \114114+ __asm__("mrrc p15, 0, %0, %1, c2" \115115+ : "=r" (pg), "=r" (pg2) \116116+ : \117117+ : "cc"); \118118+ pg &= ~(PTRS_PER_PGD*sizeof(pgd_t)-1); \119119+ (pgd_t *)phys_to_virt(pg); \120120+ })121121+#else118122#define cpu_get_pgd() \119123 ({ \120124 unsigned long pg; \···135115 pg &= ~0x3fff; \136116 (pgd_t *)phys_to_virt(pg); \137117 })118118+#endif138119139120#endif140121
+1-107
arch/arm/include/asm/sched_clock.h
···88#ifndef ASM_SCHED_CLOCK99#define ASM_SCHED_CLOCK10101111-#include <linux/kernel.h>1212-#include <linux/types.h>1313-1414-struct clock_data {1515- u64 epoch_ns;1616- u32 epoch_cyc;1717- u32 epoch_cyc_copy;1818- u32 mult;1919- u32 shift;2020-};2121-2222-#define DEFINE_CLOCK_DATA(name) struct clock_data name2323-2424-static inline u64 cyc_to_ns(u64 cyc, u32 mult, u32 shift)2525-{2626- return (cyc * mult) >> shift;2727-}2828-2929-/*3030- * Atomically update the sched_clock epoch. Your update callback will3131- * be called from a timer before the counter wraps - read the current3232- * counter value, and call this function to safely move the epochs3333- * forward. Only use this from the update callback.3434- */3535-static inline void update_sched_clock(struct clock_data *cd, u32 cyc, u32 mask)3636-{3737- unsigned long flags;3838- u64 ns = cd->epoch_ns +3939- cyc_to_ns((cyc - cd->epoch_cyc) & mask, cd->mult, cd->shift);4040-4141- /*4242- * Write epoch_cyc and epoch_ns in a way that the update is4343- * detectable in cyc_to_fixed_sched_clock().4444- */4545- raw_local_irq_save(flags);4646- cd->epoch_cyc = cyc;4747- smp_wmb();4848- cd->epoch_ns = ns;4949- smp_wmb();5050- cd->epoch_cyc_copy = cyc;5151- raw_local_irq_restore(flags);5252-}5353-5454-/*5555- * If your clock rate is known at compile time, using this will allow5656- * you to optimize the mult/shift loads away. This is paired with5757- * init_fixed_sched_clock() to ensure that your mult/shift are correct.5858- */5959-static inline unsigned long long cyc_to_fixed_sched_clock(struct clock_data *cd,6060- u32 cyc, u32 mask, u32 mult, u32 shift)6161-{6262- u64 epoch_ns;6363- u32 epoch_cyc;6464-6565- /*6666- * Load the epoch_cyc and epoch_ns atomically. We do this by6767- * ensuring that we always write epoch_cyc, epoch_ns and6868- * epoch_cyc_copy in strict order, and read them in strict order.6969- * If epoch_cyc and epoch_cyc_copy are not equal, then we're in7070- * the middle of an update, and we should repeat the load.7171- */7272- do {7373- epoch_cyc = cd->epoch_cyc;7474- smp_rmb();7575- epoch_ns = cd->epoch_ns;7676- smp_rmb();7777- } while (epoch_cyc != cd->epoch_cyc_copy);7878-7979- return epoch_ns + cyc_to_ns((cyc - epoch_cyc) & mask, mult, shift);8080-}8181-8282-/*8383- * Otherwise, you need to use this, which will obtain the mult/shift8484- * from the clock_data structure. Use init_sched_clock() with this.8585- */8686-static inline unsigned long long cyc_to_sched_clock(struct clock_data *cd,8787- u32 cyc, u32 mask)8888-{8989- return cyc_to_fixed_sched_clock(cd, cyc, mask, cd->mult, cd->shift);9090-}9191-9292-/*9393- * Initialize the clock data - calculate the appropriate multiplier9494- * and shift. Also setup a timer to ensure that the epoch is refreshed9595- * at the appropriate time interval, which will call your update9696- * handler.9797- */9898-void init_sched_clock(struct clock_data *, void (*)(void),9999- unsigned int, unsigned long);100100-101101-/*102102- * Use this initialization function rather than init_sched_clock() if103103- * you're using cyc_to_fixed_sched_clock, which will warn if your104104- * constants are incorrect.105105- */106106-static inline void init_fixed_sched_clock(struct clock_data *cd,107107- void (*update)(void), unsigned int bits, unsigned long rate,108108- u32 mult, u32 shift)109109-{110110- init_sched_clock(cd, update, bits, rate);111111- if (cd->mult != mult || cd->shift != shift) {112112- pr_crit("sched_clock: wrong multiply/shift: %u>>%u vs calculated %u>>%u\n"113113- "sched_clock: fix multiply/shift to avoid scheduler hiccups\n",114114- mult, shift, cd->mult, cd->shift);115115- }116116-}117117-11811extern void sched_clock_postinit(void);1212+extern void setup_sched_clock(u32 (*read)(void), int bits, unsigned long rate);1191312014#endif
···5757 "ARM" , "Thumb" , "Jazelle", "ThumbEE"5858};59596060-extern void setup_mm_for_reboot(char mode);6060+extern void setup_mm_for_reboot(void);61616262static volatile int hlt_counter;6363···9292__setup("nohlt", nohlt_setup);9393__setup("hlt", hlt_setup);94949595-void arm_machine_restart(char mode, const char *cmd)9696-{9797- /* Disable interrupts first */9898- local_irq_disable();9999- local_fiq_disable();9595+extern void call_with_stack(void (*fn)(void *), void *arg, void *sp);9696+typedef void (*phys_reset_t)(unsigned long);10097101101- /*102102- * Tell the mm system that we are going to reboot -103103- * we may need it to insert some 1:1 mappings so that104104- * soft boot works.105105- */106106- setup_mm_for_reboot(mode);9898+/*9999+ * A temporary stack to use for CPU reset. This is static so that we100100+ * don't clobber it with the identity mapping. When running with this101101+ * stack, any references to the current task *will not work* so you102102+ * should really do as little as possible before jumping to your reset103103+ * code.104104+ */105105+static u64 soft_restart_stack[16];106106+107107+static void __soft_restart(void *addr)108108+{109109+ phys_reset_t phys_reset;110110+111111+ /* Take out a flat memory mapping. */112112+ setup_mm_for_reboot();107113108114 /* Clean and invalidate caches */109115 flush_cache_all();···120114 /* Push out any further dirty data, and ensure cache is empty */121115 flush_cache_all();122116123123- /*124124- * Now call the architecture specific reboot code.125125- */126126- arch_reset(mode, cmd);117117+ /* Switch to the identity mapping. */118118+ phys_reset = (phys_reset_t)(unsigned long)virt_to_phys(cpu_reset);119119+ phys_reset((unsigned long)addr);127120128128- /*129129- * Whoops - the architecture was unable to reboot.130130- * Tell the user!131131- */132132- mdelay(1000);133133- printk("Reboot failed -- System halted\n");134134- while (1);121121+ /* Should never get here. */122122+ BUG();123123+}124124+125125+void soft_restart(unsigned long addr)126126+{127127+ u64 *stack = soft_restart_stack + ARRAY_SIZE(soft_restart_stack);128128+129129+ /* Disable interrupts first */130130+ local_irq_disable();131131+ local_fiq_disable();132132+133133+ /* Disable the L2 if we're the last man standing. */134134+ if (num_online_cpus() == 1)135135+ outer_disable();136136+137137+ /* Change to the new stack and continue with the reset. */138138+ call_with_stack(__soft_restart, (void *)addr, (void *)stack);139139+140140+ /* Should never get here. */141141+ BUG();142142+}143143+144144+void arm_machine_restart(char mode, const char *cmd)145145+{146146+ /* Disable interrupts first */147147+ local_irq_disable();148148+ local_fiq_disable();149149+150150+ /* Call the architecture specific reboot code. */151151+ arch_reset(mode, cmd);135152}136153137154/*···282253void machine_restart(char *cmd)283254{284255 machine_shutdown();256256+285257 arm_pm_restart(reboot_mode, cmd);258258+259259+ /* Give a grace period for failure to restart of 1s */260260+ mdelay(1000);261261+262262+ /* Whoops - the platform was unable to reboot. Tell the user! */263263+ printk("Reboot failed -- System halted\n");264264+ while (1);286265}287266288267void __show_regs(struct pt_regs *regs)
+105-13
arch/arm/kernel/sched_clock.c
···14141515#include <asm/sched_clock.h>16161717+struct clock_data {1818+ u64 epoch_ns;1919+ u32 epoch_cyc;2020+ u32 epoch_cyc_copy;2121+ u32 mult;2222+ u32 shift;2323+};2424+1725static void sched_clock_poll(unsigned long wrap_ticks);1826static DEFINE_TIMER(sched_clock_timer, sched_clock_poll, 0, 0);1919-static void (*sched_clock_update_fn)(void);2727+2828+static struct clock_data cd = {2929+ .mult = NSEC_PER_SEC / HZ,3030+};3131+3232+static u32 __read_mostly sched_clock_mask = 0xffffffff;3333+3434+static u32 notrace jiffy_sched_clock_read(void)3535+{3636+ return (u32)(jiffies - INITIAL_JIFFIES);3737+}3838+3939+static u32 __read_mostly (*read_sched_clock)(void) = jiffy_sched_clock_read;4040+4141+static inline u64 cyc_to_ns(u64 cyc, u32 mult, u32 shift)4242+{4343+ return (cyc * mult) >> shift;4444+}4545+4646+static unsigned long long cyc_to_sched_clock(u32 cyc, u32 mask)4747+{4848+ u64 epoch_ns;4949+ u32 epoch_cyc;5050+5151+ /*5252+ * Load the epoch_cyc and epoch_ns atomically. We do this by5353+ * ensuring that we always write epoch_cyc, epoch_ns and5454+ * epoch_cyc_copy in strict order, and read them in strict order.5555+ * If epoch_cyc and epoch_cyc_copy are not equal, then we're in5656+ * the middle of an update, and we should repeat the load.5757+ */5858+ do {5959+ epoch_cyc = cd.epoch_cyc;6060+ smp_rmb();6161+ epoch_ns = cd.epoch_ns;6262+ smp_rmb();6363+ } while (epoch_cyc != cd.epoch_cyc_copy);6464+6565+ return epoch_ns + cyc_to_ns((cyc - epoch_cyc) & mask, cd.mult, cd.shift);6666+}6767+6868+/*6969+ * Atomically update the sched_clock epoch.7070+ */7171+static void notrace update_sched_clock(void)7272+{7373+ unsigned long flags;7474+ u32 cyc;7575+ u64 ns;7676+7777+ cyc = read_sched_clock();7878+ ns = cd.epoch_ns +7979+ cyc_to_ns((cyc - cd.epoch_cyc) & sched_clock_mask,8080+ cd.mult, cd.shift);8181+ /*8282+ * Write epoch_cyc and epoch_ns in a way that the update is8383+ * detectable in cyc_to_fixed_sched_clock().8484+ */8585+ raw_local_irq_save(flags);8686+ cd.epoch_cyc = cyc;8787+ smp_wmb();8888+ cd.epoch_ns = ns;8989+ smp_wmb();9090+ cd.epoch_cyc_copy = cyc;9191+ raw_local_irq_restore(flags);9292+}20932194static void sched_clock_poll(unsigned long wrap_ticks)2295{2396 mod_timer(&sched_clock_timer, round_jiffies(jiffies + wrap_ticks));2424- sched_clock_update_fn();9797+ update_sched_clock();2598}26992727-void __init init_sched_clock(struct clock_data *cd, void (*update)(void),2828- unsigned int clock_bits, unsigned long rate)100100+void __init setup_sched_clock(u32 (*read)(void), int bits, unsigned long rate)29101{30102 unsigned long r, w;31103 u64 res, wrap;32104 char r_unit;331053434- sched_clock_update_fn = update;106106+ BUG_ON(bits > 32);107107+ WARN_ON(!irqs_disabled());108108+ WARN_ON(read_sched_clock != jiffy_sched_clock_read);109109+ read_sched_clock = read;110110+ sched_clock_mask = (1 << bits) - 1;3511136112 /* calculate the mult/shift to convert counter ticks to ns. */3737- clocks_calc_mult_shift(&cd->mult, &cd->shift, rate, NSEC_PER_SEC, 0);113113+ clocks_calc_mult_shift(&cd.mult, &cd.shift, rate, NSEC_PER_SEC, 0);3811439115 r = rate;40116 if (r >= 4000000) {41117 r /= 1000000;42118 r_unit = 'M';4343- } else {119119+ } else if (r >= 1000) {44120 r /= 1000;45121 r_unit = 'k';4646- }122122+ } else123123+ r_unit = ' ';4712448125 /* calculate how many ns until we wrap */4949- wrap = cyc_to_ns((1ULL << clock_bits) - 1, cd->mult, cd->shift);126126+ wrap = cyc_to_ns((1ULL << bits) - 1, cd.mult, cd.shift);50127 do_div(wrap, NSEC_PER_MSEC);51128 w = wrap;5212953130 /* calculate the ns resolution of this counter */5454- res = cyc_to_ns(1ULL, cd->mult, cd->shift);131131+ res = cyc_to_ns(1ULL, cd.mult, cd.shift);55132 pr_info("sched_clock: %u bits at %lu%cHz, resolution %lluns, wraps every %lums\n",5656- clock_bits, r, r_unit, res, w);133133+ bits, r, r_unit, res, w);5713458135 /*59136 * Start the timer to keep sched_clock() properly updated and60137 * sets the initial epoch.61138 */62139 sched_clock_timer.data = msecs_to_jiffies(w - (w / 10));6363- update();140140+ update_sched_clock();6414165142 /*66143 * Ensure that sched_clock() starts off at 0ns67144 */6868- cd->epoch_ns = 0;145145+ cd.epoch_ns = 0;146146+147147+ pr_debug("Registered %pF as sched_clock source\n", read);148148+}149149+150150+unsigned long long notrace sched_clock(void)151151+{152152+ u32 cyc = read_sched_clock();153153+ return cyc_to_sched_clock(cyc, sched_clock_mask);69154}7015571156void __init sched_clock_postinit(void)72157{158158+ /*159159+ * If no sched_clock function has been provided at that point,160160+ * make it the final one one.161161+ */162162+ if (read_sched_clock == jiffy_sched_clock_read)163163+ setup_sched_clock(jiffy_sched_clock_read, 32, HZ);164164+73165 sched_clock_poll(sched_clock_timer.data);74166}
···11+/*22+ * arch/arm/lib/call_with_stack.S33+ *44+ * Copyright (C) 2011 ARM Ltd.55+ * Written by Will Deacon <will.deacon@arm.com>66+ *77+ * This program is free software; you can redistribute it and/or modify88+ * it under the terms of the GNU General Public License version 2 as99+ * published by the Free Software Foundation.1010+ *1111+ * This program is distributed in the hope that it will be useful,1212+ * but WITHOUT ANY WARRANTY; without even the implied warranty of1313+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1414+ * GNU General Public License for more details.1515+ *1616+ * You should have received a copy of the GNU General Public License1717+ * along with this program; if not, write to the Free Software1818+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1919+ */2020+2121+#include <linux/linkage.h>2222+#include <asm/assembler.h>2323+2424+/*2525+ * void call_with_stack(void (*fn)(void *), void *arg, void *sp)2626+ *2727+ * Change the stack to that pointed at by sp, then invoke fn(arg) with2828+ * the new stack.2929+ */3030+ENTRY(call_with_stack)3131+ str sp, [r2, #-4]!3232+ str lr, [r2, #-4]!3333+3434+ mov sp, r23535+ mov r2, r03636+ mov r0, r13737+3838+ adr lr, BSYM(1f)3939+ mov pc, r24040+4141+1: ldr lr, [sp]4242+ ldr sp, [sp, #4]4343+ mov pc, lr4444+ENDPROC(call_with_stack)
-8
arch/arm/mach-at91/include/mach/io.h
···30303131#ifndef __ASSEMBLY__32323333-#ifndef CONFIG_ARCH_AT91X403434-#define __arch_ioremap at91_ioremap3535-#define __arch_iounmap at91_iounmap3636-#endif3737-3838-void __iomem *at91_ioremap(unsigned long phys, size_t size, unsigned int type);3939-void at91_iounmap(volatile void __iomem *addr);4040-4133static inline unsigned int at91_sys_read(unsigned int reg_offset)4234{4335 void __iomem *addr = (void __iomem *)AT91_VA_BASE_SYS;
-28
arch/arm/mach-at91/include/mach/vmalloc.h
···11-/*22- * arch/arm/mach-at91/include/mach/vmalloc.h33- *44- * Copyright (C) 2003 SAN People55- *66- * This program is free software; you can redistribute it and/or modify77- * it under the terms of the GNU General Public License as published by88- * the Free Software Foundation; either version 2 of the License, or99- * (at your option) any later version.1010- *1111- * This program is distributed in the hope that it will be useful,1212- * but WITHOUT ANY WARRANTY; without even the implied warranty of1313- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1414- * GNU General Public License for more details.1515- *1616- * You should have received a copy of the GNU General Public License1717- * along with this program; if not, write to the Free Software1818- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1919- */2020-2121-#ifndef __ASM_ARCH_VMALLOC_H2222-#define __ASM_ARCH_VMALLOC_H2323-2424-#include <mach/hardware.h>2525-2626-#define VMALLOC_END (AT91_VIRT_BASE & PGDIR_MASK)2727-2828-#endif
-18
arch/arm/mach-at91/setup.c
···7373 .type = MT_DEVICE,7474};75757676-void __iomem *at91_ioremap(unsigned long p, size_t size, unsigned int type)7777-{7878- if (p >= AT91_BASE_SYS && p <= (AT91_BASE_SYS + SZ_16K - 1))7979- return (void __iomem *)AT91_IO_P2V(p);8080-8181- return __arm_ioremap_caller(p, size, type, __builtin_return_address(0));8282-}8383-EXPORT_SYMBOL(at91_ioremap);8484-8585-void at91_iounmap(volatile void __iomem *addr)8686-{8787- unsigned long virt = (unsigned long)addr;8888-8989- if (virt >= VMALLOC_START && virt < VMALLOC_END)9090- __iounmap(addr);9191-}9292-EXPORT_SYMBOL(at91_iounmap);9393-9476#define AT91_DBGU0 0xfffff2009577#define AT91_DBGU1 0xffffee009678
+1-1
arch/arm/mach-bcmring/dma.c
···16151615{16161616 unsigned long addrVal = (unsigned long)addr;1617161716181618- if (addrVal >= VMALLOC_END) {16181618+ if (addrVal >= CONSISTENT_BASE) {16191619 /* NOTE: DMA virtual memory space starts at 0xFFxxxxxx */1620162016211621 /* dma_alloc_xxx pages are physically and virtually contiguous */
-25
arch/arm/mach-bcmring/include/mach/vmalloc.h
···11-/*22- *33- * Copyright (C) 2000 Russell King.44- *55- * This program is free software; you can redistribute it and/or modify66- * it under the terms of the GNU General Public License as published by77- * the Free Software Foundation; either version 2 of the License, or88- * (at your option) any later version.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-2020-/*2121- * Move VMALLOC_END to 0xf0000000 so that the vm space can range from2222- * 0xe0000000 to 0xefffffff. This gives us 256 MB of vm space and handles2323- * larger physical memory designs better.2424- */2525-#define VMALLOC_END 0xf0000000UL
···11-/*22- * arch/arm/mach-clps711x/include/mach/vmalloc.h33- *44- * Copyright (C) 2000 Deep Blue Solutions Ltd.55- *66- * This program is free software; you can redistribute it and/or modify77- * it under the terms of the GNU General Public License as published by88- * the Free Software Foundation; either version 2 of the License, or99- * (at your option) any later version.1010- *1111- * This program is distributed in the hope that it will be useful,1212- * but WITHOUT ANY WARRANTY; without even the implied warranty of1313- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1414- * GNU General Public License for more details.1515- *1616- * You should have received a copy of the GNU General Public License1717- * along with this program; if not, write to the Free Software1818- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1919- */2020-#define VMALLOC_END 0xd0000000UL
-143
arch/arm/mach-clps711x/irq.c
···11-/*22- * linux/arch/arm/mach-clps711x/irq.c33- *44- * Copyright (C) 2000 Deep Blue Solutions Ltd.55- *66- * This program is free software; you can redistribute it and/or modify77- * it under the terms of the GNU General Public License as published by88- * the Free Software Foundation; either version 2 of the License, or99- * (at your option) any later version.1010- *1111- * This program is distributed in the hope that it will be useful,1212- * but WITHOUT ANY WARRANTY; without even the implied warranty of1313- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1414- * GNU General Public License for more details.1515- *1616- * You should have received a copy of the GNU General Public License1717- * along with this program; if not, write to the Free Software1818- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1919- */2020-#include <linux/init.h>2121-#include <linux/list.h>2222-#include <linux/io.h>2323-2424-#include <asm/mach/irq.h>2525-#include <mach/hardware.h>2626-#include <asm/irq.h>2727-2828-#include <asm/hardware/clps7111.h>2929-3030-static void int1_mask(struct irq_data *d)3131-{3232- u32 intmr1;3333-3434- intmr1 = clps_readl(INTMR1);3535- intmr1 &= ~(1 << d->irq);3636- clps_writel(intmr1, INTMR1);3737-}3838-3939-static void int1_ack(struct irq_data *d)4040-{4141- u32 intmr1;4242-4343- intmr1 = clps_readl(INTMR1);4444- intmr1 &= ~(1 << d->irq);4545- clps_writel(intmr1, INTMR1);4646-4747- switch (d->irq) {4848- case IRQ_CSINT: clps_writel(0, COEOI); break;4949- case IRQ_TC1OI: clps_writel(0, TC1EOI); break;5050- case IRQ_TC2OI: clps_writel(0, TC2EOI); break;5151- case IRQ_RTCMI: clps_writel(0, RTCEOI); break;5252- case IRQ_TINT: clps_writel(0, TEOI); break;5353- case IRQ_UMSINT: clps_writel(0, UMSEOI); break;5454- }5555-}5656-5757-static void int1_unmask(struct irq_data *d)5858-{5959- u32 intmr1;6060-6161- intmr1 = clps_readl(INTMR1);6262- intmr1 |= 1 << d->irq;6363- clps_writel(intmr1, INTMR1);6464-}6565-6666-static struct irq_chip int1_chip = {6767- .irq_ack = int1_ack,6868- .irq_mask = int1_mask,6969- .irq_unmask = int1_unmask,7070-};7171-7272-static void int2_mask(struct irq_data *d)7373-{7474- u32 intmr2;7575-7676- intmr2 = clps_readl(INTMR2);7777- intmr2 &= ~(1 << (d->irq - 16));7878- clps_writel(intmr2, INTMR2);7979-}8080-8181-static void int2_ack(struct irq_data *d)8282-{8383- u32 intmr2;8484-8585- intmr2 = clps_readl(INTMR2);8686- intmr2 &= ~(1 << (d->irq - 16));8787- clps_writel(intmr2, INTMR2);8888-8989- switch (d->irq) {9090- case IRQ_KBDINT: clps_writel(0, KBDEOI); break;9191- }9292-}9393-9494-static void int2_unmask(struct irq_data *d)9595-{9696- u32 intmr2;9797-9898- intmr2 = clps_readl(INTMR2);9999- intmr2 |= 1 << (d->irq - 16);100100- clps_writel(intmr2, INTMR2);101101-}102102-103103-static struct irq_chip int2_chip = {104104- .irq_ack = int2_ack,105105- .irq_mask = int2_mask,106106- .irq_unmask = int2_unmask,107107-};108108-109109-void __init clps711x_init_irq(void)110110-{111111- unsigned int i;112112-113113- for (i = 0; i < NR_IRQS; i++) {114114- if (INT1_IRQS & (1 << i)) {115115- irq_set_chip_and_handler(i, &int1_chip,116116- handle_level_irq);117117- set_irq_flags(i, IRQF_VALID | IRQF_PROBE);118118- }119119- if (INT2_IRQS & (1 << i)) {120120- irq_set_chip_and_handler(i, &int2_chip,121121- handle_level_irq);122122- set_irq_flags(i, IRQF_VALID | IRQF_PROBE);123123- } 124124- }125125-126126- /*127127- * Disable interrupts128128- */129129- clps_writel(0, INTMR1);130130- clps_writel(0, INTMR2);131131-132132- /*133133- * Clear down any pending interrupts134134- */135135- clps_writel(0, COEOI);136136- clps_writel(0, TC1EOI);137137- clps_writel(0, TC2EOI);138138- clps_writel(0, RTCEOI);139139- clps_writel(0, TEOI);140140- clps_writel(0, UMSEOI);141141- clps_writel(0, SYNCIO);142142- clps_writel(0, KBDEOI);143143-}
-48
arch/arm/mach-clps711x/mm.c
···11-/*22- * linux/arch/arm/mach-clps711x/mm.c33- *44- * Generic MM setup for the CLPS711x-based machines.55- *66- * Copyright (C) 2001 Deep Blue Solutions Ltd77- *88- * This program is free software; you can redistribute it and/or modify99- * it under the terms of the GNU General Public License as published by1010- * the Free Software Foundation; either version 2 of the License, or1111- * (at your option) any later version.1212- *1313- * This program is distributed in the hope that it will be useful,1414- * but WITHOUT ANY WARRANTY; without even the implied warranty of1515- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1616- * GNU General Public License for more details.1717- *1818- * You should have received a copy of the GNU General Public License1919- * along with this program; if not, write to the Free Software2020- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA2121- */2222-#include <linux/kernel.h>2323-#include <linux/mm.h>2424-#include <linux/init.h>2525-2626-#include <asm/sizes.h>2727-#include <mach/hardware.h>2828-#include <asm/pgtable.h>2929-#include <asm/page.h>3030-#include <asm/mach/map.h>3131-#include <asm/hardware/clps7111.h>3232-3333-/*3434- * This maps the generic CLPS711x registers3535- */3636-static struct map_desc clps711x_io_desc[] __initdata = {3737- {3838- .virtual = CLPS7111_VIRT_BASE,3939- .pfn = __phys_to_pfn(CLPS7111_PHYS_BASE),4040- .length = SZ_1M,4141- .type = MT_DEVICE4242- }4343-};4444-4545-void __init clps711x_map_io(void)4646-{4747- iotable_init(clps711x_io_desc, ARRAY_SIZE(clps711x_io_desc));4848-}
-84
arch/arm/mach-clps711x/time.c
···11-/*22- * linux/arch/arm/mach-clps711x/time.c33- *44- * Copyright (C) 2001 Deep Blue Solutions Ltd.55- *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-#include <linux/timex.h>2020-#include <linux/init.h>2121-#include <linux/interrupt.h>2222-#include <linux/irq.h>2323-#include <linux/sched.h>2424-#include <linux/io.h>2525-2626-#include <mach/hardware.h>2727-#include <asm/irq.h>2828-#include <asm/leds.h>2929-#include <asm/hardware/clps7111.h>3030-3131-#include <asm/mach/time.h>3232-3333-3434-/*3535- * gettimeoffset() returns time since last timer tick, in usecs.3636- *3737- * 'LATCH' is hwclock ticks (see CLOCK_TICK_RATE in timex.h) per jiffy.3838- * 'tick' is usecs per jiffy.3939- */4040-static unsigned long clps711x_gettimeoffset(void)4141-{4242- unsigned long hwticks;4343- hwticks = LATCH - (clps_readl(TC2D) & 0xffff); /* since last underflow */4444- return (hwticks * (tick_nsec / 1000)) / LATCH;4545-}4646-4747-/*4848- * IRQ handler for the timer4949- */5050-static irqreturn_t5151-p720t_timer_interrupt(int irq, void *dev_id)5252-{5353- timer_tick();5454- return IRQ_HANDLED;5555-}5656-5757-static struct irqaction clps711x_timer_irq = {5858- .name = "CLPS711x Timer Tick",5959- .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,6060- .handler = p720t_timer_interrupt,6161-};6262-6363-static void __init clps711x_timer_init(void)6464-{6565- struct timespec tv;6666- unsigned int syscon;6767-6868- syscon = clps_readl(SYSCON1);6969- syscon |= SYSCON1_TC2S | SYSCON1_TC2M;7070- clps_writel(syscon, SYSCON1);7171-7272- clps_writel(LATCH-1, TC2D); /* 512kHz / 100Hz - 1 */7373-7474- setup_irq(IRQ_TC2OI, &clps711x_timer_irq);7575-7676- tv.tv_nsec = 0;7777- tv.tv_sec = clps_readl(RTCDR);7878- do_settimeofday(&tv);7979-}8080-8181-struct sys_timer clps711x_timer = {8282- .init = clps711x_timer_init,8383- .offset = clps711x_gettimeoffset,8484-};
···88 * published by the Free Software Foundation.99 */10101111-#include <asm/hardware/entry-macro-gic.S>1212-1311 .macro disable_fiq1412 .endm1513
-11
arch/arm/mach-cns3xxx/include/mach/vmalloc.h
···11-/*22- * Copyright 2000 Russell King.33- * Copyright 2003 ARM Limited44- * Copyright 2008 Cavium Networks55- *66- * This file 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-1111-#define VMALLOC_END 0xd8000000UL
···11-/*22- * DaVinci vmalloc definitions33- *44- * Author: Kevin Hilman, MontaVista Software, Inc. <source@mvista.com>55- *66- * 2007 (c) MontaVista Software, Inc. This file is licensed under77- * the terms of the GNU General Public License version 2. This program88- * is licensed "as is" without any warranty of any kind, whether express99- * or implied.1010- */1111-#include <mach/hardware.h>1212-1313-/* Allow vmalloc range until the IO virtual range minus a 2M "hole" */1414-#define VMALLOC_END (IO_VIRT - (2<<20))
-48
arch/arm/mach-davinci/io.c
···11-/*22- * DaVinci I/O mapping code33- *44- * Copyright (C) 2005-2006 Texas Instruments55- *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-1111-#include <linux/module.h>1212-#include <linux/io.h>1313-1414-#include <asm/tlb.h>1515-#include <asm/mach/map.h>1616-1717-#include <mach/common.h>1818-1919-/*2020- * Intercept ioremap() requests for addresses in our fixed mapping regions.2121- */2222-void __iomem *davinci_ioremap(unsigned long p, size_t size, unsigned int type)2323-{2424- struct map_desc *desc = davinci_soc_info.io_desc;2525- int desc_num = davinci_soc_info.io_desc_num;2626- int i;2727-2828- for (i = 0; i < desc_num; i++, desc++) {2929- unsigned long iophys = __pfn_to_phys(desc->pfn);3030- unsigned long iosize = desc->length;3131-3232- if (p >= iophys && (p + size) <= (iophys + iosize))3333- return __io(desc->virtual + p - iophys);3434- }3535-3636- return __arm_ioremap_caller(p, size, type,3737- __builtin_return_address(0));3838-}3939-EXPORT_SYMBOL(davinci_ioremap);4040-4141-void davinci_iounmap(volatile void __iomem *addr)4242-{4343- unsigned long virt = (unsigned long)addr;4444-4545- if (virt >= VMALLOC_START && virt < VMALLOC_END)4646- __iounmap(addr);4747-}4848-EXPORT_SYMBOL(davinci_iounmap);
-2
arch/arm/mach-dove/include/mach/dove.h
···1111#ifndef __ASM_ARCH_DOVE_H1212#define __ASM_ARCH_DOVE_H13131414-#include <mach/vmalloc.h>1515-1614/*1715 * Marvell Dove address maps.1816 *
···11-/*22- * arch/arm/mach-ebsa110/include/mach/vmalloc.h33- *44- * Copyright (C) 1998 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-#define VMALLOC_END 0xdf000000UL
···11111212static inline void arch_reset(char mode, const char *cmd)1313{1414- local_irq_disable();1515-1614 /*1715 * Set then clear the SWRST bit to initiate a software reset1816 */
···99 * warranty of any kind, whether express or implied.1010*/11111212-#include <mach/hardware.h>1313-#include <mach/map.h>1414-#include <asm/hardware/gic.h>1515-1612 .macro disable_fiq1713 .endm18141919- .macro get_irqnr_preamble, base, tmp2020- mov \tmp, #02121-2222- mrc p15, 0, \base, c0, c0, 52323- and \base, \base, #32424- cmp \base, #02525- beq 1f2626-2727- ldr \tmp, =gic_bank_offset2828- ldr \tmp, [\tmp]2929- cmp \base, #13030- beq 1f3131-3232- cmp \base, #23333- addeq \tmp, \tmp, \tmp3434- addne \tmp, \tmp, \tmp, LSL #13535-3636-1: ldr \base, =gic_cpu_base_addr3737- ldr \base, [\base]3838- add \base, \base, \tmp3939- .endm4040-4115 .macro arch_ret_to_user, tmp1, tmp24242- .endm4343-4444- /*4545- * The interrupt numbering scheme is defined in the4646- * interrupt controller spec. To wit:4747- *4848- * Interrupts 0-15 are IPI4949- * 16-28 are reserved5050- * 29-31 are local. We allow 30 to be used for the watchdog.5151- * 32-1020 are global5252- * 1021-1022 are reserved5353- * 1023 is "spurious" (no interrupt)5454- *5555- * For now, we ignore all local interrupts so only return an interrupt if it's5656- * between 30 and 1020. The test_for_ipi routine below will pick up on IPIs.5757- *5858- * A simple read from the controller will tell us the number of the highest5959- * priority enabled interrupt. We then just need to check whether it is in the6060- * valid range for an IRQ (30-1020 inclusive).6161- */6262-6363- .macro get_irqnr_and_base, irqnr, irqstat, base, tmp6464-6565- ldr \irqstat, [\base, #GIC_CPU_INTACK] /* bits 12-10 = src CPU, 9-0 = int # */6666-6767- ldr \tmp, =10216868-6969- bic \irqnr, \irqstat, #0x1c007070-7171- cmp \irqnr, #157272- cmpcc \irqnr, \irqnr7373- cmpne \irqnr, \tmp7474- cmpcs \irqnr, \irqnr7575- addne \irqnr, \irqnr, #327676-7777- .endm7878-7979- /* We assume that irqstat (the raw value of the IRQ acknowledge8080- * register) is preserved from the macro above.8181- * If there is an IPI, we immediately signal end of interrupt on the8282- * controller, since this requires the original irqstat value which8383- * we won't easily be able to recreate later.8484- */8585-8686- .macro test_for_ipi, irqnr, irqstat, base, tmp8787- bic \irqnr, \irqstat, #0x1c008888- cmp \irqnr, #168989- strcc \irqstat, [\base, #GIC_CPU_EOI]9090- cmpcs \irqnr, \irqnr9116 .endm
-22
arch/arm/mach-exynos/include/mach/vmalloc.h
···11-/* linux/arch/arm/mach-exynos4/include/mach/vmalloc.h22- *33- * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.44- * http://www.samsung.com55- *66- * Copyright 2010 Ben Dooks <ben-linux@fluff.org>77- *88- * Based on arch/arm/mach-s5p6440/include/mach/vmalloc.h99- *1010- * This program is free software; you can redistribute it and/or modify1111- * it under the terms of the GNU General Public License version 2 as1212- * published by the Free Software Foundation.1313- *1414- * EXYNOS4 vmalloc definition1515-*/1616-1717-#ifndef __ASM_ARCH_VMALLOC_H1818-#define __ASM_ARCH_VMALLOC_H __FILE__1919-2020-#define VMALLOC_END 0xF6000000UL2121-2222-#endif /* __ASM_ARCH_VMALLOC_H */
···32323333#include <plat/cpu.h>34343535-extern unsigned int gic_bank_offset;3635extern void exynos4_secondary_startup(void);37363837#define CPU1_BOOT_REG (samsung_rev() == EXYNOS4210_REV_1_1 ? \···64656566static DEFINE_SPINLOCK(boot_lock);66676767-static void __cpuinit exynos4_gic_secondary_init(void)6868-{6969- void __iomem *dist_base = S5P_VA_GIC_DIST +7070- (gic_bank_offset * smp_processor_id());7171- void __iomem *cpu_base = S5P_VA_GIC_CPU +7272- (gic_bank_offset * smp_processor_id());7373- int i;7474-7575- /*7676- * Deal with the banked PPI and SGI interrupts - disable all7777- * PPI interrupts, ensure all SGI interrupts are enabled.7878- */7979- __raw_writel(0xffff0000, dist_base + GIC_DIST_ENABLE_CLEAR);8080- __raw_writel(0x0000ffff, dist_base + GIC_DIST_ENABLE_SET);8181-8282- /*8383- * Set priority on PPI and SGI interrupts8484- */8585- for (i = 0; i < 32; i += 4)8686- __raw_writel(0xa0a0a0a0, dist_base + GIC_DIST_PRI + i * 4 / 4);8787-8888- __raw_writel(0xf0, cpu_base + GIC_CPU_PRIMASK);8989- __raw_writel(1, cpu_base + GIC_CPU_CTRL);9090-}9191-9268void __cpuinit platform_secondary_init(unsigned int cpu)9369{9470 /*···7197 * core (e.g. timer irq), then they will not have been enabled7298 * for us: do so7399 */7474- exynos4_gic_secondary_init();100100+ gic_secondary_init(0);7510176102 /*77103 * let the primary processor know we're out of the
···2424 /*2525 * Jump into the ROM2626 */2727- cpu_reset(0x41000000);2727+ soft_restart(0x41000000);2828 } else {2929 if (machine_is_netwinder()) {3030 /* open up the SuperIO chip
-10
arch/arm/mach-footbridge/include/mach/vmalloc.h
···11-/*22- * arch/arm/mach-footbridge/include/mach/vmalloc.h33- *44- * This program is free software; you can redistribute it and/or modify55- * it under the terms of the GNU General Public License version 2 as66- * published by the Free Software Foundation.77- */88-99-1010-#define VMALLOC_END 0xf0000000UL
-10
arch/arm/mach-gemini/include/mach/vmalloc.h
···11-/*22- * Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt>33- *44- * This program is free software; you can redistribute it and/or modify55- * it under the terms of the GNU General Public License as published by66- * the Free Software Foundation; either version 2 of the License, or77- * (at your option) any later version.88- */99-1010-#define VMALLOC_END 0xf0000000UL
···11-/*22- * arch/arm/mach-integrator/include/mach/vmalloc.h33- *44- * Copyright (C) 2000 Russell King.55- *66- * This program is free software; you can redistribute it and/or modify77- * it under the terms of the GNU General Public License as published by88- * the Free Software Foundation; either version 2 of the License, or99- * (at your option) any later version.1010- *1111- * This program is distributed in the hope that it will be useful,1212- * but WITHOUT ANY WARRANTY; without even the implied warranty of1313- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1414- * GNU General Public License for more details.1515- *1616- * You should have received a copy of the GNU General Public License1717- * along with this program; if not, write to the Free Software1818- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1919- */2020-#define VMALLOC_END 0xd0000000UL
···19192020static inline void arch_reset(char mode, const char *cmd)2121{2222- local_irq_disable();2323-2422 /*2523 * Reset flash banking register so that we are pointing at2624 * RedBoot bank.
-20
arch/arm/mach-ixp2000/include/mach/vmalloc.h
···11-/*22- * arch/arm/mach-ixp2000/include/mach/vmalloc.h33- *44- * Author: Naeem Afzal <naeem.m.afzal@intel.com>55- *66- * Copyright 2002 Intel Corp.77- *88- * This program is free software; you can redistribute it and/or modify it99- * under the terms of the GNU General Public License as published by the1010- * Free Software Foundation; either version 2 of the License, or (at your1111- * option) any later version.1212- *1313- * Just any arbitrary offset to the start of the vmalloc VM area: the1414- * current 8MB value just means that there will be a 8MB "hole" after the1515- * physical memory until the kernel virtual memory starts. That means that1616- * any out-of-bounds memory accesses will hopefully be caught.1717- * The vmalloc() routines leaves a hole of 4kB between each vmalloced1818- * area for the same reason. ;)1919- */2020-#define VMALLOC_END 0xfb000000UL
···3232 unsigned int reg;33333434 if (mode == 's')3535- cpu_reset(0);3535+ soft_restart(0);36363737 /* disable timer0 */3838 reg = __raw_readl(KS8695_TMR_VA + KS8695_TMCON);
-19
arch/arm/mach-ks8695/include/mach/vmalloc.h
···11-/*22- * arch/arm/mach-ks8695/include/mach/vmalloc.h33- *44- * Copyright (C) 2006 Ben Dooks55- * Copyright (C) 2006 Simtec Electronics <linux@simtec.co.uk>66- *77- * KS8695 vmalloc definition88- *99- * This program is free software; you can redistribute it and/or modify1010- * it under the terms of the GNU General Public License version 2 as1111- * published by the Free Software Foundation.1212- */1313-1414-#ifndef __ASM_ARCH_VMALLOC_H1515-#define __ASM_ARCH_VMALLOC_H1616-1717-#define VMALLOC_END (KS8695_IO_VA & PGDIR_MASK)1818-1919-#endif
···11-/*22- * arch/arm/mach-lpc32xx/include/mach/vmalloc.h33- *44- * Author: Kevin Wells <kevin.wells@nxp.com>55- *66- * Copyright (C) 2010 NXP Semiconductors77- *88- * This program is free software; you can redistribute it and/or modify99- * it under the terms of the GNU General Public License as published by1010- * the Free Software Foundation; either version 2 of the License, or1111- * (at your option) any later version.1212- *1313- * This program is distributed in the hope that it will be useful,1414- * but WITHOUT ANY WARRANTY; without even the implied warranty of1515- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1616- * GNU General Public License for more details.1717- */1818-1919-#ifndef __ASM_ARCH_VMALLOC_H2020-#define __ASM_ARCH_VMALLOC_H2121-2222-#define VMALLOC_END 0xF0000000UL2323-2424-#endif
···11-/*22- * Low-level IRQ helper macros33- *44- * Copyright (c) 2010, Code Aurora Forum. All rights reserved.55- *66- * This file is licensed under the terms of the GNU General Public77- * License version 2. This program is licensed "as is" without any88- * warranty of any kind, whether express or implied.99- */1010-1111-#include <asm/hardware/entry-macro-gic.S>1212-1313- .macro disable_fiq1414- .endm1515-1616- .macro arch_ret_to_user, tmp1, tmp21717- .endm
-37
arch/arm/mach-msm/include/mach/entry-macro-vic.S
···11-/*22- * Copyright (C) 2007 Google, Inc.33- * Author: Brian Swetland <swetland@google.com>44- *55- * This software is licensed under the terms of the GNU General Public66- * License version 2, as published by the Free Software Foundation, and77- * may be copied, distributed, and modified under those terms.88- *99- * This program is distributed in the hope that it will be useful,1010- * but WITHOUT ANY WARRANTY; without even the implied warranty of1111- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1212- * GNU General Public License for more details.1313- *1414- */1515-1616-#include <mach/msm_iomap.h>1717-1818- .macro disable_fiq1919- .endm2020-2121- .macro get_irqnr_preamble, base, tmp2222- @ enable imprecise aborts2323- cpsie a2424- mov \base, #MSM_VIC_BASE2525- .endm2626-2727- .macro arch_ret_to_user, tmp1, tmp22828- .endm2929-3030- .macro get_irqnr_and_base, irqnr, irqstat, base, tmp3131- @ 0xD0 has irq# or old irq# if the irq has been handled3232- @ 0xD4 has irq# or -1 if none pending *but* if you just3333- @ read 0xD4 you never get the first irq for some reason3434- ldr \irqnr, [\base, #0xD0]3535- ldr \irqnr, [\base, #0xD4]3636- cmp \irqnr, #0xffffffff3737- .endm
+23-4
arch/arm/mach-msm/include/mach/entry-macro.S
···1616 *1717 */18181919-#if defined(CONFIG_ARM_GIC)2020-#include <mach/entry-macro-qgic.S>2121-#else2222-#include <mach/entry-macro-vic.S>1919+ .macro disable_fiq2020+ .endm2121+2222+ .macro arch_ret_to_user, tmp1, tmp22323+ .endm2424+2525+#if !defined(CONFIG_ARM_GIC)2626+#include <mach/msm_iomap.h>2727+2828+ .macro get_irqnr_preamble, base, tmp2929+ @ enable imprecise aborts3030+ cpsie a3131+ mov \base, #MSM_VIC_BASE3232+ .endm3333+3434+ .macro get_irqnr_and_base, irqnr, irqstat, base, tmp3535+ @ 0xD0 has irq# or old irq# if the irq has been handled3636+ @ 0xD4 has irq# or -1 if none pending *but* if you just3737+ @ read 0xD4 you never get the first irq for some reason3838+ ldr \irqnr, [\base, #0xD0]3939+ ldr \irqnr, [\base, #0xD4]4040+ cmp \irqnr, #0xffffffff4141+ .endm2342#endif
-22
arch/arm/mach-msm/include/mach/vmalloc.h
···11-/* arch/arm/mach-msm/include/mach/vmalloc.h22- *33- * Copyright (C) 2007 Google, Inc.44- *55- * This software is licensed under the terms of the GNU General Public66- * License version 2, as published by the Free Software Foundation, and77- * may be copied, distributed, and modified under those terms.88- *99- * This program is distributed in the hope that it will be useful,1010- * but WITHOUT ANY WARRANTY; without even the implied warranty of1111- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1212- * GNU General Public License for more details.1313- *1414- */1515-1616-#ifndef __ASM_ARCH_MSM_VMALLOC_H1717-#define __ASM_ARCH_MSM_VMALLOC_H1818-1919-#define VMALLOC_END 0xd0000000UL2020-2121-#endif2222-
···11-/*22- * Copyright (C) 2000 Russell King.33- * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.44- *55- * This program is free software; you can redistribute it and/or modify66- * it under the terms of the GNU General Public License as published by77- * the Free Software Foundation; either version 2 of the License, or88- * (at your option) any later version.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-1616-#ifndef __MACH_MXS_VMALLOC_H__1717-#define __MACH_MXS_VMALLOC_H__1818-1919-/* vmalloc ending address */2020-#define VMALLOC_END 0xf4000000UL2121-2222-#endif /* __MACH_MXS_VMALLOC_H__ */
+1-1
arch/arm/mach-mxs/system.c
···5353 mdelay(50);54545555 /* We'll take a jump through zero as a poor second */5656- cpu_reset(0);5656+ soft_restart(0);5757}58585959static int __init mxs_arch_reset_init(void)
-13
arch/arm/mach-netx/include/mach/entry-macro.S
···1818 * along with this program; if not, write to the Free Software1919 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA2020 */2121-#include <mach/hardware.h>22212322 .macro disable_fiq2423 .endm25242626- .macro get_irqnr_preamble, base, tmp2727- ldr \base, =io_p2v(0x001ff000)2828- .endm2929-3025 .macro arch_ret_to_user, tmp1, tmp23126 .endm3232-3333- .macro get_irqnr_and_base, irqnr, irqstat, base, tmp3434- ldr \irqstat, [\base, #0]3535- clz \irqnr, \irqstat3636- rsb \irqnr, \irqnr, #313737- cmp \irqstat, #03838- .endm3939-
-19
arch/arm/mach-netx/include/mach/vmalloc.h
···11-/*22- * arch/arm/mach-netx/include/mach/vmalloc.h33- *44- * Copyright (C) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix55- *66- * This program is free software; you can redistribute it and/or modify77- * it under the terms of the GNU General Public License version 288- * as 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-#define VMALLOC_END 0xd0000000UL
···3232#include <plat/flash.h>3333#include <plat/fpga.h>3434#include <plat/keypad.h>3535-#include <plat/common.h>3535+#include "common.h"3636#include <plat/board.h>37373838/* fsample is pretty close to p2-sample */
+1-1
arch/arm/mach-omap1/board-generic.c
···2525#include <plat/mux.h>2626#include <plat/usb.h>2727#include <plat/board.h>2828-#include <plat/common.h>2828+#include "common.h"29293030/* assume no Mini-AB port */3131
···3737#include <plat/tc.h>3838#include <plat/usb.h>3939#include <plat/keypad.h>4040-#include <plat/common.h>4040+#include "common.h"4141#include <plat/mmc.h>42424343/* At OMAP1610 Innovator the Ethernet is directly connected to CS1 */
···5151#include <plat/usb.h>5252#include <plat/mux.h>5353#include <plat/tc.h>5454-#include <plat/common.h>5454+#include "common.h"55555656/* At OMAP5912 OSK the Ethernet is directly connected to CS1 */5757#define OMAP_OSK_ETHR_START 0x04800300
···11+/*22+ *33+ * Header for code common to all OMAP1 machines.44+ *55+ * This program is free software; you can redistribute it and/or modify it66+ * under the terms of the GNU General Public License as published by the77+ * Free Software Foundation; either version 2 of the License, or (at your88+ * option) any later version.99+ *1010+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED1111+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF1212+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN1313+ * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,1414+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT1515+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF1616+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON1717+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT1818+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF1919+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.2020+ *2121+ * You should have received a copy of the GNU General Public License along2222+ * with this program; if not, write to the Free Software Foundation, Inc.,2323+ * 675 Mass Ave, Cambridge, MA 02139, USA.2424+ */2525+2626+#ifndef __ARCH_ARM_MACH_OMAP1_COMMON_H2727+#define __ARCH_ARM_MACH_OMAP1_COMMON_H2828+2929+#include <plat/common.h>3030+3131+#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)3232+void omap7xx_map_io(void);3333+#else3434+static inline void omap7xx_map_io(void)3535+{3636+}3737+#endif3838+3939+#ifdef CONFIG_ARCH_OMAP15XX4040+void omap15xx_map_io(void);4141+#else4242+static inline void omap15xx_map_io(void)4343+{4444+}4545+#endif4646+4747+#ifdef CONFIG_ARCH_OMAP16XX4848+void omap16xx_map_io(void);4949+#else5050+static inline void omap16xx_map_io(void)5151+{5252+}5353+#endif5454+5555+void omap1_init_early(void);5656+void omap1_init_irq(void);5757+5858+extern struct sys_timer omap1_timer;5959+extern bool omap_32k_timer_init(void);6060+6161+#endif /* __ARCH_ARM_MACH_OMAP1_COMMON_H */
···11-/*22- * arch/arm/mach-omap1/include/mach/vmalloc.h33- *44- * Copyright (C) 2000 Russell King.55- *66- * This program is free software; you can redistribute it and/or modify77- * it under the terms of the GNU General Public License as published by88- * the Free Software Foundation; either version 2 of the License, or99- * (at your option) any later version.1010- *1111- * This program is distributed in the hope that it will be useful,1212- * but WITHOUT ANY WARRANTY; without even the implied warranty of1313- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1414- * GNU General Public License for more details.1515- *1616- * You should have received a copy of the GNU General Public License1717- * along with this program; if not, write to the Free Software1818- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1919- */2020-#define VMALLOC_END 0xd8000000UL
-1
arch/arm/mach-omap1/io.c
···121121void omap1_init_early(void)122122{123123 omap_check_revision();124124- omap_ioremap_init();125124126125 /* REVISIT: Refer to OMAP5910 Errata, Advisory SYS_1: "Timeout Abort127126 * on a Posted Write in the TIPB Bridge".
+5-55
arch/arm/mach-omap1/time.c
···3737#include <linux/init.h>3838#include <linux/delay.h>3939#include <linux/interrupt.h>4040-#include <linux/sched.h>4140#include <linux/spinlock.h>4241#include <linux/clk.h>4342#include <linux/err.h>···5354#include <asm/mach/irq.h>5455#include <asm/mach/time.h>55565656-#include <plat/common.h>5757+#include "common.h"57585859#ifdef CONFIG_OMAP_MPU_TIMER5960···189190 * ---------------------------------------------------------------------------190191 */191192192192-static DEFINE_CLOCK_DATA(cd);193193-194194-static inline unsigned long long notrace _omap_mpu_sched_clock(void)193193+static u32 notrace omap_mpu_read_sched_clock(void)195194{196196- u32 cyc = ~omap_mpu_timer_read(1);197197- return cyc_to_sched_clock(&cd, cyc, (u32)~0);198198-}199199-200200-#ifndef CONFIG_OMAP_32K_TIMER201201-unsigned long long notrace sched_clock(void)202202-{203203- return _omap_mpu_sched_clock();204204-}205205-#else206206-static unsigned long long notrace omap_mpu_sched_clock(void)207207-{208208- return _omap_mpu_sched_clock();209209-}210210-#endif211211-212212-static void notrace mpu_update_sched_clock(void)213213-{214214- u32 cyc = ~omap_mpu_timer_read(1);215215- update_sched_clock(&cd, cyc, (u32)~0);195195+ return ~omap_mpu_timer_read(1);216196}217197218198static void __init omap_init_clocksource(unsigned long rate)···201223 "%s: can't register clocksource!\n";202224203225 omap_mpu_timer_start(1, ~0, 1);204204- init_sched_clock(&cd, mpu_update_sched_clock, 32, rate);226226+ setup_sched_clock(omap_mpu_read_sched_clock, 32, rate);205227206228 if (clocksource_mmio_init(&timer->read_tim, "mpu_timer2", rate,207229 300, 32, clocksource_mmio_readl_down))···232254}233255#endif /* CONFIG_OMAP_MPU_TIMER */234256235235-#if defined(CONFIG_OMAP_MPU_TIMER) && defined(CONFIG_OMAP_32K_TIMER)236236-static unsigned long long (*preferred_sched_clock)(void);237237-238238-unsigned long long notrace sched_clock(void)239239-{240240- if (!preferred_sched_clock)241241- return 0;242242-243243- return preferred_sched_clock();244244-}245245-246246-static inline void preferred_sched_clock_init(bool use_32k_sched_clock)247247-{248248- if (use_32k_sched_clock)249249- preferred_sched_clock = omap_32k_sched_clock;250250- else251251- preferred_sched_clock = omap_mpu_sched_clock;252252-}253253-#else254254-static inline void preferred_sched_clock_init(bool use_32k_sched_clcok)255255-{256256-}257257-#endif258258-259257static inline int omap_32k_timer_usable(void)260258{261259 int res = false;···253299 */254300static void __init omap1_timer_init(void)255301{256256- if (omap_32k_timer_usable()) {257257- preferred_sched_clock_init(1);258258- } else {302302+ if (!omap_32k_timer_usable())259303 omap_mpu_timer_init();260260- preferred_sched_clock_init(0);261261- }262304}263305264306struct sys_timer omap1_timer = {
···11+/*22+ * Header for code common to all OMAP2+ machines.33+ *44+ * This program is free software; you can redistribute it and/or modify it55+ * under the terms of the GNU General Public License as published by the66+ * Free Software Foundation; either version 2 of the License, or (at your77+ * option) any later version.88+ *99+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED1010+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF1111+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN1212+ * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,1313+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT1414+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF1515+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON1616+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT1717+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF1818+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.1919+ *2020+ * You should have received a copy of the GNU General Public License along2121+ * with this program; if not, write to the Free Software Foundation, Inc.,2222+ * 675 Mass Ave, Cambridge, MA 02139, USA.2323+ */2424+2525+#ifndef __ARCH_ARM_MACH_OMAP2PLUS_COMMON_H2626+#define __ARCH_ARM_MACH_OMAP2PLUS_COMMON_H2727+2828+#include <linux/delay.h>2929+#include <plat/common.h>3030+3131+#ifdef CONFIG_SOC_OMAP24203232+extern void omap242x_map_common_io(void);3333+#else3434+static inline void omap242x_map_common_io(void)3535+{3636+}3737+#endif3838+3939+#ifdef CONFIG_SOC_OMAP24304040+extern void omap243x_map_common_io(void);4141+#else4242+static inline void omap243x_map_common_io(void)4343+{4444+}4545+#endif4646+4747+#ifdef CONFIG_ARCH_OMAP34848+extern void omap34xx_map_common_io(void);4949+#else5050+static inline void omap34xx_map_common_io(void)5151+{5252+}5353+#endif5454+5555+#ifdef CONFIG_SOC_OMAPTI816X5656+extern void omapti816x_map_common_io(void);5757+#else5858+static inline void omapti816x_map_common_io(void)5959+{6060+}6161+#endif6262+6363+#ifdef CONFIG_ARCH_OMAP46464+extern void omap44xx_map_common_io(void);6565+#else6666+static inline void omap44xx_map_common_io(void)6767+{6868+}6969+#endif7070+7171+extern void omap2_init_common_infrastructure(void);7272+7373+extern struct sys_timer omap2_timer;7474+extern struct sys_timer omap3_timer;7575+extern struct sys_timer omap3_secure_timer;7676+extern struct sys_timer omap4_timer;7777+7878+void omap2420_init_early(void);7979+void omap2430_init_early(void);8080+void omap3430_init_early(void);8181+void omap35xx_init_early(void);8282+void omap3630_init_early(void);8383+void omap3_init_early(void); /* Do not use this one */8484+void am35xx_init_early(void);8585+void ti816x_init_early(void);8686+void omap4430_init_early(void);8787+8888+/*8989+ * IO bases for various OMAP processors9090+ * Except the tap base, rest all the io bases9191+ * listed are physical addresses.9292+ */9393+struct omap_globals {9494+ u32 class; /* OMAP class to detect */9595+ void __iomem *tap; /* Control module ID code */9696+ void __iomem *sdrc; /* SDRAM Controller */9797+ void __iomem *sms; /* SDRAM Memory Scheduler */9898+ void __iomem *ctrl; /* System Control Module */9999+ void __iomem *ctrl_pad; /* PAD Control Module */100100+ void __iomem *prm; /* Power and Reset Management */101101+ void __iomem *cm; /* Clock Management */102102+ void __iomem *cm2;103103+};104104+105105+void omap2_set_globals_242x(void);106106+void omap2_set_globals_243x(void);107107+void omap2_set_globals_3xxx(void);108108+void omap2_set_globals_443x(void);109109+void omap2_set_globals_ti816x(void);110110+111111+/* These get called from omap2_set_globals_xxxx(), do not call these */112112+void omap2_set_globals_tap(struct omap_globals *);113113+void omap2_set_globals_sdrc(struct omap_globals *);114114+void omap2_set_globals_control(struct omap_globals *);115115+void omap2_set_globals_prcm(struct omap_globals *);116116+117117+void omap242x_map_io(void);118118+void omap243x_map_io(void);119119+void omap3_map_io(void);120120+void omap4_map_io(void);121121+122122+/**123123+ * omap_test_timeout - busy-loop, testing a condition124124+ * @cond: condition to test until it evaluates to true125125+ * @timeout: maximum number of microseconds in the timeout126126+ * @index: loop index (integer)127127+ *128128+ * Loop waiting for @cond to become true or until at least @timeout129129+ * microseconds have passed. To use, define some integer @index in the130130+ * calling code. After running, if @index == @timeout, then the loop has131131+ * timed out.132132+ */133133+#define omap_test_timeout(cond, timeout, index) \134134+({ \135135+ for (index = 0; index < timeout; index++) { \136136+ if (cond) \137137+ break; \138138+ udelay(1); \139139+ } \140140+})141141+142142+extern struct device *omap2_get_mpuss_device(void);143143+extern struct device *omap2_get_iva_device(void);144144+extern struct device *omap2_get_l3_device(void);145145+extern struct device *omap4_get_dsp_device(void);146146+147147+void omap2_init_irq(void);148148+void omap3_init_irq(void);149149+void ti816x_init_irq(void);150150+extern int omap_irq_pending(void);151151+void omap_intc_save_context(void);152152+void omap_intc_restore_context(void);153153+void omap3_intc_suspend(void);154154+void omap3_intc_prepare_idle(void);155155+void omap3_intc_resume_idle(void);156156+void omap2_intc_handle_irq(struct pt_regs *regs);157157+void omap3_intc_handle_irq(struct pt_regs *regs);158158+159159+/*160160+ * wfi used in low power code. Directly opcode is used instead161161+ * of instruction to avoid mulit-omap build break162162+ */163163+#ifdef CONFIG_THUMB2_KERNEL164164+#define do_wfi() __asm__ __volatile__ ("wfi" : : : "memory")165165+#else166166+#define do_wfi() \167167+ __asm__ __volatile__ (".word 0xe320f003" : : : "memory")168168+#endif169169+170170+#ifdef CONFIG_CACHE_L2X0171171+extern void __iomem *l2cache_base;172172+#endif173173+174174+extern void __init gic_init_irq(void);175175+extern void omap_smc1(u32 fn, u32 arg);176176+177177+#ifdef CONFIG_SMP178178+/* Needed for secondary core boot */179179+extern void omap_secondary_startup(void);180180+extern u32 omap_modify_auxcoreboot0(u32 set_mask, u32 clear_mask);181181+extern void omap_auxcoreboot_addr(u32 cpu_addr);182182+extern u32 omap_read_auxcoreboot0(void);183183+#endif184184+185185+#endif /* __ARCH_ARM_MACH_OMAP2PLUS_COMMON_H */
···1010 * License version 2. This program is licensed "as is" without any1111 * warranty of any kind, whether express or implied.1212 */1313-#include <mach/hardware.h>1414-#include <mach/io.h>1515-#include <mach/irqs.h>1616-#include <asm/hardware/gic.h>1717-1818-#include <plat/omap24xx.h>1919-#include <plat/omap34xx.h>2020-#include <plat/omap44xx.h>2121-2222-#include <plat/multi.h>2323-2424-#define OMAP2_IRQ_BASE OMAP2_L4_IO_ADDRESS(OMAP24XX_IC_BASE)2525-#define OMAP3_IRQ_BASE OMAP2_L4_IO_ADDRESS(OMAP34XX_IC_BASE)2626-#define OMAP4_IRQ_BASE OMAP2_L4_IO_ADDRESS(OMAP44XX_GIC_CPU_BASE)2727-#define INTCPS_SIR_IRQ_OFFSET 0x0040 /* omap2/3 active interrupt offset */2828-#define ACTIVEIRQ_MASK 0x7f /* omap2/3 active interrupt bits */29133014 .macro disable_fiq3115 .endm32163317 .macro arch_ret_to_user, tmp1, tmp23418 .endm3535-3636-/*3737- * Unoptimized irq functions for multi-omap2, 3 and 43838- */3939-4040-#ifdef MULTI_OMAP24141- /*4242- * Configure the interrupt base on the first interrupt.4343- * See also omap_irq_base_init for setting omap_irq_base.4444- */4545- .macro get_irqnr_preamble, base, tmp4646- ldr \base, =omap_irq_base @ irq base address4747- ldr \base, [\base, #0] @ irq base value4848- .endm4949-5050- /* Check the pending interrupts. Note that base already set */5151- .macro get_irqnr_and_base, irqnr, irqstat, base, tmp5252- tst \base, #0x100 @ gic address?5353- bne 4401f @ found gic5454-5555- /* Handle omap2 and omap3 */5656- ldr \irqnr, [\base, #0x98] /* IRQ pending reg 1 */5757- cmp \irqnr, #0x05858- bne 9998f5959- ldr \irqnr, [\base, #0xb8] /* IRQ pending reg 2 */6060- cmp \irqnr, #0x06161- bne 9998f6262- ldr \irqnr, [\base, #0xd8] /* IRQ pending reg 3 */6363- cmp \irqnr, #0x06464- bne 9998f6565-6666- /*6767- * ti816x has additional IRQ pending register. Checking this6868- * register on omap2 & omap3 has no effect (read as 0).6969- */7070- ldr \irqnr, [\base, #0xf8] /* IRQ pending reg 4 */7171- cmp \irqnr, #0x07272-9998:7373- ldrne \irqnr, [\base, #INTCPS_SIR_IRQ_OFFSET]7474- and \irqnr, \irqnr, #ACTIVEIRQ_MASK /* Clear spurious bits */7575- b 9999f7676-7777- /* Handle omap4 */7878-4401: ldr \irqstat, [\base, #GIC_CPU_INTACK]7979- ldr \tmp, =10218080- bic \irqnr, \irqstat, #0x1c008181- cmp \irqnr, #158282- cmpcc \irqnr, \irqnr8383- cmpne \irqnr, \tmp8484- cmpcs \irqnr, \irqnr8585-9999:8686- .endm8787-8888-#ifdef CONFIG_SMP8989- /* We assume that irqstat (the raw value of the IRQ acknowledge9090- * register) is preserved from the macro above.9191- * If there is an IPI, we immediately signal end of interrupt9292- * on the controller, since this requires the original irqstat9393- * value which we won't easily be able to recreate later.9494- */9595-9696- .macro test_for_ipi, irqnr, irqstat, base, tmp9797- bic \irqnr, \irqstat, #0x1c009898- cmp \irqnr, #169999- it cc100100- strcc \irqstat, [\base, #GIC_CPU_EOI]101101- it cs102102- cmpcs \irqnr, \irqnr103103- .endm104104-#endif /* CONFIG_SMP */105105-106106-#else /* MULTI_OMAP2 */107107-108108-109109-/*110110- * Optimized irq functions for omap2, 3 and 4111111- */112112-113113-#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)114114- .macro get_irqnr_preamble, base, tmp115115-#ifdef CONFIG_ARCH_OMAP2116116- ldr \base, =OMAP2_IRQ_BASE117117-#else118118- ldr \base, =OMAP3_IRQ_BASE119119-#endif120120- .endm121121-122122- /* Check the pending interrupts. Note that base already set */123123- .macro get_irqnr_and_base, irqnr, irqstat, base, tmp124124- ldr \irqnr, [\base, #0x98] /* IRQ pending reg 1 */125125- cmp \irqnr, #0x0126126- bne 9999f127127- ldr \irqnr, [\base, #0xb8] /* IRQ pending reg 2 */128128- cmp \irqnr, #0x0129129- bne 9999f130130- ldr \irqnr, [\base, #0xd8] /* IRQ pending reg 3 */131131- cmp \irqnr, #0x0132132-#ifdef CONFIG_SOC_OMAPTI816X133133- bne 9999f134134- ldr \irqnr, [\base, #0xf8] /* IRQ pending reg 4 */135135- cmp \irqnr, #0x0136136-#endif137137-9999:138138- ldrne \irqnr, [\base, #INTCPS_SIR_IRQ_OFFSET]139139- and \irqnr, \irqnr, #ACTIVEIRQ_MASK /* Clear spurious bits */140140-141141- .endm142142-#endif143143-144144-145145-#ifdef CONFIG_ARCH_OMAP4146146-#define HAVE_GET_IRQNR_PREAMBLE147147-#include <asm/hardware/entry-macro-gic.S>148148-149149- .macro get_irqnr_preamble, base, tmp150150- ldr \base, =OMAP4_IRQ_BASE151151- .endm152152-153153-#endif154154-155155-#endif /* MULTI_OMAP2 */
-43
arch/arm/mach-omap2/include/mach/omap4-common.h
···11-/*22- * omap4-common.h: OMAP4 specific common header file33- *44- * Copyright (C) 2010 Texas Instruments, Inc.55- *66- * Author:77- * Santosh Shilimkar <santosh.shilimkar@ti.com>88- *99- * This program is free software; you can redistribute it and/or modify1010- * it under the terms of the GNU General Public License version 2 as1111- * published by the Free Software Foundation.1212- */1313-#ifndef OMAP_ARCH_OMAP4_COMMON_H1414-#define OMAP_ARCH_OMAP4_COMMON_H1515-1616-/*1717- * wfi used in low power code. Directly opcode is used instead1818- * of instruction to avoid mulit-omap build break1919- */2020-#ifdef CONFIG_THUMB2_KERNEL2121-#define do_wfi() __asm__ __volatile__ ("wfi" : : : "memory")2222-#else2323-#define do_wfi() \2424- __asm__ __volatile__ (".word 0xe320f003" : : : "memory")2525-#endif2626-2727-#ifdef CONFIG_CACHE_L2X02828-extern void __iomem *l2cache_base;2929-#endif3030-3131-extern void __iomem *gic_dist_base_addr;3232-3333-extern void __init gic_init_irq(void);3434-extern void omap_smc1(u32 fn, u32 arg);3535-3636-#ifdef CONFIG_SMP3737-/* Needed for secondary core boot */3838-extern void omap_secondary_startup(void);3939-extern u32 omap_modify_auxcoreboot0(u32 set_mask, u32 clear_mask);4040-extern void omap_auxcoreboot_addr(u32 cpu_addr);4141-extern u32 omap_read_auxcoreboot0(void);4242-#endif4343-#endif
-20
arch/arm/mach-omap2/include/mach/vmalloc.h
···11-/*22- * arch/arm/plat-omap/include/mach/vmalloc.h33- *44- * Copyright (C) 2000 Russell King.55- *66- * This program is free software; you can redistribute it and/or modify77- * it under the terms of the GNU General Public License as published by88- * the Free Software Foundation; either version 2 of the License, or99- * (at your option) any later version.1010- *1111- * This program is distributed in the hope that it will be useful,1212- * but WITHOUT ANY WARRANTY; without even the implied warranty of1313- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1414- * GNU General Public License for more details.1515- *1616- * You should have received a copy of the GNU General Public License1717- * along with this program; if not, write to the Free Software1818- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1919- */2020-#define VMALLOC_END 0xf8000000UL
+2-6
arch/arm/mach-omap2/io.c
···3535#include "clock3xxx.h"3636#include "clock44xx.h"37373838-#include <plat/common.h>3838+#include "common.h"3939#include <plat/omap-pm.h>4040#include "voltage.h"4141#include "powerdomain.h"···4343#include "clockdomain.h"4444#include <plat/omap_hwmod.h>4545#include <plat/multi.h>4646-#include <plat/common.h>4646+#include "common.h"47474848/*4949 * The machine specific code may provide the extra mapping besides the···316316 return omap_hwmod_set_postsetup_state(oh, *(u8 *)data);317317}318318319319-/* See irq.c, omap4-common.c and entry-macro.S */320320-void __iomem *omap_irq_base;321321-322319static void __init omap_common_init_early(void)323320{324321 omap2_check_revision();325325- omap_ioremap_init();326322 omap_init_consistent_dma_size();327323}328324
+51
arch/arm/mach-omap2/irq.c
···1515#include <linux/interrupt.h>1616#include <linux/io.h>1717#include <mach/hardware.h>1818+#include <asm/exception.h>1819#include <asm/mach/irq.h>19202021···3534#define INTC_PENDING_IRQ0 0x00983635/* Number of IRQ state bits in each MIR register */3736#define IRQ_BITS_PER_REG 323737+3838+#define OMAP2_IRQ_BASE OMAP2_L4_IO_ADDRESS(OMAP24XX_IC_BASE)3939+#define OMAP3_IRQ_BASE OMAP2_L4_IO_ADDRESS(OMAP34XX_IC_BASE)4040+#define INTCPS_SIR_IRQ_OFFSET 0x0040 /* omap2/3 active interrupt offset */4141+#define ACTIVEIRQ_MASK 0x7f /* omap2/3 active interrupt bits */38423943/*4044 * OMAP2 has a number of different interrupt controllers, each interrupt···149143150144static void __init omap_init_irq(u32 base, int nr_irqs)151145{146146+ void __iomem *omap_irq_base;152147 unsigned long nr_of_irqs = 0;153148 unsigned int nr_banks = 0;154149 int i, j;···196189void __init ti816x_init_irq(void)197190{198191 omap_init_irq(OMAP34XX_IC_BASE, 128);192192+}193193+194194+static inline void omap_intc_handle_irq(void __iomem *base_addr, struct pt_regs *regs)195195+{196196+ u32 irqnr;197197+198198+ do {199199+ irqnr = readl_relaxed(base_addr + 0x98);200200+ if (irqnr)201201+ goto out;202202+203203+ irqnr = readl_relaxed(base_addr + 0xb8);204204+ if (irqnr)205205+ goto out;206206+207207+ irqnr = readl_relaxed(base_addr + 0xd8);208208+#ifdef CONFIG_SOC_OMAPTI816X209209+ if (irqnr)210210+ goto out;211211+ irqnr = readl_relaxed(base_addr + 0xf8);212212+#endif213213+214214+out:215215+ if (!irqnr)216216+ break;217217+218218+ irqnr = readl_relaxed(base_addr + INTCPS_SIR_IRQ_OFFSET);219219+ irqnr &= ACTIVEIRQ_MASK;220220+221221+ if (irqnr)222222+ handle_IRQ(irqnr, regs);223223+ } while (irqnr);224224+}225225+226226+asmlinkage void __exception_irq_entry omap2_intc_handle_irq(struct pt_regs *regs)227227+{228228+ void __iomem *base_addr = OMAP2_IRQ_BASE;229229+ omap_intc_handle_irq(base_addr, regs);199230}200231201232#ifdef CONFIG_ARCH_OMAP3···307262{308263 /* Re-enable autoidle */309264 intc_bank_write_reg(1, &irq_banks[0], INTC_SYSCONFIG);265265+}266266+267267+asmlinkage void __exception_irq_entry omap3_intc_handle_irq(struct pt_regs *regs)268268+{269269+ void __iomem *base_addr = OMAP3_IRQ_BASE;270270+ omap_intc_handle_irq(base_addr, regs);310271}311272#endif /* CONFIG_ARCH_OMAP3 */
+2-1
arch/arm/mach-omap2/omap-hotplug.c
···1919#include <linux/smp.h>20202121#include <asm/cacheflush.h>2222-#include <mach/omap4-common.h>2222+2323+#include "common.h"23242425int platform_cpu_kill(unsigned int cpu)2526{
···99 * License version 2. This program is licensed "as is" without any1010 * warranty of any kind, whether express or implied.1111 */1212-#include <mach/hardware.h>1313-#include <mach/irqs.h>1414-#include <mach/map.h>1212+ .macro disable_fiq1313+ .endm15141616-#define VA_VIC0 IO_ADDRESS(PICOXCELL_VIC0_BASE)1717-#define VA_VIC1 IO_ADDRESS(PICOXCELL_VIC1_BASE)1818-1919-#include <asm/entry-macro-vic2.S>1515+ .macro arch_ret_to_user, tmp1, tmp21616+ .endm
-14
arch/arm/mach-picoxcell/include/mach/vmalloc.h
···11-/*22- * Copyright (c) 2011 Picochip Ltd., Jamie Iles33- *44- * This program is free software; you can redistribute it and/or modify55- * it under the terms of the GNU General Public License as published by66- * the Free Software Foundation; either version 2 of the License, or77- * (at your option) any later version.88- *99- * This program is distributed in the hope that it will be useful,1010- * but WITHOUT ANY WARRANTY; without even the implied warranty of1111- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1212- * GNU General Public License for more details.1313- */1414-#define VMALLOC_END 0xfe000000UL
···11-/*22- * arch/arm/mach-pnx4008/include/mach/vmalloc.h33- *44- * Author: Vitaly Wool <source@mvista.com>55- *66- * 2006 (c) MontaVista Software, Inc. This file is licensed under77- * the terms of the GNU General Public License version 2. This program88- * is licensed "as is" without any warranty of any kind, whether express99- * or implied.1010- */1111-1212-/*1313- * Just any arbitrary offset to the start of the vmalloc VM area: the1414- * current 8MB value just means that there will be a 8MB "hole" after the1515- * physical memory until the kernel virtual memory starts. That means that1616- * any out-of-bounds memory accesses will hopefully be caught.1717- * The vmalloc() routines leaves a hole of 4kB between each vmalloced1818- * area for the same reason. ;)1919- */2020-#define VMALLOC_END 0xd0000000UL
···11-/*22- * arch/arm/mach-pxa/include/mach/vmalloc.h33- *44- * Author: Nicolas Pitre55- * Copyright: (C) 2001 MontaVista Software Inc.66- *77- * This program is free software; you can redistribute it and/or modify88- * it under the terms of the GNU General Public License version 2 as99- * published by the Free Software Foundation.1010- */1111-#define VMALLOC_END (0xe8000000UL)
···8888 switch (mode) {8989 case 's':9090 /* Jump into ROM at address 0 */9191- cpu_reset(0);9191+ soft_restart(0);9292 break;9393 case 'g':9494 do_gpio_reset();
···1212 bool "Support Multicore Cortex-A9 Tile"1313 depends on MACH_REALVIEW_EB1414 select CPU_V71515+ select HAVE_SMP1616+ select MIGHT_HAVE_CACHE_L2X01517 help1618 Enable support for the Cortex-A9MPCore tile fitted to the1719 Realview(R) Emulation Baseboard platform.···2321 depends on MACH_REALVIEW_EB2422 select CPU_V6K2523 select ARCH_HAS_BARRIERS if SMP2424+ select HAVE_SMP2525+ select MIGHT_HAVE_CACHE_L2X02626 help2727 Enable support for the ARM11MPCore tile fitted to the Realview(R)2828 Emulation Baseboard platform.···4339 select CPU_V6K4440 select ARM_GIC4541 select HAVE_PATA_PLATFORM4242+ select HAVE_SMP4343+ select MIGHT_HAVE_CACHE_L2X04644 select ARCH_HAS_BARRIERS if SMP4745 help4846 Include support for the ARM(R) RealView(R) Platform Baseboard for···5751 select CPU_V65852 select ARM_GIC5953 select HAVE_TCM5454+ select MIGHT_HAVE_CACHE_L2X06055 help6156 Include support for the ARM(R) RealView(R) Platform Baseboard for6257 ARM1176JZF-S.···8578 bool "Support RealView(R) Platform Baseboard Explore"8679 select ARM_GIC8780 select HAVE_PATA_PLATFORM8181+ select HAVE_SMP8282+ select MIGHT_HAVE_CACHE_L2X08883 select ARCH_SPARSEMEM_ENABLE if CPU_V7 && !REALVIEW_HIGH_PHYS_OFFSET8984 select ZONE_DMA if SPARSEMEM9085 help
-2
arch/arm/mach-realview/include/mach/entry-macro.S
···77 * License version 2. This program is licensed "as is" without any88 * warranty of any kind, whether express or implied.99 */1010-#include <mach/hardware.h>1111-#include <asm/hardware/entry-macro-gic.S>12101311 .macro disable_fiq1412 .endm
-21
arch/arm/mach-realview/include/mach/vmalloc.h
···11-/*22- * arch/arm/mach-realview/include/mach/vmalloc.h33- *44- * Copyright (C) 2003 ARM Limited55- * Copyright (C) 2000 Russell King.66- *77- * This program is free software; you can redistribute it and/or modify88- * it under the terms of the GNU General Public License as published by99- * the Free Software Foundation; either version 2 of the License, or1010- * (at your option) any later version.1111- *1212- * This program is distributed in the hope that it will be useful,1313- * but WITHOUT ANY WARRANTY; without even the implied warranty of1414- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1515- * GNU General Public License for more details.1616- *1717- * You should have received a copy of the GNU General Public License1818- * along with this program; if not, write to the Free Software1919- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA2020- */2121-#define VMALLOC_END 0xf8000000UL
···2323 /*2424 * Jump into the ROM2525 */2626- cpu_reset(0);2626+ soft_restart(0);2727}
-10
arch/arm/mach-rpc/include/mach/vmalloc.h
···11-/*22- * arch/arm/mach-rpc/include/mach/vmalloc.h33- *44- * Copyright (C) 1997 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-#define VMALLOC_END 0xdc000000UL
+2-2
arch/arm/mach-s3c2410/include/mach/system-reset.h
···1919arch_reset(char mode, const char *cmd)2020{2121 if (mode == 's') {2222- cpu_reset(0);2222+ soft_restart(0);2323 }24242525 if (s3c24xx_reset_hook)···2828 arch_wdt_reset();29293030 /* we'll take a jump through zero as a poor second */3131- cpu_reset(0);3131+ soft_restart(0);3232}
-20
arch/arm/mach-s3c2410/include/mach/vmalloc.h
···11-/* arch/arm/mach-s3c2410/include/mach/vmalloc.h22- *33- * from arch/arm/mach-iop3xx/include/mach/vmalloc.h44- *55- * Copyright (c) 2003 Simtec Electronics <linux@simtec.co.uk>66- * http://www.simtec.co.uk/products/SWLINUX/77- *88- * This program is free software; you can redistribute it and/or modify99- * it under the terms of the GNU General Public License version 2 as1010- * published by the Free Software Foundation.1111- *1212- * S3C2410 vmalloc definition1313-*/1414-1515-#ifndef __ASM_ARCH_VMALLOC_H1616-#define __ASM_ARCH_VMALLOC_H1717-1818-#define VMALLOC_END 0xF6000000UL1919-2020-#endif /* __ASM_ARCH_VMALLOC_H */
+4-3
arch/arm/mach-s3c64xx/include/mach/entry-macro.S
···1212 * warranty of any kind, whether express or implied.1313*/14141515-#include <mach/map.h>1616-#include <mach/irqs.h>1515+ .macro disable_fiq1616+ .endm17171818-#include <asm/entry-macro-vic2.S>1818+ .macro arch_ret_to_user, tmp1, tmp21919+ .endm
+1-1
arch/arm/mach-s3c64xx/include/mach/system.h
···2424 arch_wdt_reset();25252626 /* if all else fails, or mode was for soft, jump to 0 */2727- cpu_reset(0);2727+ soft_restart(0);2828}29293030#endif /* __ASM_ARCH_IRQ_H */
-20
arch/arm/mach-s3c64xx/include/mach/vmalloc.h
···11-/* arch/arm/mach-s3c64xx/include/mach/vmalloc.h22- *33- * from arch/arm/mach-iop3xx/include/mach/vmalloc.h44- *55- * Copyright (c) 2003 Simtec Electronics <linux@simtec.co.uk>66- * http://www.simtec.co.uk/products/SWLINUX/77- *88- * This program is free software; you can redistribute it and/or modify99- * it under the terms of the GNU General Public License version 2 as1010- * published by the Free Software Foundation.1111- *1212- * S3C6400 vmalloc definition1313-*/1414-1515-#ifndef __ASM_ARCH_VMALLOC_H1616-#define __ASM_ARCH_VMALLOC_H1717-1818-#define VMALLOC_END 0xF6000000UL1919-2020-#endif /* __ASM_ARCH_VMALLOC_H */
···1010 * published by the Free Software Foundation.1111*/12121313-#include <mach/map.h>1414-#include <plat/irqs.h>1313+ .macro disable_fiq1414+ .endm15151616-#include <asm/entry-macro-vic2.S>1616+ .macro arch_ret_to_user, tmp1, tmp21717+ .endm
-20
arch/arm/mach-s5p64x0/include/mach/vmalloc.h
···11-/* linux/arch/arm/mach-s5p64x0/include/mach/vmalloc.h22- *33- * Copyright (c) 2010 Samsung Electronics Co., Ltd.44- * http://www.samsung.com55- *66- * Copyright 2010 Ben Dooks <ben-linux@fluff.org>77- *88- * This program is free software; you can redistribute it and/or modify99- * it under the terms of the GNU General Public License version 2 as1010- * published by the Free Software Foundation.1111- *1212- * S3C6400 vmalloc definition1313-*/1414-1515-#ifndef __ASM_ARCH_VMALLOC_H1616-#define __ASM_ARCH_VMALLOC_H1717-1818-#define VMALLOC_END 0xF6000000UL1919-2020-#endif /* __ASM_ARCH_VMALLOC_H */
···11-/* arch/arm/mach-s5pc100/include/mach/vmalloc.h22- *33- * Copyright 2010 Ben Dooks <ben-linux@fluff.org>44- *55- * This program is free software; you can redistribute it and/or modify66- * it under the terms of the GNU General Public License version 2 as77- * published by the Free Software Foundation.88- *99- * S3C6400 vmalloc definition1010-*/1111-1212-#ifndef __ASM_ARCH_VMALLOC_H1313-#define __ASM_ARCH_VMALLOC_H1414-1515-#define VMALLOC_END 0xF6000000UL1616-1717-#endif /* __ASM_ARCH_VMALLOC_H */
···11-/* linux/arch/arm/mach-s5p6442/include/mach/vmalloc.h22- *33- * Copyright 2010 Ben Dooks <ben-linux@fluff.org>44- *55- * Copyright (c) 2010 Samsung Electronics Co., Ltd.66- * http://www.samsung.com/77- *88- * Based on arch/arm/mach-s5p6442/include/mach/vmalloc.h99- *1010- * S5PV210 vmalloc definition1111- *1212- * This program is free software; you can redistribute it and/or modify1313- * it under the terms of the GNU General Public License version 2 as1414- * published by the Free Software Foundation.1515-*/1616-1717-#ifndef __ASM_ARCH_VMALLOC_H1818-#define __ASM_ARCH_VMALLOC_H __FILE__1919-2020-#define VMALLOC_END 0xF6000000UL2121-2222-#endif /* __ASM_ARCH_VMALLOC_H */
···1212#include <linux/errno.h>1313#include <linux/interrupt.h>1414#include <linux/irq.h>1515-#include <linux/sched.h> /* just for sched_clock() - funny that */1615#include <linux/timex.h>1716#include <linux/clockchips.h>1817···1920#include <asm/sched_clock.h>2021#include <mach/hardware.h>21222222-/*2323- * This is the SA11x0 sched_clock implementation.2424- */2525-static DEFINE_CLOCK_DATA(cd);2626-2727-/*2828- * Constants generated by clocks_calc_mult_shift(m, s, 3.6864MHz,2929- * NSEC_PER_SEC, 60).3030- * This gives a resolution of about 271ns and a wrap period of about 19min.3131- */3232-#define SC_MULT 2275555556u3333-#define SC_SHIFT 233434-3535-unsigned long long notrace sched_clock(void)2323+static u32 notrace sa1100_read_sched_clock(void)3624{3737- u32 cyc = OSCR;3838- return cyc_to_fixed_sched_clock(&cd, cyc, (u32)~0, SC_MULT, SC_SHIFT);3939-}4040-4141-static void notrace sa1100_update_sched_clock(void)4242-{4343- u32 cyc = OSCR;4444- update_sched_clock(&cd, cyc, (u32)~0);2525+ return OSCR;4526}46274728#define MIN_OSCR_DELTA 2···88109 OIER = 0;89110 OSSR = OSSR_M0 | OSSR_M1 | OSSR_M2 | OSSR_M3;901119191- init_fixed_sched_clock(&cd, sa1100_update_sched_clock, 32,9292- 3686400, SC_MULT, SC_SHIFT);112112+ setup_sched_clock(sa1100_read_sched_clock, 32, 3686400);9311394114 clockevents_calc_mult_shift(&ckevt_sa1100_osmr0, 3686400, 4);95115 ckevt_sa1100_osmr0.max_delta_ns =
-1
arch/arm/mach-shark/core.c
···2929void arch_reset(char mode, const char *cmd)3030{3131 short temp;3232- local_irq_disable();3332 /* Reset the Machine via pc[3] of the sequoia chipset */3433 outw(0x09,0x24);3534 temp=inw(0x26);
···466466static void __init ag5evm_map_io(void)467467{468468 iotable_init(ag5evm_io_desc, ARRAY_SIZE(ag5evm_io_desc));469469- /* DMA memory at 0xf6000000 - 0xffdfffff */470470- init_consistent_dma_size(158 << 20);471469472470 /* setup early devices and console here as well */473471 sh73a0_add_early_devices();···607609 .map_io = ag5evm_map_io,608610 .nr_irqs = NR_IRQS_LEGACY,609611 .init_irq = sh73a0_init_irq,610610- .handle_irq = shmobile_handle_irq_gic,612612+ .handle_irq = gic_handle_irq,611613 .init_machine = ag5evm_init,612614 .timer = &ag5evm_timer,613615MACHINE_END
-2
arch/arm/mach-shmobile/board-ap4evb.c
···11721172static void __init ap4evb_map_io(void)11731173{11741174 iotable_init(ap4evb_io_desc, ARRAY_SIZE(ap4evb_io_desc));11751175- /* DMA memory at 0xf6000000 - 0xffdfffff */11761176- init_consistent_dma_size(158 << 20);1177117511781176 /* setup early devices and console here as well */11791177 sh7372_add_early_devices();
-2
arch/arm/mach-shmobile/board-g3evm.c
···261261static void __init g3evm_map_io(void)262262{263263 iotable_init(g3evm_io_desc, ARRAY_SIZE(g3evm_io_desc));264264- /* DMA memory at 0xf6000000 - 0xffdfffff */265265- init_consistent_dma_size(158 << 20);266264267265 /* setup early devices and console here as well */268266 sh7367_add_early_devices();
-2
arch/arm/mach-shmobile/board-g4evm.c
···275275static void __init g4evm_map_io(void)276276{277277 iotable_init(g4evm_io_desc, ARRAY_SIZE(g4evm_io_desc));278278- /* DMA memory at 0xf6000000 - 0xffdfffff */279279- init_consistent_dma_size(158 << 20);280278281279 /* setup early devices and console here as well */282280 sh7377_add_early_devices();
···13901390static void __init mackerel_map_io(void)13911391{13921392 iotable_init(mackerel_io_desc, ARRAY_SIZE(mackerel_io_desc));13931393- /* DMA memory at 0xf6000000 - 0xffdfffff */13941394- init_consistent_dma_size(158 << 20);1395139313961394 /* setup early devices and console here as well */13971395 sh7372_add_early_devices();
-18
arch/arm/mach-shmobile/entry-gic.S
···11-/*22- * ARM Interrupt demux handler using GIC33- *44- * Copyright (C) 2010 Magnus Damm55- * Copyright (C) 2011 Paul Mundt66- * Copyright (C) 2010 - 2011 Renesas Solutions Corp.77- *88- * This file is licensed under the terms of the GNU General Public99- * License version 2. This program is licensed "as is" without any1010- * warranty of any kind, whether express or implied.1111- */1212-1313-#include <asm/assembler.h>1414-#include <asm/entry-macro-multi.S>1515-#include <asm/hardware/gic.h>1616-#include <asm/hardware/entry-macro-gic.S>1717-1818- arch_irq_handler shmobile_handle_irq_gic
···1111 * warranty of any kind, whether express or implied.1212 */13131414-#include <asm/hardware/vic.h>1515-#include <mach/hardware.h>1616-1714 .macro disable_fiq1815 .endm19162020- .macro get_irqnr_preamble, base, tmp2121- .endm2222-2317 .macro arch_ret_to_user, tmp1, tmp22424- .endm2525-2626- .macro get_irqnr_and_base, irqnr, irqstat, base, tmp2727- ldr \base, =VA_SPEAR3XX_ML1_VIC_BASE2828- ldr \irqstat, [\base, #VIC_IRQ_STATUS] @ get status2929- teq \irqstat, #03030- beq 1001f @ this will set/reset3131- @ zero register3232- /*3333- * Following code will find bit position of least significang3434- * bit set in irqstat, using following equation3535- * least significant bit set in n = (n & ~(n-1))3636- */3737- sub \tmp, \irqstat, #1 @ tmp = irqstat - 13838- mvn \tmp, \tmp @ tmp = ~tmp3939- and \irqstat, \irqstat, \tmp @ irqstat &= tmp4040- /* Now, irqstat is = bit no. of 1st bit set in vic irq status */4141- clz \tmp, \irqstat @ tmp = leading zeros4242- rsb \irqnr, \tmp, #0x1F @ irqnr = 32 - tmp - 14343-4444-1001: /* EQ will be set if no irqs pending */4518 .endm
-19
arch/arm/mach-spear3xx/include/mach/vmalloc.h
···11-/*22- * arch/arm/mach-spear3xx/include/mach/vmalloc.h33- *44- * Defining Vmalloc area for SPEAr3xx machine family55- *66- * Copyright (C) 2009 ST Microelectronics77- * Viresh Kumar<viresh.kumar@st.com>88- *99- * This file is licensed under the terms of the GNU General Public1010- * License version 2. This program is licensed "as is" without any1111- * warranty of any kind, whether express or implied.1212- */1313-1414-#ifndef __MACH_VMALLOC_H1515-#define __MACH_VMALLOC_H1616-1717-#include <plat/vmalloc.h>1818-1919-#endif /* __MACH_VMALLOC_H */
···1111 * warranty of any kind, whether express or implied.1212 */13131414-#include <asm/hardware/vic.h>1515-#include <mach/hardware.h>1616-1714 .macro disable_fiq1815 .endm19162020- .macro get_irqnr_preamble, base, tmp2121- .endm2222-2317 .macro arch_ret_to_user, tmp1, tmp22424- .endm2525-2626- .macro get_irqnr_and_base, irqnr, irqstat, base, tmp2727- ldr \base, =VA_SPEAR6XX_CPU_VIC_PRI_BASE2828- ldr \irqstat, [\base, #VIC_IRQ_STATUS] @ get status2929- mov \irqnr, #03030- teq \irqstat, #03131- bne 1001f3232- ldr \base, =VA_SPEAR6XX_CPU_VIC_SEC_BASE3333- ldr \irqstat, [\base, #VIC_IRQ_STATUS] @ get status3434- teq \irqstat, #03535- beq 1002f @ this will set/reset3636- @ zero register3737- mov \irqnr, #323838-1001:3939- /*4040- * Following code will find bit position of least significang4141- * bit set in irqstat, using following equation4242- * least significant bit set in n = (n & ~(n-1))4343- */4444- sub \tmp, \irqstat, #1 @ tmp = irqstat - 14545- mvn \tmp, \tmp @ tmp = ~tmp4646- and \irqstat, \irqstat, \tmp @ irqstat &= tmp4747- /* Now, irqstat is = bit no. of 1st bit set in vic irq status */4848- clz \tmp, \irqstat @ tmp = leading zeros4949-5050- rsb \tmp, \tmp, #0x1F @ tmp = 32 - tmp - 15151- add \irqnr, \irqnr, \tmp5252-5353-1002: /* EQ will be set if no irqs pending */5418 .endm
-19
arch/arm/mach-spear6xx/include/mach/vmalloc.h
···11-/*22- * arch/arm/mach-spear6xx/include/mach/vmalloc.h33- *44- * Defining Vmalloc area for SPEAr6xx machine family55- *66- * Copyright (C) 2009 ST Microelectronics77- * Rajeev Kumar<rajeev-dlh.kumar@st.com>88- *99- * This file is licensed under the terms of the GNU General Public1010- * License version 2. This program is licensed "as is" without any1111- * warranty of any kind, whether express or implied.1212- */1313-1414-#ifndef __MACH_VMALLOC_H1515-#define __MACH_VMALLOC_H1616-1717-#include <plat/vmalloc.h>1818-1919-#endif /* __MACH_VMALLOC_H */
···11-/*22- * arch/arm/mach-tegra/include/mach/vmalloc.h33- *44- * Copyright (C) 2010 Google, Inc.55- *66- * Author:77- * Colin Cross <ccross@google.com>88- * Erik Gilling <konkers@google.com>99- *1010- * This software is licensed under the terms of the GNU General Public1111- * License version 2, as published by the Free Software Foundation, and1212- * may be copied, distributed, and modified under those terms.1313- *1414- * This program is distributed in the hope that it will be useful,1515- * but WITHOUT ANY WARRANTY; without even the implied warranty of1616- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1717- * GNU General Public License for more details.1818- *1919- */2020-2121-#ifndef __MACH_TEGRA_VMALLOC_H2222-#define __MACH_TEGRA_VMALLOC_H2323-2424-#include <asm/sizes.h>2525-2626-#define VMALLOC_END 0xFE000000UL2727-2828-#endif
-21
arch/arm/mach-tegra/io.c
···6060{6161 iotable_init(tegra_io_desc, ARRAY_SIZE(tegra_io_desc));6262}6363-6464-/*6565- * Intercept ioremap() requests for addresses in our fixed mapping regions.6666- */6767-void __iomem *tegra_ioremap(unsigned long p, size_t size, unsigned int type)6868-{6969- void __iomem *v = IO_ADDRESS(p);7070- if (v == NULL)7171- v = __arm_ioremap(p, size, type);7272- return v;7373-}7474-EXPORT_SYMBOL(tegra_ioremap);7575-7676-void tegra_iounmap(volatile void __iomem *addr)7777-{7878- unsigned long virt = (unsigned long)addr;7979-8080- if (virt >= VMALLOC_START && virt < VMALLOC_END)8181- __iounmap(addr);8282-}8383-EXPORT_SYMBOL(tegra_iounmap);
+3-21
arch/arm/mach-tegra/timer.c
···19192020#include <linux/init.h>2121#include <linux/err.h>2222-#include <linux/sched.h>2322#include <linux/time.h>2423#include <linux/interrupt.h>2524#include <linux/irq.h>···105106 .set_mode = tegra_timer_set_mode,106107};107108108108-static DEFINE_CLOCK_DATA(cd);109109-110110-/*111111- * Constants generated by clocks_calc_mult_shift(m, s, 1MHz, NSEC_PER_SEC, 60).112112- * This gives a resolution of about 1us and a wrap period of about 1h11min.113113- */114114-#define SC_MULT 4194304000u115115-#define SC_SHIFT 22116116-117117-unsigned long long notrace sched_clock(void)109109+static u32 notrace tegra_read_sched_clock(void)118110{119119- u32 cyc = timer_readl(TIMERUS_CNTR_1US);120120- return cyc_to_fixed_sched_clock(&cd, cyc, (u32)~0, SC_MULT, SC_SHIFT);121121-}122122-123123-static void notrace tegra_update_sched_clock(void)124124-{125125- u32 cyc = timer_readl(TIMERUS_CNTR_1US);126126- update_sched_clock(&cd, cyc, (u32)~0);111111+ return timer_readl(TIMERUS_CNTR_1US);127112}128113129114/*···201218 WARN(1, "Unknown clock rate");202219 }203220204204- init_fixed_sched_clock(&cd, tegra_update_sched_clock, 32,205205- 1000000, SC_MULT, SC_SHIFT);221221+ setup_sched_clock(tegra_read_sched_clock, 32, 1000000);206222207223 if (clocksource_mmio_init(timer_reg_base + TIMERUS_CNTR_1US,208224 "timer_us", 1000000, 300, 32, clocksource_mmio_readl_up)) {
···2727 case 's':2828 case 'h':2929 printk(KERN_CRIT "RESET: shutting down/rebooting system\n");3030- /* Disable interrupts */3131- local_irq_disable();3230#ifdef CONFIG_COH901327_WATCHDOG3331 coh901327_watchdog_reset();3432#endif
-12
arch/arm/mach-u300/include/mach/vmalloc.h
···11-/*22- *33- * arch/arm/mach-u300/include/mach/vmalloc.h44- *55- *66- * Copyright (C) 2006-2009 ST-Ericsson AB77- * License terms: GNU General Public License (GPL) version 288- * Virtual memory allocations99- * End must be above the I/O registers and on an even 2MiB boundary.1010- * Author: Linus Walleij <linus.walleij@stericsson.com>1111- */1212-#define VMALLOC_END 0xfe800000UL
+3-12
arch/arm/mach-u300/timer.c
···99 * Author: Linus Walleij <linus.walleij@stericsson.com>1010 */1111#include <linux/interrupt.h>1212-#include <linux/sched.h>1312#include <linux/time.h>1413#include <linux/timex.h>1514#include <linux/clockchips.h>···336337 * this wraps around for now, since it is just a relative time337338 * stamp. (Inspired by OMAP implementation.)338339 */339339-static DEFINE_CLOCK_DATA(cd);340340341341-unsigned long long notrace sched_clock(void)341341+static u32 notrace u300_read_sched_clock(void)342342{343343- u32 cyc = readl(U300_TIMER_APP_VBASE + U300_TIMER_APP_GPT2CC);344344- return cyc_to_sched_clock(&cd, cyc, (u32)~0);345345-}346346-347347-static void notrace u300_update_sched_clock(void)348348-{349349- u32 cyc = readl(U300_TIMER_APP_VBASE + U300_TIMER_APP_GPT2CC);350350- update_sched_clock(&cd, cyc, (u32)~0);343343+ return readl(U300_TIMER_APP_VBASE + U300_TIMER_APP_GPT2CC);351344}352345353346···357366 clk_enable(clk);358367 rate = clk_get_rate(clk);359368360360- init_sched_clock(&cd, u300_update_sched_clock, 32, rate);369369+ setup_sched_clock(u300_read_sched_clock, 32, rate);361370362371 /*363372 * Disable the "OS" and "DD" timers - these are designed for Symbian!
···3030};31313232static struct map_desc u5500_io_desc[] __initdata = {3333- __IO_DEV_DESC(U5500_GIC_CPU_BASE, SZ_4K),3333+ /* SCU base also covers GIC CPU BASE and TWD with its 4K page */3434+ __IO_DEV_DESC(U5500_SCU_BASE, SZ_4K),3435 __IO_DEV_DESC(U5500_GIC_DIST_BASE, SZ_4K),3536 __IO_DEV_DESC(U5500_L2CC_BASE, SZ_4K),3636- __IO_DEV_DESC(U5500_TWD_BASE, SZ_4K),3737 __IO_DEV_DESC(U5500_MTU0_BASE, SZ_4K),3838- __IO_DEV_DESC(U5500_SCU_BASE, SZ_4K),3938 __IO_DEV_DESC(U5500_BACKUPRAM0_BASE, SZ_8K),40394140 __IO_DEV_DESC(U5500_GPIO0_BASE, SZ_4K),
+2-3
arch/arm/mach-ux500/cpu-db8500.c
···3535};36363737static struct map_desc u8500_io_desc[] __initdata = {3838- __IO_DEV_DESC(U8500_GIC_CPU_BASE, SZ_4K),3838+ /* SCU base also covers GIC CPU BASE and TWD with its 4K page */3939+ __IO_DEV_DESC(U8500_SCU_BASE, SZ_4K),3940 __IO_DEV_DESC(U8500_GIC_DIST_BASE, SZ_4K),4041 __IO_DEV_DESC(U8500_L2CC_BASE, SZ_4K),4141- __IO_DEV_DESC(U8500_TWD_BASE, SZ_4K),4242 __IO_DEV_DESC(U8500_MTU0_BASE, SZ_4K),4343- __IO_DEV_DESC(U8500_SCU_BASE, SZ_4K),4443 __IO_DEV_DESC(U8500_BACKUPRAM0_BASE, SZ_8K),45444645 __IO_DEV_DESC(U8500_CLKRST1_BASE, SZ_4K),
-2
arch/arm/mach-ux500/include/mach/entry-macro.S
···1010 * License version 2. This program is licensed "as is" without any1111 * warranty of any kind, whether express or implied.1212 */1313-#include <mach/hardware.h>1414-#include <asm/hardware/entry-macro-gic.S>15131614 .macro disable_fiq1715 .endm
-18
arch/arm/mach-ux500/include/mach/vmalloc.h
···11-/*22- * Copyright (C) 2009 ST-Ericsson33- *44- * This program is free software; you can redistribute it and/or modify55- * it under the terms of the GNU General Public License as published by66- * the Free Software Foundation; either version 2 of the License, or77- * (at your option) any later version.88- *99- * This program is distributed in the hope that it will be useful,1010- * but WITHOUT ANY WARRANTY; without even the implied warranty of1111- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1212- * GNU General Public License for more details.1313- *1414- * You should have received a copy of the GNU General Public License1515- * along with this program; if not, write to the Free Software1616- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1717- */1818-#define VMALLOC_END 0xf0000000UL
···77 * License version 2. This program is licensed "as is" without any88 * warranty of any kind, whether express or implied.99 */1010-#include <mach/hardware.h>1111-#include <mach/platform.h>1212-#include <asm/hardware/vic.h>13101411 .macro disable_fiq1512 .endm16131717- .macro get_irqnr_preamble, base, tmp1818- ldr \base, =IO_ADDRESS(VERSATILE_VIC_BASE)1919- .endm2020-2114 .macro arch_ret_to_user, tmp1, tmp22215 .endm2323-2424- .macro get_irqnr_and_base, irqnr, irqstat, base, tmp2525- ldr \irqstat, [\base, #VIC_IRQ_STATUS] @ get masked status2626- mov \irqnr, #02727- teq \irqstat, #02828- beq 1003f2929-3030-1001: tst \irqstat, #153131- bne 1002f3232- add \irqnr, \irqnr, #43333- movs \irqstat, \irqstat, lsr #43434- bne 1001b3535-1002: tst \irqstat, #13636- bne 1003f3737- add \irqnr, \irqnr, #13838- movs \irqstat, \irqstat, lsr #13939- bne 1002b4040-1003: /* EQ will be set if no irqs pending */4141-4242-@ clz \irqnr, \irqstat4343-@1003: /* EQ will be set if we reach MAXIRQNUM */4444- .endm4545-
-21
arch/arm/mach-versatile/include/mach/vmalloc.h
···11-/*22- * arch/arm/mach-versatile/include/mach/vmalloc.h33- *44- * Copyright (C) 2003 ARM Limited55- * Copyright (C) 2000 Russell King.66- *77- * This program is free software; you can redistribute it and/or modify88- * it under the terms of the GNU General Public License as published by99- * the Free Software Foundation; either version 2 of the License, or1010- * (at your option) any later version.1111- *1212- * This program is distributed in the hope that it will be useful,1313- * but WITHOUT ANY WARRANTY; without even the implied warranty of1414- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1515- * GNU General Public License for more details.1616- *1717- * You should have received a copy of the GNU General Public License1818- * along with this program; if not, write to the Free Software1919- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA2020- */2121-#define VMALLOC_END 0xd8000000UL
···11-/*22- * arch/arm/mach-vexpress/include/mach/vmalloc.h33- *44- * Copyright (C) 2003 ARM Limited55- * Copyright (C) 2000 Russell King.66- *77- * This program is free software; you can redistribute it and/or modify88- * it under the terms of the GNU General Public License as published by99- * the Free Software Foundation; either version 2 of the License, or1010- * (at your option) any later version.1111- *1212- * This program is distributed in the hope that it will be useful,1313- * but WITHOUT ANY WARRANTY; without even the implied warranty of1414- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1515- * GNU General Public License for more details.1616- *1717- * You should have received a copy of the GNU General Public License1818- * along with this program; if not, write to the Free Software1919- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA2020- */2121-#define VMALLOC_END 0xf8000000UL
···11-/*22- * arch/arm/mach-vt8500/include/mach/vmalloc.h33- *44- * Copyright (C) 2000 Russell King.55- *66- * This program is free software; you can redistribute it and/or modify77- * it under the terms of the GNU General Public License as published by88- * the Free Software Foundation; either version 2 of the License, or99- * (at your option) any later version.1010- *1111- * This program is distributed in the hope that it will be useful,1212- * but WITHOUT ANY WARRANTY; without even the implied warranty of1313- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1414- * GNU General Public License for more details.1515- *1616- * You should have received a copy of the GNU General Public License1717- * along with this program; if not, write to the Free Software1818- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1919- */2020-#define VMALLOC_END 0xd0000000UL
+1-1
arch/arm/mach-w90x900/include/mach/system.h
···3333{3434 if (mode == 's') {3535 /* Jump into ROM at address 0 */3636- cpu_reset(0);3636+ soft_restart(0);3737 } else {3838 __raw_writel(WTE | WTRE | WTCLK, WTCR);3939 }
-23
arch/arm/mach-w90x900/include/mach/vmalloc.h
···11-/*22- * arch/arm/mach-w90x900/include/mach/vmalloc.h33- *44- * Copyright (c) 2008 Nuvoton technology corporation55- * All rights reserved.66- *77- * Wan ZongShun <mcuos.com@gmail.com>88- *99- * Based on arch/arm/mach-s3c2410/include/mach/vmalloc.h1010- *1111- * This program is free software; you can redistribute it and/or modify1212- * it under the terms of the GNU General Public License as published by1313- * the Free Software Foundation; either version 2 of the License, or1414- * (at your option) any later version.1515- *1616- */1717-1818-#ifndef __ASM_ARCH_VMALLOC_H1919-#define __ASM_ARCH_VMALLOC_H2020-2121-#define VMALLOC_END (0xe0000000UL)2222-2323-#endif /* __ASM_ARCH_VMALLOC_H */
+2
arch/arm/mach-w90x900/irq.c
···2828#include <mach/hardware.h>2929#include <mach/regs-irq.h>30303131+#include "nuc9xx.h"3232+3133struct group_irq {3234 unsigned long gpen;3335 unsigned int enabled;
+1-8
arch/arm/mach-w90x900/nuc910.h
···1212 * published by the Free Software Foundation.1313 *1414 */1515-1616-struct map_desc;1717-struct sys_timer;1818-1919-/* core initialisation functions */2020-2121-extern void nuc900_init_irq(void);2222-extern struct sys_timer nuc900_timer;1515+#include "nuc9xx.h"23162417/* extern file from nuc910.c */2518
+1-8
arch/arm/mach-w90x900/nuc950.h
···1212 * published by the Free Software Foundation.1313 *1414 */1515-1616-struct map_desc;1717-struct sys_timer;1818-1919-/* core initialisation functions */2020-2121-extern void nuc900_init_irq(void);2222-extern struct sys_timer nuc900_timer;1515+#include "nuc9xx.h"23162417/* extern file from nuc950.c */2518
+1-8
arch/arm/mach-w90x900/nuc960.h
···1212 * published by the Free Software Foundation.1313 *1414 */1515-1616-struct map_desc;1717-struct sys_timer;1818-1919-/* core initialisation functions */2020-2121-extern void nuc900_init_irq(void);2222-extern struct sys_timer nuc900_timer;1515+#include "nuc9xx.h"23162417/* extern file from nuc960.c */2518
+23
arch/arm/mach-w90x900/nuc9xx.h
···11+/*22+ * arch/arm/mach-w90x900/nuc9xx.h33+ *44+ * Copied from nuc910.h, which had:55+ *66+ * Copyright (c) 2008 Nuvoton corporation77+ *88+ * Header file for NUC900 CPU support99+ *1010+ * Wan ZongShun <mcuos.com@gmail.com>1111+ *1212+ * This program is free software; you can redistribute it and/or modify1313+ * it under the terms of the GNU General Public License version 2 as1414+ * published by the Free Software Foundation.1515+ *1616+ */1717+struct map_desc;1818+struct sys_timer;1919+2020+/* core initialisation functions */2121+2222+extern void nuc900_init_irq(void);2323+extern struct sys_timer nuc900_timer;
···2020 * GNU General Public License for more details.2121 */22222323-#include <mach/hardware.h>2424-#include <asm/hardware/entry-macro-gic.S>2525-2623 .macro disable_fiq2724 .endm2825
-20
arch/arm/mach-zynq/include/mach/vmalloc.h
···11-/* arch/arm/mach-zynq/include/mach/vmalloc.h22- *33- * Copyright (C) 2011 Xilinx44- *55- * This software is licensed under the terms of the GNU General Public66- * License version 2, as published by the Free Software Foundation, and77- * may be copied, distributed, and modified under those terms.88- *99- * This program is distributed in the hope that it will be useful,1010- * but WITHOUT ANY WARRANTY; without even the implied warranty of1111- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1212- * GNU General Public License for more details.1313- */1414-1515-#ifndef __MACH_VMALLOC_H__1616-#define __MACH_VMALLOC_H__1717-1818-#define VMALLOC_END 0xE0000000UL1919-2020-#endif
+33-7
arch/arm/mm/Kconfig
···629629630630comment "Processor Features"631631632632+config ARM_LPAE633633+ bool "Support for the Large Physical Address Extension"634634+ depends on MMU && CPU_V7635635+ help636636+ Say Y if you have an ARMv7 processor supporting the LPAE page637637+ table format and you would like to access memory beyond the638638+ 4GB limit. The resulting kernel image will not run on639639+ processors without the LPA extension.640640+641641+ If unsure, say N.642642+643643+config ARCH_PHYS_ADDR_T_64BIT644644+ def_bool ARM_LPAE645645+646646+config ARCH_DMA_ADDR_T_64BIT647647+ bool648648+632649config ARM_THUMB633650 bool "Support Thumb user binaries"634651 depends on CPU_ARM720T || CPU_ARM740T || CPU_ARM920T || CPU_ARM922T || CPU_ARM925T || CPU_ARM926T || CPU_ARM940T || CPU_ARM946E || CPU_ARM1020 || CPU_ARM1020E || CPU_ARM1022 || CPU_ARM1026 || CPU_XSCALE || CPU_XSC3 || CPU_MOHAWK || CPU_V6 || CPU_V6K || CPU_V7 || CPU_FEROCEON···833816 Say Y here to use the Feroceon L2 cache in writethrough mode.834817 Unless you specifically require this, say N for writeback mode.835818819819+config MIGHT_HAVE_CACHE_L2X0820820+ bool821821+ help822822+ This option should be selected by machines which have a L2x0823823+ or PL310 cache controller, but where its use is optional.824824+825825+ The only effect of this option is to make CACHE_L2X0 and826826+ related options available to the user for configuration.827827+828828+ Boards or SoCs which always require the cache controller829829+ support to be present should select CACHE_L2X0 directly830830+ instead of this option, thus preventing the user from831831+ inadvertently configuring a broken kernel.832832+836833config CACHE_L2X0837837- bool "Enable the L2x0 outer cache controller"838838- depends on REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP || MACH_REALVIEW_PB1176 || \839839- REALVIEW_EB_A9MP || ARCH_IMX_V6_V7 || MACH_REALVIEW_PBX || \840840- ARCH_NOMADIK || ARCH_OMAP4 || ARCH_EXYNOS4 || ARCH_TEGRA || \841841- ARCH_U8500 || ARCH_VEXPRESS_CA9X4 || ARCH_SHMOBILE || \842842- ARCH_PRIMA2 || ARCH_ZYNQ || ARCH_CNS3XXX || ARCH_HIGHBANK843843- default y834834+ bool "Enable the L2x0 outer cache controller" if MIGHT_HAVE_CACHE_L2X0835835+ default MIGHT_HAVE_CACHE_L2X0844836 select OUTER_CACHE845837 select OUTER_CACHE_SYNC846838 help
···11#include <linux/kernel.h>2233#include <asm/cputype.h>44+#include <asm/idmap.h>45#include <asm/pgalloc.h>56#include <asm/pgtable.h>77+#include <asm/sections.h>6899+pgd_t *idmap_pgd;1010+1111+#ifdef CONFIG_ARM_LPAE1212+static void idmap_add_pmd(pud_t *pud, unsigned long addr, unsigned long end,1313+ unsigned long prot)1414+{1515+ pmd_t *pmd;1616+ unsigned long next;1717+1818+ if (pud_none_or_clear_bad(pud) || (pud_val(*pud) & L_PGD_SWAPPER)) {1919+ pmd = pmd_alloc_one(&init_mm, addr);2020+ if (!pmd) {2121+ pr_warning("Failed to allocate identity pmd.\n");2222+ return;2323+ }2424+ pud_populate(&init_mm, pud, pmd);2525+ pmd += pmd_index(addr);2626+ } else2727+ pmd = pmd_offset(pud, addr);2828+2929+ do {3030+ next = pmd_addr_end(addr, end);3131+ *pmd = __pmd((addr & PMD_MASK) | prot);3232+ flush_pmd_entry(pmd);3333+ } while (pmd++, addr = next, addr != end);3434+}3535+#else /* !CONFIG_ARM_LPAE */736static void idmap_add_pmd(pud_t *pud, unsigned long addr, unsigned long end,837 unsigned long prot)938{···4415 pmd[1] = __pmd(addr);4516 flush_pmd_entry(pmd);4617}1818+#endif /* CONFIG_ARM_LPAE */47194820static void idmap_add_pud(pgd_t *pgd, unsigned long addr, unsigned long end,4921 unsigned long prot)···5828 } while (pud++, addr = next, addr != end);5929}60306161-void identity_mapping_add(pgd_t *pgd, unsigned long addr, unsigned long end)3131+static void identity_mapping_add(pgd_t *pgd, unsigned long addr, unsigned long end)6232{6333 unsigned long prot, next;64346565- prot = PMD_TYPE_SECT | PMD_SECT_AP_WRITE;3535+ prot = PMD_TYPE_SECT | PMD_SECT_AP_WRITE | PMD_SECT_AF;6636 if (cpu_architecture() <= CPU_ARCH_ARMv5TEJ && !cpu_is_xscale())6737 prot |= PMD_BIT4;6838···7343 } while (pgd++, addr = next, addr != end);7444}75457676-#ifdef CONFIG_SMP7777-static void idmap_del_pmd(pud_t *pud, unsigned long addr, unsigned long end)4646+extern char __idmap_text_start[], __idmap_text_end[];4747+4848+static int __init init_static_idmap(void)7849{7979- pmd_t *pmd = pmd_offset(pud, addr);8080- pmd_clear(pmd);5050+ phys_addr_t idmap_start, idmap_end;5151+5252+ idmap_pgd = pgd_alloc(&init_mm);5353+ if (!idmap_pgd)5454+ return -ENOMEM;5555+5656+ /* Add an identity mapping for the physical address of the section. */5757+ idmap_start = virt_to_phys((void *)__idmap_text_start);5858+ idmap_end = virt_to_phys((void *)__idmap_text_end);5959+6060+ pr_info("Setting up static identity map for 0x%llx - 0x%llx\n",6161+ (long long)idmap_start, (long long)idmap_end);6262+ identity_mapping_add(idmap_pgd, idmap_start, idmap_end);6363+6464+ return 0;8165}8282-8383-static void idmap_del_pud(pgd_t *pgd, unsigned long addr, unsigned long end)8484-{8585- pud_t *pud = pud_offset(pgd, addr);8686- unsigned long next;8787-8888- do {8989- next = pud_addr_end(addr, end);9090- idmap_del_pmd(pud, addr, next);9191- } while (pud++, addr = next, addr != end);9292-}9393-9494-void identity_mapping_del(pgd_t *pgd, unsigned long addr, unsigned long end)9595-{9696- unsigned long next;9797-9898- pgd += pgd_index(addr);9999- do {100100- next = pgd_addr_end(addr, end);101101- idmap_del_pud(pgd, addr, next);102102- } while (pgd++, addr = next, addr != end);103103-}104104-#endif6666+early_initcall(init_static_idmap);1056710668/*107107- * In order to soft-boot, we need to insert a 1:1 mapping in place of108108- * the user-mode pages. This will then ensure that we have predictable109109- * results when turning the mmu off6969+ * In order to soft-boot, we need to switch to a 1:1 mapping for the7070+ * cpu_reset functions. This will then ensure that we have predictable7171+ * results when turning off the mmu.11072 */111111-void setup_mm_for_reboot(char mode)7373+void setup_mm_for_reboot(void)11274{113113- /*114114- * We need to access to user-mode page tables here. For kernel threads115115- * we don't have any user-mode mappings so we use the context that we116116- * "borrowed".117117- */118118- identity_mapping_add(current->active_mm->pgd, 0, TASK_SIZE);7575+ /* Clean and invalidate L1. */7676+ flush_cache_all();7777+7878+ /* Switch to the identity mapping. */7979+ cpu_switch_mm(idmap_pgd, &init_mm);8080+8181+ /* Flush the TLB. */11982 local_flush_tlb_all();12083}
+8-32
arch/arm/mm/init.c
···2020#include <linux/highmem.h>2121#include <linux/gfp.h>2222#include <linux/memblock.h>2323-#include <linux/sort.h>24232524#include <asm/mach-types.h>2625#include <asm/prom.h>···133134}134135135136static void __init find_limits(unsigned long *min, unsigned long *max_low,136136- unsigned long *max_high)137137+ unsigned long *max_high)137138{138139 struct meminfo *mi = &meminfo;139140 int i;140141141141- *min = -1UL;142142- *max_low = *max_high = 0;143143-144144- for_each_bank (i, mi) {145145- struct membank *bank = &mi->bank[i];146146- unsigned long start, end;147147-148148- start = bank_pfn_start(bank);149149- end = bank_pfn_end(bank);150150-151151- if (*min > start)152152- *min = start;153153- if (*max_high < end)154154- *max_high = end;155155- if (bank->highmem)156156- continue;157157- if (*max_low < end)158158- *max_low = end;159159- }142142+ /* This assumes the meminfo array is properly sorted */143143+ *min = bank_pfn_start(&mi->bank[0]);144144+ for_each_bank (i, mi)145145+ if (mi->bank[i].highmem)146146+ break;147147+ *max_low = bank_pfn_end(&mi->bank[i - 1]);148148+ *max_high = bank_pfn_end(&mi->bank[mi->nr_banks - 1]);160149}161150162151static void __init arm_bootmem_init(unsigned long start_pfn,···306319}307320#endif308321309309-static int __init meminfo_cmp(const void *_a, const void *_b)310310-{311311- const struct membank *a = _a, *b = _b;312312- long cmp = bank_pfn_start(a) - bank_pfn_start(b);313313- return cmp < 0 ? -1 : cmp > 0 ? 1 : 0;314314-}315315-316322void __init arm_memblock_init(struct meminfo *mi, struct machine_desc *mdesc)317323{318324 int i;319319-320320- sort(&meminfo.bank, meminfo.nr_banks, sizeof(meminfo.bank[0]), meminfo_cmp, NULL);321325322326 memblock_init();323327 for (i = 0; i < mi->nr_banks; i++)···380402 * for memmap_init_zone(), otherwise all PFNs are invalid.381403 */382404 arm_bootmem_free(min, max_low, max_high);383383-384384- high_memory = __va(((phys_addr_t)max_low << PAGE_SHIFT) - 1) + 1;385405386406 /*387407 * This doesn't seem to be used by the Linux memory manager any
+75-44
arch/arm/mm/ioremap.c
···3636#include <asm/mach/map.h>3737#include "mm.h"38383939-/*4040- * Used by ioremap() and iounmap() code to mark (super)section-mapped4141- * I/O regions in vm_struct->flags field.4242- */4343-#define VM_ARM_SECTION_MAPPING 0x800000004444-4539int ioremap_page(unsigned long virt, unsigned long phys,4640 const struct mem_type *mtype)4741{···5864 } while (seq != init_mm.context.kvm_seq);5965}60666161-#ifndef CONFIG_SMP6767+#if !defined(CONFIG_SMP) && !defined(CONFIG_ARM_LPAE)6268/*6369 * Section support is unsafe on SMP - If you iounmap and ioremap a region,6470 * the other CPUs will not see this change until their next context switch.···7379{7480 unsigned long addr = virt, end = virt + (size & ~(SZ_1M - 1));7581 pgd_t *pgd;8282+ pud_t *pud;8383+ pmd_t *pmdp;76847785 flush_cache_vunmap(addr, end);7886 pgd = pgd_offset_k(addr);8787+ pud = pud_offset(pgd, addr);8888+ pmdp = pmd_offset(pud, addr);7989 do {8080- pmd_t pmd, *pmdp = pmd_offset(pgd, addr);9090+ pmd_t pmd = *pmdp;81918282- pmd = *pmdp;8392 if (!pmd_none(pmd)) {8493 /*8594 * Clear the PMD from the page table, and···101104 pte_free_kernel(&init_mm, pmd_page_vaddr(pmd));102105 }103106104104- addr += PGDIR_SIZE;105105- pgd++;107107+ addr += PMD_SIZE;108108+ pmdp += 2;106109 } while (addr < end);107110108111 /*···121124{122125 unsigned long addr = virt, end = virt + size;123126 pgd_t *pgd;127127+ pud_t *pud;128128+ pmd_t *pmd;124129125130 /*126131 * Remove and free any PTE-based mapping, and···131132 unmap_area_sections(virt, size);132133133134 pgd = pgd_offset_k(addr);135135+ pud = pud_offset(pgd, addr);136136+ pmd = pmd_offset(pud, addr);134137 do {135135- pmd_t *pmd = pmd_offset(pgd, addr);136136-137138 pmd[0] = __pmd(__pfn_to_phys(pfn) | type->prot_sect);138139 pfn += SZ_1M >> PAGE_SHIFT;139140 pmd[1] = __pmd(__pfn_to_phys(pfn) | type->prot_sect);140141 pfn += SZ_1M >> PAGE_SHIFT;141142 flush_pmd_entry(pmd);142143143143- addr += PGDIR_SIZE;144144- pgd++;144144+ addr += PMD_SIZE;145145+ pmd += 2;145146 } while (addr < end);146147147148 return 0;···153154{154155 unsigned long addr = virt, end = virt + size;155156 pgd_t *pgd;157157+ pud_t *pud;158158+ pmd_t *pmd;156159157160 /*158161 * Remove and free any PTE-based mapping, and···163162 unmap_area_sections(virt, size);164163165164 pgd = pgd_offset_k(virt);165165+ pud = pud_offset(pgd, addr);166166+ pmd = pmd_offset(pud, addr);166167 do {167168 unsigned long super_pmd_val, i;168169···173170 super_pmd_val |= ((pfn >> (32 - PAGE_SHIFT)) & 0xf) << 20;174171175172 for (i = 0; i < 8; i++) {176176- pmd_t *pmd = pmd_offset(pgd, addr);177177-178173 pmd[0] = __pmd(super_pmd_val);179174 pmd[1] = __pmd(super_pmd_val);180175 flush_pmd_entry(pmd);181176182182- addr += PGDIR_SIZE;183183- pgd++;177177+ addr += PMD_SIZE;178178+ pmd += 2;184179 }185180186181 pfn += SUPERSECTION_SIZE >> PAGE_SHIFT;···196195 unsigned long addr;197196 struct vm_struct * area;198197198198+#ifndef CONFIG_ARM_LPAE199199 /*200200 * High mappings must be supersection aligned201201 */202202 if (pfn >= 0x100000 && (__pfn_to_phys(pfn) & ~SUPERSECTION_MASK))203203 return NULL;204204-205205- /*206206- * Don't allow RAM to be mapped - this causes problems with ARMv6+207207- */208208- if (WARN_ON(pfn_valid(pfn)))209209- return NULL;204204+#endif210205211206 type = get_mem_type(mtype);212207 if (!type)···213216 */214217 size = PAGE_ALIGN(offset + size);215218219219+ /*220220+ * Try to reuse one of the static mapping whenever possible.221221+ */222222+ read_lock(&vmlist_lock);223223+ for (area = vmlist; area; area = area->next) {224224+ if (!size || (sizeof(phys_addr_t) == 4 && pfn >= 0x100000))225225+ break;226226+ if (!(area->flags & VM_ARM_STATIC_MAPPING))227227+ continue;228228+ if ((area->flags & VM_ARM_MTYPE_MASK) != VM_ARM_MTYPE(mtype))229229+ continue;230230+ if (__phys_to_pfn(area->phys_addr) > pfn ||231231+ __pfn_to_phys(pfn) + size-1 > area->phys_addr + area->size-1)232232+ continue;233233+ /* we can drop the lock here as we know *area is static */234234+ read_unlock(&vmlist_lock);235235+ addr = (unsigned long)area->addr;236236+ addr += __pfn_to_phys(pfn) - area->phys_addr;237237+ return (void __iomem *) (offset + addr);238238+ }239239+ read_unlock(&vmlist_lock);240240+241241+ /*242242+ * Don't allow RAM to be mapped - this causes problems with ARMv6+243243+ */244244+ if (WARN_ON(pfn_valid(pfn)))245245+ return NULL;246246+216247 area = get_vm_area_caller(size, VM_IOREMAP, caller);217248 if (!area)218249 return NULL;219250 addr = (unsigned long)area->addr;220251221221-#ifndef CONFIG_SMP252252+#if !defined(CONFIG_SMP) && !defined(CONFIG_ARM_LPAE)222253 if (DOMAIN_IO == 0 &&223254 (((cpu_architecture() >= CPU_ARCH_ARMv6) && (get_cr() & CR_XP)) ||224255 cpu_is_xsc3()) && pfn >= 0x100000 &&···338313void __iounmap(volatile void __iomem *io_addr)339314{340315 void *addr = (void *)(PAGE_MASK & (unsigned long)io_addr);341341-#ifndef CONFIG_SMP342342- struct vm_struct **p, *tmp;316316+ struct vm_struct *vm;343317344344- /*345345- * If this is a section based mapping we need to handle it346346- * specially as the VM subsystem does not know how to handle347347- * such a beast. We need the lock here b/c we need to clear348348- * all the mappings before the area can be reclaimed349349- * by someone else.350350- */351351- write_lock(&vmlist_lock);352352- for (p = &vmlist ; (tmp = *p) ; p = &tmp->next) {353353- if ((tmp->flags & VM_IOREMAP) && (tmp->addr == addr)) {354354- if (tmp->flags & VM_ARM_SECTION_MAPPING) {355355- unmap_area_sections((unsigned long)tmp->addr,356356- tmp->size);357357- }318318+ read_lock(&vmlist_lock);319319+ for (vm = vmlist; vm; vm = vm->next) {320320+ if (vm->addr > addr)321321+ break;322322+ if (!(vm->flags & VM_IOREMAP))323323+ continue;324324+ /* If this is a static mapping we must leave it alone */325325+ if ((vm->flags & VM_ARM_STATIC_MAPPING) &&326326+ (vm->addr <= addr) && (vm->addr + vm->size > addr)) {327327+ read_unlock(&vmlist_lock);328328+ return;329329+ }330330+#if !defined(CONFIG_SMP) && !defined(CONFIG_ARM_LPAE)331331+ /*332332+ * If this is a section based mapping we need to handle it333333+ * specially as the VM subsystem does not know how to handle334334+ * such a beast.335335+ */336336+ if ((vm->addr == addr) &&337337+ (vm->flags & VM_ARM_SECTION_MAPPING)) {338338+ unmap_area_sections((unsigned long)vm->addr, vm->size);358339 break;359340 }360360- }361361- write_unlock(&vmlist_lock);362341#endif342342+ }343343+ read_unlock(&vmlist_lock);363344364345 vunmap(addr);365346}
+14
arch/arm/mm/mm.h
···21212222extern void __flush_dcache_page(struct address_space *mapping, struct page *page);23232424+/*2525+ * ARM specific vm_struct->flags bits.2626+ */2727+2828+/* (super)section-mapped I/O regions used by ioremap()/iounmap() */2929+#define VM_ARM_SECTION_MAPPING 0x800000003030+3131+/* permanent static mappings from iotable_init() */3232+#define VM_ARM_STATIC_MAPPING 0x400000003333+3434+/* mapping type (attributes) for permanent static mappings */3535+#define VM_ARM_MTYPE(mt) ((mt) << 20)3636+#define VM_ARM_MTYPE_MASK (0x1f << 20)3737+2438#endif25392640#ifdef CONFIG_ZONE_DMA
+82-15
arch/arm/mm/mmu.c
···1515#include <linux/nodemask.h>1616#include <linux/memblock.h>1717#include <linux/fs.h>1818+#include <linux/vmalloc.h>18191920#include <asm/cputype.h>2021#include <asm/sections.h>···151150}152151early_param("nowb", early_nowrite);153152153153+#ifndef CONFIG_ARM_LPAE154154static int __init early_ecc(char *p)155155{156156 if (memcmp(p, "on", 2) == 0)···161159 return 0;162160}163161early_param("ecc", early_ecc);162162+#endif164163165164static int __init noalign_setup(char *__unused)166165{···231228 .prot_sect = PMD_TYPE_SECT | PMD_SECT_XN,232229 .domain = DOMAIN_KERNEL,233230 },231231+#ifndef CONFIG_ARM_LPAE234232 [MT_MINICLEAN] = {235233 .prot_sect = PMD_TYPE_SECT | PMD_SECT_XN | PMD_SECT_MINICACHE,236234 .domain = DOMAIN_KERNEL,237235 },236236+#endif238237 [MT_LOW_VECTORS] = {239238 .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY |240239 L_PTE_RDONLY,···434429 * ARMv6 and above have extended page tables.435430 */436431 if (cpu_arch >= CPU_ARCH_ARMv6 && (cr & CR_XP)) {432432+#ifndef CONFIG_ARM_LPAE437433 /*438434 * Mark cache clean areas and XIP ROM read only439435 * from SVC mode and no access from userspace.···442436 mem_types[MT_ROM].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE;443437 mem_types[MT_MINICLEAN].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE;444438 mem_types[MT_CACHECLEAN].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE;439439+#endif445440446441 if (is_smp()) {447442 /*···480473 } else {481474 mem_types[MT_MEMORY_NONCACHED].prot_sect |= PMD_SECT_BUFFERABLE;482475 }476476+477477+#ifdef CONFIG_ARM_LPAE478478+ /*479479+ * Do not generate access flag faults for the kernel mappings.480480+ */481481+ for (i = 0; i < ARRAY_SIZE(mem_types); i++) {482482+ mem_types[i].prot_pte |= PTE_EXT_AF;483483+ mem_types[i].prot_sect |= PMD_SECT_AF;484484+ }485485+ kern_pgprot |= PTE_EXT_AF;486486+ vecs_pgprot |= PTE_EXT_AF;487487+#endif483488484489 for (i = 0; i < 16; i++) {485490 unsigned long v = pgprot_val(protection_map[i]);···548529549530#define vectors_base() (vectors_high() ? 0xffff0000 : 0)550531551551-static void __init *early_alloc(unsigned long sz)532532+static void __init *early_alloc_aligned(unsigned long sz, unsigned long align)552533{553553- void *ptr = __va(memblock_alloc(sz, sz));534534+ void *ptr = __va(memblock_alloc(sz, align));554535 memset(ptr, 0, sz);555536 return ptr;537537+}538538+539539+static void __init *early_alloc(unsigned long sz)540540+{541541+ return early_alloc_aligned(sz, sz);556542}557543558544static pte_t * __init early_pte_alloc(pmd_t *pmd, unsigned long addr, unsigned long prot)···596572 if (((addr | end | phys) & ~SECTION_MASK) == 0) {597573 pmd_t *p = pmd;598574575575+#ifndef CONFIG_ARM_LPAE599576 if (addr & SECTION_SIZE)600577 pmd++;578578+#endif601579602580 do {603581 *pmd = __pmd(phys | type->prot_sect);···629603 } while (pud++, addr = next, addr != end);630604}631605606606+#ifndef CONFIG_ARM_LPAE632607static void __init create_36bit_mapping(struct map_desc *md,633608 const struct mem_type *type)634609{···689662 pgd += SUPERSECTION_SIZE >> PGDIR_SHIFT;690663 } while (addr != end);691664}665665+#endif /* !CONFIG_ARM_LPAE */692666693667/*694668 * Create the page directory entries and any necessary···713685 }714686715687 if ((md->type == MT_DEVICE || md->type == MT_ROM) &&716716- md->virtual >= PAGE_OFFSET && md->virtual < VMALLOC_END) {688688+ md->virtual >= PAGE_OFFSET &&689689+ (md->virtual < VMALLOC_START || md->virtual >= VMALLOC_END)) {717690 printk(KERN_WARNING "BUG: mapping for 0x%08llx"718718- " at 0x%08lx overlaps vmalloc space\n",691691+ " at 0x%08lx out of vmalloc space\n",719692 (long long)__pfn_to_phys((u64)md->pfn), md->virtual);720693 }721694722695 type = &mem_types[md->type];723696697697+#ifndef CONFIG_ARM_LPAE724698 /*725699 * Catch 36-bit addresses726700 */···730700 create_36bit_mapping(md, type);731701 return;732702 }703703+#endif733704734705 addr = md->virtual & PAGE_MASK;735706 phys = __pfn_to_phys(md->pfn);···760729 */761730void __init iotable_init(struct map_desc *io_desc, int nr)762731{763763- int i;732732+ struct map_desc *md;733733+ struct vm_struct *vm;764734765765- for (i = 0; i < nr; i++)766766- create_mapping(io_desc + i);735735+ if (!nr)736736+ return;737737+738738+ vm = early_alloc_aligned(sizeof(*vm) * nr, __alignof__(*vm));739739+740740+ for (md = io_desc; nr; md++, nr--) {741741+ create_mapping(md);742742+ vm->addr = (void *)(md->virtual & PAGE_MASK);743743+ vm->size = PAGE_ALIGN(md->length + (md->virtual & ~PAGE_MASK));744744+ vm->phys_addr = __pfn_to_phys(md->pfn); 745745+ vm->flags = VM_IOREMAP | VM_ARM_STATIC_MAPPING; 746746+ vm->flags |= VM_ARM_MTYPE(md->type);747747+ vm->caller = iotable_init;748748+ vm_area_add_early(vm++);749749+ }767750}768751769769-static void * __initdata vmalloc_min = (void *)(VMALLOC_END - SZ_128M);752752+static void * __initdata vmalloc_min =753753+ (void *)(VMALLOC_END - (240 << 20) - VMALLOC_OFFSET);770754771755/*772756 * vmalloc=size forces the vmalloc area to be exactly 'size'773757 * bytes. This can be used to increase (or decrease) the vmalloc774774- * area - the default is 128m.758758+ * area - the default is 240m.775759 */776760static int __init early_vmalloc(char *arg)777761{···821775 struct membank *bank = &meminfo.bank[j];822776 *bank = meminfo.bank[i];823777778778+ if (bank->start > ULONG_MAX)779779+ highmem = 1;780780+824781#ifdef CONFIG_HIGHMEM825782 if (__va(bank->start) >= vmalloc_min ||826783 __va(bank->start) < (void *)PAGE_OFFSET)···835786 * Split those memory banks which are partially overlapping836787 * the vmalloc area greatly simplifying things later.837788 */838838- if (__va(bank->start) < vmalloc_min &&789789+ if (!highmem && __va(bank->start) < vmalloc_min &&839790 bank->size > vmalloc_min - __va(bank->start)) {840791 if (meminfo.nr_banks >= NR_BANKS) {841792 printk(KERN_CRIT "NR_BANKS too low, "···854805 }855806#else856807 bank->highmem = highmem;808808+809809+ /*810810+ * Highmem banks not allowed with !CONFIG_HIGHMEM.811811+ */812812+ if (highmem) {813813+ printk(KERN_NOTICE "Ignoring RAM at %.8llx-%.8llx "814814+ "(!CONFIG_HIGHMEM).\n",815815+ (unsigned long long)bank->start,816816+ (unsigned long long)bank->start + bank->size - 1);817817+ continue;818818+ }857819858820 /*859821 * Check whether this memory bank would entirely overlap···920860 }921861#endif922862 meminfo.nr_banks = j;863863+ high_memory = __va(lowmem_limit - 1) + 1;923864 memblock_set_current_limit(lowmem_limit);924865}925866···951890952891 /*953892 * Clear out all the kernel space mappings, except for the first954954- * memory bank, up to the end of the vmalloc region.893893+ * memory bank, up to the vmalloc region.955894 */956895 for (addr = __phys_to_virt(end);957957- addr < VMALLOC_END; addr += PMD_SIZE)896896+ addr < VMALLOC_START; addr += PMD_SIZE)958897 pmd_clear(pmd_off_k(addr));959898}960899900900+#ifdef CONFIG_ARM_LPAE901901+/* the first page is reserved for pgd */902902+#define SWAPPER_PG_DIR_SIZE (PAGE_SIZE + \903903+ PTRS_PER_PGD * PTRS_PER_PMD * sizeof(pmd_t))904904+#else961905#define SWAPPER_PG_DIR_SIZE (PTRS_PER_PGD * sizeof(pgd_t))906906+#endif962907963908/*964909 * Reserve the special regions of memory···987920}988921989922/*990990- * Set up device the mappings. Since we clear out the page tables for all991991- * mappings above VMALLOC_END, we will remove any debug device mappings.923923+ * Set up the device mappings. Since we clear out the page tables for all924924+ * mappings above VMALLOC_START, we will remove any debug device mappings.992925 * This means you have to be careful how you debug this function, or any993926 * called function. This means you can't use any function or debugging994927 * method which may touch any device, otherwise the kernel _will_ crash.···1003936 */1004937 vectors_page = early_alloc(PAGE_SIZE);100593810061006- for (addr = VMALLOC_END; addr; addr += PMD_SIZE)939939+ for (addr = VMALLOC_START; addr; addr += PMD_SIZE)1007940 pmd_clear(pmd_off_k(addr));10089411009942 /*
+3-1
arch/arm/mm/nommu.c
···29293030void __init sanity_check_meminfo(void)3131{3232+ phys_addr_t end = bank_phys_end(&meminfo.bank[meminfo.nr_banks - 1]);3333+ high_memory = __va(end - 1) + 1;3234}33353436/*···4543/*4644 * We don't need to do anything here for nommu machines.4745 */4848-void setup_mm_for_reboot(char mode)4646+void setup_mm_for_reboot(void)4947{5048}5149
+47-4
arch/arm/mm/pgd.c
···1010#include <linux/mm.h>1111#include <linux/gfp.h>1212#include <linux/highmem.h>1313+#include <linux/slab.h>13141415#include <asm/pgalloc.h>1516#include <asm/page.h>1617#include <asm/tlbflush.h>17181819#include "mm.h"2020+2121+#ifdef CONFIG_ARM_LPAE2222+#define __pgd_alloc() kmalloc(PTRS_PER_PGD * sizeof(pgd_t), GFP_KERNEL)2323+#define __pgd_free(pgd) kfree(pgd)2424+#else2525+#define __pgd_alloc() (pgd_t *)__get_free_pages(GFP_KERNEL, 2)2626+#define __pgd_free(pgd) free_pages((unsigned long)pgd, 2)2727+#endif19282029/*2130 * need to get a 16k page for level 1···3627 pmd_t *new_pmd, *init_pmd;3728 pte_t *new_pte, *init_pte;38293939- new_pgd = (pgd_t *)__get_free_pages(GFP_KERNEL, 2);3030+ new_pgd = __pgd_alloc();4031 if (!new_pgd)4132 goto no_pgd;4233···51425243 clean_dcache_area(new_pgd, PTRS_PER_PGD * sizeof(pgd_t));53444545+#ifdef CONFIG_ARM_LPAE4646+ /*4747+ * Allocate PMD table for modules and pkmap mappings.4848+ */4949+ new_pud = pud_alloc(mm, new_pgd + pgd_index(MODULES_VADDR),5050+ MODULES_VADDR);5151+ if (!new_pud)5252+ goto no_pud;5353+5454+ new_pmd = pmd_alloc(mm, new_pud, 0);5555+ if (!new_pmd)5656+ goto no_pmd;5757+#endif5858+5459 if (!vectors_high()) {5560 /*5661 * On ARM, first page must always be allocated since it5757- * contains the machine vectors.6262+ * contains the machine vectors. The vectors are always high6363+ * with LPAE.5864 */5965 new_pud = pud_alloc(mm, new_pgd, 0);6066 if (!new_pud)···9874no_pmd:9975 pud_free(mm, new_pud);10076no_pud:101101- free_pages((unsigned long)new_pgd, 2);7777+ __pgd_free(new_pgd);10278no_pgd:10379 return NULL;10480}···135111 pgd_clear(pgd);136112 pud_free(mm, pud);137113no_pgd:138138- free_pages((unsigned long) pgd_base, 2);114114+#ifdef CONFIG_ARM_LPAE115115+ /*116116+ * Free modules/pkmap or identity pmd tables.117117+ */118118+ for (pgd = pgd_base; pgd < pgd_base + PTRS_PER_PGD; pgd++) {119119+ if (pgd_none_or_clear_bad(pgd))120120+ continue;121121+ if (pgd_val(*pgd) & L_PGD_SWAPPER)122122+ continue;123123+ pud = pud_offset(pgd, 0);124124+ if (pud_none_or_clear_bad(pud))125125+ continue;126126+ pmd = pmd_offset(pud, 0);127127+ pud_clear(pud);128128+ pmd_free(mm, pmd);129129+ pgd_clear(pgd);130130+ pud_free(mm, pud);131131+ }132132+#endif133133+ __pgd_free(pgd_base);139134}
···4545 * Params : loc(r0) address to jump to4646 * Purpose : Sets up everything for a reset and jump to the location for soft reset.4747 */4848+ .pushsection .idmap.text, "ax"4849ENTRY(cpu_arm7tdmi_reset)4950 mov pc, r05151+ENDPROC(cpu_arm7tdmi_reset)5252+ .popsection50535154 __CPUINIT5255
···4848 * Params : r0 = address to jump to4949 * Notes : This sets up everything for a reset5050 */5151+ .pushsection .idmap.text, "ax"5152ENTRY(cpu_arm940_reset)5253 mov ip, #05354 mcr p15, 0, ip, c7, c5, 0 @ flush I cache···5958 bic ip, ip, #0x00001000 @ i-cache6059 mcr p15, 0, ip, c1, c0, 0 @ ctrl register6160 mov pc, r06161+ENDPROC(cpu_arm940_reset)6262+ .popsection62636364/*6465 * cpu_arm940_do_idle()
+3
arch/arm/mm/proc-arm946.S
···5555 * Params : r0 = address to jump to5656 * Notes : This sets up everything for a reset5757 */5858+ .pushsection .idmap.text, "ax"5859ENTRY(cpu_arm946_reset)5960 mov ip, #06061 mcr p15, 0, ip, c7, c5, 0 @ flush I cache···6665 bic ip, ip, #0x00001000 @ i-cache6766 mcr p15, 0, ip, c1, c0, 0 @ ctrl register6867 mov pc, r06868+ENDPROC(cpu_arm946_reset)6969+ .popsection69707071/*7172 * cpu_arm946_do_idle()
+3
arch/arm/mm/proc-arm9tdmi.S
···4545 * Params : loc(r0) address to jump to4646 * Purpose : Sets up everything for a reset and jump to the location for soft reset.4747 */4848+ .pushsection .idmap.text, "ax"4849ENTRY(cpu_arm9tdmi_reset)4950 mov pc, r05151+ENDPROC(cpu_arm9tdmi_reset)5252+ .popsection50535154 __CPUINIT5255
+3
arch/arm/mm/proc-fa526.S
···5757 * loc: location to jump to for soft reset5858 */5959 .align 46060+ .pushsection .idmap.text, "ax"6061ENTRY(cpu_fa526_reset)6162/* TODO: Use CP8 if possible... */6263 mov ip, #0···7473 nop7574 nop7675 mov pc, r07676+ENDPROC(cpu_fa526_reset)7777+ .popsection77787879/*7980 * cpu_fa526_do_idle()
···11-/*22- * iop3xx custom ioremap implementation33- * Copyright (c) 2006, Intel Corporation.44- *55- * This program is free software; you can redistribute it and/or modify it66- * under the terms and conditions of the GNU General Public License,77- * version 2, as published by the Free Software Foundation.88- *99- * This program is distributed in the hope it will be useful, but WITHOUT1010- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or1111- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for1212- * more details.1313- *1414- * You should have received a copy of the GNU General Public License along with1515- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple1616- * Place - Suite 330, Boston, MA 02111-1307 USA.1717- *1818- */1919-#include <linux/kernel.h>2020-#include <linux/module.h>2121-#include <linux/io.h>2222-#include <mach/hardware.h>2323-2424-void * __iomem __iop3xx_ioremap(unsigned long cookie, size_t size,2525- unsigned int mtype)2626-{2727- void __iomem * retval;2828-2929- switch (cookie) {3030- case IOP3XX_PCI_LOWER_IO_PA ... IOP3XX_PCI_UPPER_IO_PA:3131- retval = (void *) IOP3XX_PCI_IO_PHYS_TO_VIRT(cookie);3232- break;3333- case IOP3XX_PERIPHERAL_PHYS_BASE ... IOP3XX_PERIPHERAL_UPPER_PA:3434- retval = (void *) IOP3XX_PMMR_PHYS_TO_VIRT(cookie);3535- break;3636- default:3737- retval = __arm_ioremap_caller(cookie, size, mtype,3838- __builtin_return_address(0));3939- }4040-4141- return retval;4242-}4343-EXPORT_SYMBOL(__iop3xx_ioremap);4444-4545-void __iop3xx_iounmap(void __iomem *addr)4646-{4747- extern void __iounmap(volatile void __iomem *addr);4848-4949- switch ((u32) addr) {5050- case IOP3XX_PCI_LOWER_IO_VA ... IOP3XX_PCI_UPPER_IO_VA:5151- case IOP3XX_PERIPHERAL_VIRT_BASE ... IOP3XX_PERIPHERAL_UPPER_VA:5252- goto skip;5353- }5454- __iounmap(addr);5555-5656-skip:5757- return;5858-}5959-EXPORT_SYMBOL(__iop3xx_iounmap);
···2020 bool "i.MX3, i.MX6"2121 select AUTO_ZRELADDR if !ZBOOT_ROM2222 select ARM_PATCH_PHYS_VIRT2323+ select MIGHT_HAVE_CACHE_L2X02324 help2425 This enables support for systems based on the Freescale i.MX3 and i.MX62526 family.
···11-/*22- * Copyright 2011 Freescale Semiconductor, Inc.33- * Copyright 2011 Linaro Ltd.44- *55- * The code contained herein is licensed under the GNU General Public66- * License. You may obtain a copy of the GNU General Public License77- * Version 2 or later at the following locations:88- *99- * http://www.opensource.org/licenses/gpl-license.html1010- * http://www.gnu.org/copyleft/gpl.html1111- */1212-1313-#include <linux/io.h>1414-#include <asm/exception.h>1515-#include <asm/localtimer.h>1616-#include <asm/hardware/gic.h>1717-#ifdef CONFIG_SMP1818-#include <asm/smp.h>1919-#endif2020-2121-asmlinkage void __exception_irq_entry gic_handle_irq(struct pt_regs *regs)2222-{2323- u32 irqstat, irqnr;2424-2525- do {2626- irqstat = readl_relaxed(gic_cpu_base_addr + GIC_CPU_INTACK);2727- irqnr = irqstat & 0x3ff;2828- if (irqnr == 1023)2929- break;3030-3131- if (irqnr > 15 && irqnr < 1021)3232- handle_IRQ(irqnr, regs);3333-#ifdef CONFIG_SMP3434- else {3535- writel_relaxed(irqstat, gic_cpu_base_addr +3636- GIC_CPU_EOI);3737- handle_IPI(irqnr, regs);3838- }3939-#endif4040- } while (1);4141-}
···11-/*22- * Copyright (C) 2000 Russell King.33- * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.44- *55- * This program is free software; you can redistribute it and/or modify66- * it under the terms of the GNU General Public License as published by77- * the Free Software Foundation; either version 2 of the License, or88- * (at your option) any later version.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-1616-#ifndef __ASM_ARCH_MXC_VMALLOC_H__1717-#define __ASM_ARCH_MXC_VMALLOC_H__1818-1919-/* vmalloc ending address */2020-#define VMALLOC_END 0xf4000000UL2121-2222-#endif /* __ASM_ARCH_MXC_VMALLOC_H__ */
+1-1
arch/arm/plat-mxc/system.c
···7171 mdelay(50);72727373 /* we'll take a jump through zero as a poor second */7474- cpu_reset(0);7474+ soft_restart(0);7575}76767777void mxc_arch_reset_init(void __iomem *base)
···1717#include <linux/clk.h>1818#include <linux/err.h>1919#include <linux/io.h>2020-#include <linux/sched.h>2120#include <linux/clocksource.h>22212322#include <asm/sched_clock.h>···36373738#define OMAP16XX_TIMER_32K_SYNCHRONIZED 0xfffbc41038393939-/*4040- * Returns current time from boot in nsecs. It's OK for this to wrap4141- * around for now, as it's just a relative time stamp.4242- */4343-static DEFINE_CLOCK_DATA(cd);4444-4545-/*4646- * Constants generated by clocks_calc_mult_shift(m, s, 32768, NSEC_PER_SEC, 60).4747- * This gives a resolution of about 30us and a wrap period of about 36hrs.4848- */4949-#define SC_MULT 4000000000u5050-#define SC_SHIFT 175151-5252-static inline unsigned long long notrace _omap_32k_sched_clock(void)4040+static u32 notrace omap_32k_read_sched_clock(void)5341{5454- u32 cyc = timer_32k_base ? __raw_readl(timer_32k_base) : 0;5555- return cyc_to_fixed_sched_clock(&cd, cyc, (u32)~0, SC_MULT, SC_SHIFT);5656-}5757-5858-#if defined(CONFIG_OMAP_32K_TIMER) && !defined(CONFIG_OMAP_MPU_TIMER)5959-unsigned long long notrace sched_clock(void)6060-{6161- return _omap_32k_sched_clock();6262-}6363-#else6464-unsigned long long notrace omap_32k_sched_clock(void)6565-{6666- return _omap_32k_sched_clock();6767-}6868-#endif6969-7070-static void notrace omap_update_sched_clock(void)7171-{7272- u32 cyc = timer_32k_base ? __raw_readl(timer_32k_base) : 0;7373- update_sched_clock(&cd, cyc, (u32)~0);4242+ return timer_32k_base ? __raw_readl(timer_32k_base) : 0;7443}75447645/**···114147 clocksource_mmio_readl_up))115148 printk(err, "32k_counter");116149117117- init_fixed_sched_clock(&cd, omap_update_sched_clock, 32,118118- 32768, SC_MULT, SC_SHIFT);150150+ setup_sched_clock(omap_32k_read_sched_clock, 32, 32768);119151 }120152 return 0;121153}
-83
arch/arm/plat-omap/include/plat/common.h
···2727#ifndef __ARCH_ARM_MACH_OMAP_COMMON_H2828#define __ARCH_ARM_MACH_OMAP_COMMON_H29293030-#include <linux/delay.h>3131-3230#include <plat/i2c.h>3331#include <plat/omap_hwmod.h>34323535-struct sys_timer;3636-3737-extern void omap_map_common_io(void);3838-extern struct sys_timer omap1_timer;3939-extern struct sys_timer omap2_timer;4040-extern struct sys_timer omap3_timer;4141-extern struct sys_timer omap3_secure_timer;4242-extern struct sys_timer omap4_timer;4343-extern bool omap_32k_timer_init(void);4433extern int __init omap_init_clocksource_32k(void);4545-extern unsigned long long notrace omap_32k_sched_clock(void);46344735extern void omap_reserve(void);4848-4949-void omap2420_init_early(void);5050-void omap2430_init_early(void);5151-void omap3430_init_early(void);5252-void omap35xx_init_early(void);5353-void omap3630_init_early(void);5454-void omap3_init_early(void); /* Do not use this one */5555-void am35xx_init_early(void);5656-void ti816x_init_early(void);5757-void omap4430_init_early(void);5858-5936extern int omap_dss_reset(struct omap_hwmod *);60376138void omap_sram_init(void);6262-6363-/*6464- * IO bases for various OMAP processors6565- * Except the tap base, rest all the io bases6666- * listed are physical addresses.6767- */6868-struct omap_globals {6969- u32 class; /* OMAP class to detect */7070- void __iomem *tap; /* Control module ID code */7171- void __iomem *sdrc; /* SDRAM Controller */7272- void __iomem *sms; /* SDRAM Memory Scheduler */7373- void __iomem *ctrl; /* System Control Module */7474- void __iomem *ctrl_pad; /* PAD Control Module */7575- void __iomem *prm; /* Power and Reset Management */7676- void __iomem *cm; /* Clock Management */7777- void __iomem *cm2;7878-};7979-8080-void omap2_set_globals_242x(void);8181-void omap2_set_globals_243x(void);8282-void omap2_set_globals_3xxx(void);8383-void omap2_set_globals_443x(void);8484-void omap2_set_globals_ti816x(void);8585-8686-/* These get called from omap2_set_globals_xxxx(), do not call these */8787-void omap2_set_globals_tap(struct omap_globals *);8888-void omap2_set_globals_sdrc(struct omap_globals *);8989-void omap2_set_globals_control(struct omap_globals *);9090-void omap2_set_globals_prcm(struct omap_globals *);9191-9292-void omap242x_map_io(void);9393-void omap243x_map_io(void);9494-void omap3_map_io(void);9595-void omap4_map_io(void);9696-9797-9898-/**9999- * omap_test_timeout - busy-loop, testing a condition100100- * @cond: condition to test until it evaluates to true101101- * @timeout: maximum number of microseconds in the timeout102102- * @index: loop index (integer)103103- *104104- * Loop waiting for @cond to become true or until at least @timeout105105- * microseconds have passed. To use, define some integer @index in the106106- * calling code. After running, if @index == @timeout, then the loop has107107- * timed out.108108- */109109-#define omap_test_timeout(cond, timeout, index) \110110-({ \111111- for (index = 0; index < timeout; index++) { \112112- if (cond) \113113- break; \114114- udelay(1); \115115- } \116116-})117117-118118-extern struct device *omap2_get_mpuss_device(void);119119-extern struct device *omap2_get_iva_device(void);120120-extern struct device *omap2_get_l3_device(void);121121-extern struct device *omap4_get_dsp_device(void);1223912340#endif /* __ARCH_ARM_MACH_OMAP_COMMON_H */
···11-/*22- * Common io.c file33- * This file is created by Russell King <rmk+kernel@arm.linux.org.uk>44- *55- * Copyright (C) 2009 Texas Instruments66- * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com>77- *88- * This program is free software; you can redistribute it and/or modify99- * it under the terms of the GNU General Public License version 2 as1010- * published by the Free Software Foundation.1111- */1212-#include <linux/module.h>1313-#include <linux/io.h>1414-#include <linux/mm.h>1515-#include <linux/dma-mapping.h>1616-1717-#include <plat/omap7xx.h>1818-#include <plat/omap1510.h>1919-#include <plat/omap16xx.h>2020-#include <plat/omap24xx.h>2121-#include <plat/omap34xx.h>2222-#include <plat/omap44xx.h>2323-2424-#define BETWEEN(p,st,sz) ((p) >= (st) && (p) < ((st) + (sz)))2525-#define XLATE(p,pst,vst) ((void __iomem *)((p) - (pst) + (vst)))2626-2727-static int initialized;2828-2929-/*3030- * Intercept ioremap() requests for addresses in our fixed mapping regions.3131- */3232-void __iomem *omap_ioremap(unsigned long p, size_t size, unsigned int type)3333-{3434-3535- WARN(!initialized, "Do not use ioremap before init_early\n");3636-3737-#ifdef CONFIG_ARCH_OMAP13838- if (cpu_class_is_omap1()) {3939- if (BETWEEN(p, OMAP1_IO_PHYS, OMAP1_IO_SIZE))4040- return XLATE(p, OMAP1_IO_PHYS, OMAP1_IO_VIRT);4141- }4242- if (cpu_is_omap7xx()) {4343- if (BETWEEN(p, OMAP7XX_DSP_BASE, OMAP7XX_DSP_SIZE))4444- return XLATE(p, OMAP7XX_DSP_BASE, OMAP7XX_DSP_START);4545-4646- if (BETWEEN(p, OMAP7XX_DSPREG_BASE, OMAP7XX_DSPREG_SIZE))4747- return XLATE(p, OMAP7XX_DSPREG_BASE,4848- OMAP7XX_DSPREG_START);4949- }5050- if (cpu_is_omap15xx()) {5151- if (BETWEEN(p, OMAP1510_DSP_BASE, OMAP1510_DSP_SIZE))5252- return XLATE(p, OMAP1510_DSP_BASE, OMAP1510_DSP_START);5353-5454- if (BETWEEN(p, OMAP1510_DSPREG_BASE, OMAP1510_DSPREG_SIZE))5555- return XLATE(p, OMAP1510_DSPREG_BASE,5656- OMAP1510_DSPREG_START);5757- }5858- if (cpu_is_omap16xx()) {5959- if (BETWEEN(p, OMAP16XX_DSP_BASE, OMAP16XX_DSP_SIZE))6060- return XLATE(p, OMAP16XX_DSP_BASE, OMAP16XX_DSP_START);6161-6262- if (BETWEEN(p, OMAP16XX_DSPREG_BASE, OMAP16XX_DSPREG_SIZE))6363- return XLATE(p, OMAP16XX_DSPREG_BASE,6464- OMAP16XX_DSPREG_START);6565- }6666-#endif6767-#ifdef CONFIG_ARCH_OMAP26868- if (cpu_is_omap24xx()) {6969- if (BETWEEN(p, L3_24XX_PHYS, L3_24XX_SIZE))7070- return XLATE(p, L3_24XX_PHYS, L3_24XX_VIRT);7171- if (BETWEEN(p, L4_24XX_PHYS, L4_24XX_SIZE))7272- return XLATE(p, L4_24XX_PHYS, L4_24XX_VIRT);7373- }7474- if (cpu_is_omap2420()) {7575- if (BETWEEN(p, DSP_MEM_2420_PHYS, DSP_MEM_2420_SIZE))7676- return XLATE(p, DSP_MEM_2420_PHYS, DSP_MEM_2420_VIRT);7777- if (BETWEEN(p, DSP_IPI_2420_PHYS, DSP_IPI_2420_SIZE))7878- return XLATE(p, DSP_IPI_2420_PHYS, DSP_IPI_2420_SIZE);7979- if (BETWEEN(p, DSP_MMU_2420_PHYS, DSP_MMU_2420_SIZE))8080- return XLATE(p, DSP_MMU_2420_PHYS, DSP_MMU_2420_VIRT);8181- }8282- if (cpu_is_omap2430()) {8383- if (BETWEEN(p, L4_WK_243X_PHYS, L4_WK_243X_SIZE))8484- return XLATE(p, L4_WK_243X_PHYS, L4_WK_243X_VIRT);8585- if (BETWEEN(p, OMAP243X_GPMC_PHYS, OMAP243X_GPMC_SIZE))8686- return XLATE(p, OMAP243X_GPMC_PHYS, OMAP243X_GPMC_VIRT);8787- if (BETWEEN(p, OMAP243X_SDRC_PHYS, OMAP243X_SDRC_SIZE))8888- return XLATE(p, OMAP243X_SDRC_PHYS, OMAP243X_SDRC_VIRT);8989- if (BETWEEN(p, OMAP243X_SMS_PHYS, OMAP243X_SMS_SIZE))9090- return XLATE(p, OMAP243X_SMS_PHYS, OMAP243X_SMS_VIRT);9191- }9292-#endif9393-#ifdef CONFIG_ARCH_OMAP39494- if (cpu_is_ti816x()) {9595- if (BETWEEN(p, L4_34XX_PHYS, L4_34XX_SIZE))9696- return XLATE(p, L4_34XX_PHYS, L4_34XX_VIRT);9797- } else if (cpu_is_omap34xx()) {9898- if (BETWEEN(p, L3_34XX_PHYS, L3_34XX_SIZE))9999- return XLATE(p, L3_34XX_PHYS, L3_34XX_VIRT);100100- if (BETWEEN(p, L4_34XX_PHYS, L4_34XX_SIZE))101101- return XLATE(p, L4_34XX_PHYS, L4_34XX_VIRT);102102- if (BETWEEN(p, OMAP34XX_GPMC_PHYS, OMAP34XX_GPMC_SIZE))103103- return XLATE(p, OMAP34XX_GPMC_PHYS, OMAP34XX_GPMC_VIRT);104104- if (BETWEEN(p, OMAP343X_SMS_PHYS, OMAP343X_SMS_SIZE))105105- return XLATE(p, OMAP343X_SMS_PHYS, OMAP343X_SMS_VIRT);106106- if (BETWEEN(p, OMAP343X_SDRC_PHYS, OMAP343X_SDRC_SIZE))107107- return XLATE(p, OMAP343X_SDRC_PHYS, OMAP343X_SDRC_VIRT);108108- if (BETWEEN(p, L4_PER_34XX_PHYS, L4_PER_34XX_SIZE))109109- return XLATE(p, L4_PER_34XX_PHYS, L4_PER_34XX_VIRT);110110- if (BETWEEN(p, L4_EMU_34XX_PHYS, L4_EMU_34XX_SIZE))111111- return XLATE(p, L4_EMU_34XX_PHYS, L4_EMU_34XX_VIRT);112112- }113113-#endif114114-#ifdef CONFIG_ARCH_OMAP4115115- if (cpu_is_omap44xx()) {116116- if (BETWEEN(p, L3_44XX_PHYS, L3_44XX_SIZE))117117- return XLATE(p, L3_44XX_PHYS, L3_44XX_VIRT);118118- if (BETWEEN(p, L4_44XX_PHYS, L4_44XX_SIZE))119119- return XLATE(p, L4_44XX_PHYS, L4_44XX_VIRT);120120- if (BETWEEN(p, OMAP44XX_GPMC_PHYS, OMAP44XX_GPMC_SIZE))121121- return XLATE(p, OMAP44XX_GPMC_PHYS, OMAP44XX_GPMC_VIRT);122122- if (BETWEEN(p, OMAP44XX_EMIF1_PHYS, OMAP44XX_EMIF1_SIZE))123123- return XLATE(p, OMAP44XX_EMIF1_PHYS, \124124- OMAP44XX_EMIF1_VIRT);125125- if (BETWEEN(p, OMAP44XX_EMIF2_PHYS, OMAP44XX_EMIF2_SIZE))126126- return XLATE(p, OMAP44XX_EMIF2_PHYS, \127127- OMAP44XX_EMIF2_VIRT);128128- if (BETWEEN(p, OMAP44XX_DMM_PHYS, OMAP44XX_DMM_SIZE))129129- return XLATE(p, OMAP44XX_DMM_PHYS, OMAP44XX_DMM_VIRT);130130- if (BETWEEN(p, L4_PER_44XX_PHYS, L4_PER_44XX_SIZE))131131- return XLATE(p, L4_PER_44XX_PHYS, L4_PER_44XX_VIRT);132132- if (BETWEEN(p, L4_EMU_44XX_PHYS, L4_EMU_44XX_SIZE))133133- return XLATE(p, L4_EMU_44XX_PHYS, L4_EMU_44XX_VIRT);134134- }135135-#endif136136- return __arm_ioremap_caller(p, size, type, __builtin_return_address(0));137137-}138138-EXPORT_SYMBOL(omap_ioremap);139139-140140-void omap_iounmap(volatile void __iomem *addr)141141-{142142- unsigned long virt = (unsigned long)addr;143143-144144- if (virt >= VMALLOC_START && virt < VMALLOC_END)145145- __iounmap(addr);146146-}147147-EXPORT_SYMBOL(omap_iounmap);148148-149149-void __init omap_init_consistent_dma_size(void)150150-{151151-#ifdef CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE152152- init_consistent_dma_size(CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE << 20);153153-#endif154154-}155155-156156-void __init omap_ioremap_init(void)157157-{158158- initialized++;159159-}
+3-18
arch/arm/plat-orion/time.c
···1212 */13131414#include <linux/kernel.h>1515-#include <linux/sched.h>1615#include <linux/timer.h>1716#include <linux/clockchips.h>1817#include <linux/interrupt.h>···5960 * Orion's sched_clock implementation. It has a resolution of6061 * at least 7.5ns (133MHz TCLK).6162 */6262-static DEFINE_CLOCK_DATA(cd);63636464-unsigned long long notrace sched_clock(void)6464+static u32 notrace orion_read_sched_clock(void)6565{6666- u32 cyc = ~readl(timer_base + TIMER0_VAL_OFF);6767- return cyc_to_sched_clock(&cd, cyc, (u32)~0);6868-}6969-7070-7171-static void notrace orion_update_sched_clock(void)7272-{7373- u32 cyc = ~readl(timer_base + TIMER0_VAL_OFF);7474- update_sched_clock(&cd, cyc, (u32)~0);7575-}7676-7777-static void __init setup_sched_clock(unsigned long tclk)7878-{7979- init_sched_clock(&cd, orion_update_sched_clock, 32, tclk);6666+ return ~readl(timer_base + TIMER0_VAL_OFF);8067}81688269/*···202217 /*203218 * Set scale and timer for sched_clock.204219 */205205- setup_sched_clock(tclk);220220+ setup_sched_clock(orion_read_sched_clock, 32, tclk);206221207222 /*208223 * Setup free-running clocksource timer (interrupts
+1
arch/arm/plat-s5p/Kconfig
···1111 default y1212 select ARM_VIC if !ARCH_EXYNOS41313 select ARM_GIC if ARCH_EXYNOS41414+ select GIC_NON_BANKED if ARCH_EXYNOS41415 select NO_IOPORT1516 select ARCH_REQUIRE_GPIOLIB1617 select S3C_GPIO_TRACK
+3-16
arch/arm/plat-s5p/s5p-time.c
···1010 * published by the Free Software Foundation.1111*/12121313-#include <linux/sched.h>1413#include <linux/interrupt.h>1514#include <linux/irq.h>1615#include <linux/err.h>···320321 * this wraps around for now, since it is just a relative time321322 * stamp. (Inspired by U300 implementation.)322323 */323323-static DEFINE_CLOCK_DATA(cd);324324-325325-unsigned long long notrace sched_clock(void)324324+static u32 notrace s5p_read_sched_clock(void)326325{327326 void __iomem *reg = s5p_timer_reg();328327329328 if (!reg)330329 return 0;331330332332- return cyc_to_sched_clock(&cd, ~__raw_readl(reg), (u32)~0);333333-}334334-335335-static void notrace s5p_update_sched_clock(void)336336-{337337- void __iomem *reg = s5p_timer_reg();338338-339339- if (!reg)340340- return;341341-342342- update_sched_clock(&cd, ~__raw_readl(reg), (u32)~0);331331+ return ~__raw_readl(reg);343332}344333345334static void __init s5p_clocksource_init(void)···345358 s5p_time_setup(timer_source.source_id, TCNT_MAX);346359 s5p_time_start(timer_source.source_id, PERIODIC);347360348348- init_sched_clock(&cd, s5p_update_sched_clock, 32, clock_rate);361361+ setup_sched_clock(s5p_read_sched_clock, 32, clock_rate);349362350363 if (clocksource_mmio_init(s5p_timer_reg(), "s5p_clocksource_timer",351364 clock_rate, 250, 32, clocksource_mmio_readl_down))
+1-1
arch/arm/plat-spear/include/plat/system.h
···3131{3232 if (mode == 's') {3333 /* software reset, Jump into ROM at address 0 */3434- cpu_reset(0);3434+ soft_restart(0);3535 } else {3636 /* hardware reset, Use on-chip reset capability */3737 sysctl_soft_reset((void __iomem *)VA_SPEAR_SYS_CTRL_BASE);
-19
arch/arm/plat-spear/include/plat/vmalloc.h
···11-/*22- * arch/arm/plat-spear/include/plat/vmalloc.h33- *44- * Defining Vmalloc area for SPEAr platform55- *66- * Copyright (C) 2009 ST Microelectronics77- * Viresh Kumar<viresh.kumar@st.com>88- *99- * This file is licensed under the terms of the GNU General Public1010- * License version 2. This program is licensed "as is" without any1111- * warranty of any kind, whether express or implied.1212- */1313-1414-#ifndef __PLAT_VMALLOC_H1515-#define __PLAT_VMALLOC_H1616-1717-#define VMALLOC_END 0xF0000000UL1818-1919-#endif /* __PLAT_VMALLOC_H */
-10
arch/arm/plat-tcc/include/mach/vmalloc.h
···11-/*22- * Author: <linux@telechips.com>33- * Created: June 10, 200844- *55- * Copyright (C) 2000 Russell King.66- * Copyright (C) 2008-2009 Telechips77- *88- * Licensed under the terms of the GPL v2.99- */1010-#define VMALLOC_END 0xf0000000UL
+6-23
arch/arm/plat-versatile/sched-clock.c
···1818 * along with this program; if not, write to the Free Software1919 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA2020 */2121+#include <linux/kernel.h>2122#include <linux/io.h>2222-#include <linux/sched.h>23232424#include <asm/sched_clock.h>2525#include <plat/sched_clock.h>26262727-static DEFINE_CLOCK_DATA(cd);2827static void __iomem *ctr;29283030-/*3131- * Constants generated by clocks_calc_mult_shift(m, s, 24MHz, NSEC_PER_SEC, 60).3232- * This gives a resolution of about 41ns and a wrap period of about 178s.3333- */3434-#define SC_MULT 2796202667u3535-#define SC_SHIFT 263636-3737-unsigned long long notrace sched_clock(void)2929+static u32 notrace versatile_read_sched_clock(void)3830{3939- if (ctr) {4040- u32 cyc = readl(ctr);4141- return cyc_to_fixed_sched_clock(&cd, cyc, (u32)~0,4242- SC_MULT, SC_SHIFT);4343- } else4444- return 0;4545-}3131+ if (ctr)3232+ return readl(ctr);46334747-static void notrace versatile_update_sched_clock(void)4848-{4949- u32 cyc = readl(ctr);5050- update_sched_clock(&cd, cyc, (u32)~0);3434+ return 0;5135}52365337void __init versatile_sched_clock_init(void __iomem *reg, unsigned long rate)5438{5539 ctr = reg;5656- init_fixed_sched_clock(&cd, versatile_update_sched_clock,5757- 32, rate, SC_MULT, SC_SHIFT);4040+ setup_sched_clock(versatile_read_sched_clock, 32, rate);5841}
···11181118EXPORT_SYMBOL(vm_map_ram);1119111911201120/**11211121+ * vm_area_add_early - add vmap area early during boot11221122+ * @vm: vm_struct to add11231123+ *11241124+ * This function is used to add fixed kernel vm area to vmlist before11251125+ * vmalloc_init() is called. @vm->addr, @vm->size, and @vm->flags11261126+ * should contain proper values and the other fields should be zero.11271127+ *11281128+ * DO NOT USE THIS FUNCTION UNLESS YOU KNOW WHAT YOU'RE DOING.11291129+ */11301130+void __init vm_area_add_early(struct vm_struct *vm)11311131+{11321132+ struct vm_struct *tmp, **p;11331133+11341134+ BUG_ON(vmap_initialized);11351135+ for (p = &vmlist; (tmp = *p) != NULL; p = &tmp->next) {11361136+ if (tmp->addr >= vm->addr) {11371137+ BUG_ON(tmp->addr < vm->addr + vm->size);11381138+ break;11391139+ } else11401140+ BUG_ON(tmp->addr + tmp->size > vm->addr);11411141+ }11421142+ vm->next = *p;11431143+ *p = vm;11441144+}11451145+11461146+/**11211147 * vm_area_register_early - register vmap area early during boot11221148 * @vm: vm_struct to register11231149 * @align: requested alignment···1165113911661140 vm->addr = (void *)addr;1167114111681168- vm->next = vmlist;11691169- vmlist = vm;11421142+ vm_area_add_early(vm);11701143}1171114411721145void __init vmalloc_init(void)