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

Merge tag 'dt' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Pull "ARM: device tree work" from Arnd Bergmann:
"Most of these patches convert code from using static platform data to
describing the hardware in the device tree. This is only the first
half of the changes for v3.4 because a lot of patches for this topic
came in the last week before the merge window.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>"

Fix up trivial conflicts in arch/arm/mach-vexpress/{Kconfig,core.h}

* tag 'dt' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (86 commits)
Document: devicetree: add OF documents for arch-mmp
ARM: dts: append DTS file of pxa168
ARM: mmp: append OF support on pxa168
ARM: mmp: enable rtc clk in pxa168
i2c: pxa: add OF support
serial: pxa: add OF support
arm/dts: mt_ventoux: very basic support for TeeJet Mt.Ventoux board
ARM: OMAP2+: Remove extra ifdefs for board-generic
ARM: OMAP2+: Fix build error when only ARCH_OMAP2/3 or 4 is selected
ASoC: DT: Add digital microphone binding to PAZ00 board.
ARM: dt: Add ARM PMU to tegra*.dtsi
ARM: at91: at91sam9x5cm/dt: add leds support
ARM: at91: usb_a9g20/dt: add gpio-keys support
ARM: at91: at91sam9m10g45ek/dt: add gpio-keys support
ARM: at91: at91sam9m10g45ek/dt: add leds support
ARM: at91: usb_a9g20/dt: add leds support
ARM: at91/pio: add new PIO3 features
ARM: at91: add sam9_smc.o to at91sam9x5 build
ARM: at91/tc/clocksource: Add 32 bit variant to Timer Counter
ARM: at91/tc: add device tree support to atmel_tclib
...

+5060 -1080
+38
Documentation/devicetree/bindings/arm/atmel-aic.txt
··· 1 + * Advanced Interrupt Controller (AIC) 2 + 3 + Required properties: 4 + - compatible: Should be "atmel,<chip>-aic" 5 + - interrupt-controller: Identifies the node as an interrupt controller. 6 + - interrupt-parent: For single AIC system, it is an empty property. 7 + - #interrupt-cells: The number of cells to define the interrupts. It sould be 2. 8 + The first cell is the IRQ number (aka "Peripheral IDentifier" on datasheet). 9 + The second cell is used to specify flags: 10 + bits[3:0] trigger type and level flags: 11 + 1 = low-to-high edge triggered. 12 + 2 = high-to-low edge triggered. 13 + 4 = active high level-sensitive. 14 + 8 = active low level-sensitive. 15 + Valid combinations are 1, 2, 3, 4, 8. 16 + Default flag for internal sources should be set to 4 (active high). 17 + - reg: Should contain AIC registers location and length 18 + 19 + Examples: 20 + /* 21 + * AIC 22 + */ 23 + aic: interrupt-controller@fffff000 { 24 + compatible = "atmel,at91rm9200-aic"; 25 + interrupt-controller; 26 + interrupt-parent; 27 + #interrupt-cells = <2>; 28 + reg = <0xfffff000 0x200>; 29 + }; 30 + 31 + /* 32 + * An interrupt generating device that is wired to an AIC. 33 + */ 34 + dma: dma-controller@ffffec00 { 35 + compatible = "atmel,at91sam9g45-dma"; 36 + reg = <0xffffec00 0x200>; 37 + interrupts = <21 4>; 38 + };
+32
Documentation/devicetree/bindings/arm/atmel-at91.txt
··· 1 + Atmel AT91 device tree bindings. 2 + ================================ 3 + 4 + PIT Timer required properties: 5 + - compatible: Should be "atmel,at91sam9260-pit" 6 + - reg: Should contain registers location and length 7 + - interrupts: Should contain interrupt for the PIT which is the IRQ line 8 + shared across all System Controller members. 9 + 10 + TC/TCLIB Timer required properties: 11 + - compatible: Should be "atmel,<chip>-pit". 12 + <chip> can be "at91rm9200" or "at91sam9x5" 13 + - reg: Should contain registers location and length 14 + - interrupts: Should contain all interrupts for the TC block 15 + Note that you can specify several interrupt cells if the TC 16 + block has one interrupt per channel. 17 + 18 + Examples: 19 + 20 + One interrupt per TC block: 21 + tcb0: timer@fff7c000 { 22 + compatible = "atmel,at91rm9200-tcb"; 23 + reg = <0xfff7c000 0x100>; 24 + interrupts = <18 4>; 25 + }; 26 + 27 + One interrupt per TC channel in a TC block: 28 + tcb1: timer@fffdc000 { 29 + compatible = "atmel,at91rm9200-tcb"; 30 + reg = <0xfffdc000 0x100>; 31 + interrupts = <26 4 27 4 28 4>; 32 + };
+22
Documentation/devicetree/bindings/arm/fsl.txt
··· 28 28 i.MX6 Quad SABRE Lite Board 29 29 Required root node properties: 30 30 - compatible = "fsl,imx6q-sabrelite", "fsl,imx6q"; 31 + 32 + Generic i.MX boards 33 + ------------------- 34 + 35 + No iomux setup is done for these boards, so this must have been configured 36 + by the bootloader for boards to work with the generic bindings. 37 + 38 + i.MX27 generic board 39 + Required root node properties: 40 + - compatible = "fsl,imx27"; 41 + 42 + i.MX51 generic board 43 + Required root node properties: 44 + - compatible = "fsl,imx51"; 45 + 46 + i.MX53 generic board 47 + Required root node properties: 48 + - compatible = "fsl,imx53"; 49 + 50 + i.MX6q generic board 51 + Required root node properties: 52 + - compatible = "fsl,imx6q";
+6
Documentation/devicetree/bindings/arm/mrvl.txt
··· 1 + Marvell Platforms Device Tree Bindings 2 + ---------------------------------------------------- 3 + 4 + PXA168 Aspenite Board 5 + Required root node properties: 6 + - compatible = "mrvl,pxa168-aspenite", "mrvl,pxa168";
+27
Documentation/devicetree/bindings/arm/omap/intc.txt
··· 1 + * OMAP Interrupt Controller 2 + 3 + OMAP2/3 are using a TI interrupt controller that can support several 4 + configurable number of interrupts. 5 + 6 + Main node required properties: 7 + 8 + - compatible : should be: 9 + "ti,omap2-intc" 10 + - interrupt-controller : Identifies the node as an interrupt controller 11 + - #interrupt-cells : Specifies the number of cells needed to encode an 12 + interrupt source. The type shall be a <u32> and the value shall be 1. 13 + 14 + The cell contains the interrupt number in the range [0-128]. 15 + - ti,intc-size: Number of interrupts handled by the interrupt controller. 16 + - reg: physical base address and size of the intc registers map. 17 + 18 + Example: 19 + 20 + intc: interrupt-controller@1 { 21 + compatible = "ti,omap2-intc"; 22 + interrupt-controller; 23 + #interrupt-cells = <1>; 24 + ti,intc-size = <96>; 25 + reg = <0x48200000 0x1000>; 26 + }; 27 +
+146
Documentation/devicetree/bindings/arm/vexpress.txt
··· 1 + ARM Versatile Express boards family 2 + ----------------------------------- 3 + 4 + ARM's Versatile Express platform consists of a motherboard and one 5 + or more daughterboards (tiles). The motherboard provides a set of 6 + peripherals. Processor and RAM "live" on the tiles. 7 + 8 + The motherboard and each core tile should be described by a separate 9 + Device Tree source file, with the tile's description including 10 + the motherboard file using a /include/ directive. As the motherboard 11 + can be initialized in one of two different configurations ("memory 12 + maps"), care must be taken to include the correct one. 13 + 14 + Required properties in the root node: 15 + - compatible value: 16 + compatible = "arm,vexpress,<model>", "arm,vexpress"; 17 + where <model> is the full tile model name (as used in the tile's 18 + Technical Reference Manual), eg.: 19 + - for Coretile Express A5x2 (V2P-CA5s): 20 + compatible = "arm,vexpress,v2p-ca5s", "arm,vexpress"; 21 + - for Coretile Express A9x4 (V2P-CA9): 22 + compatible = "arm,vexpress,v2p-ca9", "arm,vexpress"; 23 + If a tile comes in several variants or can be used in more then one 24 + configuration, the compatible value should be: 25 + compatible = "arm,vexpress,<model>,<variant>", \ 26 + "arm,vexpress,<model>", "arm,vexpress"; 27 + eg: 28 + - Coretile Express A15x2 (V2P-CA15) with Tech Chip 1: 29 + compatible = "arm,vexpress,v2p-ca15,tc1", \ 30 + "arm,vexpress,v2p-ca15", "arm,vexpress"; 31 + - LogicTile Express 13MG (V2F-2XV6) running Cortex-A7 (3 cores) SMM: 32 + compatible = "arm,vexpress,v2f-2xv6,ca7x3", \ 33 + "arm,vexpress,v2f-2xv6", "arm,vexpress"; 34 + 35 + Optional properties in the root node: 36 + - tile model name (use name from the tile's Technical Reference 37 + Manual, eg. "V2P-CA5s") 38 + model = "<model>"; 39 + - tile's HBI number (unique ARM's board model ID, visible on the 40 + PCB's silkscreen) in hexadecimal transcription: 41 + arm,hbi = <0xhbi> 42 + eg: 43 + - for Coretile Express A5x2 (V2P-CA5s) HBI-0191: 44 + arm,hbi = <0x191>; 45 + - Coretile Express A9x4 (V2P-CA9) HBI-0225: 46 + arm,hbi = <0x225>; 47 + 48 + Top-level standard "cpus" node is required. It must contain a node 49 + with device_type = "cpu" property for every available core, eg.: 50 + 51 + cpus { 52 + #address-cells = <1>; 53 + #size-cells = <0>; 54 + 55 + cpu@0 { 56 + device_type = "cpu"; 57 + compatible = "arm,cortex-a5"; 58 + reg = <0>; 59 + }; 60 + }; 61 + 62 + The motherboard description file provides a single "motherboard" node 63 + using 2 address cells corresponding to the Static Memory Bus used 64 + between the motherboard and the tile. The first cell defines the Chip 65 + Select (CS) line number, the second cell address offset within the CS. 66 + All interrupt lines between the motherboard and the tile are active 67 + high and are described using single cell. 68 + 69 + Optional properties of the "motherboard" node: 70 + - motherboard's memory map variant: 71 + arm,v2m-memory-map = "<name>"; 72 + where name is one of: 73 + - "rs1" - for RS1 map (i.a. peripherals on CS3); this map is also 74 + referred to as "ARM Cortex-A Series memory map": 75 + arm,v2m-memory-map = "rs1"; 76 + When this property is missing, the motherboard is using the original 77 + memory map (also known as the "Legacy memory map", primarily used 78 + with the original CoreTile Express A9x4) with peripherals on CS7. 79 + 80 + Motherboard .dtsi files provide a set of labelled peripherals that 81 + can be used to obtain required phandle in the tile's "aliases" node: 82 + - UARTs, note that the numbers correspond to the physical connectors 83 + on the motherboard's back panel: 84 + v2m_serial0, v2m_serial1, v2m_serial2 and v2m_serial3 85 + - I2C controllers: 86 + v2m_i2c_dvi and v2m_i2c_pcie 87 + - SP804 timers: 88 + v2m_timer01 and v2m_timer23 89 + 90 + Current Linux implementation requires a "arm,v2m_timer" alias 91 + pointing at one of the motherboard's SP804 timers, if it is to be 92 + used as the system timer. This alias should be defined in the 93 + motherboard files. 94 + 95 + The tile description must define "ranges", "interrupt-map-mask" and 96 + "interrupt-map" properties to translate the motherboard's address 97 + and interrupt space into one used by the tile's processor. 98 + 99 + Abbreviated example: 100 + 101 + /dts-v1/; 102 + 103 + / { 104 + model = "V2P-CA5s"; 105 + arm,hbi = <0x225>; 106 + compatible = "arm,vexpress-v2p-ca5s", "arm,vexpress"; 107 + interrupt-parent = <&gic>; 108 + #address-cells = <1>; 109 + #size-cells = <1>; 110 + 111 + chosen { }; 112 + 113 + aliases { 114 + serial0 = &v2m_serial0; 115 + }; 116 + 117 + cpus { 118 + #address-cells = <1>; 119 + #size-cells = <0>; 120 + 121 + cpu@0 { 122 + device_type = "cpu"; 123 + compatible = "arm,cortex-a5"; 124 + reg = <0>; 125 + }; 126 + }; 127 + 128 + gic: interrupt-controller@2c001000 { 129 + compatible = "arm,cortex-a9-gic"; 130 + #interrupt-cells = <3>; 131 + #address-cells = <0>; 132 + interrupt-controller; 133 + reg = <0x2c001000 0x1000>, 134 + <0x2c000100 0x100>; 135 + }; 136 + 137 + motherboard { 138 + /* CS0 is visible at 0x08000000 */ 139 + ranges = <0 0 0x08000000 0x04000000>; 140 + interrupt-map-mask = <0 0 63>; 141 + /* Active high IRQ 0 is connected to GIC's SPI0 */ 142 + interrupt-map = <0 0 0 &gic 0 0 4>; 143 + }; 144 + }; 145 + 146 + /include/ "vexpress-v2m-rs1.dtsi"
+20
Documentation/devicetree/bindings/gpio/gpio_atmel.txt
··· 1 + * Atmel GPIO controller (PIO) 2 + 3 + Required properties: 4 + - compatible: "atmel,<chip>-gpio", where <chip> is at91rm9200 or at91sam9x5. 5 + - reg: Should contain GPIO controller registers location and length 6 + - interrupts: Should be the port interrupt shared by all the pins. 7 + - #gpio-cells: Should be two. The first cell is the pin number and 8 + the second cell is used to specify optional parameters (currently 9 + unused). 10 + - gpio-controller: Marks the device node as a GPIO controller. 11 + 12 + Example: 13 + pioA: gpio@fffff200 { 14 + compatible = "atmel,at91rm9200-gpio"; 15 + reg = <0xfffff200 0x100>; 16 + interrupts = <2 4>; 17 + #gpio-cells = <2>; 18 + gpio-controller; 19 + }; 20 +
+23
Documentation/devicetree/bindings/gpio/mrvl-gpio.txt
··· 1 + * Marvell PXA GPIO controller 2 + 3 + Required properties: 4 + - compatible : Should be "mrvl,pxa-gpio" or "mrvl,mmp-gpio" 5 + - reg : Address and length of the register set for the device 6 + - interrupts : Should be the port interrupt shared by all gpio pins, if 7 + - interrupt-name : Should be the name of irq resource. 8 + one number. 9 + - gpio-controller : Marks the device node as a gpio controller. 10 + - #gpio-cells : Should be one. It is the pin number. 11 + 12 + Example: 13 + 14 + gpio: gpio@d4019000 { 15 + compatible = "mrvl,mmp-gpio", "mrvl,pxa-gpio"; 16 + reg = <0xd4019000 0x1000>; 17 + interrupts = <49>, <17>, <18>; 18 + interrupt-name = "gpio_mux", "gpio0", "gpio1"; 19 + gpio-controller; 20 + #gpio-cells = <1>; 21 + interrupt-controller; 22 + #interrupt-cells = <1>; 23 + };
+37
Documentation/devicetree/bindings/i2c/mrvl-i2c.txt
··· 1 + * I2C 2 + 3 + Required properties : 4 + 5 + - reg : Offset and length of the register set for the device 6 + - compatible : should be "mrvl,mmp-twsi" where CHIP is the name of a 7 + compatible processor, e.g. pxa168, pxa910, mmp2, mmp3. 8 + For the pxa2xx/pxa3xx, an additional node "mrvl,pxa-i2c" is required 9 + as shown in the example below. 10 + 11 + Recommended properties : 12 + 13 + - interrupts : <a b> where a is the interrupt number and b is a 14 + field that represents an encoding of the sense and level 15 + information for the interrupt. This should be encoded based on 16 + the information in section 2) depending on the type of interrupt 17 + controller you have. 18 + - interrupt-parent : the phandle for the interrupt controller that 19 + services interrupts for this device. 20 + - mrvl,i2c-polling : Disable interrupt of i2c controller. Polling 21 + status register of i2c controller instead. 22 + - mrvl,i2c-fast-mode : Enable fast mode of i2c controller. 23 + 24 + Examples: 25 + twsi1: i2c@d4011000 { 26 + compatible = "mrvl,mmp-twsi", "mrvl,pxa-i2c"; 27 + reg = <0xd4011000 0x1000>; 28 + interrupts = <7>; 29 + mrvl,i2c-fast-mode; 30 + }; 31 + 32 + twsi2: i2c@d4025000 { 33 + compatible = "mrvl,mmp-twsi", "mrvl,pxa-i2c"; 34 + reg = <0xd4025000 0x1000>; 35 + interrupts = <58>; 36 + }; 37 +
+17
Documentation/devicetree/bindings/rtc/sa1100-rtc.txt
··· 1 + * Marvell Real Time Clock controller 2 + 3 + Required properties: 4 + - compatible: should be "mrvl,sa1100-rtc" 5 + - reg: physical base address of the controller and length of memory mapped 6 + region. 7 + - interrupts: Should be two. The first interrupt number is the rtc alarm 8 + interrupt and the second interrupt number is the rtc hz interrupt. 9 + - interrupt-names: Assign name of irq resource. 10 + 11 + Example: 12 + rtc: rtc@d4010000 { 13 + compatible = "mrvl,mmp-rtc"; 14 + reg = <0xd4010000 0x1000>; 15 + interrupts = <5>, <6>; 16 + interrupt-name = "rtc 1Hz", "rtc alarm"; 17 + };
+4
Documentation/devicetree/bindings/serial/mrvl-serial.txt
··· 1 + PXA UART controller 2 + 3 + Required properties: 4 + - compatible : should be "mrvl,mmp-uart" or "mrvl,pxa-uart".
+1
arch/arm/Kconfig
··· 325 325 select ARCH_REQUIRE_GPIOLIB 326 326 select HAVE_CLK 327 327 select CLKDEV_LOOKUP 328 + select IRQ_DOMAIN 328 329 help 329 330 This enables support for systems based on the Atmel AT91RM9200, 330 331 AT91SAM9 processors.
+27
arch/arm/boot/dts/am3517_mt_ventoux.dts
··· 1 + /* 2 + * Copyright (C) 2011 Ilya Yanok, EmCraft Systems 3 + * 4 + * This program is free software; you can redistribute it and/or modify 5 + * it under the terms of the GNU General Public License version 2 as 6 + * published by the Free Software Foundation. 7 + */ 8 + /dts-v1/; 9 + 10 + /include/ "omap3.dtsi" 11 + 12 + / { 13 + model = "TeeJet Mt.Ventoux"; 14 + compatible = "teejet,mt_ventoux", "ti,omap3"; 15 + 16 + memory { 17 + device_type = "memory"; 18 + reg = <0x80000000 0x10000000>; /* 256 MB */ 19 + }; 20 + 21 + /* AM35xx doesn't have IVA */ 22 + soc { 23 + iva { 24 + status = "disabled"; 25 + }; 26 + }; 27 + };
+59 -9
arch/arm/boot/dts/at91sam9g20.dtsi
··· 23 23 serial4 = &usart3; 24 24 serial5 = &usart4; 25 25 serial6 = &usart5; 26 + gpio0 = &pioA; 27 + gpio1 = &pioB; 28 + gpio2 = &pioC; 29 + tcb0 = &tcb0; 30 + tcb1 = &tcb1; 26 31 }; 27 32 cpus { 28 33 cpu@0 { ··· 52 47 ranges; 53 48 54 49 aic: interrupt-controller@fffff000 { 55 - #interrupt-cells = <1>; 50 + #interrupt-cells = <2>; 56 51 compatible = "atmel,at91rm9200-aic"; 57 52 interrupt-controller; 58 53 interrupt-parent; 59 54 reg = <0xfffff000 0x200>; 60 55 }; 61 56 57 + pit: timer@fffffd30 { 58 + compatible = "atmel,at91sam9260-pit"; 59 + reg = <0xfffffd30 0xf>; 60 + interrupts = <1 4>; 61 + }; 62 + 63 + tcb0: timer@fffa0000 { 64 + compatible = "atmel,at91rm9200-tcb"; 65 + reg = <0xfffa0000 0x100>; 66 + interrupts = <17 4 18 4 19 4>; 67 + }; 68 + 69 + tcb1: timer@fffdc000 { 70 + compatible = "atmel,at91rm9200-tcb"; 71 + reg = <0xfffdc000 0x100>; 72 + interrupts = <26 4 27 4 28 4>; 73 + }; 74 + 75 + pioA: gpio@fffff400 { 76 + compatible = "atmel,at91rm9200-gpio"; 77 + reg = <0xfffff400 0x100>; 78 + interrupts = <2 4>; 79 + #gpio-cells = <2>; 80 + gpio-controller; 81 + interrupt-controller; 82 + }; 83 + 84 + pioB: gpio@fffff600 { 85 + compatible = "atmel,at91rm9200-gpio"; 86 + reg = <0xfffff600 0x100>; 87 + interrupts = <3 4>; 88 + #gpio-cells = <2>; 89 + gpio-controller; 90 + interrupt-controller; 91 + }; 92 + 93 + pioC: gpio@fffff800 { 94 + compatible = "atmel,at91rm9200-gpio"; 95 + reg = <0xfffff800 0x100>; 96 + interrupts = <4 4>; 97 + #gpio-cells = <2>; 98 + gpio-controller; 99 + interrupt-controller; 100 + }; 101 + 62 102 dbgu: serial@fffff200 { 63 103 compatible = "atmel,at91sam9260-usart"; 64 104 reg = <0xfffff200 0x200>; 65 - interrupts = <1>; 105 + interrupts = <1 4>; 66 106 status = "disabled"; 67 107 }; 68 108 69 109 usart0: serial@fffb0000 { 70 110 compatible = "atmel,at91sam9260-usart"; 71 111 reg = <0xfffb0000 0x200>; 72 - interrupts = <6>; 112 + interrupts = <6 4>; 73 113 atmel,use-dma-rx; 74 114 atmel,use-dma-tx; 75 115 status = "disabled"; ··· 123 73 usart1: serial@fffb4000 { 124 74 compatible = "atmel,at91sam9260-usart"; 125 75 reg = <0xfffb4000 0x200>; 126 - interrupts = <7>; 76 + interrupts = <7 4>; 127 77 atmel,use-dma-rx; 128 78 atmel,use-dma-tx; 129 79 status = "disabled"; ··· 132 82 usart2: serial@fffb8000 { 133 83 compatible = "atmel,at91sam9260-usart"; 134 84 reg = <0xfffb8000 0x200>; 135 - interrupts = <8>; 85 + interrupts = <8 4>; 136 86 atmel,use-dma-rx; 137 87 atmel,use-dma-tx; 138 88 status = "disabled"; ··· 141 91 usart3: serial@fffd0000 { 142 92 compatible = "atmel,at91sam9260-usart"; 143 93 reg = <0xfffd0000 0x200>; 144 - interrupts = <23>; 94 + interrupts = <23 4>; 145 95 atmel,use-dma-rx; 146 96 atmel,use-dma-tx; 147 97 status = "disabled"; ··· 150 100 usart4: serial@fffd4000 { 151 101 compatible = "atmel,at91sam9260-usart"; 152 102 reg = <0xfffd4000 0x200>; 153 - interrupts = <24>; 103 + interrupts = <24 4>; 154 104 atmel,use-dma-rx; 155 105 atmel,use-dma-tx; 156 106 status = "disabled"; ··· 159 109 usart5: serial@fffd8000 { 160 110 compatible = "atmel,at91sam9260-usart"; 161 111 reg = <0xfffd8000 0x200>; 162 - interrupts = <25>; 112 + interrupts = <25 4>; 163 113 atmel,use-dma-rx; 164 114 atmel,use-dma-tx; 165 115 status = "disabled"; ··· 168 118 macb0: ethernet@fffc4000 { 169 119 compatible = "cdns,at32ap7000-macb", "cdns,macb"; 170 120 reg = <0xfffc4000 0x100>; 171 - interrupts = <21>; 121 + interrupts = <21 4>; 172 122 status = "disabled"; 173 123 }; 174 124 };
+79 -8
arch/arm/boot/dts/at91sam9g45.dtsi
··· 22 22 serial2 = &usart1; 23 23 serial3 = &usart2; 24 24 serial4 = &usart3; 25 + gpio0 = &pioA; 26 + gpio1 = &pioB; 27 + gpio2 = &pioC; 28 + gpio3 = &pioD; 29 + gpio4 = &pioE; 30 + tcb0 = &tcb0; 31 + tcb1 = &tcb1; 25 32 }; 26 33 cpus { 27 34 cpu@0 { ··· 53 46 ranges; 54 47 55 48 aic: interrupt-controller@fffff000 { 56 - #interrupt-cells = <1>; 49 + #interrupt-cells = <2>; 57 50 compatible = "atmel,at91rm9200-aic"; 58 51 interrupt-controller; 59 52 interrupt-parent; 60 53 reg = <0xfffff000 0x200>; 61 54 }; 62 55 56 + pit: timer@fffffd30 { 57 + compatible = "atmel,at91sam9260-pit"; 58 + reg = <0xfffffd30 0xf>; 59 + interrupts = <1 4>; 60 + }; 61 + 62 + 63 + tcb0: timer@fff7c000 { 64 + compatible = "atmel,at91rm9200-tcb"; 65 + reg = <0xfff7c000 0x100>; 66 + interrupts = <18 4>; 67 + }; 68 + 69 + tcb1: timer@fffd4000 { 70 + compatible = "atmel,at91rm9200-tcb"; 71 + reg = <0xfffd4000 0x100>; 72 + interrupts = <18 4>; 73 + }; 74 + 63 75 dma: dma-controller@ffffec00 { 64 76 compatible = "atmel,at91sam9g45-dma"; 65 77 reg = <0xffffec00 0x200>; 66 - interrupts = <21>; 78 + interrupts = <21 4>; 79 + }; 80 + 81 + pioA: gpio@fffff200 { 82 + compatible = "atmel,at91rm9200-gpio"; 83 + reg = <0xfffff200 0x100>; 84 + interrupts = <2 4>; 85 + #gpio-cells = <2>; 86 + gpio-controller; 87 + interrupt-controller; 88 + }; 89 + 90 + pioB: gpio@fffff400 { 91 + compatible = "atmel,at91rm9200-gpio"; 92 + reg = <0xfffff400 0x100>; 93 + interrupts = <3 4>; 94 + #gpio-cells = <2>; 95 + gpio-controller; 96 + interrupt-controller; 97 + }; 98 + 99 + pioC: gpio@fffff600 { 100 + compatible = "atmel,at91rm9200-gpio"; 101 + reg = <0xfffff600 0x100>; 102 + interrupts = <4 4>; 103 + #gpio-cells = <2>; 104 + gpio-controller; 105 + interrupt-controller; 106 + }; 107 + 108 + pioD: gpio@fffff800 { 109 + compatible = "atmel,at91rm9200-gpio"; 110 + reg = <0xfffff800 0x100>; 111 + interrupts = <5 4>; 112 + #gpio-cells = <2>; 113 + gpio-controller; 114 + interrupt-controller; 115 + }; 116 + 117 + pioE: gpio@fffffa00 { 118 + compatible = "atmel,at91rm9200-gpio"; 119 + reg = <0xfffffa00 0x100>; 120 + interrupts = <5 4>; 121 + #gpio-cells = <2>; 122 + gpio-controller; 123 + interrupt-controller; 67 124 }; 68 125 69 126 dbgu: serial@ffffee00 { 70 127 compatible = "atmel,at91sam9260-usart"; 71 128 reg = <0xffffee00 0x200>; 72 - interrupts = <1>; 129 + interrupts = <1 4>; 73 130 status = "disabled"; 74 131 }; 75 132 76 133 usart0: serial@fff8c000 { 77 134 compatible = "atmel,at91sam9260-usart"; 78 135 reg = <0xfff8c000 0x200>; 79 - interrupts = <7>; 136 + interrupts = <7 4>; 80 137 atmel,use-dma-rx; 81 138 atmel,use-dma-tx; 82 139 status = "disabled"; ··· 149 78 usart1: serial@fff90000 { 150 79 compatible = "atmel,at91sam9260-usart"; 151 80 reg = <0xfff90000 0x200>; 152 - interrupts = <8>; 81 + interrupts = <8 4>; 153 82 atmel,use-dma-rx; 154 83 atmel,use-dma-tx; 155 84 status = "disabled"; ··· 158 87 usart2: serial@fff94000 { 159 88 compatible = "atmel,at91sam9260-usart"; 160 89 reg = <0xfff94000 0x200>; 161 - interrupts = <9>; 90 + interrupts = <9 4>; 162 91 atmel,use-dma-rx; 163 92 atmel,use-dma-tx; 164 93 status = "disabled"; ··· 167 96 usart3: serial@fff98000 { 168 97 compatible = "atmel,at91sam9260-usart"; 169 98 reg = <0xfff98000 0x200>; 170 - interrupts = <10>; 99 + interrupts = <10 4>; 171 100 atmel,use-dma-rx; 172 101 atmel,use-dma-tx; 173 102 status = "disabled"; ··· 176 105 macb0: ethernet@fffbc000 { 177 106 compatible = "cdns,at32ap7000-macb", "cdns,macb"; 178 107 reg = <0xfffbc000 0x100>; 179 - interrupts = <25>; 108 + interrupts = <25 4>; 180 109 status = "disabled"; 181 110 }; 182 111 };
+72
arch/arm/boot/dts/at91sam9m10g45ek.dts
··· 37 37 }; 38 38 }; 39 39 }; 40 + 41 + leds { 42 + compatible = "gpio-leds"; 43 + 44 + d8 { 45 + label = "d8"; 46 + gpios = <&pioD 30 0>; 47 + linux,default-trigger = "heartbeat"; 48 + }; 49 + 50 + d6 { 51 + label = "d6"; 52 + gpios = <&pioD 0 1>; 53 + linux,default-trigger = "nand-disk"; 54 + }; 55 + 56 + d7 { 57 + label = "d7"; 58 + gpios = <&pioD 31 1>; 59 + linux,default-trigger = "mmc0"; 60 + }; 61 + }; 62 + 63 + gpio_keys { 64 + compatible = "gpio-keys"; 65 + #address-cells = <1>; 66 + #size-cells = <0>; 67 + 68 + left_click { 69 + label = "left_click"; 70 + gpios = <&pioB 6 1>; 71 + linux,code = <272>; 72 + gpio-key,wakeup; 73 + }; 74 + 75 + right_click { 76 + label = "right_click"; 77 + gpios = <&pioB 7 1>; 78 + linux,code = <273>; 79 + gpio-key,wakeup; 80 + }; 81 + 82 + left { 83 + label = "Joystick Left"; 84 + gpios = <&pioB 14 1>; 85 + linux,code = <105>; 86 + }; 87 + 88 + right { 89 + label = "Joystick Right"; 90 + gpios = <&pioB 15 1>; 91 + linux,code = <106>; 92 + }; 93 + 94 + up { 95 + label = "Joystick Up"; 96 + gpios = <&pioB 16 1>; 97 + linux,code = <103>; 98 + }; 99 + 100 + down { 101 + label = "Joystick Down"; 102 + gpios = <&pioB 17 1>; 103 + linux,code = <108>; 104 + }; 105 + 106 + enter { 107 + label = "Joystick Press"; 108 + gpios = <&pioB 18 1>; 109 + linux,code = <28>; 110 + }; 111 + }; 40 112 };
+8 -4
arch/arm/boot/dts/at91sam9x5.dtsi
··· 89 89 }; 90 90 91 91 pioA: gpio@fffff400 { 92 - compatible = "atmel,at91rm9200-gpio"; 92 + compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio"; 93 93 reg = <0xfffff400 0x100>; 94 94 interrupts = <2 4>; 95 95 #gpio-cells = <2>; 96 96 gpio-controller; 97 + interrupt-controller; 97 98 }; 98 99 99 100 pioB: gpio@fffff600 { 100 - compatible = "atmel,at91rm9200-gpio"; 101 + compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio"; 101 102 reg = <0xfffff600 0x100>; 102 103 interrupts = <2 4>; 103 104 #gpio-cells = <2>; 104 105 gpio-controller; 106 + interrupt-controller; 105 107 }; 106 108 107 109 pioC: gpio@fffff800 { 108 - compatible = "atmel,at91rm9200-gpio"; 110 + compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio"; 109 111 reg = <0xfffff800 0x100>; 110 112 interrupts = <3 4>; 111 113 #gpio-cells = <2>; 112 114 gpio-controller; 115 + interrupt-controller; 113 116 }; 114 117 115 118 pioD: gpio@fffffa00 { 116 - compatible = "atmel,at91rm9200-gpio"; 119 + compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio"; 117 120 reg = <0xfffffa00 0x100>; 118 121 interrupts = <3 4>; 119 122 #gpio-cells = <2>; 120 123 gpio-controller; 124 + interrupt-controller; 121 125 }; 122 126 123 127 dbgu: serial@fffff200 {
+15
arch/arm/boot/dts/at91sam9x5cm.dtsi
··· 11 11 memory@20000000 { 12 12 reg = <0x20000000 0x8000000>; 13 13 }; 14 + 15 + leds { 16 + compatible = "gpio-leds"; 17 + 18 + pb18 { 19 + label = "pb18"; 20 + gpios = <&pioB 18 1>; 21 + linux,default-trigger = "heartbeat"; 22 + }; 23 + 24 + pd21 { 25 + label = "pd21"; 26 + gpios = <&pioD 21 0>; 27 + }; 28 + }; 14 29 };
+76
arch/arm/boot/dts/imx27-phytec-phycore.dts
··· 1 + /* 2 + * Copyright 2012 Sascha Hauer, Pengutronix 3 + * 4 + * The code contained herein is licensed under the GNU General Public 5 + * License. You may obtain a copy of the GNU General Public License 6 + * Version 2 or later at the following locations: 7 + * 8 + * http://www.opensource.org/licenses/gpl-license.html 9 + * http://www.gnu.org/copyleft/gpl.html 10 + */ 11 + 12 + /dts-v1/; 13 + /include/ "imx27.dtsi" 14 + 15 + / { 16 + model = "Phytec pcm038"; 17 + compatible = "phytec,imx27-pcm038", "fsl,imx27"; 18 + 19 + memory { 20 + reg = <0x0 0x0>; 21 + }; 22 + 23 + soc { 24 + aipi@10000000 { /* aipi */ 25 + 26 + wdog@10002000 { 27 + status = "okay"; 28 + }; 29 + 30 + uart@1000a000 { 31 + fsl,uart-has-rtscts; 32 + status = "okay"; 33 + }; 34 + 35 + uart@1000b000 { 36 + fsl,uart-has-rtscts; 37 + status = "okay"; 38 + }; 39 + 40 + uart@1000c000 { 41 + fsl,uart-has-rtscts; 42 + status = "okay"; 43 + }; 44 + 45 + fec@1002b000 { 46 + status = "okay"; 47 + }; 48 + 49 + i2c@1001d000 { 50 + clock-frequency = <400000>; 51 + status = "okay"; 52 + at24@4c { 53 + compatible = "at,24c32"; 54 + pagesize = <32>; 55 + reg = <0x52>; 56 + }; 57 + pcf8563@51 { 58 + compatible = "nxp,pcf8563"; 59 + reg = <0x51>; 60 + }; 61 + lm75@4a { 62 + compatible = "national,lm75"; 63 + reg = <0x4a>; 64 + }; 65 + }; 66 + }; 67 + }; 68 + 69 + nor_flash@c0000000 { 70 + compatible = "cfi-flash"; 71 + bank-width = <2>; 72 + reg = <0xc0000000 0x02000000>; 73 + #address-cells = <1>; 74 + #size-cells = <1>; 75 + }; 76 + };
+217
arch/arm/boot/dts/imx27.dtsi
··· 1 + /* 2 + * Copyright 2012 Sascha Hauer, Pengutronix 3 + * 4 + * The code contained herein is licensed under the GNU General Public 5 + * License. You may obtain a copy of the GNU General Public License 6 + * Version 2 or later at the following locations: 7 + * 8 + * http://www.opensource.org/licenses/gpl-license.html 9 + * http://www.gnu.org/copyleft/gpl.html 10 + */ 11 + 12 + /include/ "skeleton.dtsi" 13 + 14 + / { 15 + aliases { 16 + serial0 = &uart1; 17 + serial1 = &uart2; 18 + serial2 = &uart3; 19 + serial3 = &uart4; 20 + serial4 = &uart5; 21 + serial5 = &uart6; 22 + }; 23 + 24 + avic: avic-interrupt-controller@e0000000 { 25 + compatible = "fsl,imx27-avic", "fsl,avic"; 26 + interrupt-controller; 27 + #interrupt-cells = <1>; 28 + reg = <0x10040000 0x1000>; 29 + }; 30 + 31 + clocks { 32 + #address-cells = <1>; 33 + #size-cells = <0>; 34 + 35 + osc26m { 36 + compatible = "fsl,imx-osc26m", "fixed-clock"; 37 + clock-frequency = <26000000>; 38 + }; 39 + }; 40 + 41 + soc { 42 + #address-cells = <1>; 43 + #size-cells = <1>; 44 + compatible = "simple-bus"; 45 + interrupt-parent = <&avic>; 46 + ranges; 47 + 48 + aipi@10000000 { /* AIPI1 */ 49 + compatible = "fsl,aipi-bus", "simple-bus"; 50 + #address-cells = <1>; 51 + #size-cells = <1>; 52 + reg = <0x10000000 0x10000000>; 53 + ranges; 54 + 55 + wdog@10002000 { 56 + compatible = "fsl,imx27-wdt", "fsl,imx21-wdt"; 57 + reg = <0x10002000 0x4000>; 58 + interrupts = <27>; 59 + status = "disabled"; 60 + }; 61 + 62 + uart1: uart@1000a000 { 63 + compatible = "fsl,imx27-uart", "fsl,imx21-uart"; 64 + reg = <0x1000a000 0x1000>; 65 + interrupts = <20>; 66 + status = "disabled"; 67 + }; 68 + 69 + uart2: uart@1000b000 { 70 + compatible = "fsl,imx27-uart", "fsl,imx21-uart"; 71 + reg = <0x1000b000 0x1000>; 72 + interrupts = <19>; 73 + status = "disabled"; 74 + }; 75 + 76 + uart3: uart@1000c000 { 77 + compatible = "fsl,imx27-uart", "fsl,imx21-uart"; 78 + reg = <0x1000c000 0x1000>; 79 + interrupts = <18>; 80 + status = "disabled"; 81 + }; 82 + 83 + uart4: uart@1000d000 { 84 + compatible = "fsl,imx27-uart", "fsl,imx21-uart"; 85 + reg = <0x1000d000 0x1000>; 86 + interrupts = <17>; 87 + status = "disabled"; 88 + }; 89 + 90 + cspi1: cspi@1000e000 { 91 + #address-cells = <1>; 92 + #size-cells = <0>; 93 + compatible = "fsl,imx27-cspi"; 94 + reg = <0x1000e000 0x1000>; 95 + interrupts = <16>; 96 + status = "disabled"; 97 + }; 98 + 99 + cspi2: cspi@1000f000 { 100 + #address-cells = <1>; 101 + #size-cells = <0>; 102 + compatible = "fsl,imx27-cspi"; 103 + reg = <0x1000f000 0x1000>; 104 + interrupts = <15>; 105 + status = "disabled"; 106 + }; 107 + 108 + i2c1: i2c@10012000 { 109 + #address-cells = <1>; 110 + #size-cells = <0>; 111 + compatible = "fsl,imx27-i2c", "fsl,imx1-i2c"; 112 + reg = <0x10012000 0x1000>; 113 + interrupts = <12>; 114 + status = "disabled"; 115 + }; 116 + 117 + gpio1: gpio@10015000 { 118 + compatible = "fsl,imx27-gpio", "fsl,imx21-gpio"; 119 + reg = <0x10015000 0x100>; 120 + interrupts = <8>; 121 + gpio-controller; 122 + #gpio-cells = <2>; 123 + interrupt-controller; 124 + #interrupt-cells = <1>; 125 + }; 126 + 127 + gpio2: gpio@10015100 { 128 + compatible = "fsl,imx27-gpio", "fsl,imx21-gpio"; 129 + reg = <0x10015100 0x100>; 130 + interrupts = <8>; 131 + gpio-controller; 132 + #gpio-cells = <2>; 133 + interrupt-controller; 134 + #interrupt-cells = <1>; 135 + }; 136 + 137 + gpio3: gpio@10015200 { 138 + compatible = "fsl,imx27-gpio", "fsl,imx21-gpio"; 139 + reg = <0x10015200 0x100>; 140 + interrupts = <8>; 141 + gpio-controller; 142 + #gpio-cells = <2>; 143 + interrupt-controller; 144 + #interrupt-cells = <1>; 145 + }; 146 + 147 + gpio4: gpio@10015300 { 148 + compatible = "fsl,imx27-gpio", "fsl,imx21-gpio"; 149 + reg = <0x10015300 0x100>; 150 + interrupts = <8>; 151 + gpio-controller; 152 + #gpio-cells = <2>; 153 + interrupt-controller; 154 + #interrupt-cells = <1>; 155 + }; 156 + 157 + gpio5: gpio@10015400 { 158 + compatible = "fsl,imx27-gpio", "fsl,imx21-gpio"; 159 + reg = <0x10015400 0x100>; 160 + interrupts = <8>; 161 + gpio-controller; 162 + #gpio-cells = <2>; 163 + interrupt-controller; 164 + #interrupt-cells = <1>; 165 + }; 166 + 167 + gpio6: gpio@10015500 { 168 + compatible = "fsl,imx27-gpio", "fsl,imx21-gpio"; 169 + reg = <0x10015500 0x100>; 170 + interrupts = <8>; 171 + gpio-controller; 172 + #gpio-cells = <2>; 173 + interrupt-controller; 174 + #interrupt-cells = <1>; 175 + }; 176 + 177 + cspi3: cspi@10017000 { 178 + #address-cells = <1>; 179 + #size-cells = <0>; 180 + compatible = "fsl,imx27-cspi"; 181 + reg = <0x10017000 0x1000>; 182 + interrupts = <6>; 183 + status = "disabled"; 184 + }; 185 + 186 + uart5: uart@1001b000 { 187 + compatible = "fsl,imx27-uart", "fsl,imx21-uart"; 188 + reg = <0x1001b000 0x1000>; 189 + interrupts = <49>; 190 + status = "disabled"; 191 + }; 192 + 193 + uart6: uart@1001c000 { 194 + compatible = "fsl,imx27-uart", "fsl,imx21-uart"; 195 + reg = <0x1001c000 0x1000>; 196 + interrupts = <48>; 197 + status = "disabled"; 198 + }; 199 + 200 + i2c2: i2c@1001d000 { 201 + #address-cells = <1>; 202 + #size-cells = <0>; 203 + compatible = "fsl,imx27-i2c", "fsl,imx1-i2c"; 204 + reg = <0x1001d000 0x1000>; 205 + interrupts = <1>; 206 + status = "disabled"; 207 + }; 208 + 209 + fec: fec@1002b000 { 210 + compatible = "fsl,imx27-fec"; 211 + reg = <0x1002b000 0x4000>; 212 + interrupts = <50>; 213 + status = "disabled"; 214 + }; 215 + }; 216 + }; 217 + };
+89 -2
arch/arm/boot/dts/imx51-babbage.dts
··· 56 56 compatible = "fsl,mc13892"; 57 57 spi-max-frequency = <6000000>; 58 58 reg = <0>; 59 - mc13xxx-irq-gpios = <&gpio1 8 0>; 60 - fsl,mc13xxx-uses-regulator; 59 + interrupt-parent = <&gpio1>; 60 + interrupts = <8>; 61 + 62 + regulators { 63 + sw1_reg: sw1 { 64 + regulator-min-microvolt = <600000>; 65 + regulator-max-microvolt = <1375000>; 66 + regulator-boot-on; 67 + regulator-always-on; 68 + }; 69 + 70 + sw2_reg: sw2 { 71 + regulator-min-microvolt = <900000>; 72 + regulator-max-microvolt = <1850000>; 73 + regulator-boot-on; 74 + regulator-always-on; 75 + }; 76 + 77 + sw3_reg: sw3 { 78 + regulator-min-microvolt = <1100000>; 79 + regulator-max-microvolt = <1850000>; 80 + regulator-boot-on; 81 + regulator-always-on; 82 + }; 83 + 84 + sw4_reg: sw4 { 85 + regulator-min-microvolt = <1100000>; 86 + regulator-max-microvolt = <1850000>; 87 + regulator-boot-on; 88 + regulator-always-on; 89 + }; 90 + 91 + vpll_reg: vpll { 92 + regulator-min-microvolt = <1050000>; 93 + regulator-max-microvolt = <1800000>; 94 + regulator-boot-on; 95 + regulator-always-on; 96 + }; 97 + 98 + vdig_reg: vdig { 99 + regulator-min-microvolt = <1650000>; 100 + regulator-max-microvolt = <1650000>; 101 + regulator-boot-on; 102 + }; 103 + 104 + vsd_reg: vsd { 105 + regulator-min-microvolt = <1800000>; 106 + regulator-max-microvolt = <3150000>; 107 + }; 108 + 109 + vusb2_reg: vusb2 { 110 + regulator-min-microvolt = <2400000>; 111 + regulator-max-microvolt = <2775000>; 112 + regulator-boot-on; 113 + regulator-always-on; 114 + }; 115 + 116 + vvideo_reg: vvideo { 117 + regulator-min-microvolt = <2775000>; 118 + regulator-max-microvolt = <2775000>; 119 + }; 120 + 121 + vaudio_reg: vaudio { 122 + regulator-min-microvolt = <2300000>; 123 + regulator-max-microvolt = <3000000>; 124 + }; 125 + 126 + vcam_reg: vcam { 127 + regulator-min-microvolt = <2500000>; 128 + regulator-max-microvolt = <3000000>; 129 + }; 130 + 131 + vgen1_reg: vgen1 { 132 + regulator-min-microvolt = <1200000>; 133 + regulator-max-microvolt = <1200000>; 134 + }; 135 + 136 + vgen2_reg: vgen2 { 137 + regulator-min-microvolt = <1200000>; 138 + regulator-max-microvolt = <3150000>; 139 + regulator-always-on; 140 + }; 141 + 142 + vgen3_reg: vgen3 { 143 + regulator-min-microvolt = <1800000>; 144 + regulator-max-microvolt = <2900000>; 145 + regulator-always-on; 146 + }; 147 + }; 61 148 }; 62 149 63 150 flash: at45db321d@1 {
+14
arch/arm/boot/dts/imx6q-arm2.dts
··· 36 36 usdhc@02198000 { /* uSDHC3 */ 37 37 cd-gpios = <&gpio6 11 0>; 38 38 wp-gpios = <&gpio6 14 0>; 39 + vmmc-supply = <&reg_3p3v>; 39 40 status = "okay"; 40 41 }; 41 42 42 43 usdhc@0219c000 { /* uSDHC4 */ 43 44 fsl,card-wired; 45 + vmmc-supply = <&reg_3p3v>; 44 46 status = "okay"; 45 47 }; 46 48 47 49 uart4: uart@021f0000 { 48 50 status = "okay"; 49 51 }; 52 + }; 53 + }; 54 + 55 + regulators { 56 + compatible = "simple-bus"; 57 + 58 + reg_3p3v: 3p3v { 59 + compatible = "regulator-fixed"; 60 + regulator-name = "3P3V"; 61 + regulator-min-microvolt = <3300000>; 62 + regulator-max-microvolt = <3300000>; 63 + regulator-always-on; 50 64 }; 51 65 }; 52 66
+34
arch/arm/boot/dts/imx6q-sabrelite.dts
··· 32 32 usdhc@02198000 { /* uSDHC3 */ 33 33 cd-gpios = <&gpio7 0 0>; 34 34 wp-gpios = <&gpio7 1 0>; 35 + vmmc-supply = <&reg_3p3v>; 35 36 status = "okay"; 36 37 }; 37 38 38 39 usdhc@0219c000 { /* uSDHC4 */ 39 40 cd-gpios = <&gpio2 6 0>; 40 41 wp-gpios = <&gpio2 7 0>; 42 + vmmc-supply = <&reg_3p3v>; 41 43 status = "okay"; 42 44 }; 43 45 44 46 uart2: uart@021e8000 { 45 47 status = "okay"; 46 48 }; 49 + 50 + i2c@021a0000 { /* I2C1 */ 51 + status = "okay"; 52 + clock-frequency = <100000>; 53 + 54 + codec: sgtl5000@0a { 55 + compatible = "fsl,sgtl5000"; 56 + reg = <0x0a>; 57 + VDDA-supply = <&reg_2p5v>; 58 + VDDIO-supply = <&reg_3p3v>; 59 + }; 60 + }; 61 + }; 62 + }; 63 + 64 + regulators { 65 + compatible = "simple-bus"; 66 + 67 + reg_2p5v: 2p5v { 68 + compatible = "regulator-fixed"; 69 + regulator-name = "2P5V"; 70 + regulator-min-microvolt = <2500000>; 71 + regulator-max-microvolt = <2500000>; 72 + regulator-always-on; 73 + }; 74 + 75 + reg_3p3v: 3p3v { 76 + compatible = "regulator-fixed"; 77 + regulator-name = "3P3V"; 78 + regulator-min-microvolt = <3300000>; 79 + regulator-max-microvolt = <3300000>; 80 + regulator-always-on; 47 81 }; 48 82 }; 49 83 };
-9
arch/arm/boot/dts/omap3-beagle.dts
··· 13 13 model = "TI OMAP3 BeagleBoard"; 14 14 compatible = "ti,omap3-beagle", "ti,omap3"; 15 15 16 - /* 17 - * Since the initial device tree board file does not create any 18 - * devices (MMC, network...), the only way to boot is to provide a 19 - * ramdisk. 20 - */ 21 - chosen { 22 - bootargs = "root=/dev/ram0 rw console=ttyO2,115200n8 initrd=0x81600000,20M ramdisk_size=20480 no_console_suspend debug earlyprintk"; 23 - }; 24 - 25 16 memory { 26 17 device_type = "memory"; 27 18 reg = <0x80000000 0x20000000>; /* 512 MB */
+20
arch/arm/boot/dts/omap3-evm.dts
··· 1 + /* 2 + * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ 3 + * 4 + * This program is free software; you can redistribute it and/or modify 5 + * it under the terms of the GNU General Public License version 2 as 6 + * published by the Free Software Foundation. 7 + */ 8 + /dts-v1/; 9 + 10 + /include/ "omap3.dtsi" 11 + 12 + / { 13 + model = "TI OMAP3 EVM (OMAP3530, AM/DM37x)"; 14 + compatible = "ti,omap3-evm", "ti,omap3"; 15 + 16 + memory { 17 + device_type = "memory"; 18 + reg = <0x80000000 0x10000000>; /* 256 MB */ 19 + }; 20 + };
+29 -6
arch/arm/boot/dts/omap3.dtsi
··· 61 61 ranges; 62 62 ti,hwmods = "l3_main"; 63 63 64 - intc: interrupt-controller@1 { 65 - compatible = "ti,omap3-intc"; 64 + intc: interrupt-controller@48200000 { 65 + compatible = "ti,omap2-intc"; 66 66 interrupt-controller; 67 67 #interrupt-cells = <1>; 68 + ti,intc-size = <96>; 69 + reg = <0x48200000 0x1000>; 68 70 }; 69 71 70 - uart1: serial@0x4806a000 { 72 + uart1: serial@4806a000 { 71 73 compatible = "ti,omap3-uart"; 72 74 ti,hwmods = "uart1"; 73 75 clock-frequency = <48000000>; 74 76 }; 75 77 76 - uart2: serial@0x4806c000 { 78 + uart2: serial@4806c000 { 77 79 compatible = "ti,omap3-uart"; 78 80 ti,hwmods = "uart2"; 79 81 clock-frequency = <48000000>; 80 82 }; 81 83 82 - uart3: serial@0x49020000 { 84 + uart3: serial@49020000 { 83 85 compatible = "ti,omap3-uart"; 84 86 ti,hwmods = "uart3"; 85 87 clock-frequency = <48000000>; 86 88 }; 87 89 88 - uart4: serial@0x49042000 { 90 + uart4: serial@49042000 { 89 91 compatible = "ti,omap3-uart"; 90 92 ti,hwmods = "uart4"; 91 93 clock-frequency = <48000000>; 94 + }; 95 + 96 + i2c1: i2c@48070000 { 97 + compatible = "ti,omap3-i2c"; 98 + #address-cells = <1>; 99 + #size-cells = <0>; 100 + ti,hwmods = "i2c1"; 101 + }; 102 + 103 + i2c2: i2c@48072000 { 104 + compatible = "ti,omap3-i2c"; 105 + #address-cells = <1>; 106 + #size-cells = <0>; 107 + ti,hwmods = "i2c2"; 108 + }; 109 + 110 + i2c3: i2c@48060000 { 111 + compatible = "ti,omap3-i2c"; 112 + #address-cells = <1>; 113 + #size-cells = <0>; 114 + ti,hwmods = "i2c3"; 92 115 }; 93 116 }; 94 117 };
-9
arch/arm/boot/dts/omap4-panda.dts
··· 13 13 model = "TI OMAP4 PandaBoard"; 14 14 compatible = "ti,omap4-panda", "ti,omap4430", "ti,omap4"; 15 15 16 - /* 17 - * Since the initial device tree board file does not create any 18 - * devices (MMC, network...), the only way to boot is to provide a 19 - * ramdisk. 20 - */ 21 - chosen { 22 - bootargs = "root=/dev/ram0 rw console=ttyO2,115200n8 initrd=0x81600000,20M ramdisk_size=20480 no_console_suspend debug"; 23 - }; 24 - 25 16 memory { 26 17 device_type = "memory"; 27 18 reg = <0x80000000 0x40000000>; /* 1 GB */
-9
arch/arm/boot/dts/omap4-sdp.dts
··· 13 13 model = "TI OMAP4 SDP board"; 14 14 compatible = "ti,omap4-sdp", "ti,omap4430", "ti,omap4"; 15 15 16 - /* 17 - * Since the initial device tree board file does not create any 18 - * devices (MMC, network...), the only way to boot is to provide a 19 - * ramdisk. 20 - */ 21 - chosen { 22 - bootargs = "root=/dev/ram0 rw console=ttyO2,115200n8 initrd=0x81600000,20M ramdisk_size=20480 no_console_suspend debug"; 23 - }; 24 - 25 16 memory { 26 17 device_type = "memory"; 27 18 reg = <0x80000000 0x40000000>; /* 1 GB */
+33 -5
arch/arm/boot/dts/omap4.dtsi
··· 99 99 gic: interrupt-controller@48241000 { 100 100 compatible = "arm,cortex-a9-gic"; 101 101 interrupt-controller; 102 - #interrupt-cells = <1>; 102 + #interrupt-cells = <3>; 103 103 reg = <0x48241000 0x1000>, 104 104 <0x48240100 0x0100>; 105 105 }; 106 106 107 - uart1: serial@0x4806a000 { 107 + uart1: serial@4806a000 { 108 108 compatible = "ti,omap4-uart"; 109 109 ti,hwmods = "uart1"; 110 110 clock-frequency = <48000000>; 111 111 }; 112 112 113 - uart2: serial@0x4806c000 { 113 + uart2: serial@4806c000 { 114 114 compatible = "ti,omap4-uart"; 115 115 ti,hwmods = "uart2"; 116 116 clock-frequency = <48000000>; 117 117 }; 118 118 119 - uart3: serial@0x48020000 { 119 + uart3: serial@48020000 { 120 120 compatible = "ti,omap4-uart"; 121 121 ti,hwmods = "uart3"; 122 122 clock-frequency = <48000000>; 123 123 }; 124 124 125 - uart4: serial@0x4806e000 { 125 + uart4: serial@4806e000 { 126 126 compatible = "ti,omap4-uart"; 127 127 ti,hwmods = "uart4"; 128 128 clock-frequency = <48000000>; 129 + }; 130 + 131 + i2c1: i2c@48070000 { 132 + compatible = "ti,omap4-i2c"; 133 + #address-cells = <1>; 134 + #size-cells = <0>; 135 + ti,hwmods = "i2c1"; 136 + }; 137 + 138 + i2c2: i2c@48072000 { 139 + compatible = "ti,omap4-i2c"; 140 + #address-cells = <1>; 141 + #size-cells = <0>; 142 + ti,hwmods = "i2c2"; 143 + }; 144 + 145 + i2c3: i2c@48060000 { 146 + compatible = "ti,omap4-i2c"; 147 + #address-cells = <1>; 148 + #size-cells = <0>; 149 + ti,hwmods = "i2c3"; 150 + }; 151 + 152 + i2c4: i2c@48350000 { 153 + compatible = "ti,omap4-i2c"; 154 + #address-cells = <1>; 155 + #size-cells = <0>; 156 + ti,hwmods = "i2c4"; 129 157 }; 130 158 }; 131 159 };
+38
arch/arm/boot/dts/pxa168-aspenite.dts
··· 1 + /* 2 + * Copyright (C) 2012 Marvell Technology Group Ltd. 3 + * Author: Haojian Zhuang <haojian.zhuang@marvell.com> 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 version 2 as 7 + * publishhed by the Free Software Foundation. 8 + */ 9 + 10 + /dts-v1/; 11 + /include/ "pxa168.dtsi" 12 + 13 + / { 14 + model = "Marvell PXA168 Aspenite Development Board"; 15 + compatible = "mrvl,pxa168-aspenite", "mrvl,pxa168"; 16 + 17 + chosen { 18 + bootargs = "console=ttyS0,115200 root=/dev/nfs nfsroot=192.168.1.100:/nfsroot/ ip=192.168.1.101:192.168.1.100::255.255.255.0::eth0:on"; 19 + }; 20 + 21 + memory { 22 + reg = <0x00000000 0x04000000>; 23 + }; 24 + 25 + soc { 26 + apb@d4000000 { 27 + uart1: uart@d4017000 { 28 + status = "okay"; 29 + }; 30 + twsi1: i2c@d4011000 { 31 + status = "okay"; 32 + }; 33 + rtc: rtc@d4010000 { 34 + status = "okay"; 35 + }; 36 + }; 37 + }; 38 + };
+98
arch/arm/boot/dts/pxa168.dtsi
··· 1 + /* 2 + * Copyright (C) 2012 Marvell Technology Group Ltd. 3 + * Author: Haojian Zhuang <haojian.zhuang@marvell.com> 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 version 2 as 7 + * publishhed by the Free Software Foundation. 8 + */ 9 + 10 + /include/ "skeleton.dtsi" 11 + 12 + / { 13 + aliases { 14 + serial0 = &uart1; 15 + serial1 = &uart2; 16 + serial2 = &uart3; 17 + i2c0 = &twsi1; 18 + i2c1 = &twsi2; 19 + }; 20 + 21 + intc: intc-interrupt-controller@d4282000 { 22 + compatible = "mrvl,mmp-intc", "mrvl,intc"; 23 + interrupt-controller; 24 + #interrupt-cells = <1>; 25 + reg = <0xd4282000 0x1000>; 26 + }; 27 + 28 + soc { 29 + #address-cells = <1>; 30 + #size-cells = <1>; 31 + compatible = "simple-bus"; 32 + interrupt-parent = <&intc>; 33 + ranges; 34 + 35 + apb@d4000000 { /* APB */ 36 + compatible = "mrvl,apb-bus", "simple-bus"; 37 + #address-cells = <1>; 38 + #size-cells = <1>; 39 + reg = <0xd4000000 0x00200000>; 40 + ranges; 41 + 42 + uart1: uart@d4017000 { 43 + compatible = "mrvl,mmp-uart", "mrvl,pxa-uart"; 44 + reg = <0xd4017000 0x1000>; 45 + interrupts = <27>; 46 + status = "disabled"; 47 + }; 48 + 49 + uart2: uart@d4018000 { 50 + compatible = "mrvl,mmp-uart", "mrvl,pxa-uart"; 51 + reg = <0xd4018000 0x1000>; 52 + interrupts = <28>; 53 + status = "disabled"; 54 + }; 55 + 56 + uart3: uart@d4026000 { 57 + compatible = "mrvl,mmp-uart", "mrvl,pxa-uart"; 58 + reg = <0xd4026000 0x1000>; 59 + interrupts = <29>; 60 + status = "disabled"; 61 + }; 62 + 63 + gpio: gpio@d4019000 { 64 + compatible = "mrvl,mmp-gpio", "mrvl,pxa-gpio"; 65 + reg = <0xd4019000 0x1000>; 66 + interrupts = <49>; 67 + interrupt-names = "gpio_mux"; 68 + gpio-controller; 69 + #gpio-cells = <1>; 70 + interrupt-controller; 71 + #interrupt-cells = <1>; 72 + }; 73 + 74 + twsi1: i2c@d4011000 { 75 + compatible = "mrvl,mmp-twsi", "mrvl,pxa-i2c"; 76 + reg = <0xd4011000 0x1000>; 77 + interrupts = <7>; 78 + mrvl,i2c-fast-mode; 79 + status = "disabled"; 80 + }; 81 + 82 + twsi2: i2c@d4025000 { 83 + compatible = "mrvl,mmp-twsi", "mrvl,pxa-i2c"; 84 + reg = <0xd4025000 0x1000>; 85 + interrupts = <58>; 86 + status = "disabled"; 87 + }; 88 + 89 + rtc: rtc@d4010000 { 90 + compatible = "mrvl,mmp-rtc"; 91 + reg = <0xd4010000 0x1000>; 92 + interrupts = <5 6>; 93 + interrupt-names = "rtc 1Hz", "rtc alarm"; 94 + status = "disabled"; 95 + }; 96 + }; 97 + }; 98 + };
+18
arch/arm/boot/dts/tegra-cardhu.dts
··· 33 33 i2c@7000d000 { 34 34 clock-frequency = <100000>; 35 35 }; 36 + 37 + sdhci@78000000 { 38 + cd-gpios = <&gpio 69 0>; /* gpio PI5 */ 39 + wp-gpios = <&gpio 155 0>; /* gpio PT3 */ 40 + power-gpios = <&gpio 31 0>; /* gpio PD7 */ 41 + }; 42 + 43 + sdhci@78000200 { 44 + status = "disable"; 45 + }; 46 + 47 + sdhci@78000400 { 48 + status = "disable"; 49 + }; 50 + 51 + sdhci@78000400 { 52 + support-8bit; 53 + }; 36 54 };
+2 -1
arch/arm/boot/dts/tegra-paz00.dts
··· 65 65 "Headset Mic", "MICBIAS1", 66 66 "MIC1", "Headset Mic", 67 67 "Headset Stereophone", "HPR", 68 - "Headset Stereophone", "HPL"; 68 + "Headset Stereophone", "HPL", 69 + "DMICDAT", "Digital Mic"; 69 70 70 71 nvidia,audio-codec = <&alc5632>; 71 72 nvidia,i2s-controller = <&tegra_i2s1>;
+6
arch/arm/boot/dts/tegra20.dtsi
··· 17 17 < 0x50040100 0x0100 >; 18 18 }; 19 19 20 + pmu { 21 + compatible = "arm,cortex-a9-pmu"; 22 + interrupts = <0 56 0x04 23 + 0 57 0x04>; 24 + }; 25 + 20 26 apbdma: dma@6000a000 { 21 27 compatible = "nvidia,tegra20-apbdma"; 22 28 reg = <0x6000a000 0x1200>;
+8
arch/arm/boot/dts/tegra30.dtsi
··· 17 17 < 0x50040100 0x0100 >; 18 18 }; 19 19 20 + pmu { 21 + compatible = "arm,cortex-a9-pmu"; 22 + interrupts = <0 144 0x04 23 + 0 145 0x04 24 + 0 146 0x04 25 + 0 147 0x04>; 26 + }; 27 + 20 28 apbdma: dma@6000a000 { 21 29 compatible = "nvidia,tegra30-apbdma", "nvidia,tegra20-apbdma"; 22 30 reg = <0x6000a000 0x1400>;
+23
arch/arm/boot/dts/usb_a9g20.dts
··· 32 32 }; 33 33 }; 34 34 }; 35 + 36 + leds { 37 + compatible = "gpio-leds"; 38 + 39 + user_led { 40 + label = "user_led"; 41 + gpios = <&pioB 21 1>; 42 + linux,default-trigger = "heartbeat"; 43 + }; 44 + }; 45 + 46 + gpio_keys { 47 + compatible = "gpio-keys"; 48 + #address-cells = <1>; 49 + #size-cells = <0>; 50 + 51 + user_pb { 52 + label = "user_pb"; 53 + gpios = <&pioB 10 1>; 54 + linux,code = <28>; 55 + gpio-key,wakeup; 56 + }; 57 + }; 35 58 };
+201
arch/arm/boot/dts/vexpress-v2m-rs1.dtsi
··· 1 + /* 2 + * ARM Ltd. Versatile Express 3 + * 4 + * Motherboard Express uATX 5 + * V2M-P1 6 + * 7 + * HBI-0190D 8 + * 9 + * RS1 memory map ("ARM Cortex-A Series memory map" in the board's 10 + * Technical Reference Manual) 11 + * 12 + * WARNING! The hardware described in this file is independent from the 13 + * original variant (vexpress-v2m.dtsi), but there is a strong 14 + * correspondence between the two configurations. 15 + * 16 + * TAKE CARE WHEN MAINTAINING THIS FILE TO PROPAGATE ANY RELEVANT 17 + * CHANGES TO vexpress-v2m.dtsi! 18 + */ 19 + 20 + / { 21 + aliases { 22 + arm,v2m_timer = &v2m_timer01; 23 + }; 24 + 25 + motherboard { 26 + compatible = "simple-bus"; 27 + arm,v2m-memory-map = "rs1"; 28 + #address-cells = <2>; /* SMB chipselect number and offset */ 29 + #size-cells = <1>; 30 + #interrupt-cells = <1>; 31 + 32 + flash@0,00000000 { 33 + compatible = "arm,vexpress-flash", "cfi-flash"; 34 + reg = <0 0x00000000 0x04000000>, 35 + <4 0x00000000 0x04000000>; 36 + bank-width = <4>; 37 + }; 38 + 39 + psram@1,00000000 { 40 + compatible = "arm,vexpress-psram", "mtd-ram"; 41 + reg = <1 0x00000000 0x02000000>; 42 + bank-width = <4>; 43 + }; 44 + 45 + vram@2,00000000 { 46 + compatible = "arm,vexpress-vram"; 47 + reg = <2 0x00000000 0x00800000>; 48 + }; 49 + 50 + ethernet@2,02000000 { 51 + compatible = "smsc,lan9118", "smsc,lan9115"; 52 + reg = <2 0x02000000 0x10000>; 53 + interrupts = <15>; 54 + phy-mode = "mii"; 55 + reg-io-width = <4>; 56 + smsc,irq-active-high; 57 + smsc,irq-push-pull; 58 + }; 59 + 60 + usb@2,03000000 { 61 + compatible = "nxp,usb-isp1761"; 62 + reg = <2 0x03000000 0x20000>; 63 + interrupts = <16>; 64 + port1-otg; 65 + }; 66 + 67 + iofpga@3,00000000 { 68 + compatible = "arm,amba-bus", "simple-bus"; 69 + #address-cells = <1>; 70 + #size-cells = <1>; 71 + ranges = <0 3 0 0x200000>; 72 + 73 + sysreg@010000 { 74 + compatible = "arm,vexpress-sysreg"; 75 + reg = <0x010000 0x1000>; 76 + }; 77 + 78 + sysctl@020000 { 79 + compatible = "arm,sp810", "arm,primecell"; 80 + reg = <0x020000 0x1000>; 81 + }; 82 + 83 + /* PCI-E I2C bus */ 84 + v2m_i2c_pcie: i2c@030000 { 85 + compatible = "arm,versatile-i2c"; 86 + reg = <0x030000 0x1000>; 87 + 88 + #address-cells = <1>; 89 + #size-cells = <0>; 90 + 91 + pcie-switch@60 { 92 + compatible = "idt,89hpes32h8"; 93 + reg = <0x60>; 94 + }; 95 + }; 96 + 97 + aaci@040000 { 98 + compatible = "arm,pl041", "arm,primecell"; 99 + reg = <0x040000 0x1000>; 100 + interrupts = <11>; 101 + }; 102 + 103 + mmci@050000 { 104 + compatible = "arm,pl180", "arm,primecell"; 105 + reg = <0x050000 0x1000>; 106 + interrupts = <9 10>; 107 + }; 108 + 109 + kmi@060000 { 110 + compatible = "arm,pl050", "arm,primecell"; 111 + reg = <0x060000 0x1000>; 112 + interrupts = <12>; 113 + }; 114 + 115 + kmi@070000 { 116 + compatible = "arm,pl050", "arm,primecell"; 117 + reg = <0x070000 0x1000>; 118 + interrupts = <13>; 119 + }; 120 + 121 + v2m_serial0: uart@090000 { 122 + compatible = "arm,pl011", "arm,primecell"; 123 + reg = <0x090000 0x1000>; 124 + interrupts = <5>; 125 + }; 126 + 127 + v2m_serial1: uart@0a0000 { 128 + compatible = "arm,pl011", "arm,primecell"; 129 + reg = <0x0a0000 0x1000>; 130 + interrupts = <6>; 131 + }; 132 + 133 + v2m_serial2: uart@0b0000 { 134 + compatible = "arm,pl011", "arm,primecell"; 135 + reg = <0x0b0000 0x1000>; 136 + interrupts = <7>; 137 + }; 138 + 139 + v2m_serial3: uart@0c0000 { 140 + compatible = "arm,pl011", "arm,primecell"; 141 + reg = <0x0c0000 0x1000>; 142 + interrupts = <8>; 143 + }; 144 + 145 + wdt@0f0000 { 146 + compatible = "arm,sp805", "arm,primecell"; 147 + reg = <0x0f0000 0x1000>; 148 + interrupts = <0>; 149 + }; 150 + 151 + v2m_timer01: timer@110000 { 152 + compatible = "arm,sp804", "arm,primecell"; 153 + reg = <0x110000 0x1000>; 154 + interrupts = <2>; 155 + }; 156 + 157 + v2m_timer23: timer@120000 { 158 + compatible = "arm,sp804", "arm,primecell"; 159 + reg = <0x120000 0x1000>; 160 + }; 161 + 162 + /* DVI I2C bus */ 163 + v2m_i2c_dvi: i2c@160000 { 164 + compatible = "arm,versatile-i2c"; 165 + reg = <0x160000 0x1000>; 166 + 167 + #address-cells = <1>; 168 + #size-cells = <0>; 169 + 170 + dvi-transmitter@39 { 171 + compatible = "sil,sii9022-tpi", "sil,sii9022"; 172 + reg = <0x39>; 173 + }; 174 + 175 + dvi-transmitter@60 { 176 + compatible = "sil,sii9022-cpi", "sil,sii9022"; 177 + reg = <0x60>; 178 + }; 179 + }; 180 + 181 + rtc@170000 { 182 + compatible = "arm,pl031", "arm,primecell"; 183 + reg = <0x170000 0x1000>; 184 + interrupts = <4>; 185 + }; 186 + 187 + compact-flash@1a0000 { 188 + compatible = "arm,vexpress-cf", "ata-generic"; 189 + reg = <0x1a0000 0x100 190 + 0x1a0100 0xf00>; 191 + reg-shift = <2>; 192 + }; 193 + 194 + clcd@1f0000 { 195 + compatible = "arm,pl111", "arm,primecell"; 196 + reg = <0x1f0000 0x1000>; 197 + interrupts = <14>; 198 + }; 199 + }; 200 + }; 201 + };
+200
arch/arm/boot/dts/vexpress-v2m.dtsi
··· 1 + /* 2 + * ARM Ltd. Versatile Express 3 + * 4 + * Motherboard Express uATX 5 + * V2M-P1 6 + * 7 + * HBI-0190D 8 + * 9 + * Original memory map ("Legacy memory map" in the board's 10 + * Technical Reference Manual) 11 + * 12 + * WARNING! The hardware described in this file is independent from the 13 + * RS1 variant (vexpress-v2m-rs1.dtsi), but there is a strong 14 + * correspondence between the two configurations. 15 + * 16 + * TAKE CARE WHEN MAINTAINING THIS FILE TO PROPAGATE ANY RELEVANT 17 + * CHANGES TO vexpress-v2m-rs1.dtsi! 18 + */ 19 + 20 + / { 21 + aliases { 22 + arm,v2m_timer = &v2m_timer01; 23 + }; 24 + 25 + motherboard { 26 + compatible = "simple-bus"; 27 + #address-cells = <2>; /* SMB chipselect number and offset */ 28 + #size-cells = <1>; 29 + #interrupt-cells = <1>; 30 + 31 + flash@0,00000000 { 32 + compatible = "arm,vexpress-flash", "cfi-flash"; 33 + reg = <0 0x00000000 0x04000000>, 34 + <1 0x00000000 0x04000000>; 35 + bank-width = <4>; 36 + }; 37 + 38 + psram@2,00000000 { 39 + compatible = "arm,vexpress-psram", "mtd-ram"; 40 + reg = <2 0x00000000 0x02000000>; 41 + bank-width = <4>; 42 + }; 43 + 44 + vram@3,00000000 { 45 + compatible = "arm,vexpress-vram"; 46 + reg = <3 0x00000000 0x00800000>; 47 + }; 48 + 49 + ethernet@3,02000000 { 50 + compatible = "smsc,lan9118", "smsc,lan9115"; 51 + reg = <3 0x02000000 0x10000>; 52 + interrupts = <15>; 53 + phy-mode = "mii"; 54 + reg-io-width = <4>; 55 + smsc,irq-active-high; 56 + smsc,irq-push-pull; 57 + }; 58 + 59 + usb@3,03000000 { 60 + compatible = "nxp,usb-isp1761"; 61 + reg = <3 0x03000000 0x20000>; 62 + interrupts = <16>; 63 + port1-otg; 64 + }; 65 + 66 + iofpga@7,00000000 { 67 + compatible = "arm,amba-bus", "simple-bus"; 68 + #address-cells = <1>; 69 + #size-cells = <1>; 70 + ranges = <0 7 0 0x20000>; 71 + 72 + sysreg@00000 { 73 + compatible = "arm,vexpress-sysreg"; 74 + reg = <0x00000 0x1000>; 75 + }; 76 + 77 + sysctl@01000 { 78 + compatible = "arm,sp810", "arm,primecell"; 79 + reg = <0x01000 0x1000>; 80 + }; 81 + 82 + /* PCI-E I2C bus */ 83 + v2m_i2c_pcie: i2c@02000 { 84 + compatible = "arm,versatile-i2c"; 85 + reg = <0x02000 0x1000>; 86 + 87 + #address-cells = <1>; 88 + #size-cells = <0>; 89 + 90 + pcie-switch@60 { 91 + compatible = "idt,89hpes32h8"; 92 + reg = <0x60>; 93 + }; 94 + }; 95 + 96 + aaci@04000 { 97 + compatible = "arm,pl041", "arm,primecell"; 98 + reg = <0x04000 0x1000>; 99 + interrupts = <11>; 100 + }; 101 + 102 + mmci@05000 { 103 + compatible = "arm,pl180", "arm,primecell"; 104 + reg = <0x05000 0x1000>; 105 + interrupts = <9 10>; 106 + }; 107 + 108 + kmi@06000 { 109 + compatible = "arm,pl050", "arm,primecell"; 110 + reg = <0x06000 0x1000>; 111 + interrupts = <12>; 112 + }; 113 + 114 + kmi@07000 { 115 + compatible = "arm,pl050", "arm,primecell"; 116 + reg = <0x07000 0x1000>; 117 + interrupts = <13>; 118 + }; 119 + 120 + v2m_serial0: uart@09000 { 121 + compatible = "arm,pl011", "arm,primecell"; 122 + reg = <0x09000 0x1000>; 123 + interrupts = <5>; 124 + }; 125 + 126 + v2m_serial1: uart@0a000 { 127 + compatible = "arm,pl011", "arm,primecell"; 128 + reg = <0x0a000 0x1000>; 129 + interrupts = <6>; 130 + }; 131 + 132 + v2m_serial2: uart@0b000 { 133 + compatible = "arm,pl011", "arm,primecell"; 134 + reg = <0x0b000 0x1000>; 135 + interrupts = <7>; 136 + }; 137 + 138 + v2m_serial3: uart@0c000 { 139 + compatible = "arm,pl011", "arm,primecell"; 140 + reg = <0x0c000 0x1000>; 141 + interrupts = <8>; 142 + }; 143 + 144 + wdt@0f000 { 145 + compatible = "arm,sp805", "arm,primecell"; 146 + reg = <0x0f000 0x1000>; 147 + interrupts = <0>; 148 + }; 149 + 150 + v2m_timer01: timer@11000 { 151 + compatible = "arm,sp804", "arm,primecell"; 152 + reg = <0x11000 0x1000>; 153 + interrupts = <2>; 154 + }; 155 + 156 + v2m_timer23: timer@12000 { 157 + compatible = "arm,sp804", "arm,primecell"; 158 + reg = <0x12000 0x1000>; 159 + }; 160 + 161 + /* DVI I2C bus */ 162 + v2m_i2c_dvi: i2c@16000 { 163 + compatible = "arm,versatile-i2c"; 164 + reg = <0x16000 0x1000>; 165 + 166 + #address-cells = <1>; 167 + #size-cells = <0>; 168 + 169 + dvi-transmitter@39 { 170 + compatible = "sil,sii9022-tpi", "sil,sii9022"; 171 + reg = <0x39>; 172 + }; 173 + 174 + dvi-transmitter@60 { 175 + compatible = "sil,sii9022-cpi", "sil,sii9022"; 176 + reg = <0x60>; 177 + }; 178 + }; 179 + 180 + rtc@17000 { 181 + compatible = "arm,pl031", "arm,primecell"; 182 + reg = <0x17000 0x1000>; 183 + interrupts = <4>; 184 + }; 185 + 186 + compact-flash@1a000 { 187 + compatible = "arm,vexpress-cf", "ata-generic"; 188 + reg = <0x1a000 0x100 189 + 0x1a100 0xf00>; 190 + reg-shift = <2>; 191 + }; 192 + 193 + clcd@1f000 { 194 + compatible = "arm,pl111", "arm,primecell"; 195 + reg = <0x1f000 0x1000>; 196 + interrupts = <14>; 197 + }; 198 + }; 199 + }; 200 + };
+157
arch/arm/boot/dts/vexpress-v2p-ca15-tc1.dts
··· 1 + /* 2 + * ARM Ltd. Versatile Express 3 + * 4 + * CoreTile Express A15x2 (version with Test Chip 1) 5 + * Cortex-A15 MPCore (V2P-CA15) 6 + * 7 + * HBI-0237A 8 + */ 9 + 10 + /dts-v1/; 11 + 12 + / { 13 + model = "V2P-CA15"; 14 + arm,hbi = <0x237>; 15 + compatible = "arm,vexpress,v2p-ca15,tc1", "arm,vexpress,v2p-ca15", "arm,vexpress"; 16 + interrupt-parent = <&gic>; 17 + #address-cells = <1>; 18 + #size-cells = <1>; 19 + 20 + chosen { }; 21 + 22 + aliases { 23 + serial0 = &v2m_serial0; 24 + serial1 = &v2m_serial1; 25 + serial2 = &v2m_serial2; 26 + serial3 = &v2m_serial3; 27 + i2c0 = &v2m_i2c_dvi; 28 + i2c1 = &v2m_i2c_pcie; 29 + }; 30 + 31 + cpus { 32 + #address-cells = <1>; 33 + #size-cells = <0>; 34 + 35 + cpu@0 { 36 + device_type = "cpu"; 37 + compatible = "arm,cortex-a15"; 38 + reg = <0>; 39 + }; 40 + 41 + cpu@1 { 42 + device_type = "cpu"; 43 + compatible = "arm,cortex-a15"; 44 + reg = <1>; 45 + }; 46 + }; 47 + 48 + memory@80000000 { 49 + device_type = "memory"; 50 + reg = <0x80000000 0x40000000>; 51 + }; 52 + 53 + hdlcd@2b000000 { 54 + compatible = "arm,hdlcd"; 55 + reg = <0x2b000000 0x1000>; 56 + interrupts = <0 85 4>; 57 + }; 58 + 59 + memory-controller@2b0a0000 { 60 + compatible = "arm,pl341", "arm,primecell"; 61 + reg = <0x2b0a0000 0x1000>; 62 + }; 63 + 64 + wdt@2b060000 { 65 + compatible = "arm,sp805", "arm,primecell"; 66 + reg = <0x2b060000 0x1000>; 67 + interrupts = <98>; 68 + }; 69 + 70 + gic: interrupt-controller@2c001000 { 71 + compatible = "arm,cortex-a15-gic", "arm,cortex-a9-gic"; 72 + #interrupt-cells = <3>; 73 + #address-cells = <0>; 74 + interrupt-controller; 75 + reg = <0x2c001000 0x1000>, 76 + <0x2c002000 0x100>; 77 + }; 78 + 79 + memory-controller@7ffd0000 { 80 + compatible = "arm,pl354", "arm,primecell"; 81 + reg = <0x7ffd0000 0x1000>; 82 + interrupts = <0 86 4>, 83 + <0 87 4>; 84 + }; 85 + 86 + dma@7ffb0000 { 87 + compatible = "arm,pl330", "arm,primecell"; 88 + reg = <0x7ffb0000 0x1000>; 89 + interrupts = <0 92 4>, 90 + <0 88 4>, 91 + <0 89 4>, 92 + <0 90 4>, 93 + <0 91 4>; 94 + }; 95 + 96 + pmu { 97 + compatible = "arm,cortex-a15-pmu", "arm,cortex-a9-pmu"; 98 + interrupts = <0 68 4>, 99 + <0 69 4>; 100 + }; 101 + 102 + motherboard { 103 + ranges = <0 0 0x08000000 0x04000000>, 104 + <1 0 0x14000000 0x04000000>, 105 + <2 0 0x18000000 0x04000000>, 106 + <3 0 0x1c000000 0x04000000>, 107 + <4 0 0x0c000000 0x04000000>, 108 + <5 0 0x10000000 0x04000000>; 109 + 110 + interrupt-map-mask = <0 0 63>; 111 + interrupt-map = <0 0 0 &gic 0 0 4>, 112 + <0 0 1 &gic 0 1 4>, 113 + <0 0 2 &gic 0 2 4>, 114 + <0 0 3 &gic 0 3 4>, 115 + <0 0 4 &gic 0 4 4>, 116 + <0 0 5 &gic 0 5 4>, 117 + <0 0 6 &gic 0 6 4>, 118 + <0 0 7 &gic 0 7 4>, 119 + <0 0 8 &gic 0 8 4>, 120 + <0 0 9 &gic 0 9 4>, 121 + <0 0 10 &gic 0 10 4>, 122 + <0 0 11 &gic 0 11 4>, 123 + <0 0 12 &gic 0 12 4>, 124 + <0 0 13 &gic 0 13 4>, 125 + <0 0 14 &gic 0 14 4>, 126 + <0 0 15 &gic 0 15 4>, 127 + <0 0 16 &gic 0 16 4>, 128 + <0 0 17 &gic 0 17 4>, 129 + <0 0 18 &gic 0 18 4>, 130 + <0 0 19 &gic 0 19 4>, 131 + <0 0 20 &gic 0 20 4>, 132 + <0 0 21 &gic 0 21 4>, 133 + <0 0 22 &gic 0 22 4>, 134 + <0 0 23 &gic 0 23 4>, 135 + <0 0 24 &gic 0 24 4>, 136 + <0 0 25 &gic 0 25 4>, 137 + <0 0 26 &gic 0 26 4>, 138 + <0 0 27 &gic 0 27 4>, 139 + <0 0 28 &gic 0 28 4>, 140 + <0 0 29 &gic 0 29 4>, 141 + <0 0 30 &gic 0 30 4>, 142 + <0 0 31 &gic 0 31 4>, 143 + <0 0 32 &gic 0 32 4>, 144 + <0 0 33 &gic 0 33 4>, 145 + <0 0 34 &gic 0 34 4>, 146 + <0 0 35 &gic 0 35 4>, 147 + <0 0 36 &gic 0 36 4>, 148 + <0 0 37 &gic 0 37 4>, 149 + <0 0 38 &gic 0 38 4>, 150 + <0 0 39 &gic 0 39 4>, 151 + <0 0 40 &gic 0 40 4>, 152 + <0 0 41 &gic 0 41 4>, 153 + <0 0 42 &gic 0 42 4>; 154 + }; 155 + }; 156 + 157 + /include/ "vexpress-v2m-rs1.dtsi"
+162
arch/arm/boot/dts/vexpress-v2p-ca5s.dts
··· 1 + /* 2 + * ARM Ltd. Versatile Express 3 + * 4 + * CoreTile Express A5x2 5 + * Cortex-A5 MPCore (V2P-CA5s) 6 + * 7 + * HBI-0225B 8 + */ 9 + 10 + /dts-v1/; 11 + 12 + / { 13 + model = "V2P-CA5s"; 14 + arm,hbi = <0x225>; 15 + compatible = "arm,vexpress,v2p-ca5s", "arm,vexpress"; 16 + interrupt-parent = <&gic>; 17 + #address-cells = <1>; 18 + #size-cells = <1>; 19 + 20 + chosen { }; 21 + 22 + aliases { 23 + serial0 = &v2m_serial0; 24 + serial1 = &v2m_serial1; 25 + serial2 = &v2m_serial2; 26 + serial3 = &v2m_serial3; 27 + i2c0 = &v2m_i2c_dvi; 28 + i2c1 = &v2m_i2c_pcie; 29 + }; 30 + 31 + cpus { 32 + #address-cells = <1>; 33 + #size-cells = <0>; 34 + 35 + cpu@0 { 36 + device_type = "cpu"; 37 + compatible = "arm,cortex-a5"; 38 + reg = <0>; 39 + next-level-cache = <&L2>; 40 + }; 41 + 42 + cpu@1 { 43 + device_type = "cpu"; 44 + compatible = "arm,cortex-a5"; 45 + reg = <1>; 46 + next-level-cache = <&L2>; 47 + }; 48 + }; 49 + 50 + memory@80000000 { 51 + device_type = "memory"; 52 + reg = <0x80000000 0x40000000>; 53 + }; 54 + 55 + hdlcd@2a110000 { 56 + compatible = "arm,hdlcd"; 57 + reg = <0x2a110000 0x1000>; 58 + interrupts = <0 85 4>; 59 + }; 60 + 61 + memory-controller@2a150000 { 62 + compatible = "arm,pl341", "arm,primecell"; 63 + reg = <0x2a150000 0x1000>; 64 + }; 65 + 66 + memory-controller@2a190000 { 67 + compatible = "arm,pl354", "arm,primecell"; 68 + reg = <0x2a190000 0x1000>; 69 + interrupts = <0 86 4>, 70 + <0 87 4>; 71 + }; 72 + 73 + scu@2c000000 { 74 + compatible = "arm,cortex-a5-scu"; 75 + reg = <0x2c000000 0x58>; 76 + }; 77 + 78 + timer@2c000600 { 79 + compatible = "arm,cortex-a5-twd-timer"; 80 + reg = <0x2c000600 0x38>; 81 + interrupts = <1 2 0x304>, 82 + <1 3 0x304>; 83 + }; 84 + 85 + gic: interrupt-controller@2c001000 { 86 + compatible = "arm,corex-a5-gic", "arm,cortex-a9-gic"; 87 + #interrupt-cells = <3>; 88 + #address-cells = <0>; 89 + interrupt-controller; 90 + reg = <0x2c001000 0x1000>, 91 + <0x2c000100 0x100>; 92 + }; 93 + 94 + L2: cache-controller@2c0f0000 { 95 + compatible = "arm,pl310-cache"; 96 + reg = <0x2c0f0000 0x1000>; 97 + interrupts = <0 84 4>; 98 + cache-level = <2>; 99 + }; 100 + 101 + pmu { 102 + compatible = "arm,cortex-a5-pmu", "arm,cortex-a9-pmu"; 103 + interrupts = <0 68 4>, 104 + <0 69 4>; 105 + }; 106 + 107 + motherboard { 108 + ranges = <0 0 0x08000000 0x04000000>, 109 + <1 0 0x14000000 0x04000000>, 110 + <2 0 0x18000000 0x04000000>, 111 + <3 0 0x1c000000 0x04000000>, 112 + <4 0 0x0c000000 0x04000000>, 113 + <5 0 0x10000000 0x04000000>; 114 + 115 + interrupt-map-mask = <0 0 63>; 116 + interrupt-map = <0 0 0 &gic 0 0 4>, 117 + <0 0 1 &gic 0 1 4>, 118 + <0 0 2 &gic 0 2 4>, 119 + <0 0 3 &gic 0 3 4>, 120 + <0 0 4 &gic 0 4 4>, 121 + <0 0 5 &gic 0 5 4>, 122 + <0 0 6 &gic 0 6 4>, 123 + <0 0 7 &gic 0 7 4>, 124 + <0 0 8 &gic 0 8 4>, 125 + <0 0 9 &gic 0 9 4>, 126 + <0 0 10 &gic 0 10 4>, 127 + <0 0 11 &gic 0 11 4>, 128 + <0 0 12 &gic 0 12 4>, 129 + <0 0 13 &gic 0 13 4>, 130 + <0 0 14 &gic 0 14 4>, 131 + <0 0 15 &gic 0 15 4>, 132 + <0 0 16 &gic 0 16 4>, 133 + <0 0 17 &gic 0 17 4>, 134 + <0 0 18 &gic 0 18 4>, 135 + <0 0 19 &gic 0 19 4>, 136 + <0 0 20 &gic 0 20 4>, 137 + <0 0 21 &gic 0 21 4>, 138 + <0 0 22 &gic 0 22 4>, 139 + <0 0 23 &gic 0 23 4>, 140 + <0 0 24 &gic 0 24 4>, 141 + <0 0 25 &gic 0 25 4>, 142 + <0 0 26 &gic 0 26 4>, 143 + <0 0 27 &gic 0 27 4>, 144 + <0 0 28 &gic 0 28 4>, 145 + <0 0 29 &gic 0 29 4>, 146 + <0 0 30 &gic 0 30 4>, 147 + <0 0 31 &gic 0 31 4>, 148 + <0 0 32 &gic 0 32 4>, 149 + <0 0 33 &gic 0 33 4>, 150 + <0 0 34 &gic 0 34 4>, 151 + <0 0 35 &gic 0 35 4>, 152 + <0 0 36 &gic 0 36 4>, 153 + <0 0 37 &gic 0 37 4>, 154 + <0 0 38 &gic 0 38 4>, 155 + <0 0 39 &gic 0 39 4>, 156 + <0 0 40 &gic 0 40 4>, 157 + <0 0 41 &gic 0 41 4>, 158 + <0 0 42 &gic 0 42 4>; 159 + }; 160 + }; 161 + 162 + /include/ "vexpress-v2m-rs1.dtsi"
+192
arch/arm/boot/dts/vexpress-v2p-ca9.dts
··· 1 + /* 2 + * ARM Ltd. Versatile Express 3 + * 4 + * CoreTile Express A9x4 5 + * Cortex-A9 MPCore (V2P-CA9) 6 + * 7 + * HBI-0191B 8 + */ 9 + 10 + /dts-v1/; 11 + 12 + / { 13 + model = "V2P-CA9"; 14 + arm,hbi = <0x191>; 15 + compatible = "arm,vexpress,v2p-ca9", "arm,vexpress"; 16 + interrupt-parent = <&gic>; 17 + #address-cells = <1>; 18 + #size-cells = <1>; 19 + 20 + chosen { }; 21 + 22 + aliases { 23 + serial0 = &v2m_serial0; 24 + serial1 = &v2m_serial1; 25 + serial2 = &v2m_serial2; 26 + serial3 = &v2m_serial3; 27 + i2c0 = &v2m_i2c_dvi; 28 + i2c1 = &v2m_i2c_pcie; 29 + }; 30 + 31 + cpus { 32 + #address-cells = <1>; 33 + #size-cells = <0>; 34 + 35 + cpu@0 { 36 + device_type = "cpu"; 37 + compatible = "arm,cortex-a9"; 38 + reg = <0>; 39 + next-level-cache = <&L2>; 40 + }; 41 + 42 + cpu@1 { 43 + device_type = "cpu"; 44 + compatible = "arm,cortex-a9"; 45 + reg = <1>; 46 + next-level-cache = <&L2>; 47 + }; 48 + 49 + cpu@2 { 50 + device_type = "cpu"; 51 + compatible = "arm,cortex-a9"; 52 + reg = <2>; 53 + next-level-cache = <&L2>; 54 + }; 55 + 56 + cpu@3 { 57 + device_type = "cpu"; 58 + compatible = "arm,cortex-a9"; 59 + reg = <3>; 60 + next-level-cache = <&L2>; 61 + }; 62 + }; 63 + 64 + memory@60000000 { 65 + device_type = "memory"; 66 + reg = <0x60000000 0x40000000>; 67 + }; 68 + 69 + clcd@10020000 { 70 + compatible = "arm,pl111", "arm,primecell"; 71 + reg = <0x10020000 0x1000>; 72 + interrupts = <0 44 4>; 73 + }; 74 + 75 + memory-controller@100e0000 { 76 + compatible = "arm,pl341", "arm,primecell"; 77 + reg = <0x100e0000 0x1000>; 78 + }; 79 + 80 + memory-controller@100e1000 { 81 + compatible = "arm,pl354", "arm,primecell"; 82 + reg = <0x100e1000 0x1000>; 83 + interrupts = <0 45 4>, 84 + <0 46 4>; 85 + }; 86 + 87 + timer@100e4000 { 88 + compatible = "arm,sp804", "arm,primecell"; 89 + reg = <0x100e4000 0x1000>; 90 + interrupts = <0 48 4>, 91 + <0 49 4>; 92 + }; 93 + 94 + watchdog@100e5000 { 95 + compatible = "arm,sp805", "arm,primecell"; 96 + reg = <0x100e5000 0x1000>; 97 + interrupts = <0 51 4>; 98 + }; 99 + 100 + scu@1e000000 { 101 + compatible = "arm,cortex-a9-scu"; 102 + reg = <0x1e000000 0x58>; 103 + }; 104 + 105 + timer@1e000600 { 106 + compatible = "arm,cortex-a9-twd-timer"; 107 + reg = <0x1e000600 0x20>; 108 + interrupts = <1 2 0xf04>, 109 + <1 3 0xf04>; 110 + }; 111 + 112 + gic: interrupt-controller@1e001000 { 113 + compatible = "arm,cortex-a9-gic"; 114 + #interrupt-cells = <3>; 115 + #address-cells = <0>; 116 + interrupt-controller; 117 + reg = <0x1e001000 0x1000>, 118 + <0x1e000100 0x100>; 119 + }; 120 + 121 + L2: cache-controller@1e00a000 { 122 + compatible = "arm,pl310-cache"; 123 + reg = <0x1e00a000 0x1000>; 124 + interrupts = <0 43 4>; 125 + cache-level = <2>; 126 + arm,data-latency = <1 1 1>; 127 + arm,tag-latency = <1 1 1>; 128 + }; 129 + 130 + pmu { 131 + compatible = "arm,cortex-a9-pmu"; 132 + interrupts = <0 60 4>, 133 + <0 61 4>, 134 + <0 62 4>, 135 + <0 63 4>; 136 + }; 137 + 138 + motherboard { 139 + ranges = <0 0 0x40000000 0x04000000>, 140 + <1 0 0x44000000 0x04000000>, 141 + <2 0 0x48000000 0x04000000>, 142 + <3 0 0x4c000000 0x04000000>, 143 + <7 0 0x10000000 0x00020000>; 144 + 145 + interrupt-map-mask = <0 0 63>; 146 + interrupt-map = <0 0 0 &gic 0 0 4>, 147 + <0 0 1 &gic 0 1 4>, 148 + <0 0 2 &gic 0 2 4>, 149 + <0 0 3 &gic 0 3 4>, 150 + <0 0 4 &gic 0 4 4>, 151 + <0 0 5 &gic 0 5 4>, 152 + <0 0 6 &gic 0 6 4>, 153 + <0 0 7 &gic 0 7 4>, 154 + <0 0 8 &gic 0 8 4>, 155 + <0 0 9 &gic 0 9 4>, 156 + <0 0 10 &gic 0 10 4>, 157 + <0 0 11 &gic 0 11 4>, 158 + <0 0 12 &gic 0 12 4>, 159 + <0 0 13 &gic 0 13 4>, 160 + <0 0 14 &gic 0 14 4>, 161 + <0 0 15 &gic 0 15 4>, 162 + <0 0 16 &gic 0 16 4>, 163 + <0 0 17 &gic 0 17 4>, 164 + <0 0 18 &gic 0 18 4>, 165 + <0 0 19 &gic 0 19 4>, 166 + <0 0 20 &gic 0 20 4>, 167 + <0 0 21 &gic 0 21 4>, 168 + <0 0 22 &gic 0 22 4>, 169 + <0 0 23 &gic 0 23 4>, 170 + <0 0 24 &gic 0 24 4>, 171 + <0 0 25 &gic 0 25 4>, 172 + <0 0 26 &gic 0 26 4>, 173 + <0 0 27 &gic 0 27 4>, 174 + <0 0 28 &gic 0 28 4>, 175 + <0 0 29 &gic 0 29 4>, 176 + <0 0 30 &gic 0 30 4>, 177 + <0 0 31 &gic 0 31 4>, 178 + <0 0 32 &gic 0 32 4>, 179 + <0 0 33 &gic 0 33 4>, 180 + <0 0 34 &gic 0 34 4>, 181 + <0 0 35 &gic 0 35 4>, 182 + <0 0 36 &gic 0 36 4>, 183 + <0 0 37 &gic 0 37 4>, 184 + <0 0 38 &gic 0 38 4>, 185 + <0 0 39 &gic 0 39 4>, 186 + <0 0 40 &gic 0 40 4>, 187 + <0 0 41 &gic 0 41 4>, 188 + <0 0 42 &gic 0 42 4>; 189 + }; 190 + }; 191 + 192 + /include/ "vexpress-v2m.dtsi"
+1 -1
arch/arm/mach-at91/Makefile
··· 20 20 obj-$(CONFIG_ARCH_AT91SAM9RL) += at91sam9rl.o at91sam926x_time.o at91sam9rl_devices.o sam9_smc.o 21 21 obj-$(CONFIG_ARCH_AT91SAM9G20) += at91sam9260.o at91sam926x_time.o at91sam9260_devices.o sam9_smc.o 22 22 obj-$(CONFIG_ARCH_AT91SAM9G45) += at91sam9g45.o at91sam926x_time.o at91sam9g45_devices.o sam9_smc.o 23 - obj-$(CONFIG_ARCH_AT91SAM9X5) += at91sam9x5.o at91sam926x_time.o 23 + obj-$(CONFIG_ARCH_AT91SAM9X5) += at91sam9x5.o at91sam926x_time.o sam9_smc.o 24 24 obj-$(CONFIG_ARCH_AT91X40) += at91x40.o at91x40_time.o 25 25 26 26 # AT91RM9200 board-specific support
+7 -1
arch/arm/mach-at91/Makefile.boot
··· 13 13 initrd_phys-y := 0x20410000 14 14 endif 15 15 16 - dtb-$(CONFIG_MACH_AT91SAM_DT) += at91sam9m10g45ek.dtb usb_a9g20.dtb 16 + # Keep dtb files sorted alphabetically for each SoC 17 + # sam9g20 18 + dtb-$(CONFIG_MACH_AT91SAM_DT) += usb_a9g20.dtb 19 + # sam9g45 20 + dtb-$(CONFIG_MACH_AT91SAM_DT) += at91sam9m10g45ek.dtb 21 + # sam9x5 22 + dtb-$(CONFIG_MACH_AT91SAM_DT) += at91sam9g25ek.dtb
+5 -3
arch/arm/mach-at91/at91rm9200.c
··· 295 295 * Disable the processor clock. The processor will be automatically 296 296 * re-enabled by an interrupt or by a reset. 297 297 */ 298 - at91_sys_write(AT91_PMC_SCDR, AT91_PMC_PCK); 298 + at91_pmc_write(AT91_PMC_SCDR, AT91_PMC_PCK); 299 299 } 300 300 301 301 static void at91rm9200_restart(char mode, const char *cmd) ··· 303 303 /* 304 304 * Perform a hardware reset with the use of the Watchdog timer. 305 305 */ 306 - at91_sys_write(AT91_ST_WDMR, AT91_ST_RSTEN | AT91_ST_EXTEN | 1); 307 - at91_sys_write(AT91_ST_CR, AT91_ST_WDRST); 306 + at91_st_write(AT91_ST_WDMR, AT91_ST_RSTEN | AT91_ST_EXTEN | 1); 307 + at91_st_write(AT91_ST_CR, AT91_ST_WDRST); 308 308 } 309 309 310 310 /* -------------------------------------------------------------------- ··· 319 319 320 320 static void __init at91rm9200_ioremap_registers(void) 321 321 { 322 + at91rm9200_ioremap_st(AT91RM9200_BASE_ST); 323 + at91_ioremap_ramc(0, AT91RM9200_BASE_MC, 256); 322 324 } 323 325 324 326 static void __init at91rm9200_initialize(void)
+7 -7
arch/arm/mach-at91/at91rm9200_devices.c
··· 21 21 #include <mach/board.h> 22 22 #include <mach/at91rm9200.h> 23 23 #include <mach/at91rm9200_mc.h> 24 + #include <mach/at91_ramc.h> 24 25 25 26 #include "generic.h" 26 27 ··· 242 241 data->chipselect = 4; /* can only use EBI ChipSelect 4 */ 243 242 244 243 /* CF takes over CS4, CS5, CS6 */ 245 - csa = at91_sys_read(AT91_EBI_CSA); 246 - at91_sys_write(AT91_EBI_CSA, csa | AT91_EBI_CS4A_SMC_COMPACTFLASH); 244 + csa = at91_ramc_read(0, AT91_EBI_CSA); 245 + at91_ramc_write(0, AT91_EBI_CSA, csa | AT91_EBI_CS4A_SMC_COMPACTFLASH); 247 246 248 247 /* 249 248 * Static memory controller timing adjustments. 250 249 * REVISIT: these timings are in terms of MCK cycles, so 251 250 * when MCK changes (cpufreq etc) so must these values... 252 251 */ 253 - at91_sys_write(AT91_SMC_CSR(4), 252 + at91_ramc_write(0, AT91_SMC_CSR(4), 254 253 AT91_SMC_ACSS_STD 255 254 | AT91_SMC_DBW_16 256 255 | AT91_SMC_BAT ··· 408 407 return; 409 408 410 409 /* enable the address range of CS3 */ 411 - csa = at91_sys_read(AT91_EBI_CSA); 412 - at91_sys_write(AT91_EBI_CSA, csa | AT91_EBI_CS3A_SMC_SMARTMEDIA); 410 + csa = at91_ramc_read(0, AT91_EBI_CSA); 411 + at91_ramc_write(0, AT91_EBI_CSA, csa | AT91_EBI_CS3A_SMC_SMARTMEDIA); 413 412 414 413 /* set the bus interface characteristics */ 415 - at91_sys_write(AT91_SMC_CSR(3), AT91_SMC_ACSS_STD | AT91_SMC_DBW_8 | AT91_SMC_WSEN 414 + at91_ramc_write(0, AT91_SMC_CSR(3), AT91_SMC_ACSS_STD | AT91_SMC_DBW_8 | AT91_SMC_WSEN 416 415 | AT91_SMC_NWS_(5) 417 416 | AT91_SMC_TDF_(1) 418 417 | AT91_SMC_RWSETUP_(0) /* tDS Data Set up Time 30 - ns */ ··· 1115 1114 } 1116 1115 1117 1116 static struct platform_device *__initdata at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */ 1118 - struct platform_device *atmel_default_console_device; /* the serial console device */ 1119 1117 1120 1118 void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) 1121 1119 {
+23 -14
arch/arm/mach-at91/at91rm9200_time.c
··· 43 43 { 44 44 unsigned long x1, x2; 45 45 46 - x1 = at91_sys_read(AT91_ST_CRTR); 46 + x1 = at91_st_read(AT91_ST_CRTR); 47 47 do { 48 - x2 = at91_sys_read(AT91_ST_CRTR); 48 + x2 = at91_st_read(AT91_ST_CRTR); 49 49 if (x1 == x2) 50 50 break; 51 51 x1 = x2; ··· 58 58 */ 59 59 static irqreturn_t at91rm9200_timer_interrupt(int irq, void *dev_id) 60 60 { 61 - u32 sr = at91_sys_read(AT91_ST_SR) & irqmask; 61 + u32 sr = at91_st_read(AT91_ST_SR) & irqmask; 62 62 63 63 /* 64 64 * irqs should be disabled here, but as the irq is shared they are only ··· 110 110 clkevt32k_mode(enum clock_event_mode mode, struct clock_event_device *dev) 111 111 { 112 112 /* Disable and flush pending timer interrupts */ 113 - at91_sys_write(AT91_ST_IDR, AT91_ST_PITS | AT91_ST_ALMS); 114 - (void) at91_sys_read(AT91_ST_SR); 113 + at91_st_write(AT91_ST_IDR, AT91_ST_PITS | AT91_ST_ALMS); 114 + at91_st_read(AT91_ST_SR); 115 115 116 116 last_crtr = read_CRTR(); 117 117 switch (mode) { 118 118 case CLOCK_EVT_MODE_PERIODIC: 119 119 /* PIT for periodic irqs; fixed rate of 1/HZ */ 120 120 irqmask = AT91_ST_PITS; 121 - at91_sys_write(AT91_ST_PIMR, RM9200_TIMER_LATCH); 121 + at91_st_write(AT91_ST_PIMR, RM9200_TIMER_LATCH); 122 122 break; 123 123 case CLOCK_EVT_MODE_ONESHOT: 124 124 /* ALM for oneshot irqs, set by next_event() 125 125 * before 32 seconds have passed 126 126 */ 127 127 irqmask = AT91_ST_ALMS; 128 - at91_sys_write(AT91_ST_RTAR, last_crtr); 128 + at91_st_write(AT91_ST_RTAR, last_crtr); 129 129 break; 130 130 case CLOCK_EVT_MODE_SHUTDOWN: 131 131 case CLOCK_EVT_MODE_UNUSED: ··· 133 133 irqmask = 0; 134 134 break; 135 135 } 136 - at91_sys_write(AT91_ST_IER, irqmask); 136 + at91_st_write(AT91_ST_IER, irqmask); 137 137 } 138 138 139 139 static int ··· 156 156 alm = read_CRTR(); 157 157 158 158 /* Cancel any pending alarm; flush any pending IRQ */ 159 - at91_sys_write(AT91_ST_RTAR, alm); 160 - (void) at91_sys_read(AT91_ST_SR); 159 + at91_st_write(AT91_ST_RTAR, alm); 160 + at91_st_read(AT91_ST_SR); 161 161 162 162 /* Schedule alarm by writing RTAR. */ 163 163 alm += delta; 164 - at91_sys_write(AT91_ST_RTAR, alm); 164 + at91_st_write(AT91_ST_RTAR, alm); 165 165 166 166 return status; 167 167 } ··· 175 175 .set_mode = clkevt32k_mode, 176 176 }; 177 177 178 + void __iomem *at91_st_base; 179 + 180 + void __init at91rm9200_ioremap_st(u32 addr) 181 + { 182 + at91_st_base = ioremap(addr, 256); 183 + if (!at91_st_base) 184 + panic("Impossible to ioremap ST\n"); 185 + } 186 + 178 187 /* 179 188 * ST (system timer) module supports both clockevents and clocksource. 180 189 */ 181 190 void __init at91rm9200_timer_init(void) 182 191 { 183 192 /* Disable all timer interrupts, and clear any pending ones */ 184 - at91_sys_write(AT91_ST_IDR, 193 + at91_st_write(AT91_ST_IDR, 185 194 AT91_ST_PITS | AT91_ST_WDOVF | AT91_ST_RTTINC | AT91_ST_ALMS); 186 - (void) at91_sys_read(AT91_ST_SR); 195 + at91_st_read(AT91_ST_SR); 187 196 188 197 /* Make IRQs happen for the system timer */ 189 198 setup_irq(AT91_ID_SYS, &at91rm9200_timer_irq); ··· 201 192 * directly for the clocksource and all clockevents, after adjusting 202 193 * its prescaler from the 1 Hz default. 203 194 */ 204 - at91_sys_write(AT91_ST_RTMR, 1); 195 + at91_st_write(AT91_ST_RTMR, 1); 205 196 206 197 /* Setup timer clockevent, with minimum of two ticks (important!!) */ 207 198 clkevt.mult = div_sc(AT91_SLOW_CLOCK, NSEC_PER_SEC, clkevt.shift);
+15 -15
arch/arm/mach-at91/at91sam9260.c
··· 209 209 CLKDEV_CON_DEV_ID("usart", "fffd0000.serial", &usart3_clk), 210 210 CLKDEV_CON_DEV_ID("usart", "fffd4000.serial", &usart4_clk), 211 211 CLKDEV_CON_DEV_ID("usart", "fffd8000.serial", &usart5_clk), 212 + /* more tc lookup table for DT entries */ 213 + CLKDEV_CON_DEV_ID("t0_clk", "fffa0000.timer", &tc0_clk), 214 + CLKDEV_CON_DEV_ID("t1_clk", "fffa0000.timer", &tc1_clk), 215 + CLKDEV_CON_DEV_ID("t2_clk", "fffa0000.timer", &tc2_clk), 216 + CLKDEV_CON_DEV_ID("t0_clk", "fffdc000.timer", &tc3_clk), 217 + CLKDEV_CON_DEV_ID("t1_clk", "fffdc000.timer", &tc4_clk), 218 + CLKDEV_CON_DEV_ID("t2_clk", "fffdc000.timer", &tc5_clk), 212 219 /* fake hclk clock */ 213 220 CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk), 214 221 CLKDEV_CON_ID("pioA", &pioA_clk), ··· 317 310 318 311 static void __init at91sam9260_map_io(void) 319 312 { 320 - if (cpu_is_at91sam9xe()) { 313 + if (cpu_is_at91sam9xe()) 321 314 at91sam9xe_map_io(); 322 - } else if (cpu_is_at91sam9g20()) { 323 - at91_init_sram(0, AT91SAM9G20_SRAM0_BASE, AT91SAM9G20_SRAM0_SIZE); 324 - at91_init_sram(1, AT91SAM9G20_SRAM1_BASE, AT91SAM9G20_SRAM1_SIZE); 325 - } else { 326 - at91_init_sram(0, AT91SAM9260_SRAM0_BASE, AT91SAM9260_SRAM0_SIZE); 327 - at91_init_sram(1, AT91SAM9260_SRAM1_BASE, AT91SAM9260_SRAM1_SIZE); 328 - } 315 + else if (cpu_is_at91sam9g20()) 316 + at91_init_sram(0, AT91SAM9G20_SRAM_BASE, AT91SAM9G20_SRAM_SIZE); 317 + else 318 + at91_init_sram(0, AT91SAM9260_SRAM_BASE, AT91SAM9260_SRAM_SIZE); 329 319 } 330 320 331 321 static void __init at91sam9260_ioremap_registers(void) 332 322 { 333 323 at91_ioremap_shdwc(AT91SAM9260_BASE_SHDWC); 334 324 at91_ioremap_rstc(AT91SAM9260_BASE_RSTC); 325 + at91_ioremap_ramc(0, AT91SAM9260_BASE_SDRAMC, 512); 335 326 at91sam926x_ioremap_pit(AT91SAM9260_BASE_PIT); 336 327 at91sam9_ioremap_smc(0, AT91SAM9260_BASE_SMC); 337 - } 338 - 339 - static void at91sam9260_idle(void) 340 - { 341 - at91_sys_write(AT91_PMC_SCDR, AT91_PMC_PCK); 342 - cpu_do_idle(); 328 + at91_ioremap_matrix(AT91SAM9260_BASE_MATRIX); 343 329 } 344 330 345 331 static void __init at91sam9260_initialize(void) 346 332 { 347 - arm_pm_idle = at91sam9260_idle; 333 + arm_pm_idle = at91sam9_idle; 348 334 arm_pm_restart = at91sam9_alt_restart; 349 335 at91_extern_irq = (1 << AT91SAM9260_ID_IRQ0) | (1 << AT91SAM9260_ID_IRQ1) 350 336 | (1 << AT91SAM9260_ID_IRQ2);
+50 -9
arch/arm/mach-at91/at91sam9260_devices.c
··· 21 21 #include <mach/cpu.h> 22 22 #include <mach/at91sam9260.h> 23 23 #include <mach/at91sam9260_matrix.h> 24 + #include <mach/at91_matrix.h> 24 25 #include <mach/at91sam9_smc.h> 25 26 26 27 #include "generic.h" ··· 423 422 if (!data) 424 423 return; 425 424 426 - csa = at91_sys_read(AT91_MATRIX_EBICSA); 427 - at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_CS3A_SMC_SMARTMEDIA); 425 + csa = at91_matrix_read(AT91_MATRIX_EBICSA); 426 + at91_matrix_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_CS3A_SMC_SMARTMEDIA); 428 427 429 428 /* enable pin */ 430 429 if (gpio_is_valid(data->enable_pin)) ··· 642 641 static struct resource tcb0_resources[] = { 643 642 [0] = { 644 643 .start = AT91SAM9260_BASE_TCB0, 645 - .end = AT91SAM9260_BASE_TCB0 + SZ_16K - 1, 644 + .end = AT91SAM9260_BASE_TCB0 + SZ_256 - 1, 646 645 .flags = IORESOURCE_MEM, 647 646 }, 648 647 [1] = { ··· 672 671 static struct resource tcb1_resources[] = { 673 672 [0] = { 674 673 .start = AT91SAM9260_BASE_TCB1, 675 - .end = AT91SAM9260_BASE_TCB1 + SZ_16K - 1, 674 + .end = AT91SAM9260_BASE_TCB1 + SZ_256 - 1, 676 675 .flags = IORESOURCE_MEM, 677 676 }, 678 677 [1] = { ··· 699 698 .num_resources = ARRAY_SIZE(tcb1_resources), 700 699 }; 701 700 701 + #if defined(CONFIG_OF) 702 + static struct of_device_id tcb_ids[] = { 703 + { .compatible = "atmel,at91rm9200-tcb" }, 704 + { /*sentinel*/ } 705 + }; 706 + #endif 707 + 702 708 static void __init at91_add_device_tc(void) 703 709 { 710 + #if defined(CONFIG_OF) 711 + struct device_node *np; 712 + 713 + np = of_find_matching_node(NULL, tcb_ids); 714 + if (np) { 715 + of_node_put(np); 716 + return; 717 + } 718 + #endif 719 + 704 720 platform_device_register(&at91sam9260_tcb0_device); 705 721 platform_device_register(&at91sam9260_tcb1_device); 706 722 } ··· 735 717 .start = AT91SAM9260_BASE_RTT, 736 718 .end = AT91SAM9260_BASE_RTT + SZ_16 - 1, 737 719 .flags = IORESOURCE_MEM, 738 - } 720 + }, { 721 + .flags = IORESOURCE_MEM, 722 + }, 739 723 }; 740 724 741 725 static struct platform_device at91sam9260_rtt_device = { 742 726 .name = "at91_rtt", 743 727 .id = 0, 744 728 .resource = rtt_resources, 745 - .num_resources = ARRAY_SIZE(rtt_resources), 746 729 }; 730 + 731 + 732 + #if IS_ENABLED(CONFIG_RTC_DRV_AT91SAM9) 733 + static void __init at91_add_device_rtt_rtc(void) 734 + { 735 + at91sam9260_rtt_device.name = "rtc-at91sam9"; 736 + /* 737 + * The second resource is needed: 738 + * GPBR will serve as the storage for RTC time offset 739 + */ 740 + at91sam9260_rtt_device.num_resources = 2; 741 + rtt_resources[1].start = AT91SAM9260_BASE_GPBR + 742 + 4 * CONFIG_RTC_DRV_AT91SAM9_GPBR; 743 + rtt_resources[1].end = rtt_resources[1].start + 3; 744 + } 745 + #else 746 + static void __init at91_add_device_rtt_rtc(void) 747 + { 748 + /* Only one resource is needed: RTT not used as RTC */ 749 + at91sam9260_rtt_device.num_resources = 1; 750 + } 751 + #endif 747 752 748 753 static void __init at91_add_device_rtt(void) 749 754 { 755 + at91_add_device_rtt_rtc(); 750 756 platform_device_register(&at91sam9260_rtt_device); 751 757 } 752 758 ··· 1181 1139 } 1182 1140 1183 1141 static struct platform_device *__initdata at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */ 1184 - struct platform_device *atmel_default_console_device; /* the serial console device */ 1185 1142 1186 1143 void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) 1187 1144 { ··· 1305 1264 if (!data) 1306 1265 return; 1307 1266 1308 - csa = at91_sys_read(AT91_MATRIX_EBICSA); 1267 + csa = at91_matrix_read(AT91_MATRIX_EBICSA); 1309 1268 1310 1269 switch (data->chipselect) { 1311 1270 case 4: ··· 1328 1287 return; 1329 1288 } 1330 1289 1331 - at91_sys_write(AT91_MATRIX_EBICSA, csa); 1290 + at91_matrix_write(AT91_MATRIX_EBICSA, csa); 1332 1291 1333 1292 if (gpio_is_valid(data->rst_pin)) { 1334 1293 at91_set_multi_drive(data->rst_pin, 0);
+3 -7
arch/arm/mach-at91/at91sam9261.c
··· 283 283 { 284 284 at91_ioremap_shdwc(AT91SAM9261_BASE_SHDWC); 285 285 at91_ioremap_rstc(AT91SAM9261_BASE_RSTC); 286 + at91_ioremap_ramc(0, AT91SAM9261_BASE_SDRAMC, 512); 286 287 at91sam926x_ioremap_pit(AT91SAM9261_BASE_PIT); 287 288 at91sam9_ioremap_smc(0, AT91SAM9261_BASE_SMC); 288 - } 289 - 290 - static void at91sam9261_idle(void) 291 - { 292 - at91_sys_write(AT91_PMC_SCDR, AT91_PMC_PCK); 293 - cpu_do_idle(); 289 + at91_ioremap_matrix(AT91SAM9261_BASE_MATRIX); 294 290 } 295 291 296 292 static void __init at91sam9261_initialize(void) 297 293 { 298 - arm_pm_idle = at91sam9261_idle; 294 + arm_pm_idle = at91sam9_idle; 299 295 arm_pm_restart = at91sam9_alt_restart; 300 296 at91_extern_irq = (1 << AT91SAM9261_ID_IRQ0) | (1 << AT91SAM9261_ID_IRQ1) 301 297 | (1 << AT91SAM9261_ID_IRQ2);
+27 -4
arch/arm/mach-at91/at91sam9261_devices.c
··· 24 24 #include <mach/board.h> 25 25 #include <mach/at91sam9261.h> 26 26 #include <mach/at91sam9261_matrix.h> 27 + #include <mach/at91_matrix.h> 27 28 #include <mach/at91sam9_smc.h> 28 29 29 30 #include "generic.h" ··· 237 236 if (!data) 238 237 return; 239 238 240 - csa = at91_sys_read(AT91_MATRIX_EBICSA); 241 - at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_CS3A_SMC_SMARTMEDIA); 239 + csa = at91_matrix_read(AT91_MATRIX_EBICSA); 240 + at91_matrix_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_CS3A_SMC_SMARTMEDIA); 242 241 243 242 /* enable pin */ 244 243 if (gpio_is_valid(data->enable_pin)) ··· 604 603 .start = AT91SAM9261_BASE_RTT, 605 604 .end = AT91SAM9261_BASE_RTT + SZ_16 - 1, 606 605 .flags = IORESOURCE_MEM, 606 + }, { 607 + .flags = IORESOURCE_MEM, 607 608 } 608 609 }; 609 610 ··· 613 610 .name = "at91_rtt", 614 611 .id = 0, 615 612 .resource = rtt_resources, 616 - .num_resources = ARRAY_SIZE(rtt_resources), 617 613 }; 614 + 615 + #if IS_ENABLED(CONFIG_RTC_DRV_AT91SAM9) 616 + static void __init at91_add_device_rtt_rtc(void) 617 + { 618 + at91sam9261_rtt_device.name = "rtc-at91sam9"; 619 + /* 620 + * The second resource is needed: 621 + * GPBR will serve as the storage for RTC time offset 622 + */ 623 + at91sam9261_rtt_device.num_resources = 2; 624 + rtt_resources[1].start = AT91SAM9261_BASE_GPBR + 625 + 4 * CONFIG_RTC_DRV_AT91SAM9_GPBR; 626 + rtt_resources[1].end = rtt_resources[1].start + 3; 627 + } 628 + #else 629 + static void __init at91_add_device_rtt_rtc(void) 630 + { 631 + /* Only one resource is needed: RTT not used as RTC */ 632 + at91sam9261_rtt_device.num_resources = 1; 633 + } 634 + #endif 618 635 619 636 static void __init at91_add_device_rtt(void) 620 637 { 638 + at91_add_device_rtt_rtc(); 621 639 platform_device_register(&at91sam9261_rtt_device); 622 640 } 623 641 ··· 1015 991 } 1016 992 1017 993 static struct platform_device *__initdata at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */ 1018 - struct platform_device *atmel_default_console_device; /* the serial console device */ 1019 994 1020 995 void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) 1021 996 {
+4 -7
arch/arm/mach-at91/at91sam9263.c
··· 303 303 { 304 304 at91_ioremap_shdwc(AT91SAM9263_BASE_SHDWC); 305 305 at91_ioremap_rstc(AT91SAM9263_BASE_RSTC); 306 + at91_ioremap_ramc(0, AT91SAM9263_BASE_SDRAMC0, 512); 307 + at91_ioremap_ramc(1, AT91SAM9263_BASE_SDRAMC1, 512); 306 308 at91sam926x_ioremap_pit(AT91SAM9263_BASE_PIT); 307 309 at91sam9_ioremap_smc(0, AT91SAM9263_BASE_SMC0); 308 310 at91sam9_ioremap_smc(1, AT91SAM9263_BASE_SMC1); 309 - } 310 - 311 - static void at91sam9263_idle(void) 312 - { 313 - at91_sys_write(AT91_PMC_SCDR, AT91_PMC_PCK); 314 - cpu_do_idle(); 311 + at91_ioremap_matrix(AT91SAM9263_BASE_MATRIX); 315 312 } 316 313 317 314 static void __init at91sam9263_initialize(void) 318 315 { 319 - arm_pm_idle = at91sam9263_idle; 316 + arm_pm_idle = at91sam9_idle; 320 317 arm_pm_restart = at91sam9_alt_restart; 321 318 at91_extern_irq = (1 << AT91SAM9263_ID_IRQ0) | (1 << AT91SAM9263_ID_IRQ1); 322 319
+52 -7
arch/arm/mach-at91/at91sam9263_devices.c
··· 23 23 #include <mach/board.h> 24 24 #include <mach/at91sam9263.h> 25 25 #include <mach/at91sam9263_matrix.h> 26 + #include <mach/at91_matrix.h> 26 27 #include <mach/at91sam9_smc.h> 27 28 28 29 #include "generic.h" ··· 410 409 * we assume SMC timings are configured by board code, 411 410 * except True IDE where timings are controlled by driver 412 411 */ 413 - ebi0_csa = at91_sys_read(AT91_MATRIX_EBI0CSA); 412 + ebi0_csa = at91_matrix_read(AT91_MATRIX_EBI0CSA); 414 413 switch (data->chipselect) { 415 414 case 4: 416 415 at91_set_A_periph(AT91_PIN_PD6, 0); /* EBI0_NCS4/CFCS0 */ ··· 429 428 data->chipselect); 430 429 return; 431 430 } 432 - at91_sys_write(AT91_MATRIX_EBI0CSA, ebi0_csa); 431 + at91_matrix_write(AT91_MATRIX_EBI0CSA, ebi0_csa); 433 432 434 433 if (gpio_is_valid(data->det_pin)) { 435 434 at91_set_gpio_input(data->det_pin, 1); ··· 497 496 if (!data) 498 497 return; 499 498 500 - csa = at91_sys_read(AT91_MATRIX_EBI0CSA); 501 - at91_sys_write(AT91_MATRIX_EBI0CSA, csa | AT91_MATRIX_EBI0_CS3A_SMC_SMARTMEDIA); 499 + csa = at91_matrix_read(AT91_MATRIX_EBI0CSA); 500 + at91_matrix_write(AT91_MATRIX_EBI0CSA, csa | AT91_MATRIX_EBI0_CS3A_SMC_SMARTMEDIA); 502 501 503 502 /* enable pin */ 504 503 if (gpio_is_valid(data->enable_pin)) ··· 967 966 .start = AT91SAM9263_BASE_RTT0, 968 967 .end = AT91SAM9263_BASE_RTT0 + SZ_16 - 1, 969 968 .flags = IORESOURCE_MEM, 969 + }, { 970 + .flags = IORESOURCE_MEM, 970 971 } 971 972 }; 972 973 ··· 976 973 .name = "at91_rtt", 977 974 .id = 0, 978 975 .resource = rtt0_resources, 979 - .num_resources = ARRAY_SIZE(rtt0_resources), 980 976 }; 981 977 982 978 static struct resource rtt1_resources[] = { 983 979 { 984 980 .start = AT91SAM9263_BASE_RTT1, 985 981 .end = AT91SAM9263_BASE_RTT1 + SZ_16 - 1, 982 + .flags = IORESOURCE_MEM, 983 + }, { 986 984 .flags = IORESOURCE_MEM, 987 985 } 988 986 }; ··· 992 988 .name = "at91_rtt", 993 989 .id = 1, 994 990 .resource = rtt1_resources, 995 - .num_resources = ARRAY_SIZE(rtt1_resources), 996 991 }; 992 + 993 + #if IS_ENABLED(CONFIG_RTC_DRV_AT91SAM9) 994 + static void __init at91_add_device_rtt_rtc(void) 995 + { 996 + struct platform_device *pdev; 997 + struct resource *r; 998 + 999 + switch (CONFIG_RTC_DRV_AT91SAM9_RTT) { 1000 + case 0: 1001 + /* 1002 + * The second resource is needed only for the chosen RTT: 1003 + * GPBR will serve as the storage for RTC time offset 1004 + */ 1005 + at91sam9263_rtt0_device.num_resources = 2; 1006 + at91sam9263_rtt1_device.num_resources = 1; 1007 + pdev = &at91sam9263_rtt0_device; 1008 + r = rtt0_resources; 1009 + break; 1010 + case 1: 1011 + at91sam9263_rtt0_device.num_resources = 1; 1012 + at91sam9263_rtt1_device.num_resources = 2; 1013 + pdev = &at91sam9263_rtt1_device; 1014 + r = rtt1_resources; 1015 + break; 1016 + default: 1017 + pr_err("at91sam9263: only supports 2 RTT (%d)\n", 1018 + CONFIG_RTC_DRV_AT91SAM9_RTT); 1019 + return; 1020 + } 1021 + 1022 + pdev->name = "rtc-at91sam9"; 1023 + r[1].start = AT91SAM9263_BASE_GPBR + 4 * CONFIG_RTC_DRV_AT91SAM9_GPBR; 1024 + r[1].end = r[1].start + 3; 1025 + } 1026 + #else 1027 + static void __init at91_add_device_rtt_rtc(void) 1028 + { 1029 + /* Only one resource is needed: RTT not used as RTC */ 1030 + at91sam9263_rtt0_device.num_resources = 1; 1031 + at91sam9263_rtt1_device.num_resources = 1; 1032 + } 1033 + #endif 997 1034 998 1035 static void __init at91_add_device_rtt(void) 999 1036 { 1037 + at91_add_device_rtt_rtc(); 1000 1038 platform_device_register(&at91sam9263_rtt0_device); 1001 1039 platform_device_register(&at91sam9263_rtt1_device); 1002 1040 } ··· 1424 1378 } 1425 1379 1426 1380 static struct platform_device *__initdata at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */ 1427 - struct platform_device *atmel_default_console_device; /* the serial console device */ 1428 1381 1429 1382 void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) 1430 1383 {
+66 -2
arch/arm/mach-at91/at91sam926x_time.c
··· 14 14 #include <linux/kernel.h> 15 15 #include <linux/clk.h> 16 16 #include <linux/clockchips.h> 17 + #include <linux/of.h> 18 + #include <linux/of_address.h> 19 + #include <linux/of_irq.h> 17 20 18 21 #include <asm/mach/time.h> 19 22 ··· 136 133 static struct irqaction at91sam926x_pit_irq = { 137 134 .name = "at91_tick", 138 135 .flags = IRQF_SHARED | IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, 139 - .handler = at91sam926x_pit_interrupt 136 + .handler = at91sam926x_pit_interrupt, 137 + .irq = AT91_ID_SYS, 140 138 }; 141 139 142 140 static void at91sam926x_pit_reset(void) ··· 153 149 pit_write(AT91_PIT_MR, (pit_cycle - 1) | AT91_PIT_PITEN); 154 150 } 155 151 152 + #ifdef CONFIG_OF 153 + static struct of_device_id pit_timer_ids[] = { 154 + { .compatible = "atmel,at91sam9260-pit" }, 155 + { /* sentinel */ } 156 + }; 157 + 158 + static int __init of_at91sam926x_pit_init(void) 159 + { 160 + struct device_node *np; 161 + int ret; 162 + 163 + np = of_find_matching_node(NULL, pit_timer_ids); 164 + if (!np) 165 + goto err; 166 + 167 + pit_base_addr = of_iomap(np, 0); 168 + if (!pit_base_addr) 169 + goto node_err; 170 + 171 + /* Get the interrupts property */ 172 + ret = irq_of_parse_and_map(np, 0); 173 + if (!ret) { 174 + pr_crit("AT91: PIT: Unable to get IRQ from DT\n"); 175 + goto ioremap_err; 176 + } 177 + at91sam926x_pit_irq.irq = ret; 178 + 179 + of_node_put(np); 180 + 181 + return 0; 182 + 183 + ioremap_err: 184 + iounmap(pit_base_addr); 185 + node_err: 186 + of_node_put(np); 187 + err: 188 + return -EINVAL; 189 + } 190 + #else 191 + static int __init of_at91sam926x_pit_init(void) 192 + { 193 + return -EINVAL; 194 + } 195 + #endif 196 + 156 197 /* 157 198 * Set up both clocksource and clockevent support. 158 199 */ ··· 205 156 { 206 157 unsigned long pit_rate; 207 158 unsigned bits; 159 + int ret; 160 + 161 + /* For device tree enabled device: initialize here */ 162 + of_at91sam926x_pit_init(); 208 163 209 164 /* 210 165 * Use our actual MCK to figure out how many MCK/16 ticks per ··· 230 177 clocksource_register_hz(&pit_clk, pit_rate); 231 178 232 179 /* Set up irq handler */ 233 - setup_irq(AT91_ID_SYS, &at91sam926x_pit_irq); 180 + ret = setup_irq(at91sam926x_pit_irq.irq, &at91sam926x_pit_irq); 181 + if (ret) 182 + pr_crit("AT91: PIT: Unable to setup IRQ\n"); 234 183 235 184 /* Set up and register clockevents */ 236 185 pit_clkevt.mult = div_sc(pit_rate, NSEC_PER_SEC, pit_clkevt.shift); ··· 248 193 249 194 void __init at91sam926x_ioremap_pit(u32 addr) 250 195 { 196 + #if defined(CONFIG_OF) 197 + struct device_node *np = 198 + of_find_matching_node(NULL, pit_timer_ids); 199 + 200 + if (np) { 201 + of_node_put(np); 202 + return; 203 + } 204 + #endif 251 205 pit_base_addr = ioremap(addr, 16); 252 206 253 207 if (!pit_base_addr)
+5 -7
arch/arm/mach-at91/at91sam9_alt_reset.S
··· 15 15 16 16 #include <linux/linkage.h> 17 17 #include <mach/hardware.h> 18 - #include <mach/at91sam9_sdramc.h> 18 + #include <mach/at91_ramc.h> 19 19 #include <mach/at91_rstc.h> 20 20 21 21 .arm 22 22 23 23 .globl at91sam9_alt_restart 24 24 25 - at91sam9_alt_restart: ldr r0, .at91_va_base_sdramc @ preload constants 26 - ldr r1, =at91_rstc_base 27 - ldr r1, [r1] 25 + at91sam9_alt_restart: ldr r0, =at91_ramc_base @ preload constants 26 + ldr r0, [r0] 27 + ldr r4, =at91_rstc_base 28 + ldr r1, [r4] 28 29 29 30 mov r2, #1 30 31 mov r3, #AT91_SDRAMC_LPCB_POWER_DOWN ··· 38 37 str r4, [r1, #AT91_RSTC_CR] @ reset processor 39 38 40 39 b . 41 - 42 - .at91_va_base_sdramc: 43 - .word AT91_VA_BASE_SYS + AT91_SDRAMC0
+7 -7
arch/arm/mach-at91/at91sam9g45.c
··· 229 229 CLKDEV_CON_DEV_ID("usart", "fff90000.serial", &usart1_clk), 230 230 CLKDEV_CON_DEV_ID("usart", "fff94000.serial", &usart2_clk), 231 231 CLKDEV_CON_DEV_ID("usart", "fff98000.serial", &usart3_clk), 232 + /* more tc lookup table for DT entries */ 233 + CLKDEV_CON_DEV_ID("t0_clk", "fff7c000.timer", &tcb0_clk), 234 + CLKDEV_CON_DEV_ID("t0_clk", "fffd4000.timer", &tcb0_clk), 232 235 /* fake hclk clock */ 233 236 CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &uhphs_clk), 234 237 CLKDEV_CON_ID("pioA", &pioA_clk), ··· 320 317 } 321 318 }; 322 319 323 - static void at91sam9g45_idle(void) 324 - { 325 - at91_sys_write(AT91_PMC_SCDR, AT91_PMC_PCK); 326 - cpu_do_idle(); 327 - } 328 - 329 320 /* -------------------------------------------------------------------- 330 321 * AT91SAM9G45 processor initialization 331 322 * -------------------------------------------------------------------- */ ··· 334 337 { 335 338 at91_ioremap_shdwc(AT91SAM9G45_BASE_SHDWC); 336 339 at91_ioremap_rstc(AT91SAM9G45_BASE_RSTC); 340 + at91_ioremap_ramc(0, AT91SAM9G45_BASE_DDRSDRC1, 512); 341 + at91_ioremap_ramc(1, AT91SAM9G45_BASE_DDRSDRC0, 512); 337 342 at91sam926x_ioremap_pit(AT91SAM9G45_BASE_PIT); 338 343 at91sam9_ioremap_smc(0, AT91SAM9G45_BASE_SMC); 344 + at91_ioremap_matrix(AT91SAM9G45_BASE_MATRIX); 339 345 } 340 346 341 347 static void __init at91sam9g45_initialize(void) 342 348 { 343 - arm_pm_idle = at91sam9g45_idle; 349 + arm_pm_idle = at91sam9_idle; 344 350 arm_pm_restart = at91sam9g45_restart; 345 351 at91_extern_irq = (1 << AT91SAM9G45_ID_IRQ0); 346 352
+46 -6
arch/arm/mach-at91/at91sam9g45_devices.c
··· 25 25 #include <mach/board.h> 26 26 #include <mach/at91sam9g45.h> 27 27 #include <mach/at91sam9g45_matrix.h> 28 + #include <mach/at91_matrix.h> 28 29 #include <mach/at91sam9_smc.h> 29 30 #include <mach/at_hdmac.h> 30 31 #include <mach/atmel-mci.h> ··· 558 557 if (!data) 559 558 return; 560 559 561 - csa = at91_sys_read(AT91_MATRIX_EBICSA); 562 - at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_EBI_CS3A_SMC_SMARTMEDIA); 560 + csa = at91_matrix_read(AT91_MATRIX_EBICSA); 561 + at91_matrix_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_EBI_CS3A_SMC_SMARTMEDIA); 563 562 564 563 /* enable pin */ 565 564 if (gpio_is_valid(data->enable_pin)) ··· 1052 1051 static struct resource tcb0_resources[] = { 1053 1052 [0] = { 1054 1053 .start = AT91SAM9G45_BASE_TCB0, 1055 - .end = AT91SAM9G45_BASE_TCB0 + SZ_16K - 1, 1054 + .end = AT91SAM9G45_BASE_TCB0 + SZ_256 - 1, 1056 1055 .flags = IORESOURCE_MEM, 1057 1056 }, 1058 1057 [1] = { ··· 1073 1072 static struct resource tcb1_resources[] = { 1074 1073 [0] = { 1075 1074 .start = AT91SAM9G45_BASE_TCB1, 1076 - .end = AT91SAM9G45_BASE_TCB1 + SZ_16K - 1, 1075 + .end = AT91SAM9G45_BASE_TCB1 + SZ_256 - 1, 1077 1076 .flags = IORESOURCE_MEM, 1078 1077 }, 1079 1078 [1] = { ··· 1090 1089 .num_resources = ARRAY_SIZE(tcb1_resources), 1091 1090 }; 1092 1091 1092 + #if defined(CONFIG_OF) 1093 + static struct of_device_id tcb_ids[] = { 1094 + { .compatible = "atmel,at91rm9200-tcb" }, 1095 + { /*sentinel*/ } 1096 + }; 1097 + #endif 1098 + 1093 1099 static void __init at91_add_device_tc(void) 1094 1100 { 1101 + #if defined(CONFIG_OF) 1102 + struct device_node *np; 1103 + 1104 + np = of_find_matching_node(NULL, tcb_ids); 1105 + if (np) { 1106 + of_node_put(np); 1107 + return; 1108 + } 1109 + #endif 1110 + 1095 1111 platform_device_register(&at91sam9g45_tcb0_device); 1096 1112 platform_device_register(&at91sam9g45_tcb1_device); 1097 1113 } ··· 1211 1193 .start = AT91SAM9G45_BASE_RTT, 1212 1194 .end = AT91SAM9G45_BASE_RTT + SZ_16 - 1, 1213 1195 .flags = IORESOURCE_MEM, 1196 + }, { 1197 + .flags = IORESOURCE_MEM, 1214 1198 } 1215 1199 }; 1216 1200 ··· 1220 1200 .name = "at91_rtt", 1221 1201 .id = 0, 1222 1202 .resource = rtt_resources, 1223 - .num_resources = ARRAY_SIZE(rtt_resources), 1224 1203 }; 1204 + 1205 + #if IS_ENABLED(CONFIG_RTC_DRV_AT91SAM9) 1206 + static void __init at91_add_device_rtt_rtc(void) 1207 + { 1208 + at91sam9g45_rtt_device.name = "rtc-at91sam9"; 1209 + /* 1210 + * The second resource is needed: 1211 + * GPBR will serve as the storage for RTC time offset 1212 + */ 1213 + at91sam9g45_rtt_device.num_resources = 2; 1214 + rtt_resources[1].start = AT91SAM9G45_BASE_GPBR + 1215 + 4 * CONFIG_RTC_DRV_AT91SAM9_GPBR; 1216 + rtt_resources[1].end = rtt_resources[1].start + 3; 1217 + } 1218 + #else 1219 + static void __init at91_add_device_rtt_rtc(void) 1220 + { 1221 + /* Only one resource is needed: RTT not used as RTC */ 1222 + at91sam9g45_rtt_device.num_resources = 1; 1223 + } 1224 + #endif 1225 1225 1226 1226 static void __init at91_add_device_rtt(void) 1227 1227 { 1228 + at91_add_device_rtt_rtc(); 1228 1229 platform_device_register(&at91sam9g45_rtt_device); 1229 1230 } 1230 1231 ··· 1700 1659 } 1701 1660 1702 1661 static struct platform_device *__initdata at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */ 1703 - struct platform_device *atmel_default_console_device; /* the serial console device */ 1704 1662 1705 1663 void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) 1706 1664 {
+5 -7
arch/arm/mach-at91/at91sam9g45_reset.S
··· 12 12 13 13 #include <linux/linkage.h> 14 14 #include <mach/hardware.h> 15 - #include <mach/at91sam9_ddrsdr.h> 15 + #include <mach/at91_ramc.h> 16 16 #include <mach/at91_rstc.h> 17 17 18 18 .arm ··· 20 20 .globl at91sam9g45_restart 21 21 22 22 at91sam9g45_restart: 23 - ldr r0, .at91_va_base_sdramc0 @ preload constants 24 - ldr r1, =at91_rstc_base 25 - ldr r1, [r1] 23 + ldr r5, =at91_ramc_base @ preload constants 24 + ldr r0, [r5] 25 + ldr r4, =at91_rstc_base 26 + ldr r1, [r4] 26 27 27 28 mov r2, #1 28 29 mov r3, #AT91_DDRSDRC_LPCB_POWER_DOWN ··· 36 35 str r4, [r1, #AT91_RSTC_CR] @ reset processor 37 36 38 37 b . 39 - 40 - .at91_va_base_sdramc0: 41 - .word AT91_VA_BASE_SYS + AT91_DDRSDRC0
+3 -7
arch/arm/mach-at91/at91sam9rl.c
··· 288 288 { 289 289 at91_ioremap_shdwc(AT91SAM9RL_BASE_SHDWC); 290 290 at91_ioremap_rstc(AT91SAM9RL_BASE_RSTC); 291 + at91_ioremap_ramc(0, AT91SAM9RL_BASE_SDRAMC, 512); 291 292 at91sam926x_ioremap_pit(AT91SAM9RL_BASE_PIT); 292 293 at91sam9_ioremap_smc(0, AT91SAM9RL_BASE_SMC); 293 - } 294 - 295 - static void at91sam9rl_idle(void) 296 - { 297 - at91_sys_write(AT91_PMC_SCDR, AT91_PMC_PCK); 298 - cpu_do_idle(); 294 + at91_ioremap_matrix(AT91SAM9RL_BASE_MATRIX); 299 295 } 300 296 301 297 static void __init at91sam9rl_initialize(void) 302 298 { 303 - arm_pm_idle = at91sam9rl_idle; 299 + arm_pm_idle = at91sam9_idle; 304 300 arm_pm_restart = at91sam9_alt_restart; 305 301 at91_extern_irq = (1 << AT91SAM9RL_ID_IRQ0); 306 302
+27 -4
arch/arm/mach-at91/at91sam9rl_devices.c
··· 20 20 #include <mach/board.h> 21 21 #include <mach/at91sam9rl.h> 22 22 #include <mach/at91sam9rl_matrix.h> 23 + #include <mach/at91_matrix.h> 23 24 #include <mach/at91sam9_smc.h> 24 25 #include <mach/at_hdmac.h> 25 26 ··· 266 265 if (!data) 267 266 return; 268 267 269 - csa = at91_sys_read(AT91_MATRIX_EBICSA); 270 - at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_CS3A_SMC_SMARTMEDIA); 268 + csa = at91_matrix_read(AT91_MATRIX_EBICSA); 269 + at91_matrix_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_CS3A_SMC_SMARTMEDIA); 271 270 272 271 /* enable pin */ 273 272 if (gpio_is_valid(data->enable_pin)) ··· 683 682 .start = AT91SAM9RL_BASE_RTT, 684 683 .end = AT91SAM9RL_BASE_RTT + SZ_16 - 1, 685 684 .flags = IORESOURCE_MEM, 685 + }, { 686 + .flags = IORESOURCE_MEM, 686 687 } 687 688 }; 688 689 ··· 692 689 .name = "at91_rtt", 693 690 .id = 0, 694 691 .resource = rtt_resources, 695 - .num_resources = ARRAY_SIZE(rtt_resources), 696 692 }; 693 + 694 + #if IS_ENABLED(CONFIG_RTC_DRV_AT91SAM9) 695 + static void __init at91_add_device_rtt_rtc(void) 696 + { 697 + at91sam9rl_rtt_device.name = "rtc-at91sam9"; 698 + /* 699 + * The second resource is needed: 700 + * GPBR will serve as the storage for RTC time offset 701 + */ 702 + at91sam9rl_rtt_device.num_resources = 2; 703 + rtt_resources[1].start = AT91SAM9RL_BASE_GPBR + 704 + 4 * CONFIG_RTC_DRV_AT91SAM9_GPBR; 705 + rtt_resources[1].end = rtt_resources[1].start + 3; 706 + } 707 + #else 708 + static void __init at91_add_device_rtt_rtc(void) 709 + { 710 + /* Only one resource is needed: RTT not used as RTC */ 711 + at91sam9rl_rtt_device.num_resources = 1; 712 + } 713 + #endif 697 714 698 715 static void __init at91_add_device_rtt(void) 699 716 { 717 + at91_add_device_rtt_rtc(); 700 718 platform_device_register(&at91sam9rl_rtt_device); 701 719 } 702 720 ··· 1152 1128 } 1153 1129 1154 1130 static struct platform_device *__initdata at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */ 1155 - struct platform_device *atmel_default_console_device; /* the serial console device */ 1156 1131 1157 1132 void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) 1158 1133 {
+1 -6
arch/arm/mach-at91/at91sam9x5.c
··· 301 301 302 302 static void __init at91sam9x5_ioremap_registers(void) 303 303 { 304 - if (of_at91sam926x_pit_init() < 0) 305 - panic("Impossible to find PIT\n"); 304 + at91_ioremap_ramc(0, AT91SAM9X5_BASE_DDRSDRC0, 512); 306 305 } 307 306 308 307 void __init at91sam9x5_initialize(void) ··· 316 317 /* -------------------------------------------------------------------- 317 318 * AT91SAM9x5 devices (temporary before modification of code) 318 319 * -------------------------------------------------------------------- */ 319 - void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) {} 320 - void __init at91_set_serial_console(unsigned portnr) {} 321 - struct platform_device *atmel_default_console_device = NULL; 322 - 323 320 void __init at91_add_device_nand(struct atmel_nand_data *data) {} 324 321 325 322 /* --------------------------------------------------------------------
+1 -1
arch/arm/mach-at91/at91x40.c
··· 44 44 * Disable the processor clock. The processor will be automatically 45 45 * re-enabled by an interrupt or by a reset. 46 46 */ 47 - at91_sys_write(AT91_PS_CR, AT91_PS_CR_CPU); 47 + __raw_writel(AT91_PS_CR_CPU, AT91_PS_CR); 48 48 cpu_do_idle(); 49 49 } 50 50
+17 -11
arch/arm/mach-at91/at91x40_time.c
··· 28 28 #include <asm/mach/time.h> 29 29 #include <mach/at91_tc.h> 30 30 31 + #define at91_tc_read(field) \ 32 + __raw_readl(AT91_TC + field) 33 + 34 + #define at91_tc_write(field, value) \ 35 + __raw_writel(value, AT91_TC + field); 36 + 31 37 /* 32 38 * 3 counter/timer units present. 33 39 */ ··· 43 37 44 38 static unsigned long at91x40_gettimeoffset(void) 45 39 { 46 - return (at91_sys_read(AT91_TC + AT91_TC_CLK1BASE + AT91_TC_CV) * 1000000 / (AT91X40_MASTER_CLOCK / 128)); 40 + return (at91_tc_read(AT91_TC_CLK1BASE + AT91_TC_CV) * 1000000 / (AT91X40_MASTER_CLOCK / 128)); 47 41 } 48 42 49 43 static irqreturn_t at91x40_timer_interrupt(int irq, void *dev_id) 50 44 { 51 - at91_sys_read(AT91_TC + AT91_TC_CLK1BASE + AT91_TC_SR); 45 + at91_tc_read(AT91_TC_CLK1BASE + AT91_TC_SR); 52 46 timer_tick(); 53 47 return IRQ_HANDLED; 54 48 } ··· 63 57 { 64 58 unsigned int v; 65 59 66 - at91_sys_write(AT91_TC + AT91_TC_BCR, 0); 67 - v = at91_sys_read(AT91_TC + AT91_TC_BMR); 60 + at91_tc_write(AT91_TC_BCR, 0); 61 + v = at91_tc_read(AT91_TC_BMR); 68 62 v = (v & ~AT91_TC_TC1XC1S) | AT91_TC_TC1XC1S_NONE; 69 - at91_sys_write(AT91_TC + AT91_TC_BMR, v); 63 + at91_tc_write(AT91_TC_BMR, v); 70 64 71 - at91_sys_write(AT91_TC + AT91_TC_CLK1BASE + AT91_TC_CCR, AT91_TC_CLKDIS); 72 - at91_sys_write(AT91_TC + AT91_TC_CLK1BASE + AT91_TC_CMR, (AT91_TC_TIMER_CLOCK4 | AT91_TC_CPCTRG)); 73 - at91_sys_write(AT91_TC + AT91_TC_CLK1BASE + AT91_TC_IDR, 0xffffffff); 74 - at91_sys_write(AT91_TC + AT91_TC_CLK1BASE + AT91_TC_RC, (AT91X40_MASTER_CLOCK / 128) / HZ - 1); 75 - at91_sys_write(AT91_TC + AT91_TC_CLK1BASE + AT91_TC_IER, (1<<4)); 65 + at91_tc_write(AT91_TC_CLK1BASE + AT91_TC_CCR, AT91_TC_CLKDIS); 66 + at91_tc_write(AT91_TC_CLK1BASE + AT91_TC_CMR, (AT91_TC_TIMER_CLOCK4 | AT91_TC_CPCTRG)); 67 + at91_tc_write(AT91_TC_CLK1BASE + AT91_TC_IDR, 0xffffffff); 68 + at91_tc_write(AT91_TC_CLK1BASE + AT91_TC_RC, (AT91X40_MASTER_CLOCK / 128) / HZ - 1); 69 + at91_tc_write(AT91_TC_CLK1BASE + AT91_TC_IER, (1<<4)); 76 70 77 71 setup_irq(AT91X40_ID_TC1, &at91x40_timer_irq); 78 72 79 - at91_sys_write(AT91_TC + AT91_TC_CLK1BASE + AT91_TC_CCR, (AT91_TC_SWTRG | AT91_TC_CLKEN)); 73 + at91_tc_write(AT91_TC_CLK1BASE + AT91_TC_CCR, (AT91_TC_SWTRG | AT91_TC_CLKEN)); 80 74 } 81 75 82 76 struct sys_timer at91x40_timer = {
+3 -2
arch/arm/mach-at91/board-cpu9krea.c
··· 43 43 #include <mach/board.h> 44 44 #include <mach/at91sam9_smc.h> 45 45 #include <mach/at91sam9260_matrix.h> 46 + #include <mach/at91_matrix.h> 46 47 47 48 #include "sam9_smc.h" 48 49 #include "generic.h" ··· 239 238 { 240 239 unsigned long csa; 241 240 242 - csa = at91_sys_read(AT91_MATRIX_EBICSA); 243 - at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_VDDIOMSEL_3_3V); 241 + csa = at91_matrix_read(AT91_MATRIX_EBICSA); 242 + at91_matrix_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_VDDIOMSEL_3_3V); 244 243 245 244 /* configure chip-select 0 (NOR) */ 246 245 sam9_smc_configure(0, 0, &cpu9krea_nor_smc_config);
+1
arch/arm/mach-at91/board-cpuat91.c
··· 38 38 39 39 #include <mach/board.h> 40 40 #include <mach/at91rm9200_mc.h> 41 + #include <mach/at91_ramc.h> 41 42 #include <mach/cpu.h> 42 43 43 44 #include "generic.h"
+8 -12
arch/arm/mach-at91/board-dt.c
··· 15 15 #include <linux/init.h> 16 16 #include <linux/module.h> 17 17 #include <linux/gpio.h> 18 - #include <linux/irqdomain.h> 18 + #include <linux/of.h> 19 19 #include <linux/of_irq.h> 20 20 #include <linux/of_platform.h> 21 21 ··· 38 38 { 39 39 /* Initialize processor: 12.000 MHz crystal */ 40 40 at91_initialize(12000000); 41 - 42 - /* DGBU on ttyS0. (Rx & Tx only) */ 43 - at91_register_uart(0, 0, 0); 44 - 45 - /* set serial console to ttyS0 (ie, DBGU) */ 46 - at91_set_serial_console(0); 47 41 } 48 42 49 43 /* det_pin is not connected */ ··· 82 88 at91_add_device_nand(&ek_nand_data); 83 89 } 84 90 85 - static const struct of_device_id aic_of_match[] __initconst = { 86 - { .compatible = "atmel,at91rm9200-aic", }, 87 - {}, 91 + static const struct of_device_id irq_of_match[] __initconst = { 92 + 93 + { .compatible = "atmel,at91rm9200-aic", .data = at91_aic_of_init }, 94 + { .compatible = "atmel,at91rm9200-gpio", .data = at91_gpio_of_irq_setup }, 95 + { .compatible = "atmel,at91sam9x5-gpio", .data = at91_gpio_of_irq_setup }, 96 + { /*sentinel*/ } 88 97 }; 89 98 90 99 static void __init at91_dt_init_irq(void) 91 100 { 92 - irq_domain_generate_simple(aic_of_match, 0xfffff000, 0); 93 - at91_init_irq_default(); 101 + of_irq_init(irq_of_match); 94 102 } 95 103 96 104 static void __init at91_dt_device_init(void)
+3 -2
arch/arm/mach-at91/board-eco920.c
··· 26 26 27 27 #include <mach/board.h> 28 28 #include <mach/at91rm9200_mc.h> 29 + #include <mach/at91_ramc.h> 29 30 #include <mach/cpu.h> 30 31 31 32 #include "generic.h" ··· 111 110 at91_add_device_mmc(0, &eco920_mmc_data); 112 111 platform_device_register(&eco920_flash); 113 112 114 - at91_sys_write(AT91_SMC_CSR(7), AT91_SMC_RWHOLD_(1) 113 + at91_ramc_write(0, AT91_SMC_CSR(7), AT91_SMC_RWHOLD_(1) 115 114 | AT91_SMC_RWSETUP_(1) 116 115 | AT91_SMC_DBW_8 117 116 | AT91_SMC_WSEN ··· 123 122 at91_set_deglitch(AT91_PIN_PA23, 1); 124 123 125 124 /* Initialization of the Static Memory Controller for Chip Select 3 */ 126 - at91_sys_write(AT91_SMC_CSR(3), 125 + at91_ramc_write(0, AT91_SMC_CSR(3), 127 126 AT91_SMC_DBW_16 | /* 16 bit */ 128 127 AT91_SMC_WSEN | 129 128 AT91_SMC_NWS_(5) | /* wait states */
+1
arch/arm/mach-at91/board-kb9202.c
··· 38 38 #include <mach/board.h> 39 39 #include <mach/cpu.h> 40 40 #include <mach/at91rm9200_mc.h> 41 + #include <mach/at91_ramc.h> 41 42 42 43 #include "generic.h" 43 44
+1
arch/arm/mach-at91/board-picotux200.c
··· 39 39 40 40 #include <mach/board.h> 41 41 #include <mach/at91rm9200_mc.h> 42 + #include <mach/at91_ramc.h> 42 43 43 44 #include "generic.h" 44 45
+1
arch/arm/mach-at91/board-rm9200dk.c
··· 41 41 #include <mach/hardware.h> 42 42 #include <mach/board.h> 43 43 #include <mach/at91rm9200_mc.h> 44 + #include <mach/at91_ramc.h> 44 45 45 46 #include "generic.h" 46 47
+1
arch/arm/mach-at91/board-rm9200ek.c
··· 41 41 #include <mach/hardware.h> 42 42 #include <mach/board.h> 43 43 #include <mach/at91rm9200_mc.h> 44 + #include <mach/at91_ramc.h> 44 45 45 46 #include "generic.h" 46 47
+7 -3
arch/arm/mach-at91/board-snapper9260.c
··· 145 145 /* Audio codec */ 146 146 I2C_BOARD_INFO("tlv320aic23", 0x1a), 147 147 }, 148 - { 148 + }; 149 + 150 + static struct i2c_board_info __initdata snapper9260_i2c_isl1208 = { 149 151 /* RTC */ 150 152 I2C_BOARD_INFO("isl1208", 0x6f), 151 - .irq = gpio_to_irq(AT91_PIN_PA31), 152 - }, 153 153 }; 154 154 155 155 static void __init snapper9260_add_device_nand(void) ··· 163 163 { 164 164 at91_add_device_i2c(snapper9260_i2c_devices, 165 165 ARRAY_SIZE(snapper9260_i2c_devices)); 166 + 167 + snapper9260_i2c_isl1208.irq = gpio_to_irq(AT91_PIN_PA31); 168 + i2c_register_board_info(0, &snapper9260_i2c_isl1208, 1); 169 + 166 170 at91_add_device_serial(); 167 171 at91_add_device_usbh(&snapper9260_usbh_data); 168 172 at91_add_device_udc(&snapper9260_udc_data);
+2 -1
arch/arm/mach-at91/board-yl-9200.c
··· 45 45 #include <mach/hardware.h> 46 46 #include <mach/board.h> 47 47 #include <mach/at91rm9200_mc.h> 48 + #include <mach/at91_ramc.h> 48 49 #include <mach/cpu.h> 49 50 50 51 #include "generic.h" ··· 394 393 at91_set_A_periph(AT91_PIN_PC6, 0); 395 394 396 395 /* Initialization of the Static Memory Controller for Chip Select 2 */ 397 - at91_sys_write(AT91_SMC_CSR(2), AT91_SMC_DBW_16 /* 16 bit */ 396 + at91_ramc_write(0, AT91_SMC_CSR(2), AT91_SMC_DBW_16 /* 16 bit */ 398 397 | AT91_SMC_WSEN | AT91_SMC_NWS_(0x4) /* wait states */ 399 398 | AT91_SMC_TDF_(0x100) /* float time */ 400 399 );
+53 -35
arch/arm/mach-at91/clock.c
··· 28 28 #include <mach/at91_pmc.h> 29 29 #include <mach/cpu.h> 30 30 31 + #include <asm/proc-fns.h> 32 + 31 33 #include "clock.h" 32 34 #include "generic.h" 33 35 36 + void __iomem *at91_pmc_base; 34 37 35 38 /* 36 39 * There's a lot more which can be done with clocks, including cpufreq ··· 126 123 value = 0; 127 124 128 125 // REVISIT: Add work-around for AT91RM9200 Errata #26 ? 129 - at91_sys_write(AT91_CKGR_PLLBR, value); 126 + at91_pmc_write(AT91_CKGR_PLLBR, value); 130 127 131 128 do { 132 129 cpu_relax(); 133 - } while ((at91_sys_read(AT91_PMC_SR) & AT91_PMC_LOCKB) != is_on); 130 + } while ((at91_pmc_read(AT91_PMC_SR) & AT91_PMC_LOCKB) != is_on); 134 131 } 135 132 136 133 static struct clk pllb = { ··· 145 142 static void pmc_sys_mode(struct clk *clk, int is_on) 146 143 { 147 144 if (is_on) 148 - at91_sys_write(AT91_PMC_SCER, clk->pmc_mask); 145 + at91_pmc_write(AT91_PMC_SCER, clk->pmc_mask); 149 146 else 150 - at91_sys_write(AT91_PMC_SCDR, clk->pmc_mask); 147 + at91_pmc_write(AT91_PMC_SCDR, clk->pmc_mask); 151 148 } 152 149 153 150 static void pmc_uckr_mode(struct clk *clk, int is_on) 154 151 { 155 - unsigned int uckr = at91_sys_read(AT91_CKGR_UCKR); 152 + unsigned int uckr = at91_pmc_read(AT91_CKGR_UCKR); 156 153 157 154 if (is_on) { 158 155 is_on = AT91_PMC_LOCKU; 159 - at91_sys_write(AT91_CKGR_UCKR, uckr | clk->pmc_mask); 156 + at91_pmc_write(AT91_CKGR_UCKR, uckr | clk->pmc_mask); 160 157 } else 161 - at91_sys_write(AT91_CKGR_UCKR, uckr & ~(clk->pmc_mask)); 158 + at91_pmc_write(AT91_CKGR_UCKR, uckr & ~(clk->pmc_mask)); 162 159 163 160 do { 164 161 cpu_relax(); 165 - } while ((at91_sys_read(AT91_PMC_SR) & AT91_PMC_LOCKU) != is_on); 162 + } while ((at91_pmc_read(AT91_PMC_SR) & AT91_PMC_LOCKU) != is_on); 166 163 } 167 164 168 165 /* USB function clocks (PLLB must be 48 MHz) */ ··· 198 195 static void pmc_periph_mode(struct clk *clk, int is_on) 199 196 { 200 197 if (is_on) 201 - at91_sys_write(AT91_PMC_PCER, clk->pmc_mask); 198 + at91_pmc_write(AT91_PMC_PCER, clk->pmc_mask); 202 199 else 203 - at91_sys_write(AT91_PMC_PCDR, clk->pmc_mask); 200 + at91_pmc_write(AT91_PMC_PCDR, clk->pmc_mask); 204 201 } 205 202 206 203 static struct clk __init *at91_css_to_clk(unsigned long css) ··· 360 357 if (actual && actual <= rate) { 361 358 u32 pckr; 362 359 363 - pckr = at91_sys_read(AT91_PMC_PCKR(clk->id)); 360 + pckr = at91_pmc_read(AT91_PMC_PCKR(clk->id)); 364 361 pckr &= css_mask; /* keep clock selection */ 365 362 pckr |= prescale << prescale_offset; 366 - at91_sys_write(AT91_PMC_PCKR(clk->id), pckr); 363 + at91_pmc_write(AT91_PMC_PCKR(clk->id), pckr); 367 364 clk->rate_hz = actual; 368 365 break; 369 366 } ··· 397 394 398 395 clk->rate_hz = parent->rate_hz; 399 396 clk->parent = parent; 400 - at91_sys_write(AT91_PMC_PCKR(clk->id), parent->id); 397 + at91_pmc_write(AT91_PMC_PCKR(clk->id), parent->id); 401 398 402 399 spin_unlock_irqrestore(&clk_lock, flags); 403 400 return 0; ··· 416 413 else 417 414 css_mask = AT91_PMC_CSS; 418 415 419 - pckr = at91_sys_read(AT91_PMC_PCKR(clk->id)); 416 + pckr = at91_pmc_read(AT91_PMC_PCKR(clk->id)); 420 417 parent = at91_css_to_clk(pckr & css_mask); 421 418 clk->parent = parent; 422 419 clk->rate_hz = parent->rate_hz / pmc_prescaler_divider(pckr); ··· 433 430 u32 scsr, pcsr, uckr = 0, sr; 434 431 struct clk *clk; 435 432 436 - seq_printf(s, "SCSR = %8x\n", scsr = at91_sys_read(AT91_PMC_SCSR)); 437 - seq_printf(s, "PCSR = %8x\n", pcsr = at91_sys_read(AT91_PMC_PCSR)); 438 - seq_printf(s, "MOR = %8x\n", at91_sys_read(AT91_CKGR_MOR)); 439 - seq_printf(s, "MCFR = %8x\n", at91_sys_read(AT91_CKGR_MCFR)); 440 - seq_printf(s, "PLLA = %8x\n", at91_sys_read(AT91_CKGR_PLLAR)); 433 + scsr = at91_pmc_read(AT91_PMC_SCSR); 434 + pcsr = at91_pmc_read(AT91_PMC_PCSR); 435 + sr = at91_pmc_read(AT91_PMC_SR); 436 + seq_printf(s, "SCSR = %8x\n", scsr); 437 + seq_printf(s, "PCSR = %8x\n", pcsr); 438 + seq_printf(s, "MOR = %8x\n", at91_pmc_read(AT91_CKGR_MOR)); 439 + seq_printf(s, "MCFR = %8x\n", at91_pmc_read(AT91_CKGR_MCFR)); 440 + seq_printf(s, "PLLA = %8x\n", at91_pmc_read(AT91_CKGR_PLLAR)); 441 441 if (cpu_has_pllb()) 442 - seq_printf(s, "PLLB = %8x\n", at91_sys_read(AT91_CKGR_PLLBR)); 443 - if (cpu_has_utmi()) 444 - seq_printf(s, "UCKR = %8x\n", uckr = at91_sys_read(AT91_CKGR_UCKR)); 445 - seq_printf(s, "MCKR = %8x\n", at91_sys_read(AT91_PMC_MCKR)); 442 + seq_printf(s, "PLLB = %8x\n", at91_pmc_read(AT91_CKGR_PLLBR)); 443 + if (cpu_has_utmi()) { 444 + uckr = at91_pmc_read(AT91_CKGR_UCKR); 445 + seq_printf(s, "UCKR = %8x\n", uckr); 446 + } 447 + seq_printf(s, "MCKR = %8x\n", at91_pmc_read(AT91_PMC_MCKR)); 446 448 if (cpu_has_upll()) 447 - seq_printf(s, "USB = %8x\n", at91_sys_read(AT91_PMC_USB)); 448 - seq_printf(s, "SR = %8x\n", sr = at91_sys_read(AT91_PMC_SR)); 449 + seq_printf(s, "USB = %8x\n", at91_pmc_read(AT91_PMC_USB)); 450 + seq_printf(s, "SR = %8x\n", sr); 449 451 450 452 seq_printf(s, "\n"); 451 453 ··· 638 630 if (cpu_is_at91rm9200()) { 639 631 uhpck.pmc_mask = AT91RM9200_PMC_UHP; 640 632 udpck.pmc_mask = AT91RM9200_PMC_UDP; 641 - at91_sys_write(AT91_PMC_SCER, AT91RM9200_PMC_MCKUDP); 633 + at91_pmc_write(AT91_PMC_SCER, AT91RM9200_PMC_MCKUDP); 642 634 } else if (cpu_is_at91sam9260() || cpu_is_at91sam9261() || 643 635 cpu_is_at91sam9263() || cpu_is_at91sam9g20() || 644 636 cpu_is_at91sam9g10()) { 645 637 uhpck.pmc_mask = AT91SAM926x_PMC_UHP; 646 638 udpck.pmc_mask = AT91SAM926x_PMC_UDP; 647 639 } 648 - at91_sys_write(AT91_CKGR_PLLBR, 0); 640 + at91_pmc_write(AT91_CKGR_PLLBR, 0); 649 641 650 642 udpck.rate_hz = at91_usb_rate(&pllb, pllb.rate_hz, at91_pllb_usb_init); 651 643 uhpck.rate_hz = at91_usb_rate(&pllb, pllb.rate_hz, at91_pllb_usb_init); ··· 662 654 /* Setup divider by 10 to reach 48 MHz */ 663 655 usbr |= ((10 - 1) << 8) & AT91_PMC_OHCIUSBDIV; 664 656 665 - at91_sys_write(AT91_PMC_USB, usbr); 657 + at91_pmc_write(AT91_PMC_USB, usbr); 666 658 667 659 /* Now set uhpck values */ 668 660 uhpck.parent = &utmi_clk; 669 661 uhpck.pmc_mask = AT91SAM926x_PMC_UHP; 670 662 uhpck.rate_hz = utmi_clk.rate_hz; 671 - uhpck.rate_hz /= 1 + ((at91_sys_read(AT91_PMC_USB) & AT91_PMC_OHCIUSBDIV) >> 8); 663 + uhpck.rate_hz /= 1 + ((at91_pmc_read(AT91_PMC_USB) & AT91_PMC_OHCIUSBDIV) >> 8); 672 664 } 673 665 674 666 int __init at91_clock_init(unsigned long main_clock) ··· 676 668 unsigned tmp, freq, mckr; 677 669 int i; 678 670 int pll_overclock = false; 671 + 672 + at91_pmc_base = ioremap(AT91_PMC, 256); 673 + if (!at91_pmc_base) 674 + panic("Impossible to ioremap AT91_PMC 0x%x\n", AT91_PMC); 679 675 680 676 /* 681 677 * When the bootloader initialized the main oscillator correctly, ··· 689 677 */ 690 678 if (!main_clock) { 691 679 do { 692 - tmp = at91_sys_read(AT91_CKGR_MCFR); 680 + tmp = at91_pmc_read(AT91_CKGR_MCFR); 693 681 } while (!(tmp & AT91_PMC_MAINRDY)); 694 682 main_clock = (tmp & AT91_PMC_MAINF) * (AT91_SLOW_CLOCK / 16); 695 683 } 696 684 main_clk.rate_hz = main_clock; 697 685 698 686 /* report if PLLA is more than mildly overclocked */ 699 - plla.rate_hz = at91_pll_rate(&plla, main_clock, at91_sys_read(AT91_CKGR_PLLAR)); 687 + plla.rate_hz = at91_pll_rate(&plla, main_clock, at91_pmc_read(AT91_CKGR_PLLAR)); 700 688 if (cpu_has_300M_plla()) { 701 689 if (plla.rate_hz > 300000000) 702 690 pll_overclock = true; ··· 711 699 pr_info("Clocks: PLLA overclocked, %ld MHz\n", plla.rate_hz / 1000000); 712 700 713 701 if (cpu_has_plladiv2()) { 714 - mckr = at91_sys_read(AT91_PMC_MCKR); 702 + mckr = at91_pmc_read(AT91_PMC_MCKR); 715 703 plla.rate_hz /= (1 << ((mckr & AT91_PMC_PLLADIV2) >> 12)); /* plla divisor by 2 */ 716 704 } 717 705 ··· 751 739 * MCK and CPU derive from one of those primary clocks. 752 740 * For now, assume this parentage won't change. 753 741 */ 754 - mckr = at91_sys_read(AT91_PMC_MCKR); 742 + mckr = at91_pmc_read(AT91_PMC_MCKR); 755 743 mck.parent = at91_css_to_clk(mckr & AT91_PMC_CSS); 756 744 freq = mck.parent->rate_hz; 757 745 freq /= pmc_prescaler_divider(mckr); /* prescale */ ··· 824 812 pr_debug("Clocks: disable unused %s\n", clk->name); 825 813 } 826 814 827 - at91_sys_write(AT91_PMC_PCDR, pcdr); 828 - at91_sys_write(AT91_PMC_SCDR, scdr); 815 + at91_pmc_write(AT91_PMC_PCDR, pcdr); 816 + at91_pmc_write(AT91_PMC_SCDR, scdr); 829 817 830 818 return 0; 831 819 } 832 820 late_initcall(at91_clock_reset); 821 + 822 + void at91sam9_idle(void) 823 + { 824 + at91_pmc_write(AT91_PMC_SCDR, AT91_PMC_PCK); 825 + cpu_do_idle(); 826 + }
+16
arch/arm/mach-at91/generic.h
··· 9 9 */ 10 10 11 11 #include <linux/clkdev.h> 12 + #include <linux/of.h> 12 13 13 14 /* Map io */ 14 15 extern void __init at91_map_io(void); ··· 26 25 extern void __init at91_init_interrupts(unsigned int priority[]); 27 26 extern void __init at91x40_init_interrupts(unsigned int priority[]); 28 27 extern void __init at91_aic_init(unsigned int priority[]); 28 + extern int __init at91_aic_of_init(struct device_node *node, 29 + struct device_node *parent); 30 + 29 31 30 32 /* Timer */ 31 33 struct sys_timer; 34 + extern void at91rm9200_ioremap_st(u32 addr); 32 35 extern struct sys_timer at91rm9200_timer; 33 36 extern void at91sam926x_ioremap_pit(u32 addr); 34 37 extern struct sys_timer at91sam926x_timer; ··· 61 56 extern void at91_irq_suspend(void); 62 57 extern void at91_irq_resume(void); 63 58 59 + /* idle */ 60 + extern void at91sam9_idle(void); 61 + 64 62 /* reset */ 65 63 extern void at91_ioremap_rstc(u32 base_addr); 66 64 extern void at91sam9_alt_restart(char, const char *); ··· 71 63 72 64 /* shutdown */ 73 65 extern void at91_ioremap_shdwc(u32 base_addr); 66 + 67 + /* Matrix */ 68 + extern void at91_ioremap_matrix(u32 base_addr); 69 + 70 + /* Ram Controler */ 71 + extern void at91_ioremap_ramc(int id, u32 addr, u32 size); 74 72 75 73 /* GPIO */ 76 74 #define AT91RM9200_PQFP 3 /* AT91RM9200 PQFP package has 3 banks */ ··· 88 74 }; 89 75 extern void __init at91_gpio_init(struct at91_gpio_bank *, int nr_banks); 90 76 extern void __init at91_gpio_irq_setup(void); 77 + extern int __init at91_gpio_of_irq_setup(struct device_node *node, 78 + struct device_node *parent); 91 79 92 80 extern int at91_extern_irq;
+541 -84
arch/arm/mach-at91/gpio.c
··· 11 11 12 12 #include <linux/clk.h> 13 13 #include <linux/errno.h> 14 + #include <linux/device.h> 14 15 #include <linux/gpio.h> 15 16 #include <linux/interrupt.h> 16 17 #include <linux/irq.h> ··· 21 20 #include <linux/list.h> 22 21 #include <linux/module.h> 23 22 #include <linux/io.h> 23 + #include <linux/irqdomain.h> 24 + #include <linux/of_address.h> 25 + #include <linux/of_irq.h> 26 + #include <linux/of_gpio.h> 24 27 25 28 #include <mach/hardware.h> 26 29 #include <mach/at91_pio.h> ··· 34 29 struct at91_gpio_chip { 35 30 struct gpio_chip chip; 36 31 struct at91_gpio_chip *next; /* Bank sharing same clock */ 37 - int id; /* ID of register bank */ 38 - void __iomem *regbase; /* Base of register bank */ 32 + int pioc_hwirq; /* PIO bank interrupt identifier on AIC */ 33 + int pioc_virq; /* PIO bank Linux virtual interrupt */ 34 + int pioc_idx; /* PIO bank index */ 35 + void __iomem *regbase; /* PIO bank virtual address */ 39 36 struct clk *clock; /* associated clock */ 37 + struct irq_domain *domain; /* associated irq domain */ 40 38 }; 41 39 42 40 #define to_at91_gpio_chip(c) container_of(c, struct at91_gpio_chip, chip) ··· 51 43 unsigned offset, int val); 52 44 static int at91_gpiolib_direction_input(struct gpio_chip *chip, 53 45 unsigned offset); 46 + static int at91_gpiolib_to_irq(struct gpio_chip *chip, unsigned offset); 54 47 55 - #define AT91_GPIO_CHIP(name, base_gpio, nr_gpio) \ 48 + #define AT91_GPIO_CHIP(name, nr_gpio) \ 56 49 { \ 57 50 .chip = { \ 58 51 .label = name, \ ··· 62 53 .get = at91_gpiolib_get, \ 63 54 .set = at91_gpiolib_set, \ 64 55 .dbg_show = at91_gpiolib_dbg_show, \ 65 - .base = base_gpio, \ 56 + .to_irq = at91_gpiolib_to_irq, \ 66 57 .ngpio = nr_gpio, \ 67 58 }, \ 68 59 } 69 60 70 61 static struct at91_gpio_chip gpio_chip[] = { 71 - AT91_GPIO_CHIP("pioA", 0x00, 32), 72 - AT91_GPIO_CHIP("pioB", 0x20, 32), 73 - AT91_GPIO_CHIP("pioC", 0x40, 32), 74 - AT91_GPIO_CHIP("pioD", 0x60, 32), 75 - AT91_GPIO_CHIP("pioE", 0x80, 32), 62 + AT91_GPIO_CHIP("pioA", 32), 63 + AT91_GPIO_CHIP("pioB", 32), 64 + AT91_GPIO_CHIP("pioC", 32), 65 + AT91_GPIO_CHIP("pioD", 32), 66 + AT91_GPIO_CHIP("pioE", 32), 76 67 }; 77 68 78 69 static int gpio_banks; 70 + static unsigned long at91_gpio_caps; 71 + 72 + /* All PIO controllers support PIO3 features */ 73 + #define AT91_GPIO_CAP_PIO3 (1 << 0) 74 + 75 + #define has_pio3() (at91_gpio_caps & AT91_GPIO_CAP_PIO3) 76 + 77 + /*--------------------------------------------------------------------------*/ 79 78 80 79 static inline void __iomem *pin_to_controller(unsigned pin) 81 80 { ··· 99 82 return 1 << (pin % 32); 100 83 } 101 84 85 + 86 + static char peripheral_function(void __iomem *pio, unsigned mask) 87 + { 88 + char ret = 'X'; 89 + u8 select; 90 + 91 + if (pio) { 92 + if (has_pio3()) { 93 + select = !!(__raw_readl(pio + PIO_ABCDSR1) & mask); 94 + select |= (!!(__raw_readl(pio + PIO_ABCDSR2) & mask) << 1); 95 + ret = 'A' + select; 96 + } else { 97 + ret = __raw_readl(pio + PIO_ABSR) & mask ? 98 + 'B' : 'A'; 99 + } 100 + } 101 + 102 + return ret; 103 + } 102 104 103 105 /*--------------------------------------------------------------------------*/ 104 106 ··· 166 130 167 131 __raw_writel(mask, pio + PIO_IDR); 168 132 __raw_writel(mask, pio + (use_pullup ? PIO_PUER : PIO_PUDR)); 169 - __raw_writel(mask, pio + PIO_ASR); 133 + if (has_pio3()) { 134 + __raw_writel(__raw_readl(pio + PIO_ABCDSR1) & ~mask, 135 + pio + PIO_ABCDSR1); 136 + __raw_writel(__raw_readl(pio + PIO_ABCDSR2) & ~mask, 137 + pio + PIO_ABCDSR2); 138 + } else { 139 + __raw_writel(mask, pio + PIO_ASR); 140 + } 170 141 __raw_writel(mask, pio + PIO_PDR); 171 142 return 0; 172 143 } ··· 193 150 194 151 __raw_writel(mask, pio + PIO_IDR); 195 152 __raw_writel(mask, pio + (use_pullup ? PIO_PUER : PIO_PUDR)); 196 - __raw_writel(mask, pio + PIO_BSR); 153 + if (has_pio3()) { 154 + __raw_writel(__raw_readl(pio + PIO_ABCDSR1) | mask, 155 + pio + PIO_ABCDSR1); 156 + __raw_writel(__raw_readl(pio + PIO_ABCDSR2) & ~mask, 157 + pio + PIO_ABCDSR2); 158 + } else { 159 + __raw_writel(mask, pio + PIO_BSR); 160 + } 197 161 __raw_writel(mask, pio + PIO_PDR); 198 162 return 0; 199 163 } ··· 208 158 209 159 210 160 /* 211 - * mux the pin to the gpio controller (instead of "A" or "B" peripheral), and 212 - * configure it for an input. 161 + * mux the pin to the "C" internal peripheral role. 162 + */ 163 + int __init_or_module at91_set_C_periph(unsigned pin, int use_pullup) 164 + { 165 + void __iomem *pio = pin_to_controller(pin); 166 + unsigned mask = pin_to_mask(pin); 167 + 168 + if (!pio || !has_pio3()) 169 + return -EINVAL; 170 + 171 + __raw_writel(mask, pio + PIO_IDR); 172 + __raw_writel(mask, pio + (use_pullup ? PIO_PUER : PIO_PUDR)); 173 + __raw_writel(__raw_readl(pio + PIO_ABCDSR1) & ~mask, pio + PIO_ABCDSR1); 174 + __raw_writel(__raw_readl(pio + PIO_ABCDSR2) | mask, pio + PIO_ABCDSR2); 175 + __raw_writel(mask, pio + PIO_PDR); 176 + return 0; 177 + } 178 + EXPORT_SYMBOL(at91_set_C_periph); 179 + 180 + 181 + /* 182 + * mux the pin to the "D" internal peripheral role. 183 + */ 184 + int __init_or_module at91_set_D_periph(unsigned pin, int use_pullup) 185 + { 186 + void __iomem *pio = pin_to_controller(pin); 187 + unsigned mask = pin_to_mask(pin); 188 + 189 + if (!pio || !has_pio3()) 190 + return -EINVAL; 191 + 192 + __raw_writel(mask, pio + PIO_IDR); 193 + __raw_writel(mask, pio + (use_pullup ? PIO_PUER : PIO_PUDR)); 194 + __raw_writel(__raw_readl(pio + PIO_ABCDSR1) | mask, pio + PIO_ABCDSR1); 195 + __raw_writel(__raw_readl(pio + PIO_ABCDSR2) | mask, pio + PIO_ABCDSR2); 196 + __raw_writel(mask, pio + PIO_PDR); 197 + return 0; 198 + } 199 + EXPORT_SYMBOL(at91_set_D_periph); 200 + 201 + 202 + /* 203 + * mux the pin to the gpio controller (instead of "A", "B", "C" 204 + * or "D" peripheral), and configure it for an input. 213 205 */ 214 206 int __init_or_module at91_set_gpio_input(unsigned pin, int use_pullup) 215 207 { ··· 271 179 272 180 273 181 /* 274 - * mux the pin to the gpio controller (instead of "A" or "B" peripheral), 275 - * and configure it for an output. 182 + * mux the pin to the gpio controller (instead of "A", "B", "C" 183 + * or "D" peripheral), and configure it for an output. 276 184 */ 277 185 int __init_or_module at91_set_gpio_output(unsigned pin, int value) 278 186 { ··· 302 210 303 211 if (!pio) 304 212 return -EINVAL; 213 + 214 + if (has_pio3() && is_on) 215 + __raw_writel(mask, pio + PIO_IFSCDR); 305 216 __raw_writel(mask, pio + (is_on ? PIO_IFER : PIO_IFDR)); 306 217 return 0; 307 218 } 308 219 EXPORT_SYMBOL(at91_set_deglitch); 220 + 221 + /* 222 + * enable/disable the debounce filter; 223 + */ 224 + int __init_or_module at91_set_debounce(unsigned pin, int is_on, int div) 225 + { 226 + void __iomem *pio = pin_to_controller(pin); 227 + unsigned mask = pin_to_mask(pin); 228 + 229 + if (!pio || !has_pio3()) 230 + return -EINVAL; 231 + 232 + if (is_on) { 233 + __raw_writel(mask, pio + PIO_IFSCER); 234 + __raw_writel(div & PIO_SCDR_DIV, pio + PIO_SCDR); 235 + __raw_writel(mask, pio + PIO_IFER); 236 + } else { 237 + __raw_writel(mask, pio + PIO_IFDR); 238 + } 239 + return 0; 240 + } 241 + EXPORT_SYMBOL(at91_set_debounce); 309 242 310 243 /* 311 244 * enable/disable the multi-driver; This is only valid for output and ··· 348 231 return 0; 349 232 } 350 233 EXPORT_SYMBOL(at91_set_multi_drive); 234 + 235 + /* 236 + * enable/disable the pull-down. 237 + * If pull-up already enabled while calling the function, we disable it. 238 + */ 239 + int __init_or_module at91_set_pulldown(unsigned pin, int is_on) 240 + { 241 + void __iomem *pio = pin_to_controller(pin); 242 + unsigned mask = pin_to_mask(pin); 243 + 244 + if (!pio || !has_pio3()) 245 + return -EINVAL; 246 + 247 + /* Disable pull-up anyway */ 248 + __raw_writel(mask, pio + PIO_PUDR); 249 + __raw_writel(mask, pio + (is_on ? PIO_PPDER : PIO_PPDDR)); 250 + return 0; 251 + } 252 + EXPORT_SYMBOL(at91_set_pulldown); 253 + 254 + /* 255 + * disable Schmitt trigger 256 + */ 257 + int __init_or_module at91_disable_schmitt_trig(unsigned pin) 258 + { 259 + void __iomem *pio = pin_to_controller(pin); 260 + unsigned mask = pin_to_mask(pin); 261 + 262 + if (!pio || !has_pio3()) 263 + return -EINVAL; 264 + 265 + __raw_writel(__raw_readl(pio + PIO_SCHMITT) | mask, pio + PIO_SCHMITT); 266 + return 0; 267 + } 268 + EXPORT_SYMBOL(at91_disable_schmitt_trig); 351 269 352 270 /* 353 271 * assuming the pin is muxed as a gpio output, set its value. ··· 425 273 426 274 static int gpio_irq_set_wake(struct irq_data *d, unsigned state) 427 275 { 428 - unsigned pin = irq_to_gpio(d->irq); 429 - unsigned mask = pin_to_mask(pin); 430 - unsigned bank = pin / 32; 276 + struct at91_gpio_chip *at91_gpio = irq_data_get_irq_chip_data(d); 277 + unsigned mask = 1 << d->hwirq; 278 + unsigned bank = at91_gpio->pioc_idx; 431 279 432 280 if (unlikely(bank >= MAX_GPIO_BANKS)) 433 281 return -EINVAL; ··· 437 285 else 438 286 wakeups[bank] &= ~mask; 439 287 440 - irq_set_irq_wake(gpio_chip[bank].id, state); 288 + irq_set_irq_wake(at91_gpio->pioc_virq, state); 441 289 442 290 return 0; 443 291 } ··· 453 301 __raw_writel(backups[i], pio + PIO_IDR); 454 302 __raw_writel(wakeups[i], pio + PIO_IER); 455 303 456 - if (!wakeups[i]) 304 + if (!wakeups[i]) { 305 + clk_unprepare(gpio_chip[i].clock); 457 306 clk_disable(gpio_chip[i].clock); 458 - else { 307 + } else { 459 308 #ifdef CONFIG_PM_DEBUG 460 309 printk(KERN_DEBUG "GPIO-%c may wake for %08x\n", 'A'+i, wakeups[i]); 461 310 #endif ··· 471 318 for (i = 0; i < gpio_banks; i++) { 472 319 void __iomem *pio = gpio_chip[i].regbase; 473 320 474 - if (!wakeups[i]) 475 - clk_enable(gpio_chip[i].clock); 321 + if (!wakeups[i]) { 322 + if (clk_prepare(gpio_chip[i].clock) == 0) 323 + clk_enable(gpio_chip[i].clock); 324 + } 476 325 477 326 __raw_writel(wakeups[i], pio + PIO_IDR); 478 327 __raw_writel(backups[i], pio + PIO_IER); ··· 490 335 * To use any AT91_PIN_* as an externally triggered IRQ, first call 491 336 * at91_set_gpio_input() then maybe enable its glitch filter. 492 337 * Then just request_irq() with the pin ID; it works like any ARM IRQ 493 - * handler, though it always triggers on rising and falling edges. 338 + * handler. 339 + * First implementation always triggers on rising and falling edges 340 + * whereas the newer PIO3 can be additionally configured to trigger on 341 + * level, edge with any polarity. 494 342 * 495 343 * Alternatively, certain pins may be used directly as IRQ0..IRQ6 after 496 344 * configuring them with at91_set_a_periph() or at91_set_b_periph(). ··· 502 344 503 345 static void gpio_irq_mask(struct irq_data *d) 504 346 { 505 - unsigned pin = irq_to_gpio(d->irq); 506 - void __iomem *pio = pin_to_controller(pin); 507 - unsigned mask = pin_to_mask(pin); 347 + struct at91_gpio_chip *at91_gpio = irq_data_get_irq_chip_data(d); 348 + void __iomem *pio = at91_gpio->regbase; 349 + unsigned mask = 1 << d->hwirq; 508 350 509 351 if (pio) 510 352 __raw_writel(mask, pio + PIO_IDR); ··· 512 354 513 355 static void gpio_irq_unmask(struct irq_data *d) 514 356 { 515 - unsigned pin = irq_to_gpio(d->irq); 516 - void __iomem *pio = pin_to_controller(pin); 517 - unsigned mask = pin_to_mask(pin); 357 + struct at91_gpio_chip *at91_gpio = irq_data_get_irq_chip_data(d); 358 + void __iomem *pio = at91_gpio->regbase; 359 + unsigned mask = 1 << d->hwirq; 518 360 519 361 if (pio) 520 362 __raw_writel(mask, pio + PIO_IER); ··· 531 373 } 532 374 } 533 375 376 + /* Alternate irq type for PIO3 support */ 377 + static int alt_gpio_irq_type(struct irq_data *d, unsigned type) 378 + { 379 + struct at91_gpio_chip *at91_gpio = irq_data_get_irq_chip_data(d); 380 + void __iomem *pio = at91_gpio->regbase; 381 + unsigned mask = 1 << d->hwirq; 382 + 383 + switch (type) { 384 + case IRQ_TYPE_EDGE_RISING: 385 + __raw_writel(mask, pio + PIO_ESR); 386 + __raw_writel(mask, pio + PIO_REHLSR); 387 + break; 388 + case IRQ_TYPE_EDGE_FALLING: 389 + __raw_writel(mask, pio + PIO_ESR); 390 + __raw_writel(mask, pio + PIO_FELLSR); 391 + break; 392 + case IRQ_TYPE_LEVEL_LOW: 393 + __raw_writel(mask, pio + PIO_LSR); 394 + __raw_writel(mask, pio + PIO_FELLSR); 395 + break; 396 + case IRQ_TYPE_LEVEL_HIGH: 397 + __raw_writel(mask, pio + PIO_LSR); 398 + __raw_writel(mask, pio + PIO_REHLSR); 399 + break; 400 + case IRQ_TYPE_EDGE_BOTH: 401 + /* 402 + * disable additional interrupt modes: 403 + * fall back to default behavior 404 + */ 405 + __raw_writel(mask, pio + PIO_AIMDR); 406 + return 0; 407 + case IRQ_TYPE_NONE: 408 + default: 409 + pr_warn("AT91: No type for irq %d\n", gpio_to_irq(d->irq)); 410 + return -EINVAL; 411 + } 412 + 413 + /* enable additional interrupt modes */ 414 + __raw_writel(mask, pio + PIO_AIMER); 415 + 416 + return 0; 417 + } 418 + 534 419 static struct irq_chip gpio_irqchip = { 535 420 .name = "GPIO", 536 421 .irq_disable = gpio_irq_mask, 537 422 .irq_mask = gpio_irq_mask, 538 423 .irq_unmask = gpio_irq_unmask, 539 - .irq_set_type = gpio_irq_type, 424 + /* .irq_set_type is set dynamically */ 540 425 .irq_set_wake = gpio_irq_set_wake, 541 426 }; 542 427 543 428 static void gpio_irq_handler(unsigned irq, struct irq_desc *desc) 544 429 { 545 - unsigned irq_pin; 546 430 struct irq_data *idata = irq_desc_get_irq_data(desc); 547 431 struct irq_chip *chip = irq_data_get_irq_chip(idata); 548 432 struct at91_gpio_chip *at91_gpio = irq_data_get_irq_chip_data(idata); 549 433 void __iomem *pio = at91_gpio->regbase; 550 - u32 isr; 434 + unsigned long isr; 435 + int n; 551 436 552 437 /* temporarily mask (level sensitive) parent IRQ */ 553 438 chip->irq_ack(idata); ··· 608 407 continue; 609 408 } 610 409 611 - irq_pin = gpio_to_irq(at91_gpio->chip.base); 612 - 613 - while (isr) { 614 - if (isr & 1) 615 - generic_handle_irq(irq_pin); 616 - irq_pin++; 617 - isr >>= 1; 410 + n = find_first_bit(&isr, BITS_PER_LONG); 411 + while (n < BITS_PER_LONG) { 412 + generic_handle_irq(irq_find_mapping(at91_gpio->domain, n)); 413 + n = find_next_bit(&isr, BITS_PER_LONG, n + 1); 618 414 } 619 415 } 620 416 chip->irq_unmask(idata); ··· 622 424 623 425 #ifdef CONFIG_DEBUG_FS 624 426 427 + static void gpio_printf(struct seq_file *s, void __iomem *pio, unsigned mask) 428 + { 429 + char *trigger = NULL; 430 + char *polarity = NULL; 431 + 432 + if (__raw_readl(pio + PIO_IMR) & mask) { 433 + if (!has_pio3() || !(__raw_readl(pio + PIO_AIMMR) & mask )) { 434 + trigger = "edge"; 435 + polarity = "both"; 436 + } else { 437 + if (__raw_readl(pio + PIO_ELSR) & mask) { 438 + trigger = "level"; 439 + polarity = __raw_readl(pio + PIO_FRLHSR) & mask ? 440 + "high" : "low"; 441 + } else { 442 + trigger = "edge"; 443 + polarity = __raw_readl(pio + PIO_FRLHSR) & mask ? 444 + "rising" : "falling"; 445 + } 446 + } 447 + seq_printf(s, "IRQ:%s-%s\t", trigger, polarity); 448 + } else { 449 + seq_printf(s, "GPIO:%s\t\t", 450 + __raw_readl(pio + PIO_PDSR) & mask ? "1" : "0"); 451 + } 452 + } 453 + 625 454 static int at91_gpio_show(struct seq_file *s, void *unused) 626 455 { 627 456 int bank, j; ··· 656 431 /* print heading */ 657 432 seq_printf(s, "Pin\t"); 658 433 for (bank = 0; bank < gpio_banks; bank++) { 659 - seq_printf(s, "PIO%c\t", 'A' + bank); 434 + seq_printf(s, "PIO%c\t\t", 'A' + bank); 660 435 }; 661 436 seq_printf(s, "\n\n"); 662 437 ··· 670 445 unsigned mask = pin_to_mask(pin); 671 446 672 447 if (__raw_readl(pio + PIO_PSR) & mask) 673 - seq_printf(s, "GPIO:%s", __raw_readl(pio + PIO_PDSR) & mask ? "1" : "0"); 448 + gpio_printf(s, pio, mask); 674 449 else 675 - seq_printf(s, "%s", __raw_readl(pio + PIO_ABSR) & mask ? "B" : "A"); 676 - 677 - seq_printf(s, "\t"); 450 + seq_printf(s, "%c\t\t", 451 + peripheral_function(pio, mask)); 678 452 } 679 453 680 454 seq_printf(s, "\n"); ··· 712 488 */ 713 489 static struct lock_class_key gpio_lock_class; 714 490 491 + #if defined(CONFIG_OF) 492 + static int at91_gpio_irq_map(struct irq_domain *h, unsigned int virq, 493 + irq_hw_number_t hw) 494 + { 495 + struct at91_gpio_chip *at91_gpio = h->host_data; 496 + 497 + irq_set_lockdep_class(virq, &gpio_lock_class); 498 + 499 + /* 500 + * Can use the "simple" and not "edge" handler since it's 501 + * shorter, and the AIC handles interrupts sanely. 502 + */ 503 + irq_set_chip_and_handler(virq, &gpio_irqchip, 504 + handle_simple_irq); 505 + set_irq_flags(virq, IRQF_VALID); 506 + irq_set_chip_data(virq, at91_gpio); 507 + 508 + return 0; 509 + } 510 + 511 + static struct irq_domain_ops at91_gpio_ops = { 512 + .map = at91_gpio_irq_map, 513 + .xlate = irq_domain_xlate_twocell, 514 + }; 515 + 516 + int __init at91_gpio_of_irq_setup(struct device_node *node, 517 + struct device_node *parent) 518 + { 519 + struct at91_gpio_chip *prev = NULL; 520 + int alias_idx = of_alias_get_id(node, "gpio"); 521 + struct at91_gpio_chip *at91_gpio = &gpio_chip[alias_idx]; 522 + 523 + /* Setup proper .irq_set_type function */ 524 + if (has_pio3()) 525 + gpio_irqchip.irq_set_type = alt_gpio_irq_type; 526 + else 527 + gpio_irqchip.irq_set_type = gpio_irq_type; 528 + 529 + /* Disable irqs of this PIO controller */ 530 + __raw_writel(~0, at91_gpio->regbase + PIO_IDR); 531 + 532 + /* Setup irq domain */ 533 + at91_gpio->domain = irq_domain_add_linear(node, at91_gpio->chip.ngpio, 534 + &at91_gpio_ops, at91_gpio); 535 + if (!at91_gpio->domain) 536 + panic("at91_gpio.%d: couldn't allocate irq domain (DT).\n", 537 + at91_gpio->pioc_idx); 538 + 539 + /* Setup chained handler */ 540 + if (at91_gpio->pioc_idx) 541 + prev = &gpio_chip[at91_gpio->pioc_idx - 1]; 542 + 543 + /* The toplevel handler handles one bank of GPIOs, except 544 + * on some SoC it can handles up to three... 545 + * We only set up the handler for the first of the list. 546 + */ 547 + if (prev && prev->next == at91_gpio) 548 + return 0; 549 + 550 + at91_gpio->pioc_virq = irq_create_mapping(irq_find_host(parent), 551 + at91_gpio->pioc_hwirq); 552 + irq_set_chip_data(at91_gpio->pioc_virq, at91_gpio); 553 + irq_set_chained_handler(at91_gpio->pioc_virq, gpio_irq_handler); 554 + 555 + return 0; 556 + } 557 + #else 558 + int __init at91_gpio_of_irq_setup(struct device_node *node, 559 + struct device_node *parent) 560 + { 561 + return -EINVAL; 562 + } 563 + #endif 564 + 565 + /* 566 + * irqdomain initialization: pile up irqdomains on top of AIC range 567 + */ 568 + static void __init at91_gpio_irqdomain(struct at91_gpio_chip *at91_gpio) 569 + { 570 + int irq_base; 571 + 572 + irq_base = irq_alloc_descs(-1, 0, at91_gpio->chip.ngpio, 0); 573 + if (irq_base < 0) 574 + panic("at91_gpio.%d: error %d: couldn't allocate IRQ numbers.\n", 575 + at91_gpio->pioc_idx, irq_base); 576 + at91_gpio->domain = irq_domain_add_legacy(NULL, at91_gpio->chip.ngpio, 577 + irq_base, 0, 578 + &irq_domain_simple_ops, NULL); 579 + if (!at91_gpio->domain) 580 + panic("at91_gpio.%d: couldn't allocate irq domain.\n", 581 + at91_gpio->pioc_idx); 582 + } 583 + 715 584 /* 716 585 * Called from the processor-specific init to enable GPIO interrupt support. 717 586 */ 718 587 void __init at91_gpio_irq_setup(void) 719 588 { 720 - unsigned pioc, irq = gpio_to_irq(0); 589 + unsigned pioc; 590 + int gpio_irqnbr = 0; 721 591 struct at91_gpio_chip *this, *prev; 592 + 593 + /* Setup proper .irq_set_type function */ 594 + if (has_pio3()) 595 + gpio_irqchip.irq_set_type = alt_gpio_irq_type; 596 + else 597 + gpio_irqchip.irq_set_type = gpio_irq_type; 722 598 723 599 for (pioc = 0, this = gpio_chip, prev = NULL; 724 600 pioc++ < gpio_banks; 725 601 prev = this, this++) { 726 - unsigned id = this->id; 727 - unsigned i; 602 + int offset; 728 603 729 604 __raw_writel(~0, this->regbase + PIO_IDR); 730 605 731 - for (i = 0, irq = gpio_to_irq(this->chip.base); i < 32; 732 - i++, irq++) { 733 - irq_set_lockdep_class(irq, &gpio_lock_class); 606 + /* setup irq domain for this GPIO controller */ 607 + at91_gpio_irqdomain(this); 608 + 609 + for (offset = 0; offset < this->chip.ngpio; offset++) { 610 + unsigned int virq = irq_find_mapping(this->domain, offset); 611 + irq_set_lockdep_class(virq, &gpio_lock_class); 734 612 735 613 /* 736 614 * Can use the "simple" and not "edge" handler since it's 737 615 * shorter, and the AIC handles interrupts sanely. 738 616 */ 739 - irq_set_chip_and_handler(irq, &gpio_irqchip, 617 + irq_set_chip_and_handler(virq, &gpio_irqchip, 740 618 handle_simple_irq); 741 - set_irq_flags(irq, IRQF_VALID); 619 + set_irq_flags(virq, IRQF_VALID); 620 + irq_set_chip_data(virq, this); 621 + 622 + gpio_irqnbr++; 742 623 } 743 624 744 625 /* The toplevel handler handles one bank of GPIOs, except 745 - * AT91SAM9263_ID_PIOCDE handles three... PIOC is first in 746 - * the list, so we only set up that handler. 626 + * on some SoC it can handles up to three... 627 + * We only set up the handler for the first of the list. 747 628 */ 748 629 if (prev && prev->next == this) 749 630 continue; 750 631 751 - irq_set_chip_data(id, this); 752 - irq_set_chained_handler(id, gpio_irq_handler); 632 + this->pioc_virq = irq_create_mapping(NULL, this->pioc_hwirq); 633 + irq_set_chip_data(this->pioc_virq, this); 634 + irq_set_chained_handler(this->pioc_virq, gpio_irq_handler); 753 635 } 754 - pr_info("AT91: %d gpio irqs in %d banks\n", irq - gpio_to_irq(0), gpio_banks); 636 + pr_info("AT91: %d gpio irqs in %d banks\n", gpio_irqnbr, gpio_banks); 755 637 } 756 638 757 639 /* gpiolib support */ ··· 923 593 at91_get_gpio_value(pin) ? 924 594 "set" : "clear"); 925 595 else 926 - seq_printf(s, "[periph %s]\n", 927 - __raw_readl(pio + PIO_ABSR) & 928 - mask ? "B" : "A"); 596 + seq_printf(s, "[periph %c]\n", 597 + peripheral_function(pio, mask)); 929 598 } 930 599 } 600 + } 601 + 602 + static int at91_gpiolib_to_irq(struct gpio_chip *chip, unsigned offset) 603 + { 604 + struct at91_gpio_chip *at91_gpio = to_at91_gpio_chip(chip); 605 + int virq; 606 + 607 + if (offset < chip->ngpio) 608 + virq = irq_create_mapping(at91_gpio->domain, offset); 609 + else 610 + virq = -ENXIO; 611 + 612 + dev_dbg(chip->dev, "%s: request IRQ for GPIO %d, return %d\n", 613 + chip->label, offset + chip->base, virq); 614 + return virq; 615 + } 616 + 617 + static int __init at91_gpio_setup_clk(int idx) 618 + { 619 + struct at91_gpio_chip *at91_gpio = &gpio_chip[idx]; 620 + 621 + /* retreive PIO controller's clock */ 622 + at91_gpio->clock = clk_get_sys(NULL, at91_gpio->chip.label); 623 + if (IS_ERR(at91_gpio->clock)) { 624 + pr_err("at91_gpio.%d, failed to get clock, ignoring.\n", idx); 625 + goto err; 626 + } 627 + 628 + if (clk_prepare(at91_gpio->clock)) 629 + goto clk_prep_err; 630 + 631 + /* enable PIO controller's clock */ 632 + if (clk_enable(at91_gpio->clock)) { 633 + pr_err("at91_gpio.%d, failed to enable clock, ignoring.\n", idx); 634 + goto clk_err; 635 + } 636 + 637 + return 0; 638 + 639 + clk_err: 640 + clk_unprepare(at91_gpio->clock); 641 + clk_prep_err: 642 + clk_put(at91_gpio->clock); 643 + err: 644 + return -EINVAL; 645 + } 646 + 647 + #ifdef CONFIG_OF_GPIO 648 + static void __init of_at91_gpio_init_one(struct device_node *np) 649 + { 650 + int alias_idx; 651 + struct at91_gpio_chip *at91_gpio; 652 + 653 + if (!np) 654 + return; 655 + 656 + alias_idx = of_alias_get_id(np, "gpio"); 657 + if (alias_idx >= MAX_GPIO_BANKS) { 658 + pr_err("at91_gpio, failed alias idx(%d) > MAX_GPIO_BANKS(%d), ignoring.\n", 659 + alias_idx, MAX_GPIO_BANKS); 660 + return; 661 + } 662 + 663 + at91_gpio = &gpio_chip[alias_idx]; 664 + at91_gpio->chip.base = alias_idx * at91_gpio->chip.ngpio; 665 + 666 + at91_gpio->regbase = of_iomap(np, 0); 667 + if (!at91_gpio->regbase) { 668 + pr_err("at91_gpio.%d, failed to map registers, ignoring.\n", 669 + alias_idx); 670 + return; 671 + } 672 + 673 + /* Get the interrupts property */ 674 + if (of_property_read_u32(np, "interrupts", &at91_gpio->pioc_hwirq)) { 675 + pr_err("at91_gpio.%d, failed to get interrupts property, ignoring.\n", 676 + alias_idx); 677 + goto ioremap_err; 678 + } 679 + 680 + /* Get capabilities from compatibility property */ 681 + if (of_device_is_compatible(np, "atmel,at91sam9x5-gpio")) 682 + at91_gpio_caps |= AT91_GPIO_CAP_PIO3; 683 + 684 + /* Setup clock */ 685 + if (at91_gpio_setup_clk(alias_idx)) 686 + goto ioremap_err; 687 + 688 + at91_gpio->chip.of_node = np; 689 + gpio_banks = max(gpio_banks, alias_idx + 1); 690 + at91_gpio->pioc_idx = alias_idx; 691 + return; 692 + 693 + ioremap_err: 694 + iounmap(at91_gpio->regbase); 695 + } 696 + 697 + static int __init of_at91_gpio_init(void) 698 + { 699 + struct device_node *np = NULL; 700 + 701 + /* 702 + * This isn't ideal, but it gets things hooked up until this 703 + * driver is converted into a platform_device 704 + */ 705 + for_each_compatible_node(np, NULL, "atmel,at91rm9200-gpio") 706 + of_at91_gpio_init_one(np); 707 + 708 + return gpio_banks > 0 ? 0 : -EINVAL; 709 + } 710 + #else 711 + static int __init of_at91_gpio_init(void) 712 + { 713 + return -EINVAL; 714 + } 715 + #endif 716 + 717 + static void __init at91_gpio_init_one(int idx, u32 regbase, int pioc_hwirq) 718 + { 719 + struct at91_gpio_chip *at91_gpio = &gpio_chip[idx]; 720 + 721 + at91_gpio->chip.base = idx * at91_gpio->chip.ngpio; 722 + at91_gpio->pioc_hwirq = pioc_hwirq; 723 + at91_gpio->pioc_idx = idx; 724 + 725 + at91_gpio->regbase = ioremap(regbase, 512); 726 + if (!at91_gpio->regbase) { 727 + pr_err("at91_gpio.%d, failed to map registers, ignoring.\n", idx); 728 + return; 729 + } 730 + 731 + if (at91_gpio_setup_clk(idx)) 732 + goto ioremap_err; 733 + 734 + gpio_banks = max(gpio_banks, idx + 1); 735 + return; 736 + 737 + ioremap_err: 738 + iounmap(at91_gpio->regbase); 931 739 } 932 740 933 741 /* ··· 1073 605 */ 1074 606 void __init at91_gpio_init(struct at91_gpio_bank *data, int nr_banks) 1075 607 { 1076 - unsigned i; 608 + unsigned i; 1077 609 struct at91_gpio_chip *at91_gpio, *last = NULL; 1078 610 1079 611 BUG_ON(nr_banks > MAX_GPIO_BANKS); 1080 612 1081 - gpio_banks = nr_banks; 613 + if (of_at91_gpio_init() < 0) { 614 + /* No GPIO controller found in device tree */ 615 + for (i = 0; i < nr_banks; i++) 616 + at91_gpio_init_one(i, data[i].regbase, data[i].id); 617 + } 1082 618 1083 - for (i = 0; i < nr_banks; i++) { 619 + for (i = 0; i < gpio_banks; i++) { 1084 620 at91_gpio = &gpio_chip[i]; 1085 621 1086 - at91_gpio->id = data[i].id; 1087 - at91_gpio->chip.base = i * 32; 1088 - 1089 - at91_gpio->regbase = ioremap(data[i].regbase, 512); 1090 - if (!at91_gpio->regbase) { 1091 - pr_err("at91_gpio.%d, failed to map registers, ignoring.\n", i); 1092 - continue; 1093 - } 1094 - 1095 - at91_gpio->clock = clk_get_sys(NULL, at91_gpio->chip.label); 1096 - if (!at91_gpio->clock) { 1097 - pr_err("at91_gpio.%d, failed to get clock, ignoring.\n", i); 1098 - continue; 1099 - } 1100 - 1101 - /* enable PIO controller's clock */ 1102 - clk_enable(at91_gpio->clock); 1103 - 1104 - /* AT91SAM9263_ID_PIOCDE groups PIOC, PIOD, PIOE */ 1105 - if (last && last->id == at91_gpio->id) 622 + /* 623 + * GPIO controller are grouped on some SoC: 624 + * PIOC, PIOD and PIOE can share the same IRQ line 625 + */ 626 + if (last && last->pioc_hwirq == at91_gpio->pioc_hwirq) 1106 627 last->next = at91_gpio; 1107 628 last = at91_gpio; 1108 629
+23
arch/arm/mach-at91/include/mach/at91_matrix.h
··· 1 + /* 2 + * Copyright (C) 2011 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> 3 + * 4 + * Under GPLv2 5 + */ 6 + 7 + #ifndef __MACH_AT91_MATRIX_H__ 8 + #define __MACH_AT91_MATRIX_H__ 9 + 10 + #ifndef __ASSEMBLY__ 11 + extern void __iomem *at91_matrix_base; 12 + 13 + #define at91_matrix_read(field) \ 14 + __raw_readl(at91_matrix_base + field) 15 + 16 + #define at91_matrix_write(field, value) \ 17 + __raw_writel(value, at91_matrix_base + field); 18 + 19 + #else 20 + .extern at91_matrix_base 21 + #endif 22 + 23 + #endif /* __MACH_AT91_MATRIX_H__ */
+25
arch/arm/mach-at91/include/mach/at91_pio.h
··· 40 40 #define PIO_PUER 0x64 /* Pull-up Enable Register */ 41 41 #define PIO_PUSR 0x68 /* Pull-up Status Register */ 42 42 #define PIO_ASR 0x70 /* Peripheral A Select Register */ 43 + #define PIO_ABCDSR1 0x70 /* Peripheral ABCD Select Register 1 [some sam9 only] */ 43 44 #define PIO_BSR 0x74 /* Peripheral B Select Register */ 45 + #define PIO_ABCDSR2 0x74 /* Peripheral ABCD Select Register 2 [some sam9 only] */ 44 46 #define PIO_ABSR 0x78 /* AB Status Register */ 47 + #define PIO_IFSCDR 0x80 /* Input Filter Slow Clock Disable Register */ 48 + #define PIO_IFSCER 0x84 /* Input Filter Slow Clock Enable Register */ 49 + #define PIO_IFSCSR 0x88 /* Input Filter Slow Clock Status Register */ 50 + #define PIO_SCDR 0x8c /* Slow Clock Divider Debouncing Register */ 51 + #define PIO_SCDR_DIV (0x3fff << 0) /* Slow Clock Divider Mask */ 52 + #define PIO_PPDDR 0x90 /* Pad Pull-down Disable Register */ 53 + #define PIO_PPDER 0x94 /* Pad Pull-down Enable Register */ 54 + #define PIO_PPDSR 0x98 /* Pad Pull-down Status Register */ 45 55 #define PIO_OWER 0xa0 /* Output Write Enable Register */ 46 56 #define PIO_OWDR 0xa4 /* Output Write Disable Register */ 47 57 #define PIO_OWSR 0xa8 /* Output Write Status Register */ 58 + #define PIO_AIMER 0xb0 /* Additional Interrupt Modes Enable Register */ 59 + #define PIO_AIMDR 0xb4 /* Additional Interrupt Modes Disable Register */ 60 + #define PIO_AIMMR 0xb8 /* Additional Interrupt Modes Mask Register */ 61 + #define PIO_ESR 0xc0 /* Edge Select Register */ 62 + #define PIO_LSR 0xc4 /* Level Select Register */ 63 + #define PIO_ELSR 0xc8 /* Edge/Level Status Register */ 64 + #define PIO_FELLSR 0xd0 /* Falling Edge/Low Level Select Register */ 65 + #define PIO_REHLSR 0xd4 /* Rising Edge/ High Level Select Register */ 66 + #define PIO_FRLHSR 0xd8 /* Fall/Rise - Low/High Status Register */ 67 + #define PIO_SCHMITT 0x100 /* Schmitt Trigger Register */ 68 + 69 + #define ABCDSR_PERIPH_A 0x0 70 + #define ABCDSR_PERIPH_B 0x1 71 + #define ABCDSR_PERIPH_C 0x2 72 + #define ABCDSR_PERIPH_D 0x3 48 73 49 74 #endif
+34 -22
arch/arm/mach-at91/include/mach/at91_pmc.h
··· 16 16 #ifndef AT91_PMC_H 17 17 #define AT91_PMC_H 18 18 19 - #define AT91_PMC_SCER (AT91_PMC + 0x00) /* System Clock Enable Register */ 20 - #define AT91_PMC_SCDR (AT91_PMC + 0x04) /* System Clock Disable Register */ 19 + #ifndef __ASSEMBLY__ 20 + extern void __iomem *at91_pmc_base; 21 21 22 - #define AT91_PMC_SCSR (AT91_PMC + 0x08) /* System Clock Status Register */ 22 + #define at91_pmc_read(field) \ 23 + __raw_readl(at91_pmc_base + field) 24 + 25 + #define at91_pmc_write(field, value) \ 26 + __raw_writel(value, at91_pmc_base + field) 27 + #else 28 + .extern at91_aic_base 29 + #endif 30 + 31 + #define AT91_PMC_SCER 0x00 /* System Clock Enable Register */ 32 + #define AT91_PMC_SCDR 0x04 /* System Clock Disable Register */ 33 + 34 + #define AT91_PMC_SCSR 0x08 /* System Clock Status Register */ 23 35 #define AT91_PMC_PCK (1 << 0) /* Processor Clock */ 24 36 #define AT91RM9200_PMC_UDP (1 << 1) /* USB Devcice Port Clock [AT91RM9200 only] */ 25 37 #define AT91RM9200_PMC_MCKUDP (1 << 2) /* USB Device Port Master Clock Automatic Disable on Suspend [AT91RM9200 only] */ ··· 46 34 #define AT91_PMC_HCK0 (1 << 16) /* AHB Clock (USB host) [AT91SAM9261 only] */ 47 35 #define AT91_PMC_HCK1 (1 << 17) /* AHB Clock (LCD) [AT91SAM9261 only] */ 48 36 49 - #define AT91_PMC_PCER (AT91_PMC + 0x10) /* Peripheral Clock Enable Register */ 50 - #define AT91_PMC_PCDR (AT91_PMC + 0x14) /* Peripheral Clock Disable Register */ 51 - #define AT91_PMC_PCSR (AT91_PMC + 0x18) /* Peripheral Clock Status Register */ 37 + #define AT91_PMC_PCER 0x10 /* Peripheral Clock Enable Register */ 38 + #define AT91_PMC_PCDR 0x14 /* Peripheral Clock Disable Register */ 39 + #define AT91_PMC_PCSR 0x18 /* Peripheral Clock Status Register */ 52 40 53 - #define AT91_CKGR_UCKR (AT91_PMC + 0x1C) /* UTMI Clock Register [some SAM9] */ 41 + #define AT91_CKGR_UCKR 0x1C /* UTMI Clock Register [some SAM9] */ 54 42 #define AT91_PMC_UPLLEN (1 << 16) /* UTMI PLL Enable */ 55 43 #define AT91_PMC_UPLLCOUNT (0xf << 20) /* UTMI PLL Start-up Time */ 56 44 #define AT91_PMC_BIASEN (1 << 24) /* UTMI BIAS Enable */ 57 45 #define AT91_PMC_BIASCOUNT (0xf << 28) /* UTMI BIAS Start-up Time */ 58 46 59 - #define AT91_CKGR_MOR (AT91_PMC + 0x20) /* Main Oscillator Register [not on SAM9RL] */ 47 + #define AT91_CKGR_MOR 0x20 /* Main Oscillator Register [not on SAM9RL] */ 60 48 #define AT91_PMC_MOSCEN (1 << 0) /* Main Oscillator Enable */ 61 49 #define AT91_PMC_OSCBYPASS (1 << 1) /* Oscillator Bypass */ 62 50 #define AT91_PMC_MOSCRCEN (1 << 3) /* Main On-Chip RC Oscillator Enable [some SAM9] */ ··· 65 53 #define AT91_PMC_MOSCSEL (1 << 24) /* Main Oscillator Selection [some SAM9] */ 66 54 #define AT91_PMC_CFDEN (1 << 25) /* Clock Failure Detector Enable [some SAM9] */ 67 55 68 - #define AT91_CKGR_MCFR (AT91_PMC + 0x24) /* Main Clock Frequency Register */ 56 + #define AT91_CKGR_MCFR 0x24 /* Main Clock Frequency Register */ 69 57 #define AT91_PMC_MAINF (0xffff << 0) /* Main Clock Frequency */ 70 58 #define AT91_PMC_MAINRDY (1 << 16) /* Main Clock Ready */ 71 59 72 - #define AT91_CKGR_PLLAR (AT91_PMC + 0x28) /* PLL A Register */ 73 - #define AT91_CKGR_PLLBR (AT91_PMC + 0x2c) /* PLL B Register */ 60 + #define AT91_CKGR_PLLAR 0x28 /* PLL A Register */ 61 + #define AT91_CKGR_PLLBR 0x2c /* PLL B Register */ 74 62 #define AT91_PMC_DIV (0xff << 0) /* Divider */ 75 63 #define AT91_PMC_PLLCOUNT (0x3f << 8) /* PLL Counter */ 76 64 #define AT91_PMC_OUT (3 << 14) /* PLL Clock Frequency Range */ ··· 81 69 #define AT91_PMC_USBDIV_4 (2 << 28) 82 70 #define AT91_PMC_USB96M (1 << 28) /* Divider by 2 Enable (PLLB only) */ 83 71 84 - #define AT91_PMC_MCKR (AT91_PMC + 0x30) /* Master Clock Register */ 72 + #define AT91_PMC_MCKR 0x30 /* Master Clock Register */ 85 73 #define AT91_PMC_CSS (3 << 0) /* Master Clock Selection */ 86 74 #define AT91_PMC_CSS_SLOW (0 << 0) 87 75 #define AT91_PMC_CSS_MAIN (1 << 0) ··· 123 111 #define AT91_PMC_PLLADIV2_OFF (0 << 12) 124 112 #define AT91_PMC_PLLADIV2_ON (1 << 12) 125 113 126 - #define AT91_PMC_USB (AT91_PMC + 0x38) /* USB Clock Register [some SAM9 only] */ 114 + #define AT91_PMC_USB 0x38 /* USB Clock Register [some SAM9 only] */ 127 115 #define AT91_PMC_USBS (0x1 << 0) /* USB OHCI Input clock selection */ 128 116 #define AT91_PMC_USBS_PLLA (0 << 0) 129 117 #define AT91_PMC_USBS_UPLL (1 << 0) 130 118 #define AT91_PMC_OHCIUSBDIV (0xF << 8) /* Divider for USB OHCI Clock */ 131 119 132 - #define AT91_PMC_SMD (AT91_PMC + 0x3c) /* Soft Modem Clock Register [some SAM9 only] */ 120 + #define AT91_PMC_SMD 0x3c /* Soft Modem Clock Register [some SAM9 only] */ 133 121 #define AT91_PMC_SMDS (0x1 << 0) /* SMD input clock selection */ 134 122 #define AT91_PMC_SMD_DIV (0x1f << 8) /* SMD input clock divider */ 135 123 #define AT91_PMC_SMDDIV(n) (((n) << 8) & AT91_PMC_SMD_DIV) 136 124 137 - #define AT91_PMC_PCKR(n) (AT91_PMC + 0x40 + ((n) * 4)) /* Programmable Clock 0-N Registers */ 125 + #define AT91_PMC_PCKR(n) (0x40 + ((n) * 4)) /* Programmable Clock 0-N Registers */ 138 126 #define AT91_PMC_ALT_PCKR_CSS (0x7 << 0) /* Programmable Clock Source Selection [alternate length] */ 139 127 #define AT91_PMC_CSS_MASTER (4 << 0) /* [some SAM9 only] */ 140 128 #define AT91_PMC_CSSMCK (0x1 << 8) /* CSS or Master Clock Selection */ 141 129 #define AT91_PMC_CSSMCK_CSS (0 << 8) 142 130 #define AT91_PMC_CSSMCK_MCK (1 << 8) 143 131 144 - #define AT91_PMC_IER (AT91_PMC + 0x60) /* Interrupt Enable Register */ 145 - #define AT91_PMC_IDR (AT91_PMC + 0x64) /* Interrupt Disable Register */ 146 - #define AT91_PMC_SR (AT91_PMC + 0x68) /* Status Register */ 132 + #define AT91_PMC_IER 0x60 /* Interrupt Enable Register */ 133 + #define AT91_PMC_IDR 0x64 /* Interrupt Disable Register */ 134 + #define AT91_PMC_SR 0x68 /* Status Register */ 147 135 #define AT91_PMC_MOSCS (1 << 0) /* MOSCS Flag */ 148 136 #define AT91_PMC_LOCKA (1 << 1) /* PLLA Lock */ 149 137 #define AT91_PMC_LOCKB (1 << 2) /* PLLB Lock */ ··· 156 144 #define AT91_PMC_MOSCSELS (1 << 16) /* Main Oscillator Selection [some SAM9] */ 157 145 #define AT91_PMC_MOSCRCS (1 << 17) /* Main On-Chip RC [some SAM9] */ 158 146 #define AT91_PMC_CFDEV (1 << 18) /* Clock Failure Detector Event [some SAM9] */ 159 - #define AT91_PMC_IMR (AT91_PMC + 0x6c) /* Interrupt Mask Register */ 147 + #define AT91_PMC_IMR 0x6c /* Interrupt Mask Register */ 160 148 161 - #define AT91_PMC_PROT (AT91_PMC + 0xe4) /* Write Protect Mode Register [some SAM9] */ 149 + #define AT91_PMC_PROT 0xe4 /* Write Protect Mode Register [some SAM9] */ 162 150 #define AT91_PMC_WPEN (0x1 << 0) /* Write Protect Enable */ 163 151 #define AT91_PMC_WPKEY (0xffffff << 8) /* Write Protect Key */ 164 152 #define AT91_PMC_PROTKEY (0x504d43 << 8) /* Activation Code */ 165 153 166 - #define AT91_PMC_WPSR (AT91_PMC + 0xe8) /* Write Protect Status Register [some SAM9] */ 154 + #define AT91_PMC_WPSR 0xe8 /* Write Protect Status Register [some SAM9] */ 167 155 #define AT91_PMC_WPVS (0x1 << 0) /* Write Protect Violation Status */ 168 156 #define AT91_PMC_WPVSRC (0xffff << 8) /* Write Protect Violation Source */ 169 157 170 - #define AT91_PMC_PCR (AT91_PMC + 0x10c) /* Peripheral Control Register [some SAM9] */ 158 + #define AT91_PMC_PCR 0x10c /* Peripheral Control Register [some SAM9] */ 171 159 #define AT91_PMC_PCR_PID (0x3f << 0) /* Peripheral ID */ 172 160 #define AT91_PMC_PCR_CMD (0x1 << 12) /* Command */ 173 161 #define AT91_PMC_PCR_DIV (0x3 << 16) /* Divisor Value */
+32
arch/arm/mach-at91/include/mach/at91_ramc.h
··· 1 + /* 2 + * Header file for the Atmel RAM Controller 3 + * 4 + * Copyright (C) 2011 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> 5 + * 6 + * Under GPLv2 only 7 + */ 8 + 9 + #ifndef __AT91_RAMC_H__ 10 + #define __AT91_RAMC_H__ 11 + 12 + #ifndef __ASSEMBLY__ 13 + extern void __iomem *at91_ramc_base[]; 14 + 15 + #define at91_ramc_read(id, field) \ 16 + __raw_readl(at91_ramc_base[id] + field) 17 + 18 + #define at91_ramc_write(id, field, value) \ 19 + __raw_writel(value, at91_ramc_base[id] + field) 20 + #else 21 + .extern at91_ramc_base 22 + #endif 23 + 24 + #define AT91_MEMCTRL_MC 0 25 + #define AT91_MEMCTRL_SDRAMC 1 26 + #define AT91_MEMCTRL_DDRSDR 2 27 + 28 + #include <mach/at91rm9200_sdramc.h> 29 + #include <mach/at91sam9_ddrsdr.h> 30 + #include <mach/at91sam9_sdramc.h> 31 + 32 + #endif /* __AT91_RAMC_H__ */
+22 -10
arch/arm/mach-at91/include/mach/at91_st.h
··· 16 16 #ifndef AT91_ST_H 17 17 #define AT91_ST_H 18 18 19 - #define AT91_ST_CR (AT91_ST + 0x00) /* Control Register */ 19 + #ifndef __ASSEMBLY__ 20 + extern void __iomem *at91_st_base; 21 + 22 + #define at91_st_read(field) \ 23 + __raw_readl(at91_st_base + field) 24 + 25 + #define at91_st_write(field, value) \ 26 + __raw_writel(value, at91_st_base + field); 27 + #else 28 + .extern at91_st_base 29 + #endif 30 + 31 + #define AT91_ST_CR 0x00 /* Control Register */ 20 32 #define AT91_ST_WDRST (1 << 0) /* Watchdog Timer Restart */ 21 33 22 - #define AT91_ST_PIMR (AT91_ST + 0x04) /* Period Interval Mode Register */ 34 + #define AT91_ST_PIMR 0x04 /* Period Interval Mode Register */ 23 35 #define AT91_ST_PIV (0xffff << 0) /* Period Interval Value */ 24 36 25 - #define AT91_ST_WDMR (AT91_ST + 0x08) /* Watchdog Mode Register */ 37 + #define AT91_ST_WDMR 0x08 /* Watchdog Mode Register */ 26 38 #define AT91_ST_WDV (0xffff << 0) /* Watchdog Counter Value */ 27 39 #define AT91_ST_RSTEN (1 << 16) /* Reset Enable */ 28 40 #define AT91_ST_EXTEN (1 << 17) /* External Signal Assertion Enable */ 29 41 30 - #define AT91_ST_RTMR (AT91_ST + 0x0c) /* Real-time Mode Register */ 42 + #define AT91_ST_RTMR 0x0c /* Real-time Mode Register */ 31 43 #define AT91_ST_RTPRES (0xffff << 0) /* Real-time Prescalar Value */ 32 44 33 - #define AT91_ST_SR (AT91_ST + 0x10) /* Status Register */ 45 + #define AT91_ST_SR 0x10 /* Status Register */ 34 46 #define AT91_ST_PITS (1 << 0) /* Period Interval Timer Status */ 35 47 #define AT91_ST_WDOVF (1 << 1) /* Watchdog Overflow */ 36 48 #define AT91_ST_RTTINC (1 << 2) /* Real-time Timer Increment */ 37 49 #define AT91_ST_ALMS (1 << 3) /* Alarm Status */ 38 50 39 - #define AT91_ST_IER (AT91_ST + 0x14) /* Interrupt Enable Register */ 40 - #define AT91_ST_IDR (AT91_ST + 0x18) /* Interrupt Disable Register */ 41 - #define AT91_ST_IMR (AT91_ST + 0x1c) /* Interrupt Mask Register */ 51 + #define AT91_ST_IER 0x14 /* Interrupt Enable Register */ 52 + #define AT91_ST_IDR 0x18 /* Interrupt Disable Register */ 53 + #define AT91_ST_IMR 0x1c /* Interrupt Mask Register */ 42 54 43 - #define AT91_ST_RTAR (AT91_ST + 0x20) /* Real-time Alarm Register */ 55 + #define AT91_ST_RTAR 0x20 /* Real-time Alarm Register */ 44 56 #define AT91_ST_ALMV (0xfffff << 0) /* Alarm Value */ 45 57 46 - #define AT91_ST_CRTR (AT91_ST + 0x24) /* Current Real-time Register */ 58 + #define AT91_ST_CRTR 0x24 /* Current Real-time Register */ 47 59 #define AT91_ST_CRTV (0xfffff << 0) /* Current Real-Time Value */ 48 60 49 61 #endif
+3 -7
arch/arm/mach-at91/include/mach/at91rm9200.h
··· 77 77 78 78 79 79 /* 80 - * System Peripherals (offset from AT91_BASE_SYS) 80 + * System Peripherals 81 81 */ 82 - #define AT91_PMC (0xfffffc00 - AT91_BASE_SYS) /* Power Management Controller */ 83 - #define AT91_ST (0xfffffd00 - AT91_BASE_SYS) /* System Timer */ 84 - #define AT91_MC (0xffffff00 - AT91_BASE_SYS) /* Memory Controllers */ 85 - 86 82 #define AT91RM9200_BASE_DBGU AT91_BASE_DBGU0 /* Debug Unit */ 87 83 #define AT91RM9200_BASE_PIOA 0xfffff400 /* PIO Controller A */ 88 84 #define AT91RM9200_BASE_PIOB 0xfffff600 /* PIO Controller B */ 89 85 #define AT91RM9200_BASE_PIOC 0xfffff800 /* PIO Controller C */ 90 86 #define AT91RM9200_BASE_PIOD 0xfffffa00 /* PIO Controller D */ 87 + #define AT91RM9200_BASE_ST 0xfffffd00 /* System Timer */ 91 88 #define AT91RM9200_BASE_RTC 0xfffffe00 /* Real-Time Clock */ 89 + #define AT91RM9200_BASE_MC 0xffffff00 /* Memory Controllers */ 92 90 93 91 #define AT91_USART0 AT91RM9200_BASE_US0 94 92 #define AT91_USART1 AT91RM9200_BASE_US1 95 93 #define AT91_USART2 AT91RM9200_BASE_US2 96 94 #define AT91_USART3 AT91RM9200_BASE_US3 97 - 98 - #define AT91_MATRIX 0 /* not supported */ 99 95 100 96 /* 101 97 * Internal Memory.
+7 -51
arch/arm/mach-at91/include/mach/at91rm9200_mc.h
··· 17 17 #define AT91RM9200_MC_H 18 18 19 19 /* Memory Controller */ 20 - #define AT91_MC_RCR (AT91_MC + 0x00) /* MC Remap Control Register */ 20 + #define AT91_MC_RCR 0x00 /* MC Remap Control Register */ 21 21 #define AT91_MC_RCB (1 << 0) /* Remap Command Bit */ 22 22 23 - #define AT91_MC_ASR (AT91_MC + 0x04) /* MC Abort Status Register */ 23 + #define AT91_MC_ASR 0x04 /* MC Abort Status Register */ 24 24 #define AT91_MC_UNADD (1 << 0) /* Undefined Address Abort Status */ 25 25 #define AT91_MC_MISADD (1 << 1) /* Misaligned Address Abort Status */ 26 26 #define AT91_MC_ABTSZ (3 << 8) /* Abort Size Status */ ··· 40 40 #define AT91_MC_SVMST2 (1 << 26) /* Saved UHP Abort Source */ 41 41 #define AT91_MC_SVMST3 (1 << 27) /* Saved EMAC Abort Source */ 42 42 43 - #define AT91_MC_AASR (AT91_MC + 0x08) /* MC Abort Address Status Register */ 43 + #define AT91_MC_AASR 0x08 /* MC Abort Address Status Register */ 44 44 45 - #define AT91_MC_MPR (AT91_MC + 0x0c) /* MC Master Priority Register */ 45 + #define AT91_MC_MPR 0x0c /* MC Master Priority Register */ 46 46 #define AT91_MPR_MSTP0 (7 << 0) /* ARM920T Priority */ 47 47 #define AT91_MPR_MSTP1 (7 << 4) /* PDC Priority */ 48 48 #define AT91_MPR_MSTP2 (7 << 8) /* UHP Priority */ 49 49 #define AT91_MPR_MSTP3 (7 << 12) /* EMAC Priority */ 50 50 51 51 /* External Bus Interface (EBI) registers */ 52 - #define AT91_EBI_CSA (AT91_MC + 0x60) /* Chip Select Assignment Register */ 52 + #define AT91_EBI_CSA 0x60 /* Chip Select Assignment Register */ 53 53 #define AT91_EBI_CS0A (1 << 0) /* Chip Select 0 Assignment */ 54 54 #define AT91_EBI_CS0A_SMC (0 << 0) 55 55 #define AT91_EBI_CS0A_BFC (1 << 0) ··· 66 66 #define AT91_EBI_DBPUC (1 << 0) /* Data Bus Pull-Up Configuration */ 67 67 68 68 /* Static Memory Controller (SMC) registers */ 69 - #define AT91_SMC_CSR(n) (AT91_MC + 0x70 + ((n) * 4))/* SMC Chip Select Register */ 69 + #define AT91_SMC_CSR(n) (0x70 + ((n) * 4)) /* SMC Chip Select Register */ 70 70 #define AT91_SMC_NWS (0x7f << 0) /* Number of Wait States */ 71 71 #define AT91_SMC_NWS_(x) ((x) << 0) 72 72 #define AT91_SMC_WSEN (1 << 7) /* Wait State Enable */ ··· 87 87 #define AT91_SMC_RWHOLD (7 << 28) /* Read & Write Signal Hold Time */ 88 88 #define AT91_SMC_RWHOLD_(x) ((x) << 28) 89 89 90 - /* SDRAM Controller registers */ 91 - #define AT91_SDRAMC_MR (AT91_MC + 0x90) /* Mode Register */ 92 - #define AT91_SDRAMC_MODE (0xf << 0) /* Command Mode */ 93 - #define AT91_SDRAMC_MODE_NORMAL (0 << 0) 94 - #define AT91_SDRAMC_MODE_NOP (1 << 0) 95 - #define AT91_SDRAMC_MODE_PRECHARGE (2 << 0) 96 - #define AT91_SDRAMC_MODE_LMR (3 << 0) 97 - #define AT91_SDRAMC_MODE_REFRESH (4 << 0) 98 - #define AT91_SDRAMC_DBW (1 << 4) /* Data Bus Width */ 99 - #define AT91_SDRAMC_DBW_32 (0 << 4) 100 - #define AT91_SDRAMC_DBW_16 (1 << 4) 101 - 102 - #define AT91_SDRAMC_TR (AT91_MC + 0x94) /* Refresh Timer Register */ 103 - #define AT91_SDRAMC_COUNT (0xfff << 0) /* Refresh Timer Count */ 104 - 105 - #define AT91_SDRAMC_CR (AT91_MC + 0x98) /* Configuration Register */ 106 - #define AT91_SDRAMC_NC (3 << 0) /* Number of Column Bits */ 107 - #define AT91_SDRAMC_NC_8 (0 << 0) 108 - #define AT91_SDRAMC_NC_9 (1 << 0) 109 - #define AT91_SDRAMC_NC_10 (2 << 0) 110 - #define AT91_SDRAMC_NC_11 (3 << 0) 111 - #define AT91_SDRAMC_NR (3 << 2) /* Number of Row Bits */ 112 - #define AT91_SDRAMC_NR_11 (0 << 2) 113 - #define AT91_SDRAMC_NR_12 (1 << 2) 114 - #define AT91_SDRAMC_NR_13 (2 << 2) 115 - #define AT91_SDRAMC_NB (1 << 4) /* Number of Banks */ 116 - #define AT91_SDRAMC_NB_2 (0 << 4) 117 - #define AT91_SDRAMC_NB_4 (1 << 4) 118 - #define AT91_SDRAMC_CAS (3 << 5) /* CAS Latency */ 119 - #define AT91_SDRAMC_CAS_2 (2 << 5) 120 - #define AT91_SDRAMC_TWR (0xf << 7) /* Write Recovery Delay */ 121 - #define AT91_SDRAMC_TRC (0xf << 11) /* Row Cycle Delay */ 122 - #define AT91_SDRAMC_TRP (0xf << 15) /* Row Precharge Delay */ 123 - #define AT91_SDRAMC_TRCD (0xf << 19) /* Row to Column Delay */ 124 - #define AT91_SDRAMC_TRAS (0xf << 23) /* Active to Precharge Delay */ 125 - #define AT91_SDRAMC_TXSR (0xf << 27) /* Exit Self Refresh to Active Delay */ 126 - 127 - #define AT91_SDRAMC_SRR (AT91_MC + 0x9c) /* Self Refresh Register */ 128 - #define AT91_SDRAMC_LPR (AT91_MC + 0xa0) /* Low Power Register */ 129 - #define AT91_SDRAMC_IER (AT91_MC + 0xa4) /* Interrupt Enable Register */ 130 - #define AT91_SDRAMC_IDR (AT91_MC + 0xa8) /* Interrupt Disable Register */ 131 - #define AT91_SDRAMC_IMR (AT91_MC + 0xac) /* Interrupt Mask Register */ 132 - #define AT91_SDRAMC_ISR (AT91_MC + 0xb0) /* Interrupt Status Register */ 133 - 134 90 /* Burst Flash Controller register */ 135 - #define AT91_BFC_MR (AT91_MC + 0xc0) /* Mode Register */ 91 + #define AT91_BFC_MR 0xc0 /* Mode Register */ 136 92 #define AT91_BFC_BFCOM (3 << 0) /* Burst Flash Controller Operating Mode */ 137 93 #define AT91_BFC_BFCOM_DISABLED (0 << 0) 138 94 #define AT91_BFC_BFCOM_ASYNC (1 << 0)
+63
arch/arm/mach-at91/include/mach/at91rm9200_sdramc.h
··· 1 + /* 2 + * arch/arm/mach-at91/include/mach/at91rm9200_sdramc.h 3 + * 4 + * Copyright (C) 2005 Ivan Kokshaysky 5 + * Copyright (C) SAN People 6 + * 7 + * Memory Controllers (SDRAMC only) - System peripherals registers. 8 + * Based on AT91RM9200 datasheet revision E. 9 + * 10 + * This program is free software; you can redistribute it and/or modify 11 + * it under the terms of the GNU General Public License as published by 12 + * the Free Software Foundation; either version 2 of the License, or 13 + * (at your option) any later version. 14 + */ 15 + 16 + #ifndef AT91RM9200_SDRAMC_H 17 + #define AT91RM9200_SDRAMC_H 18 + 19 + /* SDRAM Controller registers */ 20 + #define AT91RM9200_SDRAMC_MR 0x90 /* Mode Register */ 21 + #define AT91RM9200_SDRAMC_MODE (0xf << 0) /* Command Mode */ 22 + #define AT91RM9200_SDRAMC_MODE_NORMAL (0 << 0) 23 + #define AT91RM9200_SDRAMC_MODE_NOP (1 << 0) 24 + #define AT91RM9200_SDRAMC_MODE_PRECHARGE (2 << 0) 25 + #define AT91RM9200_SDRAMC_MODE_LMR (3 << 0) 26 + #define AT91RM9200_SDRAMC_MODE_REFRESH (4 << 0) 27 + #define AT91RM9200_SDRAMC_DBW (1 << 4) /* Data Bus Width */ 28 + #define AT91RM9200_SDRAMC_DBW_32 (0 << 4) 29 + #define AT91RM9200_SDRAMC_DBW_16 (1 << 4) 30 + 31 + #define AT91RM9200_SDRAMC_TR 0x94 /* Refresh Timer Register */ 32 + #define AT91RM9200_SDRAMC_COUNT (0xfff << 0) /* Refresh Timer Count */ 33 + 34 + #define AT91RM9200_SDRAMC_CR 0x98 /* Configuration Register */ 35 + #define AT91RM9200_SDRAMC_NC (3 << 0) /* Number of Column Bits */ 36 + #define AT91RM9200_SDRAMC_NC_8 (0 << 0) 37 + #define AT91RM9200_SDRAMC_NC_9 (1 << 0) 38 + #define AT91RM9200_SDRAMC_NC_10 (2 << 0) 39 + #define AT91RM9200_SDRAMC_NC_11 (3 << 0) 40 + #define AT91RM9200_SDRAMC_NR (3 << 2) /* Number of Row Bits */ 41 + #define AT91RM9200_SDRAMC_NR_11 (0 << 2) 42 + #define AT91RM9200_SDRAMC_NR_12 (1 << 2) 43 + #define AT91RM9200_SDRAMC_NR_13 (2 << 2) 44 + #define AT91RM9200_SDRAMC_NB (1 << 4) /* Number of Banks */ 45 + #define AT91RM9200_SDRAMC_NB_2 (0 << 4) 46 + #define AT91RM9200_SDRAMC_NB_4 (1 << 4) 47 + #define AT91RM9200_SDRAMC_CAS (3 << 5) /* CAS Latency */ 48 + #define AT91RM9200_SDRAMC_CAS_2 (2 << 5) 49 + #define AT91RM9200_SDRAMC_TWR (0xf << 7) /* Write Recovery Delay */ 50 + #define AT91RM9200_SDRAMC_TRC (0xf << 11) /* Row Cycle Delay */ 51 + #define AT91RM9200_SDRAMC_TRP (0xf << 15) /* Row Precharge Delay */ 52 + #define AT91RM9200_SDRAMC_TRCD (0xf << 19) /* Row to Column Delay */ 53 + #define AT91RM9200_SDRAMC_TRAS (0xf << 23) /* Active to Precharge Delay */ 54 + #define AT91RM9200_SDRAMC_TXSR (0xf << 27) /* Exit Self Refresh to Active Delay */ 55 + 56 + #define AT91RM9200_SDRAMC_SRR 0x9c /* Self Refresh Register */ 57 + #define AT91RM9200_SDRAMC_LPR 0xa0 /* Low Power Register */ 58 + #define AT91RM9200_SDRAMC_IER 0xa4 /* Interrupt Enable Register */ 59 + #define AT91RM9200_SDRAMC_IDR 0xa8 /* Interrupt Disable Register */ 60 + #define AT91RM9200_SDRAMC_IMR 0xac /* Interrupt Mask Register */ 61 + #define AT91RM9200_SDRAMC_ISR 0xb0 /* Interrupt Status Register */ 62 + 63 + #endif
+8 -6
arch/arm/mach-at91/include/mach/at91sam9260.h
··· 78 78 #define AT91SAM9260_BASE_ADC 0xfffe0000 79 79 80 80 /* 81 - * System Peripherals (offset from AT91_BASE_SYS) 81 + * System Peripherals 82 82 */ 83 - #define AT91_SDRAMC0 (0xffffea00 - AT91_BASE_SYS) 84 - #define AT91_MATRIX (0xffffee00 - AT91_BASE_SYS) 85 - #define AT91_PMC (0xfffffc00 - AT91_BASE_SYS) 86 - #define AT91_GPBR (0xfffffd50 - AT91_BASE_SYS) 87 - 88 83 #define AT91SAM9260_BASE_ECC 0xffffe800 84 + #define AT91SAM9260_BASE_SDRAMC 0xffffea00 89 85 #define AT91SAM9260_BASE_SMC 0xffffec00 86 + #define AT91SAM9260_BASE_MATRIX 0xffffee00 90 87 #define AT91SAM9260_BASE_DBGU AT91_BASE_DBGU0 91 88 #define AT91SAM9260_BASE_PIOA 0xfffff400 92 89 #define AT91SAM9260_BASE_PIOB 0xfffff600 ··· 93 96 #define AT91SAM9260_BASE_RTT 0xfffffd20 94 97 #define AT91SAM9260_BASE_PIT 0xfffffd30 95 98 #define AT91SAM9260_BASE_WDT 0xfffffd40 99 + #define AT91SAM9260_BASE_GPBR 0xfffffd50 96 100 97 101 #define AT91_USART0 AT91SAM9260_BASE_US0 98 102 #define AT91_USART1 AT91SAM9260_BASE_US1 ··· 113 115 #define AT91SAM9260_SRAM0_SIZE SZ_4K /* Internal SRAM 0 size (4Kb) */ 114 116 #define AT91SAM9260_SRAM1_BASE 0x00300000 /* Internal SRAM 1 base address */ 115 117 #define AT91SAM9260_SRAM1_SIZE SZ_4K /* Internal SRAM 1 size (4Kb) */ 118 + #define AT91SAM9260_SRAM_BASE 0x002FF000 /* Internal SRAM base address */ 119 + #define AT91SAM9260_SRAM_SIZE SZ_8K /* Internal SRAM size (8Kb) */ 116 120 117 121 #define AT91SAM9260_UHP_BASE 0x00500000 /* USB Host controller */ 118 122 ··· 128 128 #define AT91SAM9G20_SRAM0_SIZE SZ_16K /* Internal SRAM 0 size (16Kb) */ 129 129 #define AT91SAM9G20_SRAM1_BASE 0x00300000 /* Internal SRAM 1 base address */ 130 130 #define AT91SAM9G20_SRAM1_SIZE SZ_16K /* Internal SRAM 1 size (16Kb) */ 131 + #define AT91SAM9G20_SRAM_BASE 0x002FC000 /* Internal SRAM base address */ 132 + #define AT91SAM9G20_SRAM_SIZE SZ_32K /* Internal SRAM size (32Kb) */ 131 133 132 134 #define AT91SAM9G20_UHP_BASE 0x00500000 /* USB Host controller */ 133 135
+18 -18
arch/arm/mach-at91/include/mach/at91sam9260_matrix.h
··· 15 15 #ifndef AT91SAM9260_MATRIX_H 16 16 #define AT91SAM9260_MATRIX_H 17 17 18 - #define AT91_MATRIX_MCFG0 (AT91_MATRIX + 0x00) /* Master Configuration Register 0 */ 19 - #define AT91_MATRIX_MCFG1 (AT91_MATRIX + 0x04) /* Master Configuration Register 1 */ 20 - #define AT91_MATRIX_MCFG2 (AT91_MATRIX + 0x08) /* Master Configuration Register 2 */ 21 - #define AT91_MATRIX_MCFG3 (AT91_MATRIX + 0x0C) /* Master Configuration Register 3 */ 22 - #define AT91_MATRIX_MCFG4 (AT91_MATRIX + 0x10) /* Master Configuration Register 4 */ 23 - #define AT91_MATRIX_MCFG5 (AT91_MATRIX + 0x14) /* Master Configuration Register 5 */ 18 + #define AT91_MATRIX_MCFG0 0x00 /* Master Configuration Register 0 */ 19 + #define AT91_MATRIX_MCFG1 0x04 /* Master Configuration Register 1 */ 20 + #define AT91_MATRIX_MCFG2 0x08 /* Master Configuration Register 2 */ 21 + #define AT91_MATRIX_MCFG3 0x0C /* Master Configuration Register 3 */ 22 + #define AT91_MATRIX_MCFG4 0x10 /* Master Configuration Register 4 */ 23 + #define AT91_MATRIX_MCFG5 0x14 /* Master Configuration Register 5 */ 24 24 #define AT91_MATRIX_ULBT (7 << 0) /* Undefined Length Burst Type */ 25 25 #define AT91_MATRIX_ULBT_INFINITE (0 << 0) 26 26 #define AT91_MATRIX_ULBT_SINGLE (1 << 0) ··· 28 28 #define AT91_MATRIX_ULBT_EIGHT (3 << 0) 29 29 #define AT91_MATRIX_ULBT_SIXTEEN (4 << 0) 30 30 31 - #define AT91_MATRIX_SCFG0 (AT91_MATRIX + 0x40) /* Slave Configuration Register 0 */ 32 - #define AT91_MATRIX_SCFG1 (AT91_MATRIX + 0x44) /* Slave Configuration Register 1 */ 33 - #define AT91_MATRIX_SCFG2 (AT91_MATRIX + 0x48) /* Slave Configuration Register 2 */ 34 - #define AT91_MATRIX_SCFG3 (AT91_MATRIX + 0x4C) /* Slave Configuration Register 3 */ 35 - #define AT91_MATRIX_SCFG4 (AT91_MATRIX + 0x50) /* Slave Configuration Register 4 */ 31 + #define AT91_MATRIX_SCFG0 0x40 /* Slave Configuration Register 0 */ 32 + #define AT91_MATRIX_SCFG1 0x44 /* Slave Configuration Register 1 */ 33 + #define AT91_MATRIX_SCFG2 0x48 /* Slave Configuration Register 2 */ 34 + #define AT91_MATRIX_SCFG3 0x4C /* Slave Configuration Register 3 */ 35 + #define AT91_MATRIX_SCFG4 0x50 /* Slave Configuration Register 4 */ 36 36 #define AT91_MATRIX_SLOT_CYCLE (0xff << 0) /* Maximum Number of Allowed Cycles for a Burst */ 37 37 #define AT91_MATRIX_DEFMSTR_TYPE (3 << 16) /* Default Master Type */ 38 38 #define AT91_MATRIX_DEFMSTR_TYPE_NONE (0 << 16) ··· 43 43 #define AT91_MATRIX_ARBT_ROUND_ROBIN (0 << 24) 44 44 #define AT91_MATRIX_ARBT_FIXED_PRIORITY (1 << 24) 45 45 46 - #define AT91_MATRIX_PRAS0 (AT91_MATRIX + 0x80) /* Priority Register A for Slave 0 */ 47 - #define AT91_MATRIX_PRAS1 (AT91_MATRIX + 0x88) /* Priority Register A for Slave 1 */ 48 - #define AT91_MATRIX_PRAS2 (AT91_MATRIX + 0x90) /* Priority Register A for Slave 2 */ 49 - #define AT91_MATRIX_PRAS3 (AT91_MATRIX + 0x98) /* Priority Register A for Slave 3 */ 50 - #define AT91_MATRIX_PRAS4 (AT91_MATRIX + 0xA0) /* Priority Register A for Slave 4 */ 46 + #define AT91_MATRIX_PRAS0 0x80 /* Priority Register A for Slave 0 */ 47 + #define AT91_MATRIX_PRAS1 0x88 /* Priority Register A for Slave 1 */ 48 + #define AT91_MATRIX_PRAS2 0x90 /* Priority Register A for Slave 2 */ 49 + #define AT91_MATRIX_PRAS3 0x98 /* Priority Register A for Slave 3 */ 50 + #define AT91_MATRIX_PRAS4 0xA0 /* Priority Register A for Slave 4 */ 51 51 #define AT91_MATRIX_M0PR (3 << 0) /* Master 0 Priority */ 52 52 #define AT91_MATRIX_M1PR (3 << 4) /* Master 1 Priority */ 53 53 #define AT91_MATRIX_M2PR (3 << 8) /* Master 2 Priority */ ··· 55 55 #define AT91_MATRIX_M4PR (3 << 16) /* Master 4 Priority */ 56 56 #define AT91_MATRIX_M5PR (3 << 20) /* Master 5 Priority */ 57 57 58 - #define AT91_MATRIX_MRCR (AT91_MATRIX + 0x100) /* Master Remap Control Register */ 58 + #define AT91_MATRIX_MRCR 0x100 /* Master Remap Control Register */ 59 59 #define AT91_MATRIX_RCB0 (1 << 0) /* Remap Command for AHB Master 0 (ARM926EJ-S Instruction Master) */ 60 60 #define AT91_MATRIX_RCB1 (1 << 1) /* Remap Command for AHB Master 1 (ARM926EJ-S Data Master) */ 61 61 62 - #define AT91_MATRIX_EBICSA (AT91_MATRIX + 0x11C) /* EBI Chip Select Assignment Register */ 62 + #define AT91_MATRIX_EBICSA 0x11C /* EBI Chip Select Assignment Register */ 63 63 #define AT91_MATRIX_CS1A (1 << 1) /* Chip Select 1 Assignment */ 64 64 #define AT91_MATRIX_CS1A_SMC (0 << 1) 65 65 #define AT91_MATRIX_CS1A_SDRAMC (1 << 1)
+4 -6
arch/arm/mach-at91/include/mach/at91sam9261.h
··· 63 63 64 64 65 65 /* 66 - * System Peripherals (offset from AT91_BASE_SYS) 66 + * System Peripherals 67 67 */ 68 - #define AT91_SDRAMC0 (0xffffea00 - AT91_BASE_SYS) 69 - #define AT91_MATRIX (0xffffee00 - AT91_BASE_SYS) 70 - #define AT91_PMC (0xfffffc00 - AT91_BASE_SYS) 71 - #define AT91_GPBR (0xfffffd50 - AT91_BASE_SYS) 72 - 73 68 #define AT91SAM9261_BASE_SMC 0xffffec00 69 + #define AT91SAM9261_BASE_MATRIX 0xffffee00 70 + #define AT91SAM9261_BASE_SDRAMC 0xffffea00 74 71 #define AT91SAM9261_BASE_DBGU AT91_BASE_DBGU0 75 72 #define AT91SAM9261_BASE_PIOA 0xfffff400 76 73 #define AT91SAM9261_BASE_PIOB 0xfffff600 ··· 77 80 #define AT91SAM9261_BASE_RTT 0xfffffd20 78 81 #define AT91SAM9261_BASE_PIT 0xfffffd30 79 82 #define AT91SAM9261_BASE_WDT 0xfffffd40 83 + #define AT91SAM9261_BASE_GPBR 0xfffffd50 80 84 81 85 #define AT91_USART0 AT91SAM9261_BASE_US0 82 86 #define AT91_USART1 AT91SAM9261_BASE_US1
+9 -9
arch/arm/mach-at91/include/mach/at91sam9261_matrix.h
··· 15 15 #ifndef AT91SAM9261_MATRIX_H 16 16 #define AT91SAM9261_MATRIX_H 17 17 18 - #define AT91_MATRIX_MCFG (AT91_MATRIX + 0x00) /* Master Configuration Register */ 18 + #define AT91_MATRIX_MCFG 0x00 /* Master Configuration Register */ 19 19 #define AT91_MATRIX_RCB0 (1 << 0) /* Remap Command for AHB Master 0 (ARM926EJ-S Instruction Master) */ 20 20 #define AT91_MATRIX_RCB1 (1 << 1) /* Remap Command for AHB Master 1 (ARM926EJ-S Data Master) */ 21 21 22 - #define AT91_MATRIX_SCFG0 (AT91_MATRIX + 0x04) /* Slave Configuration Register 0 */ 23 - #define AT91_MATRIX_SCFG1 (AT91_MATRIX + 0x08) /* Slave Configuration Register 1 */ 24 - #define AT91_MATRIX_SCFG2 (AT91_MATRIX + 0x0C) /* Slave Configuration Register 2 */ 25 - #define AT91_MATRIX_SCFG3 (AT91_MATRIX + 0x10) /* Slave Configuration Register 3 */ 26 - #define AT91_MATRIX_SCFG4 (AT91_MATRIX + 0x14) /* Slave Configuration Register 4 */ 22 + #define AT91_MATRIX_SCFG0 0x04 /* Slave Configuration Register 0 */ 23 + #define AT91_MATRIX_SCFG1 0x08 /* Slave Configuration Register 1 */ 24 + #define AT91_MATRIX_SCFG2 0x0C /* Slave Configuration Register 2 */ 25 + #define AT91_MATRIX_SCFG3 0x10 /* Slave Configuration Register 3 */ 26 + #define AT91_MATRIX_SCFG4 0x14 /* Slave Configuration Register 4 */ 27 27 #define AT91_MATRIX_SLOT_CYCLE (0xff << 0) /* Maximum Number of Allowed Cycles for a Burst */ 28 28 #define AT91_MATRIX_DEFMSTR_TYPE (3 << 16) /* Default Master Type */ 29 29 #define AT91_MATRIX_DEFMSTR_TYPE_NONE (0 << 16) ··· 31 31 #define AT91_MATRIX_DEFMSTR_TYPE_FIXED (2 << 16) 32 32 #define AT91_MATRIX_FIXED_DEFMSTR (7 << 18) /* Fixed Index of Default Master */ 33 33 34 - #define AT91_MATRIX_TCR (AT91_MATRIX + 0x24) /* TCM Configuration Register */ 34 + #define AT91_MATRIX_TCR 0x24 /* TCM Configuration Register */ 35 35 #define AT91_MATRIX_ITCM_SIZE (0xf << 0) /* Size of ITCM enabled memory block */ 36 36 #define AT91_MATRIX_ITCM_0 (0 << 0) 37 37 #define AT91_MATRIX_ITCM_16 (5 << 0) ··· 43 43 #define AT91_MATRIX_DTCM_32 (6 << 4) 44 44 #define AT91_MATRIX_DTCM_64 (7 << 4) 45 45 46 - #define AT91_MATRIX_EBICSA (AT91_MATRIX + 0x30) /* EBI Chip Select Assignment Register */ 46 + #define AT91_MATRIX_EBICSA 0x30 /* EBI Chip Select Assignment Register */ 47 47 #define AT91_MATRIX_CS1A (1 << 1) /* Chip Select 1 Assignment */ 48 48 #define AT91_MATRIX_CS1A_SMC (0 << 1) 49 49 #define AT91_MATRIX_CS1A_SDRAMC (1 << 1) ··· 58 58 #define AT91_MATRIX_CS5A_SMC_CF2 (1 << 5) 59 59 #define AT91_MATRIX_DBPUC (1 << 8) /* Data Bus Pull-up Configuration */ 60 60 61 - #define AT91_MATRIX_USBPUCR (AT91_MATRIX + 0x34) /* USB Pad Pull-Up Control Register */ 61 + #define AT91_MATRIX_USBPUCR 0x34 /* USB Pad Pull-Up Control Register */ 62 62 #define AT91_MATRIX_USBPUCR_PUON (1 << 30) /* USB Device PAD Pull-up Enable */ 63 63 64 64 #endif
+5 -7
arch/arm/mach-at91/include/mach/at91sam9263.h
··· 72 72 #define AT91SAM9263_BASE_2DGE 0xfffc8000 73 73 74 74 /* 75 - * System Peripherals (offset from AT91_BASE_SYS) 75 + * System Peripherals 76 76 */ 77 - #define AT91_SDRAMC0 (0xffffe200 - AT91_BASE_SYS) 78 - #define AT91_SDRAMC1 (0xffffe800 - AT91_BASE_SYS) 79 - #define AT91_MATRIX (0xffffec00 - AT91_BASE_SYS) 80 - #define AT91_PMC (0xfffffc00 - AT91_BASE_SYS) 81 - #define AT91_GPBR (0xfffffd60 - AT91_BASE_SYS) 82 - 83 77 #define AT91SAM9263_BASE_ECC0 0xffffe000 78 + #define AT91SAM9263_BASE_SDRAMC0 0xffffe200 84 79 #define AT91SAM9263_BASE_SMC0 0xffffe400 85 80 #define AT91SAM9263_BASE_ECC1 0xffffe600 81 + #define AT91SAM9263_BASE_SDRAMC1 0xffffe800 86 82 #define AT91SAM9263_BASE_SMC1 0xffffea00 83 + #define AT91SAM9263_BASE_MATRIX 0xffffec00 87 84 #define AT91SAM9263_BASE_DBGU AT91_BASE_DBGU1 88 85 #define AT91SAM9263_BASE_PIOA 0xfffff200 89 86 #define AT91SAM9263_BASE_PIOB 0xfffff400 ··· 93 96 #define AT91SAM9263_BASE_PIT 0xfffffd30 94 97 #define AT91SAM9263_BASE_WDT 0xfffffd40 95 98 #define AT91SAM9263_BASE_RTT1 0xfffffd50 99 + #define AT91SAM9263_BASE_GPBR 0xfffffd60 96 100 97 101 #define AT91_USART0 AT91SAM9263_BASE_US0 98 102 #define AT91_USART1 AT91SAM9263_BASE_US1
+37 -37
arch/arm/mach-at91/include/mach/at91sam9263_matrix.h
··· 15 15 #ifndef AT91SAM9263_MATRIX_H 16 16 #define AT91SAM9263_MATRIX_H 17 17 18 - #define AT91_MATRIX_MCFG0 (AT91_MATRIX + 0x00) /* Master Configuration Register 0 */ 19 - #define AT91_MATRIX_MCFG1 (AT91_MATRIX + 0x04) /* Master Configuration Register 1 */ 20 - #define AT91_MATRIX_MCFG2 (AT91_MATRIX + 0x08) /* Master Configuration Register 2 */ 21 - #define AT91_MATRIX_MCFG3 (AT91_MATRIX + 0x0C) /* Master Configuration Register 3 */ 22 - #define AT91_MATRIX_MCFG4 (AT91_MATRIX + 0x10) /* Master Configuration Register 4 */ 23 - #define AT91_MATRIX_MCFG5 (AT91_MATRIX + 0x14) /* Master Configuration Register 5 */ 24 - #define AT91_MATRIX_MCFG6 (AT91_MATRIX + 0x18) /* Master Configuration Register 6 */ 25 - #define AT91_MATRIX_MCFG7 (AT91_MATRIX + 0x1C) /* Master Configuration Register 7 */ 26 - #define AT91_MATRIX_MCFG8 (AT91_MATRIX + 0x20) /* Master Configuration Register 8 */ 18 + #define AT91_MATRIX_MCFG0 0x00 /* Master Configuration Register 0 */ 19 + #define AT91_MATRIX_MCFG1 0x04 /* Master Configuration Register 1 */ 20 + #define AT91_MATRIX_MCFG2 0x08 /* Master Configuration Register 2 */ 21 + #define AT91_MATRIX_MCFG3 0x0C /* Master Configuration Register 3 */ 22 + #define AT91_MATRIX_MCFG4 0x10 /* Master Configuration Register 4 */ 23 + #define AT91_MATRIX_MCFG5 0x14 /* Master Configuration Register 5 */ 24 + #define AT91_MATRIX_MCFG6 0x18 /* Master Configuration Register 6 */ 25 + #define AT91_MATRIX_MCFG7 0x1C /* Master Configuration Register 7 */ 26 + #define AT91_MATRIX_MCFG8 0x20 /* Master Configuration Register 8 */ 27 27 #define AT91_MATRIX_ULBT (7 << 0) /* Undefined Length Burst Type */ 28 28 #define AT91_MATRIX_ULBT_INFINITE (0 << 0) 29 29 #define AT91_MATRIX_ULBT_SINGLE (1 << 0) ··· 31 31 #define AT91_MATRIX_ULBT_EIGHT (3 << 0) 32 32 #define AT91_MATRIX_ULBT_SIXTEEN (4 << 0) 33 33 34 - #define AT91_MATRIX_SCFG0 (AT91_MATRIX + 0x40) /* Slave Configuration Register 0 */ 35 - #define AT91_MATRIX_SCFG1 (AT91_MATRIX + 0x44) /* Slave Configuration Register 1 */ 36 - #define AT91_MATRIX_SCFG2 (AT91_MATRIX + 0x48) /* Slave Configuration Register 2 */ 37 - #define AT91_MATRIX_SCFG3 (AT91_MATRIX + 0x4C) /* Slave Configuration Register 3 */ 38 - #define AT91_MATRIX_SCFG4 (AT91_MATRIX + 0x50) /* Slave Configuration Register 4 */ 39 - #define AT91_MATRIX_SCFG5 (AT91_MATRIX + 0x54) /* Slave Configuration Register 5 */ 40 - #define AT91_MATRIX_SCFG6 (AT91_MATRIX + 0x58) /* Slave Configuration Register 6 */ 41 - #define AT91_MATRIX_SCFG7 (AT91_MATRIX + 0x5C) /* Slave Configuration Register 7 */ 34 + #define AT91_MATRIX_SCFG0 0x40 /* Slave Configuration Register 0 */ 35 + #define AT91_MATRIX_SCFG1 0x44 /* Slave Configuration Register 1 */ 36 + #define AT91_MATRIX_SCFG2 0x48 /* Slave Configuration Register 2 */ 37 + #define AT91_MATRIX_SCFG3 0x4C /* Slave Configuration Register 3 */ 38 + #define AT91_MATRIX_SCFG4 0x50 /* Slave Configuration Register 4 */ 39 + #define AT91_MATRIX_SCFG5 0x54 /* Slave Configuration Register 5 */ 40 + #define AT91_MATRIX_SCFG6 0x58 /* Slave Configuration Register 6 */ 41 + #define AT91_MATRIX_SCFG7 0x5C /* Slave Configuration Register 7 */ 42 42 #define AT91_MATRIX_SLOT_CYCLE (0xff << 0) /* Maximum Number of Allowed Cycles for a Burst */ 43 43 #define AT91_MATRIX_DEFMSTR_TYPE (3 << 16) /* Default Master Type */ 44 44 #define AT91_MATRIX_DEFMSTR_TYPE_NONE (0 << 16) ··· 49 49 #define AT91_MATRIX_ARBT_ROUND_ROBIN (0 << 24) 50 50 #define AT91_MATRIX_ARBT_FIXED_PRIORITY (1 << 24) 51 51 52 - #define AT91_MATRIX_PRAS0 (AT91_MATRIX + 0x80) /* Priority Register A for Slave 0 */ 53 - #define AT91_MATRIX_PRBS0 (AT91_MATRIX + 0x84) /* Priority Register B for Slave 0 */ 54 - #define AT91_MATRIX_PRAS1 (AT91_MATRIX + 0x88) /* Priority Register A for Slave 1 */ 55 - #define AT91_MATRIX_PRBS1 (AT91_MATRIX + 0x8C) /* Priority Register B for Slave 1 */ 56 - #define AT91_MATRIX_PRAS2 (AT91_MATRIX + 0x90) /* Priority Register A for Slave 2 */ 57 - #define AT91_MATRIX_PRBS2 (AT91_MATRIX + 0x94) /* Priority Register B for Slave 2 */ 58 - #define AT91_MATRIX_PRAS3 (AT91_MATRIX + 0x98) /* Priority Register A for Slave 3 */ 59 - #define AT91_MATRIX_PRBS3 (AT91_MATRIX + 0x9C) /* Priority Register B for Slave 3 */ 60 - #define AT91_MATRIX_PRAS4 (AT91_MATRIX + 0xA0) /* Priority Register A for Slave 4 */ 61 - #define AT91_MATRIX_PRBS4 (AT91_MATRIX + 0xA4) /* Priority Register B for Slave 4 */ 62 - #define AT91_MATRIX_PRAS5 (AT91_MATRIX + 0xA8) /* Priority Register A for Slave 5 */ 63 - #define AT91_MATRIX_PRBS5 (AT91_MATRIX + 0xAC) /* Priority Register B for Slave 5 */ 64 - #define AT91_MATRIX_PRAS6 (AT91_MATRIX + 0xB0) /* Priority Register A for Slave 6 */ 65 - #define AT91_MATRIX_PRBS6 (AT91_MATRIX + 0xB4) /* Priority Register B for Slave 6 */ 66 - #define AT91_MATRIX_PRAS7 (AT91_MATRIX + 0xB8) /* Priority Register A for Slave 7 */ 67 - #define AT91_MATRIX_PRBS7 (AT91_MATRIX + 0xBC) /* Priority Register B for Slave 7 */ 52 + #define AT91_MATRIX_PRAS0 0x80 /* Priority Register A for Slave 0 */ 53 + #define AT91_MATRIX_PRBS0 0x84 /* Priority Register B for Slave 0 */ 54 + #define AT91_MATRIX_PRAS1 0x88 /* Priority Register A for Slave 1 */ 55 + #define AT91_MATRIX_PRBS1 0x8C /* Priority Register B for Slave 1 */ 56 + #define AT91_MATRIX_PRAS2 0x90 /* Priority Register A for Slave 2 */ 57 + #define AT91_MATRIX_PRBS2 0x94 /* Priority Register B for Slave 2 */ 58 + #define AT91_MATRIX_PRAS3 0x98 /* Priority Register A for Slave 3 */ 59 + #define AT91_MATRIX_PRBS3 0x9C /* Priority Register B for Slave 3 */ 60 + #define AT91_MATRIX_PRAS4 0xA0 /* Priority Register A for Slave 4 */ 61 + #define AT91_MATRIX_PRBS4 0xA4 /* Priority Register B for Slave 4 */ 62 + #define AT91_MATRIX_PRAS5 0xA8 /* Priority Register A for Slave 5 */ 63 + #define AT91_MATRIX_PRBS5 0xAC /* Priority Register B for Slave 5 */ 64 + #define AT91_MATRIX_PRAS6 0xB0 /* Priority Register A for Slave 6 */ 65 + #define AT91_MATRIX_PRBS6 0xB4 /* Priority Register B for Slave 6 */ 66 + #define AT91_MATRIX_PRAS7 0xB8 /* Priority Register A for Slave 7 */ 67 + #define AT91_MATRIX_PRBS7 0xBC /* Priority Register B for Slave 7 */ 68 68 #define AT91_MATRIX_M0PR (3 << 0) /* Master 0 Priority */ 69 69 #define AT91_MATRIX_M1PR (3 << 4) /* Master 1 Priority */ 70 70 #define AT91_MATRIX_M2PR (3 << 8) /* Master 2 Priority */ ··· 75 75 #define AT91_MATRIX_M7PR (3 << 28) /* Master 7 Priority */ 76 76 #define AT91_MATRIX_M8PR (3 << 0) /* Master 8 Priority (in Register B) */ 77 77 78 - #define AT91_MATRIX_MRCR (AT91_MATRIX + 0x100) /* Master Remap Control Register */ 78 + #define AT91_MATRIX_MRCR 0x100 /* Master Remap Control Register */ 79 79 #define AT91_MATRIX_RCB0 (1 << 0) /* Remap Command for AHB Master 0 (ARM926EJ-S Instruction Master) */ 80 80 #define AT91_MATRIX_RCB1 (1 << 1) /* Remap Command for AHB Master 1 (ARM926EJ-S Data Master) */ 81 81 #define AT91_MATRIX_RCB2 (1 << 2) ··· 86 86 #define AT91_MATRIX_RCB7 (1 << 7) 87 87 #define AT91_MATRIX_RCB8 (1 << 8) 88 88 89 - #define AT91_MATRIX_TCMR (AT91_MATRIX + 0x114) /* TCM Configuration Register */ 89 + #define AT91_MATRIX_TCMR 0x114 /* TCM Configuration Register */ 90 90 #define AT91_MATRIX_ITCM_SIZE (0xf << 0) /* Size of ITCM enabled memory block */ 91 91 #define AT91_MATRIX_ITCM_0 (0 << 0) 92 92 #define AT91_MATRIX_ITCM_16 (5 << 0) ··· 96 96 #define AT91_MATRIX_DTCM_16 (5 << 4) 97 97 #define AT91_MATRIX_DTCM_32 (6 << 4) 98 98 99 - #define AT91_MATRIX_EBI0CSA (AT91_MATRIX + 0x120) /* EBI0 Chip Select Assignment Register */ 99 + #define AT91_MATRIX_EBI0CSA 0x120 /* EBI0 Chip Select Assignment Register */ 100 100 #define AT91_MATRIX_EBI0_CS1A (1 << 1) /* Chip Select 1 Assignment */ 101 101 #define AT91_MATRIX_EBI0_CS1A_SMC (0 << 1) 102 102 #define AT91_MATRIX_EBI0_CS1A_SDRAMC (1 << 1) ··· 114 114 #define AT91_MATRIX_EBI0_VDDIOMSEL_1_8V (0 << 16) 115 115 #define AT91_MATRIX_EBI0_VDDIOMSEL_3_3V (1 << 16) 116 116 117 - #define AT91_MATRIX_EBI1CSA (AT91_MATRIX + 0x124) /* EBI1 Chip Select Assignment Register */ 117 + #define AT91_MATRIX_EBI1CSA 0x124 /* EBI1 Chip Select Assignment Register */ 118 118 #define AT91_MATRIX_EBI1_CS1A (1 << 1) /* Chip Select 1 Assignment */ 119 119 #define AT91_MATRIX_EBI1_CS1A_SMC (0 << 1) 120 120 #define AT91_MATRIX_EBI1_CS1A_SDRAMC (1 << 1)
-6
arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h
··· 121 121 #define AT91_DDRSDRC_WPVS (1 << 0) /* Write protect violation status */ 122 122 #define AT91_DDRSDRC_WPVSRC (0xffff << 8) /* Write protect violation source */ 123 123 124 - /* Register access macros */ 125 - #define at91_ramc_read(num, reg) \ 126 - at91_sys_read(AT91_DDRSDRC##num + reg) 127 - #define at91_ramc_write(num, reg, value) \ 128 - at91_sys_write(AT91_DDRSDRC##num + reg, value) 129 - 130 124 #endif
-6
arch/arm/mach-at91/include/mach/at91sam9_sdramc.h
··· 82 82 #define AT91_SDRAMC_MD_SDRAM 0 83 83 #define AT91_SDRAMC_MD_LOW_POWER_SDRAM 1 84 84 85 - /* Register access macros */ 86 - #define at91_ramc_read(num, reg) \ 87 - at91_sys_read(AT91_SDRAMC##num + reg) 88 - #define at91_ramc_write(num, reg, value) \ 89 - at91_sys_write(AT91_SDRAMC##num + reg, value) 90 - 91 85 #endif
+5 -7
arch/arm/mach-at91/include/mach/at91sam9g45.h
··· 84 84 #define AT91SAM9G45_BASE_TC5 0xfffd4080 85 85 86 86 /* 87 - * System Peripherals (offset from AT91_BASE_SYS) 87 + * System Peripherals 88 88 */ 89 - #define AT91_DDRSDRC1 (0xffffe400 - AT91_BASE_SYS) 90 - #define AT91_DDRSDRC0 (0xffffe600 - AT91_BASE_SYS) 91 - #define AT91_MATRIX (0xffffea00 - AT91_BASE_SYS) 92 - #define AT91_PMC (0xfffffc00 - AT91_BASE_SYS) 93 - #define AT91_GPBR (0xfffffd60 - AT91_BASE_SYS) 94 - 95 89 #define AT91SAM9G45_BASE_ECC 0xffffe200 90 + #define AT91SAM9G45_BASE_DDRSDRC1 0xffffe400 91 + #define AT91SAM9G45_BASE_DDRSDRC0 0xffffe600 96 92 #define AT91SAM9G45_BASE_DMA 0xffffec00 97 93 #define AT91SAM9G45_BASE_SMC 0xffffe800 94 + #define AT91SAM9G45_BASE_MATRIX 0xffffea00 98 95 #define AT91SAM9G45_BASE_DBGU AT91_BASE_DBGU1 99 96 #define AT91SAM9G45_BASE_PIOA 0xfffff200 100 97 #define AT91SAM9G45_BASE_PIOB 0xfffff400 ··· 104 107 #define AT91SAM9G45_BASE_PIT 0xfffffd30 105 108 #define AT91SAM9G45_BASE_WDT 0xfffffd40 106 109 #define AT91SAM9G45_BASE_RTC 0xfffffdb0 110 + #define AT91SAM9G45_BASE_GPBR 0xfffffd60 107 111 108 112 #define AT91_USART0 AT91SAM9G45_BASE_US0 109 113 #define AT91_USART1 AT91SAM9G45_BASE_US1
+42 -42
arch/arm/mach-at91/include/mach/at91sam9g45_matrix.h
··· 15 15 #ifndef AT91SAM9G45_MATRIX_H 16 16 #define AT91SAM9G45_MATRIX_H 17 17 18 - #define AT91_MATRIX_MCFG0 (AT91_MATRIX + 0x00) /* Master Configuration Register 0 */ 19 - #define AT91_MATRIX_MCFG1 (AT91_MATRIX + 0x04) /* Master Configuration Register 1 */ 20 - #define AT91_MATRIX_MCFG2 (AT91_MATRIX + 0x08) /* Master Configuration Register 2 */ 21 - #define AT91_MATRIX_MCFG3 (AT91_MATRIX + 0x0C) /* Master Configuration Register 3 */ 22 - #define AT91_MATRIX_MCFG4 (AT91_MATRIX + 0x10) /* Master Configuration Register 4 */ 23 - #define AT91_MATRIX_MCFG5 (AT91_MATRIX + 0x14) /* Master Configuration Register 5 */ 24 - #define AT91_MATRIX_MCFG6 (AT91_MATRIX + 0x18) /* Master Configuration Register 6 */ 25 - #define AT91_MATRIX_MCFG7 (AT91_MATRIX + 0x1C) /* Master Configuration Register 7 */ 26 - #define AT91_MATRIX_MCFG8 (AT91_MATRIX + 0x20) /* Master Configuration Register 8 */ 27 - #define AT91_MATRIX_MCFG9 (AT91_MATRIX + 0x24) /* Master Configuration Register 9 */ 28 - #define AT91_MATRIX_MCFG10 (AT91_MATRIX + 0x28) /* Master Configuration Register 10 */ 29 - #define AT91_MATRIX_MCFG11 (AT91_MATRIX + 0x2C) /* Master Configuration Register 11 */ 18 + #define AT91_MATRIX_MCFG0 0x00 /* Master Configuration Register 0 */ 19 + #define AT91_MATRIX_MCFG1 0x04 /* Master Configuration Register 1 */ 20 + #define AT91_MATRIX_MCFG2 0x08 /* Master Configuration Register 2 */ 21 + #define AT91_MATRIX_MCFG3 0x0C /* Master Configuration Register 3 */ 22 + #define AT91_MATRIX_MCFG4 0x10 /* Master Configuration Register 4 */ 23 + #define AT91_MATRIX_MCFG5 0x14 /* Master Configuration Register 5 */ 24 + #define AT91_MATRIX_MCFG6 0x18 /* Master Configuration Register 6 */ 25 + #define AT91_MATRIX_MCFG7 0x1C /* Master Configuration Register 7 */ 26 + #define AT91_MATRIX_MCFG8 0x20 /* Master Configuration Register 8 */ 27 + #define AT91_MATRIX_MCFG9 0x24 /* Master Configuration Register 9 */ 28 + #define AT91_MATRIX_MCFG10 0x28 /* Master Configuration Register 10 */ 29 + #define AT91_MATRIX_MCFG11 0x2C /* Master Configuration Register 11 */ 30 30 #define AT91_MATRIX_ULBT (7 << 0) /* Undefined Length Burst Type */ 31 31 #define AT91_MATRIX_ULBT_INFINITE (0 << 0) 32 32 #define AT91_MATRIX_ULBT_SINGLE (1 << 0) ··· 37 37 #define AT91_MATRIX_ULBT_SIXTYFOUR (6 << 0) 38 38 #define AT91_MATRIX_ULBT_128 (7 << 0) 39 39 40 - #define AT91_MATRIX_SCFG0 (AT91_MATRIX + 0x40) /* Slave Configuration Register 0 */ 41 - #define AT91_MATRIX_SCFG1 (AT91_MATRIX + 0x44) /* Slave Configuration Register 1 */ 42 - #define AT91_MATRIX_SCFG2 (AT91_MATRIX + 0x48) /* Slave Configuration Register 2 */ 43 - #define AT91_MATRIX_SCFG3 (AT91_MATRIX + 0x4C) /* Slave Configuration Register 3 */ 44 - #define AT91_MATRIX_SCFG4 (AT91_MATRIX + 0x50) /* Slave Configuration Register 4 */ 45 - #define AT91_MATRIX_SCFG5 (AT91_MATRIX + 0x54) /* Slave Configuration Register 5 */ 46 - #define AT91_MATRIX_SCFG6 (AT91_MATRIX + 0x58) /* Slave Configuration Register 6 */ 47 - #define AT91_MATRIX_SCFG7 (AT91_MATRIX + 0x5C) /* Slave Configuration Register 7 */ 40 + #define AT91_MATRIX_SCFG0 0x40 /* Slave Configuration Register 0 */ 41 + #define AT91_MATRIX_SCFG1 0x44 /* Slave Configuration Register 1 */ 42 + #define AT91_MATRIX_SCFG2 0x48 /* Slave Configuration Register 2 */ 43 + #define AT91_MATRIX_SCFG3 0x4C /* Slave Configuration Register 3 */ 44 + #define AT91_MATRIX_SCFG4 0x50 /* Slave Configuration Register 4 */ 45 + #define AT91_MATRIX_SCFG5 0x54 /* Slave Configuration Register 5 */ 46 + #define AT91_MATRIX_SCFG6 0x58 /* Slave Configuration Register 6 */ 47 + #define AT91_MATRIX_SCFG7 0x5C /* Slave Configuration Register 7 */ 48 48 #define AT91_MATRIX_SLOT_CYCLE (0x1ff << 0) /* Maximum Number of Allowed Cycles for a Burst */ 49 49 #define AT91_MATRIX_DEFMSTR_TYPE (3 << 16) /* Default Master Type */ 50 50 #define AT91_MATRIX_DEFMSTR_TYPE_NONE (0 << 16) ··· 52 52 #define AT91_MATRIX_DEFMSTR_TYPE_FIXED (2 << 16) 53 53 #define AT91_MATRIX_FIXED_DEFMSTR (0xf << 18) /* Fixed Index of Default Master */ 54 54 55 - #define AT91_MATRIX_PRAS0 (AT91_MATRIX + 0x80) /* Priority Register A for Slave 0 */ 56 - #define AT91_MATRIX_PRBS0 (AT91_MATRIX + 0x84) /* Priority Register B for Slave 0 */ 57 - #define AT91_MATRIX_PRAS1 (AT91_MATRIX + 0x88) /* Priority Register A for Slave 1 */ 58 - #define AT91_MATRIX_PRBS1 (AT91_MATRIX + 0x8C) /* Priority Register B for Slave 1 */ 59 - #define AT91_MATRIX_PRAS2 (AT91_MATRIX + 0x90) /* Priority Register A for Slave 2 */ 60 - #define AT91_MATRIX_PRBS2 (AT91_MATRIX + 0x94) /* Priority Register B for Slave 2 */ 61 - #define AT91_MATRIX_PRAS3 (AT91_MATRIX + 0x98) /* Priority Register A for Slave 3 */ 62 - #define AT91_MATRIX_PRBS3 (AT91_MATRIX + 0x9C) /* Priority Register B for Slave 3 */ 63 - #define AT91_MATRIX_PRAS4 (AT91_MATRIX + 0xA0) /* Priority Register A for Slave 4 */ 64 - #define AT91_MATRIX_PRBS4 (AT91_MATRIX + 0xA4) /* Priority Register B for Slave 4 */ 65 - #define AT91_MATRIX_PRAS5 (AT91_MATRIX + 0xA8) /* Priority Register A for Slave 5 */ 66 - #define AT91_MATRIX_PRBS5 (AT91_MATRIX + 0xAC) /* Priority Register B for Slave 5 */ 67 - #define AT91_MATRIX_PRAS6 (AT91_MATRIX + 0xB0) /* Priority Register A for Slave 6 */ 68 - #define AT91_MATRIX_PRBS6 (AT91_MATRIX + 0xB4) /* Priority Register B for Slave 6 */ 69 - #define AT91_MATRIX_PRAS7 (AT91_MATRIX + 0xB8) /* Priority Register A for Slave 7 */ 70 - #define AT91_MATRIX_PRBS7 (AT91_MATRIX + 0xBC) /* Priority Register B for Slave 7 */ 55 + #define AT91_MATRIX_PRAS0 0x80 /* Priority Register A for Slave 0 */ 56 + #define AT91_MATRIX_PRBS0 0x84 /* Priority Register B for Slave 0 */ 57 + #define AT91_MATRIX_PRAS1 0x88 /* Priority Register A for Slave 1 */ 58 + #define AT91_MATRIX_PRBS1 0x8C /* Priority Register B for Slave 1 */ 59 + #define AT91_MATRIX_PRAS2 0x90 /* Priority Register A for Slave 2 */ 60 + #define AT91_MATRIX_PRBS2 0x94 /* Priority Register B for Slave 2 */ 61 + #define AT91_MATRIX_PRAS3 0x98 /* Priority Register A for Slave 3 */ 62 + #define AT91_MATRIX_PRBS3 0x9C /* Priority Register B for Slave 3 */ 63 + #define AT91_MATRIX_PRAS4 0xA0 /* Priority Register A for Slave 4 */ 64 + #define AT91_MATRIX_PRBS4 0xA4 /* Priority Register B for Slave 4 */ 65 + #define AT91_MATRIX_PRAS5 0xA8 /* Priority Register A for Slave 5 */ 66 + #define AT91_MATRIX_PRBS5 0xAC /* Priority Register B for Slave 5 */ 67 + #define AT91_MATRIX_PRAS6 0xB0 /* Priority Register A for Slave 6 */ 68 + #define AT91_MATRIX_PRBS6 0xB4 /* Priority Register B for Slave 6 */ 69 + #define AT91_MATRIX_PRAS7 0xB8 /* Priority Register A for Slave 7 */ 70 + #define AT91_MATRIX_PRBS7 0xBC /* Priority Register B for Slave 7 */ 71 71 #define AT91_MATRIX_M0PR (3 << 0) /* Master 0 Priority */ 72 72 #define AT91_MATRIX_M1PR (3 << 4) /* Master 1 Priority */ 73 73 #define AT91_MATRIX_M2PR (3 << 8) /* Master 2 Priority */ ··· 81 81 #define AT91_MATRIX_M10PR (3 << 8) /* Master 10 Priority (in Register B) */ 82 82 #define AT91_MATRIX_M11PR (3 << 12) /* Master 11 Priority (in Register B) */ 83 83 84 - #define AT91_MATRIX_MRCR (AT91_MATRIX + 0x100) /* Master Remap Control Register */ 84 + #define AT91_MATRIX_MRCR 0x100 /* Master Remap Control Register */ 85 85 #define AT91_MATRIX_RCB0 (1 << 0) /* Remap Command for AHB Master 0 (ARM926EJ-S Instruction Master) */ 86 86 #define AT91_MATRIX_RCB1 (1 << 1) /* Remap Command for AHB Master 1 (ARM926EJ-S Data Master) */ 87 87 #define AT91_MATRIX_RCB2 (1 << 2) ··· 95 95 #define AT91_MATRIX_RCB10 (1 << 10) 96 96 #define AT91_MATRIX_RCB11 (1 << 11) 97 97 98 - #define AT91_MATRIX_TCMR (AT91_MATRIX + 0x110) /* TCM Configuration Register */ 98 + #define AT91_MATRIX_TCMR 0x110 /* TCM Configuration Register */ 99 99 #define AT91_MATRIX_ITCM_SIZE (0xf << 0) /* Size of ITCM enabled memory block */ 100 100 #define AT91_MATRIX_ITCM_0 (0 << 0) 101 101 #define AT91_MATRIX_ITCM_32 (6 << 0) ··· 107 107 #define AT91_MATRIX_TCM_NO_WS (0x0 << 11) 108 108 #define AT91_MATRIX_TCM_ONE_WS (0x1 << 11) 109 109 110 - #define AT91_MATRIX_VIDEO (AT91_MATRIX + 0x118) /* Video Mode Configuration Register */ 110 + #define AT91_MATRIX_VIDEO 0x118 /* Video Mode Configuration Register */ 111 111 #define AT91C_VDEC_SEL (0x1 << 0) /* Video Mode Selection */ 112 112 #define AT91C_VDEC_SEL_OFF (0 << 0) 113 113 #define AT91C_VDEC_SEL_ON (1 << 0) 114 114 115 - #define AT91_MATRIX_EBICSA (AT91_MATRIX + 0x128) /* EBI Chip Select Assignment Register */ 115 + #define AT91_MATRIX_EBICSA 0x128 /* EBI Chip Select Assignment Register */ 116 116 #define AT91_MATRIX_EBI_CS1A (1 << 1) /* Chip Select 1 Assignment */ 117 117 #define AT91_MATRIX_EBI_CS1A_SMC (0 << 1) 118 118 #define AT91_MATRIX_EBI_CS1A_SDRAMC (1 << 1) ··· 138 138 #define AT91_MATRIX_EBI_DDR_IOSR_REDUCED (0 << 18) 139 139 #define AT91_MATRIX_EBI_DDR_IOSR_NORMAL (1 << 18) 140 140 141 - #define AT91_MATRIX_WPMR (AT91_MATRIX + 0x1E4) /* Write Protect Mode Register */ 141 + #define AT91_MATRIX_WPMR 0x1E4 /* Write Protect Mode Register */ 142 142 #define AT91_MATRIX_WPMR_WPEN (1 << 0) /* Write Protect ENable */ 143 143 #define AT91_MATRIX_WPMR_WP_WPDIS (0 << 0) 144 144 #define AT91_MATRIX_WPMR_WP_WPEN (1 << 0) 145 145 #define AT91_MATRIX_WPMR_WPKEY (0xFFFFFF << 8) /* Write Protect KEY */ 146 146 147 - #define AT91_MATRIX_WPSR (AT91_MATRIX + 0x1E8) /* Write Protect Status Register */ 147 + #define AT91_MATRIX_WPSR 0x1E8 /* Write Protect Status Register */ 148 148 #define AT91_MATRIX_WPSR_WPVS (1 << 0) /* Write Protect Violation Status */ 149 149 #define AT91_MATRIX_WPSR_NO_WPV (0 << 0) 150 150 #define AT91_MATRIX_WPSR_WPV (1 << 0)
+3 -4
arch/arm/mach-at91/include/mach/at91sam9rl.h
··· 69 69 /* 70 70 * System Peripherals (offset from AT91_BASE_SYS) 71 71 */ 72 - #define AT91_SDRAMC0 (0xffffea00 - AT91_BASE_SYS) 73 - #define AT91_MATRIX (0xffffee00 - AT91_BASE_SYS) 74 - #define AT91_PMC (0xfffffc00 - AT91_BASE_SYS) 75 72 #define AT91_SCKCR (0xfffffd50 - AT91_BASE_SYS) 76 - #define AT91_GPBR (0xfffffd60 - AT91_BASE_SYS) 77 73 78 74 #define AT91SAM9RL_BASE_DMA 0xffffe600 79 75 #define AT91SAM9RL_BASE_ECC 0xffffe800 76 + #define AT91SAM9RL_BASE_SDRAMC 0xffffea00 80 77 #define AT91SAM9RL_BASE_SMC 0xffffec00 78 + #define AT91SAM9RL_BASE_MATRIX 0xffffee00 81 79 #define AT91SAM9RL_BASE_DBGU AT91_BASE_DBGU0 82 80 #define AT91SAM9RL_BASE_PIOA 0xfffff400 83 81 #define AT91SAM9RL_BASE_PIOB 0xfffff600 ··· 86 88 #define AT91SAM9RL_BASE_RTT 0xfffffd20 87 89 #define AT91SAM9RL_BASE_PIT 0xfffffd30 88 90 #define AT91SAM9RL_BASE_WDT 0xfffffd40 91 + #define AT91SAM9RL_BASE_GPBR 0xfffffd60 89 92 #define AT91SAM9RL_BASE_RTC 0xfffffe00 90 93 91 94 #define AT91_USART0 AT91SAM9RL_BASE_US0
+21 -21
arch/arm/mach-at91/include/mach/at91sam9rl_matrix.h
··· 14 14 #ifndef AT91SAM9RL_MATRIX_H 15 15 #define AT91SAM9RL_MATRIX_H 16 16 17 - #define AT91_MATRIX_MCFG0 (AT91_MATRIX + 0x00) /* Master Configuration Register 0 */ 18 - #define AT91_MATRIX_MCFG1 (AT91_MATRIX + 0x04) /* Master Configuration Register 1 */ 19 - #define AT91_MATRIX_MCFG2 (AT91_MATRIX + 0x08) /* Master Configuration Register 2 */ 20 - #define AT91_MATRIX_MCFG3 (AT91_MATRIX + 0x0C) /* Master Configuration Register 3 */ 21 - #define AT91_MATRIX_MCFG4 (AT91_MATRIX + 0x10) /* Master Configuration Register 4 */ 22 - #define AT91_MATRIX_MCFG5 (AT91_MATRIX + 0x14) /* Master Configuration Register 5 */ 17 + #define AT91_MATRIX_MCFG0 0x00 /* Master Configuration Register 0 */ 18 + #define AT91_MATRIX_MCFG1 0x04 /* Master Configuration Register 1 */ 19 + #define AT91_MATRIX_MCFG2 0x08 /* Master Configuration Register 2 */ 20 + #define AT91_MATRIX_MCFG3 0x0C /* Master Configuration Register 3 */ 21 + #define AT91_MATRIX_MCFG4 0x10 /* Master Configuration Register 4 */ 22 + #define AT91_MATRIX_MCFG5 0x14 /* Master Configuration Register 5 */ 23 23 #define AT91_MATRIX_ULBT (7 << 0) /* Undefined Length Burst Type */ 24 24 #define AT91_MATRIX_ULBT_INFINITE (0 << 0) 25 25 #define AT91_MATRIX_ULBT_SINGLE (1 << 0) ··· 27 27 #define AT91_MATRIX_ULBT_EIGHT (3 << 0) 28 28 #define AT91_MATRIX_ULBT_SIXTEEN (4 << 0) 29 29 30 - #define AT91_MATRIX_SCFG0 (AT91_MATRIX + 0x40) /* Slave Configuration Register 0 */ 31 - #define AT91_MATRIX_SCFG1 (AT91_MATRIX + 0x44) /* Slave Configuration Register 1 */ 32 - #define AT91_MATRIX_SCFG2 (AT91_MATRIX + 0x48) /* Slave Configuration Register 2 */ 33 - #define AT91_MATRIX_SCFG3 (AT91_MATRIX + 0x4C) /* Slave Configuration Register 3 */ 34 - #define AT91_MATRIX_SCFG4 (AT91_MATRIX + 0x50) /* Slave Configuration Register 4 */ 35 - #define AT91_MATRIX_SCFG5 (AT91_MATRIX + 0x54) /* Slave Configuration Register 5 */ 30 + #define AT91_MATRIX_SCFG0 0x40 /* Slave Configuration Register 0 */ 31 + #define AT91_MATRIX_SCFG1 0x44 /* Slave Configuration Register 1 */ 32 + #define AT91_MATRIX_SCFG2 0x48 /* Slave Configuration Register 2 */ 33 + #define AT91_MATRIX_SCFG3 0x4C /* Slave Configuration Register 3 */ 34 + #define AT91_MATRIX_SCFG4 0x50 /* Slave Configuration Register 4 */ 35 + #define AT91_MATRIX_SCFG5 0x54 /* Slave Configuration Register 5 */ 36 36 #define AT91_MATRIX_SLOT_CYCLE (0xff << 0) /* Maximum Number of Allowed Cycles for a Burst */ 37 37 #define AT91_MATRIX_DEFMSTR_TYPE (3 << 16) /* Default Master Type */ 38 38 #define AT91_MATRIX_DEFMSTR_TYPE_NONE (0 << 16) ··· 43 43 #define AT91_MATRIX_ARBT_ROUND_ROBIN (0 << 24) 44 44 #define AT91_MATRIX_ARBT_FIXED_PRIORITY (1 << 24) 45 45 46 - #define AT91_MATRIX_PRAS0 (AT91_MATRIX + 0x80) /* Priority Register A for Slave 0 */ 47 - #define AT91_MATRIX_PRAS1 (AT91_MATRIX + 0x88) /* Priority Register A for Slave 1 */ 48 - #define AT91_MATRIX_PRAS2 (AT91_MATRIX + 0x90) /* Priority Register A for Slave 2 */ 49 - #define AT91_MATRIX_PRAS3 (AT91_MATRIX + 0x98) /* Priority Register A for Slave 3 */ 50 - #define AT91_MATRIX_PRAS4 (AT91_MATRIX + 0xA0) /* Priority Register A for Slave 4 */ 51 - #define AT91_MATRIX_PRAS5 (AT91_MATRIX + 0xA8) /* Priority Register A for Slave 5 */ 46 + #define AT91_MATRIX_PRAS0 0x80 /* Priority Register A for Slave 0 */ 47 + #define AT91_MATRIX_PRAS1 0x88 /* Priority Register A for Slave 1 */ 48 + #define AT91_MATRIX_PRAS2 0x90 /* Priority Register A for Slave 2 */ 49 + #define AT91_MATRIX_PRAS3 0x98 /* Priority Register A for Slave 3 */ 50 + #define AT91_MATRIX_PRAS4 0xA0 /* Priority Register A for Slave 4 */ 51 + #define AT91_MATRIX_PRAS5 0xA8 /* Priority Register A for Slave 5 */ 52 52 #define AT91_MATRIX_M0PR (3 << 0) /* Master 0 Priority */ 53 53 #define AT91_MATRIX_M1PR (3 << 4) /* Master 1 Priority */ 54 54 #define AT91_MATRIX_M2PR (3 << 8) /* Master 2 Priority */ ··· 56 56 #define AT91_MATRIX_M4PR (3 << 16) /* Master 4 Priority */ 57 57 #define AT91_MATRIX_M5PR (3 << 20) /* Master 5 Priority */ 58 58 59 - #define AT91_MATRIX_MRCR (AT91_MATRIX + 0x100) /* Master Remap Control Register */ 59 + #define AT91_MATRIX_MRCR 0x100 /* Master Remap Control Register */ 60 60 #define AT91_MATRIX_RCB0 (1 << 0) /* Remap Command for AHB Master 0 (ARM926EJ-S Instruction Master) */ 61 61 #define AT91_MATRIX_RCB1 (1 << 1) /* Remap Command for AHB Master 1 (ARM926EJ-S Data Master) */ 62 62 #define AT91_MATRIX_RCB2 (1 << 2) ··· 64 64 #define AT91_MATRIX_RCB4 (1 << 4) 65 65 #define AT91_MATRIX_RCB5 (1 << 5) 66 66 67 - #define AT91_MATRIX_TCMR (AT91_MATRIX + 0x114) /* TCM Configuration Register */ 67 + #define AT91_MATRIX_TCMR 0x114 /* TCM Configuration Register */ 68 68 #define AT91_MATRIX_ITCM_SIZE (0xf << 0) /* Size of ITCM enabled memory block */ 69 69 #define AT91_MATRIX_ITCM_0 (0 << 0) 70 70 #define AT91_MATRIX_ITCM_16 (5 << 0) ··· 74 74 #define AT91_MATRIX_DTCM_16 (5 << 4) 75 75 #define AT91_MATRIX_DTCM_32 (6 << 4) 76 76 77 - #define AT91_MATRIX_EBICSA (AT91_MATRIX + 0x120) /* EBI0 Chip Select Assignment Register */ 77 + #define AT91_MATRIX_EBICSA 0x120 /* EBI0 Chip Select Assignment Register */ 78 78 #define AT91_MATRIX_CS1A (1 << 1) /* Chip Select 1 Assignment */ 79 79 #define AT91_MATRIX_CS1A_SMC (0 << 1) 80 80 #define AT91_MATRIX_CS1A_SDRAMC (1 << 1)
+2 -3
arch/arm/mach-at91/include/mach/at91sam9x5.h
··· 55 55 #define AT91SAM9X5_BASE_USART2 0xf8024000 56 56 57 57 /* 58 - * System Peripherals (offset from AT91_BASE_SYS) 58 + * System Peripherals 59 59 */ 60 - #define AT91_DDRSDRC0 (0xffffe800 - AT91_BASE_SYS) 61 - #define AT91_PMC (0xfffffc00 - AT91_BASE_SYS) 60 + #define AT91SAM9X5_BASE_DDRSDRC0 0xffffe800 62 61 63 62 /* 64 63 * Base addresses for early serial code (uncompress.h)
+9 -9
arch/arm/mach-at91/include/mach/at91x40.h
··· 28 28 #define AT91X40_ID_IRQ2 18 /* External IRQ 2 */ 29 29 30 30 /* 31 - * System Peripherals (offset from AT91_BASE_SYS) 31 + * System Peripherals 32 32 */ 33 33 #define AT91_BASE_SYS 0xffc00000 34 34 35 - #define AT91_EBI (0xffe00000 - AT91_BASE_SYS) /* External Bus Interface */ 36 - #define AT91_SF (0xfff00000 - AT91_BASE_SYS) /* Special Function */ 37 - #define AT91_USART1 (0xfffcc000 - AT91_BASE_SYS) /* USART 1 */ 38 - #define AT91_USART0 (0xfffd0000 - AT91_BASE_SYS) /* USART 0 */ 39 - #define AT91_TC (0xfffe0000 - AT91_BASE_SYS) /* Timer Counter */ 40 - #define AT91_PIOA (0xffff0000 - AT91_BASE_SYS) /* PIO Controller A */ 41 - #define AT91_PS (0xffff4000 - AT91_BASE_SYS) /* Power Save */ 42 - #define AT91_WD (0xffff8000 - AT91_BASE_SYS) /* Watchdog Timer */ 35 + #define AT91_EBI 0xffe00000 /* External Bus Interface */ 36 + #define AT91_SF 0xfff00000 /* Special Function */ 37 + #define AT91_USART1 0xfffcc000 /* USART 1 */ 38 + #define AT91_USART0 0xfffd0000 /* USART 0 */ 39 + #define AT91_TC 0xfffe0000 /* Timer Counter */ 40 + #define AT91_PIOA 0xffff0000 /* PIO Controller A */ 41 + #define AT91_PS 0xffff4000 /* Power Save */ 42 + #define AT91_WD 0xffff8000 /* Watchdog Timer */ 43 43 44 44 /* 45 45 * The AT91x40 series doesn't have a debug unit like the other AT91 parts.
+5 -12
arch/arm/mach-at91/include/mach/gpio.h
··· 191 191 extern int __init_or_module at91_set_GPIO_periph(unsigned pin, int use_pullup); 192 192 extern int __init_or_module at91_set_A_periph(unsigned pin, int use_pullup); 193 193 extern int __init_or_module at91_set_B_periph(unsigned pin, int use_pullup); 194 + extern int __init_or_module at91_set_C_periph(unsigned pin, int use_pullup); 195 + extern int __init_or_module at91_set_D_periph(unsigned pin, int use_pullup); 194 196 extern int __init_or_module at91_set_gpio_input(unsigned pin, int use_pullup); 195 197 extern int __init_or_module at91_set_gpio_output(unsigned pin, int value); 196 198 extern int __init_or_module at91_set_deglitch(unsigned pin, int is_on); 199 + extern int __init_or_module at91_set_debounce(unsigned pin, int is_on, int div); 197 200 extern int __init_or_module at91_set_multi_drive(unsigned pin, int is_on); 201 + extern int __init_or_module at91_set_pulldown(unsigned pin, int is_on); 202 + extern int __init_or_module at91_disable_schmitt_trig(unsigned pin); 198 203 199 204 /* callable at any time */ 200 205 extern int at91_set_gpio_value(unsigned pin, int value); ··· 208 203 /* callable only from core power-management code */ 209 204 extern void at91_gpio_suspend(void); 210 205 extern void at91_gpio_resume(void); 211 - 212 - /*-------------------------------------------------------------------------*/ 213 - 214 - /* wrappers for "new style" GPIO calls. the old AT91-specific ones should 215 - * eventually be removed (along with this errno.h inclusion), and the 216 - * gpio request/free calls should probably be implemented. 217 - */ 218 - 219 - #include <asm/errno.h> 220 - 221 - #define gpio_to_irq(gpio) (gpio + NR_AIC_IRQS) 222 - #define irq_to_gpio(irq) (irq - NR_AIC_IRQS) 223 206 224 207 #endif /* __ASSEMBLY__ */ 225 208
+2 -1
arch/arm/mach-at91/include/mach/hardware.h
··· 59 59 60 60 /* 61 61 * On all at91 have the Advanced Interrupt Controller starts at address 62 - * 0xfffff000 62 + * 0xfffff000 and the Power Management Controller starts at 0xfffffc00 63 63 */ 64 64 #define AT91_AIC 0xfffff000 65 + #define AT91_PMC 0xfffffc00 65 66 66 67 /* 67 68 * Peripheral identifiers/interrupts.
-18
arch/arm/mach-at91/include/mach/io.h
··· 28 28 #define __io(a) __typesafe_io(a) 29 29 #define __mem_pci(a) (a) 30 30 31 - #ifndef __ASSEMBLY__ 32 - 33 - static inline unsigned int at91_sys_read(unsigned int reg_offset) 34 - { 35 - void __iomem *addr = (void __iomem *)AT91_VA_BASE_SYS; 36 - 37 - return __raw_readl(addr + reg_offset); 38 - } 39 - 40 - static inline void at91_sys_write(unsigned int reg_offset, unsigned long value) 41 - { 42 - void __iomem *addr = (void __iomem *)AT91_VA_BASE_SYS; 43 - 44 - __raw_writel(value, addr + reg_offset); 45 - } 46 - 47 - #endif 48 - 49 31 #endif
+112 -38
arch/arm/mach-at91/irq.c
··· 24 24 #include <linux/module.h> 25 25 #include <linux/mm.h> 26 26 #include <linux/types.h> 27 + #include <linux/irq.h> 28 + #include <linux/of.h> 29 + #include <linux/of_address.h> 30 + #include <linux/of_irq.h> 31 + #include <linux/irqdomain.h> 32 + #include <linux/err.h> 27 33 28 34 #include <mach/hardware.h> 29 35 #include <asm/irq.h> ··· 40 34 #include <asm/mach/map.h> 41 35 42 36 void __iomem *at91_aic_base; 37 + static struct irq_domain *at91_aic_domain; 38 + static struct device_node *at91_aic_np; 43 39 44 40 static void at91_aic_mask_irq(struct irq_data *d) 45 41 { 46 42 /* Disable interrupt on AIC */ 47 - at91_aic_write(AT91_AIC_IDCR, 1 << d->irq); 43 + at91_aic_write(AT91_AIC_IDCR, 1 << d->hwirq); 48 44 } 49 45 50 46 static void at91_aic_unmask_irq(struct irq_data *d) 51 47 { 52 48 /* Enable interrupt on AIC */ 53 - at91_aic_write(AT91_AIC_IECR, 1 << d->irq); 49 + at91_aic_write(AT91_AIC_IECR, 1 << d->hwirq); 54 50 } 55 51 56 52 unsigned int at91_extern_irq; 57 53 58 - #define is_extern_irq(irq) ((1 << (irq)) & at91_extern_irq) 54 + #define is_extern_irq(hwirq) ((1 << (hwirq)) & at91_extern_irq) 59 55 60 56 static int at91_aic_set_type(struct irq_data *d, unsigned type) 61 57 { ··· 71 63 srctype = AT91_AIC_SRCTYPE_RISING; 72 64 break; 73 65 case IRQ_TYPE_LEVEL_LOW: 74 - if ((d->irq == AT91_ID_FIQ) || is_extern_irq(d->irq)) /* only supported on external interrupts */ 66 + if ((d->hwirq == AT91_ID_FIQ) || is_extern_irq(d->hwirq)) /* only supported on external interrupts */ 75 67 srctype = AT91_AIC_SRCTYPE_LOW; 76 68 else 77 69 return -EINVAL; 78 70 break; 79 71 case IRQ_TYPE_EDGE_FALLING: 80 - if ((d->irq == AT91_ID_FIQ) || is_extern_irq(d->irq)) /* only supported on external interrupts */ 72 + if ((d->hwirq == AT91_ID_FIQ) || is_extern_irq(d->hwirq)) /* only supported on external interrupts */ 81 73 srctype = AT91_AIC_SRCTYPE_FALLING; 82 74 else 83 75 return -EINVAL; ··· 86 78 return -EINVAL; 87 79 } 88 80 89 - smr = at91_aic_read(AT91_AIC_SMR(d->irq)) & ~AT91_AIC_SRCTYPE; 90 - at91_aic_write(AT91_AIC_SMR(d->irq), smr | srctype); 81 + smr = at91_aic_read(AT91_AIC_SMR(d->hwirq)) & ~AT91_AIC_SRCTYPE; 82 + at91_aic_write(AT91_AIC_SMR(d->hwirq), smr | srctype); 91 83 return 0; 92 84 } 93 85 ··· 98 90 99 91 static int at91_aic_set_wake(struct irq_data *d, unsigned value) 100 92 { 101 - if (unlikely(d->irq >= 32)) 93 + if (unlikely(d->hwirq >= NR_AIC_IRQS)) 102 94 return -EINVAL; 103 95 104 96 if (value) 105 - wakeups |= (1 << d->irq); 97 + wakeups |= (1 << d->hwirq); 106 98 else 107 - wakeups &= ~(1 << d->irq); 99 + wakeups &= ~(1 << d->hwirq); 108 100 109 101 return 0; 110 102 } ··· 135 127 .irq_set_wake = at91_aic_set_wake, 136 128 }; 137 129 138 - /* 139 - * Initialize the AIC interrupt controller. 140 - */ 141 - void __init at91_aic_init(unsigned int priority[NR_AIC_IRQS]) 130 + static void __init at91_aic_hw_init(unsigned int spu_vector) 142 131 { 143 - unsigned int i; 144 - 145 - at91_aic_base = ioremap(AT91_AIC, 512); 146 - 147 - if (!at91_aic_base) 148 - panic("Impossible to ioremap AT91_AIC\n"); 132 + int i; 149 133 150 134 /* 151 - * The IVR is used by macro get_irqnr_and_base to read and verify. 152 - * The irq number is NR_AIC_IRQS when a spurious interrupt has occurred. 135 + * Perform 8 End Of Interrupt Command to make sure AIC 136 + * will not Lock out nIRQ 153 137 */ 154 - for (i = 0; i < NR_AIC_IRQS; i++) { 155 - /* Put irq number in Source Vector Register: */ 156 - at91_aic_write(AT91_AIC_SVR(i), i); 157 - /* Active Low interrupt, with the specified priority */ 158 - at91_aic_write(AT91_AIC_SMR(i), AT91_AIC_SRCTYPE_LOW | priority[i]); 159 - 160 - irq_set_chip_and_handler(i, &at91_aic_chip, handle_level_irq); 161 - set_irq_flags(i, IRQF_VALID | IRQF_PROBE); 162 - 163 - /* Perform 8 End Of Interrupt Command to make sure AIC will not Lock out nIRQ */ 164 - if (i < 8) 165 - at91_aic_write(AT91_AIC_EOICR, 0); 166 - } 138 + for (i = 0; i < 8; i++) 139 + at91_aic_write(AT91_AIC_EOICR, 0); 167 140 168 141 /* 169 - * Spurious Interrupt ID in Spurious Vector Register is NR_AIC_IRQS 170 - * When there is no current interrupt, the IRQ Vector Register reads the value stored in AIC_SPU 142 + * Spurious Interrupt ID in Spurious Vector Register. 143 + * When there is no current interrupt, the IRQ Vector Register 144 + * reads the value stored in AIC_SPU 171 145 */ 172 - at91_aic_write(AT91_AIC_SPU, NR_AIC_IRQS); 146 + at91_aic_write(AT91_AIC_SPU, spu_vector); 173 147 174 148 /* No debugging in AIC: Debug (Protect) Control Register */ 175 149 at91_aic_write(AT91_AIC_DCR, 0); ··· 159 169 /* Disable and clear all interrupts initially */ 160 170 at91_aic_write(AT91_AIC_IDCR, 0xFFFFFFFF); 161 171 at91_aic_write(AT91_AIC_ICCR, 0xFFFFFFFF); 172 + } 173 + 174 + #if defined(CONFIG_OF) 175 + static int at91_aic_irq_map(struct irq_domain *h, unsigned int virq, 176 + irq_hw_number_t hw) 177 + { 178 + /* Put virq number in Source Vector Register */ 179 + at91_aic_write(AT91_AIC_SVR(hw), virq); 180 + 181 + /* Active Low interrupt, without priority */ 182 + at91_aic_write(AT91_AIC_SMR(hw), AT91_AIC_SRCTYPE_LOW); 183 + 184 + irq_set_chip_and_handler(virq, &at91_aic_chip, handle_level_irq); 185 + set_irq_flags(virq, IRQF_VALID | IRQF_PROBE); 186 + 187 + return 0; 188 + } 189 + 190 + static struct irq_domain_ops at91_aic_irq_ops = { 191 + .map = at91_aic_irq_map, 192 + .xlate = irq_domain_xlate_twocell, 193 + }; 194 + 195 + int __init at91_aic_of_init(struct device_node *node, 196 + struct device_node *parent) 197 + { 198 + at91_aic_base = of_iomap(node, 0); 199 + at91_aic_np = node; 200 + 201 + at91_aic_domain = irq_domain_add_linear(at91_aic_np, NR_AIC_IRQS, 202 + &at91_aic_irq_ops, NULL); 203 + if (!at91_aic_domain) 204 + panic("Unable to add AIC irq domain (DT)\n"); 205 + 206 + irq_set_default_host(at91_aic_domain); 207 + 208 + at91_aic_hw_init(NR_AIC_IRQS); 209 + 210 + return 0; 211 + } 212 + #endif 213 + 214 + /* 215 + * Initialize the AIC interrupt controller. 216 + */ 217 + void __init at91_aic_init(unsigned int priority[NR_AIC_IRQS]) 218 + { 219 + unsigned int i; 220 + int irq_base; 221 + 222 + at91_aic_base = ioremap(AT91_AIC, 512); 223 + if (!at91_aic_base) 224 + panic("Unable to ioremap AIC registers\n"); 225 + 226 + /* Add irq domain for AIC */ 227 + irq_base = irq_alloc_descs(-1, 0, NR_AIC_IRQS, 0); 228 + if (irq_base < 0) { 229 + WARN(1, "Cannot allocate irq_descs, assuming pre-allocated\n"); 230 + irq_base = 0; 231 + } 232 + at91_aic_domain = irq_domain_add_legacy(at91_aic_np, NR_AIC_IRQS, 233 + irq_base, 0, 234 + &irq_domain_simple_ops, NULL); 235 + 236 + if (!at91_aic_domain) 237 + panic("Unable to add AIC irq domain\n"); 238 + 239 + irq_set_default_host(at91_aic_domain); 240 + 241 + /* 242 + * The IVR is used by macro get_irqnr_and_base to read and verify. 243 + * The irq number is NR_AIC_IRQS when a spurious interrupt has occurred. 244 + */ 245 + for (i = 0; i < NR_AIC_IRQS; i++) { 246 + /* Put hardware irq number in Source Vector Register: */ 247 + at91_aic_write(AT91_AIC_SVR(i), i); 248 + /* Active Low interrupt, with the specified priority */ 249 + at91_aic_write(AT91_AIC_SMR(i), AT91_AIC_SRCTYPE_LOW | priority[i]); 250 + 251 + irq_set_chip_and_handler(i, &at91_aic_chip, handle_level_irq); 252 + set_irq_flags(i, IRQF_VALID | IRQF_PROBE); 253 + } 254 + 255 + at91_aic_hw_init(NR_AIC_IRQS); 162 256 }
+28 -7
arch/arm/mach-at91/pm.c
··· 136 136 unsigned long scsr; 137 137 int i; 138 138 139 - scsr = at91_sys_read(AT91_PMC_SCSR); 139 + scsr = at91_pmc_read(AT91_PMC_SCSR); 140 140 141 141 /* USB must not be using PLLB */ 142 142 if (cpu_is_at91rm9200()) { ··· 160 160 if ((scsr & (AT91_PMC_PCK0 << i)) == 0) 161 161 continue; 162 162 163 - css = at91_sys_read(AT91_PMC_PCKR(i)) & AT91_PMC_CSS; 163 + css = at91_pmc_read(AT91_PMC_PCKR(i)) & AT91_PMC_CSS; 164 164 if (css != AT91_PMC_CSS_SLOW) { 165 165 pr_err("AT91: PM - Suspend-to-RAM with PCK%d src %d\n", i, css); 166 166 return 0; ··· 188 188 EXPORT_SYMBOL(at91_suspend_entering_slow_clock); 189 189 190 190 191 - static void (*slow_clock)(void); 191 + static void (*slow_clock)(void __iomem *pmc, void __iomem *ramc0, 192 + void __iomem *ramc1, int memctrl); 192 193 193 194 #ifdef CONFIG_AT91_SLOW_CLOCK 194 - extern void at91_slow_clock(void); 195 + extern void at91_slow_clock(void __iomem *pmc, void __iomem *ramc0, 196 + void __iomem *ramc1, int memctrl); 195 197 extern u32 at91_slow_clock_sz; 196 198 #endif 197 199 200 + void __iomem *at91_ramc_base[2]; 201 + 202 + void __init at91_ioremap_ramc(int id, u32 addr, u32 size) 203 + { 204 + if (id < 0 || id > 1) { 205 + pr_emerg("Wrong RAM controller id (%d), cannot continue\n", id); 206 + BUG(); 207 + } 208 + at91_ramc_base[id] = ioremap(addr, size); 209 + if (!at91_ramc_base[id]) 210 + panic("Impossible to ioremap ramc.%d 0x%x\n", id, addr); 211 + } 198 212 199 213 static int at91_pm_enter(suspend_state_t state) 200 214 { ··· 217 203 218 204 pr_debug("AT91: PM - wake mask %08x, pm state %d\n", 219 205 /* remember all the always-wake irqs */ 220 - (at91_sys_read(AT91_PMC_PCSR) 206 + (at91_pmc_read(AT91_PMC_PCSR) 221 207 | (1 << AT91_ID_FIQ) 222 208 | (1 << AT91_ID_SYS) 223 209 | (at91_extern_irq)) ··· 242 228 * turning off the main oscillator; reverse on wakeup. 243 229 */ 244 230 if (slow_clock) { 231 + int memctrl = AT91_MEMCTRL_SDRAMC; 232 + 233 + if (cpu_is_at91rm9200()) 234 + memctrl = AT91_MEMCTRL_MC; 235 + else if (cpu_is_at91sam9g45()) 236 + memctrl = AT91_MEMCTRL_DDRSDR; 245 237 #ifdef CONFIG_AT91_SLOW_CLOCK 246 238 /* copy slow_clock handler to SRAM, and call it */ 247 239 memcpy(slow_clock, at91_slow_clock, at91_slow_clock_sz); 248 240 #endif 249 - slow_clock(); 241 + slow_clock(at91_pmc_base, at91_ramc_base[0], 242 + at91_ramc_base[1], memctrl); 250 243 break; 251 244 } else { 252 245 pr_info("AT91: PM - no slow clock mode enabled ...\n"); ··· 322 301 323 302 #ifdef CONFIG_ARCH_AT91RM9200 324 303 /* AT91RM9200 SDRAM low-power mode cannot be used with self-refresh. */ 325 - at91_sys_write(AT91_SDRAMC_LPR, 0); 304 + at91_ramc_write(0, AT91RM9200_SDRAMC_LPR, 0); 326 305 #endif 327 306 328 307 suspend_set_ops(&at91_pm_ops);
+5 -6
arch/arm/mach-at91/pm.h
··· 11 11 #ifndef __ARCH_ARM_MACH_AT91_PM 12 12 #define __ARCH_ARM_MACH_AT91_PM 13 13 14 + #include <mach/at91_ramc.h> 14 15 #ifdef CONFIG_ARCH_AT91RM9200 15 - #include <mach/at91rm9200_mc.h> 16 + #include <mach/at91rm9200_sdramc.h> 16 17 17 18 /* 18 19 * The AT91RM9200 goes into self-refresh mode with this command, and will ··· 27 26 28 27 static inline void at91rm9200_standby(void) 29 28 { 30 - u32 lpr = at91_sys_read(AT91_SDRAMC_LPR); 29 + u32 lpr = at91_ramc_read(0, AT91RM9200_SDRAMC_LPR); 31 30 32 31 asm volatile( 33 32 "b 1f\n\t" ··· 38 37 " mcr p15, 0, %0, c7, c0, 4\n\t" 39 38 " str %5, [%1, %2]" 40 39 : 41 - : "r" (0), "r" (AT91_BASE_SYS), "r" (AT91_SDRAMC_LPR), 42 - "r" (1), "r" (AT91_SDRAMC_SRR), 40 + : "r" (0), "r" (AT91_BASE_SYS), "r" (AT91RM9200_SDRAMC_LPR), 41 + "r" (1), "r" (AT91RM9200_SDRAMC_SRR), 43 42 "r" (lpr)); 44 43 } 45 44 46 45 #define at91_standby at91rm9200_standby 47 46 48 47 #elif defined(CONFIG_ARCH_AT91SAM9G45) 49 - #include <mach/at91sam9_ddrsdr.h> 50 48 51 49 /* We manage both DDRAM/SDRAM controllers, we need more than one value to 52 50 * remember. ··· 78 78 #define at91_standby at91sam9g45_standby 79 79 80 80 #else 81 - #include <mach/at91sam9_sdramc.h> 82 81 83 82 #ifdef CONFIG_ARCH_AT91SAM9263 84 83 /*
+141 -130
arch/arm/mach-at91/pm_slowclock.S
··· 15 15 #include <linux/linkage.h> 16 16 #include <mach/hardware.h> 17 17 #include <mach/at91_pmc.h> 18 - 19 - #if defined(CONFIG_ARCH_AT91RM9200) 20 - #include <mach/at91rm9200_mc.h> 21 - #elif defined(CONFIG_ARCH_AT91SAM9G45) 22 - #include <mach/at91sam9_ddrsdr.h> 23 - #else 24 - #include <mach/at91sam9_sdramc.h> 25 - #endif 18 + #include <mach/at91_ramc.h> 26 19 27 20 28 21 #ifdef CONFIG_ARCH_AT91SAM9263 ··· 39 46 #define PLLALOCK_TIMEOUT 1000 40 47 #define PLLBLOCK_TIMEOUT 1000 41 48 49 + pmc .req r0 50 + sdramc .req r1 51 + ramc1 .req r2 52 + memctrl .req r3 53 + tmp1 .req r4 54 + tmp2 .req r5 42 55 43 56 /* 44 57 * Wait until master clock is ready (after switching master clock source) 45 58 */ 46 59 .macro wait_mckrdy 47 - mov r4, #MCKRDY_TIMEOUT 48 - 1: sub r4, r4, #1 49 - cmp r4, #0 60 + mov tmp2, #MCKRDY_TIMEOUT 61 + 1: sub tmp2, tmp2, #1 62 + cmp tmp2, #0 50 63 beq 2f 51 - ldr r3, [r1, #(AT91_PMC_SR - AT91_PMC)] 52 - tst r3, #AT91_PMC_MCKRDY 64 + ldr tmp1, [pmc, #AT91_PMC_SR] 65 + tst tmp1, #AT91_PMC_MCKRDY 53 66 beq 1b 54 67 2: 55 68 .endm ··· 64 65 * Wait until master oscillator has stabilized. 65 66 */ 66 67 .macro wait_moscrdy 67 - mov r4, #MOSCRDY_TIMEOUT 68 - 1: sub r4, r4, #1 69 - cmp r4, #0 68 + mov tmp2, #MOSCRDY_TIMEOUT 69 + 1: sub tmp2, tmp2, #1 70 + cmp tmp2, #0 70 71 beq 2f 71 - ldr r3, [r1, #(AT91_PMC_SR - AT91_PMC)] 72 - tst r3, #AT91_PMC_MOSCS 72 + ldr tmp1, [pmc, #AT91_PMC_SR] 73 + tst tmp1, #AT91_PMC_MOSCS 73 74 beq 1b 74 75 2: 75 76 .endm ··· 78 79 * Wait until PLLA has locked. 79 80 */ 80 81 .macro wait_pllalock 81 - mov r4, #PLLALOCK_TIMEOUT 82 - 1: sub r4, r4, #1 83 - cmp r4, #0 82 + mov tmp2, #PLLALOCK_TIMEOUT 83 + 1: sub tmp2, tmp2, #1 84 + cmp tmp2, #0 84 85 beq 2f 85 - ldr r3, [r1, #(AT91_PMC_SR - AT91_PMC)] 86 - tst r3, #AT91_PMC_LOCKA 86 + ldr tmp1, [pmc, #AT91_PMC_SR] 87 + tst tmp1, #AT91_PMC_LOCKA 87 88 beq 1b 88 89 2: 89 90 .endm ··· 92 93 * Wait until PLLB has locked. 93 94 */ 94 95 .macro wait_pllblock 95 - mov r4, #PLLBLOCK_TIMEOUT 96 - 1: sub r4, r4, #1 97 - cmp r4, #0 96 + mov tmp2, #PLLBLOCK_TIMEOUT 97 + 1: sub tmp2, tmp2, #1 98 + cmp tmp2, #0 98 99 beq 2f 99 - ldr r3, [r1, #(AT91_PMC_SR - AT91_PMC)] 100 - tst r3, #AT91_PMC_LOCKB 100 + ldr tmp1, [pmc, #AT91_PMC_SR] 101 + tst tmp1, #AT91_PMC_LOCKB 101 102 beq 1b 102 103 2: 103 104 .endm 104 105 105 106 .text 106 107 108 + /* void at91_slow_clock(void __iomem *pmc, void __iomem *sdramc, 109 + * void __iomem *ramc1, int memctrl) 110 + */ 107 111 ENTRY(at91_slow_clock) 108 112 /* Save registers on stack */ 109 - stmfd sp!, {r0 - r12, lr} 113 + stmfd sp!, {r4 - r12, lr} 110 114 111 115 /* 112 116 * Register usage: 113 - * R1 = Base address of AT91_PMC 114 - * R2 = Base address of RAM Controller (SDRAM, DDRSDR, or AT91_SYS) 115 - * R3 = temporary register 117 + * R0 = Base address of AT91_PMC 118 + * R1 = Base address of RAM Controller (SDRAM, DDRSDR, or AT91_SYS) 119 + * R2 = Base address of second RAM Controller or 0 if not present 120 + * R3 = Memory controller 116 121 * R4 = temporary register 117 - * R5 = Base address of second RAM Controller or 0 if not present 122 + * R5 = temporary register 118 123 */ 119 - ldr r1, .at91_va_base_pmc 120 - ldr r2, .at91_va_base_sdramc 121 - ldr r5, .at91_va_base_ramc1 122 124 123 125 /* Drain write buffer */ 124 - mov r0, #0 125 - mcr p15, 0, r0, c7, c10, 4 126 + mov tmp1, #0 127 + mcr p15, 0, tmp1, c7, c10, 4 126 128 127 - #ifdef CONFIG_ARCH_AT91RM9200 129 + cmp memctrl, #AT91_MEMCTRL_MC 130 + bne ddr_sr_enable 131 + 132 + /* 133 + * at91rm9200 Memory controller 134 + */ 128 135 /* Put SDRAM in self-refresh mode */ 129 - mov r3, #1 130 - str r3, [r2, #AT91_SDRAMC_SRR] 131 - #elif defined(CONFIG_ARCH_AT91SAM9G45) 136 + mov tmp1, #1 137 + str tmp1, [sdramc, #AT91RM9200_SDRAMC_SRR] 138 + b sdr_sr_done 139 + 140 + /* 141 + * DDRSDR Memory controller 142 + */ 143 + ddr_sr_enable: 144 + cmp memctrl, #AT91_MEMCTRL_DDRSDR 145 + bne sdr_sr_enable 132 146 133 147 /* prepare for DDRAM self-refresh mode */ 134 - ldr r3, [r2, #AT91_DDRSDRC_LPR] 135 - str r3, .saved_sam9_lpr 136 - bic r3, #AT91_DDRSDRC_LPCB 137 - orr r3, #AT91_DDRSDRC_LPCB_SELF_REFRESH 148 + ldr tmp1, [sdramc, #AT91_DDRSDRC_LPR] 149 + str tmp1, .saved_sam9_lpr 150 + bic tmp1, #AT91_DDRSDRC_LPCB 151 + orr tmp1, #AT91_DDRSDRC_LPCB_SELF_REFRESH 138 152 139 153 /* figure out if we use the second ram controller */ 140 - cmp r5, #0 141 - ldrne r4, [r5, #AT91_DDRSDRC_LPR] 142 - strne r4, .saved_sam9_lpr1 143 - bicne r4, #AT91_DDRSDRC_LPCB 144 - orrne r4, #AT91_DDRSDRC_LPCB_SELF_REFRESH 154 + cmp ramc1, #0 155 + ldrne tmp2, [ramc1, #AT91_DDRSDRC_LPR] 156 + strne tmp2, .saved_sam9_lpr1 157 + bicne tmp2, #AT91_DDRSDRC_LPCB 158 + orrne tmp2, #AT91_DDRSDRC_LPCB_SELF_REFRESH 145 159 146 160 /* Enable DDRAM self-refresh mode */ 147 - str r3, [r2, #AT91_DDRSDRC_LPR] 148 - strne r4, [r5, #AT91_DDRSDRC_LPR] 149 - #else 161 + str tmp1, [sdramc, #AT91_DDRSDRC_LPR] 162 + strne tmp2, [ramc1, #AT91_DDRSDRC_LPR] 163 + 164 + b sdr_sr_done 165 + 166 + /* 167 + * SDRAMC Memory controller 168 + */ 169 + sdr_sr_enable: 150 170 /* Enable SDRAM self-refresh mode */ 151 - ldr r3, [r2, #AT91_SDRAMC_LPR] 152 - str r3, .saved_sam9_lpr 171 + ldr tmp1, [sdramc, #AT91_SDRAMC_LPR] 172 + str tmp1, .saved_sam9_lpr 153 173 154 - bic r3, #AT91_SDRAMC_LPCB 155 - orr r3, #AT91_SDRAMC_LPCB_SELF_REFRESH 156 - str r3, [r2, #AT91_SDRAMC_LPR] 157 - #endif 174 + bic tmp1, #AT91_SDRAMC_LPCB 175 + orr tmp1, #AT91_SDRAMC_LPCB_SELF_REFRESH 176 + str tmp1, [sdramc, #AT91_SDRAMC_LPR] 158 177 178 + sdr_sr_done: 159 179 /* Save Master clock setting */ 160 - ldr r3, [r1, #(AT91_PMC_MCKR - AT91_PMC)] 161 - str r3, .saved_mckr 180 + ldr tmp1, [pmc, #AT91_PMC_MCKR] 181 + str tmp1, .saved_mckr 162 182 163 183 /* 164 184 * Set the Master clock source to slow clock 165 185 */ 166 - bic r3, r3, #AT91_PMC_CSS 167 - str r3, [r1, #(AT91_PMC_MCKR - AT91_PMC)] 186 + bic tmp1, tmp1, #AT91_PMC_CSS 187 + str tmp1, [pmc, #AT91_PMC_MCKR] 168 188 169 189 wait_mckrdy 170 190 ··· 193 175 * 194 176 * See AT91RM9200 errata #27 and #28 for details. 195 177 */ 196 - mov r3, #0 197 - str r3, [r1, #(AT91_PMC_MCKR - AT91_PMC)] 178 + mov tmp1, #0 179 + str tmp1, [pmc, #AT91_PMC_MCKR] 198 180 199 181 wait_mckrdy 200 182 #endif 201 183 202 184 /* Save PLLA setting and disable it */ 203 - ldr r3, [r1, #(AT91_CKGR_PLLAR - AT91_PMC)] 204 - str r3, .saved_pllar 185 + ldr tmp1, [pmc, #AT91_CKGR_PLLAR] 186 + str tmp1, .saved_pllar 205 187 206 - mov r3, #AT91_PMC_PLLCOUNT 207 - orr r3, r3, #(1 << 29) /* bit 29 always set */ 208 - str r3, [r1, #(AT91_CKGR_PLLAR - AT91_PMC)] 188 + mov tmp1, #AT91_PMC_PLLCOUNT 189 + orr tmp1, tmp1, #(1 << 29) /* bit 29 always set */ 190 + str tmp1, [pmc, #AT91_CKGR_PLLAR] 209 191 210 192 /* Save PLLB setting and disable it */ 211 - ldr r3, [r1, #(AT91_CKGR_PLLBR - AT91_PMC)] 212 - str r3, .saved_pllbr 193 + ldr tmp1, [pmc, #AT91_CKGR_PLLBR] 194 + str tmp1, .saved_pllbr 213 195 214 - mov r3, #AT91_PMC_PLLCOUNT 215 - str r3, [r1, #(AT91_CKGR_PLLBR - AT91_PMC)] 196 + mov tmp1, #AT91_PMC_PLLCOUNT 197 + str tmp1, [pmc, #AT91_CKGR_PLLBR] 216 198 217 199 /* Turn off the main oscillator */ 218 - ldr r3, [r1, #(AT91_CKGR_MOR - AT91_PMC)] 219 - bic r3, r3, #AT91_PMC_MOSCEN 220 - str r3, [r1, #(AT91_CKGR_MOR - AT91_PMC)] 200 + ldr tmp1, [pmc, #AT91_CKGR_MOR] 201 + bic tmp1, tmp1, #AT91_PMC_MOSCEN 202 + str tmp1, [pmc, #AT91_CKGR_MOR] 221 203 222 204 /* Wait for interrupt */ 223 - mcr p15, 0, r0, c7, c0, 4 205 + mcr p15, 0, tmp1, c7, c0, 4 224 206 225 207 /* Turn on the main oscillator */ 226 - ldr r3, [r1, #(AT91_CKGR_MOR - AT91_PMC)] 227 - orr r3, r3, #AT91_PMC_MOSCEN 228 - str r3, [r1, #(AT91_CKGR_MOR - AT91_PMC)] 208 + ldr tmp1, [pmc, #AT91_CKGR_MOR] 209 + orr tmp1, tmp1, #AT91_PMC_MOSCEN 210 + str tmp1, [pmc, #AT91_CKGR_MOR] 229 211 230 212 wait_moscrdy 231 213 232 214 /* Restore PLLB setting */ 233 - ldr r3, .saved_pllbr 234 - str r3, [r1, #(AT91_CKGR_PLLBR - AT91_PMC)] 215 + ldr tmp1, .saved_pllbr 216 + str tmp1, [pmc, #AT91_CKGR_PLLBR] 235 217 236 - tst r3, #(AT91_PMC_MUL & 0xff0000) 218 + tst tmp1, #(AT91_PMC_MUL & 0xff0000) 237 219 bne 1f 238 - tst r3, #(AT91_PMC_MUL & ~0xff0000) 220 + tst tmp1, #(AT91_PMC_MUL & ~0xff0000) 239 221 beq 2f 240 222 1: 241 223 wait_pllblock 242 224 2: 243 225 244 226 /* Restore PLLA setting */ 245 - ldr r3, .saved_pllar 246 - str r3, [r1, #(AT91_CKGR_PLLAR - AT91_PMC)] 227 + ldr tmp1, .saved_pllar 228 + str tmp1, [pmc, #AT91_CKGR_PLLAR] 247 229 248 - tst r3, #(AT91_PMC_MUL & 0xff0000) 230 + tst tmp1, #(AT91_PMC_MUL & 0xff0000) 249 231 bne 3f 250 - tst r3, #(AT91_PMC_MUL & ~0xff0000) 232 + tst tmp1, #(AT91_PMC_MUL & ~0xff0000) 251 233 beq 4f 252 234 3: 253 235 wait_pllalock ··· 260 242 * 261 243 * See AT91RM9200 errata #27 and #28 for details. 262 244 */ 263 - ldr r3, .saved_mckr 264 - tst r3, #AT91_PMC_PRES 245 + ldr tmp1, .saved_mckr 246 + tst tmp1, #AT91_PMC_PRES 265 247 beq 2f 266 - and r3, r3, #AT91_PMC_PRES 267 - str r3, [r1, #(AT91_PMC_MCKR - AT91_PMC)] 248 + and tmp1, tmp1, #AT91_PMC_PRES 249 + str tmp1, [pmc, #AT91_PMC_MCKR] 268 250 269 251 wait_mckrdy 270 252 #endif ··· 272 254 /* 273 255 * Restore master clock setting 274 256 */ 275 - 2: ldr r3, .saved_mckr 276 - str r3, [r1, #(AT91_PMC_MCKR - AT91_PMC)] 257 + 2: ldr tmp1, .saved_mckr 258 + str tmp1, [pmc, #AT91_PMC_MCKR] 277 259 278 260 wait_mckrdy 279 261 280 - #ifdef CONFIG_ARCH_AT91RM9200 281 - /* Do nothing - self-refresh is automatically disabled. */ 282 - #elif defined(CONFIG_ARCH_AT91SAM9G45) 262 + /* 263 + * at91rm9200 Memory controller 264 + * Do nothing - self-refresh is automatically disabled. 265 + */ 266 + cmp memctrl, #AT91_MEMCTRL_MC 267 + beq ram_restored 268 + 269 + /* 270 + * DDRSDR Memory controller 271 + */ 272 + cmp memctrl, #AT91_MEMCTRL_DDRSDR 273 + bne sdr_en_restore 283 274 /* Restore LPR on AT91 with DDRAM */ 284 - ldr r3, .saved_sam9_lpr 285 - str r3, [r2, #AT91_DDRSDRC_LPR] 275 + ldr tmp1, .saved_sam9_lpr 276 + str tmp1, [sdramc, #AT91_DDRSDRC_LPR] 286 277 287 278 /* if we use the second ram controller */ 288 - cmp r5, #0 289 - ldrne r4, .saved_sam9_lpr1 290 - strne r4, [r5, #AT91_DDRSDRC_LPR] 279 + cmp ramc1, #0 280 + ldrne tmp2, .saved_sam9_lpr1 281 + strne tmp2, [ramc1, #AT91_DDRSDRC_LPR] 291 282 292 - #else 283 + b ram_restored 284 + 285 + /* 286 + * SDRAMC Memory controller 287 + */ 288 + sdr_en_restore: 293 289 /* Restore LPR on AT91 with SDRAM */ 294 - ldr r3, .saved_sam9_lpr 295 - str r3, [r2, #AT91_SDRAMC_LPR] 296 - #endif 290 + ldr tmp1, .saved_sam9_lpr 291 + str tmp1, [sdramc, #AT91_SDRAMC_LPR] 297 292 293 + ram_restored: 298 294 /* Restore registers, and return */ 299 - ldmfd sp!, {r0 - r12, pc} 295 + ldmfd sp!, {r4 - r12, pc} 300 296 301 297 302 298 .saved_mckr: ··· 327 295 328 296 .saved_sam9_lpr1: 329 297 .word 0 330 - 331 - .at91_va_base_pmc: 332 - .word AT91_VA_BASE_SYS + AT91_PMC 333 - 334 - #ifdef CONFIG_ARCH_AT91RM9200 335 - .at91_va_base_sdramc: 336 - .word AT91_VA_BASE_SYS 337 - #elif defined(CONFIG_ARCH_AT91SAM9G45) 338 - .at91_va_base_sdramc: 339 - .word AT91_VA_BASE_SYS + AT91_DDRSDRC0 340 - #else 341 - .at91_va_base_sdramc: 342 - .word AT91_VA_BASE_SYS + AT91_SDRAMC0 343 - #endif 344 - 345 - .at91_va_base_ramc1: 346 - #if defined(CONFIG_ARCH_AT91SAM9G45) 347 - .word AT91_VA_BASE_SYS + AT91_DDRSDRC1 348 - #else 349 - .word 0 350 - #endif 351 298 352 299 ENTRY(at91_slow_clock_sz) 353 300 .word .-at91_slow_clock
+9
arch/arm/mach-at91/setup.c
··· 276 276 panic("Impossible to ioremap at91_rstc_base\n"); 277 277 } 278 278 279 + void __iomem *at91_matrix_base; 280 + 281 + void __init at91_ioremap_matrix(u32 base_addr) 282 + { 283 + at91_matrix_base = ioremap(base_addr, 512); 284 + if (!at91_matrix_base) 285 + panic("Impossible to ioremap at91_matrix_base\n"); 286 + } 287 + 279 288 void __init at91_initialize(unsigned long main_clock) 280 289 { 281 290 at91_boot_soc.ioremap_registers();
+8
arch/arm/mach-imx/Kconfig
··· 373 373 Include support for IMX27 IPCAM platform. This includes specific 374 374 configurations for the board and its peripherals. 375 375 376 + config MACH_IMX27_DT 377 + bool "Support i.MX27 platforms from device tree" 378 + select SOC_IMX27 379 + select USE_OF 380 + help 381 + Include support for Freescale i.MX27 based platforms 382 + using the device tree for discovery 383 + 376 384 endif 377 385 378 386 if ARCH_IMX_V6_V7
+1
arch/arm/mach-imx/Makefile
··· 41 41 obj-$(CONFIG_MACH_PCA100) += mach-pca100.o 42 42 obj-$(CONFIG_MACH_MXT_TD60) += mach-mxt_td60.o 43 43 obj-$(CONFIG_MACH_IMX27IPCAM) += mach-imx27ipcam.o 44 + obj-$(CONFIG_MACH_IMX27_DT) += imx27-dt.o 44 45 45 46 # i.MX31 based machines 46 47 obj-$(CONFIG_MACH_MX31ADS) += mach-mx31ads.o
+3
arch/arm/mach-imx/Makefile.boot
··· 38 38 params_phys-$(CONFIG_SOC_IMX6Q) := 0x10000100 39 39 initrd_phys-$(CONFIG_SOC_IMX6Q) := 0x10800000 40 40 41 + dtb-$(CONFIG_MACH_IMX51_DT) += imx51-babbage.dtb 42 + dtb-$(CONFIG_MACH_IMX53_DT) += imx53-ard.dtb imx53-evk.dtb \ 43 + imx53-qsb.dtb imx53-smd.dtb 41 44 dtb-$(CONFIG_SOC_IMX6Q) += imx6q-arm2.dtb \ 42 45 imx6q-sabrelite.dtb
+18
arch/arm/mach-imx/clock-imx27.c
··· 22 22 #include <linux/io.h> 23 23 #include <linux/module.h> 24 24 #include <linux/clkdev.h> 25 + #include <linux/of.h> 25 26 26 27 #include <asm/div64.h> 27 28 ··· 765 764 return 0; 766 765 } 767 766 767 + #ifdef CONFIG_OF 768 + int __init mx27_clocks_init_dt(void) 769 + { 770 + struct device_node *np; 771 + u32 fref = 26000000; /* default */ 772 + 773 + for_each_compatible_node(np, NULL, "fixed-clock") { 774 + if (!of_device_is_compatible(np, "fsl,imx-osc26m")) 775 + continue; 776 + 777 + if (!of_property_read_u32(np, "clock-frequency", &fref)) 778 + break; 779 + } 780 + 781 + return mx27_clocks_init(fref); 782 + } 783 + #endif
+89
arch/arm/mach-imx/imx27-dt.c
··· 1 + /* 2 + * Copyright 2012 Sascha Hauer, Pengutronix 3 + * 4 + * The code contained herein is licensed under the GNU General Public 5 + * License. You may obtain a copy of the GNU General Public License 6 + * Version 2 or later at the following locations: 7 + * 8 + * http://www.opensource.org/licenses/gpl-license.html 9 + * http://www.gnu.org/copyleft/gpl.html 10 + */ 11 + 12 + #include <linux/irq.h> 13 + #include <linux/irqdomain.h> 14 + #include <linux/of_irq.h> 15 + #include <linux/of_platform.h> 16 + #include <asm/mach/arch.h> 17 + #include <asm/mach/time.h> 18 + #include <mach/common.h> 19 + #include <mach/mx27.h> 20 + 21 + static const struct of_dev_auxdata imx27_auxdata_lookup[] __initconst = { 22 + OF_DEV_AUXDATA("fsl,imx27-uart", MX27_UART1_BASE_ADDR, "imx21-uart.0", NULL), 23 + OF_DEV_AUXDATA("fsl,imx27-uart", MX27_UART2_BASE_ADDR, "imx21-uart.1", NULL), 24 + OF_DEV_AUXDATA("fsl,imx27-uart", MX27_UART3_BASE_ADDR, "imx21-uart.2", NULL), 25 + OF_DEV_AUXDATA("fsl,imx27-fec", MX27_FEC_BASE_ADDR, "imx27-fec.0", NULL), 26 + OF_DEV_AUXDATA("fsl,imx27-i2c", MX27_I2C1_BASE_ADDR, "imx-i2c.0", NULL), 27 + OF_DEV_AUXDATA("fsl,imx27-i2c", MX27_I2C2_BASE_ADDR, "imx-i2c.1", NULL), 28 + OF_DEV_AUXDATA("fsl,imx27-cspi", MX27_CSPI1_BASE_ADDR, "imx27-cspi.0", NULL), 29 + OF_DEV_AUXDATA("fsl,imx27-cspi", MX27_CSPI2_BASE_ADDR, "imx27-cspi.1", NULL), 30 + OF_DEV_AUXDATA("fsl,imx27-cspi", MX27_CSPI3_BASE_ADDR, "imx27-cspi.2", NULL), 31 + OF_DEV_AUXDATA("fsl,imx27-wdt", MX27_WDOG_BASE_ADDR, "imx2-wdt.0", NULL), 32 + { /* sentinel */ } 33 + }; 34 + 35 + static int __init imx27_avic_add_irq_domain(struct device_node *np, 36 + struct device_node *interrupt_parent) 37 + { 38 + irq_domain_add_simple(np, 0); 39 + return 0; 40 + } 41 + 42 + static int __init imx27_gpio_add_irq_domain(struct device_node *np, 43 + struct device_node *interrupt_parent) 44 + { 45 + static int gpio_irq_base = MXC_GPIO_IRQ_START + ARCH_NR_GPIOS; 46 + 47 + irq_domain_add_simple(np, gpio_irq_base); 48 + 49 + return 0; 50 + } 51 + 52 + static const struct of_device_id imx27_irq_match[] __initconst = { 53 + { .compatible = "fsl,imx27-avic", .data = imx27_avic_add_irq_domain, }, 54 + { .compatible = "fsl,imx27-gpio", .data = imx27_gpio_add_irq_domain, }, 55 + { /* sentinel */ } 56 + }; 57 + 58 + static void __init imx27_dt_init(void) 59 + { 60 + of_irq_init(imx27_irq_match); 61 + 62 + of_platform_populate(NULL, of_default_bus_match_table, 63 + imx27_auxdata_lookup, NULL); 64 + } 65 + 66 + static void __init imx27_timer_init(void) 67 + { 68 + mx27_clocks_init_dt(); 69 + } 70 + 71 + static struct sys_timer imx27_timer = { 72 + .init = imx27_timer_init, 73 + }; 74 + 75 + static const char *imx27_dt_board_compat[] __initdata = { 76 + "fsl,imx27", 77 + NULL 78 + }; 79 + 80 + DT_MACHINE_START(IMX27_DT, "Freescale i.MX27 (Device Tree Support)") 81 + .map_io = mx27_map_io, 82 + .init_early = imx27_init_early, 83 + .init_irq = mx27_init_irq, 84 + .handle_irq = imx27_handle_irq, 85 + .timer = &imx27_timer, 86 + .init_machine = imx27_dt_init, 87 + .dt_compat = imx27_dt_board_compat, 88 + .restart = mxc_restart, 89 + MACHINE_END
+1
arch/arm/mach-imx/imx51-dt.c
··· 104 104 105 105 static const char *imx51_dt_board_compat[] __initdata = { 106 106 "fsl,imx51-babbage", 107 + "fsl,imx51", 107 108 NULL 108 109 }; 109 110
+1
arch/arm/mach-imx/imx53-dt.c
··· 114 114 "fsl,imx53-evk", 115 115 "fsl,imx53-qsb", 116 116 "fsl,imx53-smd", 117 + "fsl,imx53", 117 118 NULL 118 119 }; 119 120
+1
arch/arm/mach-imx/mach-imx6q.c
··· 131 131 static const char *imx6q_dt_compat[] __initdata = { 132 132 "fsl,imx6q-arm2", 133 133 "fsl,imx6q-sabrelite", 134 + "fsl,imx6q", 134 135 NULL, 135 136 }; 136 137
+10
arch/arm/mach-mmp/Kconfig
··· 2 2 3 3 menu "Marvell PXA168/910/MMP2 Implmentations" 4 4 5 + config MACH_MMP_DT 6 + bool "Support MMP2 platforms from device tree" 7 + select CPU_PXA168 8 + select CPU_PXA910 9 + select USE_OF 10 + help 11 + Include support for Marvell MMP2 based platforms using 12 + the device tree. Needn't select any other machine while 13 + MACH_MMP_DT is enabled. 14 + 5 15 config MACH_ASPENITE 6 16 bool "Marvell's PXA168 Aspenite Development Board" 7 17 select CPU_PXA168
+1
arch/arm/mach-mmp/Makefile
··· 18 18 obj-$(CONFIG_MACH_BROWNSTONE) += brownstone.o 19 19 obj-$(CONFIG_MACH_FLINT) += flint.o 20 20 obj-$(CONFIG_MACH_MARVELL_JASPER) += jasper.o 21 + obj-$(CONFIG_MACH_MMP_DT) += mmp-dt.o 21 22 obj-$(CONFIG_MACH_TETON_BGA) += teton_bga.o 22 23 obj-$(CONFIG_MACH_GPLUGD) += gplugd.o
+75
arch/arm/mach-mmp/mmp-dt.c
··· 1 + /* 2 + * linux/arch/arm/mach-mmp/mmp-dt.c 3 + * 4 + * Copyright (C) 2012 Marvell Technology Group Ltd. 5 + * Author: Haojian Zhuang <haojian.zhuang@marvell.com> 6 + * 7 + * This program is free software; you can redistribute it and/or modify 8 + * it under the terms of the GNU General Public License version 2 as 9 + * publishhed by the Free Software Foundation. 10 + */ 11 + 12 + #include <linux/irq.h> 13 + #include <linux/irqdomain.h> 14 + #include <linux/of_irq.h> 15 + #include <linux/of_platform.h> 16 + #include <asm/mach/arch.h> 17 + #include <mach/irqs.h> 18 + 19 + #include "common.h" 20 + 21 + extern struct sys_timer pxa168_timer; 22 + extern void __init icu_init_irq(void); 23 + 24 + static const struct of_dev_auxdata mmp_auxdata_lookup[] __initconst = { 25 + OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4017000, "pxa2xx-uart.0", NULL), 26 + OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4018000, "pxa2xx-uart.1", NULL), 27 + OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4026000, "pxa2xx-uart.2", NULL), 28 + OF_DEV_AUXDATA("mrvl,mmp-twsi", 0xd4011000, "pxa2xx-i2c.0", NULL), 29 + OF_DEV_AUXDATA("mrvl,mmp-twsi", 0xd4025000, "pxa2xx-i2c.1", NULL), 30 + OF_DEV_AUXDATA("mrvl,mmp-gpio", 0xd4019000, "pxa-gpio", NULL), 31 + OF_DEV_AUXDATA("mrvl,mmp-rtc", 0xd4010000, "sa1100-rtc", NULL), 32 + {} 33 + }; 34 + 35 + static int __init mmp_intc_add_irq_domain(struct device_node *np, 36 + struct device_node *parent) 37 + { 38 + irq_domain_add_simple(np, 0); 39 + return 0; 40 + } 41 + 42 + static int __init mmp_gpio_add_irq_domain(struct device_node *np, 43 + struct device_node *parent) 44 + { 45 + irq_domain_add_simple(np, IRQ_GPIO_START); 46 + return 0; 47 + } 48 + 49 + static const struct of_device_id mmp_irq_match[] __initconst = { 50 + { .compatible = "mrvl,mmp-intc", .data = mmp_intc_add_irq_domain, }, 51 + { .compatible = "mrvl,mmp-gpio", .data = mmp_gpio_add_irq_domain, }, 52 + {} 53 + }; 54 + 55 + static void __init mmp_dt_init(void) 56 + { 57 + 58 + of_irq_init(mmp_irq_match); 59 + 60 + of_platform_populate(NULL, of_default_bus_match_table, 61 + mmp_auxdata_lookup, NULL); 62 + } 63 + 64 + static const char *pxa168_dt_board_compat[] __initdata = { 65 + "mrvl,pxa168-aspenite", 66 + NULL, 67 + }; 68 + 69 + DT_MACHINE_START(PXA168_DT, "Marvell PXA168 (Device Tree Support)") 70 + .map_io = mmp_map_io, 71 + .init_irq = icu_init_irq, 72 + .timer = &pxa168_timer, 73 + .init_machine = mmp_dt_init, 74 + .dt_compat = pxa168_dt_board_compat, 75 + MACHINE_END
+2
arch/arm/mach-mmp/pxa168.c
··· 64 64 static APBC_CLK(ssp5, PXA168_SSP5, 4, 0); 65 65 static APBC_CLK(gpio, PXA168_GPIO, 0, 13000000); 66 66 static APBC_CLK(keypad, PXA168_KPC, 0, 32000); 67 + static APBC_CLK(rtc, PXA168_RTC, 8, 32768); 67 68 68 69 static APMU_CLK(nand, NAND, 0x19b, 156000000); 69 70 static APMU_CLK(lcd, LCD, 0x7f, 312000000); ··· 93 92 INIT_CLKREG(&clk_keypad, "pxa27x-keypad", NULL), 94 93 INIT_CLKREG(&clk_eth, "pxa168-eth", "MFUCLK"), 95 94 INIT_CLKREG(&clk_usb, "pxa168-ehci", "PXA168-USBCLK"), 95 + INIT_CLKREG(&clk_rtc, "sa1100-rtc", NULL), 96 96 }; 97 97 98 98 static int __init pxa168_init(void)
-1
arch/arm/mach-omap2/Kconfig
··· 117 117 config MACH_OMAP_GENERIC 118 118 bool "Generic OMAP2+ board" 119 119 depends on ARCH_OMAP2PLUS 120 - select USE_OF 121 120 default y 122 121 help 123 122 Support for generic TI OMAP2+ boards using Flattened Device Tree.
+83 -90
arch/arm/mach-omap2/board-generic.c
··· 12 12 * published by the Free Software Foundation. 13 13 */ 14 14 #include <linux/io.h> 15 + #include <linux/of_irq.h> 15 16 #include <linux/of_platform.h> 16 17 #include <linux/irqdomain.h> 17 18 #include <linux/i2c/twl.h> ··· 25 24 #include "common.h" 26 25 #include "common-board-devices.h" 27 26 28 - /* 29 - * XXX: Still needed to boot until the i2c & twl driver is adapted to 30 - * device-tree 31 - */ 32 - #ifdef CONFIG_ARCH_OMAP4 33 - static struct twl4030_platform_data sdp4430_twldata = { 34 - .irq_base = TWL6030_IRQ_BASE, 35 - .irq_end = TWL6030_IRQ_END, 27 + #if !(defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)) 28 + #define omap_intc_of_init NULL 29 + #endif 30 + #ifndef CONFIG_ARCH_OMAP4 31 + #define gic_of_init NULL 32 + #endif 33 + 34 + static struct of_device_id irq_match[] __initdata = { 35 + { .compatible = "ti,omap2-intc", .data = omap_intc_of_init, }, 36 + { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, }, 37 + { } 36 38 }; 37 39 38 - static void __init omap4_i2c_init(void) 40 + static void __init omap_init_irq(void) 39 41 { 40 - omap4_pmic_init("twl6030", &sdp4430_twldata); 42 + of_irq_init(irq_match); 41 43 } 44 + 45 + static struct of_device_id omap_dt_match_table[] __initdata = { 46 + { .compatible = "simple-bus", }, 47 + { .compatible = "ti,omap-infra", }, 48 + { } 49 + }; 50 + 51 + static void __init omap_generic_init(void) 52 + { 53 + omap_sdrc_init(NULL, NULL); 54 + 55 + of_platform_populate(NULL, omap_dt_match_table, NULL, NULL); 56 + } 57 + 58 + #ifdef CONFIG_SOC_OMAP2420 59 + static const char *omap242x_boards_compat[] __initdata = { 60 + "ti,omap2420", 61 + NULL, 62 + }; 63 + 64 + DT_MACHINE_START(OMAP242X_DT, "Generic OMAP2420 (Flattened Device Tree)") 65 + .reserve = omap_reserve, 66 + .map_io = omap242x_map_io, 67 + .init_early = omap2420_init_early, 68 + .init_irq = omap_init_irq, 69 + .handle_irq = omap2_intc_handle_irq, 70 + .init_machine = omap_generic_init, 71 + .timer = &omap2_timer, 72 + .dt_compat = omap242x_boards_compat, 73 + .restart = omap_prcm_restart, 74 + MACHINE_END 75 + #endif 76 + 77 + #ifdef CONFIG_SOC_OMAP2430 78 + static const char *omap243x_boards_compat[] __initdata = { 79 + "ti,omap2430", 80 + NULL, 81 + }; 82 + 83 + DT_MACHINE_START(OMAP243X_DT, "Generic OMAP2430 (Flattened Device Tree)") 84 + .reserve = omap_reserve, 85 + .map_io = omap243x_map_io, 86 + .init_early = omap2430_init_early, 87 + .init_irq = omap_init_irq, 88 + .handle_irq = omap2_intc_handle_irq, 89 + .init_machine = omap_generic_init, 90 + .timer = &omap2_timer, 91 + .dt_compat = omap243x_boards_compat, 92 + .restart = omap_prcm_restart, 93 + MACHINE_END 42 94 #endif 43 95 44 96 #ifdef CONFIG_ARCH_OMAP3 ··· 104 50 { 105 51 omap3_pmic_init("twl4030", &beagle_twldata); 106 52 } 107 - #endif 108 53 109 - static struct of_device_id omap_dt_match_table[] __initdata = { 110 - { .compatible = "simple-bus", }, 111 - { .compatible = "ti,omap-infra", }, 112 - { } 113 - }; 114 - 115 - static struct of_device_id intc_match[] __initdata = { 116 - { .compatible = "ti,omap3-intc", }, 117 - { .compatible = "arm,cortex-a9-gic", }, 118 - { } 119 - }; 120 - 121 - static void __init omap_generic_init(void) 122 - { 123 - struct device_node *node = of_find_matching_node(NULL, intc_match); 124 - if (node) 125 - irq_domain_add_legacy(node, 32, 0, 0, &irq_domain_simple_ops, NULL); 126 - 127 - omap_sdrc_init(NULL, NULL); 128 - 129 - of_platform_populate(NULL, omap_dt_match_table, NULL, NULL); 130 - } 131 - 132 - #ifdef CONFIG_ARCH_OMAP4 133 - static void __init omap4_init(void) 134 - { 135 - omap4_i2c_init(); 136 - omap_generic_init(); 137 - } 138 - #endif 139 - 140 - #ifdef CONFIG_ARCH_OMAP3 141 54 static void __init omap3_init(void) 142 55 { 143 56 omap3_i2c_init(); 144 57 omap_generic_init(); 145 58 } 146 - #endif 147 59 148 - #if defined(CONFIG_SOC_OMAP2420) 149 - static const char *omap242x_boards_compat[] __initdata = { 150 - "ti,omap2420", 151 - NULL, 152 - }; 153 - 154 - DT_MACHINE_START(OMAP242X_DT, "Generic OMAP2420 (Flattened Device Tree)") 155 - .atag_offset = 0x100, 156 - .reserve = omap_reserve, 157 - .map_io = omap242x_map_io, 158 - .init_early = omap2420_init_early, 159 - .init_irq = omap2_init_irq, 160 - .handle_irq = omap2_intc_handle_irq, 161 - .init_machine = omap_generic_init, 162 - .timer = &omap2_timer, 163 - .dt_compat = omap242x_boards_compat, 164 - .restart = omap_prcm_restart, 165 - MACHINE_END 166 - #endif 167 - 168 - #if defined(CONFIG_SOC_OMAP2430) 169 - static const char *omap243x_boards_compat[] __initdata = { 170 - "ti,omap2430", 171 - NULL, 172 - }; 173 - 174 - DT_MACHINE_START(OMAP243X_DT, "Generic OMAP2430 (Flattened Device Tree)") 175 - .atag_offset = 0x100, 176 - .reserve = omap_reserve, 177 - .map_io = omap243x_map_io, 178 - .init_early = omap2430_init_early, 179 - .init_irq = omap2_init_irq, 180 - .handle_irq = omap2_intc_handle_irq, 181 - .init_machine = omap_generic_init, 182 - .timer = &omap2_timer, 183 - .dt_compat = omap243x_boards_compat, 184 - .restart = omap_prcm_restart, 185 - MACHINE_END 186 - #endif 187 - 188 - #if defined(CONFIG_ARCH_OMAP3) 189 60 static const char *omap3_boards_compat[] __initdata = { 190 61 "ti,omap3", 191 62 NULL, 192 63 }; 193 64 194 65 DT_MACHINE_START(OMAP3_DT, "Generic OMAP3 (Flattened Device Tree)") 195 - .atag_offset = 0x100, 196 66 .reserve = omap_reserve, 197 67 .map_io = omap3_map_io, 198 68 .init_early = omap3430_init_early, 199 - .init_irq = omap3_init_irq, 69 + .init_irq = omap_init_irq, 200 70 .handle_irq = omap3_intc_handle_irq, 201 71 .init_machine = omap3_init, 202 72 .timer = &omap3_timer, ··· 129 151 MACHINE_END 130 152 #endif 131 153 132 - #if defined(CONFIG_ARCH_OMAP4) 154 + #ifdef CONFIG_ARCH_OMAP4 155 + static struct twl4030_platform_data sdp4430_twldata = { 156 + .irq_base = TWL6030_IRQ_BASE, 157 + .irq_end = TWL6030_IRQ_END, 158 + }; 159 + 160 + static void __init omap4_i2c_init(void) 161 + { 162 + omap4_pmic_init("twl6030", &sdp4430_twldata); 163 + } 164 + 165 + static void __init omap4_init(void) 166 + { 167 + omap4_i2c_init(); 168 + omap_generic_init(); 169 + } 170 + 133 171 static const char *omap4_boards_compat[] __initdata = { 134 172 "ti,omap4", 135 173 NULL, 136 174 }; 137 175 138 176 DT_MACHINE_START(OMAP4_DT, "Generic OMAP4 (Flattened Device Tree)") 139 - .atag_offset = 0x100, 140 177 .reserve = omap_reserve, 141 178 .map_io = omap4_map_io, 142 179 .init_early = omap4430_init_early, 143 - .init_irq = gic_init_irq, 180 + .init_irq = omap_init_irq, 144 181 .handle_irq = gic_handle_irq, 145 182 .init_machine = omap4_init, 146 183 .timer = &omap4_timer,
+12
arch/arm/mach-omap2/common.h
··· 177 177 extern void __iomem *omap4_get_l2cache_base(void); 178 178 #endif 179 179 180 + struct device_node; 181 + #ifdef CONFIG_OF 182 + int __init omap_intc_of_init(struct device_node *node, 183 + struct device_node *parent); 184 + #else 185 + int __init omap_intc_of_init(struct device_node *node, 186 + struct device_node *parent) 187 + { 188 + return 0; 189 + } 190 + #endif 191 + 180 192 #ifdef CONFIG_SMP 181 193 extern void __iomem *omap4_get_scu_base(void); 182 194 #else
+50 -10
arch/arm/mach-omap2/irq.c
··· 11 11 * for more details. 12 12 */ 13 13 #include <linux/kernel.h> 14 + #include <linux/module.h> 14 15 #include <linux/init.h> 15 16 #include <linux/interrupt.h> 16 17 #include <linux/io.h> 17 18 18 19 #include <asm/exception.h> 19 20 #include <asm/mach/irq.h> 21 + #include <linux/irqdomain.h> 22 + #include <linux/of.h> 23 + #include <linux/of_address.h> 20 24 21 25 #include <mach/hardware.h> 22 26 ··· 63 59 .nr_irqs = 96, 64 60 }, 65 61 }; 62 + 63 + static struct irq_domain *domain; 66 64 67 65 /* Structure to save interrupt controller context */ 68 66 struct omap3_intc_regs { ··· 156 150 IRQ_NOREQUEST | IRQ_NOPROBE, 0); 157 151 } 158 152 159 - static void __init omap_init_irq(u32 base, int nr_irqs) 153 + static void __init omap_init_irq(u32 base, int nr_irqs, 154 + struct device_node *node) 160 155 { 161 156 void __iomem *omap_irq_base; 162 157 unsigned long nr_of_irqs = 0; 163 158 unsigned int nr_banks = 0; 164 - int i, j; 159 + int i, j, irq_base; 165 160 166 161 omap_irq_base = ioremap(base, SZ_4K); 167 162 if (WARN_ON(!omap_irq_base)) 168 163 return; 164 + 165 + irq_base = irq_alloc_descs(-1, 0, nr_irqs, 0); 166 + if (irq_base < 0) { 167 + pr_warn("Couldn't allocate IRQ numbers\n"); 168 + irq_base = 0; 169 + } 170 + 171 + domain = irq_domain_add_legacy(node, nr_irqs, irq_base, 0, 172 + &irq_domain_simple_ops, NULL); 169 173 170 174 for (i = 0; i < ARRAY_SIZE(irq_banks); i++) { 171 175 struct omap_irq_bank *bank = irq_banks + i; ··· 185 169 /* Static mapping, never released */ 186 170 bank->base_reg = ioremap(base, SZ_4K); 187 171 if (!bank->base_reg) { 188 - printk(KERN_ERR "Could not ioremap irq bank%i\n", i); 172 + pr_err("Could not ioremap irq bank%i\n", i); 189 173 continue; 190 174 } 191 175 192 176 omap_irq_bank_init_one(bank); 193 177 194 178 for (j = 0; j < bank->nr_irqs; j += 32) 195 - omap_alloc_gc(bank->base_reg + j, j, 32); 179 + omap_alloc_gc(bank->base_reg + j, j + irq_base, 32); 196 180 197 181 nr_of_irqs += bank->nr_irqs; 198 182 nr_banks++; 199 183 } 200 184 201 - printk(KERN_INFO "Total of %ld interrupts on %d active controller%s\n", 202 - nr_of_irqs, nr_banks, nr_banks > 1 ? "s" : ""); 185 + pr_info("Total of %ld interrupts on %d active controller%s\n", 186 + nr_of_irqs, nr_banks, nr_banks > 1 ? "s" : ""); 203 187 } 204 188 205 189 void __init omap2_init_irq(void) 206 190 { 207 - omap_init_irq(OMAP24XX_IC_BASE, 96); 191 + omap_init_irq(OMAP24XX_IC_BASE, 96, NULL); 208 192 } 209 193 210 194 void __init omap3_init_irq(void) 211 195 { 212 - omap_init_irq(OMAP34XX_IC_BASE, 96); 196 + omap_init_irq(OMAP34XX_IC_BASE, 96, NULL); 213 197 } 214 198 215 199 void __init ti81xx_init_irq(void) 216 200 { 217 - omap_init_irq(OMAP34XX_IC_BASE, 128); 201 + omap_init_irq(OMAP34XX_IC_BASE, 128, NULL); 218 202 } 219 203 220 204 static inline void omap_intc_handle_irq(void __iomem *base_addr, struct pt_regs *regs) ··· 244 228 irqnr = readl_relaxed(base_addr + INTCPS_SIR_IRQ_OFFSET); 245 229 irqnr &= ACTIVEIRQ_MASK; 246 230 247 - if (irqnr) 231 + if (irqnr) { 232 + irqnr = irq_find_mapping(domain, irqnr); 248 233 handle_IRQ(irqnr, regs); 234 + } 249 235 } while (irqnr); 250 236 } 251 237 ··· 255 237 { 256 238 void __iomem *base_addr = OMAP2_IRQ_BASE; 257 239 omap_intc_handle_irq(base_addr, regs); 240 + } 241 + 242 + int __init omap_intc_of_init(struct device_node *node, 243 + struct device_node *parent) 244 + { 245 + struct resource res; 246 + u32 nr_irqs = 96; 247 + 248 + if (WARN_ON(!node)) 249 + return -ENODEV; 250 + 251 + if (of_address_to_resource(node, 0, &res)) { 252 + WARN(1, "unable to get intc registers\n"); 253 + return -EINVAL; 254 + } 255 + 256 + if (of_property_read_u32(node, "ti,intc-size", &nr_irqs)) 257 + pr_warn("unable to get intc-size, default to %d\n", nr_irqs); 258 + 259 + omap_init_irq(res.start, nr_irqs, of_node_get(node)); 260 + 261 + return 0; 258 262 } 259 263 260 264 #ifdef CONFIG_ARCH_OMAP3
+8
arch/arm/mach-omap2/pm.c
··· 295 295 296 296 static int __init omap2_common_pm_late_init(void) 297 297 { 298 + /* 299 + * In the case of DT, the PMIC and SR initialization will be done using 300 + * a completely different mechanism. 301 + * Disable this part if a DT blob is available. 302 + */ 303 + if (of_have_populated_dt()) 304 + return 0; 305 + 298 306 /* Init the voltage layer */ 299 307 omap_pmic_late_init(); 300 308 omap_voltage_late_init();
+46 -5
arch/arm/mach-vexpress/Kconfig
··· 1 1 menu "Versatile Express platform type" 2 2 depends on ARCH_VEXPRESS 3 3 4 - config ARCH_VEXPRESS_CA9X4 5 - bool "Versatile Express Cortex-A9x4 tile" 6 - select CPU_V7 7 - select ARM_GIC 4 + config ARCH_VEXPRESS_CORTEX_A5_A9_ERRATA 5 + bool 8 6 select ARM_ERRATA_720789 9 7 select ARM_ERRATA_751472 10 - select PL310_ERRATA_753970 8 + select PL310_ERRATA_753970 if CACHE_PL310 9 + help 10 + Provides common dependencies for Versatile Express platforms 11 + based on Cortex-A5 and Cortex-A9 processors. In order to 12 + build a working kernel, you must also enable relevant core 13 + tile support or Flattened Device Tree based support options. 14 + 15 + config ARCH_VEXPRESS_CA9X4 16 + bool "Versatile Express Cortex-A9x4 tile" 17 + select ARCH_VEXPRESS_CORTEX_A5_A9_ERRATA 18 + select ARM_GIC 19 + select CPU_V7 11 20 select HAVE_SMP 12 21 select MIGHT_HAVE_CACHE_L2X0 22 + 23 + config ARCH_VEXPRESS_DT 24 + bool "Device Tree support for Versatile Express platforms" 25 + select ARCH_VEXPRESS_CORTEX_A5_A9_ERRATA 26 + select ARM_GIC 27 + select ARM_PATCH_PHYS_VIRT 28 + select AUTO_ZRELADDR 29 + select CPU_V7 30 + select HAVE_SMP 31 + select MIGHT_HAVE_CACHE_L2X0 32 + select USE_OF 33 + help 34 + New Versatile Express platforms require Flattened Device Tree to 35 + be passed to the kernel. 36 + 37 + This option enables support for systems using Cortex processor based 38 + ARM core and logic (FPGA) tiles on the Versatile Express motherboard, 39 + for example: 40 + 41 + - CoreTile Express A5x2 (V2P-CA5s) 42 + - CoreTile Express A9x4 (V2P-CA9) 43 + - CoreTile Express A15x2 (V2P-CA15) 44 + - LogicTile Express 13MG (V2F-2XV6) with A5, A7, A9 or A15 SMMs 45 + (Soft Macrocell Models) 46 + - Versatile Express RTSMs (Models) 47 + 48 + You must boot using a Flattened Device Tree in order to use these 49 + platforms. The traditional (ATAGs) boot method is not usable on 50 + these boards with this option. 51 + 52 + If your bootloader supports Flattened Device Tree based booting, 53 + say Y here. 13 54 14 55 endmenu
+6
arch/arm/mach-vexpress/Makefile.boot
··· 1 + # Those numbers are used only by the non-DT V2P-CA9 platform 2 + # The DT-enabled ones require CONFIG_AUTO_ZRELADDR=y 1 3 zreladdr-y += 0x60008000 2 4 params_phys-y := 0x60000100 3 5 initrd_phys-y := 0x60800000 6 + 7 + dtb-$(CONFIG_ARCH_VEXPRESS_DT) += vexpress-v2p-ca5s.dtb \ 8 + vexpress-v2p-ca9.dtb \ 9 + vexpress-v2p-ca15-tc1.dtb
+2
arch/arm/mach-vexpress/core.h
··· 3 3 4 4 /* Tile's peripherals static mappings should start here */ 5 5 #define V2T_PERIPH 0xf8200000 6 + 7 + void vexpress_dt_smp_map_io(void);
+26 -4
arch/arm/mach-vexpress/include/mach/debug-macro.S
··· 10 10 * published by the Free Software Foundation. 11 11 */ 12 12 13 - #define DEBUG_LL_UART_OFFSET 0x00009000 13 + #define DEBUG_LL_PHYS_BASE 0x10000000 14 + #define DEBUG_LL_UART_OFFSET 0x00009000 15 + 16 + #define DEBUG_LL_PHYS_BASE_RS1 0x1c000000 17 + #define DEBUG_LL_UART_OFFSET_RS1 0x00090000 18 + 19 + #define DEBUG_LL_VIRT_BASE 0xf8000000 14 20 15 21 .macro addruart,rp,rv,tmp 16 - mov \rp, #DEBUG_LL_UART_OFFSET 17 - orr \rv, \rp, #0xf8000000 @ virtual base 18 - orr \rp, \rp, #0x10000000 @ physical base 22 + 23 + @ Make an educated guess regarding the memory map: 24 + @ - the original A9 core tile, which has MPCore peripherals 25 + @ located at 0x1e000000, should use UART at 0x10009000 26 + @ - all other (RS1 complaint) tiles use UART mapped 27 + @ at 0x1c090000 28 + mrc p15, 4, \tmp, c15, c0, 0 29 + cmp \tmp, #0x1e000000 30 + 31 + @ Original memory map 32 + moveq \rp, #DEBUG_LL_UART_OFFSET 33 + orreq \rv, \rp, #DEBUG_LL_VIRT_BASE 34 + orreq \rp, \rp, #DEBUG_LL_PHYS_BASE 35 + 36 + @ RS1 memory map 37 + movne \rp, #DEBUG_LL_UART_OFFSET_RS1 38 + orrne \rv, \rp, #DEBUG_LL_VIRT_BASE 39 + orrne \rp, \rp, #DEBUG_LL_PHYS_BASE_RS1 40 + 19 41 .endm 20 42 21 43 #include <asm/hardware/debug-pl01x.S>
+1 -1
arch/arm/mach-vexpress/include/mach/irqs.h
··· 1 1 #define IRQ_LOCALTIMER 29 2 2 #define IRQ_LOCALWDOG 30 3 3 4 - #define NR_IRQS 128 4 + #define NR_IRQS 256
+6
arch/arm/mach-vexpress/include/mach/motherboard.h
··· 117 117 void v2m_flags_set(u32 data); 118 118 119 119 /* 120 + * Miscellaneous 121 + */ 122 + #define SYS_MISC_MASTERSITE (1 << 14) 123 + #define SYS_PROCIDx_HBI_MASK 0xfff 124 + 125 + /* 120 126 * Core tile IDs 121 127 */ 122 128 #define V2M_CT_ID_CA9 0x0c000191
+21 -1
arch/arm/mach-vexpress/include/mach/uncompress.h
··· 22 22 #define AMBA_UART_CR(base) (*(volatile unsigned char *)((base) + 0x30)) 23 23 #define AMBA_UART_FR(base) (*(volatile unsigned char *)((base) + 0x18)) 24 24 25 - #define get_uart_base() (0x10000000 + 0x00009000) 25 + #define UART_BASE 0x10009000 26 + #define UART_BASE_RS1 0x1c090000 27 + 28 + static unsigned long get_uart_base(void) 29 + { 30 + unsigned long mpcore_periph; 31 + 32 + /* 33 + * Make an educated guess regarding the memory map: 34 + * - the original A9 core tile, which has MPCore peripherals 35 + * located at 0x1e000000, should use UART at 0x10009000 36 + * - all other (RS1 complaint) tiles use UART mapped 37 + * at 0x1c090000 38 + */ 39 + asm("mrc p15, 4, %0, c15, c0, 0" : "=r" (mpcore_periph)); 40 + 41 + if (mpcore_periph == 0x1e000000) 42 + return UART_BASE; 43 + else 44 + return UART_BASE_RS1; 45 + } 26 46 27 47 /* 28 48 * This does not append a newline
+153 -2
arch/arm/mach-vexpress/platsmp.c
··· 12 12 #include <linux/errno.h> 13 13 #include <linux/smp.h> 14 14 #include <linux/io.h> 15 + #include <linux/of_fdt.h> 16 + 17 + #include <asm/smp_scu.h> 18 + #include <asm/hardware/gic.h> 19 + #include <asm/mach/map.h> 15 20 16 21 #include <mach/motherboard.h> 17 22 ··· 24 19 25 20 extern void versatile_secondary_startup(void); 26 21 22 + #if defined(CONFIG_OF) 23 + 24 + static enum { 25 + GENERIC_SCU, 26 + CORTEX_A9_SCU, 27 + } vexpress_dt_scu __initdata = GENERIC_SCU; 28 + 29 + static struct map_desc vexpress_dt_cortex_a9_scu_map __initdata = { 30 + .virtual = V2T_PERIPH, 31 + /* .pfn set in vexpress_dt_init_cortex_a9_scu() */ 32 + .length = SZ_128, 33 + .type = MT_DEVICE, 34 + }; 35 + 36 + static void *vexpress_dt_cortex_a9_scu_base __initdata; 37 + 38 + const static char *vexpress_dt_cortex_a9_match[] __initconst = { 39 + "arm,cortex-a5-scu", 40 + "arm,cortex-a9-scu", 41 + NULL 42 + }; 43 + 44 + static int __init vexpress_dt_find_scu(unsigned long node, 45 + const char *uname, int depth, void *data) 46 + { 47 + if (of_flat_dt_match(node, vexpress_dt_cortex_a9_match)) { 48 + phys_addr_t phys_addr; 49 + __be32 *reg = of_get_flat_dt_prop(node, "reg", NULL); 50 + 51 + if (WARN_ON(!reg)) 52 + return -EINVAL; 53 + 54 + phys_addr = be32_to_cpup(reg); 55 + vexpress_dt_scu = CORTEX_A9_SCU; 56 + 57 + vexpress_dt_cortex_a9_scu_map.pfn = __phys_to_pfn(phys_addr); 58 + iotable_init(&vexpress_dt_cortex_a9_scu_map, 1); 59 + vexpress_dt_cortex_a9_scu_base = ioremap(phys_addr, SZ_256); 60 + if (WARN_ON(!vexpress_dt_cortex_a9_scu_base)) 61 + return -EFAULT; 62 + } 63 + 64 + return 0; 65 + } 66 + 67 + void __init vexpress_dt_smp_map_io(void) 68 + { 69 + if (initial_boot_params) 70 + WARN_ON(of_scan_flat_dt(vexpress_dt_find_scu, NULL)); 71 + } 72 + 73 + static int __init vexpress_dt_cpus_num(unsigned long node, const char *uname, 74 + int depth, void *data) 75 + { 76 + static int prev_depth = -1; 77 + static int nr_cpus = -1; 78 + 79 + if (prev_depth > depth && nr_cpus > 0) 80 + return nr_cpus; 81 + 82 + if (nr_cpus < 0 && strcmp(uname, "cpus") == 0) 83 + nr_cpus = 0; 84 + 85 + if (nr_cpus >= 0) { 86 + const char *device_type = of_get_flat_dt_prop(node, 87 + "device_type", NULL); 88 + 89 + if (device_type && strcmp(device_type, "cpu") == 0) 90 + nr_cpus++; 91 + } 92 + 93 + prev_depth = depth; 94 + 95 + return 0; 96 + } 97 + 98 + static void __init vexpress_dt_smp_init_cpus(void) 99 + { 100 + int ncores = 0, i; 101 + 102 + switch (vexpress_dt_scu) { 103 + case GENERIC_SCU: 104 + ncores = of_scan_flat_dt(vexpress_dt_cpus_num, NULL); 105 + break; 106 + case CORTEX_A9_SCU: 107 + ncores = scu_get_core_count(vexpress_dt_cortex_a9_scu_base); 108 + break; 109 + default: 110 + WARN_ON(1); 111 + break; 112 + } 113 + 114 + if (ncores < 2) 115 + return; 116 + 117 + if (ncores > nr_cpu_ids) { 118 + pr_warn("SMP: %u cores greater than maximum (%u), clipping\n", 119 + ncores, nr_cpu_ids); 120 + ncores = nr_cpu_ids; 121 + } 122 + 123 + for (i = 0; i < ncores; ++i) 124 + set_cpu_possible(i, true); 125 + 126 + set_smp_cross_call(gic_raise_softirq); 127 + } 128 + 129 + static void __init vexpress_dt_smp_prepare_cpus(unsigned int max_cpus) 130 + { 131 + int i; 132 + 133 + switch (vexpress_dt_scu) { 134 + case GENERIC_SCU: 135 + for (i = 0; i < max_cpus; i++) 136 + set_cpu_present(i, true); 137 + break; 138 + case CORTEX_A9_SCU: 139 + scu_enable(vexpress_dt_cortex_a9_scu_base); 140 + break; 141 + default: 142 + WARN_ON(1); 143 + break; 144 + } 145 + } 146 + 147 + #else 148 + 149 + static void __init vexpress_dt_smp_init_cpus(void) 150 + { 151 + WARN_ON(1); 152 + } 153 + 154 + void __init vexpress_dt_smp_prepare_cpus(unsigned int max_cpus) 155 + { 156 + WARN_ON(1); 157 + } 158 + 159 + #endif 160 + 27 161 /* 28 162 * Initialise the CPU possible map early - this describes the CPUs 29 163 * which may be present or become present in the system. 30 164 */ 31 165 void __init smp_init_cpus(void) 32 166 { 33 - ct_desc->init_cpu_map(); 167 + if (ct_desc) 168 + ct_desc->init_cpu_map(); 169 + else 170 + vexpress_dt_smp_init_cpus(); 171 + 34 172 } 35 173 36 174 void __init platform_smp_prepare_cpus(unsigned int max_cpus) ··· 182 34 * Initialise the present map, which describes the set of CPUs 183 35 * actually populated at the present time. 184 36 */ 185 - ct_desc->smp_enable(max_cpus); 37 + if (ct_desc) 38 + ct_desc->smp_enable(max_cpus); 39 + else 40 + vexpress_dt_smp_prepare_cpus(max_cpus); 186 41 187 42 /* 188 43 * Write the address of secondary startup into the
+211 -2
arch/arm/mach-vexpress/v2m.c
··· 6 6 #include <linux/amba/mmci.h> 7 7 #include <linux/io.h> 8 8 #include <linux/init.h> 9 + #include <linux/of_address.h> 10 + #include <linux/of_fdt.h> 11 + #include <linux/of_irq.h> 12 + #include <linux/of_platform.h> 9 13 #include <linux/platform_device.h> 10 14 #include <linux/ata_platform.h> 11 15 #include <linux/smsc911x.h> ··· 25 21 #include <asm/mach/map.h> 26 22 #include <asm/mach/time.h> 27 23 #include <asm/hardware/arm_timer.h> 24 + #include <asm/hardware/cache-l2x0.h> 25 + #include <asm/hardware/gic.h> 28 26 #include <asm/hardware/timer-sp.h> 29 27 #include <asm/hardware/sp810.h> 30 28 #include <asm/hardware/gic.h> ··· 436 430 ct_desc = ct_descs[i]; 437 431 438 432 if (!ct_desc) 439 - panic("vexpress: failed to populate core tile description " 440 - "for tile ID 0x%8x\n", current_tile_id); 433 + panic("vexpress: this kernel does not support core tile ID 0x%08x when booting via ATAGs.\n" 434 + "You may need a device tree blob or a different kernel to boot on this board.\n", 435 + current_tile_id); 441 436 } 442 437 443 438 static void __init v2m_map_io(void) ··· 483 476 .init_machine = v2m_init, 484 477 .restart = v2m_restart, 485 478 MACHINE_END 479 + 480 + #if defined(CONFIG_ARCH_VEXPRESS_DT) 481 + 482 + static struct map_desc v2m_rs1_io_desc __initdata = { 483 + .virtual = V2M_PERIPH, 484 + .pfn = __phys_to_pfn(0x1c000000), 485 + .length = SZ_2M, 486 + .type = MT_DEVICE, 487 + }; 488 + 489 + static int __init v2m_dt_scan_memory_map(unsigned long node, const char *uname, 490 + int depth, void *data) 491 + { 492 + const char **map = data; 493 + 494 + if (strcmp(uname, "motherboard") != 0) 495 + return 0; 496 + 497 + *map = of_get_flat_dt_prop(node, "arm,v2m-memory-map", NULL); 498 + 499 + return 1; 500 + } 501 + 502 + void __init v2m_dt_map_io(void) 503 + { 504 + const char *map = NULL; 505 + 506 + of_scan_flat_dt(v2m_dt_scan_memory_map, &map); 507 + 508 + if (map && strcmp(map, "rs1") == 0) 509 + iotable_init(&v2m_rs1_io_desc, 1); 510 + else 511 + iotable_init(v2m_io_desc, ARRAY_SIZE(v2m_io_desc)); 512 + 513 + #if defined(CONFIG_SMP) 514 + vexpress_dt_smp_map_io(); 515 + #endif 516 + } 517 + 518 + static struct clk_lookup v2m_dt_lookups[] = { 519 + { /* AMBA bus clock */ 520 + .con_id = "apb_pclk", 521 + .clk = &dummy_apb_pclk, 522 + }, { /* SP804 timers */ 523 + .dev_id = "sp804", 524 + .con_id = "v2m-timer0", 525 + .clk = &v2m_sp804_clk, 526 + }, { /* SP804 timers */ 527 + .dev_id = "sp804", 528 + .con_id = "v2m-timer1", 529 + .clk = &v2m_sp804_clk, 530 + }, { /* PL180 MMCI */ 531 + .dev_id = "mb:mmci", /* 10005000.mmci */ 532 + .clk = &osc2_clk, 533 + }, { /* PL050 KMI0 */ 534 + .dev_id = "10006000.kmi", 535 + .clk = &osc2_clk, 536 + }, { /* PL050 KMI1 */ 537 + .dev_id = "10007000.kmi", 538 + .clk = &osc2_clk, 539 + }, { /* PL011 UART0 */ 540 + .dev_id = "10009000.uart", 541 + .clk = &osc2_clk, 542 + }, { /* PL011 UART1 */ 543 + .dev_id = "1000a000.uart", 544 + .clk = &osc2_clk, 545 + }, { /* PL011 UART2 */ 546 + .dev_id = "1000b000.uart", 547 + .clk = &osc2_clk, 548 + }, { /* PL011 UART3 */ 549 + .dev_id = "1000c000.uart", 550 + .clk = &osc2_clk, 551 + }, { /* SP805 WDT */ 552 + .dev_id = "1000f000.wdt", 553 + .clk = &v2m_ref_clk, 554 + }, { /* PL111 CLCD */ 555 + .dev_id = "1001f000.clcd", 556 + .clk = &osc1_clk, 557 + }, 558 + /* RS1 memory map */ 559 + { /* PL180 MMCI */ 560 + .dev_id = "mb:mmci", /* 1c050000.mmci */ 561 + .clk = &osc2_clk, 562 + }, { /* PL050 KMI0 */ 563 + .dev_id = "1c060000.kmi", 564 + .clk = &osc2_clk, 565 + }, { /* PL050 KMI1 */ 566 + .dev_id = "1c070000.kmi", 567 + .clk = &osc2_clk, 568 + }, { /* PL011 UART0 */ 569 + .dev_id = "1c090000.uart", 570 + .clk = &osc2_clk, 571 + }, { /* PL011 UART1 */ 572 + .dev_id = "1c0a0000.uart", 573 + .clk = &osc2_clk, 574 + }, { /* PL011 UART2 */ 575 + .dev_id = "1c0b0000.uart", 576 + .clk = &osc2_clk, 577 + }, { /* PL011 UART3 */ 578 + .dev_id = "1c0c0000.uart", 579 + .clk = &osc2_clk, 580 + }, { /* SP805 WDT */ 581 + .dev_id = "1c0f0000.wdt", 582 + .clk = &v2m_ref_clk, 583 + }, { /* PL111 CLCD */ 584 + .dev_id = "1c1f0000.clcd", 585 + .clk = &osc1_clk, 586 + }, 587 + }; 588 + 589 + void __init v2m_dt_init_early(void) 590 + { 591 + struct device_node *node; 592 + u32 dt_hbi; 593 + 594 + node = of_find_compatible_node(NULL, NULL, "arm,vexpress-sysreg"); 595 + v2m_sysreg_base = of_iomap(node, 0); 596 + if (WARN_ON(!v2m_sysreg_base)) 597 + return; 598 + 599 + /* Confirm board type against DT property, if available */ 600 + if (of_property_read_u32(allnodes, "arm,hbi", &dt_hbi) == 0) { 601 + u32 misc = readl(v2m_sysreg_base + V2M_SYS_MISC); 602 + u32 id = readl(v2m_sysreg_base + (misc & SYS_MISC_MASTERSITE ? 603 + V2M_SYS_PROCID1 : V2M_SYS_PROCID0)); 604 + u32 hbi = id & SYS_PROCIDx_HBI_MASK; 605 + 606 + if (WARN_ON(dt_hbi != hbi)) 607 + pr_warning("vexpress: DT HBI (%x) is not matching " 608 + "hardware (%x)!\n", dt_hbi, hbi); 609 + } 610 + 611 + clkdev_add_table(v2m_dt_lookups, ARRAY_SIZE(v2m_dt_lookups)); 612 + versatile_sched_clock_init(v2m_sysreg_base + V2M_SYS_24MHZ, 24000000); 613 + } 614 + 615 + static struct of_device_id vexpress_irq_match[] __initdata = { 616 + { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, }, 617 + {} 618 + }; 619 + 620 + static void __init v2m_dt_init_irq(void) 621 + { 622 + of_irq_init(vexpress_irq_match); 623 + } 624 + 625 + static void __init v2m_dt_timer_init(void) 626 + { 627 + struct device_node *node; 628 + const char *path; 629 + int err; 630 + 631 + node = of_find_compatible_node(NULL, NULL, "arm,sp810"); 632 + v2m_sysctl_init(of_iomap(node, 0)); 633 + 634 + err = of_property_read_string(of_aliases, "arm,v2m_timer", &path); 635 + if (WARN_ON(err)) 636 + return; 637 + node = of_find_node_by_path(path); 638 + v2m_sp804_init(of_iomap(node, 0), irq_of_parse_and_map(node, 0)); 639 + } 640 + 641 + static struct sys_timer v2m_dt_timer = { 642 + .init = v2m_dt_timer_init, 643 + }; 644 + 645 + static struct of_dev_auxdata v2m_dt_auxdata_lookup[] __initdata = { 646 + OF_DEV_AUXDATA("arm,vexpress-flash", V2M_NOR0, "physmap-flash", 647 + &v2m_flash_data), 648 + OF_DEV_AUXDATA("arm,primecell", V2M_MMCI, "mb:mmci", &v2m_mmci_data), 649 + /* RS1 memory map */ 650 + OF_DEV_AUXDATA("arm,vexpress-flash", 0x08000000, "physmap-flash", 651 + &v2m_flash_data), 652 + OF_DEV_AUXDATA("arm,primecell", 0x1c050000, "mb:mmci", &v2m_mmci_data), 653 + {} 654 + }; 655 + 656 + static void __init v2m_dt_init(void) 657 + { 658 + l2x0_of_init(0x00400000, 0xfe0fffff); 659 + of_platform_populate(NULL, of_default_bus_match_table, 660 + v2m_dt_auxdata_lookup, NULL); 661 + pm_power_off = v2m_power_off; 662 + } 663 + 664 + const static char *v2m_dt_match[] __initconst = { 665 + "arm,vexpress", 666 + NULL, 667 + }; 668 + 669 + DT_MACHINE_START(VEXPRESS_DT, "ARM-Versatile Express") 670 + .dt_compat = v2m_dt_match, 671 + .map_io = v2m_dt_map_io, 672 + .init_early = v2m_dt_init_early, 673 + .init_irq = v2m_dt_init_irq, 674 + .timer = &v2m_dt_timer, 675 + .init_machine = v2m_dt_init, 676 + .handle_irq = gic_handle_irq, 677 + .restart = v2m_restart, 678 + MACHINE_END 679 + 680 + #endif
+1
arch/arm/plat-mxc/include/mach/common.h
··· 65 65 unsigned long ckih1, unsigned long ckih2); 66 66 extern int mx53_clocks_init(unsigned long ckil, unsigned long osc, 67 67 unsigned long ckih1, unsigned long ckih2); 68 + extern int mx27_clocks_init_dt(void); 68 69 extern int mx51_clocks_init_dt(void); 69 70 extern int mx53_clocks_init_dt(void); 70 71 extern int mx6q_clocks_init(void);
+3
arch/arm/plat-omap/Kconfig
··· 14 14 select CLKDEV_LOOKUP 15 15 select CLKSRC_MMIO 16 16 select GENERIC_IRQ_CHIP 17 + select IRQ_DOMAIN 17 18 select HAVE_IDE 18 19 select NEED_MACH_MEMORY_H 19 20 help ··· 25 24 select CLKDEV_LOOKUP 26 25 select GENERIC_IRQ_CHIP 27 26 select OMAP_DM_TIMER 27 + select USE_OF 28 + select PROC_DEVICETREE if PROC_FS 28 29 help 29 30 "Systems based on OMAP2, OMAP3 or OMAP4" 30 31
+1 -1
arch/arm/plat-omap/omap_device.c
··· 340 340 341 341 oh_cnt = of_property_count_strings(node, "ti,hwmods"); 342 342 if (!oh_cnt || IS_ERR_VALUE(oh_cnt)) { 343 - dev_warn(&pdev->dev, "No 'hwmods' to build omap_device\n"); 343 + dev_dbg(&pdev->dev, "No 'hwmods' to build omap_device\n"); 344 344 return -ENODEV; 345 345 } 346 346
-2
arch/avr32/mach-at32ap/at32ap700x.c
··· 1055 1055 return at32_usarts[id]; 1056 1056 } 1057 1057 1058 - struct platform_device *atmel_default_console_device; 1059 - 1060 1058 void __init at32_setup_serial_console(unsigned int usart_id) 1061 1059 { 1062 1060 atmel_default_console_device = at32_usarts[usart_id];
+62 -28
drivers/clocksource/tcb_clksrc.c
··· 19 19 * - Two channels combine to create a free-running 32 bit counter 20 20 * with a base rate of 5+ MHz, packaged as a clocksource (with 21 21 * resolution better than 200 nsec). 22 + * - Some chips support 32 bit counter. A single channel is used for 23 + * this 32 bit free-running counter. the second channel is not used. 22 24 * 23 25 * - The third channel may be used to provide a 16-bit clockevent 24 26 * source, used in either periodic or oneshot mode. This runs ··· 54 52 55 53 raw_local_irq_restore(flags); 56 54 return (upper << 16) | lower; 55 + } 56 + 57 + static cycle_t tc_get_cycles32(struct clocksource *cs) 58 + { 59 + return __raw_readl(tcaddr + ATMEL_TC_REG(0, CV)); 57 60 } 58 61 59 62 static struct clocksource clksrc = { ··· 216 209 217 210 #endif 218 211 212 + static void __init tcb_setup_dual_chan(struct atmel_tc *tc, int mck_divisor_idx) 213 + { 214 + /* channel 0: waveform mode, input mclk/8, clock TIOA0 on overflow */ 215 + __raw_writel(mck_divisor_idx /* likely divide-by-8 */ 216 + | ATMEL_TC_WAVE 217 + | ATMEL_TC_WAVESEL_UP /* free-run */ 218 + | ATMEL_TC_ACPA_SET /* TIOA0 rises at 0 */ 219 + | ATMEL_TC_ACPC_CLEAR, /* (duty cycle 50%) */ 220 + tcaddr + ATMEL_TC_REG(0, CMR)); 221 + __raw_writel(0x0000, tcaddr + ATMEL_TC_REG(0, RA)); 222 + __raw_writel(0x8000, tcaddr + ATMEL_TC_REG(0, RC)); 223 + __raw_writel(0xff, tcaddr + ATMEL_TC_REG(0, IDR)); /* no irqs */ 224 + __raw_writel(ATMEL_TC_CLKEN, tcaddr + ATMEL_TC_REG(0, CCR)); 225 + 226 + /* channel 1: waveform mode, input TIOA0 */ 227 + __raw_writel(ATMEL_TC_XC1 /* input: TIOA0 */ 228 + | ATMEL_TC_WAVE 229 + | ATMEL_TC_WAVESEL_UP, /* free-run */ 230 + tcaddr + ATMEL_TC_REG(1, CMR)); 231 + __raw_writel(0xff, tcaddr + ATMEL_TC_REG(1, IDR)); /* no irqs */ 232 + __raw_writel(ATMEL_TC_CLKEN, tcaddr + ATMEL_TC_REG(1, CCR)); 233 + 234 + /* chain channel 0 to channel 1*/ 235 + __raw_writel(ATMEL_TC_TC1XC1S_TIOA0, tcaddr + ATMEL_TC_BMR); 236 + /* then reset all the timers */ 237 + __raw_writel(ATMEL_TC_SYNC, tcaddr + ATMEL_TC_BCR); 238 + } 239 + 240 + static void __init tcb_setup_single_chan(struct atmel_tc *tc, int mck_divisor_idx) 241 + { 242 + /* channel 0: waveform mode, input mclk/8 */ 243 + __raw_writel(mck_divisor_idx /* likely divide-by-8 */ 244 + | ATMEL_TC_WAVE 245 + | ATMEL_TC_WAVESEL_UP, /* free-run */ 246 + tcaddr + ATMEL_TC_REG(0, CMR)); 247 + __raw_writel(0xff, tcaddr + ATMEL_TC_REG(0, IDR)); /* no irqs */ 248 + __raw_writel(ATMEL_TC_CLKEN, tcaddr + ATMEL_TC_REG(0, CCR)); 249 + 250 + /* then reset all the timers */ 251 + __raw_writel(ATMEL_TC_SYNC, tcaddr + ATMEL_TC_BCR); 252 + } 253 + 219 254 static int __init tcb_clksrc_init(void) 220 255 { 221 256 static char bootinfo[] __initdata ··· 309 260 divided_rate / 1000000, 310 261 ((divided_rate + 500000) % 1000000) / 1000); 311 262 312 - /* tclib will give us three clocks no matter what the 313 - * underlying platform supports. 314 - */ 315 - clk_enable(tc->clk[1]); 316 - 317 - /* channel 0: waveform mode, input mclk/8, clock TIOA0 on overflow */ 318 - __raw_writel(best_divisor_idx /* likely divide-by-8 */ 319 - | ATMEL_TC_WAVE 320 - | ATMEL_TC_WAVESEL_UP /* free-run */ 321 - | ATMEL_TC_ACPA_SET /* TIOA0 rises at 0 */ 322 - | ATMEL_TC_ACPC_CLEAR, /* (duty cycle 50%) */ 323 - tcaddr + ATMEL_TC_REG(0, CMR)); 324 - __raw_writel(0x0000, tcaddr + ATMEL_TC_REG(0, RA)); 325 - __raw_writel(0x8000, tcaddr + ATMEL_TC_REG(0, RC)); 326 - __raw_writel(0xff, tcaddr + ATMEL_TC_REG(0, IDR)); /* no irqs */ 327 - __raw_writel(ATMEL_TC_CLKEN, tcaddr + ATMEL_TC_REG(0, CCR)); 328 - 329 - /* channel 1: waveform mode, input TIOA0 */ 330 - __raw_writel(ATMEL_TC_XC1 /* input: TIOA0 */ 331 - | ATMEL_TC_WAVE 332 - | ATMEL_TC_WAVESEL_UP, /* free-run */ 333 - tcaddr + ATMEL_TC_REG(1, CMR)); 334 - __raw_writel(0xff, tcaddr + ATMEL_TC_REG(1, IDR)); /* no irqs */ 335 - __raw_writel(ATMEL_TC_CLKEN, tcaddr + ATMEL_TC_REG(1, CCR)); 336 - 337 - /* chain channel 0 to channel 1, then reset all the timers */ 338 - __raw_writel(ATMEL_TC_TC1XC1S_TIOA0, tcaddr + ATMEL_TC_BMR); 339 - __raw_writel(ATMEL_TC_SYNC, tcaddr + ATMEL_TC_BCR); 263 + if (tc->tcb_config && tc->tcb_config->counter_width == 32) { 264 + /* use apropriate function to read 32 bit counter */ 265 + clksrc.read = tc_get_cycles32; 266 + /* setup ony channel 0 */ 267 + tcb_setup_single_chan(tc, best_divisor_idx); 268 + } else { 269 + /* tclib will give us three clocks no matter what the 270 + * underlying platform supports. 271 + */ 272 + clk_enable(tc->clk[1]); 273 + /* setup both channel 0 & 1 */ 274 + tcb_setup_dual_chan(tc, best_divisor_idx); 275 + } 340 276 341 277 /* and away we go! */ 342 278 clocksource_register_hz(&clksrc, divided_rate);
+75 -22
drivers/i2c/busses/i2c-pxa.c
··· 29 29 #include <linux/errno.h> 30 30 #include <linux/interrupt.h> 31 31 #include <linux/i2c-pxa.h> 32 + #include <linux/of.h> 33 + #include <linux/of_device.h> 32 34 #include <linux/of_i2c.h> 33 35 #include <linux/platform_device.h> 34 36 #include <linux/err.h> ··· 1046 1044 .functionality = i2c_pxa_functionality, 1047 1045 }; 1048 1046 1047 + static struct of_device_id i2c_pxa_dt_ids[] = { 1048 + { .compatible = "mrvl,pxa-i2c", .data = (void *)REGS_PXA2XX }, 1049 + { .compatible = "mrvl,pwri2c", .data = (void *)REGS_PXA3XX }, 1050 + { .compatible = "mrvl,mmp-twsi", .data = (void *)REGS_PXA2XX }, 1051 + {} 1052 + }; 1053 + MODULE_DEVICE_TABLE(of, i2c_pxa_dt_ids); 1054 + 1055 + static int i2c_pxa_probe_dt(struct platform_device *pdev, struct pxa_i2c *i2c, 1056 + enum pxa_i2c_types *i2c_types) 1057 + { 1058 + struct device_node *np = pdev->dev.of_node; 1059 + const struct of_device_id *of_id = 1060 + of_match_device(i2c_pxa_dt_ids, &pdev->dev); 1061 + int ret; 1062 + 1063 + if (!of_id) 1064 + return 1; 1065 + ret = of_alias_get_id(np, "i2c"); 1066 + if (ret < 0) { 1067 + dev_err(&pdev->dev, "failed to get alias id, errno %d\n", ret); 1068 + return ret; 1069 + } 1070 + pdev->id = ret; 1071 + if (of_get_property(np, "mrvl,i2c-polling", NULL)) 1072 + i2c->use_pio = 1; 1073 + if (of_get_property(np, "mrvl,i2c-fast-mode", NULL)) 1074 + i2c->fast_mode = 1; 1075 + *i2c_types = (u32)(of_id->data); 1076 + return 0; 1077 + } 1078 + 1079 + static int i2c_pxa_probe_pdata(struct platform_device *pdev, 1080 + struct pxa_i2c *i2c, 1081 + enum pxa_i2c_types *i2c_types) 1082 + { 1083 + struct i2c_pxa_platform_data *plat = pdev->dev.platform_data; 1084 + const struct platform_device_id *id = platform_get_device_id(pdev); 1085 + 1086 + *i2c_types = id->driver_data; 1087 + if (plat) { 1088 + i2c->use_pio = plat->use_pio; 1089 + i2c->fast_mode = plat->fast_mode; 1090 + } 1091 + return 0; 1092 + } 1093 + 1049 1094 static int i2c_pxa_probe(struct platform_device *dev) 1050 1095 { 1051 - struct pxa_i2c *i2c; 1052 - struct resource *res; 1053 1096 struct i2c_pxa_platform_data *plat = dev->dev.platform_data; 1054 - const struct platform_device_id *id = platform_get_device_id(dev); 1055 - enum pxa_i2c_types i2c_type = id->driver_data; 1056 - int ret; 1057 - int irq; 1058 - 1059 - res = platform_get_resource(dev, IORESOURCE_MEM, 0); 1060 - irq = platform_get_irq(dev, 0); 1061 - if (res == NULL || irq < 0) 1062 - return -ENODEV; 1063 - 1064 - if (!request_mem_region(res->start, resource_size(res), res->name)) 1065 - return -ENOMEM; 1097 + enum pxa_i2c_types i2c_type; 1098 + struct pxa_i2c *i2c; 1099 + struct resource *res = NULL; 1100 + int ret, irq; 1066 1101 1067 1102 i2c = kzalloc(sizeof(struct pxa_i2c), GFP_KERNEL); 1068 1103 if (!i2c) { 1069 1104 ret = -ENOMEM; 1070 1105 goto emalloc; 1106 + } 1107 + 1108 + ret = i2c_pxa_probe_dt(dev, i2c, &i2c_type); 1109 + if (ret > 0) 1110 + ret = i2c_pxa_probe_pdata(dev, i2c, &i2c_type); 1111 + if (ret < 0) 1112 + goto eclk; 1113 + 1114 + res = platform_get_resource(dev, IORESOURCE_MEM, 0); 1115 + irq = platform_get_irq(dev, 0); 1116 + if (res == NULL || irq < 0) { 1117 + ret = -ENODEV; 1118 + goto eclk; 1119 + } 1120 + 1121 + if (!request_mem_region(res->start, resource_size(res), res->name)) { 1122 + ret = -ENOMEM; 1123 + goto eclk; 1071 1124 } 1072 1125 1073 1126 i2c->adap.owner = THIS_MODULE; ··· 1166 1109 1167 1110 i2c->slave_addr = I2C_PXA_SLAVE_ADDR; 1168 1111 1169 - #ifdef CONFIG_I2C_PXA_SLAVE 1170 1112 if (plat) { 1113 + #ifdef CONFIG_I2C_PXA_SLAVE 1171 1114 i2c->slave_addr = plat->slave_addr; 1172 1115 i2c->slave = plat->slave; 1173 - } 1174 1116 #endif 1117 + i2c->adap.class = plat->class; 1118 + } 1175 1119 1176 1120 clk_enable(i2c->clk); 1177 - 1178 - if (plat) { 1179 - i2c->adap.class = plat->class; 1180 - i2c->use_pio = plat->use_pio; 1181 - i2c->fast_mode = plat->fast_mode; 1182 - } 1183 1121 1184 1122 if (i2c->use_pio) { 1185 1123 i2c->adap.algo = &i2c_pxa_pio_algorithm; ··· 1286 1234 .name = "pxa2xx-i2c", 1287 1235 .owner = THIS_MODULE, 1288 1236 .pm = I2C_PXA_DEV_PM_OPS, 1237 + .of_match_table = i2c_pxa_dt_ids, 1289 1238 }, 1290 1239 .id_table = i2c_pxa_id_table, 1291 1240 };
+54 -10
drivers/misc/atmel_tclib.c
··· 6 6 #include <linux/ioport.h> 7 7 #include <linux/kernel.h> 8 8 #include <linux/platform_device.h> 9 + #include <linux/module.h> 9 10 #include <linux/slab.h> 10 11 #include <linux/export.h> 11 - 12 - /* Number of bytes to reserve for the iomem resource */ 13 - #define ATMEL_TC_IOMEM_SIZE 256 14 - 12 + #include <linux/of.h> 15 13 16 14 /* 17 15 * This is a thin library to solve the problem of how to portably allocate ··· 46 48 struct atmel_tc *tc; 47 49 struct platform_device *pdev = NULL; 48 50 struct resource *r; 51 + size_t size; 49 52 50 53 spin_lock(&tc_list_lock); 51 54 list_for_each_entry(tc, &tc_list, node) { 52 - if (tc->pdev->id == block) { 55 + if (tc->pdev->dev.of_node) { 56 + if (of_alias_get_id(tc->pdev->dev.of_node, "tcb") 57 + == block) { 58 + pdev = tc->pdev; 59 + break; 60 + } 61 + } else if (tc->pdev->id == block) { 53 62 pdev = tc->pdev; 54 63 break; 55 64 } ··· 66 61 goto fail; 67 62 68 63 r = platform_get_resource(pdev, IORESOURCE_MEM, 0); 69 - r = request_mem_region(r->start, ATMEL_TC_IOMEM_SIZE, name); 70 64 if (!r) 71 65 goto fail; 72 66 73 - tc->regs = ioremap(r->start, ATMEL_TC_IOMEM_SIZE); 67 + size = resource_size(r); 68 + r = request_mem_region(r->start, size, name); 69 + if (!r) 70 + goto fail; 71 + 72 + tc->regs = ioremap(r->start, size); 74 73 if (!tc->regs) 75 74 goto fail_ioremap; 76 75 ··· 85 76 return tc; 86 77 87 78 fail_ioremap: 88 - release_mem_region(r->start, ATMEL_TC_IOMEM_SIZE); 79 + release_mem_region(r->start, size); 89 80 fail: 90 81 tc = NULL; 91 82 goto out; ··· 105 96 spin_lock(&tc_list_lock); 106 97 if (tc->regs) { 107 98 iounmap(tc->regs); 108 - release_mem_region(tc->iomem->start, ATMEL_TC_IOMEM_SIZE); 99 + release_mem_region(tc->iomem->start, resource_size(tc->iomem)); 109 100 tc->regs = NULL; 110 101 tc->iomem = NULL; 111 102 } 112 103 spin_unlock(&tc_list_lock); 113 104 } 114 105 EXPORT_SYMBOL_GPL(atmel_tc_free); 106 + 107 + #if defined(CONFIG_OF) 108 + static struct atmel_tcb_config tcb_rm9200_config = { 109 + .counter_width = 16, 110 + }; 111 + 112 + static struct atmel_tcb_config tcb_sam9x5_config = { 113 + .counter_width = 32, 114 + }; 115 + 116 + static const struct of_device_id atmel_tcb_dt_ids[] = { 117 + { 118 + .compatible = "atmel,at91rm9200-tcb", 119 + .data = &tcb_rm9200_config, 120 + }, { 121 + .compatible = "atmel,at91sam9x5-tcb", 122 + .data = &tcb_sam9x5_config, 123 + }, { 124 + /* sentinel */ 125 + } 126 + }; 127 + 128 + MODULE_DEVICE_TABLE(of, atmel_tcb_dt_ids); 129 + #endif 115 130 116 131 static int __init tc_probe(struct platform_device *pdev) 117 132 { ··· 162 129 return -EINVAL; 163 130 } 164 131 132 + /* Now take SoC information if available */ 133 + if (pdev->dev.of_node) { 134 + const struct of_device_id *match; 135 + match = of_match_node(atmel_tcb_dt_ids, pdev->dev.of_node); 136 + if (match) 137 + tc->tcb_config = match->data; 138 + } 139 + 165 140 tc->clk[0] = clk; 166 141 tc->clk[1] = clk_get(&pdev->dev, "t1_clk"); 167 142 if (IS_ERR(tc->clk[1])) ··· 194 153 } 195 154 196 155 static struct platform_driver tc_driver = { 197 - .driver.name = "atmel_tcb", 156 + .driver = { 157 + .name = "atmel_tcb", 158 + .of_match_table = of_match_ptr(atmel_tcb_dt_ids), 159 + }, 198 160 }; 199 161 200 162 static int __init tc_init(void)
+3 -2
drivers/pcmcia/at91_cf.c
··· 26 26 27 27 #include <mach/board.h> 28 28 #include <mach/at91rm9200_mc.h> 29 + #include <mach/at91_ramc.h> 29 30 30 31 31 32 /* ··· 157 156 /* 158 157 * Use 16 bit accesses unless/until we need 8-bit i/o space. 159 158 */ 160 - csr = at91_sys_read(AT91_SMC_CSR(cf->board->chipselect)) & ~AT91_SMC_DBW; 159 + csr = at91_ramc_read(0, AT91_SMC_CSR(cf->board->chipselect)) & ~AT91_SMC_DBW; 161 160 162 161 /* 163 162 * NOTE: this CF controller ignores IOIS16, so we can't really do ··· 176 175 csr |= AT91_SMC_DBW_16; 177 176 pr_debug("%s: 16bit i/o bus\n", driver_name); 178 177 } 179 - at91_sys_write(AT91_SMC_CSR(cf->board->chipselect), csr); 178 + at91_ramc_write(0, AT91_SMC_CSR(cf->board->chipselect), csr); 180 179 181 180 io->start = cf->socket.io_offset; 182 181 io->stop = io->start + SZ_2K - 1;
+28 -57
drivers/rtc/rtc-at91sam9.c
··· 57 57 void __iomem *rtt; 58 58 struct rtc_device *rtcdev; 59 59 u32 imr; 60 + void __iomem *gpbr; 60 61 }; 61 62 62 63 #define rtt_readl(rtc, field) \ ··· 66 65 __raw_writel((val), (rtc)->rtt + AT91_RTT_ ## field) 67 66 68 67 #define gpbr_readl(rtc) \ 69 - at91_sys_read(AT91_GPBR + 4 * CONFIG_RTC_DRV_AT91SAM9_GPBR) 68 + __raw_readl((rtc)->gpbr) 70 69 #define gpbr_writel(rtc, val) \ 71 - at91_sys_write(AT91_GPBR + 4 * CONFIG_RTC_DRV_AT91SAM9_GPBR, (val)) 70 + __raw_writel((val), (rtc)->gpbr) 72 71 73 72 /* 74 73 * Read current time and date in RTC ··· 288 287 /* 289 288 * Initialize and install RTC driver 290 289 */ 291 - static int __init at91_rtc_probe(struct platform_device *pdev) 290 + static int __devinit at91_rtc_probe(struct platform_device *pdev) 292 291 { 293 - struct resource *r; 292 + struct resource *r, *r_gpbr; 294 293 struct sam9_rtc *rtc; 295 294 int ret; 296 295 u32 mr; 297 296 298 297 r = platform_get_resource(pdev, IORESOURCE_MEM, 0); 299 - if (!r) 298 + r_gpbr = platform_get_resource(pdev, IORESOURCE_MEM, 1); 299 + if (!r || !r_gpbr) { 300 + dev_err(&pdev->dev, "need 2 ressources\n"); 300 301 return -ENODEV; 302 + } 301 303 302 304 rtc = kzalloc(sizeof *rtc, GFP_KERNEL); 303 305 if (!rtc) ··· 316 312 dev_err(&pdev->dev, "failed to map registers, aborting.\n"); 317 313 ret = -ENOMEM; 318 314 goto fail; 315 + } 316 + 317 + rtc->gpbr = ioremap(r_gpbr->start, resource_size(r_gpbr)); 318 + if (!rtc->gpbr) { 319 + dev_err(&pdev->dev, "failed to map gpbr registers, aborting.\n"); 320 + ret = -ENOMEM; 321 + goto fail_gpbr; 319 322 } 320 323 321 324 mr = rtt_readl(rtc, MR); ··· 351 340 if (ret) { 352 341 dev_dbg(&pdev->dev, "can't share IRQ %d?\n", AT91_ID_SYS); 353 342 rtc_device_unregister(rtc->rtcdev); 354 - goto fail; 343 + goto fail_register; 355 344 } 356 345 357 346 /* NOTE: sam9260 rev A silicon has a ROM bug which resets the ··· 367 356 return 0; 368 357 369 358 fail_register: 359 + iounmap(rtc->gpbr); 360 + fail_gpbr: 370 361 iounmap(rtc->rtt); 371 362 fail: 372 363 platform_set_drvdata(pdev, NULL); ··· 379 366 /* 380 367 * Disable and remove the RTC driver 381 368 */ 382 - static int __exit at91_rtc_remove(struct platform_device *pdev) 369 + static int __devexit at91_rtc_remove(struct platform_device *pdev) 383 370 { 384 371 struct sam9_rtc *rtc = platform_get_drvdata(pdev); 385 372 u32 mr = rtt_readl(rtc, MR); ··· 390 377 391 378 rtc_device_unregister(rtc->rtcdev); 392 379 380 + iounmap(rtc->gpbr); 393 381 iounmap(rtc->rtt); 394 382 platform_set_drvdata(pdev, NULL); 395 383 kfree(rtc); ··· 454 440 #endif 455 441 456 442 static struct platform_driver at91_rtc_driver = { 457 - .driver.name = "rtc-at91sam9", 458 - .driver.owner = THIS_MODULE, 459 - .remove = __exit_p(at91_rtc_remove), 443 + .probe = at91_rtc_probe, 444 + .remove = __devexit_p(at91_rtc_remove), 460 445 .shutdown = at91_rtc_shutdown, 461 446 .suspend = at91_rtc_suspend, 462 447 .resume = at91_rtc_resume, 448 + .driver = { 449 + .name = "rtc-at91sam9", 450 + .owner = THIS_MODULE, 451 + }, 463 452 }; 464 - 465 - /* Chips can have more than one RTT module, and they can be used for more 466 - * than just RTCs. So we can't just register as "the" RTT driver. 467 - * 468 - * A normal approach in such cases is to create a library to allocate and 469 - * free the modules. Here we just use bus_find_device() as like such a 470 - * library, binding directly ... no runtime "library" footprint is needed. 471 - */ 472 - static int __init at91_rtc_match(struct device *dev, void *v) 473 - { 474 - struct platform_device *pdev = to_platform_device(dev); 475 - int ret; 476 - 477 - /* continue searching if this isn't the RTT we need */ 478 - if (strcmp("at91_rtt", pdev->name) != 0 479 - || pdev->id != CONFIG_RTC_DRV_AT91SAM9_RTT) 480 - goto fail; 481 - 482 - /* else we found it ... but fail unless we can bind to the RTC driver */ 483 - if (dev->driver) { 484 - dev_dbg(dev, "busy, can't use as RTC!\n"); 485 - goto fail; 486 - } 487 - dev->driver = &at91_rtc_driver.driver; 488 - if (device_attach(dev) == 0) { 489 - dev_dbg(dev, "can't attach RTC!\n"); 490 - goto fail; 491 - } 492 - ret = at91_rtc_probe(pdev); 493 - if (ret == 0) 494 - return true; 495 - 496 - dev_dbg(dev, "RTC probe err %d!\n", ret); 497 - fail: 498 - return false; 499 - } 500 453 501 454 static int __init at91_rtc_init(void) 502 455 { 503 - int status; 504 - struct device *rtc; 505 - 506 - status = platform_driver_register(&at91_rtc_driver); 507 - if (status) 508 - return status; 509 - rtc = bus_find_device(&platform_bus_type, NULL, 510 - NULL, at91_rtc_match); 511 - if (!rtc) 512 - platform_driver_unregister(&at91_rtc_driver); 513 - return rtc ? 0 : -ENODEV; 456 + return platform_driver_register(&at91_rtc_driver); 514 457 } 515 458 module_init(at91_rtc_init); 516 459
+2
drivers/tty/serial/atmel_serial.c
··· 1526 1526 atmel_pops.set_wake = fns->set_wake; 1527 1527 } 1528 1528 1529 + struct platform_device *atmel_default_console_device; /* the serial console device */ 1530 + 1529 1531 #ifdef CONFIG_SERIAL_ATMEL_CONSOLE 1530 1532 static void atmel_console_putchar(struct uart_port *port, int ch) 1531 1533 {
+37 -12
drivers/tty/serial/pxa.c
··· 36 36 #include <linux/circ_buf.h> 37 37 #include <linux/delay.h> 38 38 #include <linux/interrupt.h> 39 + #include <linux/of.h> 39 40 #include <linux/platform_device.h> 40 41 #include <linux/tty.h> 41 42 #include <linux/tty_flip.h> ··· 45 44 #include <linux/io.h> 46 45 #include <linux/slab.h> 47 46 47 + #define PXA_NAME_LEN 8 48 + 48 49 struct uart_pxa_port { 49 50 struct uart_port port; 50 51 unsigned char ier; ··· 54 51 unsigned char mcr; 55 52 unsigned int lsr_break_flag; 56 53 struct clk *clk; 57 - char *name; 54 + char name[PXA_NAME_LEN]; 58 55 }; 59 56 60 57 static inline unsigned int serial_in(struct uart_pxa_port *up, int offset) ··· 784 781 }; 785 782 #endif 786 783 784 + static struct of_device_id serial_pxa_dt_ids[] = { 785 + { .compatible = "mrvl,pxa-uart", }, 786 + { .compatible = "mrvl,mmp-uart", }, 787 + {} 788 + }; 789 + MODULE_DEVICE_TABLE(of, serial_pxa_dt_ids); 790 + 791 + static int serial_pxa_probe_dt(struct platform_device *pdev, 792 + struct uart_pxa_port *sport) 793 + { 794 + struct device_node *np = pdev->dev.of_node; 795 + int ret; 796 + 797 + if (!np) 798 + return 1; 799 + 800 + ret = of_alias_get_id(np, "serial"); 801 + if (ret < 0) { 802 + dev_err(&pdev->dev, "failed to get alias id, errno %d\n", ret); 803 + return ret; 804 + } 805 + sport->port.line = ret; 806 + return 0; 807 + } 808 + 787 809 static int serial_pxa_probe(struct platform_device *dev) 788 810 { 789 811 struct uart_pxa_port *sport; ··· 836 808 sport->port.irq = irqres->start; 837 809 sport->port.fifosize = 64; 838 810 sport->port.ops = &serial_pxa_pops; 839 - sport->port.line = dev->id; 840 811 sport->port.dev = &dev->dev; 841 812 sport->port.flags = UPF_IOREMAP | UPF_BOOT_AUTOCONF; 842 813 sport->port.uartclk = clk_get_rate(sport->clk); 843 814 844 - switch (dev->id) { 845 - case 0: sport->name = "FFUART"; break; 846 - case 1: sport->name = "BTUART"; break; 847 - case 2: sport->name = "STUART"; break; 848 - case 3: sport->name = "HWUART"; break; 849 - default: 850 - sport->name = "???"; 851 - break; 852 - } 815 + ret = serial_pxa_probe_dt(dev, sport); 816 + if (ret > 0) 817 + sport->port.line = dev->id; 818 + else if (ret < 0) 819 + goto err_clk; 820 + snprintf(sport->name, PXA_NAME_LEN - 1, "UART%d", sport->port.line + 1); 853 821 854 822 sport->port.membase = ioremap(mmres->start, resource_size(mmres)); 855 823 if (!sport->port.membase) { ··· 853 829 goto err_clk; 854 830 } 855 831 856 - serial_pxa_ports[dev->id] = sport; 832 + serial_pxa_ports[sport->port.line] = sport; 857 833 858 834 uart_add_one_port(&serial_pxa_reg, &sport->port); 859 835 platform_set_drvdata(dev, sport); ··· 890 866 #ifdef CONFIG_PM 891 867 .pm = &serial_pxa_pm_ops, 892 868 #endif 869 + .of_match_table = serial_pxa_dt_ids, 893 870 }, 894 871 }; 895 872
+5 -4
drivers/usb/gadget/at91_udc.c
··· 40 40 #include <mach/board.h> 41 41 #include <mach/cpu.h> 42 42 #include <mach/at91sam9261_matrix.h> 43 + #include <mach/at91_matrix.h> 43 44 44 45 #include "at91_udc.h" 45 46 ··· 911 910 } else if (cpu_is_at91sam9261() || cpu_is_at91sam9g10()) { 912 911 u32 usbpucr; 913 912 914 - usbpucr = at91_sys_read(AT91_MATRIX_USBPUCR); 913 + usbpucr = at91_matrix_read(AT91_MATRIX_USBPUCR); 915 914 usbpucr |= AT91_MATRIX_USBPUCR_PUON; 916 - at91_sys_write(AT91_MATRIX_USBPUCR, usbpucr); 915 + at91_matrix_write(AT91_MATRIX_USBPUCR, usbpucr); 917 916 } 918 917 } else { 919 918 stop_activity(udc); ··· 929 928 } else if (cpu_is_at91sam9261() || cpu_is_at91sam9g10()) { 930 929 u32 usbpucr; 931 930 932 - usbpucr = at91_sys_read(AT91_MATRIX_USBPUCR); 931 + usbpucr = at91_matrix_read(AT91_MATRIX_USBPUCR); 933 932 usbpucr &= ~AT91_MATRIX_USBPUCR_PUON; 934 - at91_sys_write(AT91_MATRIX_USBPUCR, usbpucr); 933 + at91_matrix_write(AT91_MATRIX_USBPUCR, usbpucr); 935 934 } 936 935 clk_off(udc); 937 936 }
+3 -3
drivers/usb/gadget/atmel_usba_udc.c
··· 332 332 333 333 static void toggle_bias(int is_on) 334 334 { 335 - unsigned int uckr = at91_sys_read(AT91_CKGR_UCKR); 335 + unsigned int uckr = at91_pmc_read(AT91_CKGR_UCKR); 336 336 337 337 if (is_on) 338 - at91_sys_write(AT91_CKGR_UCKR, uckr | AT91_PMC_BIASEN); 338 + at91_pmc_write(AT91_CKGR_UCKR, uckr | AT91_PMC_BIASEN); 339 339 else 340 - at91_sys_write(AT91_CKGR_UCKR, uckr & ~(AT91_PMC_BIASEN)); 340 + at91_pmc_write(AT91_CKGR_UCKR, uckr & ~(AT91_PMC_BIASEN)); 341 341 } 342 342 343 343 #else
+3 -2
drivers/usb/host/ohci-at91.c
··· 448 448 449 449 /* From the GPIO notifying the over-current situation, find 450 450 * out the corresponding port */ 451 - gpio = irq_to_gpio(irq); 452 451 for (port = 0; port < ARRAY_SIZE(pdata->overcurrent_pin); port++) { 453 - if (pdata->overcurrent_pin[port] == gpio) 452 + if (gpio_to_irq(pdata->overcurrent_pin[port]) == irq) { 453 + gpio = pdata->overcurrent_pin[port]; 454 454 break; 455 + } 455 456 } 456 457 457 458 if (port == ARRAY_SIZE(pdata->overcurrent_pin)) {
+4 -4
drivers/watchdog/at91rm9200_wdt.c
··· 51 51 */ 52 52 static inline void at91_wdt_stop(void) 53 53 { 54 - at91_sys_write(AT91_ST_WDMR, AT91_ST_EXTEN); 54 + at91_st_write(AT91_ST_WDMR, AT91_ST_EXTEN); 55 55 } 56 56 57 57 /* ··· 59 59 */ 60 60 static inline void at91_wdt_start(void) 61 61 { 62 - at91_sys_write(AT91_ST_WDMR, AT91_ST_EXTEN | AT91_ST_RSTEN | 62 + at91_st_write(AT91_ST_WDMR, AT91_ST_EXTEN | AT91_ST_RSTEN | 63 63 (((65536 * wdt_time) >> 8) & AT91_ST_WDV)); 64 - at91_sys_write(AT91_ST_CR, AT91_ST_WDRST); 64 + at91_st_write(AT91_ST_CR, AT91_ST_WDRST); 65 65 } 66 66 67 67 /* ··· 69 69 */ 70 70 static inline void at91_wdt_reload(void) 71 71 { 72 - at91_sys_write(AT91_ST_CR, AT91_ST_WDRST); 72 + at91_st_write(AT91_ST_CR, AT91_ST_WDRST); 73 73 } 74 74 75 75 /* ......................................................................... */
+10
include/linux/atmel_tc.h
··· 34 34 struct clk; 35 35 36 36 /** 37 + * struct atmel_tcb_config - SoC data for a Timer/Counter Block 38 + * @counter_width: size in bits of a timer counter register 39 + */ 40 + struct atmel_tcb_config { 41 + size_t counter_width; 42 + }; 43 + 44 + /** 37 45 * struct atmel_tc - information about a Timer/Counter Block 38 46 * @pdev: physical device 39 47 * @iomem: resource associated with the I/O register 40 48 * @regs: mapping through which the I/O registers can be accessed 49 + * @tcb_config: configuration data from SoC 41 50 * @irq: irq for each of the three channels 42 51 * @clk: internal clock source for each of the three channels 43 52 * @node: list node, for tclib internal use ··· 63 54 struct platform_device *pdev; 64 55 struct resource *iomem; 65 56 void __iomem *regs; 57 + struct atmel_tcb_config *tcb_config; 66 58 int irq[3]; 67 59 struct clk *clk[3]; 68 60 struct list_head node;