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

Merge tag 'at91-cleanup2' of git://git.kernel.org/pub/scm/linux/kernel/git/nferre/linux-at91 into next/soc

Merge "at91: cleanup for 3.20 #2" from Nicolas Ferre:

Second batch of cleanup for 3.20:
- By reworking the PM code, we can remove the AT91 more specific initialization
- We are using DT for SRAM initialization now, so we can remove its explicit
mapping
- The PMC clock driver now hosts IDLE function for at91rm9200 with other
SoCs ones.

* tag 'at91-cleanup2' of git://git.kernel.org/pub/scm/linux/kernel/git/nferre/linux-at91: (37 commits)
ARM: at91: move at91rm9200_idle() to clk/at91/pmc.c
ARM: at91: remove unused at91_init_sram
ARM: at91: sama5d4: remove useless call to at91_init_sram
ARM: at91: remove useless map_io
ARM: at91: pm: prepare for multiplatform
ARM: at91: pm: add UDP and UHP checks to newer SoCs
ARM: at91: pm: use the mmio-sram pool to access SRAM
ARM: at91: pm: rework cpu detection
ARM: at91: dts: sama5d3: add ov2640 camera sensor support
ARM: at91: dts: sama5d3: change name of pinctrl of ISI_MCK
ARM: at91: dts: sama5d3: change name of pinctrl_isi_{power,reset}
ARM: at91: dts: sama5d3: move the isi mck pin to mb
ARM: at91: dts: sama5d3: add missing pins of isi
ARM: at91: dts: sama5d3: split isi pinctrl
ARM: at91: dts: sama5d3: add isi clock
ARM: at91/dt: ethernut5: use at91sam9xe.dtsi
ARM: at91/dt: Add a dtsi for at91sam9xe
ARM: at91/dt: add SRAM nodes
ARM: at91/dt: at91rm9200ek: enable RTC
ARM: at91/dt: rm9200: add RTC node
...

Signed-off-by: Olof Johansson <olof@lixom.net>

+520 -491
+124
Documentation/arm/Atmel/README
··· 1 + ARM Atmel SoCs (aka AT91) 2 + ========================= 3 + 4 + 5 + Introduction 6 + ------------ 7 + This document gives useful information about the ARM Atmel SoCs that are 8 + currently supported in Linux Mainline (you know, the one on kernel.org). 9 + 10 + It is important to note that the Atmel | SMART ARM-based MPU product line is 11 + historically named "AT91" or "at91" throughout the Linux kernel development 12 + process even if this product prefix has completely disappeared from the 13 + official Atmel product name. Anyway, files, directories, git trees, 14 + git branches/tags and email subject always contain this "at91" sub-string. 15 + 16 + 17 + AT91 SoCs 18 + --------- 19 + Documentation and detailled datasheet for each product are available on 20 + the Atmel website: http://www.atmel.com. 21 + 22 + Flavors: 23 + * ARM 920 based SoC 24 + - at91rm9200 25 + + Datasheet 26 + http://www.atmel.com/Images/doc1768.pdf 27 + 28 + * ARM 926 based SoCs 29 + - at91sam9260 30 + + Datasheet 31 + http://www.atmel.com/Images/doc6221.pdf 32 + 33 + - at91sam9xe 34 + + Datasheet 35 + http://www.atmel.com/Images/Atmel-6254-32-bit-ARM926EJ-S-Embedded-Microprocessor-SAM9XE_Datasheet.pdf 36 + 37 + - at91sam9261 38 + + Datasheet 39 + http://www.atmel.com/Images/doc6062.pdf 40 + 41 + - at91sam9263 42 + + Datasheet 43 + http://www.atmel.com/Images/Atmel_6249_32-bit-ARM926EJ-S-Microcontroller_SAM9263_Datasheet.pdf 44 + 45 + - at91sam9rl 46 + + Datasheet 47 + http://www.atmel.com/Images/doc6289.pdf 48 + 49 + - at91sam9g20 50 + + Datasheet 51 + http://www.atmel.com/Images/doc6384.pdf 52 + 53 + - at91sam9g45 family 54 + - at91sam9g45 55 + - at91sam9g46 56 + - at91sam9m10 57 + - at91sam9m11 (device superset) 58 + + Datasheet 59 + http://www.atmel.com/Images/Atmel-6437-32-bit-ARM926-Embedded-Microprocessor-SAM9M11_Datasheet.pdf 60 + 61 + - at91sam9x5 family (aka "The 5 series") 62 + - at91sam9g15 63 + - at91sam9g25 64 + - at91sam9g35 65 + - at91sam9x25 66 + - at91sam9x35 67 + + Datasheet (can be considered as covering the whole family) 68 + http://www.atmel.com/Images/Atmel_11055_32-bit-ARM926EJ-S-Microcontroller_SAM9X35_Datasheet.pdf 69 + 70 + - at91sam9n12 71 + + Datasheet 72 + http://www.atmel.com/Images/Atmel_11063_32-bit-ARM926EJ-S-Microcontroller_SAM9N12CN11CN12_Datasheet.pdf 73 + 74 + * ARM Cortex-A5 based SoCs 75 + - sama5d3 family 76 + - sama5d31 77 + - sama5d33 78 + - sama5d34 79 + - sama5d35 80 + - sama5d36 (device superset) 81 + + Datasheet 82 + http://www.atmel.com/Images/Atmel-11121-32-bit-Cortex-A5-Microcontroller-SAMA5D3_Datasheet.pdf 83 + 84 + * ARM Cortex-A5 + NEON based SoCs 85 + - sama5d4 family 86 + - sama5d41 87 + - sama5d42 88 + - sama5d43 89 + - sama5d44 (device superset) 90 + + Datasheet 91 + http://www.atmel.com/Images/Atmel-11238-32-bit-Cortex-A5-Microcontroller-SAMA5D4_Datasheet.pdf 92 + 93 + 94 + Linux kernel information 95 + ------------------------ 96 + Linux kernel mach directory: arch/arm/mach-at91 97 + MAINTAINERS entry is: "ARM/ATMEL AT91RM9200 AND AT91SAM ARM ARCHITECTURES" 98 + 99 + 100 + Device Tree for AT91 SoCs and boards 101 + ------------------------------------ 102 + All AT91 SoCs are converted to Device Tree. Since Linux 3.19, these products 103 + must use this method to boot the Linux kernel. 104 + 105 + Work In Progress statement: 106 + Device Tree files and Device Tree bindings that apply to AT91 SoCs and boards are 107 + considered as "Unstable". To be completely clear, any at91 binding can change at 108 + any time. So, be sure to use a Device Tree Binary and a Kernel Image generated from 109 + the same source tree. 110 + Please refer to the Documentation/devicetree/bindings/ABI.txt file for a 111 + definition of a "Stable" binding/ABI. 112 + This statement will be removed by AT91 MAINTAINERS when appropriate. 113 + 114 + Naming conventions and best practice: 115 + - SoCs Device Tree Source Include files are named after the official name of 116 + the product (at91sam9g20.dtsi or sama5d33.dtsi for instance). 117 + - Device Tree Source Include files (.dtsi) are used to collect common nodes that can be 118 + shared across SoCs or boards (sama5d3.dtsi or at91sam9x5cm.dtsi for instance). 119 + When collecting nodes for a particular peripheral or topic, the identifier have to 120 + be placed at the end of the file name, separated with a "_" (at91sam9x5_can.dtsi 121 + or sama5d3_gmac.dtsi for example). 122 + - board Device Tree Source files (.dts) are prefixed by the string "at91-" so 123 + that they can be identified easily. Note that some files are historical exceptions 124 + to this rule (sama5d3[13456]ek.dts, usb_a9g20.dts or animeo_ip.dts for example).
+17
Documentation/devicetree/bindings/arm/atmel-at91.txt
··· 24 24 o "atmel,at91sam9g45" 25 25 o "atmel,at91sam9n12" 26 26 o "atmel,at91sam9rl" 27 + o "atmel,at91sam9xe" 27 28 * "atmel,sama5" for SoCs using a Cortex-A5, shall be extended with the specific 28 29 SoC family: 29 30 o "atmel,sama5d3" shall be extended with the specific SoC compatible: ··· 136 135 rstc@fffffd00 { 137 136 compatible = "atmel,at91sam9260-rstc"; 138 137 reg = <0xfffffd00 0x10>; 138 + }; 139 + 140 + Special Function Registers (SFR) 141 + 142 + Special Function Registers (SFR) manage specific aspects of the integrated 143 + memory, bridge implementations, processor and other functionality not controlled 144 + elsewhere. 145 + 146 + required properties: 147 + - compatible: Should be "atmel,<chip>-sfr", "syscon". 148 + <chip> can be "sama5d3" or "sama5d4". 149 + - reg: Should contain registers location and length 150 + 151 + sfr@f0038000 { 152 + compatible = "atmel,sama5d3-sfr", "syscon"; 153 + reg = <0xf0038000 0x60>; 139 154 };
+1
MAINTAINERS
··· 877 877 F: arch/arm/boot/dts/at91*.dtsi 878 878 F: arch/arm/boot/dts/sama*.dts 879 879 F: arch/arm/boot/dts/sama*.dtsi 880 + F: arch/arm/include/debug/at91.S 880 881 881 882 ARM/ATMEL AT91 Clock Support 882 883 M: Boris Brezillon <boris.brezillon@free-electrons.com>
+7 -2
arch/arm/Kconfig.debug
··· 115 115 0x80024000 | 0xf0024000 | UART9 116 116 117 117 config AT91_DEBUG_LL_DBGU0 118 - bool "Kernel low-level debugging on rm9200, 9260/9g20, 9261/9g10 and 9rl" 118 + bool "Kernel low-level debugging on rm9200, 9260/9g20, 9261/9g10, 9rl, 9x5, 9n12" 119 + select DEBUG_AT91_UART 119 120 depends on HAVE_AT91_DBGU0 120 121 121 122 config AT91_DEBUG_LL_DBGU1 122 - bool "Kernel low-level debugging on 9263 and 9g45" 123 + bool "Kernel low-level debugging on 9263, 9g45 and sama5d3" 124 + select DEBUG_AT91_UART 123 125 depends on HAVE_AT91_DBGU1 124 126 125 127 config AT91_DEBUG_LL_DBGU2 126 128 bool "Kernel low-level debugging on sama5d4" 129 + select DEBUG_AT91_UART 127 130 depends on HAVE_AT91_DBGU2 128 131 129 132 config DEBUG_BCM2835 ··· 1207 1204 string 1208 1205 default "debug/sa1100.S" if DEBUG_SA1100 1209 1206 default "debug/8250.S" if DEBUG_LL_UART_8250 || DEBUG_UART_8250 1207 + default "debug/at91.S" if AT91_DEBUG_LL_DBGU0 || AT91_DEBUG_LL_DBGU1 || \ 1208 + AT91_DEBUG_LL_DBGU2 1210 1209 default "debug/asm9260.S" if DEBUG_ASM9260_UART 1211 1210 default "debug/clps711x.S" if DEBUG_CLPS711X_UART1 || DEBUG_CLPS711X_UART2 1212 1211 default "debug/meson.S" if DEBUG_MESON_UARTAO
+12
arch/arm/boot/dts/at91rm9200.dtsi
··· 66 66 }; 67 67 }; 68 68 69 + sram: sram@00200000 { 70 + compatible = "mmio-sram"; 71 + reg = <0x00200000 0x4000>; 72 + }; 73 + 69 74 ahb { 70 75 compatible = "simple-bus"; 71 76 #address-cells = <1>; ··· 359 354 compatible = "atmel,at91rm9200-st"; 360 355 reg = <0xfffffd00 0x100>; 361 356 interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>; 357 + }; 358 + 359 + rtc: rtc@fffffe00 { 360 + compatible = "atmel,at91rm9200-rtc"; 361 + reg = <0xfffffe00 0x40>; 362 + interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>; 363 + status = "disabled"; 362 364 }; 363 365 364 366 tcb0: timer@fffa0000 {
+4
arch/arm/boot/dts/at91rm9200ek.dts
··· 77 77 dbgu: serial@fffff200 { 78 78 status = "okay"; 79 79 }; 80 + 81 + rtc: rtc@fffffe00 { 82 + status = "okay"; 83 + }; 80 84 }; 81 85 82 86 usb0: ohci@00300000 {
+5
arch/arm/boot/dts/at91sam9260.dtsi
··· 69 69 }; 70 70 }; 71 71 72 + sram0: sram@002ff000 { 73 + compatible = "mmio-sram"; 74 + reg = <0x002ff000 0x2000>; 75 + }; 76 + 72 77 ahb { 73 78 compatible = "simple-bus"; 74 79 #address-cells = <1>;
+5
arch/arm/boot/dts/at91sam9261.dtsi
··· 60 60 }; 61 61 }; 62 62 63 + sram: sram@00300000 { 64 + compatible = "mmio-sram"; 65 + reg = <0x00300000 0x28000>; 66 + }; 67 + 63 68 ahb { 64 69 compatible = "simple-bus"; 65 70 #address-cells = <1>;
+11 -1
arch/arm/boot/dts/at91sam9263.dtsi
··· 62 62 }; 63 63 }; 64 64 65 + sram0: sram@00300000 { 66 + compatible = "mmio-sram"; 67 + reg = <0x00300000 0x14000>; 68 + }; 69 + 70 + sram1: sram@00500000 { 71 + compatible = "mmio-sram"; 72 + reg = <0x00300000 0x4000>; 73 + }; 74 + 65 75 ahb { 66 76 compatible = "simple-bus"; 67 77 #address-cells = <1>; ··· 304 294 reg = <17>; 305 295 }; 306 296 307 - ac91_clk: ac97_clk { 297 + ac97_clk: ac97_clk { 308 298 #clock-cells = <0>; 309 299 reg = <18>; 310 300 };
+9
arch/arm/boot/dts/at91sam9g20.dtsi
··· 16 16 reg = <0x20000000 0x08000000>; 17 17 }; 18 18 19 + sram0: sram@002ff000 { 20 + status = "disabled"; 21 + }; 22 + 23 + sram1: sram@002fc000 { 24 + compatible = "mmio-sram"; 25 + reg = <0x002fc000 0x8000>; 26 + }; 27 + 19 28 ahb { 20 29 apb { 21 30 i2c0: i2c@fffac000 {
+5 -2
arch/arm/boot/dts/at91sam9g45.dtsi
··· 74 74 }; 75 75 }; 76 76 77 + sram: sram@00300000 { 78 + compatible = "mmio-sram"; 79 + reg = <0x00300000 0x10000>; 80 + }; 81 + 77 82 ahb { 78 83 compatible = "simple-bus"; 79 84 #address-cells = <1>; ··· 1292 1287 compatible = "atmel,at91rm9200-ohci", "usb-ohci"; 1293 1288 reg = <0x00700000 0x100000>; 1294 1289 interrupts = <22 IRQ_TYPE_LEVEL_HIGH 2>; 1295 - //TODO 1296 1290 clocks = <&usb>, <&uhphs_clk>, <&uhphs_clk>, <&uhpck>; 1297 1291 clock-names = "usb_clk", "ohci_clk", "hclk", "uhpck"; 1298 1292 status = "disabled"; ··· 1301 1297 compatible = "atmel,at91sam9g45-ehci", "usb-ehci"; 1302 1298 reg = <0x00800000 0x100000>; 1303 1299 interrupts = <22 IRQ_TYPE_LEVEL_HIGH 2>; 1304 - //TODO 1305 1300 clocks = <&usb>, <&uhphs_clk>, <&uhphs_clk>, <&uhpck>; 1306 1301 clock-names = "usb_clk", "ehci_clk", "hclk", "uhpck"; 1307 1302 status = "disabled";
+12
arch/arm/boot/dts/at91sam9n12.dtsi
··· 64 64 }; 65 65 }; 66 66 67 + sram: sram@00300000 { 68 + compatible = "mmio-sram"; 69 + reg = <0x00300000 0x8000>; 70 + }; 71 + 67 72 ahb { 68 73 compatible = "simple-bus"; 69 74 #address-cells = <1>; ··· 895 890 atmel,reset-type = "all"; 896 891 atmel,dbg-halt; 897 892 atmel,idle-halt; 893 + status = "disabled"; 894 + }; 895 + 896 + rtc@fffffeb0 { 897 + compatible = "atmel,at91rm9200-rtc"; 898 + reg = <0xfffffeb0 0x40>; 899 + interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>; 898 900 status = "disabled"; 899 901 }; 900 902
+5
arch/arm/boot/dts/at91sam9rl.dtsi
··· 70 70 }; 71 71 }; 72 72 73 + sram: sram@00300000 { 74 + compatible = "mmio-sram"; 75 + reg = <0x00300000 0x10000>; 76 + }; 77 + 73 78 ahb { 74 79 compatible = "simple-bus"; 75 80 #address-cells = <1>;
+5
arch/arm/boot/dts/at91sam9x5.dtsi
··· 72 72 }; 73 73 }; 74 74 75 + sram: sram@00300000 { 76 + compatible = "mmio-sram"; 77 + reg = <0x00300000 0x8000>; 78 + }; 79 + 75 80 ahb { 76 81 compatible = "simple-bus"; 77 82 #address-cells = <1>;
+60
arch/arm/boot/dts/at91sam9xe.dtsi
··· 1 + /* 2 + * at91sam9xe.dtsi - Device Tree Include file for AT91SAM9XE family SoC 3 + * 4 + * Copyright (C) 2015 Atmel, 5 + * 2015 Alexandre Belloni <alexandre.Belloni@free-electrons.com> 6 + * 7 + * This file is dual-licensed: you can use it either under the terms 8 + * of the GPL or the X11 license, at your option. Note that this dual 9 + * licensing only applies to this file, and not this project as a 10 + * whole. 11 + * 12 + * a) This file is free software; you can redistribute it and/or 13 + * modify it under the terms of the GNU General Public License as 14 + * published by the Free Software Foundation; either version 2 of the 15 + * License, or (at your option) any later version. 16 + * 17 + * This file is distributed in the hope that it will be useful, 18 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 + * GNU General Public License for more details. 21 + * 22 + * Or, alternatively, 23 + * 24 + * b) Permission is hereby granted, free of charge, to any person 25 + * obtaining a copy of this software and associated documentation 26 + * files (the "Software"), to deal in the Software without 27 + * restriction, including without limitation the rights to use, 28 + * copy, modify, merge, publish, distribute, sublicense, and/or 29 + * sell copies of the Software, and to permit persons to whom the 30 + * Software is furnished to do so, subject to the following 31 + * conditions: 32 + * 33 + * The above copyright notice and this permission notice shall be 34 + * included in all copies or substantial portions of the Software. 35 + * 36 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 37 + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 38 + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 39 + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 40 + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 41 + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 42 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 43 + * OTHER DEALINGS IN THE SOFTWARE. 44 + */ 45 + 46 + #include "at91sam9260.dtsi" 47 + 48 + / { 49 + model = "Atmel AT91SAM9XE family SoC"; 50 + compatible = "atmel,at91sam9xe", "atmel,at91sam9260"; 51 + 52 + sram0: sram@002ff000 { 53 + status = "disabled"; 54 + }; 55 + 56 + sram1: sram@00300000 { 57 + compatible = "mmio-sram"; 58 + reg = <0x00300000 0x4000>; 59 + }; 60 + };
+1 -1
arch/arm/boot/dts/ethernut5.dts
··· 6 6 * Licensed under GPLv2. 7 7 */ 8 8 /dts-v1/; 9 - #include "at91sam9260.dtsi" 9 + #include "at91sam9xe.dtsi" 10 10 11 11 / { 12 12 model = "Ethernut 5";
+29 -5
arch/arm/boot/dts/sama5d3.dtsi
··· 78 78 }; 79 79 }; 80 80 81 + sram: sram@00300000 { 82 + compatible = "mmio-sram"; 83 + reg = <0x00300000 0x20000>; 84 + }; 85 + 81 86 ahb { 82 87 compatible = "simple-bus"; 83 88 #address-cells = <1>; ··· 219 214 compatible = "atmel,at91sam9g45-isi"; 220 215 reg = <0xf0034000 0x4000>; 221 216 interrupts = <37 IRQ_TYPE_LEVEL_HIGH 5>; 217 + pinctrl-names = "default"; 218 + pinctrl-0 = <&pinctrl_isi_data_0_7>; 219 + clocks = <&isi_clk>; 220 + clock-names = "isi_clk"; 222 221 status = "disabled"; 222 + port { 223 + #address-cells = <1>; 224 + #size-cells = <0>; 225 + }; 226 + }; 227 + 228 + sfr: sfr@f0038000 { 229 + compatible = "atmel,sama5d3-sfr", "syscon"; 230 + reg = <0xf0038000 0x60>; 223 231 }; 224 232 225 233 mmc1: mmc@f8000000 { ··· 563 545 }; 564 546 565 547 isi { 566 - pinctrl_isi: isi-0 { 548 + pinctrl_isi_data_0_7: isi-0-data-0-7 { 567 549 atmel,pins = 568 550 <AT91_PIOA 16 AT91_PERIPH_C AT91_PINCTRL_NONE /* PA16 periph C ISI_D0, conflicts with LCDDAT16 */ 569 551 AT91_PIOA 17 AT91_PERIPH_C AT91_PINCTRL_NONE /* PA17 periph C ISI_D1, conflicts with LCDDAT17 */ ··· 575 557 AT91_PIOA 23 AT91_PERIPH_C AT91_PINCTRL_NONE /* PA23 periph C ISI_D7, conflicts with LCDDAT23, PWML1 */ 576 558 AT91_PIOC 30 AT91_PERIPH_C AT91_PINCTRL_NONE /* PC30 periph C ISI_PCK, conflicts with UTXD0 */ 577 559 AT91_PIOA 31 AT91_PERIPH_C AT91_PINCTRL_NONE /* PA31 periph C ISI_HSYNC, conflicts with TWCK0, UTXD1 */ 578 - AT91_PIOA 30 AT91_PERIPH_C AT91_PINCTRL_NONE /* PA30 periph C ISI_VSYNC, conflicts with TWD0, URXD1 */ 579 - AT91_PIOC 29 AT91_PERIPH_C AT91_PINCTRL_NONE /* PC29 periph C ISI_PD8, conflicts with URXD0, PWMFI2 */ 560 + AT91_PIOA 30 AT91_PERIPH_C AT91_PINCTRL_NONE>; /* PA30 periph C ISI_VSYNC, conflicts with TWD0, URXD1 */ 561 + }; 562 + 563 + pinctrl_isi_data_8_9: isi-0-data-8-9 { 564 + atmel,pins = 565 + <AT91_PIOC 29 AT91_PERIPH_C AT91_PINCTRL_NONE /* PC29 periph C ISI_PD8, conflicts with URXD0, PWMFI2 */ 580 566 AT91_PIOC 28 AT91_PERIPH_C AT91_PINCTRL_NONE>; /* PC28 periph C ISI_PD9, conflicts with SPI1_NPCS3, PWMFI0 */ 581 567 }; 582 - pinctrl_isi_pck_as_mck: isi_pck_as_mck-0 { 568 + 569 + pinctrl_isi_data_10_11: isi-0-data-10-11 { 583 570 atmel,pins = 584 - <AT91_PIOD 31 AT91_PERIPH_B AT91_PINCTRL_NONE>; /* PD31 periph B ISI_MCK */ 571 + <AT91_PIOC 27 AT91_PERIPH_C AT91_PINCTRL_NONE /* PC27 periph C ISI_PD10, conflicts with SPI1_NPCS2, TWCK1 */ 572 + AT91_PIOC 26 AT91_PERIPH_C AT91_PINCTRL_NONE>; /* PC26 periph C ISI_PD11, conflicts with SPI1_NPCS1, TWD1 */ 585 573 }; 586 574 }; 587 575
+1
arch/arm/boot/dts/sama5d3xcm.dtsi
··· 122 122 d2 { 123 123 label = "d2"; 124 124 gpios = <&pioE 25 GPIO_ACTIVE_LOW>; /* PE25, conflicts with A25, RXD2 */ 125 + linux,default-trigger = "heartbeat"; 125 126 }; 126 127 }; 127 128 };
+36 -4
arch/arm/boot/dts/sama5d3xmb.dtsi
··· 52 52 }; 53 53 }; 54 54 55 + i2c1: i2c@f0018000 { 56 + ov2640: camera@0x30 { 57 + compatible = "ovti,ov2640"; 58 + reg = <0x30>; 59 + pinctrl-names = "default"; 60 + pinctrl-0 = <&pinctrl_pck1_as_isi_mck &pinctrl_sensor_power &pinctrl_sensor_reset>; 61 + resetb-gpios = <&pioE 24 GPIO_ACTIVE_LOW>; 62 + pwdn-gpios = <&pioE 29 GPIO_ACTIVE_HIGH>; 63 + /* use pck1 for the master clock of ov2640 */ 64 + clocks = <&pck1>; 65 + clock-names = "xvclk"; 66 + assigned-clocks = <&pck1>; 67 + assigned-clock-rates = <25000000>; 68 + 69 + port { 70 + ov2640_0: endpoint { 71 + remote-endpoint = <&isi_0>; 72 + bus-width = <8>; 73 + }; 74 + }; 75 + }; 76 + }; 77 + 55 78 usart1: serial@f0020000 { 56 79 dmas = <0>, <0>; /* Do not use DMA for usart1 */ 57 80 pinctrl-names = "default"; ··· 83 60 }; 84 61 85 62 isi: isi@f0034000 { 86 - pinctrl-names = "default"; 87 - pinctrl-0 = <&pinctrl_isi &pinctrl_isi_pck_as_mck &pinctrl_isi_power &pinctrl_isi_reset>; 63 + port { 64 + isi_0: endpoint { 65 + remote-endpoint = <&ov2640_0>; 66 + bus-width = <8>; 67 + }; 68 + }; 88 69 }; 89 70 90 71 mmc1: mmc@f8000000 { ··· 144 117 <AT91_PIOD 30 AT91_PERIPH_B AT91_PINCTRL_NONE>; /* PD30 periph B */ 145 118 }; 146 119 147 - pinctrl_isi_reset: isi_reset-0 { 120 + pinctrl_pck1_as_isi_mck: pck1_as_isi_mck-0 { 121 + atmel,pins = 122 + <AT91_PIOD 31 AT91_PERIPH_B AT91_PINCTRL_NONE>; /* PD31 periph B ISI_MCK */ 123 + }; 124 + 125 + pinctrl_sensor_reset: sensor_reset-0 { 148 126 atmel,pins = 149 127 <AT91_PIOE 24 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>; /* PE24 gpio */ 150 128 }; 151 129 152 - pinctrl_isi_power: isi_power-0 { 130 + pinctrl_sensor_power: sensor_power-0 { 153 131 atmel,pins = 154 132 <AT91_PIOE 29 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>; /* PE29 gpio */ 155 133 };
+10
arch/arm/boot/dts/sama5d4.dtsi
··· 103 103 }; 104 104 }; 105 105 106 + ns_sram: sram@00210000 { 107 + compatible = "mmio-sram"; 108 + reg = <0x00210000 0x10000>; 109 + }; 110 + 106 111 ahb { 107 112 compatible = "simple-bus"; 108 113 #address-cells = <1>; ··· 873 868 #size-cells = <0>; 874 869 clocks = <&twi2_clk>; 875 870 status = "disabled"; 871 + }; 872 + 873 + sfr: sfr@f8028000 { 874 + compatible = "atmel,sama5d4-sfr", "syscon"; 875 + reg = <0xf8028000 0x60>; 876 876 }; 877 877 878 878 mmc1: mmc@fc000000 {
+1 -8
arch/arm/mach-at91/Kconfig
··· 174 174 # ---------------------------------------------------------- 175 175 endif # SOC_SAM_V4_V5 176 176 177 - config MACH_AT91RM9200_DT 178 - def_bool SOC_AT91RM9200 179 - 180 - config MACH_AT91SAM9_DT 181 - def_bool SOC_AT91SAM9 182 - 183 - # ---------------------------------------------------------- 184 - 185 177 comment "AT91 Feature Selections" 186 178 187 179 config AT91_SLOW_CLOCK 188 180 bool "Suspend-to-RAM disables main oscillator" 181 + select SRAM 189 182 depends on SUSPEND 190 183 help 191 184 Select this if you want Suspend-to-RAM to save the most power
+3 -3
arch/arm/mach-at91/Makefile
··· 2 2 # Makefile for the linux kernel. 3 3 # 4 4 5 - obj-y := setup.o sysirq_mask.o 5 + obj-y := setup.o 6 6 7 7 obj-$(CONFIG_SOC_AT91SAM9) += sam9_smc.o 8 8 ··· 19 19 obj-$(CONFIG_SOC_SAMA5D4) += sama5d4.o 20 20 21 21 # AT91SAM board with device-tree 22 - obj-$(CONFIG_MACH_AT91RM9200_DT) += board-dt-rm9200.o 23 - obj-$(CONFIG_MACH_AT91SAM9_DT) += board-dt-sam9.o 22 + obj-$(CONFIG_SOC_AT91RM9200) += board-dt-rm9200.o 23 + obj-$(CONFIG_SOC_AT91SAM9) += board-dt-sam9.o 24 24 25 25 # SAMA5 board with device-tree 26 26 obj-$(CONFIG_SOC_SAMA5) += board-dt-sama5.o
-15
arch/arm/mach-at91/at91rm9200.c
··· 21 21 #include "soc.h" 22 22 #include "generic.h" 23 23 24 - static void at91rm9200_idle(void) 25 - { 26 - /* 27 - * Disable the processor clock. The processor will be automatically 28 - * re-enabled by an interrupt or by a reset. 29 - */ 30 - at91_pmc_write(AT91_PMC_SCDR, AT91_PMC_PCK); 31 - } 32 24 33 25 static void at91rm9200_restart(enum reboot_mode reboot_mode, const char *cmd) 34 26 { ··· 34 42 /* -------------------------------------------------------------------- 35 43 * AT91RM9200 processor initialization 36 44 * -------------------------------------------------------------------- */ 37 - static void __init at91rm9200_map_io(void) 38 - { 39 - /* Map peripherals */ 40 - at91_init_sram(0, AT91RM9200_SRAM_BASE, AT91RM9200_SRAM_SIZE); 41 - } 42 45 43 46 static void __init at91rm9200_initialize(void) 44 47 { ··· 41 54 arm_pm_restart = at91rm9200_restart; 42 55 } 43 56 44 - 45 57 AT91_SOC_START(at91rm9200) 46 - .map_io = at91rm9200_map_io, 47 58 .init = at91rm9200_initialize, 48 59 AT91_SOC_END
-29
arch/arm/mach-at91/at91sam9260.c
··· 22 22 * AT91SAM9260 processor initialization 23 23 * -------------------------------------------------------------------- */ 24 24 25 - static void __init at91sam9xe_map_io(void) 26 - { 27 - unsigned long sram_size; 28 - 29 - switch (at91_soc_initdata.cidr & AT91_CIDR_SRAMSIZ) { 30 - case AT91_CIDR_SRAMSIZ_32K: 31 - sram_size = 2 * SZ_16K; 32 - break; 33 - case AT91_CIDR_SRAMSIZ_16K: 34 - default: 35 - sram_size = SZ_16K; 36 - } 37 - 38 - at91_init_sram(0, AT91SAM9XE_SRAM_BASE, sram_size); 39 - } 40 - 41 - static void __init at91sam9260_map_io(void) 42 - { 43 - if (cpu_is_at91sam9xe()) 44 - at91sam9xe_map_io(); 45 - else if (cpu_is_at91sam9g20()) 46 - at91_init_sram(0, AT91SAM9G20_SRAM_BASE, AT91SAM9G20_SRAM_SIZE); 47 - else 48 - at91_init_sram(0, AT91SAM9260_SRAM_BASE, AT91SAM9260_SRAM_SIZE); 49 - } 50 - 51 25 static void __init at91sam9260_initialize(void) 52 26 { 53 27 arm_pm_idle = at91sam9_idle; 54 - 55 - at91_sysirq_mask_rtt(AT91SAM9260_BASE_RTT); 56 28 } 57 29 58 30 AT91_SOC_START(at91sam9260) 59 - .map_io = at91sam9260_map_io, 60 31 .init = at91sam9260_initialize, 61 32 AT91_SOC_END
-11
arch/arm/mach-at91/at91sam9261.c
··· 21 21 * AT91SAM9261 processor initialization 22 22 * -------------------------------------------------------------------- */ 23 23 24 - static void __init at91sam9261_map_io(void) 25 - { 26 - if (cpu_is_at91sam9g10()) 27 - at91_init_sram(0, AT91SAM9G10_SRAM_BASE, AT91SAM9G10_SRAM_SIZE); 28 - else 29 - at91_init_sram(0, AT91SAM9261_SRAM_BASE, AT91SAM9261_SRAM_SIZE); 30 - } 31 - 32 24 static void __init at91sam9261_initialize(void) 33 25 { 34 26 arm_pm_idle = at91sam9_idle; 35 - 36 - at91_sysirq_mask_rtt(AT91SAM9261_BASE_RTT); 37 27 } 38 28 39 29 AT91_SOC_START(at91sam9261) 40 - .map_io = at91sam9261_map_io, 41 30 .init = at91sam9261_initialize, 42 31 AT91_SOC_END
-10
arch/arm/mach-at91/at91sam9263.c
··· 20 20 * AT91SAM9263 processor initialization 21 21 * -------------------------------------------------------------------- */ 22 22 23 - static void __init at91sam9263_map_io(void) 24 - { 25 - at91_init_sram(0, AT91SAM9263_SRAM0_BASE, AT91SAM9263_SRAM0_SIZE); 26 - at91_init_sram(1, AT91SAM9263_SRAM1_BASE, AT91SAM9263_SRAM1_SIZE); 27 - } 28 - 29 23 static void __init at91sam9263_initialize(void) 30 24 { 31 25 arm_pm_idle = at91sam9_idle; 32 - 33 - at91_sysirq_mask_rtt(AT91SAM9263_BASE_RTT0); 34 - at91_sysirq_mask_rtt(AT91SAM9263_BASE_RTT1); 35 26 } 36 27 37 28 AT91_SOC_START(at91sam9263) 38 - .map_io = at91sam9263_map_io, 39 29 .init = at91sam9263_initialize, 40 30 AT91_SOC_END
-11
arch/arm/mach-at91/at91sam9g45.c
··· 11 11 */ 12 12 13 13 #include <asm/system_misc.h> 14 - #include <asm/irq.h> 15 14 #include <mach/hardware.h> 16 15 17 16 #include "soc.h" ··· 19 20 /* -------------------------------------------------------------------- 20 21 * AT91SAM9G45 processor initialization 21 22 * -------------------------------------------------------------------- */ 22 - 23 - static void __init at91sam9g45_map_io(void) 24 - { 25 - at91_init_sram(0, AT91SAM9G45_SRAM_BASE, AT91SAM9G45_SRAM_SIZE); 26 - } 27 - 28 23 static void __init at91sam9g45_initialize(void) 29 24 { 30 25 arm_pm_idle = at91sam9_idle; 31 - 32 - at91_sysirq_mask_rtc(AT91SAM9G45_BASE_RTC); 33 - at91_sysirq_mask_rtt(AT91SAM9G45_BASE_RTT); 34 26 } 35 27 36 28 AT91_SOC_START(at91sam9g45) 37 - .map_io = at91sam9g45_map_io, 38 29 .init = at91sam9g45_initialize, 39 30 AT91_SOC_END
-12
arch/arm/mach-at91/at91sam9n12.c
··· 16 16 * AT91SAM9N12 processor initialization 17 17 * -------------------------------------------------------------------- */ 18 18 19 - static void __init at91sam9n12_map_io(void) 20 - { 21 - at91_init_sram(0, AT91SAM9N12_SRAM_BASE, AT91SAM9N12_SRAM_SIZE); 22 - } 23 - 24 - static void __init at91sam9n12_initialize(void) 25 - { 26 - at91_sysirq_mask_rtc(AT91SAM9N12_BASE_RTC); 27 - } 28 - 29 19 AT91_SOC_START(at91sam9n12) 30 - .map_io = at91sam9n12_map_io, 31 - .init = at91sam9n12_initialize, 32 20 AT91_SOC_END
-22
arch/arm/mach-at91/at91sam9rl.c
··· 10 10 */ 11 11 12 12 #include <asm/system_misc.h> 13 - #include <asm/irq.h> 14 13 #include <mach/cpu.h> 15 14 #include <mach/at91_dbgu.h> 16 15 #include <mach/hardware.h> ··· 21 22 * AT91SAM9RL processor initialization 22 23 * -------------------------------------------------------------------- */ 23 24 24 - static void __init at91sam9rl_map_io(void) 25 - { 26 - unsigned long sram_size; 27 - 28 - switch (at91_soc_initdata.cidr & AT91_CIDR_SRAMSIZ) { 29 - case AT91_CIDR_SRAMSIZ_32K: 30 - sram_size = 2 * SZ_16K; 31 - break; 32 - case AT91_CIDR_SRAMSIZ_16K: 33 - default: 34 - sram_size = SZ_16K; 35 - } 36 - 37 - /* Map SRAM */ 38 - at91_init_sram(0, AT91SAM9RL_SRAM_BASE, sram_size); 39 - } 40 - 41 25 static void __init at91sam9rl_initialize(void) 42 26 { 43 27 arm_pm_idle = at91sam9_idle; 44 - 45 - at91_sysirq_mask_rtc(AT91SAM9RL_BASE_RTC); 46 - at91_sysirq_mask_rtt(AT91SAM9RL_BASE_RTT); 47 28 } 48 29 49 30 AT91_SOC_START(at91sam9rl) 50 - .map_io = at91sam9rl_map_io, 51 31 .init = at91sam9rl_initialize, 52 32 AT91_SOC_END
-16
arch/arm/mach-at91/at91sam9x5.c
··· 16 16 * AT91SAM9x5 processor initialization 17 17 * -------------------------------------------------------------------- */ 18 18 19 - static void __init at91sam9x5_map_io(void) 20 - { 21 - at91_init_sram(0, AT91SAM9X5_SRAM_BASE, AT91SAM9X5_SRAM_SIZE); 22 - } 23 - 24 - static void __init at91sam9x5_initialize(void) 25 - { 26 - at91_sysirq_mask_rtc(AT91SAM9X5_BASE_RTC); 27 - } 28 - 29 - /* -------------------------------------------------------------------- 30 - * Interrupt initialization 31 - * -------------------------------------------------------------------- */ 32 - 33 19 AT91_SOC_START(at91sam9x5) 34 - .map_io = at91sam9x5_map_io, 35 - .init = at91sam9x5_initialize, 36 20 AT91_SOC_END
+12 -1
arch/arm/mach-at91/board-dt-rm9200.c
··· 14 14 #include <linux/gpio.h> 15 15 #include <linux/of.h> 16 16 #include <linux/of_irq.h> 17 + #include <linux/of_platform.h> 17 18 #include <linux/clk-provider.h> 18 19 19 20 #include <asm/setup.h> ··· 31 30 at91rm9200_timer_init(); 32 31 } 33 32 33 + static void __init rm9200_dt_device_init(void) 34 + { 35 + at91_rm9200_pm_init(); 36 + 37 + of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 38 + } 39 + 40 + 41 + 34 42 static const char *at91rm9200_dt_board_compat[] __initdata = { 35 43 "atmel,at91rm9200", 36 44 NULL ··· 48 38 DT_MACHINE_START(at91rm9200_dt, "Atmel AT91RM9200 (Device Tree)") 49 39 .init_time = at91rm9200_dt_timer_init, 50 40 .map_io = at91_map_io, 51 - .init_early = at91rm9200_dt_initialize, 41 + .init_early = at91_dt_initialize, 42 + .init_machine = rm9200_dt_device_init, 52 43 .dt_compat = at91rm9200_dt_board_compat, 53 44 MACHINE_END
+27
arch/arm/mach-at91/board-dt-sam9.c
··· 13 13 #include <linux/gpio.h> 14 14 #include <linux/of.h> 15 15 #include <linux/of_irq.h> 16 + #include <linux/of_platform.h> 16 17 #include <linux/clk-provider.h> 17 18 18 19 #include <asm/setup.h> ··· 24 23 25 24 #include "generic.h" 26 25 26 + static void __init sam9_dt_device_init(void) 27 + { 28 + at91_sam9260_pm_init(); 29 + of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 30 + } 31 + 27 32 static const char *at91_dt_board_compat[] __initdata = { 28 33 "atmel,at91sam9", 29 34 NULL ··· 39 32 /* Maintainer: Atmel */ 40 33 .map_io = at91_map_io, 41 34 .init_early = at91_dt_initialize, 35 + .init_machine = sam9_dt_device_init, 42 36 .dt_compat = at91_dt_board_compat, 37 + MACHINE_END 38 + 39 + static void __init sam9g45_dt_device_init(void) 40 + { 41 + at91_sam9g45_pm_init(); 42 + of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 43 + } 44 + 45 + static const char *at91_9g45_board_compat[] __initconst = { 46 + "atmel,at91sam9g45", 47 + NULL 48 + }; 49 + 50 + DT_MACHINE_START(at91sam9g45_dt, "Atmel AT91SAM9G45") 51 + /* Maintainer: Atmel */ 52 + .map_io = at91_map_io, 53 + .init_early = at91_dt_initialize, 54 + .init_machine = sam9g45_dt_device_init, 55 + .dt_compat = at91_9g45_board_compat, 43 56 MACHINE_END
+1
arch/arm/mach-at91/board-dt-sama5.c
··· 28 28 29 29 static void __init sama5_dt_device_init(void) 30 30 { 31 + at91_sam9260_pm_init(); 31 32 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 32 33 } 33 34
+13 -8
arch/arm/mach-at91/generic.h
··· 17 17 /* Map io */ 18 18 extern void __init at91_map_io(void); 19 19 extern void __init at91_alt_map_io(void); 20 - extern void __init at91_init_sram(int bank, unsigned long base, 21 - unsigned int length); 22 20 23 21 /* Processors */ 24 - extern void __init at91rm9200_set_type(int type); 25 - extern void __init at91rm9200_dt_initialize(void); 26 22 extern void __init at91_dt_initialize(void); 27 - 28 - /* Interrupts */ 29 - extern void __init at91_sysirq_mask_rtc(u32 rtc_base); 30 - extern void __init at91_sysirq_mask_rtt(u32 rtt_base); 31 23 32 24 /* Timer */ 33 25 extern void at91rm9200_timer_init(void); 34 26 35 27 /* idle */ 28 + extern void at91rm9200_idle(void); 36 29 extern void at91sam9_idle(void); 37 30 38 31 /* Matrix */ 39 32 extern void at91_ioremap_matrix(u32 base_addr); 33 + 34 + 35 + #ifdef CONFIG_PM 36 + extern void __init at91_rm9200_pm_init(void); 37 + extern void __init at91_sam9260_pm_init(void); 38 + extern void __init at91_sam9g45_pm_init(void); 39 + #else 40 + void __init at91_rm9200_pm_init(void) { } 41 + void __init at91_sam9260_pm_init(void) { } 42 + void __init at91_sam9g45_pm_init(void) { } 43 + #endif 44 + 40 45 #endif /* _AT91_GENERIC_H */
-80
arch/arm/mach-at91/include/mach/at91_pio.h
··· 1 - /* 2 - * arch/arm/mach-at91/include/mach/at91_pio.h 3 - * 4 - * Copyright (C) 2005 Ivan Kokshaysky 5 - * Copyright (C) SAN People 6 - * 7 - * Parallel I/O Controller (PIO) - 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 AT91_PIO_H 17 - #define AT91_PIO_H 18 - 19 - #define PIO_PER 0x00 /* Enable Register */ 20 - #define PIO_PDR 0x04 /* Disable Register */ 21 - #define PIO_PSR 0x08 /* Status Register */ 22 - #define PIO_OER 0x10 /* Output Enable Register */ 23 - #define PIO_ODR 0x14 /* Output Disable Register */ 24 - #define PIO_OSR 0x18 /* Output Status Register */ 25 - #define PIO_IFER 0x20 /* Glitch Input Filter Enable */ 26 - #define PIO_IFDR 0x24 /* Glitch Input Filter Disable */ 27 - #define PIO_IFSR 0x28 /* Glitch Input Filter Status */ 28 - #define PIO_SODR 0x30 /* Set Output Data Register */ 29 - #define PIO_CODR 0x34 /* Clear Output Data Register */ 30 - #define PIO_ODSR 0x38 /* Output Data Status Register */ 31 - #define PIO_PDSR 0x3c /* Pin Data Status Register */ 32 - #define PIO_IER 0x40 /* Interrupt Enable Register */ 33 - #define PIO_IDR 0x44 /* Interrupt Disable Register */ 34 - #define PIO_IMR 0x48 /* Interrupt Mask Register */ 35 - #define PIO_ISR 0x4c /* Interrupt Status Register */ 36 - #define PIO_MDER 0x50 /* Multi-driver Enable Register */ 37 - #define PIO_MDDR 0x54 /* Multi-driver Disable Register */ 38 - #define PIO_MDSR 0x58 /* Multi-driver Status Register */ 39 - #define PIO_PUDR 0x60 /* Pull-up Disable Register */ 40 - #define PIO_PUER 0x64 /* Pull-up Enable Register */ 41 - #define PIO_PUSR 0x68 /* Pull-up Status Register */ 42 - #define PIO_ASR 0x70 /* Peripheral A Select Register */ 43 - #define PIO_ABCDSR1 0x70 /* Peripheral ABCD Select Register 1 [some sam9 only] */ 44 - #define PIO_BSR 0x74 /* Peripheral B Select Register */ 45 - #define PIO_ABCDSR2 0x74 /* Peripheral ABCD Select Register 2 [some sam9 only] */ 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 */ 55 - #define PIO_OWER 0xa0 /* Output Write Enable Register */ 56 - #define PIO_OWDR 0xa4 /* Output Write Disable Register */ 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 73 - 74 - #define SAMA5D3_PIO_DRIVER1 0x118 /*PIO Driver 1 register offset*/ 75 - #define SAMA5D3_PIO_DRIVER2 0x11C /*PIO Driver 2 register offset*/ 76 - 77 - #define AT91SAM9X5_PIO_DRIVER1 0x114 /*PIO Driver 1 register offset*/ 78 - #define AT91SAM9X5_PIO_DRIVER2 0x118 /*PIO Driver 2 register offset*/ 79 - 80 - #endif
-35
arch/arm/mach-at91/include/mach/at91_rtt.h
··· 1 - /* 2 - * arch/arm/mach-at91/include/mach/at91_rtt.h 3 - * 4 - * Copyright (C) 2007 Andrew Victor 5 - * Copyright (C) 2007 Atmel Corporation. 6 - * 7 - * Real-time Timer (RTT) - System peripherals regsters. 8 - * Based on AT91SAM9261 datasheet revision D. 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 AT91_RTT_H 17 - #define AT91_RTT_H 18 - 19 - #define AT91_RTT_MR 0x00 /* Real-time Mode Register */ 20 - #define AT91_RTT_RTPRES (0xffff << 0) /* Real-time Timer Prescaler Value */ 21 - #define AT91_RTT_ALMIEN (1 << 16) /* Alarm Interrupt Enable */ 22 - #define AT91_RTT_RTTINCIEN (1 << 17) /* Real Time Timer Increment Interrupt Enable */ 23 - #define AT91_RTT_RTTRST (1 << 18) /* Real Time Timer Restart */ 24 - 25 - #define AT91_RTT_AR 0x04 /* Real-time Alarm Register */ 26 - #define AT91_RTT_ALMV (0xffffffff) /* Alarm Value */ 27 - 28 - #define AT91_RTT_VR 0x08 /* Real-time Value Register */ 29 - #define AT91_RTT_CRTV (0xffffffff) /* Current Real-time Value */ 30 - 31 - #define AT91_RTT_SR 0x0c /* Real-time Status Register */ 32 - #define AT91_RTT_ALMS (1 << 0) /* Real-time Alarm Status */ 33 - #define AT91_RTT_RTTINC (1 << 1) /* Real-time Timer Increment */ 34 - 35 - #endif
+11 -8
arch/arm/mach-at91/include/mach/debug-macro.S arch/arm/include/debug/at91.S
··· 1 1 /* 2 - * arch/arm/mach-at91/include/mach/debug-macro.S 3 - * 4 2 * Copyright (C) 2003-2005 SAN People 5 3 * 6 4 * Debugging macro include header ··· 9 11 * 10 12 */ 11 13 12 - #include <mach/hardware.h> 13 - #include <mach/at91_dbgu.h> 14 - 15 14 #if defined(CONFIG_AT91_DEBUG_LL_DBGU0) 16 - #define AT91_DBGU AT91_BASE_DBGU0 15 + #define AT91_DBGU 0xfffff200 /* AT91_BASE_DBGU0 */ 17 16 #elif defined(CONFIG_AT91_DEBUG_LL_DBGU1) 18 - #define AT91_DBGU AT91_BASE_DBGU1 17 + #define AT91_DBGU 0xffffee00 /* AT91_BASE_DBGU1 */ 19 18 #else 20 19 /* On sama5d4, use USART3 as low level serial console */ 21 - #define AT91_DBGU SAMA5D4_BASE_USART3 20 + #define AT91_DBGU 0xfc00c000 /* SAMA5D4_BASE_USART3 */ 22 21 #endif 22 + 23 + /* Keep in sync with mach-at91/include/mach/hardware.h */ 24 + #define AT91_IO_P2V(x) ((x) - 0x01000000) 25 + 26 + #define AT91_DBGU_SR (0x14) /* Status Register */ 27 + #define AT91_DBGU_THR (0x1c) /* Transmitter Holding Register */ 28 + #define AT91_DBGU_TXRDY (1 << 1) /* Transmitter Ready */ 29 + #define AT91_DBGU_TXEMPTY (1 << 9) /* Transmitter Empty */ 23 30 24 31 .macro addruart, rp, rv, tmp 25 32 ldr \rp, =AT91_DBGU @ System peripherals (phys address)
-26
arch/arm/mach-at91/include/mach/memory.h
··· 1 - /* 2 - * arch/arm/mach-at91/include/mach/memory.h 3 - * 4 - * Copyright (C) 2004 SAN People 5 - * 6 - * This program is free software; you can redistribute it and/or modify 7 - * it under the terms of the GNU General Public License as published by 8 - * the Free Software Foundation; either version 2 of the License, or 9 - * (at your option) any later version. 10 - * 11 - * This program is distributed in the hope that it will be useful, 12 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 - * GNU General Public License for more details. 15 - * 16 - * You should have received a copy of the GNU General Public License 17 - * along with this program; if not, write to the Free Software 18 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 - */ 20 - 21 - #ifndef __ASM_ARCH_MEMORY_H 22 - #define __ASM_ARCH_MEMORY_H 23 - 24 - #include <mach/hardware.h> 25 - 26 - #endif
+84 -27
arch/arm/mach-at91/pm.c
··· 14 14 #include <linux/suspend.h> 15 15 #include <linux/sched.h> 16 16 #include <linux/proc_fs.h> 17 + #include <linux/genalloc.h> 17 18 #include <linux/interrupt.h> 18 19 #include <linux/sysfs.h> 19 20 #include <linux/module.h> 21 + #include <linux/of.h> 22 + #include <linux/of_platform.h> 20 23 #include <linux/platform_device.h> 21 24 #include <linux/io.h> 22 25 #include <linux/clk/at91_pmc.h> ··· 34 31 35 32 #include "generic.h" 36 33 #include "pm.h" 34 + 35 + static struct { 36 + unsigned long uhp_udp_mask; 37 + int memctrl; 38 + } at91_pm_data; 37 39 38 40 static void (*at91_pm_standby)(void); 39 41 ··· 79 71 scsr = at91_pmc_read(AT91_PMC_SCSR); 80 72 81 73 /* USB must not be using PLLB */ 82 - if (cpu_is_at91rm9200()) { 83 - if ((scsr & (AT91RM9200_PMC_UHP | AT91RM9200_PMC_UDP)) != 0) { 84 - pr_err("AT91: PM - Suspend-to-RAM with USB still active\n"); 85 - return 0; 86 - } 87 - } else if (cpu_is_at91sam9260() || cpu_is_at91sam9261() || cpu_is_at91sam9263() 88 - || cpu_is_at91sam9g20() || cpu_is_at91sam9g10()) { 89 - if ((scsr & (AT91SAM926x_PMC_UHP | AT91SAM926x_PMC_UDP)) != 0) { 90 - pr_err("AT91: PM - Suspend-to-RAM with USB still active\n"); 91 - return 0; 92 - } 74 + if ((scsr & at91_pm_data.uhp_udp_mask) != 0) { 75 + pr_err("AT91: PM - Suspend-to-RAM with USB still active\n"); 76 + return 0; 93 77 } 94 78 95 79 /* PCK0..PCK3 must be disabled, or configured to use clk32k */ ··· 149 149 * turning off the main oscillator; reverse on wakeup. 150 150 */ 151 151 if (slow_clock) { 152 - int memctrl = AT91_MEMCTRL_SDRAMC; 153 - 154 - if (cpu_is_at91rm9200()) 155 - memctrl = AT91_MEMCTRL_MC; 156 - else if (cpu_is_at91sam9g45()) 157 - memctrl = AT91_MEMCTRL_DDRSDR; 158 152 #ifdef CONFIG_AT91_SLOW_CLOCK 159 153 /* copy slow_clock handler to SRAM, and call it */ 160 154 memcpy(slow_clock, at91_slow_clock, at91_slow_clock_sz); 161 155 #endif 162 156 slow_clock(at91_pmc_base, at91_ramc_base[0], 163 - at91_ramc_base[1], memctrl); 157 + at91_ramc_base[1], 158 + at91_pm_data.memctrl); 164 159 break; 165 160 } else { 166 161 pr_info("AT91: PM - no slow clock mode enabled ...\n"); ··· 224 229 } 225 230 } 226 231 227 - static int __init at91_pm_init(void) 232 + #ifdef CONFIG_AT91_SLOW_CLOCK 233 + static void __init at91_pm_sram_init(void) 234 + { 235 + struct gen_pool *sram_pool; 236 + phys_addr_t sram_pbase; 237 + unsigned long sram_base; 238 + struct device_node *node; 239 + struct platform_device *pdev; 240 + 241 + node = of_find_compatible_node(NULL, NULL, "mmio-sram"); 242 + if (!node) { 243 + pr_warn("%s: failed to find sram node!\n", __func__); 244 + return; 245 + } 246 + 247 + pdev = of_find_device_by_node(node); 248 + if (!pdev) { 249 + pr_warn("%s: failed to find sram device!\n", __func__); 250 + goto put_node; 251 + } 252 + 253 + sram_pool = dev_get_gen_pool(&pdev->dev); 254 + if (!sram_pool) { 255 + pr_warn("%s: sram pool unavailable!\n", __func__); 256 + goto put_node; 257 + } 258 + 259 + sram_base = gen_pool_alloc(sram_pool, at91_slow_clock_sz); 260 + if (!sram_base) { 261 + pr_warn("%s: unable to alloc ocram!\n", __func__); 262 + goto put_node; 263 + } 264 + 265 + sram_pbase = gen_pool_virt_to_phys(sram_pool, sram_base); 266 + slow_clock = __arm_ioremap_exec(sram_pbase, at91_slow_clock_sz, false); 267 + 268 + put_node: 269 + of_node_put(node); 270 + } 271 + #endif 272 + 273 + 274 + static void __init at91_pm_init(void) 228 275 { 229 276 #ifdef CONFIG_AT91_SLOW_CLOCK 230 - slow_clock = (void *) (AT91_IO_VIRT_BASE - at91_slow_clock_sz); 277 + at91_pm_sram_init(); 231 278 #endif 232 279 233 280 pr_info("AT91: Power Management%s\n", (slow_clock ? " (with slow clock mode)" : "")); 234 281 235 - /* AT91RM9200 SDRAM low-power mode cannot be used with self-refresh. */ 236 - if (cpu_is_at91rm9200()) 237 - at91_ramc_write(0, AT91RM9200_SDRAMC_LPR, 0); 238 - 239 282 if (at91_cpuidle_device.dev.platform_data) 240 283 platform_device_register(&at91_cpuidle_device); 241 284 242 285 suspend_set_ops(&at91_pm_ops); 243 - 244 - return 0; 245 286 } 246 - arch_initcall(at91_pm_init); 287 + 288 + void __init at91_rm9200_pm_init(void) 289 + { 290 + /* 291 + * AT91RM9200 SDRAM low-power mode cannot be used with self-refresh. 292 + */ 293 + at91_ramc_write(0, AT91RM9200_SDRAMC_LPR, 0); 294 + 295 + at91_pm_data.uhp_udp_mask = AT91RM9200_PMC_UHP | AT91RM9200_PMC_UDP; 296 + at91_pm_data.memctrl = AT91_MEMCTRL_MC; 297 + 298 + at91_pm_init(); 299 + } 300 + 301 + void __init at91_sam9260_pm_init(void) 302 + { 303 + at91_pm_data.memctrl = AT91_MEMCTRL_SDRAMC; 304 + at91_pm_data.uhp_udp_mask = AT91SAM926x_PMC_UHP | AT91SAM926x_PMC_UDP; 305 + return at91_pm_init(); 306 + } 307 + 308 + void __init at91_sam9g45_pm_init(void) 309 + { 310 + at91_pm_data.uhp_udp_mask = AT91SAM926x_PMC_UHP; 311 + at91_pm_data.memctrl = AT91_MEMCTRL_DDRSDR; 312 + return at91_pm_init(); 313 + }
-12
arch/arm/mach-at91/sama5d3.c
··· 25 25 * AT91SAM9x5 processor initialization 26 26 * -------------------------------------------------------------------- */ 27 27 28 - static void __init sama5d3_map_io(void) 29 - { 30 - at91_init_sram(0, SAMA5D3_SRAM_BASE, SAMA5D3_SRAM_SIZE); 31 - } 32 - 33 - static void __init sama5d3_initialize(void) 34 - { 35 - at91_sysirq_mask_rtc(SAMA5D3_BASE_RTC); 36 - } 37 - 38 28 AT91_SOC_START(sama5d3) 39 - .map_io = sama5d3_map_io, 40 - .init = sama5d3_initialize, 41 29 AT91_SOC_END
-1
arch/arm/mach-at91/sama5d4.c
··· 56 56 static void __init sama5d4_map_io(void) 57 57 { 58 58 iotable_init(at91_io_desc, ARRAY_SIZE(at91_io_desc)); 59 - at91_init_sram(0, SAMA5D4_NS_SRAM_BASE, SAMA5D4_NS_SRAM_SIZE); 60 59 } 61 60 62 61 AT91_SOC_START(sama5d4)
-38
arch/arm/mach-at91/setup.c
··· 31 31 struct at91_socinfo at91_soc_initdata; 32 32 EXPORT_SYMBOL(at91_soc_initdata); 33 33 34 - void __init at91rm9200_set_type(int type) 35 - { 36 - if (type == ARCH_REVISON_9200_PQFP) 37 - at91_soc_initdata.subtype = AT91_SOC_RM9200_PQFP; 38 - else 39 - at91_soc_initdata.subtype = AT91_SOC_RM9200_BGA; 40 - 41 - pr_info("filled in soc subtype: %s\n", 42 - at91_get_soc_subtype(&at91_soc_initdata)); 43 - } 44 - 45 34 void __iomem *at91_ramc_base[2]; 46 35 EXPORT_SYMBOL_GPL(at91_ramc_base); 47 - 48 - static struct map_desc sram_desc[2] __initdata; 49 - 50 - void __init at91_init_sram(int bank, unsigned long base, unsigned int length) 51 - { 52 - struct map_desc *desc = &sram_desc[bank]; 53 - 54 - desc->virtual = (unsigned long)AT91_IO_VIRT_BASE - length; 55 - if (bank > 0) 56 - desc->virtual -= sram_desc[bank - 1].length; 57 - 58 - desc->pfn = __phys_to_pfn(base); 59 - desc->length = length; 60 - desc->type = MT_MEMORY_RWX_NONCACHED; 61 - 62 - pr_info("sram at 0x%lx of 0x%x mapped at 0x%lx\n", 63 - base, length, desc->virtual); 64 - 65 - iotable_init(desc, 1); 66 - } 67 36 68 37 static struct map_desc at91_io_desc __initdata __maybe_unused = { 69 38 .virtual = (unsigned long)AT91_VA_BASE_SYS, ··· 396 427 } 397 428 398 429 at91_pm_set_standby(standby); 399 - } 400 - 401 - void __init at91rm9200_dt_initialize(void) 402 - { 403 - at91_dt_ramc(); 404 - 405 - at91_boot_soc.init(); 406 430 } 407 431 408 432 void __init at91_dt_initialize(void)
-75
arch/arm/mach-at91/sysirq_mask.c
··· 1 - /* 2 - * sysirq_mask.c - System-interrupt masking 3 - * 4 - * Copyright (C) 2013 Johan Hovold <jhovold@gmail.com> 5 - * 6 - * Functions to disable system interrupts from backup-powered peripherals. 7 - * 8 - * The RTC and RTT-peripherals are generally powered by backup power (VDDBU) 9 - * and are not reset on wake-up, user, watchdog or software reset. This means 10 - * that their interrupts may be enabled during early boot (e.g. after a user 11 - * reset). 12 - * 13 - * As the RTC and RTT share the system-interrupt line with the PIT, an 14 - * interrupt occurring before a handler has been installed would lead to the 15 - * system interrupt being disabled and prevent the system from booting. 16 - * 17 - * This program is free software; you can redistribute it and/or modify 18 - * it under the terms of the GNU General Public License as published by 19 - * the Free Software Foundation; either version 2 of the License, or 20 - * (at your option) any later version. 21 - */ 22 - 23 - #include <linux/io.h> 24 - #include <mach/at91_rtt.h> 25 - 26 - #include "generic.h" 27 - 28 - #define AT91_RTC_IDR 0x24 /* Interrupt Disable Register */ 29 - #define AT91_RTC_IMR 0x28 /* Interrupt Mask Register */ 30 - #define AT91_RTC_IRQ_MASK 0x1f /* Available IRQs mask */ 31 - 32 - void __init at91_sysirq_mask_rtc(u32 rtc_base) 33 - { 34 - void __iomem *base; 35 - 36 - base = ioremap(rtc_base, 64); 37 - if (!base) 38 - return; 39 - 40 - /* 41 - * sam9x5 SoCs have the following errata: 42 - * "RTC: Interrupt Mask Register cannot be used 43 - * Interrupt Mask Register read always returns 0." 44 - * 45 - * Hence we're not relying on IMR values to disable 46 - * interrupts. 47 - */ 48 - writel_relaxed(AT91_RTC_IRQ_MASK, base + AT91_RTC_IDR); 49 - (void)readl_relaxed(base + AT91_RTC_IMR); /* flush */ 50 - 51 - iounmap(base); 52 - } 53 - 54 - void __init at91_sysirq_mask_rtt(u32 rtt_base) 55 - { 56 - void __iomem *base; 57 - void __iomem *reg; 58 - u32 mode; 59 - 60 - base = ioremap(rtt_base, 16); 61 - if (!base) 62 - return; 63 - 64 - reg = base + AT91_RTT_MR; 65 - 66 - mode = readl_relaxed(reg); 67 - if (mode & (AT91_RTT_ALMIEN | AT91_RTT_RTTINCIEN)) { 68 - pr_info("AT91: Disabling rtt irq\n"); 69 - mode &= ~(AT91_RTT_ALMIEN | AT91_RTT_RTTINCIEN); 70 - writel_relaxed(mode, reg); 71 - (void)readl_relaxed(reg); /* flush */ 72 - } 73 - 74 - iounmap(base); 75 - }
+9
drivers/clk/at91/pmc.c
··· 27 27 void __iomem *at91_pmc_base; 28 28 EXPORT_SYMBOL_GPL(at91_pmc_base); 29 29 30 + void at91rm9200_idle(void) 31 + { 32 + /* 33 + * Disable the processor clock. The processor will be automatically 34 + * re-enabled by an interrupt or by a reset. 35 + */ 36 + at91_pmc_write(AT91_PMC_SCDR, AT91_PMC_PCK); 37 + } 38 + 30 39 void at91sam9_idle(void) 31 40 { 32 41 at91_pmc_write(AT91_PMC_SCDR, AT91_PMC_PCK);
-28
drivers/rtc/Kconfig
··· 1141 1141 probably want to use the real RTC block instead of the "RTT as an 1142 1142 RTC" driver. 1143 1143 1144 - config RTC_DRV_AT91SAM9_RTT 1145 - int 1146 - range 0 1 1147 - default 0 1148 - depends on RTC_DRV_AT91SAM9 1149 - help 1150 - This option is only relevant for legacy board support and 1151 - won't be used when booting a DT board. 1152 - 1153 - More than one RTT module is available. You can choose which 1154 - one will be used as an RTC. The default of zero is normally 1155 - OK to use, though some systems use that for non-RTC purposes. 1156 - 1157 - config RTC_DRV_AT91SAM9_GPBR 1158 - int 1159 - range 0 3 1160 - default 0 1161 - prompt "Backup Register Number" 1162 - depends on RTC_DRV_AT91SAM9 1163 - help 1164 - This option is only relevant for legacy board support and 1165 - won't be used when booting a DT board. 1166 - 1167 - The RTC driver needs to use one of the General Purpose Backup 1168 - Registers (GPBRs) as well as the RTT. You can choose which one 1169 - will be used. The default of zero is normally OK to use, but 1170 - on some systems other software needs to use that register. 1171 - 1172 1144 config RTC_DRV_AU1XXX 1173 1145 tristate "Au1xxx Counter0 RTC support" 1174 1146 depends on MIPS_ALCHEMY