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

Merge branch 'for-linus' of git://git.linaro.org/people/rmk/linux-arm

Pull ARM updates from Russell King:
"This is the first chunk of ARM updates for this merge window.
Conflicts are expected in two files - asm/timex.h and
mach-integrator/integrator_cp.c. Nothing particularly stands out more
than anything else.

Most of the growth is down to the opcodes stuff from Dave Martin,
which is countered by Rob's patches to use more of the asm-generic
headers on ARM."

(A few more conflicts grew since then, but it all looked fairly trivial)

* 'for-linus' of git://git.linaro.org/people/rmk/linux-arm: (44 commits)
ARM: 7548/1: include linux/sched.h in syscall.h
ARM: 7541/1: Add ARM ERRATA 775420 workaround
ARM: ensure vm_struct has its phys_addr member filled in
ARM: 7540/1: kexec: Check segment memory addresses
ARM: 7539/1: kexec: scan for dtb magic in segments
ARM: 7538/1: delay: add registration mechanism for delay timer sources
ARM: 7536/1: smp: Formalize an IPI for wakeup
ARM: 7525/1: ptrace: use updated syscall number for syscall auditing
ARM: 7524/1: support syscall tracing
ARM: 7519/1: integrator: convert platform devices to Device Tree
ARM: 7518/1: integrator: convert AMBA devices to device tree
ARM: 7517/1: integrator: initial device tree support
ARM: 7516/1: plat-versatile: add DT support to FPGA IRQ
ARM: 7515/1: integrator: check PL010 base address from resource
ARM: 7514/1: integrator: call common init function from machine
ARM: 7522/1: arch_timers: register a time/cycle counter
ARM: 7523/1: arch_timers: enable the use of the virtual timer
ARM: 7531/1: mark kernelmode mem{cpy,set} non-experimental
ARM: 7520/1: Build dtb files in all target
ARM: Fix build warning in arch/arm/mm/alignment.c
...

+1817 -1312
+12
Documentation/devicetree/bindings/arm/arm-boards
··· 1 + ARM Integrator/AP (Application Platform) and Integrator/CP (Compact Platform) 2 + ----------------------------------------------------------------------------- 3 + ARM's oldest Linux-supported platform with connectors for different core 4 + tiles of ARMv4, ARMv5 and ARMv6 type. 5 + 6 + Required properties (in root node): 7 + compatible = "arm,integrator-ap"; /* Application Platform */ 8 + compatible = "arm,integrator-cp"; /* Compact Platform */ 9 + 10 + FPGA type interrupt controllers, see the versatile-fpga-irq binding doc. 11 + 12 + 1 13 ARM Versatile Application and Platform Baseboards 2 14 ------------------------------------------------- 3 15 ARM's development hardware platform with connectors for customizable
+31
Documentation/devicetree/bindings/arm/versatile-fpga-irq.txt
··· 1 + * ARM Versatile FPGA interrupt controller 2 + 3 + One or more FPGA IRQ controllers can be synthesized in an ARM reference board 4 + such as the Integrator or Versatile family. The output of these different 5 + controllers are OR:ed together and fed to the CPU tile's IRQ input. Each 6 + instance can handle up to 32 interrupts. 7 + 8 + Required properties: 9 + - compatible: "arm,versatile-fpga-irq" 10 + - interrupt-controller: Identifies the node as an interrupt controller 11 + - #interrupt-cells: The number of cells to define the interrupts. Must be 1 12 + as the FPGA IRQ controller has no configuration options for interrupt 13 + sources. The cell is a u32 and defines the interrupt number. 14 + - reg: The register bank for the FPGA interrupt controller. 15 + - clear-mask: a u32 number representing the mask written to clear all IRQs 16 + on the controller at boot for example. 17 + - valid-mask: a u32 number representing a bit mask determining which of 18 + the interrupts are valid. Unconnected/unused lines are set to 0, and 19 + the system till not make it possible for devices to request these 20 + interrupts. 21 + 22 + Example: 23 + 24 + pic: pic@14000000 { 25 + compatible = "arm,versatile-fpga-irq"; 26 + #interrupt-cells = <1>; 27 + interrupt-controller; 28 + reg = <0x14000000 0x100>; 29 + clear-mask = <0xffffffff>; 30 + valid-mask = <0x003fffff>; 31 + };
+32 -9
arch/arm/Kconfig
··· 16 16 select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL 17 17 select HAVE_ARCH_KGDB 18 18 select HAVE_ARCH_TRACEHOOK 19 + select HAVE_SYSCALL_TRACEPOINTS 19 20 select HAVE_KPROBES if !XIP_KERNEL 20 21 select HAVE_KRETPROBES if (HAVE_KPROBES) 21 22 select HAVE_FUNCTION_TRACER if (!XIP_KERNEL) ··· 1403 1402 on systems with an outer cache, the store buffer is drained 1404 1403 explicitly. 1405 1404 1405 + config ARM_ERRATA_775420 1406 + bool "ARM errata: A data cache maintenance operation which aborts, might lead to deadlock" 1407 + depends on CPU_V7 1408 + help 1409 + This option enables the workaround for the 775420 Cortex-A9 (r2p2, 1410 + r2p6,r2p8,r2p10,r3p0) erratum. In case a date cache maintenance 1411 + operation aborts with MMU exception, it might cause the processor 1412 + to deadlock. This workaround puts DSB before executing ISB if 1413 + an abort may occur on cache maintenance. 1414 + 1406 1415 endmenu 1407 1416 1408 1417 source "arch/arm/common/Kconfig" ··· 1797 1786 configuration it is safe to say N, otherwise say Y. 1798 1787 1799 1788 config UACCESS_WITH_MEMCPY 1800 - bool "Use kernel mem{cpy,set}() for {copy_to,clear}_user() (EXPERIMENTAL)" 1801 - depends on MMU && EXPERIMENTAL 1789 + bool "Use kernel mem{cpy,set}() for {copy_to,clear}_user()" 1790 + depends on MMU 1802 1791 default y if CPU_FEROCEON 1803 1792 help 1804 1793 Implement faster copy_to_user and clear_user methods for CPU ··· 1839 1828 neutralized via a kernel panic. 1840 1829 This feature requires gcc version 4.2 or above. 1841 1830 1842 - config DEPRECATED_PARAM_STRUCT 1843 - bool "Provide old way to pass kernel parameters" 1844 - help 1845 - This was deprecated in 2001 and announced to live on for 5 years. 1846 - Some old boot loaders still use this way. 1847 - 1848 1831 config XEN_DOM0 1849 1832 def_bool y 1850 1833 depends on XEN ··· 1860 1855 select IRQ_DOMAIN 1861 1856 help 1862 1857 Include support for flattened device tree machine descriptions. 1858 + 1859 + config ATAGS 1860 + bool "Support for the traditional ATAGS boot data passing" if USE_OF 1861 + default y 1862 + help 1863 + This is the traditional way of passing data to the kernel at boot 1864 + time. If you are solely relying on the flattened device tree (or 1865 + the ARM_ATAG_DTB_COMPAT option) then you may unselect this option 1866 + to remove ATAGS support from your kernel binary. If unsure, 1867 + leave this to y. 1868 + 1869 + config DEPRECATED_PARAM_STRUCT 1870 + bool "Provide old way to pass kernel parameters" 1871 + depends on ATAGS 1872 + help 1873 + This was deprecated in 2001 and announced to live on for 5 years. 1874 + Some old boot loaders still use this way. 1863 1875 1864 1876 # Compressed boot loader in ROM. Yes, we really want to ask about 1865 1877 # TEXT and BSS so we preserve their values in the config files. ··· 2004 1982 choice 2005 1983 prompt "Kernel command line type" if CMDLINE != "" 2006 1984 default CMDLINE_FROM_BOOTLOADER 1985 + depends on ATAGS 2007 1986 2008 1987 config CMDLINE_FROM_BOOTLOADER 2009 1988 bool "Use bootloader kernel arguments if available" ··· 2074 2051 2075 2052 config ATAGS_PROC 2076 2053 bool "Export atags in procfs" 2077 - depends on KEXEC 2054 + depends on ATAGS && KEXEC 2078 2055 default y 2079 2056 help 2080 2057 Should the atags used to boot the kernel be exported in an "atags"
+7 -2
arch/arm/Makefile
··· 269 269 KBUILD_IMAGE := zImage 270 270 endif 271 271 272 - all: $(KBUILD_IMAGE) 272 + # Build the DT binary blobs if we have OF configured 273 + ifeq ($(CONFIG_USE_OF),y) 274 + KBUILD_DTBS := dtbs 275 + endif 276 + 277 + all: $(KBUILD_IMAGE) $(KBUILD_DTBS) 273 278 274 279 boot := arch/arm/boot 275 280 ··· 312 307 echo ' uImage - U-Boot wrapped zImage' 313 308 echo ' bootpImage - Combined zImage and initial RAM disk' 314 309 echo ' (supply initrd image via make variable INITRD=<path>)' 315 - echo ' dtbs - Build device tree blobs for enabled boards' 310 + echo '* dtbs - Build device tree blobs for enabled boards' 316 311 echo ' install - Install uncompressed kernel' 317 312 echo ' zinstall - Install compressed kernel' 318 313 echo ' uinstall - Install U-Boot wrapped compressed kernel'
+3
arch/arm/boot/compressed/decompress.c
··· 32 32 # define Tracecv(c,x) 33 33 #endif 34 34 35 + /* Not needed, but used in some headers pulled in by decompressors */ 36 + extern char * strstr(const char * s1, const char *s2); 37 + 35 38 #ifdef CONFIG_KERNEL_GZIP 36 39 #include "../../../../lib/decompress_inflate.c" 37 40 #endif
+76
arch/arm/boot/dts/integrator.dtsi
··· 1 + /* 2 + * SoC core Device Tree for the ARM Integrator platforms 3 + */ 4 + 5 + /include/ "skeleton.dtsi" 6 + 7 + / { 8 + timer@13000000 { 9 + reg = <0x13000000 0x100>; 10 + interrupt-parent = <&pic>; 11 + interrupts = <5>; 12 + }; 13 + 14 + timer@13000100 { 15 + reg = <0x13000100 0x100>; 16 + interrupt-parent = <&pic>; 17 + interrupts = <6>; 18 + }; 19 + 20 + timer@13000200 { 21 + reg = <0x13000200 0x100>; 22 + interrupt-parent = <&pic>; 23 + interrupts = <7>; 24 + }; 25 + 26 + pic@14000000 { 27 + compatible = "arm,versatile-fpga-irq"; 28 + #interrupt-cells = <1>; 29 + interrupt-controller; 30 + reg = <0x14000000 0x100>; 31 + clear-mask = <0xffffffff>; 32 + }; 33 + 34 + flash@24000000 { 35 + compatible = "cfi-flash"; 36 + reg = <0x24000000 0x02000000>; 37 + }; 38 + 39 + fpga { 40 + compatible = "arm,amba-bus", "simple-bus"; 41 + #address-cells = <1>; 42 + #size-cells = <1>; 43 + ranges; 44 + interrupt-parent = <&pic>; 45 + 46 + /* 47 + * These PrimeCells are in the same locations and using the 48 + * same interrupts in all Integrators, however the silicon 49 + * version deployed is different. 50 + */ 51 + rtc@15000000 { 52 + reg = <0x15000000 0x1000>; 53 + interrupts = <8>; 54 + }; 55 + 56 + uart@16000000 { 57 + reg = <0x16000000 0x1000>; 58 + interrupts = <1>; 59 + }; 60 + 61 + uart@17000000 { 62 + reg = <0x17000000 0x1000>; 63 + interrupts = <2>; 64 + }; 65 + 66 + kmi@18000000 { 67 + reg = <0x18000000 0x1000>; 68 + interrupts = <3>; 69 + }; 70 + 71 + kmi@19000000 { 72 + reg = <0x19000000 0x1000>; 73 + interrupts = <4>; 74 + }; 75 + }; 76 + };
+68
arch/arm/boot/dts/integratorap.dts
··· 1 + /* 2 + * Device Tree for the ARM Integrator/AP platform 3 + */ 4 + 5 + /dts-v1/; 6 + /include/ "integrator.dtsi" 7 + 8 + / { 9 + model = "ARM Integrator/AP"; 10 + compatible = "arm,integrator-ap"; 11 + 12 + aliases { 13 + arm,timer-primary = &timer2; 14 + arm,timer-secondary = &timer1; 15 + }; 16 + 17 + chosen { 18 + bootargs = "root=/dev/ram0 console=ttyAM0,38400n8 earlyprintk"; 19 + }; 20 + 21 + timer0: timer@13000000 { 22 + compatible = "arm,integrator-timer"; 23 + }; 24 + 25 + timer1: timer@13000100 { 26 + compatible = "arm,integrator-timer"; 27 + }; 28 + 29 + timer2: timer@13000200 { 30 + compatible = "arm,integrator-timer"; 31 + }; 32 + 33 + pic: pic@14000000 { 34 + valid-mask = <0x003fffff>; 35 + }; 36 + 37 + fpga { 38 + /* 39 + * The Integator/AP predates the idea to have magic numbers 40 + * identifying the PrimeCell in hardware, thus we have to 41 + * supply these from the device tree. 42 + */ 43 + rtc: rtc@15000000 { 44 + compatible = "arm,pl030", "arm,primecell"; 45 + arm,primecell-periphid = <0x00041030>; 46 + }; 47 + 48 + uart0: uart@16000000 { 49 + compatible = "arm,pl010", "arm,primecell"; 50 + arm,primecell-periphid = <0x00041010>; 51 + }; 52 + 53 + uart1: uart@17000000 { 54 + compatible = "arm,pl010", "arm,primecell"; 55 + arm,primecell-periphid = <0x00041010>; 56 + }; 57 + 58 + kmi0: kmi@18000000 { 59 + compatible = "arm,pl050", "arm,primecell"; 60 + arm,primecell-periphid = <0x00041050>; 61 + }; 62 + 63 + kmi1: kmi@19000000 { 64 + compatible = "arm,pl050", "arm,primecell"; 65 + arm,primecell-periphid = <0x00041050>; 66 + }; 67 + }; 68 + };
+110
arch/arm/boot/dts/integratorcp.dts
··· 1 + /* 2 + * Device Tree for the ARM Integrator/CP platform 3 + */ 4 + 5 + /dts-v1/; 6 + /include/ "integrator.dtsi" 7 + 8 + / { 9 + model = "ARM Integrator/CP"; 10 + compatible = "arm,integrator-cp"; 11 + 12 + aliases { 13 + arm,timer-primary = &timer2; 14 + arm,timer-secondary = &timer1; 15 + }; 16 + 17 + chosen { 18 + bootargs = "root=/dev/ram0 console=ttyAMA0,38400n8 earlyprintk"; 19 + }; 20 + 21 + timer0: timer@13000000 { 22 + compatible = "arm,sp804", "arm,primecell"; 23 + }; 24 + 25 + timer1: timer@13000100 { 26 + compatible = "arm,sp804", "arm,primecell"; 27 + }; 28 + 29 + timer2: timer@13000200 { 30 + compatible = "arm,sp804", "arm,primecell"; 31 + }; 32 + 33 + pic: pic@14000000 { 34 + valid-mask = <0x1fc003ff>; 35 + }; 36 + 37 + cic: cic@10000040 { 38 + compatible = "arm,versatile-fpga-irq"; 39 + #interrupt-cells = <1>; 40 + interrupt-controller; 41 + reg = <0x10000040 0x100>; 42 + clear-mask = <0xffffffff>; 43 + valid-mask = <0x00000007>; 44 + }; 45 + 46 + sic: sic@ca000000 { 47 + compatible = "arm,versatile-fpga-irq"; 48 + #interrupt-cells = <1>; 49 + interrupt-controller; 50 + reg = <0xca000000 0x100>; 51 + clear-mask = <0x00000fff>; 52 + valid-mask = <0x00000fff>; 53 + }; 54 + 55 + ethernet@c8000000 { 56 + compatible = "smsc,lan91c111"; 57 + reg = <0xc8000000 0x10>; 58 + interrupt-parent = <&pic>; 59 + interrupts = <27>; 60 + }; 61 + 62 + fpga { 63 + /* 64 + * These PrimeCells are at the same location and using 65 + * the same interrupts in all Integrators, but in the CP 66 + * slightly newer versions are deployed. 67 + */ 68 + rtc@15000000 { 69 + compatible = "arm,pl031", "arm,primecell"; 70 + }; 71 + 72 + uart@16000000 { 73 + compatible = "arm,pl011", "arm,primecell"; 74 + }; 75 + 76 + uart@17000000 { 77 + compatible = "arm,pl011", "arm,primecell"; 78 + }; 79 + 80 + kmi@18000000 { 81 + compatible = "arm,pl050", "arm,primecell"; 82 + }; 83 + 84 + kmi@19000000 { 85 + compatible = "arm,pl050", "arm,primecell"; 86 + }; 87 + 88 + /* 89 + * These PrimeCells are only available on the Integrator/CP 90 + */ 91 + mmc@1c000000 { 92 + compatible = "arm,pl180", "arm,primecell"; 93 + reg = <0x1c000000 0x1000>; 94 + interrupts = <23 24>; 95 + max-frequency = <515633>; 96 + }; 97 + 98 + aaci@1d000000 { 99 + compatible = "arm,pl041", "arm,primecell"; 100 + reg = <0x1d000000 0x1000>; 101 + interrupts = <25>; 102 + }; 103 + 104 + clcd@c0000000 { 105 + compatible = "arm,pl110", "arm,primecell"; 106 + reg = <0xC0000000 0x1000>; 107 + interrupts = <22>; 108 + }; 109 + }; 110 + };
+17
arch/arm/include/asm/Kbuild
··· 5 5 generic-y += auxvec.h 6 6 generic-y += bitsperlong.h 7 7 generic-y += cputime.h 8 + generic-y += current.h 8 9 generic-y += emergency-restart.h 9 10 generic-y += errno.h 11 + generic-y += exec.h 10 12 generic-y += ioctl.h 13 + generic-y += ipcbuf.h 11 14 generic-y += irq_regs.h 12 15 generic-y += kdebug.h 13 16 generic-y += local.h 14 17 generic-y += local64.h 18 + generic-y += msgbuf.h 19 + generic-y += param.h 20 + generic-y += parport.h 15 21 generic-y += percpu.h 16 22 generic-y += poll.h 17 23 generic-y += resource.h 18 24 generic-y += sections.h 25 + generic-y += segment.h 26 + generic-y += sembuf.h 27 + generic-y += serial.h 28 + generic-y += shmbuf.h 19 29 generic-y += siginfo.h 20 30 generic-y += sizes.h 31 + generic-y += socket.h 32 + generic-y += sockios.h 33 + generic-y += termbits.h 34 + generic-y += termios.h 35 + generic-y += timex.h 36 + generic-y += types.h 37 + generic-y += unaligned.h
+7 -1
arch/arm/include/asm/arch_timer.h
··· 2 2 #define __ASMARM_ARCH_TIMER_H 3 3 4 4 #include <asm/errno.h> 5 + #include <linux/clocksource.h> 5 6 6 7 #ifdef CONFIG_ARM_ARCH_TIMER 7 - #define ARCH_HAS_READ_CURRENT_TIMER 8 8 int arch_timer_of_register(void); 9 9 int arch_timer_sched_clock_init(void); 10 + struct timecounter *arch_timer_get_timecounter(void); 10 11 #else 11 12 static inline int arch_timer_of_register(void) 12 13 { ··· 17 16 static inline int arch_timer_sched_clock_init(void) 18 17 { 19 18 return -ENXIO; 19 + } 20 + 21 + static inline struct timecounter *arch_timer_get_timecounter(void) 22 + { 23 + return NULL; 20 24 } 21 25 #endif 22 26
-15
arch/arm/include/asm/current.h
··· 1 - #ifndef _ASMARM_CURRENT_H 2 - #define _ASMARM_CURRENT_H 3 - 4 - #include <linux/thread_info.h> 5 - 6 - static inline struct task_struct *get_current(void) __attribute_const__; 7 - 8 - static inline struct task_struct *get_current(void) 9 - { 10 - return current_thread_info()->task; 11 - } 12 - 13 - #define current (get_current()) 14 - 15 - #endif /* _ASMARM_CURRENT_H */
+9
arch/arm/include/asm/delay.h
··· 15 15 16 16 #ifndef __ASSEMBLY__ 17 17 18 + struct delay_timer { 19 + unsigned long (*read_current_timer)(void); 20 + unsigned long freq; 21 + }; 22 + 18 23 extern struct arm_delay_ops { 19 24 void (*delay)(unsigned long); 20 25 void (*const_udelay)(unsigned long); ··· 60 55 extern void __loop_delay(unsigned long loops); 61 56 extern void __loop_udelay(unsigned long usecs); 62 57 extern void __loop_const_udelay(unsigned long); 58 + 59 + /* Delay-loop timer registration. */ 60 + #define ARCH_HAS_READ_CURRENT_TIMER 61 + extern void register_current_timer_delay(const struct delay_timer *timer); 63 62 64 63 #endif /* __ASSEMBLY__ */ 65 64
-6
arch/arm/include/asm/exec.h
··· 1 - #ifndef __ASM_ARM_EXEC_H 2 - #define __ASM_ARM_EXEC_H 3 - 4 - #define arch_align_stack(x) (x) 5 - 6 - #endif /* __ASM_ARM_EXEC_H */
+8 -8
arch/arm/include/asm/glue-cache.h
··· 110 110 #endif 111 111 112 112 #if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K) 113 - //# ifdef _CACHE 113 + # ifdef _CACHE 114 114 # define MULTI_CACHE 1 115 - //# else 116 - //# define _CACHE v6 117 - //# endif 115 + # else 116 + # define _CACHE v6 117 + # endif 118 118 #endif 119 119 120 120 #if defined(CONFIG_CPU_V7) 121 - //# ifdef _CACHE 121 + # ifdef _CACHE 122 122 # define MULTI_CACHE 1 123 - //# else 124 - //# define _CACHE v7 125 - //# endif 123 + # else 124 + # define _CACHE v7 125 + # endif 126 126 #endif 127 127 128 128 #if !defined(_CACHE) && !defined(MULTI_CACHE)
+1 -1
arch/arm/include/asm/hardirq.h
··· 5 5 #include <linux/threads.h> 6 6 #include <asm/irq.h> 7 7 8 - #define NR_IPI 5 8 + #define NR_IPI 6 9 9 10 10 typedef struct { 11 11 unsigned int __softirq_pending;
-48
arch/arm/include/asm/hardware/linkup-l1110.h
··· 1 - /* 2 - * 3 - * Definitions for H3600 Handheld Computer 4 - * 5 - * Copyright 2001 Compaq Computer Corporation. 6 - * 7 - * Use consistent with the GNU GPL is permitted, 8 - * provided that this copyright notice is 9 - * preserved in its entirety in all copies and derived works. 10 - * 11 - * COMPAQ COMPUTER CORPORATION MAKES NO WARRANTIES, EXPRESSED OR IMPLIED, 12 - * AS TO THE USEFULNESS OR CORRECTNESS OF THIS CODE OR ITS 13 - * FITNESS FOR ANY PARTICULAR PURPOSE. 14 - * 15 - * Author: Jamey Hicks. 16 - * 17 - */ 18 - 19 - /* LinkUp Systems PCCard/CompactFlash Interface for SA-1100 */ 20 - 21 - /* PC Card Status Register */ 22 - #define LINKUP_PRS_S1 (1 << 0) /* voltage control bits S1-S4 */ 23 - #define LINKUP_PRS_S2 (1 << 1) 24 - #define LINKUP_PRS_S3 (1 << 2) 25 - #define LINKUP_PRS_S4 (1 << 3) 26 - #define LINKUP_PRS_BVD1 (1 << 4) 27 - #define LINKUP_PRS_BVD2 (1 << 5) 28 - #define LINKUP_PRS_VS1 (1 << 6) 29 - #define LINKUP_PRS_VS2 (1 << 7) 30 - #define LINKUP_PRS_RDY (1 << 8) 31 - #define LINKUP_PRS_CD1 (1 << 9) 32 - #define LINKUP_PRS_CD2 (1 << 10) 33 - 34 - /* PC Card Command Register */ 35 - #define LINKUP_PRC_S1 (1 << 0) 36 - #define LINKUP_PRC_S2 (1 << 1) 37 - #define LINKUP_PRC_S3 (1 << 2) 38 - #define LINKUP_PRC_S4 (1 << 3) 39 - #define LINKUP_PRC_RESET (1 << 4) 40 - #define LINKUP_PRC_APOE (1 << 5) /* Auto Power Off Enable: clears S1-S4 when either nCD goes high */ 41 - #define LINKUP_PRC_CFE (1 << 6) /* CompactFlash mode Enable: addresses A[10:0] only, A[25:11] high */ 42 - #define LINKUP_PRC_SOE (1 << 7) /* signal output driver enable */ 43 - #define LINKUP_PRC_SSP (1 << 8) /* sock select polarity: 0 for socket 0, 1 for socket 1 */ 44 - #define LINKUP_PRC_MBZ (1 << 15) /* must be zero */ 45 - 46 - struct linkup_l1110 { 47 - volatile short prc; 48 - };
+61 -6
arch/arm/include/asm/io.h
··· 47 47 extern void __raw_readsw(const void __iomem *addr, void *data, int wordlen); 48 48 extern void __raw_readsl(const void __iomem *addr, void *data, int longlen); 49 49 50 - #define __raw_writeb(v,a) ((void)(__chk_io_ptr(a), *(volatile unsigned char __force *)(a) = (v))) 51 - #define __raw_writew(v,a) ((void)(__chk_io_ptr(a), *(volatile unsigned short __force *)(a) = (v))) 52 - #define __raw_writel(v,a) ((void)(__chk_io_ptr(a), *(volatile unsigned int __force *)(a) = (v))) 50 + #if __LINUX_ARM_ARCH__ < 6 51 + /* 52 + * Half-word accesses are problematic with RiscPC due to limitations of 53 + * the bus. Rather than special-case the machine, just let the compiler 54 + * generate the access for CPUs prior to ARMv6. 55 + */ 56 + #define __raw_readw(a) (__chk_io_ptr(a), *(volatile unsigned short __force *)(a)) 57 + #define __raw_writew(v,a) ((void)(__chk_io_ptr(a), *(volatile unsigned short __force *)(a) = (v))) 58 + #else 59 + /* 60 + * When running under a hypervisor, we want to avoid I/O accesses with 61 + * writeback addressing modes as these incur a significant performance 62 + * overhead (the address generation must be emulated in software). 63 + */ 64 + static inline void __raw_writew(u16 val, volatile void __iomem *addr) 65 + { 66 + asm volatile("strh %1, %0" 67 + : "+Qo" (*(volatile u16 __force *)addr) 68 + : "r" (val)); 69 + } 53 70 54 - #define __raw_readb(a) (__chk_io_ptr(a), *(volatile unsigned char __force *)(a)) 55 - #define __raw_readw(a) (__chk_io_ptr(a), *(volatile unsigned short __force *)(a)) 56 - #define __raw_readl(a) (__chk_io_ptr(a), *(volatile unsigned int __force *)(a)) 71 + static inline u16 __raw_readw(const volatile void __iomem *addr) 72 + { 73 + u16 val; 74 + asm volatile("ldrh %1, %0" 75 + : "+Qo" (*(volatile u16 __force *)addr), 76 + "=r" (val)); 77 + return val; 78 + } 79 + #endif 80 + 81 + static inline void __raw_writeb(u8 val, volatile void __iomem *addr) 82 + { 83 + asm volatile("strb %1, %0" 84 + : "+Qo" (*(volatile u8 __force *)addr) 85 + : "r" (val)); 86 + } 87 + 88 + static inline void __raw_writel(u32 val, volatile void __iomem *addr) 89 + { 90 + asm volatile("str %1, %0" 91 + : "+Qo" (*(volatile u32 __force *)addr) 92 + : "r" (val)); 93 + } 94 + 95 + static inline u8 __raw_readb(const volatile void __iomem *addr) 96 + { 97 + u8 val; 98 + asm volatile("ldrb %1, %0" 99 + : "+Qo" (*(volatile u8 __force *)addr), 100 + "=r" (val)); 101 + return val; 102 + } 103 + 104 + static inline u32 __raw_readl(const volatile void __iomem *addr) 105 + { 106 + u32 val; 107 + asm volatile("ldr %1, %0" 108 + : "+Qo" (*(volatile u32 __force *)addr), 109 + "=r" (val)); 110 + return val; 111 + } 57 112 58 113 /* 59 114 * Architecture ioremap implementation.
-1
arch/arm/include/asm/ipcbuf.h
··· 1 - #include <asm-generic/ipcbuf.h>
-31
arch/arm/include/asm/msgbuf.h
··· 1 - #ifndef _ASMARM_MSGBUF_H 2 - #define _ASMARM_MSGBUF_H 3 - 4 - /* 5 - * The msqid64_ds structure for arm architecture. 6 - * Note extra padding because this structure is passed back and forth 7 - * between kernel and user space. 8 - * 9 - * Pad space is left for: 10 - * - 64-bit time_t to solve y2038 problem 11 - * - 2 miscellaneous 32-bit values 12 - */ 13 - 14 - struct msqid64_ds { 15 - struct ipc64_perm msg_perm; 16 - __kernel_time_t msg_stime; /* last msgsnd time */ 17 - unsigned long __unused1; 18 - __kernel_time_t msg_rtime; /* last msgrcv time */ 19 - unsigned long __unused2; 20 - __kernel_time_t msg_ctime; /* last change time */ 21 - unsigned long __unused3; 22 - unsigned long msg_cbytes; /* current number of bytes on queue */ 23 - unsigned long msg_qnum; /* number of messages in queue */ 24 - unsigned long msg_qbytes; /* max number of bytes on queue */ 25 - __kernel_pid_t msg_lspid; /* pid of last msgsnd */ 26 - __kernel_pid_t msg_lrpid; /* last receive pid */ 27 - unsigned long __unused4; 28 - unsigned long __unused5; 29 - }; 30 - 31 - #endif /* _ASMARM_MSGBUF_H */
+7 -2
arch/arm/include/asm/mutex.h
··· 9 9 #define _ASM_MUTEX_H 10 10 /* 11 11 * On pre-ARMv6 hardware this results in a swp-based implementation, 12 - * which is the most efficient. For ARMv6+, we emit a pair of exclusive 13 - * accesses instead. 12 + * which is the most efficient. For ARMv6+, we have exclusive memory 13 + * accessors and use atomic_dec to avoid the extra xchg operations 14 + * on the locking slowpaths. 14 15 */ 16 + #if __LINUX_ARM_ARCH__ < 6 15 17 #include <asm-generic/mutex-xchg.h> 18 + #else 19 + #include <asm-generic/mutex-dec.h> 16 20 #endif 21 + #endif /* _ASM_MUTEX_H */
+29
arch/arm/include/asm/opcodes-virt.h
··· 1 + /* 2 + * opcodes-virt.h: Opcode definitions for the ARM virtualization extensions 3 + * Copyright (C) 2012 Linaro Limited 4 + * 5 + * This program is free software; you can redistribute it and/or modify 6 + * it under the terms of the GNU General Public License as published by 7 + * the Free Software Foundation; either version 2 of the License, or 8 + * (at your option) any later version. 9 + * 10 + * This program is distributed in the hope that it will be useful, 11 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 + * GNU General Public License for more details. 14 + * 15 + * You should have received a copy of the GNU General Public License along 16 + * with this program; if not, write to the Free Software Foundation, Inc., 17 + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 + */ 19 + #ifndef __ASM_ARM_OPCODES_VIRT_H 20 + #define __ASM_ARM_OPCODES_VIRT_H 21 + 22 + #include <asm/opcodes.h> 23 + 24 + #define __HVC(imm16) __inst_arm_thumb32( \ 25 + 0xE1400070 | (((imm16) & 0xFFF0) << 4) | ((imm16) & 0x000F), \ 26 + 0xF7E08000 | (((imm16) & 0xF000) << 4) | ((imm16) & 0x0FFF) \ 27 + ) 28 + 29 + #endif /* ! __ASM_ARM_OPCODES_VIRT_H */
+166 -15
arch/arm/include/asm/opcodes.h
··· 19 19 20 20 21 21 /* 22 + * Assembler opcode byteswap helpers. 23 + * These are only intended for use by this header: don't use them directly, 24 + * because they will be suboptimal in most cases. 25 + */ 26 + #define ___asm_opcode_swab32(x) ( \ 27 + (((x) << 24) & 0xFF000000) \ 28 + | (((x) << 8) & 0x00FF0000) \ 29 + | (((x) >> 8) & 0x0000FF00) \ 30 + | (((x) >> 24) & 0x000000FF) \ 31 + ) 32 + #define ___asm_opcode_swab16(x) ( \ 33 + (((x) << 8) & 0xFF00) \ 34 + | (((x) >> 8) & 0x00FF) \ 35 + ) 36 + #define ___asm_opcode_swahb32(x) ( \ 37 + (((x) << 8) & 0xFF00FF00) \ 38 + | (((x) >> 8) & 0x00FF00FF) \ 39 + ) 40 + #define ___asm_opcode_swahw32(x) ( \ 41 + (((x) << 16) & 0xFFFF0000) \ 42 + | (((x) >> 16) & 0x0000FFFF) \ 43 + ) 44 + #define ___asm_opcode_identity32(x) ((x) & 0xFFFFFFFF) 45 + #define ___asm_opcode_identity16(x) ((x) & 0xFFFF) 46 + 47 + 48 + /* 22 49 * Opcode byteswap helpers 23 50 * 24 51 * These macros help with converting instructions between a canonical integer ··· 68 41 * Note that values in the range 0x0000E800..0xE7FFFFFF intentionally do not 69 42 * represent any valid Thumb-2 instruction. For this range, 70 43 * __opcode_is_thumb32() and __opcode_is_thumb16() will both be false. 44 + * 45 + * The ___asm variants are intended only for use by this header, in situations 46 + * involving inline assembler. For .S files, the normal __opcode_*() macros 47 + * should do the right thing. 71 48 */ 49 + #ifdef __ASSEMBLY__ 72 50 73 - #ifndef __ASSEMBLY__ 51 + #define ___opcode_swab32(x) ___asm_opcode_swab32(x) 52 + #define ___opcode_swab16(x) ___asm_opcode_swab16(x) 53 + #define ___opcode_swahb32(x) ___asm_opcode_swahb32(x) 54 + #define ___opcode_swahw32(x) ___asm_opcode_swahw32(x) 55 + #define ___opcode_identity32(x) ___asm_opcode_identity32(x) 56 + #define ___opcode_identity16(x) ___asm_opcode_identity16(x) 57 + 58 + #else /* ! __ASSEMBLY__ */ 74 59 75 60 #include <linux/types.h> 76 61 #include <linux/swab.h> 77 62 63 + #define ___opcode_swab32(x) swab32(x) 64 + #define ___opcode_swab16(x) swab16(x) 65 + #define ___opcode_swahb32(x) swahb32(x) 66 + #define ___opcode_swahw32(x) swahw32(x) 67 + #define ___opcode_identity32(x) ((u32)(x)) 68 + #define ___opcode_identity16(x) ((u16)(x)) 69 + 70 + #endif /* ! __ASSEMBLY__ */ 71 + 72 + 78 73 #ifdef CONFIG_CPU_ENDIAN_BE8 79 - #define __opcode_to_mem_arm(x) swab32(x) 80 - #define __opcode_to_mem_thumb16(x) swab16(x) 81 - #define __opcode_to_mem_thumb32(x) swahb32(x) 82 - #else 83 - #define __opcode_to_mem_arm(x) ((u32)(x)) 84 - #define __opcode_to_mem_thumb16(x) ((u16)(x)) 85 - #define __opcode_to_mem_thumb32(x) swahw32(x) 74 + 75 + #define __opcode_to_mem_arm(x) ___opcode_swab32(x) 76 + #define __opcode_to_mem_thumb16(x) ___opcode_swab16(x) 77 + #define __opcode_to_mem_thumb32(x) ___opcode_swahb32(x) 78 + #define ___asm_opcode_to_mem_arm(x) ___asm_opcode_swab32(x) 79 + #define ___asm_opcode_to_mem_thumb16(x) ___asm_opcode_swab16(x) 80 + #define ___asm_opcode_to_mem_thumb32(x) ___asm_opcode_swahb32(x) 81 + 82 + #else /* ! CONFIG_CPU_ENDIAN_BE8 */ 83 + 84 + #define __opcode_to_mem_arm(x) ___opcode_identity32(x) 85 + #define __opcode_to_mem_thumb16(x) ___opcode_identity16(x) 86 + #define ___asm_opcode_to_mem_arm(x) ___asm_opcode_identity32(x) 87 + #define ___asm_opcode_to_mem_thumb16(x) ___asm_opcode_identity16(x) 88 + #ifndef CONFIG_CPU_ENDIAN_BE32 89 + /* 90 + * On BE32 systems, using 32-bit accesses to store Thumb instructions will not 91 + * work in all cases, due to alignment constraints. For now, a correct 92 + * version is not provided for BE32. 93 + */ 94 + #define __opcode_to_mem_thumb32(x) ___opcode_swahw32(x) 95 + #define ___asm_opcode_to_mem_thumb32(x) ___asm_opcode_swahw32(x) 86 96 #endif 97 + 98 + #endif /* ! CONFIG_CPU_ENDIAN_BE8 */ 87 99 88 100 #define __mem_to_opcode_arm(x) __opcode_to_mem_arm(x) 89 101 #define __mem_to_opcode_thumb16(x) __opcode_to_mem_thumb16(x) 102 + #ifndef CONFIG_CPU_ENDIAN_BE32 90 103 #define __mem_to_opcode_thumb32(x) __opcode_to_mem_thumb32(x) 104 + #endif 91 105 92 106 /* Operations specific to Thumb opcodes */ 93 107 94 108 /* Instruction size checks: */ 95 - #define __opcode_is_thumb32(x) ((u32)(x) >= 0xE8000000UL) 96 - #define __opcode_is_thumb16(x) ((u32)(x) < 0xE800UL) 109 + #define __opcode_is_thumb32(x) ( \ 110 + ((x) & 0xF8000000) == 0xE8000000 \ 111 + || ((x) & 0xF0000000) == 0xF0000000 \ 112 + ) 113 + #define __opcode_is_thumb16(x) ( \ 114 + ((x) & 0xFFFF0000) == 0 \ 115 + && !(((x) & 0xF800) == 0xE800 || ((x) & 0xF000) == 0xF000) \ 116 + ) 97 117 98 118 /* Operations to construct or split 32-bit Thumb instructions: */ 99 - #define __opcode_thumb32_first(x) ((u16)((x) >> 16)) 100 - #define __opcode_thumb32_second(x) ((u16)(x)) 101 - #define __opcode_thumb32_compose(first, second) \ 102 - (((u32)(u16)(first) << 16) | (u32)(u16)(second)) 119 + #define __opcode_thumb32_first(x) (___opcode_identity16((x) >> 16)) 120 + #define __opcode_thumb32_second(x) (___opcode_identity16(x)) 121 + #define __opcode_thumb32_compose(first, second) ( \ 122 + (___opcode_identity32(___opcode_identity16(first)) << 16) \ 123 + | ___opcode_identity32(___opcode_identity16(second)) \ 124 + ) 125 + #define ___asm_opcode_thumb32_first(x) (___asm_opcode_identity16((x) >> 16)) 126 + #define ___asm_opcode_thumb32_second(x) (___asm_opcode_identity16(x)) 127 + #define ___asm_opcode_thumb32_compose(first, second) ( \ 128 + (___asm_opcode_identity32(___asm_opcode_identity16(first)) << 16) \ 129 + | ___asm_opcode_identity32(___asm_opcode_identity16(second)) \ 130 + ) 103 131 104 - #endif /* __ASSEMBLY__ */ 132 + /* 133 + * Opcode injection helpers 134 + * 135 + * In rare cases it is necessary to assemble an opcode which the 136 + * assembler does not support directly, or which would normally be 137 + * rejected because of the CFLAGS or AFLAGS used to build the affected 138 + * file. 139 + * 140 + * Before using these macros, consider carefully whether it is feasible 141 + * instead to change the build flags for your file, or whether it really 142 + * makes sense to support old assembler versions when building that 143 + * particular kernel feature. 144 + * 145 + * The macros defined here should only be used where there is no viable 146 + * alternative. 147 + * 148 + * 149 + * __inst_arm(x): emit the specified ARM opcode 150 + * __inst_thumb16(x): emit the specified 16-bit Thumb opcode 151 + * __inst_thumb32(x): emit the specified 32-bit Thumb opcode 152 + * 153 + * __inst_arm_thumb16(arm, thumb): emit either the specified arm or 154 + * 16-bit Thumb opcode, depending on whether an ARM or Thumb-2 155 + * kernel is being built 156 + * 157 + * __inst_arm_thumb32(arm, thumb): emit either the specified arm or 158 + * 32-bit Thumb opcode, depending on whether an ARM or Thumb-2 159 + * kernel is being built 160 + * 161 + * 162 + * Note that using these macros directly is poor practice. Instead, you 163 + * should use them to define human-readable wrapper macros to encode the 164 + * instructions that you care about. In code which might run on ARMv7 or 165 + * above, you can usually use the __inst_arm_thumb{16,32} macros to 166 + * specify the ARM and Thumb alternatives at the same time. This ensures 167 + * that the correct opcode gets emitted depending on the instruction set 168 + * used for the kernel build. 169 + * 170 + * Look at opcodes-virt.h for an example of how to use these macros. 171 + */ 172 + #include <linux/stringify.h> 173 + 174 + #define __inst_arm(x) ___inst_arm(___asm_opcode_to_mem_arm(x)) 175 + #define __inst_thumb32(x) ___inst_thumb32( \ 176 + ___asm_opcode_to_mem_thumb16(___asm_opcode_thumb32_first(x)), \ 177 + ___asm_opcode_to_mem_thumb16(___asm_opcode_thumb32_second(x)) \ 178 + ) 179 + #define __inst_thumb16(x) ___inst_thumb16(___asm_opcode_to_mem_thumb16(x)) 180 + 181 + #ifdef CONFIG_THUMB2_KERNEL 182 + #define __inst_arm_thumb16(arm_opcode, thumb_opcode) \ 183 + __inst_thumb16(thumb_opcode) 184 + #define __inst_arm_thumb32(arm_opcode, thumb_opcode) \ 185 + __inst_thumb32(thumb_opcode) 186 + #else 187 + #define __inst_arm_thumb16(arm_opcode, thumb_opcode) __inst_arm(arm_opcode) 188 + #define __inst_arm_thumb32(arm_opcode, thumb_opcode) __inst_arm(arm_opcode) 189 + #endif 190 + 191 + /* Helpers for the helpers. Don't use these directly. */ 192 + #ifdef __ASSEMBLY__ 193 + #define ___inst_arm(x) .long x 194 + #define ___inst_thumb16(x) .short x 195 + #define ___inst_thumb32(first, second) .short first, second 196 + #else 197 + #define ___inst_arm(x) ".long " __stringify(x) "\n\t" 198 + #define ___inst_thumb16(x) ".short " __stringify(x) "\n\t" 199 + #define ___inst_thumb32(first, second) \ 200 + ".short " __stringify(first) ", " __stringify(second) "\n\t" 201 + #endif 105 202 106 203 #endif /* __ASM_ARM_OPCODES_H */
-31
arch/arm/include/asm/param.h
··· 1 - /* 2 - * arch/arm/include/asm/param.h 3 - * 4 - * Copyright (C) 1995-1999 Russell King 5 - * 6 - * This program is free software; you can redistribute it and/or modify 7 - * it under the terms of the GNU General Public License version 2 as 8 - * published by the Free Software Foundation. 9 - */ 10 - #ifndef __ASM_PARAM_H 11 - #define __ASM_PARAM_H 12 - 13 - #ifdef __KERNEL__ 14 - # define HZ CONFIG_HZ /* Internal kernel timer frequency */ 15 - # define USER_HZ 100 /* User interfaces are in "ticks" */ 16 - # define CLOCKS_PER_SEC (USER_HZ) /* like times() */ 17 - #else 18 - # define HZ 100 19 - #endif 20 - 21 - #define EXEC_PAGESIZE 4096 22 - 23 - #ifndef NOGROUP 24 - #define NOGROUP (-1) 25 - #endif 26 - 27 - /* max length of hostname */ 28 - #define MAXHOSTNAMELEN 64 29 - 30 - #endif 31 -
-18
arch/arm/include/asm/parport.h
··· 1 - /* 2 - * arch/arm/include/asm/parport.h: ARM-specific parport initialisation 3 - * 4 - * Copyright (C) 1999, 2000 Tim Waugh <tim@cyberelk.demon.co.uk> 5 - * 6 - * This file should only be included by drivers/parport/parport_pc.c. 7 - */ 8 - 9 - #ifndef __ASMARM_PARPORT_H 10 - #define __ASMARM_PARPORT_H 11 - 12 - static int __devinit parport_pc_find_isa_ports (int autoirq, int autodma); 13 - static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma) 14 - { 15 - return parport_pc_find_isa_ports (autoirq, autodma); 16 - } 17 - 18 - #endif /* !(_ASMARM_PARPORT_H) */
-11
arch/arm/include/asm/segment.h
··· 1 - #ifndef __ASM_ARM_SEGMENT_H 2 - #define __ASM_ARM_SEGMENT_H 3 - 4 - #define __KERNEL_CS 0x0 5 - #define __KERNEL_DS 0x0 6 - 7 - #define __USER_CS 0x1 8 - #define __USER_DS 0x1 9 - 10 - #endif /* __ASM_ARM_SEGMENT_H */ 11 -
-25
arch/arm/include/asm/sembuf.h
··· 1 - #ifndef _ASMARM_SEMBUF_H 2 - #define _ASMARM_SEMBUF_H 3 - 4 - /* 5 - * The semid64_ds structure for arm architecture. 6 - * Note extra padding because this structure is passed back and forth 7 - * between kernel and user space. 8 - * 9 - * Pad space is left for: 10 - * - 64-bit time_t to solve y2038 problem 11 - * - 2 miscellaneous 32-bit values 12 - */ 13 - 14 - struct semid64_ds { 15 - struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ 16 - __kernel_time_t sem_otime; /* last semop time */ 17 - unsigned long __unused1; 18 - __kernel_time_t sem_ctime; /* last change time */ 19 - unsigned long __unused2; 20 - unsigned long sem_nsems; /* no. of semaphores in array */ 21 - unsigned long __unused3; 22 - unsigned long __unused4; 23 - }; 24 - 25 - #endif /* _ASMARM_SEMBUF_H */
-19
arch/arm/include/asm/serial.h
··· 1 - /* 2 - * arch/arm/include/asm/serial.h 3 - * 4 - * Copyright (C) 1996 Russell King. 5 - * 6 - * This program is free software; you can redistribute it and/or modify 7 - * it under the terms of the GNU General Public License version 2 as 8 - * published by the Free Software Foundation. 9 - * 10 - * Changelog: 11 - * 15-10-1996 RMK Created 12 - */ 13 - 14 - #ifndef __ASM_SERIAL_H 15 - #define __ASM_SERIAL_H 16 - 17 - #define BASE_BAUD (1843200 / 16) 18 - 19 - #endif
-42
arch/arm/include/asm/shmbuf.h
··· 1 - #ifndef _ASMARM_SHMBUF_H 2 - #define _ASMARM_SHMBUF_H 3 - 4 - /* 5 - * The shmid64_ds structure for arm architecture. 6 - * Note extra padding because this structure is passed back and forth 7 - * between kernel and user space. 8 - * 9 - * Pad space is left for: 10 - * - 64-bit time_t to solve y2038 problem 11 - * - 2 miscellaneous 32-bit values 12 - */ 13 - 14 - struct shmid64_ds { 15 - struct ipc64_perm shm_perm; /* operation perms */ 16 - size_t shm_segsz; /* size of segment (bytes) */ 17 - __kernel_time_t shm_atime; /* last attach time */ 18 - unsigned long __unused1; 19 - __kernel_time_t shm_dtime; /* last detach time */ 20 - unsigned long __unused2; 21 - __kernel_time_t shm_ctime; /* last change time */ 22 - unsigned long __unused3; 23 - __kernel_pid_t shm_cpid; /* pid of creator */ 24 - __kernel_pid_t shm_lpid; /* pid of last operator */ 25 - unsigned long shm_nattch; /* no. of current attaches */ 26 - unsigned long __unused4; 27 - unsigned long __unused5; 28 - }; 29 - 30 - struct shminfo64 { 31 - unsigned long shmmax; 32 - unsigned long shmmin; 33 - unsigned long shmmni; 34 - unsigned long shmseg; 35 - unsigned long shmall; 36 - unsigned long __unused1; 37 - unsigned long __unused2; 38 - unsigned long __unused3; 39 - unsigned long __unused4; 40 - }; 41 - 42 - #endif /* _ASMARM_SHMBUF_H */
-72
arch/arm/include/asm/socket.h
··· 1 - #ifndef _ASMARM_SOCKET_H 2 - #define _ASMARM_SOCKET_H 3 - 4 - #include <asm/sockios.h> 5 - 6 - /* For setsockopt(2) */ 7 - #define SOL_SOCKET 1 8 - 9 - #define SO_DEBUG 1 10 - #define SO_REUSEADDR 2 11 - #define SO_TYPE 3 12 - #define SO_ERROR 4 13 - #define SO_DONTROUTE 5 14 - #define SO_BROADCAST 6 15 - #define SO_SNDBUF 7 16 - #define SO_RCVBUF 8 17 - #define SO_SNDBUFFORCE 32 18 - #define SO_RCVBUFFORCE 33 19 - #define SO_KEEPALIVE 9 20 - #define SO_OOBINLINE 10 21 - #define SO_NO_CHECK 11 22 - #define SO_PRIORITY 12 23 - #define SO_LINGER 13 24 - #define SO_BSDCOMPAT 14 25 - /* To add :#define SO_REUSEPORT 15 */ 26 - #define SO_PASSCRED 16 27 - #define SO_PEERCRED 17 28 - #define SO_RCVLOWAT 18 29 - #define SO_SNDLOWAT 19 30 - #define SO_RCVTIMEO 20 31 - #define SO_SNDTIMEO 21 32 - 33 - /* Security levels - as per NRL IPv6 - don't actually do anything */ 34 - #define SO_SECURITY_AUTHENTICATION 22 35 - #define SO_SECURITY_ENCRYPTION_TRANSPORT 23 36 - #define SO_SECURITY_ENCRYPTION_NETWORK 24 37 - 38 - #define SO_BINDTODEVICE 25 39 - 40 - /* Socket filtering */ 41 - #define SO_ATTACH_FILTER 26 42 - #define SO_DETACH_FILTER 27 43 - 44 - #define SO_PEERNAME 28 45 - #define SO_TIMESTAMP 29 46 - #define SCM_TIMESTAMP SO_TIMESTAMP 47 - 48 - #define SO_ACCEPTCONN 30 49 - 50 - #define SO_PEERSEC 31 51 - #define SO_PASSSEC 34 52 - #define SO_TIMESTAMPNS 35 53 - #define SCM_TIMESTAMPNS SO_TIMESTAMPNS 54 - 55 - #define SO_MARK 36 56 - 57 - #define SO_TIMESTAMPING 37 58 - #define SCM_TIMESTAMPING SO_TIMESTAMPING 59 - 60 - #define SO_PROTOCOL 38 61 - #define SO_DOMAIN 39 62 - 63 - #define SO_RXQ_OVFL 40 64 - 65 - #define SO_WIFI_STATUS 41 66 - #define SCM_WIFI_STATUS SO_WIFI_STATUS 67 - #define SO_PEEK_OFF 42 68 - 69 - /* Instruct lower device to use last 4-bytes of skb data as FCS */ 70 - #define SO_NOFCS 43 71 - 72 - #endif /* _ASM_SOCKET_H */
-13
arch/arm/include/asm/sockios.h
··· 1 - #ifndef __ARCH_ARM_SOCKIOS_H 2 - #define __ARCH_ARM_SOCKIOS_H 3 - 4 - /* Socket-level I/O control calls. */ 5 - #define FIOSETOWN 0x8901 6 - #define SIOCSPGRP 0x8902 7 - #define FIOGETOWN 0x8903 8 - #define SIOCGPGRP 0x8904 9 - #define SIOCATMARK 0x8905 10 - #define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */ 11 - #define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */ 12 - 13 - #endif
+5
arch/arm/include/asm/syscall.h
··· 8 8 #define _ASM_ARM_SYSCALL_H 9 9 10 10 #include <linux/err.h> 11 + #include <linux/sched.h> 12 + 13 + #include <asm/unistd.h> 14 + 15 + #define NR_syscalls (__NR_syscalls) 11 16 12 17 extern const unsigned long sys_call_table[]; 13 18
-198
arch/arm/include/asm/termbits.h
··· 1 - #ifndef __ASM_ARM_TERMBITS_H 2 - #define __ASM_ARM_TERMBITS_H 3 - 4 - typedef unsigned char cc_t; 5 - typedef unsigned int speed_t; 6 - typedef unsigned int tcflag_t; 7 - 8 - #define NCCS 19 9 - struct termios { 10 - tcflag_t c_iflag; /* input mode flags */ 11 - tcflag_t c_oflag; /* output mode flags */ 12 - tcflag_t c_cflag; /* control mode flags */ 13 - tcflag_t c_lflag; /* local mode flags */ 14 - cc_t c_line; /* line discipline */ 15 - cc_t c_cc[NCCS]; /* control characters */ 16 - }; 17 - 18 - struct termios2 { 19 - tcflag_t c_iflag; /* input mode flags */ 20 - tcflag_t c_oflag; /* output mode flags */ 21 - tcflag_t c_cflag; /* control mode flags */ 22 - tcflag_t c_lflag; /* local mode flags */ 23 - cc_t c_line; /* line discipline */ 24 - cc_t c_cc[NCCS]; /* control characters */ 25 - speed_t c_ispeed; /* input speed */ 26 - speed_t c_ospeed; /* output speed */ 27 - }; 28 - 29 - struct ktermios { 30 - tcflag_t c_iflag; /* input mode flags */ 31 - tcflag_t c_oflag; /* output mode flags */ 32 - tcflag_t c_cflag; /* control mode flags */ 33 - tcflag_t c_lflag; /* local mode flags */ 34 - cc_t c_line; /* line discipline */ 35 - cc_t c_cc[NCCS]; /* control characters */ 36 - speed_t c_ispeed; /* input speed */ 37 - speed_t c_ospeed; /* output speed */ 38 - }; 39 - 40 - 41 - /* c_cc characters */ 42 - #define VINTR 0 43 - #define VQUIT 1 44 - #define VERASE 2 45 - #define VKILL 3 46 - #define VEOF 4 47 - #define VTIME 5 48 - #define VMIN 6 49 - #define VSWTC 7 50 - #define VSTART 8 51 - #define VSTOP 9 52 - #define VSUSP 10 53 - #define VEOL 11 54 - #define VREPRINT 12 55 - #define VDISCARD 13 56 - #define VWERASE 14 57 - #define VLNEXT 15 58 - #define VEOL2 16 59 - 60 - /* c_iflag bits */ 61 - #define IGNBRK 0000001 62 - #define BRKINT 0000002 63 - #define IGNPAR 0000004 64 - #define PARMRK 0000010 65 - #define INPCK 0000020 66 - #define ISTRIP 0000040 67 - #define INLCR 0000100 68 - #define IGNCR 0000200 69 - #define ICRNL 0000400 70 - #define IUCLC 0001000 71 - #define IXON 0002000 72 - #define IXANY 0004000 73 - #define IXOFF 0010000 74 - #define IMAXBEL 0020000 75 - #define IUTF8 0040000 76 - 77 - /* c_oflag bits */ 78 - #define OPOST 0000001 79 - #define OLCUC 0000002 80 - #define ONLCR 0000004 81 - #define OCRNL 0000010 82 - #define ONOCR 0000020 83 - #define ONLRET 0000040 84 - #define OFILL 0000100 85 - #define OFDEL 0000200 86 - #define NLDLY 0000400 87 - #define NL0 0000000 88 - #define NL1 0000400 89 - #define CRDLY 0003000 90 - #define CR0 0000000 91 - #define CR1 0001000 92 - #define CR2 0002000 93 - #define CR3 0003000 94 - #define TABDLY 0014000 95 - #define TAB0 0000000 96 - #define TAB1 0004000 97 - #define TAB2 0010000 98 - #define TAB3 0014000 99 - #define XTABS 0014000 100 - #define BSDLY 0020000 101 - #define BS0 0000000 102 - #define BS1 0020000 103 - #define VTDLY 0040000 104 - #define VT0 0000000 105 - #define VT1 0040000 106 - #define FFDLY 0100000 107 - #define FF0 0000000 108 - #define FF1 0100000 109 - 110 - /* c_cflag bit meaning */ 111 - #define CBAUD 0010017 112 - #define B0 0000000 /* hang up */ 113 - #define B50 0000001 114 - #define B75 0000002 115 - #define B110 0000003 116 - #define B134 0000004 117 - #define B150 0000005 118 - #define B200 0000006 119 - #define B300 0000007 120 - #define B600 0000010 121 - #define B1200 0000011 122 - #define B1800 0000012 123 - #define B2400 0000013 124 - #define B4800 0000014 125 - #define B9600 0000015 126 - #define B19200 0000016 127 - #define B38400 0000017 128 - #define EXTA B19200 129 - #define EXTB B38400 130 - #define CSIZE 0000060 131 - #define CS5 0000000 132 - #define CS6 0000020 133 - #define CS7 0000040 134 - #define CS8 0000060 135 - #define CSTOPB 0000100 136 - #define CREAD 0000200 137 - #define PARENB 0000400 138 - #define PARODD 0001000 139 - #define HUPCL 0002000 140 - #define CLOCAL 0004000 141 - #define CBAUDEX 0010000 142 - #define BOTHER 0010000 143 - #define B57600 0010001 144 - #define B115200 0010002 145 - #define B230400 0010003 146 - #define B460800 0010004 147 - #define B500000 0010005 148 - #define B576000 0010006 149 - #define B921600 0010007 150 - #define B1000000 0010010 151 - #define B1152000 0010011 152 - #define B1500000 0010012 153 - #define B2000000 0010013 154 - #define B2500000 0010014 155 - #define B3000000 0010015 156 - #define B3500000 0010016 157 - #define B4000000 0010017 158 - #define CIBAUD 002003600000 /* input baud rate */ 159 - #define CMSPAR 010000000000 /* mark or space (stick) parity */ 160 - #define CRTSCTS 020000000000 /* flow control */ 161 - 162 - #define IBSHIFT 16 163 - 164 - /* c_lflag bits */ 165 - #define ISIG 0000001 166 - #define ICANON 0000002 167 - #define XCASE 0000004 168 - #define ECHO 0000010 169 - #define ECHOE 0000020 170 - #define ECHOK 0000040 171 - #define ECHONL 0000100 172 - #define NOFLSH 0000200 173 - #define TOSTOP 0000400 174 - #define ECHOCTL 0001000 175 - #define ECHOPRT 0002000 176 - #define ECHOKE 0004000 177 - #define FLUSHO 0010000 178 - #define PENDIN 0040000 179 - #define IEXTEN 0100000 180 - #define EXTPROC 0200000 181 - 182 - /* tcflow() and TCXONC use these */ 183 - #define TCOOFF 0 184 - #define TCOON 1 185 - #define TCIOFF 2 186 - #define TCION 3 187 - 188 - /* tcflush() and TCFLSH use these */ 189 - #define TCIFLUSH 0 190 - #define TCOFLUSH 1 191 - #define TCIOFLUSH 2 192 - 193 - /* tcsetattr uses these */ 194 - #define TCSANOW 0 195 - #define TCSADRAIN 1 196 - #define TCSAFLUSH 2 197 - 198 - #endif /* __ASM_ARM_TERMBITS_H */
-92
arch/arm/include/asm/termios.h
··· 1 - #ifndef __ASM_ARM_TERMIOS_H 2 - #define __ASM_ARM_TERMIOS_H 3 - 4 - #include <asm/termbits.h> 5 - #include <asm/ioctls.h> 6 - 7 - struct winsize { 8 - unsigned short ws_row; 9 - unsigned short ws_col; 10 - unsigned short ws_xpixel; 11 - unsigned short ws_ypixel; 12 - }; 13 - 14 - #define NCC 8 15 - struct termio { 16 - unsigned short c_iflag; /* input mode flags */ 17 - unsigned short c_oflag; /* output mode flags */ 18 - unsigned short c_cflag; /* control mode flags */ 19 - unsigned short c_lflag; /* local mode flags */ 20 - unsigned char c_line; /* line discipline */ 21 - unsigned char c_cc[NCC]; /* control characters */ 22 - }; 23 - 24 - #ifdef __KERNEL__ 25 - /* intr=^C quit=^| erase=del kill=^U 26 - eof=^D vtime=\0 vmin=\1 sxtc=\0 27 - start=^Q stop=^S susp=^Z eol=\0 28 - reprint=^R discard=^U werase=^W lnext=^V 29 - eol2=\0 30 - */ 31 - #define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0" 32 - #endif 33 - 34 - /* modem lines */ 35 - #define TIOCM_LE 0x001 36 - #define TIOCM_DTR 0x002 37 - #define TIOCM_RTS 0x004 38 - #define TIOCM_ST 0x008 39 - #define TIOCM_SR 0x010 40 - #define TIOCM_CTS 0x020 41 - #define TIOCM_CAR 0x040 42 - #define TIOCM_RNG 0x080 43 - #define TIOCM_DSR 0x100 44 - #define TIOCM_CD TIOCM_CAR 45 - #define TIOCM_RI TIOCM_RNG 46 - #define TIOCM_OUT1 0x2000 47 - #define TIOCM_OUT2 0x4000 48 - #define TIOCM_LOOP 0x8000 49 - 50 - /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ 51 - 52 - #ifdef __KERNEL__ 53 - 54 - /* 55 - * Translate a "termio" structure into a "termios". Ugh. 56 - */ 57 - #define SET_LOW_TERMIOS_BITS(termios, termio, x) { \ 58 - unsigned short __tmp; \ 59 - get_user(__tmp,&(termio)->x); \ 60 - *(unsigned short *) &(termios)->x = __tmp; \ 61 - } 62 - 63 - #define user_termio_to_kernel_termios(termios, termio) \ 64 - ({ \ 65 - SET_LOW_TERMIOS_BITS(termios, termio, c_iflag); \ 66 - SET_LOW_TERMIOS_BITS(termios, termio, c_oflag); \ 67 - SET_LOW_TERMIOS_BITS(termios, termio, c_cflag); \ 68 - SET_LOW_TERMIOS_BITS(termios, termio, c_lflag); \ 69 - copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \ 70 - }) 71 - 72 - /* 73 - * Translate a "termios" structure into a "termio". Ugh. 74 - */ 75 - #define kernel_termios_to_user_termio(termio, termios) \ 76 - ({ \ 77 - put_user((termios)->c_iflag, &(termio)->c_iflag); \ 78 - put_user((termios)->c_oflag, &(termio)->c_oflag); \ 79 - put_user((termios)->c_cflag, &(termio)->c_cflag); \ 80 - put_user((termios)->c_lflag, &(termio)->c_lflag); \ 81 - put_user((termios)->c_line, &(termio)->c_line); \ 82 - copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ 83 - }) 84 - 85 - #define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios2)) 86 - #define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios2)) 87 - #define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios)) 88 - #define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios)) 89 - 90 - #endif /* __KERNEL__ */ 91 - 92 - #endif /* __ASM_ARM_TERMIOS_H */
+5 -1
arch/arm/include/asm/thread_info.h
··· 59 59 __u32 syscall; /* syscall number */ 60 60 __u8 used_cp[16]; /* thread used copro */ 61 61 unsigned long tp_value; 62 + #ifdef CONFIG_CRUNCH 62 63 struct crunch_state crunchstate; 64 + #endif 63 65 union fp_state fpstate __attribute__((aligned(8))); 64 66 union vfp_state vfpstate; 65 67 #ifdef CONFIG_ARM_THUMBEE ··· 150 148 #define TIF_NOTIFY_RESUME 2 /* callback before returning to user */ 151 149 #define TIF_SYSCALL_TRACE 8 152 150 #define TIF_SYSCALL_AUDIT 9 151 + #define TIF_SYSCALL_TRACEPOINT 10 153 152 #define TIF_POLLING_NRFLAG 16 154 153 #define TIF_USING_IWMMXT 17 155 154 #define TIF_MEMDIE 18 /* is terminating due to OOM killer */ ··· 163 160 #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) 164 161 #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) 165 162 #define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT) 163 + #define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT) 166 164 #define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) 167 165 #define _TIF_USING_IWMMXT (1 << TIF_USING_IWMMXT) 168 166 #define _TIF_SECCOMP (1 << TIF_SECCOMP) 169 167 170 168 /* Checks for any syscall work in entry-common.S */ 171 - #define _TIF_SYSCALL_WORK (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT) 169 + #define _TIF_SYSCALL_WORK (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | _TIF_SYSCALL_TRACEPOINT) 172 170 173 171 /* 174 172 * Change these and you break ASM code in entry-common.S
-6
arch/arm/include/asm/timex.h
··· 12 12 #ifndef _ASMARM_TIMEX_H 13 13 #define _ASMARM_TIMEX_H 14 14 15 - #include <asm/arch_timer.h> 16 15 #ifdef CONFIG_ARCH_MULTIPLATFORM 17 16 #define CLOCK_TICK_RATE 1000000 18 17 #else ··· 19 20 #endif 20 21 21 22 typedef unsigned long cycles_t; 22 - 23 - #ifdef ARCH_HAS_READ_CURRENT_TIMER 24 23 #define get_cycles() ({ cycles_t c; read_current_timer(&c) ? 0 : c; }) 25 - #else 26 - #define get_cycles() (0) 27 - #endif 28 24 29 25 #endif
-16
arch/arm/include/asm/types.h
··· 1 - #ifndef __ASM_ARM_TYPES_H 2 - #define __ASM_ARM_TYPES_H 3 - 4 - #include <asm-generic/int-ll64.h> 5 - 6 - /* 7 - * These aren't exported outside the kernel to avoid name space clashes 8 - */ 9 - #ifdef __KERNEL__ 10 - 11 - #define BITS_PER_LONG 32 12 - 13 - #endif /* __KERNEL__ */ 14 - 15 - #endif 16 -
-19
arch/arm/include/asm/unaligned.h
··· 1 - #ifndef _ASM_ARM_UNALIGNED_H 2 - #define _ASM_ARM_UNALIGNED_H 3 - 4 - #include <linux/unaligned/le_byteshift.h> 5 - #include <linux/unaligned/be_byteshift.h> 6 - #include <linux/unaligned/generic.h> 7 - 8 - /* 9 - * Select endianness 10 - */ 11 - #ifndef __ARMEB__ 12 - #define get_unaligned __get_unaligned_le 13 - #define put_unaligned __put_unaligned_le 14 - #else 15 - #define get_unaligned __get_unaligned_be 16 - #define put_unaligned __put_unaligned_be 17 - #endif 18 - 19 - #endif /* _ASM_ARM_UNALIGNED_H */
+8
arch/arm/include/asm/unistd.h
··· 407 407 /* 378 for kcmp */ 408 408 409 409 /* 410 + * This may need to be greater than __NR_last_syscall+1 in order to 411 + * account for the padding in the syscall table 412 + */ 413 + #ifdef __KERNEL__ 414 + #define __NR_syscalls (380) 415 + #endif /* __KERNEL__ */ 416 + 417 + /* 410 418 * The following SWIs are ARM private. 411 419 */ 412 420 #define __ARM_NR_BASE (__NR_SYSCALL_BASE+0x0f0000)
+3 -2
arch/arm/kernel/Makefile
··· 19 19 process.o ptrace.o return_address.o sched_clock.o \ 20 20 setup.o signal.o stacktrace.o sys_arm.o time.o traps.o 21 21 22 - obj-$(CONFIG_DEPRECATED_PARAM_STRUCT) += compat.o 22 + obj-$(CONFIG_ATAGS) += atags_parse.o 23 + obj-$(CONFIG_ATAGS_PROC) += atags_proc.o 24 + obj-$(CONFIG_DEPRECATED_PARAM_STRUCT) += atags_compat.o 23 25 24 26 obj-$(CONFIG_OC_ETM) += etm.o 25 27 obj-$(CONFIG_CPU_IDLE) += cpuidle.o ··· 53 51 else 54 52 test-kprobes-objs += kprobes-test-arm.o 55 53 endif 56 - obj-$(CONFIG_ATAGS_PROC) += atags.o 57 54 obj-$(CONFIG_OABI_COMPAT) += sys_oabi-compat.o 58 55 obj-$(CONFIG_ARM_THUMBEE) += thumbee.o 59 56 obj-$(CONFIG_KGDB) += kgdb.o
+280 -117
arch/arm/kernel/arch_timer.c
··· 21 21 #include <linux/io.h> 22 22 23 23 #include <asm/cputype.h> 24 + #include <asm/delay.h> 24 25 #include <asm/localtimer.h> 25 26 #include <asm/arch_timer.h> 26 27 #include <asm/system_info.h> 27 28 #include <asm/sched_clock.h> 28 29 29 30 static unsigned long arch_timer_rate; 30 - static int arch_timer_ppi; 31 - static int arch_timer_ppi2; 31 + 32 + enum ppi_nr { 33 + PHYS_SECURE_PPI, 34 + PHYS_NONSECURE_PPI, 35 + VIRT_PPI, 36 + HYP_PPI, 37 + MAX_TIMER_PPI 38 + }; 39 + 40 + static int arch_timer_ppi[MAX_TIMER_PPI]; 32 41 33 42 static struct clock_event_device __percpu **arch_timer_evt; 43 + static struct delay_timer arch_delay_timer; 34 44 35 - extern void init_current_timer_delay(unsigned long freq); 45 + static bool arch_timer_use_virtual = true; 36 46 37 47 /* 38 48 * Architected system timer support. ··· 56 46 #define ARCH_TIMER_REG_FREQ 1 57 47 #define ARCH_TIMER_REG_TVAL 2 58 48 59 - static void arch_timer_reg_write(int reg, u32 val) 49 + #define ARCH_TIMER_PHYS_ACCESS 0 50 + #define ARCH_TIMER_VIRT_ACCESS 1 51 + 52 + /* 53 + * These register accessors are marked inline so the compiler can 54 + * nicely work out which register we want, and chuck away the rest of 55 + * the code. At least it does so with a recent GCC (4.6.3). 56 + */ 57 + static inline void arch_timer_reg_write(const int access, const int reg, u32 val) 60 58 { 61 - switch (reg) { 62 - case ARCH_TIMER_REG_CTRL: 63 - asm volatile("mcr p15, 0, %0, c14, c2, 1" : : "r" (val)); 64 - break; 65 - case ARCH_TIMER_REG_TVAL: 66 - asm volatile("mcr p15, 0, %0, c14, c2, 0" : : "r" (val)); 67 - break; 59 + if (access == ARCH_TIMER_PHYS_ACCESS) { 60 + switch (reg) { 61 + case ARCH_TIMER_REG_CTRL: 62 + asm volatile("mcr p15, 0, %0, c14, c2, 1" : : "r" (val)); 63 + break; 64 + case ARCH_TIMER_REG_TVAL: 65 + asm volatile("mcr p15, 0, %0, c14, c2, 0" : : "r" (val)); 66 + break; 67 + } 68 + } 69 + 70 + if (access == ARCH_TIMER_VIRT_ACCESS) { 71 + switch (reg) { 72 + case ARCH_TIMER_REG_CTRL: 73 + asm volatile("mcr p15, 0, %0, c14, c3, 1" : : "r" (val)); 74 + break; 75 + case ARCH_TIMER_REG_TVAL: 76 + asm volatile("mcr p15, 0, %0, c14, c3, 0" : : "r" (val)); 77 + break; 78 + } 68 79 } 69 80 70 81 isb(); 71 82 } 72 83 73 - static u32 arch_timer_reg_read(int reg) 84 + static inline u32 arch_timer_reg_read(const int access, const int reg) 74 85 { 75 - u32 val; 86 + u32 val = 0; 76 87 77 - switch (reg) { 78 - case ARCH_TIMER_REG_CTRL: 79 - asm volatile("mrc p15, 0, %0, c14, c2, 1" : "=r" (val)); 80 - break; 81 - case ARCH_TIMER_REG_FREQ: 82 - asm volatile("mrc p15, 0, %0, c14, c0, 0" : "=r" (val)); 83 - break; 84 - case ARCH_TIMER_REG_TVAL: 85 - asm volatile("mrc p15, 0, %0, c14, c2, 0" : "=r" (val)); 86 - break; 87 - default: 88 - BUG(); 88 + if (access == ARCH_TIMER_PHYS_ACCESS) { 89 + switch (reg) { 90 + case ARCH_TIMER_REG_CTRL: 91 + asm volatile("mrc p15, 0, %0, c14, c2, 1" : "=r" (val)); 92 + break; 93 + case ARCH_TIMER_REG_TVAL: 94 + asm volatile("mrc p15, 0, %0, c14, c2, 0" : "=r" (val)); 95 + break; 96 + case ARCH_TIMER_REG_FREQ: 97 + asm volatile("mrc p15, 0, %0, c14, c0, 0" : "=r" (val)); 98 + break; 99 + } 100 + } 101 + 102 + if (access == ARCH_TIMER_VIRT_ACCESS) { 103 + switch (reg) { 104 + case ARCH_TIMER_REG_CTRL: 105 + asm volatile("mrc p15, 0, %0, c14, c3, 1" : "=r" (val)); 106 + break; 107 + case ARCH_TIMER_REG_TVAL: 108 + asm volatile("mrc p15, 0, %0, c14, c3, 0" : "=r" (val)); 109 + break; 110 + } 89 111 } 90 112 91 113 return val; 92 114 } 93 115 94 - static irqreturn_t arch_timer_handler(int irq, void *dev_id) 116 + static inline cycle_t arch_timer_counter_read(const int access) 95 117 { 96 - struct clock_event_device *evt = *(struct clock_event_device **)dev_id; 97 - unsigned long ctrl; 118 + cycle_t cval = 0; 98 119 99 - ctrl = arch_timer_reg_read(ARCH_TIMER_REG_CTRL); 120 + if (access == ARCH_TIMER_PHYS_ACCESS) 121 + asm volatile("mrrc p15, 0, %Q0, %R0, c14" : "=r" (cval)); 122 + 123 + if (access == ARCH_TIMER_VIRT_ACCESS) 124 + asm volatile("mrrc p15, 1, %Q0, %R0, c14" : "=r" (cval)); 125 + 126 + return cval; 127 + } 128 + 129 + static inline cycle_t arch_counter_get_cntpct(void) 130 + { 131 + return arch_timer_counter_read(ARCH_TIMER_PHYS_ACCESS); 132 + } 133 + 134 + static inline cycle_t arch_counter_get_cntvct(void) 135 + { 136 + return arch_timer_counter_read(ARCH_TIMER_VIRT_ACCESS); 137 + } 138 + 139 + static irqreturn_t inline timer_handler(const int access, 140 + struct clock_event_device *evt) 141 + { 142 + unsigned long ctrl; 143 + ctrl = arch_timer_reg_read(access, ARCH_TIMER_REG_CTRL); 100 144 if (ctrl & ARCH_TIMER_CTRL_IT_STAT) { 101 145 ctrl |= ARCH_TIMER_CTRL_IT_MASK; 102 - arch_timer_reg_write(ARCH_TIMER_REG_CTRL, ctrl); 146 + arch_timer_reg_write(access, ARCH_TIMER_REG_CTRL, ctrl); 103 147 evt->event_handler(evt); 104 148 return IRQ_HANDLED; 105 149 } ··· 161 97 return IRQ_NONE; 162 98 } 163 99 164 - static void arch_timer_disable(void) 100 + static irqreturn_t arch_timer_handler_virt(int irq, void *dev_id) 165 101 { 166 - unsigned long ctrl; 102 + struct clock_event_device *evt = *(struct clock_event_device **)dev_id; 167 103 168 - ctrl = arch_timer_reg_read(ARCH_TIMER_REG_CTRL); 169 - ctrl &= ~ARCH_TIMER_CTRL_ENABLE; 170 - arch_timer_reg_write(ARCH_TIMER_REG_CTRL, ctrl); 104 + return timer_handler(ARCH_TIMER_VIRT_ACCESS, evt); 171 105 } 172 106 173 - static void arch_timer_set_mode(enum clock_event_mode mode, 174 - struct clock_event_device *clk) 107 + static irqreturn_t arch_timer_handler_phys(int irq, void *dev_id) 175 108 { 109 + struct clock_event_device *evt = *(struct clock_event_device **)dev_id; 110 + 111 + return timer_handler(ARCH_TIMER_PHYS_ACCESS, evt); 112 + } 113 + 114 + static inline void timer_set_mode(const int access, int mode) 115 + { 116 + unsigned long ctrl; 176 117 switch (mode) { 177 118 case CLOCK_EVT_MODE_UNUSED: 178 119 case CLOCK_EVT_MODE_SHUTDOWN: 179 - arch_timer_disable(); 120 + ctrl = arch_timer_reg_read(access, ARCH_TIMER_REG_CTRL); 121 + ctrl &= ~ARCH_TIMER_CTRL_ENABLE; 122 + arch_timer_reg_write(access, ARCH_TIMER_REG_CTRL, ctrl); 180 123 break; 181 124 default: 182 125 break; 183 126 } 184 127 } 185 128 186 - static int arch_timer_set_next_event(unsigned long evt, 187 - struct clock_event_device *unused) 129 + static void arch_timer_set_mode_virt(enum clock_event_mode mode, 130 + struct clock_event_device *clk) 131 + { 132 + timer_set_mode(ARCH_TIMER_VIRT_ACCESS, mode); 133 + } 134 + 135 + static void arch_timer_set_mode_phys(enum clock_event_mode mode, 136 + struct clock_event_device *clk) 137 + { 138 + timer_set_mode(ARCH_TIMER_PHYS_ACCESS, mode); 139 + } 140 + 141 + static inline void set_next_event(const int access, unsigned long evt) 188 142 { 189 143 unsigned long ctrl; 190 - 191 - ctrl = arch_timer_reg_read(ARCH_TIMER_REG_CTRL); 144 + ctrl = arch_timer_reg_read(access, ARCH_TIMER_REG_CTRL); 192 145 ctrl |= ARCH_TIMER_CTRL_ENABLE; 193 146 ctrl &= ~ARCH_TIMER_CTRL_IT_MASK; 147 + arch_timer_reg_write(access, ARCH_TIMER_REG_TVAL, evt); 148 + arch_timer_reg_write(access, ARCH_TIMER_REG_CTRL, ctrl); 149 + } 194 150 195 - arch_timer_reg_write(ARCH_TIMER_REG_TVAL, evt); 196 - arch_timer_reg_write(ARCH_TIMER_REG_CTRL, ctrl); 151 + static int arch_timer_set_next_event_virt(unsigned long evt, 152 + struct clock_event_device *unused) 153 + { 154 + set_next_event(ARCH_TIMER_VIRT_ACCESS, evt); 155 + return 0; 156 + } 197 157 158 + static int arch_timer_set_next_event_phys(unsigned long evt, 159 + struct clock_event_device *unused) 160 + { 161 + set_next_event(ARCH_TIMER_PHYS_ACCESS, evt); 198 162 return 0; 199 163 } 200 164 201 165 static int __cpuinit arch_timer_setup(struct clock_event_device *clk) 202 166 { 203 - /* Be safe... */ 204 - arch_timer_disable(); 205 - 206 167 clk->features = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_C3STOP; 207 168 clk->name = "arch_sys_timer"; 208 169 clk->rating = 450; 209 - clk->set_mode = arch_timer_set_mode; 210 - clk->set_next_event = arch_timer_set_next_event; 211 - clk->irq = arch_timer_ppi; 170 + if (arch_timer_use_virtual) { 171 + clk->irq = arch_timer_ppi[VIRT_PPI]; 172 + clk->set_mode = arch_timer_set_mode_virt; 173 + clk->set_next_event = arch_timer_set_next_event_virt; 174 + } else { 175 + clk->irq = arch_timer_ppi[PHYS_SECURE_PPI]; 176 + clk->set_mode = arch_timer_set_mode_phys; 177 + clk->set_next_event = arch_timer_set_next_event_phys; 178 + } 179 + 180 + clk->set_mode(CLOCK_EVT_MODE_SHUTDOWN, NULL); 212 181 213 182 clockevents_config_and_register(clk, arch_timer_rate, 214 183 0xf, 0x7fffffff); 215 184 216 185 *__this_cpu_ptr(arch_timer_evt) = clk; 217 186 218 - enable_percpu_irq(clk->irq, 0); 219 - if (arch_timer_ppi2) 220 - enable_percpu_irq(arch_timer_ppi2, 0); 187 + if (arch_timer_use_virtual) 188 + enable_percpu_irq(arch_timer_ppi[VIRT_PPI], 0); 189 + else { 190 + enable_percpu_irq(arch_timer_ppi[PHYS_SECURE_PPI], 0); 191 + if (arch_timer_ppi[PHYS_NONSECURE_PPI]) 192 + enable_percpu_irq(arch_timer_ppi[PHYS_NONSECURE_PPI], 0); 193 + } 221 194 222 195 return 0; 223 196 } ··· 274 173 return -ENXIO; 275 174 276 175 if (arch_timer_rate == 0) { 277 - arch_timer_reg_write(ARCH_TIMER_REG_CTRL, 0); 278 - freq = arch_timer_reg_read(ARCH_TIMER_REG_FREQ); 176 + freq = arch_timer_reg_read(ARCH_TIMER_PHYS_ACCESS, 177 + ARCH_TIMER_REG_FREQ); 279 178 280 179 /* Check the timer frequency. */ 281 180 if (freq == 0) { ··· 286 185 arch_timer_rate = freq; 287 186 } 288 187 289 - pr_info_once("Architected local timer running at %lu.%02luMHz.\n", 290 - arch_timer_rate / 1000000, (arch_timer_rate / 10000) % 100); 188 + pr_info_once("Architected local timer running at %lu.%02luMHz (%s).\n", 189 + arch_timer_rate / 1000000, (arch_timer_rate / 10000) % 100, 190 + arch_timer_use_virtual ? "virt" : "phys"); 291 191 return 0; 292 192 } 293 193 294 - static inline cycle_t arch_counter_get_cntpct(void) 194 + static u32 notrace arch_counter_get_cntpct32(void) 295 195 { 296 - u32 cvall, cvalh; 297 - 298 - asm volatile("mrrc p15, 0, %0, %1, c14" : "=r" (cvall), "=r" (cvalh)); 299 - 300 - return ((cycle_t) cvalh << 32) | cvall; 301 - } 302 - 303 - static inline cycle_t arch_counter_get_cntvct(void) 304 - { 305 - u32 cvall, cvalh; 306 - 307 - asm volatile("mrrc p15, 1, %0, %1, c14" : "=r" (cvall), "=r" (cvalh)); 308 - 309 - return ((cycle_t) cvalh << 32) | cvall; 310 - } 311 - 312 - static u32 notrace arch_counter_get_cntvct32(void) 313 - { 314 - cycle_t cntvct = arch_counter_get_cntvct(); 196 + cycle_t cnt = arch_counter_get_cntpct(); 315 197 316 198 /* 317 199 * The sched_clock infrastructure only knows about counters 318 200 * with at most 32bits. Forget about the upper 24 bits for the 319 201 * time being... 320 202 */ 321 - return (u32)(cntvct & (u32)~0); 203 + return (u32)cnt; 204 + } 205 + 206 + static u32 notrace arch_counter_get_cntvct32(void) 207 + { 208 + cycle_t cnt = arch_counter_get_cntvct(); 209 + 210 + /* 211 + * The sched_clock infrastructure only knows about counters 212 + * with at most 32bits. Forget about the upper 24 bits for the 213 + * time being... 214 + */ 215 + return (u32)cnt; 322 216 } 323 217 324 218 static cycle_t arch_counter_read(struct clocksource *cs) 325 219 { 220 + /* 221 + * Always use the physical counter for the clocksource. 222 + * CNTHCTL.PL1PCTEN must be set to 1. 223 + */ 326 224 return arch_counter_get_cntpct(); 327 225 } 328 226 329 - int read_current_timer(unsigned long *timer_val) 227 + static unsigned long arch_timer_read_current_timer(void) 330 228 { 331 - if (!arch_timer_rate) 332 - return -ENXIO; 333 - *timer_val = arch_counter_get_cntpct(); 334 - return 0; 229 + return arch_counter_get_cntpct(); 230 + } 231 + 232 + static cycle_t arch_counter_read_cc(const struct cyclecounter *cc) 233 + { 234 + /* 235 + * Always use the physical counter for the clocksource. 236 + * CNTHCTL.PL1PCTEN must be set to 1. 237 + */ 238 + return arch_counter_get_cntpct(); 335 239 } 336 240 337 241 static struct clocksource clocksource_counter = { ··· 347 241 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 348 242 }; 349 243 244 + static struct cyclecounter cyclecounter = { 245 + .read = arch_counter_read_cc, 246 + .mask = CLOCKSOURCE_MASK(56), 247 + }; 248 + 249 + static struct timecounter timecounter; 250 + 251 + struct timecounter *arch_timer_get_timecounter(void) 252 + { 253 + return &timecounter; 254 + } 255 + 350 256 static void __cpuinit arch_timer_stop(struct clock_event_device *clk) 351 257 { 352 258 pr_debug("arch_timer_teardown disable IRQ%d cpu #%d\n", 353 259 clk->irq, smp_processor_id()); 354 - disable_percpu_irq(clk->irq); 355 - if (arch_timer_ppi2) 356 - disable_percpu_irq(arch_timer_ppi2); 357 - arch_timer_set_mode(CLOCK_EVT_MODE_UNUSED, clk); 260 + 261 + if (arch_timer_use_virtual) 262 + disable_percpu_irq(arch_timer_ppi[VIRT_PPI]); 263 + else { 264 + disable_percpu_irq(arch_timer_ppi[PHYS_SECURE_PPI]); 265 + if (arch_timer_ppi[PHYS_NONSECURE_PPI]) 266 + disable_percpu_irq(arch_timer_ppi[PHYS_NONSECURE_PPI]); 267 + } 268 + 269 + clk->set_mode(CLOCK_EVT_MODE_UNUSED, clk); 358 270 } 359 271 360 272 static struct local_timer_ops arch_timer_ops __cpuinitdata = { ··· 385 261 static int __init arch_timer_register(void) 386 262 { 387 263 int err; 264 + int ppi; 388 265 389 266 err = arch_timer_available(); 390 267 if (err) 391 - return err; 268 + goto out; 392 269 393 270 arch_timer_evt = alloc_percpu(struct clock_event_device *); 394 - if (!arch_timer_evt) 395 - return -ENOMEM; 396 - 397 - clocksource_register_hz(&clocksource_counter, arch_timer_rate); 398 - 399 - err = request_percpu_irq(arch_timer_ppi, arch_timer_handler, 400 - "arch_timer", arch_timer_evt); 401 - if (err) { 402 - pr_err("arch_timer: can't register interrupt %d (%d)\n", 403 - arch_timer_ppi, err); 404 - goto out_free; 271 + if (!arch_timer_evt) { 272 + err = -ENOMEM; 273 + goto out; 405 274 } 406 275 407 - if (arch_timer_ppi2) { 408 - err = request_percpu_irq(arch_timer_ppi2, arch_timer_handler, 276 + clocksource_register_hz(&clocksource_counter, arch_timer_rate); 277 + cyclecounter.mult = clocksource_counter.mult; 278 + cyclecounter.shift = clocksource_counter.shift; 279 + timecounter_init(&timecounter, &cyclecounter, 280 + arch_counter_get_cntpct()); 281 + 282 + if (arch_timer_use_virtual) { 283 + ppi = arch_timer_ppi[VIRT_PPI]; 284 + err = request_percpu_irq(ppi, arch_timer_handler_virt, 409 285 "arch_timer", arch_timer_evt); 410 - if (err) { 411 - pr_err("arch_timer: can't register interrupt %d (%d)\n", 412 - arch_timer_ppi2, err); 413 - arch_timer_ppi2 = 0; 414 - goto out_free_irq; 286 + } else { 287 + ppi = arch_timer_ppi[PHYS_SECURE_PPI]; 288 + err = request_percpu_irq(ppi, arch_timer_handler_phys, 289 + "arch_timer", arch_timer_evt); 290 + if (!err && arch_timer_ppi[PHYS_NONSECURE_PPI]) { 291 + ppi = arch_timer_ppi[PHYS_NONSECURE_PPI]; 292 + err = request_percpu_irq(ppi, arch_timer_handler_phys, 293 + "arch_timer", arch_timer_evt); 294 + if (err) 295 + free_percpu_irq(arch_timer_ppi[PHYS_SECURE_PPI], 296 + arch_timer_evt); 415 297 } 298 + } 299 + 300 + if (err) { 301 + pr_err("arch_timer: can't register interrupt %d (%d)\n", 302 + ppi, err); 303 + goto out_free; 416 304 } 417 305 418 306 err = local_timer_register(&arch_timer_ops); ··· 438 302 arch_timer_global_evt.cpumask = cpumask_of(0); 439 303 err = arch_timer_setup(&arch_timer_global_evt); 440 304 } 441 - 442 305 if (err) 443 306 goto out_free_irq; 444 307 445 - init_current_timer_delay(arch_timer_rate); 308 + /* Use the architected timer for the delay loop. */ 309 + arch_delay_timer.read_current_timer = &arch_timer_read_current_timer; 310 + arch_delay_timer.freq = arch_timer_rate; 311 + register_current_timer_delay(&arch_delay_timer); 446 312 return 0; 447 313 448 314 out_free_irq: 449 - free_percpu_irq(arch_timer_ppi, arch_timer_evt); 450 - if (arch_timer_ppi2) 451 - free_percpu_irq(arch_timer_ppi2, arch_timer_evt); 315 + if (arch_timer_use_virtual) 316 + free_percpu_irq(arch_timer_ppi[VIRT_PPI], arch_timer_evt); 317 + else { 318 + free_percpu_irq(arch_timer_ppi[PHYS_SECURE_PPI], 319 + arch_timer_evt); 320 + if (arch_timer_ppi[PHYS_NONSECURE_PPI]) 321 + free_percpu_irq(arch_timer_ppi[PHYS_NONSECURE_PPI], 322 + arch_timer_evt); 323 + } 452 324 453 325 out_free: 454 326 free_percpu(arch_timer_evt); 455 - 327 + out: 456 328 return err; 457 329 } 458 330 ··· 473 329 { 474 330 struct device_node *np; 475 331 u32 freq; 332 + int i; 476 333 477 334 np = of_find_matching_node(NULL, arch_timer_of_match); 478 335 if (!np) { ··· 485 340 if (!of_property_read_u32(np, "clock-frequency", &freq)) 486 341 arch_timer_rate = freq; 487 342 488 - arch_timer_ppi = irq_of_parse_and_map(np, 0); 489 - arch_timer_ppi2 = irq_of_parse_and_map(np, 1); 490 - pr_info("arch_timer: found %s irqs %d %d\n", 491 - np->name, arch_timer_ppi, arch_timer_ppi2); 343 + for (i = PHYS_SECURE_PPI; i < MAX_TIMER_PPI; i++) 344 + arch_timer_ppi[i] = irq_of_parse_and_map(np, i); 345 + 346 + /* 347 + * If no interrupt provided for virtual timer, we'll have to 348 + * stick to the physical timer. It'd better be accessible... 349 + */ 350 + if (!arch_timer_ppi[VIRT_PPI]) { 351 + arch_timer_use_virtual = false; 352 + 353 + if (!arch_timer_ppi[PHYS_SECURE_PPI] || 354 + !arch_timer_ppi[PHYS_NONSECURE_PPI]) { 355 + pr_warn("arch_timer: No interrupt available, giving up\n"); 356 + return -EINVAL; 357 + } 358 + } 492 359 493 360 return arch_timer_register(); 494 361 } 495 362 496 363 int __init arch_timer_sched_clock_init(void) 497 364 { 365 + u32 (*cnt32)(void); 498 366 int err; 499 367 500 368 err = arch_timer_available(); 501 369 if (err) 502 370 return err; 503 371 504 - setup_sched_clock(arch_counter_get_cntvct32, 32, arch_timer_rate); 372 + if (arch_timer_use_virtual) 373 + cnt32 = arch_counter_get_cntvct32; 374 + else 375 + cnt32 = arch_counter_get_cntpct32; 376 + 377 + setup_sched_clock(cnt32, 32, arch_timer_rate); 505 378 return 0; 506 379 }
+2
arch/arm/kernel/asm-offsets.c
··· 59 59 DEFINE(TI_USED_CP, offsetof(struct thread_info, used_cp)); 60 60 DEFINE(TI_TP_VALUE, offsetof(struct thread_info, tp_value)); 61 61 DEFINE(TI_FPSTATE, offsetof(struct thread_info, fpstate)); 62 + #ifdef CONFIG_VFP 62 63 DEFINE(TI_VFPSTATE, offsetof(struct thread_info, vfpstate)); 63 64 #ifdef CONFIG_SMP 64 65 DEFINE(VFP_CPU, offsetof(union vfp_state, hard.cpu)); 66 + #endif 65 67 #endif 66 68 #ifdef CONFIG_ARM_THUMBEE 67 69 DEFINE(TI_THUMBEE_STATE, offsetof(struct thread_info, thumbee_state));
arch/arm/kernel/atags.c arch/arm/kernel/atags_proc.c
+14
arch/arm/kernel/atags.h
··· 3 3 #else 4 4 static inline void save_atags(struct tag *tags) { } 5 5 #endif 6 + 7 + void convert_to_tag_list(struct tag *tags); 8 + 9 + #ifdef CONFIG_ATAGS 10 + struct machine_desc *setup_machine_tags(phys_addr_t __atags_pointer, unsigned int machine_nr); 11 + #else 12 + static inline struct machine_desc * 13 + setup_machine_tags(phys_addr_t __atags_pointer, unsigned int machine_nr) 14 + { 15 + early_print("no ATAGS support: can't continue\n"); 16 + while (true); 17 + unreachable(); 18 + } 19 + #endif
+238
arch/arm/kernel/atags_parse.c
··· 1 + /* 2 + * Tag parsing. 3 + * 4 + * Copyright (C) 1995-2001 Russell King 5 + * 6 + * This program is free software; you can redistribute it and/or modify 7 + * it under the terms of the GNU General Public License version 2 as 8 + * published by the Free Software Foundation. 9 + */ 10 + 11 + /* 12 + * This is the traditional way of passing data to the kernel at boot time. Rather 13 + * than passing a fixed inflexible structure to the kernel, we pass a list 14 + * of variable-sized tags to the kernel. The first tag must be a ATAG_CORE 15 + * tag for the list to be recognised (to distinguish the tagged list from 16 + * a param_struct). The list is terminated with a zero-length tag (this tag 17 + * is not parsed in any way). 18 + */ 19 + 20 + #include <linux/init.h> 21 + #include <linux/kernel.h> 22 + #include <linux/fs.h> 23 + #include <linux/root_dev.h> 24 + #include <linux/screen_info.h> 25 + 26 + #include <asm/setup.h> 27 + #include <asm/system_info.h> 28 + #include <asm/page.h> 29 + #include <asm/mach/arch.h> 30 + 31 + #include "atags.h" 32 + 33 + static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE; 34 + 35 + #ifndef MEM_SIZE 36 + #define MEM_SIZE (16*1024*1024) 37 + #endif 38 + 39 + static struct { 40 + struct tag_header hdr1; 41 + struct tag_core core; 42 + struct tag_header hdr2; 43 + struct tag_mem32 mem; 44 + struct tag_header hdr3; 45 + } default_tags __initdata = { 46 + { tag_size(tag_core), ATAG_CORE }, 47 + { 1, PAGE_SIZE, 0xff }, 48 + { tag_size(tag_mem32), ATAG_MEM }, 49 + { MEM_SIZE }, 50 + { 0, ATAG_NONE } 51 + }; 52 + 53 + static int __init parse_tag_core(const struct tag *tag) 54 + { 55 + if (tag->hdr.size > 2) { 56 + if ((tag->u.core.flags & 1) == 0) 57 + root_mountflags &= ~MS_RDONLY; 58 + ROOT_DEV = old_decode_dev(tag->u.core.rootdev); 59 + } 60 + return 0; 61 + } 62 + 63 + __tagtable(ATAG_CORE, parse_tag_core); 64 + 65 + static int __init parse_tag_mem32(const struct tag *tag) 66 + { 67 + return arm_add_memory(tag->u.mem.start, tag->u.mem.size); 68 + } 69 + 70 + __tagtable(ATAG_MEM, parse_tag_mem32); 71 + 72 + #if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_DUMMY_CONSOLE) 73 + static int __init parse_tag_videotext(const struct tag *tag) 74 + { 75 + screen_info.orig_x = tag->u.videotext.x; 76 + screen_info.orig_y = tag->u.videotext.y; 77 + screen_info.orig_video_page = tag->u.videotext.video_page; 78 + screen_info.orig_video_mode = tag->u.videotext.video_mode; 79 + screen_info.orig_video_cols = tag->u.videotext.video_cols; 80 + screen_info.orig_video_ega_bx = tag->u.videotext.video_ega_bx; 81 + screen_info.orig_video_lines = tag->u.videotext.video_lines; 82 + screen_info.orig_video_isVGA = tag->u.videotext.video_isvga; 83 + screen_info.orig_video_points = tag->u.videotext.video_points; 84 + return 0; 85 + } 86 + 87 + __tagtable(ATAG_VIDEOTEXT, parse_tag_videotext); 88 + #endif 89 + 90 + #ifdef CONFIG_BLK_DEV_RAM 91 + static int __init parse_tag_ramdisk(const struct tag *tag) 92 + { 93 + extern int rd_size, rd_image_start, rd_prompt, rd_doload; 94 + 95 + rd_image_start = tag->u.ramdisk.start; 96 + rd_doload = (tag->u.ramdisk.flags & 1) == 0; 97 + rd_prompt = (tag->u.ramdisk.flags & 2) == 0; 98 + 99 + if (tag->u.ramdisk.size) 100 + rd_size = tag->u.ramdisk.size; 101 + 102 + return 0; 103 + } 104 + 105 + __tagtable(ATAG_RAMDISK, parse_tag_ramdisk); 106 + #endif 107 + 108 + static int __init parse_tag_serialnr(const struct tag *tag) 109 + { 110 + system_serial_low = tag->u.serialnr.low; 111 + system_serial_high = tag->u.serialnr.high; 112 + return 0; 113 + } 114 + 115 + __tagtable(ATAG_SERIAL, parse_tag_serialnr); 116 + 117 + static int __init parse_tag_revision(const struct tag *tag) 118 + { 119 + system_rev = tag->u.revision.rev; 120 + return 0; 121 + } 122 + 123 + __tagtable(ATAG_REVISION, parse_tag_revision); 124 + 125 + static int __init parse_tag_cmdline(const struct tag *tag) 126 + { 127 + #if defined(CONFIG_CMDLINE_EXTEND) 128 + strlcat(default_command_line, " ", COMMAND_LINE_SIZE); 129 + strlcat(default_command_line, tag->u.cmdline.cmdline, 130 + COMMAND_LINE_SIZE); 131 + #elif defined(CONFIG_CMDLINE_FORCE) 132 + pr_warning("Ignoring tag cmdline (using the default kernel command line)\n"); 133 + #else 134 + strlcpy(default_command_line, tag->u.cmdline.cmdline, 135 + COMMAND_LINE_SIZE); 136 + #endif 137 + return 0; 138 + } 139 + 140 + __tagtable(ATAG_CMDLINE, parse_tag_cmdline); 141 + 142 + /* 143 + * Scan the tag table for this tag, and call its parse function. 144 + * The tag table is built by the linker from all the __tagtable 145 + * declarations. 146 + */ 147 + static int __init parse_tag(const struct tag *tag) 148 + { 149 + extern struct tagtable __tagtable_begin, __tagtable_end; 150 + struct tagtable *t; 151 + 152 + for (t = &__tagtable_begin; t < &__tagtable_end; t++) 153 + if (tag->hdr.tag == t->tag) { 154 + t->parse(tag); 155 + break; 156 + } 157 + 158 + return t < &__tagtable_end; 159 + } 160 + 161 + /* 162 + * Parse all tags in the list, checking both the global and architecture 163 + * specific tag tables. 164 + */ 165 + static void __init parse_tags(const struct tag *t) 166 + { 167 + for (; t->hdr.size; t = tag_next(t)) 168 + if (!parse_tag(t)) 169 + printk(KERN_WARNING 170 + "Ignoring unrecognised tag 0x%08x\n", 171 + t->hdr.tag); 172 + } 173 + 174 + static void __init squash_mem_tags(struct tag *tag) 175 + { 176 + for (; tag->hdr.size; tag = tag_next(tag)) 177 + if (tag->hdr.tag == ATAG_MEM) 178 + tag->hdr.tag = ATAG_NONE; 179 + } 180 + 181 + struct machine_desc * __init setup_machine_tags(phys_addr_t __atags_pointer, 182 + unsigned int machine_nr) 183 + { 184 + struct tag *tags = (struct tag *)&default_tags; 185 + struct machine_desc *mdesc = NULL, *p; 186 + char *from = default_command_line; 187 + 188 + default_tags.mem.start = PHYS_OFFSET; 189 + 190 + /* 191 + * locate machine in the list of supported machines. 192 + */ 193 + for_each_machine_desc(p) 194 + if (machine_nr == p->nr) { 195 + printk("Machine: %s\n", p->name); 196 + mdesc = p; 197 + break; 198 + } 199 + 200 + if (!mdesc) { 201 + early_print("\nError: unrecognized/unsupported machine ID" 202 + " (r1 = 0x%08x).\n\n", machine_nr); 203 + dump_machine_table(); /* does not return */ 204 + } 205 + 206 + if (__atags_pointer) 207 + tags = phys_to_virt(__atags_pointer); 208 + else if (mdesc->atag_offset) 209 + tags = (void *)(PAGE_OFFSET + mdesc->atag_offset); 210 + 211 + #if defined(CONFIG_DEPRECATED_PARAM_STRUCT) 212 + /* 213 + * If we have the old style parameters, convert them to 214 + * a tag list. 215 + */ 216 + if (tags->hdr.tag != ATAG_CORE) 217 + convert_to_tag_list(tags); 218 + #endif 219 + if (tags->hdr.tag != ATAG_CORE) { 220 + early_print("Warning: Neither atags nor dtb found\n"); 221 + tags = (struct tag *)&default_tags; 222 + } 223 + 224 + if (mdesc->fixup) 225 + mdesc->fixup(tags, &from, &meminfo); 226 + 227 + if (tags->hdr.tag == ATAG_CORE) { 228 + if (meminfo.nr_banks != 0) 229 + squash_mem_tags(tags); 230 + save_atags(tags); 231 + parse_tags(tags); 232 + } 233 + 234 + /* parse_early_param needs a boot_command_line */ 235 + strlcpy(boot_command_line, from, COMMAND_LINE_SIZE); 236 + 237 + return mdesc; 238 + }
+2 -2
arch/arm/kernel/compat.c arch/arm/kernel/atags_compat.c
··· 1 1 /* 2 - * linux/arch/arm/kernel/compat.c 2 + * linux/arch/arm/kernel/atags_compat.c 3 3 * 4 4 * Copyright (C) 2001 Russell King 5 5 * ··· 26 26 27 27 #include <asm/mach/arch.h> 28 28 29 - #include "compat.h" 29 + #include "atags.h" 30 30 31 31 /* 32 32 * Usage:
-11
arch/arm/kernel/compat.h
··· 1 - /* 2 - * linux/arch/arm/kernel/compat.h 3 - * 4 - * Copyright (C) 2001 Russell King 5 - * 6 - * This program is free software; you can redistribute it and/or modify 7 - * it under the terms of the GNU General Public License version 2 as 8 - * published by the Free Software Foundation. 9 - */ 10 - 11 - extern void convert_to_tag_list(struct tag *tags);
+9
arch/arm/kernel/entry-common.S
··· 94 94 .equ NR_syscalls,0 95 95 #define CALL(x) .equ NR_syscalls,NR_syscalls+1 96 96 #include "calls.S" 97 + 98 + /* 99 + * Ensure that the system call table is equal to __NR_syscalls, 100 + * which is the value the rest of the system sees 101 + */ 102 + .ifne NR_syscalls - __NR_syscalls 103 + .error "__NR_syscalls is not equal to the size of the syscall table" 104 + .endif 105 + 97 106 #undef CALL 98 107 #define CALL(x) .long x 99 108
+28 -1
arch/arm/kernel/machine_kexec.c
··· 8 8 #include <linux/reboot.h> 9 9 #include <linux/io.h> 10 10 #include <linux/irq.h> 11 + #include <linux/memblock.h> 11 12 #include <asm/pgtable.h> 13 + #include <linux/of_fdt.h> 12 14 #include <asm/pgalloc.h> 13 15 #include <asm/mmu_context.h> 14 16 #include <asm/cacheflush.h> ··· 34 32 35 33 int machine_kexec_prepare(struct kimage *image) 36 34 { 35 + struct kexec_segment *current_segment; 36 + __be32 header; 37 + int i, err; 38 + 39 + /* 40 + * No segment at default ATAGs address. try to locate 41 + * a dtb using magic. 42 + */ 43 + for (i = 0; i < image->nr_segments; i++) { 44 + current_segment = &image->segment[i]; 45 + 46 + err = memblock_is_region_memory(current_segment->mem, 47 + current_segment->memsz); 48 + if (err) 49 + return - EINVAL; 50 + 51 + err = get_user(header, (__be32*)current_segment->buf); 52 + if (err) 53 + return err; 54 + 55 + if (be32_to_cpu(header) == OF_DT_HEADER) 56 + kexec_boot_atags = current_segment->mem; 57 + } 37 58 return 0; 38 59 } 39 60 ··· 147 122 kexec_start_address = image->start; 148 123 kexec_indirection_page = page_list; 149 124 kexec_mach_type = machine_arch_type; 150 - kexec_boot_atags = image->start - KEXEC_ARM_ZIMAGE_OFFSET + KEXEC_ARM_ATAGS_OFFSET; 125 + if (!kexec_boot_atags) 126 + kexec_boot_atags = image->start - KEXEC_ARM_ZIMAGE_OFFSET + KEXEC_ARM_ATAGS_OFFSET; 127 + 151 128 152 129 /* copy our kernel relocation code to the control code page */ 153 130 memcpy(reboot_code_buffer,
+13 -6
arch/arm/kernel/ptrace.c
··· 30 30 #include <asm/pgtable.h> 31 31 #include <asm/traps.h> 32 32 33 + #define CREATE_TRACE_POINTS 34 + #include <trace/events/syscalls.h> 35 + 33 36 #define REG_PC 15 34 37 #define REG_PSR 16 35 38 /* ··· 921 918 { 922 919 unsigned long ip; 923 920 921 + current_thread_info()->syscall = scno; 922 + 924 923 if (!test_thread_flag(TIF_SYSCALL_TRACE)) 925 924 return scno; 926 - 927 - current_thread_info()->syscall = scno; 928 925 929 926 /* 930 927 * IP is used to denote syscall entry/exit: ··· 944 941 945 942 asmlinkage int syscall_trace_enter(struct pt_regs *regs, int scno) 946 943 { 947 - int ret = ptrace_syscall_trace(regs, scno, PTRACE_SYSCALL_ENTER); 944 + scno = ptrace_syscall_trace(regs, scno, PTRACE_SYSCALL_ENTER); 945 + if (test_thread_flag(TIF_SYSCALL_TRACEPOINT)) 946 + trace_sys_enter(regs, scno); 948 947 audit_syscall_entry(AUDIT_ARCH_ARM, scno, regs->ARM_r0, regs->ARM_r1, 949 948 regs->ARM_r2, regs->ARM_r3); 950 - return ret; 949 + return scno; 951 950 } 952 951 953 952 asmlinkage int syscall_trace_exit(struct pt_regs *regs, int scno) 954 953 { 955 - int ret = ptrace_syscall_trace(regs, scno, PTRACE_SYSCALL_EXIT); 954 + scno = ptrace_syscall_trace(regs, scno, PTRACE_SYSCALL_EXIT); 955 + if (test_thread_flag(TIF_SYSCALL_TRACEPOINT)) 956 + trace_sys_exit(regs, scno); 956 957 audit_syscall_exit(regs); 957 - return ret; 958 + return scno; 958 959 }
+8
arch/arm/kernel/sched_clock.c
··· 9 9 #include <linux/init.h> 10 10 #include <linux/jiffies.h> 11 11 #include <linux/kernel.h> 12 + #include <linux/moduleparam.h> 12 13 #include <linux/sched.h> 13 14 #include <linux/syscore_ops.h> 14 15 #include <linux/timer.h> ··· 28 27 29 28 static void sched_clock_poll(unsigned long wrap_ticks); 30 29 static DEFINE_TIMER(sched_clock_timer, sched_clock_poll, 0, 0); 30 + static int irqtime = -1; 31 + 32 + core_param(irqtime, irqtime, int, 0400); 31 33 32 34 static struct clock_data cd = { 33 35 .mult = NSEC_PER_SEC / HZ, ··· 160 156 * Ensure that sched_clock() starts off at 0ns 161 157 */ 162 158 cd.epoch_ns = 0; 159 + 160 + /* Enable IRQ time accounting if we have a fast enough sched_clock */ 161 + if (irqtime > 0 || (irqtime == -1 && rate >= 1000000)) 162 + enable_sched_clock_irqtime(); 163 163 164 164 pr_debug("Registered %pF as sched_clock source\n", read); 165 165 }
+1 -235
arch/arm/kernel/setup.c
··· 21 21 #include <linux/init.h> 22 22 #include <linux/kexec.h> 23 23 #include <linux/of_fdt.h> 24 - #include <linux/root_dev.h> 25 24 #include <linux/cpu.h> 26 25 #include <linux/interrupt.h> 27 26 #include <linux/smp.h> 28 - #include <linux/fs.h> 29 27 #include <linux/proc_fs.h> 30 28 #include <linux/memblock.h> 31 29 #include <linux/bug.h> ··· 54 56 #include <asm/unwind.h> 55 57 #include <asm/memblock.h> 56 58 57 - #if defined(CONFIG_DEPRECATED_PARAM_STRUCT) 58 - #include "compat.h" 59 - #endif 60 59 #include "atags.h" 61 60 #include "tcm.h" 62 61 63 - #ifndef MEM_SIZE 64 - #define MEM_SIZE (16*1024*1024) 65 - #endif 66 62 67 63 #if defined(CONFIG_FPE_NWFPE) || defined(CONFIG_FPE_FASTFPE) 68 64 char fpe_type[8]; ··· 137 145 static char __initdata cmd_line[COMMAND_LINE_SIZE]; 138 146 struct machine_desc *machine_desc __initdata; 139 147 140 - static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE; 141 148 static union { char c[4]; unsigned long l; } endian_test __initdata = { { 'l', '?', '?', 'b' } }; 142 149 #define ENDIANNESS ((char)endian_test.l) 143 150 ··· 574 583 } 575 584 early_param("mem", early_mem); 576 585 577 - static void __init 578 - setup_ramdisk(int doload, int prompt, int image_start, unsigned int rd_sz) 579 - { 580 - #ifdef CONFIG_BLK_DEV_RAM 581 - extern int rd_size, rd_image_start, rd_prompt, rd_doload; 582 - 583 - rd_image_start = image_start; 584 - rd_prompt = prompt; 585 - rd_doload = doload; 586 - 587 - if (rd_sz) 588 - rd_size = rd_sz; 589 - #endif 590 - } 591 - 592 586 static void __init request_standard_resources(struct machine_desc *mdesc) 593 587 { 594 588 struct memblock_region *region; ··· 619 643 request_resource(&ioport_resource, &lp2); 620 644 } 621 645 622 - /* 623 - * Tag parsing. 624 - * 625 - * This is the new way of passing data to the kernel at boot time. Rather 626 - * than passing a fixed inflexible structure to the kernel, we pass a list 627 - * of variable-sized tags to the kernel. The first tag must be a ATAG_CORE 628 - * tag for the list to be recognised (to distinguish the tagged list from 629 - * a param_struct). The list is terminated with a zero-length tag (this tag 630 - * is not parsed in any way). 631 - */ 632 - static int __init parse_tag_core(const struct tag *tag) 633 - { 634 - if (tag->hdr.size > 2) { 635 - if ((tag->u.core.flags & 1) == 0) 636 - root_mountflags &= ~MS_RDONLY; 637 - ROOT_DEV = old_decode_dev(tag->u.core.rootdev); 638 - } 639 - return 0; 640 - } 641 - 642 - __tagtable(ATAG_CORE, parse_tag_core); 643 - 644 - static int __init parse_tag_mem32(const struct tag *tag) 645 - { 646 - return arm_add_memory(tag->u.mem.start, tag->u.mem.size); 647 - } 648 - 649 - __tagtable(ATAG_MEM, parse_tag_mem32); 650 - 651 646 #if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_DUMMY_CONSOLE) 652 647 struct screen_info screen_info = { 653 648 .orig_video_lines = 30, ··· 628 681 .orig_video_isVGA = 1, 629 682 .orig_video_points = 8 630 683 }; 631 - 632 - static int __init parse_tag_videotext(const struct tag *tag) 633 - { 634 - screen_info.orig_x = tag->u.videotext.x; 635 - screen_info.orig_y = tag->u.videotext.y; 636 - screen_info.orig_video_page = tag->u.videotext.video_page; 637 - screen_info.orig_video_mode = tag->u.videotext.video_mode; 638 - screen_info.orig_video_cols = tag->u.videotext.video_cols; 639 - screen_info.orig_video_ega_bx = tag->u.videotext.video_ega_bx; 640 - screen_info.orig_video_lines = tag->u.videotext.video_lines; 641 - screen_info.orig_video_isVGA = tag->u.videotext.video_isvga; 642 - screen_info.orig_video_points = tag->u.videotext.video_points; 643 - return 0; 644 - } 645 - 646 - __tagtable(ATAG_VIDEOTEXT, parse_tag_videotext); 647 684 #endif 648 - 649 - static int __init parse_tag_ramdisk(const struct tag *tag) 650 - { 651 - setup_ramdisk((tag->u.ramdisk.flags & 1) == 0, 652 - (tag->u.ramdisk.flags & 2) == 0, 653 - tag->u.ramdisk.start, tag->u.ramdisk.size); 654 - return 0; 655 - } 656 - 657 - __tagtable(ATAG_RAMDISK, parse_tag_ramdisk); 658 - 659 - static int __init parse_tag_serialnr(const struct tag *tag) 660 - { 661 - system_serial_low = tag->u.serialnr.low; 662 - system_serial_high = tag->u.serialnr.high; 663 - return 0; 664 - } 665 - 666 - __tagtable(ATAG_SERIAL, parse_tag_serialnr); 667 - 668 - static int __init parse_tag_revision(const struct tag *tag) 669 - { 670 - system_rev = tag->u.revision.rev; 671 - return 0; 672 - } 673 - 674 - __tagtable(ATAG_REVISION, parse_tag_revision); 675 - 676 - static int __init parse_tag_cmdline(const struct tag *tag) 677 - { 678 - #if defined(CONFIG_CMDLINE_EXTEND) 679 - strlcat(default_command_line, " ", COMMAND_LINE_SIZE); 680 - strlcat(default_command_line, tag->u.cmdline.cmdline, 681 - COMMAND_LINE_SIZE); 682 - #elif defined(CONFIG_CMDLINE_FORCE) 683 - pr_warning("Ignoring tag cmdline (using the default kernel command line)\n"); 684 - #else 685 - strlcpy(default_command_line, tag->u.cmdline.cmdline, 686 - COMMAND_LINE_SIZE); 687 - #endif 688 - return 0; 689 - } 690 - 691 - __tagtable(ATAG_CMDLINE, parse_tag_cmdline); 692 - 693 - /* 694 - * Scan the tag table for this tag, and call its parse function. 695 - * The tag table is built by the linker from all the __tagtable 696 - * declarations. 697 - */ 698 - static int __init parse_tag(const struct tag *tag) 699 - { 700 - extern struct tagtable __tagtable_begin, __tagtable_end; 701 - struct tagtable *t; 702 - 703 - for (t = &__tagtable_begin; t < &__tagtable_end; t++) 704 - if (tag->hdr.tag == t->tag) { 705 - t->parse(tag); 706 - break; 707 - } 708 - 709 - return t < &__tagtable_end; 710 - } 711 - 712 - /* 713 - * Parse all tags in the list, checking both the global and architecture 714 - * specific tag tables. 715 - */ 716 - static void __init parse_tags(const struct tag *t) 717 - { 718 - for (; t->hdr.size; t = tag_next(t)) 719 - if (!parse_tag(t)) 720 - printk(KERN_WARNING 721 - "Ignoring unrecognised tag 0x%08x\n", 722 - t->hdr.tag); 723 - } 724 - 725 - /* 726 - * This holds our defaults. 727 - */ 728 - static struct init_tags { 729 - struct tag_header hdr1; 730 - struct tag_core core; 731 - struct tag_header hdr2; 732 - struct tag_mem32 mem; 733 - struct tag_header hdr3; 734 - } init_tags __initdata = { 735 - { tag_size(tag_core), ATAG_CORE }, 736 - { 1, PAGE_SIZE, 0xff }, 737 - { tag_size(tag_mem32), ATAG_MEM }, 738 - { MEM_SIZE }, 739 - { 0, ATAG_NONE } 740 - }; 741 685 742 686 static int __init customize_machine(void) 743 687 { ··· 696 858 static inline void reserve_crashkernel(void) {} 697 859 #endif /* CONFIG_KEXEC */ 698 860 699 - static void __init squash_mem_tags(struct tag *tag) 700 - { 701 - for (; tag->hdr.size; tag = tag_next(tag)) 702 - if (tag->hdr.tag == ATAG_MEM) 703 - tag->hdr.tag = ATAG_NONE; 704 - } 705 - 706 - static struct machine_desc * __init setup_machine_tags(unsigned int nr) 707 - { 708 - struct tag *tags = (struct tag *)&init_tags; 709 - struct machine_desc *mdesc = NULL, *p; 710 - char *from = default_command_line; 711 - 712 - init_tags.mem.start = PHYS_OFFSET; 713 - 714 - /* 715 - * locate machine in the list of supported machines. 716 - */ 717 - for_each_machine_desc(p) 718 - if (nr == p->nr) { 719 - printk("Machine: %s\n", p->name); 720 - mdesc = p; 721 - break; 722 - } 723 - 724 - if (!mdesc) { 725 - early_print("\nError: unrecognized/unsupported machine ID" 726 - " (r1 = 0x%08x).\n\n", nr); 727 - dump_machine_table(); /* does not return */ 728 - } 729 - 730 - if (__atags_pointer) 731 - tags = phys_to_virt(__atags_pointer); 732 - else if (mdesc->atag_offset) 733 - tags = (void *)(PAGE_OFFSET + mdesc->atag_offset); 734 - 735 - #if defined(CONFIG_DEPRECATED_PARAM_STRUCT) 736 - /* 737 - * If we have the old style parameters, convert them to 738 - * a tag list. 739 - */ 740 - if (tags->hdr.tag != ATAG_CORE) 741 - convert_to_tag_list(tags); 742 - #endif 743 - 744 - if (tags->hdr.tag != ATAG_CORE) { 745 - #if defined(CONFIG_OF) 746 - /* 747 - * If CONFIG_OF is set, then assume this is a reasonably 748 - * modern system that should pass boot parameters 749 - */ 750 - early_print("Warning: Neither atags nor dtb found\n"); 751 - #endif 752 - tags = (struct tag *)&init_tags; 753 - } 754 - 755 - if (mdesc->fixup) 756 - mdesc->fixup(tags, &from, &meminfo); 757 - 758 - if (tags->hdr.tag == ATAG_CORE) { 759 - if (meminfo.nr_banks != 0) 760 - squash_mem_tags(tags); 761 - save_atags(tags); 762 - parse_tags(tags); 763 - } 764 - 765 - /* parse_early_param needs a boot_command_line */ 766 - strlcpy(boot_command_line, from, COMMAND_LINE_SIZE); 767 - 768 - return mdesc; 769 - } 770 - 771 861 static int __init meminfo_cmp(const void *_a, const void *_b) 772 862 { 773 863 const struct membank *a = _a, *b = _b; ··· 710 944 setup_processor(); 711 945 mdesc = setup_machine_fdt(__atags_pointer); 712 946 if (!mdesc) 713 - mdesc = setup_machine_tags(machine_arch_type); 947 + mdesc = setup_machine_tags(__atags_pointer, machine_arch_type); 714 948 machine_desc = mdesc; 715 949 machine_name = mdesc->name; 716 950
+9 -4
arch/arm/kernel/smp.c
··· 59 59 volatile int __cpuinitdata pen_release = -1; 60 60 61 61 enum ipi_msg_type { 62 - IPI_TIMER = 2, 62 + IPI_WAKEUP, 63 + IPI_TIMER, 63 64 IPI_RESCHEDULE, 64 65 IPI_CALL_FUNC, 65 66 IPI_CALL_FUNC_SINGLE, ··· 415 414 } 416 415 417 416 static const char *ipi_types[NR_IPI] = { 418 - #define S(x,s) [x - IPI_TIMER] = s 417 + #define S(x,s) [x] = s 418 + S(IPI_WAKEUP, "CPU wakeup interrupts"), 419 419 S(IPI_TIMER, "Timer broadcast interrupts"), 420 420 S(IPI_RESCHEDULE, "Rescheduling interrupts"), 421 421 S(IPI_CALL_FUNC, "Function call interrupts"), ··· 569 567 unsigned int cpu = smp_processor_id(); 570 568 struct pt_regs *old_regs = set_irq_regs(regs); 571 569 572 - if (ipinr >= IPI_TIMER && ipinr < IPI_TIMER + NR_IPI) 573 - __inc_irq_stat(cpu, ipi_irqs[ipinr - IPI_TIMER]); 570 + if (ipinr < NR_IPI) 571 + __inc_irq_stat(cpu, ipi_irqs[ipinr]); 574 572 575 573 switch (ipinr) { 574 + case IPI_WAKEUP: 575 + break; 576 + 576 577 case IPI_TIMER: 577 578 irq_enter(); 578 579 ipi_timer();
+26 -9
arch/arm/lib/delay.c
··· 34 34 .udelay = __loop_udelay, 35 35 }; 36 36 37 - #ifdef ARCH_HAS_READ_CURRENT_TIMER 37 + static const struct delay_timer *delay_timer; 38 + static bool delay_calibrated; 39 + 40 + int read_current_timer(unsigned long *timer_val) 41 + { 42 + if (!delay_timer) 43 + return -ENXIO; 44 + 45 + *timer_val = delay_timer->read_current_timer(); 46 + return 0; 47 + } 48 + 38 49 static void __timer_delay(unsigned long cycles) 39 50 { 40 51 cycles_t start = get_cycles(); ··· 66 55 __timer_const_udelay(usecs * UDELAY_MULT); 67 56 } 68 57 69 - void __init init_current_timer_delay(unsigned long freq) 58 + void __init register_current_timer_delay(const struct delay_timer *timer) 70 59 { 71 - pr_info("Switching to timer-based delay loop\n"); 72 - lpj_fine = freq / HZ; 73 - loops_per_jiffy = lpj_fine; 74 - arm_delay_ops.delay = __timer_delay; 75 - arm_delay_ops.const_udelay = __timer_const_udelay; 76 - arm_delay_ops.udelay = __timer_udelay; 60 + if (!delay_calibrated) { 61 + pr_info("Switching to timer-based delay loop\n"); 62 + delay_timer = timer; 63 + lpj_fine = timer->freq / HZ; 64 + loops_per_jiffy = lpj_fine; 65 + arm_delay_ops.delay = __timer_delay; 66 + arm_delay_ops.const_udelay = __timer_const_udelay; 67 + arm_delay_ops.udelay = __timer_udelay; 68 + delay_calibrated = true; 69 + } else { 70 + pr_info("Ignoring duplicate/late registration of read_current_timer delay\n"); 71 + } 77 72 } 78 73 79 74 unsigned long __cpuinit calibrate_delay_is_known(void) 80 75 { 76 + delay_calibrated = true; 81 77 return lpj_fine; 82 78 } 83 - #endif
+1 -1
arch/arm/mach-exynos/platsmp.c
··· 134 134 135 135 __raw_writel(virt_to_phys(exynos4_secondary_startup), 136 136 CPU1_BOOT_REG); 137 - gic_raise_softirq(cpumask_of(cpu), 1); 137 + gic_raise_softirq(cpumask_of(cpu), 0); 138 138 139 139 if (pen_release == -1) 140 140 break;
+3
arch/arm/mach-integrator/common.h
··· 1 + #include <linux/amba/serial.h> 2 + extern struct amba_pl010_data integrator_uart_data; 1 3 void integrator_init_early(void); 4 + int integrator_init(bool is_cp); 2 5 void integrator_reserve(void); 3 6 void integrator_restart(char, const char *);
+11 -6
arch/arm/mach-integrator/core.c
··· 32 32 #include <asm/mach/time.h> 33 33 #include <asm/pgtable.h> 34 34 35 - static struct amba_pl010_data integrator_uart_data; 35 + #include "common.h" 36 + 37 + #ifdef CONFIG_ATAGS 36 38 37 39 #define INTEGRATOR_RTC_IRQ { IRQ_RTCINT } 38 40 #define INTEGRATOR_UART0_IRQ { IRQ_UARTINT0 } ··· 62 60 &kmi1_device, 63 61 }; 64 62 65 - static int __init integrator_init(void) 63 + int __init integrator_init(bool is_cp) 66 64 { 67 65 int i; 68 66 ··· 71 69 * hard-code them. The Integator/CP and forward have proper cell IDs. 72 70 * Else we leave them undefined to the bus driver can autoprobe them. 73 71 */ 74 - if (machine_is_integrator()) { 72 + if (!is_cp) { 75 73 rtc_device.periphid = 0x00041030; 76 74 uart0_device.periphid = 0x00041010; 77 75 uart1_device.periphid = 0x00041010; ··· 87 85 return 0; 88 86 } 89 87 90 - arch_initcall(integrator_init); 88 + #endif 91 89 92 90 /* 93 91 * On the Integrator platform, the port RTS and DTR are provided by ··· 102 100 static void integrator_uart_set_mctrl(struct amba_device *dev, void __iomem *base, unsigned int mctrl) 103 101 { 104 102 unsigned int ctrls = 0, ctrlc = 0, rts_mask, dtr_mask; 103 + u32 phybase = dev->res.start; 105 104 106 - if (dev == &uart0_device) { 105 + if (phybase == INTEGRATOR_UART0_BASE) { 106 + /* UART0 */ 107 107 rts_mask = 1 << 4; 108 108 dtr_mask = 1 << 5; 109 109 } else { 110 + /* UART1 */ 110 111 rts_mask = 1 << 6; 111 112 dtr_mask = 1 << 7; 112 113 } ··· 128 123 __raw_writel(ctrlc, SC_CTRLC); 129 124 } 130 125 131 - static struct amba_pl010_data integrator_uart_data = { 126 + struct amba_pl010_data integrator_uart_data = { 132 127 .set_mctrl = integrator_uart_set_mctrl, 133 128 }; 134 129
+207 -69
arch/arm/mach-integrator/integrator_ap.c
··· 34 34 #include <linux/mtd/physmap.h> 35 35 #include <linux/clk.h> 36 36 #include <linux/platform_data/clk-integrator.h> 37 + #include <linux/of_irq.h> 38 + #include <linux/of_address.h> 39 + #include <linux/of_platform.h> 37 40 #include <video/vga.h> 38 41 39 42 #include <mach/hardware.h> ··· 161 158 pci_map_io_early(__phys_to_pfn(PHYS_PCI_IO_BASE)); 162 159 } 163 160 164 - #define INTEGRATOR_SC_VALID_INT 0x003fffff 165 - 166 - static void __init ap_init_irq(void) 167 - { 168 - /* Disable all interrupts initially. */ 169 - /* Do the core module ones */ 170 - writel(-1, VA_CMIC_BASE + IRQ_ENABLE_CLEAR); 171 - 172 - /* do the header card stuff next */ 173 - writel(-1, VA_IC_BASE + IRQ_ENABLE_CLEAR); 174 - writel(-1, VA_IC_BASE + FIQ_ENABLE_CLEAR); 175 - 176 - fpga_irq_init(VA_IC_BASE, "SC", IRQ_PIC_START, 177 - -1, INTEGRATOR_SC_VALID_INT, NULL); 178 - integrator_clk_init(false); 179 - } 180 - 181 161 #ifdef CONFIG_PM 182 162 static unsigned long ic_irq_enable; 183 163 ··· 253 267 .set_vpp = ap_flash_set_vpp, 254 268 }; 255 269 256 - static struct resource cfi_flash_resource = { 257 - .start = INTEGRATOR_FLASH_BASE, 258 - .end = INTEGRATOR_FLASH_BASE + INTEGRATOR_FLASH_SIZE - 1, 259 - .flags = IORESOURCE_MEM, 260 - }; 261 - 262 - static struct platform_device cfi_flash_device = { 263 - .name = "physmap-flash", 264 - .id = 0, 265 - .dev = { 266 - .platform_data = &ap_flash_data, 267 - }, 268 - .num_resources = 1, 269 - .resource = &cfi_flash_resource, 270 - }; 271 - 272 - static void __init ap_init(void) 273 - { 274 - unsigned long sc_dec; 275 - int i; 276 - 277 - platform_device_register(&cfi_flash_device); 278 - 279 - sc_dec = readl(VA_SC_BASE + INTEGRATOR_SC_DEC_OFFSET); 280 - for (i = 0; i < 4; i++) { 281 - struct lm_device *lmdev; 282 - 283 - if ((sc_dec & (16 << i)) == 0) 284 - continue; 285 - 286 - lmdev = kzalloc(sizeof(struct lm_device), GFP_KERNEL); 287 - if (!lmdev) 288 - continue; 289 - 290 - lmdev->resource.start = 0xc0000000 + 0x10000000 * i; 291 - lmdev->resource.end = lmdev->resource.start + 0x0fffffff; 292 - lmdev->resource.flags = IORESOURCE_MEM; 293 - lmdev->irq = IRQ_AP_EXPINT0 + i; 294 - lmdev->id = i; 295 - 296 - lm_device_register(lmdev); 297 - } 298 - } 299 - 300 270 /* 301 271 * Where is the timer (VA)? 302 272 */ ··· 267 325 return -readl((void __iomem *) TIMER2_VA_BASE + TIMER_VALUE); 268 326 } 269 327 270 - static void integrator_clocksource_init(unsigned long inrate) 328 + static void integrator_clocksource_init(unsigned long inrate, 329 + void __iomem *base) 271 330 { 272 - void __iomem *base = (void __iomem *)TIMER2_VA_BASE; 273 331 u32 ctrl = TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC; 274 332 unsigned long rate = inrate; 275 333 ··· 286 344 setup_sched_clock(integrator_read_sched_clock, 16, rate); 287 345 } 288 346 289 - static void __iomem * const clkevt_base = (void __iomem *)TIMER1_VA_BASE; 347 + static void __iomem * clkevt_base; 290 348 291 349 /* 292 350 * IRQ handler for the timer ··· 358 416 .dev_id = &integrator_clockevent, 359 417 }; 360 418 361 - static void integrator_clockevent_init(unsigned long inrate) 419 + static void integrator_clockevent_init(unsigned long inrate, 420 + void __iomem *base, int irq) 362 421 { 363 422 unsigned long rate = inrate; 364 423 unsigned int ctrl = 0; 365 424 425 + clkevt_base = base; 366 426 /* Calculate and program a divisor */ 367 427 if (rate > 0x100000 * HZ) { 368 428 rate /= 256; ··· 376 432 timer_reload = rate / HZ; 377 433 writel(ctrl, clkevt_base + TIMER_CTRL); 378 434 379 - setup_irq(IRQ_TIMERINT1, &integrator_timer_irq); 435 + setup_irq(irq, &integrator_timer_irq); 380 436 clockevents_config_and_register(&integrator_clockevent, 381 437 rate, 382 438 1, ··· 387 443 { 388 444 } 389 445 446 + #ifdef CONFIG_OF 447 + 448 + static void __init ap_init_timer_of(void) 449 + { 450 + struct device_node *node; 451 + const char *path; 452 + void __iomem *base; 453 + int err; 454 + int irq; 455 + struct clk *clk; 456 + unsigned long rate; 457 + 458 + clk = clk_get_sys("ap_timer", NULL); 459 + BUG_ON(IS_ERR(clk)); 460 + clk_prepare_enable(clk); 461 + rate = clk_get_rate(clk); 462 + 463 + err = of_property_read_string(of_aliases, 464 + "arm,timer-primary", &path); 465 + if (WARN_ON(err)) 466 + return; 467 + node = of_find_node_by_path(path); 468 + base = of_iomap(node, 0); 469 + if (WARN_ON(!base)) 470 + return; 471 + writel(0, base + TIMER_CTRL); 472 + integrator_clocksource_init(rate, base); 473 + 474 + err = of_property_read_string(of_aliases, 475 + "arm,timer-secondary", &path); 476 + if (WARN_ON(err)) 477 + return; 478 + node = of_find_node_by_path(path); 479 + base = of_iomap(node, 0); 480 + if (WARN_ON(!base)) 481 + return; 482 + irq = irq_of_parse_and_map(node, 0); 483 + writel(0, base + TIMER_CTRL); 484 + integrator_clockevent_init(rate, base, irq); 485 + } 486 + 487 + static struct sys_timer ap_of_timer = { 488 + .init = ap_init_timer_of, 489 + }; 490 + 491 + static const struct of_device_id fpga_irq_of_match[] __initconst = { 492 + { .compatible = "arm,versatile-fpga-irq", .data = fpga_irq_of_init, }, 493 + { /* Sentinel */ } 494 + }; 495 + 496 + static void __init ap_init_irq_of(void) 497 + { 498 + /* disable core module IRQs */ 499 + writel(0xffffffffU, VA_CMIC_BASE + IRQ_ENABLE_CLEAR); 500 + of_irq_init(fpga_irq_of_match); 501 + integrator_clk_init(false); 502 + } 503 + 504 + /* For the Device Tree, add in the UART callbacks as AUXDATA */ 505 + static struct of_dev_auxdata ap_auxdata_lookup[] __initdata = { 506 + OF_DEV_AUXDATA("arm,primecell", INTEGRATOR_RTC_BASE, 507 + "rtc", NULL), 508 + OF_DEV_AUXDATA("arm,primecell", INTEGRATOR_UART0_BASE, 509 + "uart0", &integrator_uart_data), 510 + OF_DEV_AUXDATA("arm,primecell", INTEGRATOR_UART1_BASE, 511 + "uart1", &integrator_uart_data), 512 + OF_DEV_AUXDATA("arm,primecell", KMI0_BASE, 513 + "kmi0", NULL), 514 + OF_DEV_AUXDATA("arm,primecell", KMI1_BASE, 515 + "kmi1", NULL), 516 + OF_DEV_AUXDATA("cfi-flash", INTEGRATOR_FLASH_BASE, 517 + "physmap-flash", &ap_flash_data), 518 + { /* sentinel */ }, 519 + }; 520 + 521 + static void __init ap_init_of(void) 522 + { 523 + unsigned long sc_dec; 524 + int i; 525 + 526 + of_platform_populate(NULL, of_default_bus_match_table, 527 + ap_auxdata_lookup, NULL); 528 + 529 + sc_dec = readl(VA_SC_BASE + INTEGRATOR_SC_DEC_OFFSET); 530 + for (i = 0; i < 4; i++) { 531 + struct lm_device *lmdev; 532 + 533 + if ((sc_dec & (16 << i)) == 0) 534 + continue; 535 + 536 + lmdev = kzalloc(sizeof(struct lm_device), GFP_KERNEL); 537 + if (!lmdev) 538 + continue; 539 + 540 + lmdev->resource.start = 0xc0000000 + 0x10000000 * i; 541 + lmdev->resource.end = lmdev->resource.start + 0x0fffffff; 542 + lmdev->resource.flags = IORESOURCE_MEM; 543 + lmdev->irq = IRQ_AP_EXPINT0 + i; 544 + lmdev->id = i; 545 + 546 + lm_device_register(lmdev); 547 + } 548 + } 549 + 550 + static const char * ap_dt_board_compat[] = { 551 + "arm,integrator-ap", 552 + NULL, 553 + }; 554 + 555 + DT_MACHINE_START(INTEGRATOR_AP_DT, "ARM Integrator/AP (Device Tree)") 556 + .reserve = integrator_reserve, 557 + .map_io = ap_map_io, 558 + .nr_irqs = NR_IRQS_INTEGRATOR_AP, 559 + .init_early = ap_init_early, 560 + .init_irq = ap_init_irq_of, 561 + .handle_irq = fpga_handle_irq, 562 + .timer = &ap_of_timer, 563 + .init_machine = ap_init_of, 564 + .restart = integrator_restart, 565 + .dt_compat = ap_dt_board_compat, 566 + MACHINE_END 567 + 568 + #endif 569 + 570 + #ifdef CONFIG_ATAGS 571 + 390 572 /* 391 - * Set up timer(s). 573 + * This is where non-devicetree initialization code is collected and stashed 574 + * for eventual deletion. 392 575 */ 576 + 577 + static struct resource cfi_flash_resource = { 578 + .start = INTEGRATOR_FLASH_BASE, 579 + .end = INTEGRATOR_FLASH_BASE + INTEGRATOR_FLASH_SIZE - 1, 580 + .flags = IORESOURCE_MEM, 581 + }; 582 + 583 + static struct platform_device cfi_flash_device = { 584 + .name = "physmap-flash", 585 + .id = 0, 586 + .dev = { 587 + .platform_data = &ap_flash_data, 588 + }, 589 + .num_resources = 1, 590 + .resource = &cfi_flash_resource, 591 + }; 592 + 393 593 static void __init ap_init_timer(void) 394 594 { 395 595 struct clk *clk; ··· 548 460 writel(0, TIMER1_VA_BASE + TIMER_CTRL); 549 461 writel(0, TIMER2_VA_BASE + TIMER_CTRL); 550 462 551 - integrator_clocksource_init(rate); 552 - integrator_clockevent_init(rate); 463 + integrator_clocksource_init(rate, (void __iomem *)TIMER2_VA_BASE); 464 + integrator_clockevent_init(rate, (void __iomem *)TIMER1_VA_BASE, 465 + IRQ_TIMERINT1); 553 466 } 554 467 555 468 static struct sys_timer ap_timer = { 556 469 .init = ap_init_timer, 557 470 }; 471 + 472 + #define INTEGRATOR_SC_VALID_INT 0x003fffff 473 + 474 + static void __init ap_init_irq(void) 475 + { 476 + /* Disable all interrupts initially. */ 477 + /* Do the core module ones */ 478 + writel(-1, VA_CMIC_BASE + IRQ_ENABLE_CLEAR); 479 + 480 + /* do the header card stuff next */ 481 + writel(-1, VA_IC_BASE + IRQ_ENABLE_CLEAR); 482 + writel(-1, VA_IC_BASE + FIQ_ENABLE_CLEAR); 483 + 484 + fpga_irq_init(VA_IC_BASE, "SC", IRQ_PIC_START, 485 + -1, INTEGRATOR_SC_VALID_INT, NULL); 486 + integrator_clk_init(false); 487 + } 488 + 489 + static void __init ap_init(void) 490 + { 491 + unsigned long sc_dec; 492 + int i; 493 + 494 + platform_device_register(&cfi_flash_device); 495 + 496 + sc_dec = readl(VA_SC_BASE + INTEGRATOR_SC_DEC_OFFSET); 497 + for (i = 0; i < 4; i++) { 498 + struct lm_device *lmdev; 499 + 500 + if ((sc_dec & (16 << i)) == 0) 501 + continue; 502 + 503 + lmdev = kzalloc(sizeof(struct lm_device), GFP_KERNEL); 504 + if (!lmdev) 505 + continue; 506 + 507 + lmdev->resource.start = 0xc0000000 + 0x10000000 * i; 508 + lmdev->resource.end = lmdev->resource.start + 0x0fffffff; 509 + lmdev->resource.flags = IORESOURCE_MEM; 510 + lmdev->irq = IRQ_AP_EXPINT0 + i; 511 + lmdev->id = i; 512 + 513 + lm_device_register(lmdev); 514 + } 515 + 516 + integrator_init(false); 517 + } 558 518 559 519 MACHINE_START(INTEGRATOR, "ARM-Integrator") 560 520 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */ ··· 617 481 .init_machine = ap_init, 618 482 .restart = integrator_restart, 619 483 MACHINE_END 484 + 485 + #endif
+220 -105
arch/arm/mach-integrator/integrator_cp.c
··· 23 23 #include <linux/gfp.h> 24 24 #include <linux/mtd/physmap.h> 25 25 #include <linux/platform_data/clk-integrator.h> 26 + #include <linux/of_irq.h> 27 + #include <linux/of_address.h> 28 + #include <linux/of_platform.h> 26 29 27 30 #include <mach/hardware.h> 28 31 #include <mach/platform.h> ··· 52 49 #include "common.h" 53 50 54 51 #define INTCP_PA_FLASH_BASE 0x24000000 55 - #define INTCP_FLASH_SIZE SZ_32M 56 52 57 53 #define INTCP_PA_CLCD_BASE 0xc0000000 58 - 59 - #define INTCP_VA_CIC_BASE __io_address(INTEGRATOR_HDR_BASE + 0x40) 60 - #define INTCP_VA_PIC_BASE __io_address(INTEGRATOR_IC_BASE) 61 - #define INTCP_VA_SIC_BASE __io_address(INTEGRATOR_CP_SIC_BASE) 62 - 63 - #define INTCP_ETH_SIZE 0x10 64 54 65 55 #define INTCP_VA_CTRL_BASE __io_address(INTEGRATOR_CP_CTL_BASE) 66 56 #define INTCP_FLASHPROG 0x04 ··· 139 143 iotable_init(intcp_io_desc, ARRAY_SIZE(intcp_io_desc)); 140 144 } 141 145 142 - static void __init intcp_init_irq(void) 143 - { 144 - u32 pic_mask, cic_mask, sic_mask; 145 - 146 - /* These masks are for the HW IRQ registers */ 147 - pic_mask = ~((~0u) << (11 - IRQ_PIC_START)); 148 - pic_mask |= (~((~0u) << (29 - 22))) << 22; 149 - cic_mask = ~((~0u) << (1 + IRQ_CIC_END - IRQ_CIC_START)); 150 - sic_mask = ~((~0u) << (1 + IRQ_SIC_END - IRQ_SIC_START)); 151 - 152 - /* 153 - * Disable all interrupt sources 154 - */ 155 - writel(0xffffffff, INTCP_VA_PIC_BASE + IRQ_ENABLE_CLEAR); 156 - writel(0xffffffff, INTCP_VA_PIC_BASE + FIQ_ENABLE_CLEAR); 157 - writel(0xffffffff, INTCP_VA_CIC_BASE + IRQ_ENABLE_CLEAR); 158 - writel(0xffffffff, INTCP_VA_CIC_BASE + FIQ_ENABLE_CLEAR); 159 - writel(sic_mask, INTCP_VA_SIC_BASE + IRQ_ENABLE_CLEAR); 160 - writel(sic_mask, INTCP_VA_SIC_BASE + FIQ_ENABLE_CLEAR); 161 - 162 - fpga_irq_init(INTCP_VA_PIC_BASE, "PIC", IRQ_PIC_START, 163 - -1, pic_mask, NULL); 164 - 165 - fpga_irq_init(INTCP_VA_CIC_BASE, "CIC", IRQ_CIC_START, 166 - -1, cic_mask, NULL); 167 - 168 - fpga_irq_init(INTCP_VA_SIC_BASE, "SIC", IRQ_SIC_START, 169 - IRQ_CP_CPPLDINT, sic_mask, NULL); 170 - integrator_clk_init(true); 171 - } 172 - 173 146 /* 174 147 * Flash handling. 175 148 */ ··· 181 216 .set_vpp = intcp_flash_set_vpp, 182 217 }; 183 218 184 - static struct resource intcp_flash_resource = { 185 - .start = INTCP_PA_FLASH_BASE, 186 - .end = INTCP_PA_FLASH_BASE + INTCP_FLASH_SIZE - 1, 187 - .flags = IORESOURCE_MEM, 188 - }; 189 - 190 - static struct platform_device intcp_flash_device = { 191 - .name = "physmap-flash", 192 - .id = 0, 193 - .dev = { 194 - .platform_data = &intcp_flash_data, 195 - }, 196 - .num_resources = 1, 197 - .resource = &intcp_flash_resource, 198 - }; 199 - 200 - static struct resource smc91x_resources[] = { 201 - [0] = { 202 - .start = INTEGRATOR_CP_ETH_BASE, 203 - .end = INTEGRATOR_CP_ETH_BASE + INTCP_ETH_SIZE - 1, 204 - .flags = IORESOURCE_MEM, 205 - }, 206 - [1] = { 207 - .start = IRQ_CP_ETHINT, 208 - .end = IRQ_CP_ETHINT, 209 - .flags = IORESOURCE_IRQ, 210 - }, 211 - }; 212 - 213 - static struct platform_device smc91x_device = { 214 - .name = "smc91x", 215 - .id = 0, 216 - .num_resources = ARRAY_SIZE(smc91x_resources), 217 - .resource = smc91x_resources, 218 - }; 219 - 220 - static struct platform_device *intcp_devs[] __initdata = { 221 - &intcp_flash_device, 222 - &smc91x_device, 223 - }; 224 - 225 219 /* 226 220 * It seems that the card insertion interrupt remains active after 227 221 * we've acknowledged it. We therefore ignore the interrupt, and ··· 201 277 .gpio_wp = -1, 202 278 .gpio_cd = -1, 203 279 }; 204 - 205 - #define INTEGRATOR_CP_MMC_IRQS { IRQ_CP_MMCIINT0, IRQ_CP_MMCIINT1 } 206 - #define INTEGRATOR_CP_AACI_IRQS { IRQ_CP_AACIINT } 207 - 208 - static AMBA_APB_DEVICE(mmc, "mmci", 0, INTEGRATOR_CP_MMC_BASE, 209 - INTEGRATOR_CP_MMC_IRQS, &mmc_data); 210 - 211 - static AMBA_APB_DEVICE(aaci, "aaci", 0, INTEGRATOR_CP_AACI_BASE, 212 - INTEGRATOR_CP_AACI_IRQS, NULL); 213 - 214 280 215 281 /* 216 282 * CLCD support ··· 252 338 .remove = versatile_clcd_remove_dma, 253 339 }; 254 340 255 - static AMBA_AHB_DEVICE(clcd, "clcd", 0, INTCP_PA_CLCD_BASE, 256 - { IRQ_CP_CLCDCINT }, &clcd_data); 257 - 258 - static struct amba_device *amba_devs[] __initdata = { 259 - &mmc_device, 260 - &aaci_device, 261 - &clcd_device, 262 - }; 263 - 264 341 #define REFCOUNTER (__io_address(INTEGRATOR_HDR_BASE) + 0x28) 265 342 266 343 static void __init intcp_init_early(void) ··· 261 356 #endif 262 357 } 263 358 264 - static void __init intcp_init(void) 359 + static void __init intcp_timer_init_of(void) 265 360 { 266 - int i; 361 + struct device_node *node; 362 + const char *path; 363 + void __iomem *base; 364 + int err; 365 + int irq; 267 366 268 - platform_add_devices(intcp_devs, ARRAY_SIZE(intcp_devs)); 367 + err = of_property_read_string(of_aliases, 368 + "arm,timer-primary", &path); 369 + if (WARN_ON(err)) 370 + return; 371 + node = of_find_node_by_path(path); 372 + base = of_iomap(node, 0); 373 + if (WARN_ON(!base)) 374 + return; 375 + writel(0, base + TIMER_CTRL); 376 + sp804_clocksource_init(base, node->name); 269 377 270 - for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { 271 - struct amba_device *d = amba_devs[i]; 272 - amba_device_register(d, &iomem_resource); 273 - } 378 + err = of_property_read_string(of_aliases, 379 + "arm,timer-secondary", &path); 380 + if (WARN_ON(err)) 381 + return; 382 + node = of_find_node_by_path(path); 383 + base = of_iomap(node, 0); 384 + if (WARN_ON(!base)) 385 + return; 386 + irq = irq_of_parse_and_map(node, 0); 387 + writel(0, base + TIMER_CTRL); 388 + sp804_clockevents_init(base, irq, node->name); 389 + } 390 + 391 + static struct sys_timer cp_of_timer = { 392 + .init = intcp_timer_init_of, 393 + }; 394 + 395 + #ifdef CONFIG_OF 396 + 397 + static const struct of_device_id fpga_irq_of_match[] __initconst = { 398 + { .compatible = "arm,versatile-fpga-irq", .data = fpga_irq_of_init, }, 399 + { /* Sentinel */ } 400 + }; 401 + 402 + static void __init intcp_init_irq_of(void) 403 + { 404 + of_irq_init(fpga_irq_of_match); 405 + integrator_clk_init(true); 406 + } 407 + 408 + /* 409 + * For the Device Tree, add in the UART, MMC and CLCD specifics as AUXDATA 410 + * and enforce the bus names since these are used for clock lookups. 411 + */ 412 + static struct of_dev_auxdata intcp_auxdata_lookup[] __initdata = { 413 + OF_DEV_AUXDATA("arm,primecell", INTEGRATOR_RTC_BASE, 414 + "rtc", NULL), 415 + OF_DEV_AUXDATA("arm,primecell", INTEGRATOR_UART0_BASE, 416 + "uart0", &integrator_uart_data), 417 + OF_DEV_AUXDATA("arm,primecell", INTEGRATOR_UART1_BASE, 418 + "uart1", &integrator_uart_data), 419 + OF_DEV_AUXDATA("arm,primecell", KMI0_BASE, 420 + "kmi0", NULL), 421 + OF_DEV_AUXDATA("arm,primecell", KMI1_BASE, 422 + "kmi1", NULL), 423 + OF_DEV_AUXDATA("arm,primecell", INTEGRATOR_CP_MMC_BASE, 424 + "mmci", &mmc_data), 425 + OF_DEV_AUXDATA("arm,primecell", INTEGRATOR_CP_AACI_BASE, 426 + "aaci", &mmc_data), 427 + OF_DEV_AUXDATA("arm,primecell", INTCP_PA_CLCD_BASE, 428 + "clcd", &clcd_data), 429 + OF_DEV_AUXDATA("cfi-flash", INTCP_PA_FLASH_BASE, 430 + "physmap-flash", &intcp_flash_data), 431 + { /* sentinel */ }, 432 + }; 433 + 434 + static void __init intcp_init_of(void) 435 + { 436 + of_platform_populate(NULL, of_default_bus_match_table, 437 + intcp_auxdata_lookup, NULL); 438 + } 439 + 440 + static const char * intcp_dt_board_compat[] = { 441 + "arm,integrator-cp", 442 + NULL, 443 + }; 444 + 445 + DT_MACHINE_START(INTEGRATOR_CP_DT, "ARM Integrator/CP (Device Tree)") 446 + .reserve = integrator_reserve, 447 + .map_io = intcp_map_io, 448 + .nr_irqs = NR_IRQS_INTEGRATOR_CP, 449 + .init_early = intcp_init_early, 450 + .init_irq = intcp_init_irq_of, 451 + .handle_irq = fpga_handle_irq, 452 + .timer = &cp_of_timer, 453 + .init_machine = intcp_init_of, 454 + .restart = integrator_restart, 455 + .dt_compat = intcp_dt_board_compat, 456 + MACHINE_END 457 + 458 + #endif 459 + 460 + #ifdef CONFIG_ATAGS 461 + 462 + /* 463 + * This is where non-devicetree initialization code is collected and stashed 464 + * for eventual deletion. 465 + */ 466 + 467 + #define INTCP_FLASH_SIZE SZ_32M 468 + 469 + static struct resource intcp_flash_resource = { 470 + .start = INTCP_PA_FLASH_BASE, 471 + .end = INTCP_PA_FLASH_BASE + INTCP_FLASH_SIZE - 1, 472 + .flags = IORESOURCE_MEM, 473 + }; 474 + 475 + static struct platform_device intcp_flash_device = { 476 + .name = "physmap-flash", 477 + .id = 0, 478 + .dev = { 479 + .platform_data = &intcp_flash_data, 480 + }, 481 + .num_resources = 1, 482 + .resource = &intcp_flash_resource, 483 + }; 484 + 485 + #define INTCP_ETH_SIZE 0x10 486 + 487 + static struct resource smc91x_resources[] = { 488 + [0] = { 489 + .start = INTEGRATOR_CP_ETH_BASE, 490 + .end = INTEGRATOR_CP_ETH_BASE + INTCP_ETH_SIZE - 1, 491 + .flags = IORESOURCE_MEM, 492 + }, 493 + [1] = { 494 + .start = IRQ_CP_ETHINT, 495 + .end = IRQ_CP_ETHINT, 496 + .flags = IORESOURCE_IRQ, 497 + }, 498 + }; 499 + 500 + static struct platform_device smc91x_device = { 501 + .name = "smc91x", 502 + .id = 0, 503 + .num_resources = ARRAY_SIZE(smc91x_resources), 504 + .resource = smc91x_resources, 505 + }; 506 + 507 + static struct platform_device *intcp_devs[] __initdata = { 508 + &intcp_flash_device, 509 + &smc91x_device, 510 + }; 511 + 512 + #define INTCP_VA_CIC_BASE __io_address(INTEGRATOR_HDR_BASE + 0x40) 513 + #define INTCP_VA_PIC_BASE __io_address(INTEGRATOR_IC_BASE) 514 + #define INTCP_VA_SIC_BASE __io_address(INTEGRATOR_CP_SIC_BASE) 515 + 516 + static void __init intcp_init_irq(void) 517 + { 518 + u32 pic_mask, cic_mask, sic_mask; 519 + 520 + /* These masks are for the HW IRQ registers */ 521 + pic_mask = ~((~0u) << (11 - IRQ_PIC_START)); 522 + pic_mask |= (~((~0u) << (29 - 22))) << 22; 523 + cic_mask = ~((~0u) << (1 + IRQ_CIC_END - IRQ_CIC_START)); 524 + sic_mask = ~((~0u) << (1 + IRQ_SIC_END - IRQ_SIC_START)); 525 + 526 + /* 527 + * Disable all interrupt sources 528 + */ 529 + writel(0xffffffff, INTCP_VA_PIC_BASE + IRQ_ENABLE_CLEAR); 530 + writel(0xffffffff, INTCP_VA_PIC_BASE + FIQ_ENABLE_CLEAR); 531 + writel(0xffffffff, INTCP_VA_CIC_BASE + IRQ_ENABLE_CLEAR); 532 + writel(0xffffffff, INTCP_VA_CIC_BASE + FIQ_ENABLE_CLEAR); 533 + writel(sic_mask, INTCP_VA_SIC_BASE + IRQ_ENABLE_CLEAR); 534 + writel(sic_mask, INTCP_VA_SIC_BASE + FIQ_ENABLE_CLEAR); 535 + 536 + fpga_irq_init(INTCP_VA_PIC_BASE, "PIC", IRQ_PIC_START, 537 + -1, pic_mask, NULL); 538 + 539 + fpga_irq_init(INTCP_VA_CIC_BASE, "CIC", IRQ_CIC_START, 540 + -1, cic_mask, NULL); 541 + 542 + fpga_irq_init(INTCP_VA_SIC_BASE, "SIC", IRQ_SIC_START, 543 + IRQ_CP_CPPLDINT, sic_mask, NULL); 544 + 545 + integrator_clk_init(true); 274 546 } 275 547 276 548 #define TIMER0_VA_BASE __io_address(INTEGRATOR_TIMER0_BASE) ··· 468 386 .init = intcp_timer_init, 469 387 }; 470 388 389 + #define INTEGRATOR_CP_MMC_IRQS { IRQ_CP_MMCIINT0, IRQ_CP_MMCIINT1 } 390 + #define INTEGRATOR_CP_AACI_IRQS { IRQ_CP_AACIINT } 391 + 392 + static AMBA_APB_DEVICE(mmc, "mmci", 0, INTEGRATOR_CP_MMC_BASE, 393 + INTEGRATOR_CP_MMC_IRQS, &mmc_data); 394 + 395 + static AMBA_APB_DEVICE(aaci, "aaci", 0, INTEGRATOR_CP_AACI_BASE, 396 + INTEGRATOR_CP_AACI_IRQS, NULL); 397 + 398 + static AMBA_AHB_DEVICE(clcd, "clcd", 0, INTCP_PA_CLCD_BASE, 399 + { IRQ_CP_CLCDCINT }, &clcd_data); 400 + 401 + static struct amba_device *amba_devs[] __initdata = { 402 + &mmc_device, 403 + &aaci_device, 404 + &clcd_device, 405 + }; 406 + 407 + static void __init intcp_init(void) 408 + { 409 + int i; 410 + 411 + platform_add_devices(intcp_devs, ARRAY_SIZE(intcp_devs)); 412 + 413 + for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { 414 + struct amba_device *d = amba_devs[i]; 415 + amba_device_register(d, &iomem_resource); 416 + } 417 + integrator_init(true); 418 + } 419 + 471 420 MACHINE_START(CINTEGRATOR, "ARM-IntegratorCP") 472 421 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */ 473 422 .atag_offset = 0x100, ··· 512 399 .init_machine = intcp_init, 513 400 .restart = integrator_restart, 514 401 MACHINE_END 402 + 403 + #endif
-5
arch/arm/mach-sa1100/include/mach/SA-1111.h
··· 1 - /* 2 - * Moved to new location 3 - */ 4 - #warning using old SA-1111.h - update to <asm/hardware/sa1111.h> 5 - #include <asm/hardware/sa1111.h>
-13
arch/arm/mach-sa1100/include/mach/lart.h
··· 1 - #ifndef _INCLUDE_LART_H 2 - #define _INCLUDE_LART_H 3 - 4 - #define LART_GPIO_ETH0 GPIO_GPIO0 5 - #define LART_IRQ_ETH0 IRQ_GPIO0 6 - 7 - #define LART_GPIO_IDE GPIO_GPIO1 8 - #define LART_IRQ_IDE IRQ_GPIO1 9 - 10 - #define LART_GPIO_UCB1200 GPIO_GPIO18 11 - #define LART_IRQ_UCB1200 IRQ_GPIO18 12 - 13 - #endif
+1 -1
arch/arm/mach-shmobile/smp-emev2.c
··· 100 100 /* Tell ROM loader about our vector (in headsmp.S) */ 101 101 emev2_set_boot_vector(__pa(shmobile_secondary_vector)); 102 102 103 - gic_raise_softirq(cpumask_of(cpu), 1); 103 + gic_raise_softirq(cpumask_of(cpu), 0); 104 104 return 0; 105 105 } 106 106
+3 -3
arch/arm/mm/alignment.c
··· 699 699 unsigned long instr = *pinstr; 700 700 u16 tinst1 = (instr >> 16) & 0xffff; 701 701 u16 tinst2 = instr & 0xffff; 702 - poffset->un = 0; 703 702 704 703 switch (tinst1 & 0xffe0) { 705 704 /* A6.3.5 Load/Store multiple */ ··· 853 854 break; 854 855 855 856 case 0x08000000: /* ldm or stm, or thumb-2 32bit instruction */ 856 - if (thumb2_32b) 857 + if (thumb2_32b) { 858 + offset.un = 0; 857 859 handler = do_alignment_t32_to_handler(&instr, regs, &offset); 858 - else 860 + } else 859 861 handler = do_alignment_ldmstm; 860 862 break; 861 863
+6 -2
arch/arm/mm/cache-l2x0.c
··· 368 368 /* l2x0 controller is disabled */ 369 369 writel_relaxed(aux, l2x0_base + L2X0_AUX_CTRL); 370 370 371 - l2x0_saved_regs.aux_ctrl = aux; 372 - 373 371 l2x0_inv_all(); 374 372 375 373 /* enable L2X0 */ 376 374 writel_relaxed(1, l2x0_base + L2X0_CTRL); 377 375 } 376 + 377 + /* Re-read it in case some bits are reserved. */ 378 + aux = readl_relaxed(l2x0_base + L2X0_AUX_CTRL); 379 + 380 + /* Save the value for resuming. */ 381 + l2x0_saved_regs.aux_ctrl = aux; 378 382 379 383 outer_cache.inv_range = l2x0_inv_range; 380 384 outer_cache.clean_range = l2x0_clean_range;
+3
arch/arm/mm/cache-v7.S
··· 211 211 * isn't mapped, fail with -EFAULT. 212 212 */ 213 213 9001: 214 + #ifdef CONFIG_ARM_ERRATA_775420 215 + dsb 216 + #endif 214 217 mov r0, #-EFAULT 215 218 mov pc, lr 216 219 UNWIND(.fnend )
+1 -1
arch/arm/mm/init.c
··· 324 324 325 325 BUG_ON(!arm_memblock_steal_permitted); 326 326 327 - phys = memblock_alloc(size, align); 327 + phys = memblock_alloc_base(size, align, MEMBLOCK_ALLOC_ANYWHERE); 328 328 memblock_free(phys, size); 329 329 memblock_remove(phys, size); 330 330
+1
arch/arm/mm/ioremap.c
··· 248 248 if (!area) 249 249 return NULL; 250 250 addr = (unsigned long)area->addr; 251 + area->phys_addr = __pfn_to_phys(pfn); 251 252 252 253 #if !defined(CONFIG_SMP) && !defined(CONFIG_ARM_LPAE) 253 254 if (DOMAIN_IO == 0 &&
+63 -11
arch/arm/plat-versatile/fpga-irq.c
··· 5 5 #include <linux/io.h> 6 6 #include <linux/irqdomain.h> 7 7 #include <linux/module.h> 8 + #include <linux/of.h> 9 + #include <linux/of_address.h> 8 10 9 11 #include <asm/exception.h> 10 12 #include <asm/mach/irq.h> ··· 16 14 #define IRQ_RAW_STATUS 0x04 17 15 #define IRQ_ENABLE_SET 0x08 18 16 #define IRQ_ENABLE_CLEAR 0x0c 17 + #define INT_SOFT_SET 0x10 18 + #define INT_SOFT_CLEAR 0x14 19 + #define FIQ_STATUS 0x20 20 + #define FIQ_RAW_STATUS 0x24 21 + #define FIQ_ENABLE 0x28 22 + #define FIQ_ENABLE_SET 0x28 23 + #define FIQ_ENABLE_CLEAR 0x2C 19 24 20 25 /** 21 26 * struct fpga_irq_data - irq data container for the FPGA IRQ controller 22 27 * @base: memory offset in virtual memory 23 - * @irq_start: first IRQ number handled by this instance 24 28 * @chip: chip container for this instance 25 29 * @domain: IRQ domain for this instance 26 30 * @valid: mask for valid IRQs on this controller ··· 34 26 */ 35 27 struct fpga_irq_data { 36 28 void __iomem *base; 37 - unsigned int irq_start; 38 29 struct irq_chip chip; 39 30 u32 valid; 40 31 struct irq_domain *domain; ··· 132 125 .xlate = irq_domain_xlate_onetwocell, 133 126 }; 134 127 135 - void __init fpga_irq_init(void __iomem *base, const char *name, int irq_start, 136 - int parent_irq, u32 valid, struct device_node *node) 137 - { 128 + static __init struct fpga_irq_data * 129 + fpga_irq_prep_struct(void __iomem *base, const char *name, u32 valid) { 138 130 struct fpga_irq_data *f; 139 131 140 132 if (fpga_irq_id >= ARRAY_SIZE(fpga_irq_devices)) { 141 133 printk(KERN_ERR "%s: too few FPGA IRQ controllers, increase CONFIG_PLAT_VERSATILE_FPGA_IRQ_NR\n", __func__); 142 - return; 134 + return NULL; 143 135 } 144 - 145 136 f = &fpga_irq_devices[fpga_irq_id]; 146 137 f->base = base; 147 - f->irq_start = irq_start; 148 138 f->chip.name = name; 149 139 f->chip.irq_ack = fpga_irq_mask; 150 140 f->chip.irq_mask = fpga_irq_mask; 151 141 f->chip.irq_unmask = fpga_irq_unmask; 152 142 f->valid = valid; 143 + fpga_irq_id++; 144 + 145 + return f; 146 + } 147 + 148 + void __init fpga_irq_init(void __iomem *base, const char *name, int irq_start, 149 + int parent_irq, u32 valid, struct device_node *node) 150 + { 151 + struct fpga_irq_data *f; 152 + 153 + f = fpga_irq_prep_struct(base, name, valid); 154 + if (!f) 155 + return; 153 156 154 157 if (parent_irq != -1) { 155 158 irq_set_handler_data(parent_irq, f); 156 159 irq_set_chained_handler(parent_irq, fpga_irq_handle); 157 160 } 158 161 159 - f->domain = irq_domain_add_legacy(node, fls(valid), f->irq_start, 0, 162 + f->domain = irq_domain_add_legacy(node, fls(valid), irq_start, 0, 160 163 &fpga_irqdomain_ops, f); 161 164 pr_info("FPGA IRQ chip %d \"%s\" @ %p, %u irqs\n", 162 165 fpga_irq_id, name, base, f->used_irqs); 163 - 164 - fpga_irq_id++; 165 166 } 167 + 168 + #ifdef CONFIG_OF 169 + int __init fpga_irq_of_init(struct device_node *node, 170 + struct device_node *parent) 171 + { 172 + struct fpga_irq_data *f; 173 + void __iomem *base; 174 + u32 clear_mask; 175 + u32 valid_mask; 176 + 177 + if (WARN_ON(!node)) 178 + return -ENODEV; 179 + 180 + base = of_iomap(node, 0); 181 + WARN(!base, "unable to map fpga irq registers\n"); 182 + 183 + if (of_property_read_u32(node, "clear-mask", &clear_mask)) 184 + clear_mask = 0; 185 + 186 + if (of_property_read_u32(node, "valid-mask", &valid_mask)) 187 + valid_mask = 0; 188 + 189 + f = fpga_irq_prep_struct(base, node->name, valid_mask); 190 + if (!f) 191 + return -ENOMEM; 192 + 193 + writel(clear_mask, base + IRQ_ENABLE_CLEAR); 194 + writel(clear_mask, base + FIQ_ENABLE_CLEAR); 195 + 196 + f->domain = irq_domain_add_linear(node, fls(valid_mask), &fpga_irqdomain_ops, f); 197 + f->used_irqs = hweight32(valid_mask); 198 + 199 + pr_info("FPGA IRQ chip %d \"%s\" @ %p, %u irqs\n", 200 + fpga_irq_id, node->name, base, f->used_irqs); 201 + return 0; 202 + } 203 + #endif
+2
arch/arm/plat-versatile/include/plat/fpga-irq.h
··· 7 7 void fpga_handle_irq(struct pt_regs *regs); 8 8 void fpga_irq_init(void __iomem *, const char *, int, int, u32, 9 9 struct device_node *node); 10 + int fpga_irq_of_init(struct device_node *node, 11 + struct device_node *parent); 10 12 11 13 #endif