···740741endmenu742743-if (ARCH_SA1100 || ARCH_INTEGRATOR || ARCH_OMAP)744745menu "CPU Frequency scaling"746···766 For details, take a look at <file:Documentation/cpu-freq>.767768 If in doubt, say Y.000000000769770endmenu771···953source "drivers/video/Kconfig"954955source "sound/Kconfig"00956957source "drivers/usb/Kconfig"958
···740741endmenu742743+if (ARCH_SA1100 || ARCH_INTEGRATOR || ARCH_OMAP || ARCH_IMX )744745menu "CPU Frequency scaling"746···766 For details, take a look at <file:Documentation/cpu-freq>.767768 If in doubt, say Y.769+770+config CPU_FREQ_IMX771+ tristate "CPUfreq driver for i.MX CPUs"772+ depends on ARCH_IMX && CPU_FREQ773+ default n774+ help775+ This enables the CPUfreq driver for i.MX CPUs.776+777+ If in doubt, say N.778779endmenu780···944source "drivers/video/Kconfig"945946source "sound/Kconfig"947+948+source "drivers/hid/Kconfig"949950source "drivers/usb/Kconfig"951
···22#include <asm/thread_info.h>23#include <asm/system.h>2425-#define KERNEL_RAM_ADDR (PAGE_OFFSET + TEXT_OFFSET)02627/*28 * swapper_pg_dir is the virtual address of the initial page table.29- * We place the page tables 16K below KERNEL_RAM_ADDR. Therefore, we must30- * make sure that KERNEL_RAM_ADDR is correctly set. Currently, we expect31 * the least significant 16 bits to be 0x8000, but we could probably32- * relax this restriction to KERNEL_RAM_ADDR >= PAGE_OFFSET + 0x4000.33 */34-#if (KERNEL_RAM_ADDR & 0xffff) != 0x800035-#error KERNEL_RAM_ADDR must start at 0xXXXX800036#endif3738 .globl swapper_pg_dir39- .equ swapper_pg_dir, KERNEL_RAM_ADDR - 0x40004041 .macro pgtbl, rd42- ldr \rd, =(__virt_to_phys(KERNEL_RAM_ADDR - 0x4000))43 .endm4445#ifdef CONFIG_XIP_KERNEL46#define TEXTADDR XIP_VIRT_ADDR(CONFIG_XIP_PHYS_ADDR)47#else48-#define TEXTADDR KERNEL_RAM_ADDR49#endif5051/*
···22#include <asm/thread_info.h>23#include <asm/system.h>2425+#define KERNEL_RAM_VADDR (PAGE_OFFSET + TEXT_OFFSET)26+#define KERNEL_RAM_PADDR (PHYS_OFFSET + TEXT_OFFSET)2728/*29 * swapper_pg_dir is the virtual address of the initial page table.30+ * We place the page tables 16K below KERNEL_RAM_VADDR. Therefore, we must31+ * make sure that KERNEL_RAM_VADDR is correctly set. Currently, we expect32 * the least significant 16 bits to be 0x8000, but we could probably33+ * relax this restriction to KERNEL_RAM_VADDR >= PAGE_OFFSET + 0x4000.34 */35+#if (KERNEL_RAM_VADDR & 0xffff) != 0x800036+#error KERNEL_RAM_VADDR must start at 0xXXXX800037#endif3839 .globl swapper_pg_dir40+ .equ swapper_pg_dir, KERNEL_RAM_VADDR - 0x40004142 .macro pgtbl, rd43+ ldr \rd, =(KERNEL_RAM_PADDR - 0x4000)44 .endm4546#ifdef CONFIG_XIP_KERNEL47#define TEXTADDR XIP_VIRT_ADDR(CONFIG_XIP_PHYS_ADDR)48#else49+#define TEXTADDR KERNEL_RAM_VADDR50#endif5152/*
···18#include <linux/signal.h>19#include <linux/errno.h>20#include <linux/sched.h>02122#include <asm/system.h>23#include <asm/hardware.h>···47 }48 RCNR = current_time;49 return 0;50-}51-52-/* IRQs are disabled before entering here from do_gettimeofday() */53-static unsigned long pxa_gettimeoffset (void)54-{55- long ticks_to_match, elapsed, usec;56-57- /* Get ticks before next timer match */58- ticks_to_match = OSMR0 - OSCR;59-60- /* We need elapsed ticks since last match */61- elapsed = LATCH - ticks_to_match;62-63- /* don't get fooled by the workaround in pxa_timer_interrupt() */64- if (elapsed <= 0)65- return 0;66-67- /* Now convert them to usec */68- usec = (unsigned long)(elapsed * (tick_nsec / 1000))/LATCH;69-70- return usec;71}7273#ifdef CONFIG_NO_IDLE_HZ···101 .handler = pxa_timer_interrupt,102};10300000000000000104static void __init pxa_timer_init(void)105{106 struct timespec tv;···133 OIER = OIER_E0; /* enable match on timer 0 to cause interrupts */134 OSMR0 = OSCR + LATCH; /* set initial match */135 local_irq_restore(flags);00000000136}137138#ifdef CONFIG_NO_IDLE_HZ···213 .init = pxa_timer_init,214 .suspend = pxa_timer_suspend,215 .resume = pxa_timer_resume,216- .offset = pxa_gettimeoffset,217#ifdef CONFIG_NO_IDLE_HZ218 .dyn_tick = &pxa_dyn_tick,219#endif
···18#include <linux/signal.h>19#include <linux/errno.h>20#include <linux/sched.h>21+#include <linux/clocksource.h>2223#include <asm/system.h>24#include <asm/hardware.h>···46 }47 RCNR = current_time;48 return 0;00000000000000000000049}5051#ifdef CONFIG_NO_IDLE_HZ···121 .handler = pxa_timer_interrupt,122};123124+cycle_t pxa_get_cycles(void)125+{126+ return OSCR;127+}128+129+static struct clocksource clocksource_pxa = {130+ .name = "pxa_timer",131+ .rating = 200,132+ .read = pxa_get_cycles,133+ .mask = CLOCKSOURCE_MASK(32),134+ .shift = 20,135+ .is_continuous = 1,136+};137+138static void __init pxa_timer_init(void)139{140 struct timespec tv;···139 OIER = OIER_E0; /* enable match on timer 0 to cause interrupts */140 OSMR0 = OSCR + LATCH; /* set initial match */141 local_irq_restore(flags);142+143+ /* on PXA OSCR runs continiously and is not written to, so we can use it144+ * as clock source directly.145+ */146+ clocksource_pxa.mult =147+ clocksource_hz2mult(CLOCK_TICK_RATE, clocksource_pxa.shift);148+ clocksource_register(&clocksource_pxa);149+150}151152#ifdef CONFIG_NO_IDLE_HZ···211 .init = pxa_timer_init,212 .suspend = pxa_timer_suspend,213 .resume = pxa_timer_resume,0214#ifdef CONFIG_NO_IDLE_HZ215 .dyn_tick = &pxa_dyn_tick,216#endif
···1/*2 * linux/arch/arm/mach-sa1100/jornada720.c3+ *4+ * HP Jornada720 init code5+ *6+ * Copyright (C) 2006 Filip Zyzniewski <filip.zyzniewski@tefnet.pl>7+ * Copyright (C) 2005 Michael Gernoth <michael@gernoth.net>8+ *9+ * This program is free software; you can redistribute it and/or modify10+ * it under the terms of the GNU General Public License version 2 as11+ * published by the Free Software Foundation.12+ *13 */1415#include <linux/init.h>···10#include <linux/ioport.h>11#include <linux/mtd/mtd.h>12#include <linux/mtd/partitions.h>13+#include <video/s1d13xxxfb.h>1415#include <asm/hardware.h>16#include <asm/hardware/sa1111.h>17#include <asm/irq.h>18#include <asm/mach-types.h>19#include <asm/setup.h>020#include <asm/mach/arch.h>21#include <asm/mach/flash.h>22#include <asm/mach/map.h>···2425#include "generic.h"2627+/*28+ * HP Documentation referred in this file:29+ * http://www.jlime.com/downloads/development/docs/jornada7xx/jornada720.txt30+ */3132+/* line 110 of HP's doc */33+#define TUCR_VAL 0x2000040034+35+/* memory space (line 52 of HP's doc) */36+#define SA1111REGSTART 0x4000000037+#define SA1111REGLEN 0x00001fff38+#define EPSONREGSTART 0x4800000039+#define EPSONREGLEN 0x0010000040+#define EPSONFBSTART 0x4820000041+/* 512kB framebuffer */42+#define EPSONFBLEN 512*102443+44+static struct s1d13xxxfb_regval s1d13xxxfb_initregs[] = {45+ /* line 344 of HP's doc */46+ {0x0001,0x00}, // Miscellaneous Register47+ {0x01FC,0x00}, // Display Mode Register48+ {0x0004,0x00}, // General IO Pins Configuration Register 049+ {0x0005,0x00}, // General IO Pins Configuration Register 150+ {0x0008,0x00}, // General IO Pins Control Register 051+ {0x0009,0x00}, // General IO Pins Control Register 152+ {0x0010,0x01}, // Memory Clock Configuration Register53+ {0x0014,0x11}, // LCD Pixel Clock Configuration Register54+ {0x0018,0x01}, // CRT/TV Pixel Clock Configuration Register55+ {0x001C,0x01}, // MediaPlug Clock Configuration Register56+ {0x001E,0x01}, // CPU To Memory Wait State Select Register57+ {0x0020,0x00}, // Memory Configuration Register58+ {0x0021,0x45}, // DRAM Refresh Rate Register59+ {0x002A,0x01}, // DRAM Timings Control Register 060+ {0x002B,0x03}, // DRAM Timings Control Register 161+ {0x0030,0x1c}, // Panel Type Register62+ {0x0031,0x00}, // MOD Rate Register63+ {0x0032,0x4F}, // LCD Horizontal Display Width Register64+ {0x0034,0x07}, // LCD Horizontal Non-Display Period Register65+ {0x0035,0x01}, // TFT FPLINE Start Position Register66+ {0x0036,0x0B}, // TFT FPLINE Pulse Width Register67+ {0x0038,0xEF}, // LCD Vertical Display Height Register 068+ {0x0039,0x00}, // LCD Vertical Display Height Register 169+ {0x003A,0x13}, // LCD Vertical Non-Display Period Register70+ {0x003B,0x0B}, // TFT FPFRAME Start Position Register71+ {0x003C,0x01}, // TFT FPFRAME Pulse Width Register72+ {0x0040,0x05}, // LCD Display Mode Register (2:4bpp,3:8bpp,5:16bpp)73+ {0x0041,0x00}, // LCD Miscellaneous Register74+ {0x0042,0x00}, // LCD Display Start Address Register 075+ {0x0043,0x00}, // LCD Display Start Address Register 176+ {0x0044,0x00}, // LCD Display Start Address Register 277+ {0x0046,0x80}, // LCD Memory Address Offset Register 078+ {0x0047,0x02}, // LCD Memory Address Offset Register 179+ {0x0048,0x00}, // LCD Pixel Panning Register80+ {0x004A,0x00}, // LCD Display FIFO High Threshold Control Register81+ {0x004B,0x00}, // LCD Display FIFO Low Threshold Control Register82+ {0x0050,0x4F}, // CRT/TV Horizontal Display Width Register83+ {0x0052,0x13}, // CRT/TV Horizontal Non-Display Period Register84+ {0x0053,0x01}, // CRT/TV HRTC Start Position Register85+ {0x0054,0x0B}, // CRT/TV HRTC Pulse Width Register86+ {0x0056,0xDF}, // CRT/TV Vertical Display Height Register 087+ {0x0057,0x01}, // CRT/TV Vertical Display Height Register 188+ {0x0058,0x2B}, // CRT/TV Vertical Non-Display Period Register89+ {0x0059,0x09}, // CRT/TV VRTC Start Position Register90+ {0x005A,0x01}, // CRT/TV VRTC Pulse Width Register91+ {0x005B,0x10}, // TV Output Control Register92+ {0x0060,0x03}, // CRT/TV Display Mode Register (2:4bpp,3:8bpp,5:16bpp)93+ {0x0062,0x00}, // CRT/TV Display Start Address Register 094+ {0x0063,0x00}, // CRT/TV Display Start Address Register 195+ {0x0064,0x00}, // CRT/TV Display Start Address Register 296+ {0x0066,0x40}, // CRT/TV Memory Address Offset Register 097+ {0x0067,0x01}, // CRT/TV Memory Address Offset Register 198+ {0x0068,0x00}, // CRT/TV Pixel Panning Register99+ {0x006A,0x00}, // CRT/TV Display FIFO High Threshold Control Register100+ {0x006B,0x00}, // CRT/TV Display FIFO Low Threshold Control Register101+ {0x0070,0x00}, // LCD Ink/Cursor Control Register102+ {0x0071,0x01}, // LCD Ink/Cursor Start Address Register103+ {0x0072,0x00}, // LCD Cursor X Position Register 0104+ {0x0073,0x00}, // LCD Cursor X Position Register 1105+ {0x0074,0x00}, // LCD Cursor Y Position Register 0106+ {0x0075,0x00}, // LCD Cursor Y Position Register 1107+ {0x0076,0x00}, // LCD Ink/Cursor Blue Color 0 Register108+ {0x0077,0x00}, // LCD Ink/Cursor Green Color 0 Register109+ {0x0078,0x00}, // LCD Ink/Cursor Red Color 0 Register110+ {0x007A,0x1F}, // LCD Ink/Cursor Blue Color 1 Register111+ {0x007B,0x3F}, // LCD Ink/Cursor Green Color 1 Register112+ {0x007C,0x1F}, // LCD Ink/Cursor Red Color 1 Register113+ {0x007E,0x00}, // LCD Ink/Cursor FIFO Threshold Register114+ {0x0080,0x00}, // CRT/TV Ink/Cursor Control Register115+ {0x0081,0x01}, // CRT/TV Ink/Cursor Start Address Register116+ {0x0082,0x00}, // CRT/TV Cursor X Position Register 0117+ {0x0083,0x00}, // CRT/TV Cursor X Position Register 1118+ {0x0084,0x00}, // CRT/TV Cursor Y Position Register 0119+ {0x0085,0x00}, // CRT/TV Cursor Y Position Register 1120+ {0x0086,0x00}, // CRT/TV Ink/Cursor Blue Color 0 Register121+ {0x0087,0x00}, // CRT/TV Ink/Cursor Green Color 0 Register122+ {0x0088,0x00}, // CRT/TV Ink/Cursor Red Color 0 Register123+ {0x008A,0x1F}, // CRT/TV Ink/Cursor Blue Color 1 Register124+ {0x008B,0x3F}, // CRT/TV Ink/Cursor Green Color 1 Register125+ {0x008C,0x1F}, // CRT/TV Ink/Cursor Red Color 1 Register126+ {0x008E,0x00}, // CRT/TV Ink/Cursor FIFO Threshold Register127+ {0x0100,0x00}, // BitBlt Control Register 0128+ {0x0101,0x00}, // BitBlt Control Register 1129+ {0x0102,0x00}, // BitBlt ROP Code/Color Expansion Register130+ {0x0103,0x00}, // BitBlt Operation Register131+ {0x0104,0x00}, // BitBlt Source Start Address Register 0132+ {0x0105,0x00}, // BitBlt Source Start Address Register 1133+ {0x0106,0x00}, // BitBlt Source Start Address Register 2134+ {0x0108,0x00}, // BitBlt Destination Start Address Register 0135+ {0x0109,0x00}, // BitBlt Destination Start Address Register 1136+ {0x010A,0x00}, // BitBlt Destination Start Address Register 2137+ {0x010C,0x00}, // BitBlt Memory Address Offset Register 0138+ {0x010D,0x00}, // BitBlt Memory Address Offset Register 1139+ {0x0110,0x00}, // BitBlt Width Register 0140+ {0x0111,0x00}, // BitBlt Width Register 1141+ {0x0112,0x00}, // BitBlt Height Register 0142+ {0x0113,0x00}, // BitBlt Height Register 1143+ {0x0114,0x00}, // BitBlt Background Color Register 0144+ {0x0115,0x00}, // BitBlt Background Color Register 1145+ {0x0118,0x00}, // BitBlt Foreground Color Register 0146+ {0x0119,0x00}, // BitBlt Foreground Color Register 1147+ {0x01E0,0x00}, // Look-Up Table Mode Register148+ {0x01E2,0x00}, // Look-Up Table Address Register149+ /* not sure, wouldn't like to mess with the driver */150+ {0x01E4,0x00}, // Look-Up Table Data Register151+ /* jornada doc says 0x00, but I trust the driver */152+ {0x01F0,0x10}, // Power Save Configuration Register153+ {0x01F1,0x00}, // Power Save Status Register154+ {0x01F4,0x00}, // CPU-to-Memory Access Watchdog Timer Register155+ {0x01FC,0x01}, // Display Mode Register(0x01:LCD, 0x02:CRT, 0x03:LCD&CRT)156+};157+158+static struct s1d13xxxfb_pdata s1d13xxxfb_data = {159+ .initregs = s1d13xxxfb_initregs,160+ .initregssize = ARRAY_SIZE(s1d13xxxfb_initregs),161+ .platform_init_video = NULL162+};163+164+static struct resource s1d13xxxfb_resources[] = {165+ [0] = {166+ .start = EPSONFBSTART,167+ .end = EPSONFBSTART + EPSONFBLEN,168+ .flags = IORESOURCE_MEM,169+ },170+ [1] = {171+ .start = EPSONREGSTART,172+ .end = EPSONREGSTART + EPSONREGLEN,173+ .flags = IORESOURCE_MEM,174+ }175+};176+177+static struct platform_device s1d13xxxfb_device = {178+ .name = S1D_DEVICENAME,179+ .id = 0,180+ .dev = {181+ .platform_data = &s1d13xxxfb_data,182+ },183+ .num_resources = ARRAY_SIZE(s1d13xxxfb_resources),184+ .resource = s1d13xxxfb_resources,185+};186187static struct resource sa1111_resources[] = {188 [0] = {189+ .start = SA1111REGSTART,190+ .end = SA1111REGSTART + SA1111REGLEN,191 .flags = IORESOURCE_MEM,192 },193 [1] = {···53 .resource = sa1111_resources,54};5556+static struct platform_device jornada720_mcu_device = {57+ .name = "jornada720_mcu",58+ .id = -1,59+};60+61static struct platform_device *devices[] __initdata = {62 &sa1111_device,63+ &jornada720_mcu_device,64+ &s1d13xxxfb_device,65};66+67+/* a stub for now, we theoretically cannot suspend without a flashboard */68+int pm_suspend(suspend_state_t state)69+{70+ return -1;71+}7273static int __init jornada720_init(void)74{···6364 if (machine_is_jornada720()) {65 GPDR |= GPIO_GPIO20;66+ /* oscillator setup (line 116 of HP's doc) */67+ TUCR = TUCR_VAL;68+ /* resetting SA1111 (line 118 of HP's doc) */69 GPSR = GPIO_GPIO20;70 udelay(1);71 GPCR = GPIO_GPIO20;72 udelay(1);73 GPSR = GPIO_GPIO20;74 udelay(20);00007576 ret = platform_add_devices(devices, ARRAY_SIZE(devices));77 }···8586static struct map_desc jornada720_io_desc[] __initdata = {87 { /* Epson registers */88+ .virtual = 0xf0000000,89+ .pfn = __phys_to_pfn(EPSONREGSTART),90+ .length = EPSONREGLEN,91 .type = MT_DEVICE92 }, { /* Epson frame buffer */93+ .virtual = 0xf1000000,94+ .pfn = __phys_to_pfn(EPSONFBSTART),95+ .length = EPSONFBLEN,96 .type = MT_DEVICE97 }, { /* SA-1111 */98+ .virtual = 0xf4000000,99+ .pfn = __phys_to_pfn(SA1111REGSTART),100+ .length = SA1111REGLEN,101 .type = MT_DEVICE102 }103};···106{107 sa1100_map_io();108 iotable_init(jornada720_io_desc, ARRAY_SIZE(jornada720_io_desc));109+110 sa1100_register_uart(0, 3);111 sa1100_register_uart(1, 1);112}···116 .name = "JORNADA720 boot firmware",117 .size = 0x00040000,118 .offset = 0,119+ .mask_flags = MTD_WRITEABLE, /* force read-only */120 }, {121 .name = "JORNADA720 kernel",122 .size = 0x000c0000,···139 .offset = 0x00540000,140 }, {141 .name = "JORNADA720 usr local",142+ .size = 0, /* will expand to the end of the flash */143 .offset = 0x00d00000,144 }145};···147static void jornada720_set_vpp(int vpp)148{149 if (vpp)150+ /* enabling flash write (line 470 of HP's doc) */151+ PPSR |= PPC_LDD7;152 else153+ /* disabling flash write (line 470 of HP's doc) */154+ PPSR &= ~PPC_LDD7;155+ PPDR |= PPC_LDD7;156}157158static struct flash_platform_data jornada720_flash_data = {
+1-1
arch/arm/mm/consistent.c
···238 * x86 does not mark the pages reserved...239 */240 SetPageReserved(page);241- set_pte(pte, mk_pte(page, prot));242 page++;243 pte++;244 off++;
···238 * x86 does not mark the pages reserved...239 */240 SetPageReserved(page);241+ set_pte_ext(pte, mk_pte(page, prot), 0);242 page++;243 pte++;244 off++;
···26 unsigned long to = ALIAS_FLUSH_START + (CACHE_COLOUR(vaddr) << PAGE_SHIFT);27 const int zero = 0;2829- set_pte(TOP_PTE(to), pfn_pte(pfn, PAGE_KERNEL));30 flush_tlb_kernel_page(to);3132 asm( "mcrr p15, 0, %1, %0, c14\n"
···26 unsigned long to = ALIAS_FLUSH_START + (CACHE_COLOUR(vaddr) << PAGE_SHIFT);27 const int zero = 0;2829+ set_pte_ext(TOP_PTE(to), pfn_pte(pfn, PAGE_KERNEL), 0);30 flush_tlb_kernel_page(to);3132 asm( "mcrr p15, 0, %1, %0, c14\n"
+41-59
arch/arm/mm/ioremap.c
···38 */39#define VM_ARM_SECTION_MAPPING 0x800000004041-static inline void42-remap_area_pte(pte_t * pte, unsigned long address, unsigned long size,43- unsigned long phys_addr, pgprot_t pgprot)44{45- unsigned long end;4647- address &= ~PMD_MASK;48- end = address + size;49- if (end > PMD_SIZE)50- end = PMD_SIZE;51- BUG_ON(address >= end);52 do {53 if (!pte_none(*pte))54 goto bad;5556- set_pte(pte, pfn_pte(phys_addr >> PAGE_SHIFT, pgprot));57- address += PAGE_SIZE;58 phys_addr += PAGE_SIZE;59- pte++;60- } while (address && (address < end));61- return;6263 bad:64- printk("remap_area_pte: page already exists\n");65 BUG();66}6768-static inline int69-remap_area_pmd(pmd_t * pmd, unsigned long address, unsigned long size,70- unsigned long phys_addr, unsigned long flags)71{72- unsigned long end;73- pgprot_t pgprot;07475- address &= ~PGDIR_MASK;76- end = address + size;07778- if (end > PGDIR_SIZE)79- end = PGDIR_SIZE;80-81- phys_addr -= address;82- BUG_ON(address >= end);83-84- pgprot = __pgprot(L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY | L_PTE_WRITE | flags);85 do {86- pte_t * pte = pte_alloc_kernel(pmd, address);87- if (!pte)88- return -ENOMEM;89- remap_area_pte(pte, address, end - address, address + phys_addr, pgprot);90- address = (address + PMD_SIZE) & PMD_MASK;91- pmd++;92- } while (address && (address < end));93- return 0;94}9596-static int97-remap_area_pages(unsigned long start, unsigned long pfn,98- unsigned long size, unsigned long flags)99{100- unsigned long address = start;101- unsigned long end = start + size;102 unsigned long phys_addr = __pfn_to_phys(pfn);000103 int err = 0;104- pgd_t * dir;105106- phys_addr -= address;107- dir = pgd_offset(&init_mm, address);108- BUG_ON(address >= end);109 do {110- pmd_t *pmd = pmd_alloc(&init_mm, dir, address);111- if (!pmd) {112- err = -ENOMEM;113 break;114- }115- if (remap_area_pmd(pmd, address, end - address,116- phys_addr + address, flags)) {117- err = -ENOMEM;118- break;119- }120-121- address = (address + PGDIR_SIZE) & PGDIR_MASK;122- dir++;123- } while (address && (address < end));124125 return err;126}
···38 */39#define VM_ARM_SECTION_MAPPING 0x800000004041+static int remap_area_pte(pmd_t *pmd, unsigned long addr, unsigned long end,42+ unsigned long phys_addr, pgprot_t prot)043{44+ pte_t *pte;4546+ pte = pte_alloc_kernel(pmd, addr);47+ if (!pte)48+ return -ENOMEM;49+050 do {51 if (!pte_none(*pte))52 goto bad;5354+ set_pte_ext(pte, pfn_pte(phys_addr >> PAGE_SHIFT, prot), 0);055 phys_addr += PAGE_SIZE;56+ } while (pte++, addr += PAGE_SIZE, addr != end);57+ return 0;05859 bad:60+ printk(KERN_CRIT "remap_area_pte: page already exists\n");61 BUG();62}6364+static inline int remap_area_pmd(pgd_t *pgd, unsigned long addr,65+ unsigned long end, unsigned long phys_addr,66+ pgprot_t prot)67{68+ unsigned long next;69+ pmd_t *pmd;70+ int ret = 0;7172+ pmd = pmd_alloc(&init_mm, pgd, addr);73+ if (!pmd)74+ return -ENOMEM;75000000076 do {77+ next = pmd_addr_end(addr, end);78+ ret = remap_area_pte(pmd, addr, next, phys_addr, prot);79+ if (ret)80+ return ret;81+ phys_addr += next - addr;82+ } while (pmd++, addr = next, addr != end);83+ return ret;084}8586+static int remap_area_pages(unsigned long start, unsigned long pfn,87+ unsigned long size, unsigned long flags)088{89+ unsigned long addr = start;90+ unsigned long next, end = start + size;91 unsigned long phys_addr = __pfn_to_phys(pfn);92+ pgprot_t prot = __pgprot(L_PTE_PRESENT | L_PTE_YOUNG |93+ L_PTE_DIRTY | L_PTE_WRITE | flags);94+ pgd_t *pgd;95 int err = 0;09697+ BUG_ON(addr >= end);98+ pgd = pgd_offset_k(addr);099 do {100+ next = pgd_addr_end(addr, end);101+ err = remap_area_pmd(pgd, addr, next, phys_addr, prot);102+ if (err)103 break;104+ phys_addr += next - addr;105+ } while (pgd++, addr = next, addr != end);00000000106107 return err;108}
+1-7
arch/arm/mm/mmu.c
···294 mem_types[MT_DEVICE].prot_pte |= L_PTE_BUFFERABLE;295 mem_types[MT_DEVICE].prot_sect |= PMD_SECT_BUFFERED;296297- /*298- * User pages need to be mapped with the ASID299- * (iow, non-global)300- */301- user_pgprot |= L_PTE_ASID;302-303#ifdef CONFIG_SMP304 /*305 * Mark memory with the "shared" attribute for SMP systems···402 }403 ptep = pte_offset_kernel(pmdp, virt);404405- set_pte(ptep, pfn_pte(phys >> PAGE_SHIFT, prot));406}407408/*
···294 mem_types[MT_DEVICE].prot_pte |= L_PTE_BUFFERABLE;295 mem_types[MT_DEVICE].prot_sect |= PMD_SECT_BUFFERED;296000000297#ifdef CONFIG_SMP298 /*299 * Mark memory with the "shared" attribute for SMP systems···408 }409 ptep = pte_offset_kernel(pmdp, virt);410411+ set_pte_ext(ptep, pfn_pte(phys >> PAGE_SHIFT, prot), 0);412}413414/*
···139#define cpu_is_xscale() 1140#endif141142-#define set_cr(x) \143- __asm__ __volatile__( \144- "mcr p15, 0, %0, c1, c0, 0 @ set CR" \145- : : "r" (x) : "cc")00146147-#define get_cr() \148- ({ \149- unsigned int __val; \150- __asm__ __volatile__( \151- "mrc p15, 0, %0, c1, c0, 0 @ get CR" \152- : "=r" (__val) : : "cc"); \153- __val; \154- })000000000000000155156extern unsigned long cr_no_alignment; /* defined in entry-armv.S */157extern unsigned long cr_alignment; /* defined in entry-armv.S */00000000000000000000158159#define UDBG_UNDEFINED (1 << 0)160#define UDBG_SYSCALL (1 << 1)
···139#define cpu_is_xscale() 1140#endif141142+static inline unsigned int get_cr(void)143+{144+ unsigned int val;145+ asm("mrc p15, 0, %0, c1, c0, 0 @ get CR" : "=r" (val) : : "cc");146+ return val;147+}148149+static inline void set_cr(unsigned int val)150+{151+ asm volatile("mcr p15, 0, %0, c1, c0, 0 @ set CR"152+ : : "r" (val) : "cc");153+}154+155+#define CPACC_FULL(n) (3 << (n * 2))156+#define CPACC_SVC(n) (1 << (n * 2))157+#define CPACC_DISABLE(n) (0 << (n * 2))158+159+static inline unsigned int get_copro_access(void)160+{161+ unsigned int val;162+ asm("mrc p15, 0, %0, c1, c0, 2 @ get copro access"163+ : "=r" (val) : : "cc");164+ return val;165+}166+167+static inline void set_copro_access(unsigned int val)168+{169+ asm volatile("mcr p15, 0, %0, c1, c0, 2 @ set copro access"170+ : : "r" (val) : "cc");171+}172173extern unsigned long cr_no_alignment; /* defined in entry-armv.S */174extern unsigned long cr_alignment; /* defined in entry-armv.S */175+176+#ifndef CONFIG_SMP177+static inline void adjust_cr(unsigned long mask, unsigned long set)178+{179+ unsigned long flags, cr;180+181+ mask &= ~CR_A;182+183+ set &= mask;184+185+ local_irq_save(flags);186+187+ cr_no_alignment = (cr_no_alignment & ~mask) | set;188+ cr_alignment = (cr_alignment & ~mask) | set;189+190+ set_cr((get_cr() & ~mask) | set);191+192+ local_irq_restore(flags);193+}194+#endif195196#define UDBG_UNDEFINED (1 << 0)197#define UDBG_SYSCALL (1 << 1)
+13
include/asm-arm/unistd.h
···347#define __NR_mbind (__NR_SYSCALL_BASE+319)348#define __NR_get_mempolicy (__NR_SYSCALL_BASE+320)349#define __NR_set_mempolicy (__NR_SYSCALL_BASE+321)0000000000000350351/*352 * The following SWIs are ARM private.
···347#define __NR_mbind (__NR_SYSCALL_BASE+319)348#define __NR_get_mempolicy (__NR_SYSCALL_BASE+320)349#define __NR_set_mempolicy (__NR_SYSCALL_BASE+321)350+#define __NR_openat (__NR_SYSCALL_BASE+322)351+#define __NR_mkdirat (__NR_SYSCALL_BASE+323)352+#define __NR_mknodat (__NR_SYSCALL_BASE+324)353+#define __NR_fchownat (__NR_SYSCALL_BASE+325)354+#define __NR_futimesat (__NR_SYSCALL_BASE+326)355+#define __NR_fstatat64 (__NR_SYSCALL_BASE+327)356+#define __NR_unlinkat (__NR_SYSCALL_BASE+328)357+#define __NR_renameat (__NR_SYSCALL_BASE+329)358+#define __NR_linkat (__NR_SYSCALL_BASE+330)359+#define __NR_symlinkat (__NR_SYSCALL_BASE+331)360+#define __NR_readlinkat (__NR_SYSCALL_BASE+332)361+#define __NR_fchmodat (__NR_SYSCALL_BASE+333)362+#define __NR_faccessat (__NR_SYSCALL_BASE+334)363364/*365 * The following SWIs are ARM private.