diff options
author | Olof Johansson <olof@lixom.net> | 2015-01-21 18:17:56 -0500 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2015-01-21 18:17:56 -0500 |
commit | 7f09a46fe9e0d5cb68a16c50f06e11600830b340 (patch) | |
tree | 1ebb9781a5af4ed72ab8d96513356f03fa9022d4 | |
parent | 7fda91e731554336c08a8157b886387d890a9676 (diff) | |
parent | 29ee506d0d56f6d39cc237de2512f9cb5629cbf7 (diff) |
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>
45 files changed, 519 insertions, 490 deletions
diff --git a/Documentation/arm/Atmel/README b/Documentation/arm/Atmel/README new file mode 100644 index 000000000000..c53a19b4aab2 --- /dev/null +++ b/Documentation/arm/Atmel/README | |||
@@ -0,0 +1,124 @@ | |||
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). | ||
diff --git a/Documentation/devicetree/bindings/arm/atmel-at91.txt b/Documentation/devicetree/bindings/arm/atmel-at91.txt index 562cda9d86d9..ad319f84f560 100644 --- a/Documentation/devicetree/bindings/arm/atmel-at91.txt +++ b/Documentation/devicetree/bindings/arm/atmel-at91.txt | |||
@@ -24,6 +24,7 @@ compatible: must be one of: | |||
24 | o "atmel,at91sam9g45" | 24 | o "atmel,at91sam9g45" |
25 | o "atmel,at91sam9n12" | 25 | o "atmel,at91sam9n12" |
26 | o "atmel,at91sam9rl" | 26 | o "atmel,at91sam9rl" |
27 | o "atmel,at91sam9xe" | ||
27 | * "atmel,sama5" for SoCs using a Cortex-A5, shall be extended with the specific | 28 | * "atmel,sama5" for SoCs using a Cortex-A5, shall be extended with the specific |
28 | SoC family: | 29 | SoC family: |
29 | o "atmel,sama5d3" shall be extended with the specific SoC compatible: | 30 | o "atmel,sama5d3" shall be extended with the specific SoC compatible: |
@@ -136,3 +137,19 @@ Example: | |||
136 | compatible = "atmel,at91sam9260-rstc"; | 137 | compatible = "atmel,at91sam9260-rstc"; |
137 | reg = <0xfffffd00 0x10>; | 138 | reg = <0xfffffd00 0x10>; |
138 | }; | 139 | }; |
140 | |||
141 | Special Function Registers (SFR) | ||
142 | |||
143 | Special Function Registers (SFR) manage specific aspects of the integrated | ||
144 | memory, bridge implementations, processor and other functionality not controlled | ||
145 | elsewhere. | ||
146 | |||
147 | required properties: | ||
148 | - compatible: Should be "atmel,<chip>-sfr", "syscon". | ||
149 | <chip> can be "sama5d3" or "sama5d4". | ||
150 | - reg: Should contain registers location and length | ||
151 | |||
152 | sfr@f0038000 { | ||
153 | compatible = "atmel,sama5d3-sfr", "syscon"; | ||
154 | reg = <0xf0038000 0x60>; | ||
155 | }; | ||
diff --git a/MAINTAINERS b/MAINTAINERS index 3589d67437f8..8c25979a3c43 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -877,6 +877,7 @@ F: arch/arm/boot/dts/at91*.dts | |||
877 | F: arch/arm/boot/dts/at91*.dtsi | 877 | F: arch/arm/boot/dts/at91*.dtsi |
878 | F: arch/arm/boot/dts/sama*.dts | 878 | F: arch/arm/boot/dts/sama*.dts |
879 | F: arch/arm/boot/dts/sama*.dtsi | 879 | F: arch/arm/boot/dts/sama*.dtsi |
880 | F: arch/arm/include/debug/at91.S | ||
880 | 881 | ||
881 | ARM/ATMEL AT91 Clock Support | 882 | ARM/ATMEL AT91 Clock Support |
882 | M: Boris Brezillon <boris.brezillon@free-electrons.com> | 883 | M: Boris Brezillon <boris.brezillon@free-electrons.com> |
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index 15fb262677ae..dc2b768edb8a 100644 --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug | |||
@@ -115,15 +115,18 @@ choice | |||
115 | 0x80024000 | 0xf0024000 | UART9 | 115 | 0x80024000 | 0xf0024000 | UART9 |
116 | 116 | ||
117 | config AT91_DEBUG_LL_DBGU0 | 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 | depends on HAVE_AT91_DBGU0 | 120 | depends on HAVE_AT91_DBGU0 |
120 | 121 | ||
121 | config AT91_DEBUG_LL_DBGU1 | 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 | depends on HAVE_AT91_DBGU1 | 125 | depends on HAVE_AT91_DBGU1 |
124 | 126 | ||
125 | config AT91_DEBUG_LL_DBGU2 | 127 | config AT91_DEBUG_LL_DBGU2 |
126 | bool "Kernel low-level debugging on sama5d4" | 128 | bool "Kernel low-level debugging on sama5d4" |
129 | select DEBUG_AT91_UART | ||
127 | depends on HAVE_AT91_DBGU2 | 130 | depends on HAVE_AT91_DBGU2 |
128 | 131 | ||
129 | config DEBUG_BCM2835 | 132 | config DEBUG_BCM2835 |
@@ -1204,6 +1207,8 @@ config DEBUG_LL_INCLUDE | |||
1204 | string | 1207 | string |
1205 | default "debug/sa1100.S" if DEBUG_SA1100 | 1208 | default "debug/sa1100.S" if DEBUG_SA1100 |
1206 | default "debug/8250.S" if DEBUG_LL_UART_8250 || DEBUG_UART_8250 | 1209 | default "debug/8250.S" if DEBUG_LL_UART_8250 || DEBUG_UART_8250 |
1210 | default "debug/at91.S" if AT91_DEBUG_LL_DBGU0 || AT91_DEBUG_LL_DBGU1 || \ | ||
1211 | AT91_DEBUG_LL_DBGU2 | ||
1207 | default "debug/asm9260.S" if DEBUG_ASM9260_UART | 1212 | default "debug/asm9260.S" if DEBUG_ASM9260_UART |
1208 | default "debug/clps711x.S" if DEBUG_CLPS711X_UART1 || DEBUG_CLPS711X_UART2 | 1213 | default "debug/clps711x.S" if DEBUG_CLPS711X_UART1 || DEBUG_CLPS711X_UART2 |
1209 | default "debug/meson.S" if DEBUG_MESON_UARTAO | 1214 | default "debug/meson.S" if DEBUG_MESON_UARTAO |
diff --git a/arch/arm/boot/dts/at91rm9200.dtsi b/arch/arm/boot/dts/at91rm9200.dtsi index 6c97d4af61ee..21c2b504f977 100644 --- a/arch/arm/boot/dts/at91rm9200.dtsi +++ b/arch/arm/boot/dts/at91rm9200.dtsi | |||
@@ -66,6 +66,11 @@ | |||
66 | }; | 66 | }; |
67 | }; | 67 | }; |
68 | 68 | ||
69 | sram: sram@00200000 { | ||
70 | compatible = "mmio-sram"; | ||
71 | reg = <0x00200000 0x4000>; | ||
72 | }; | ||
73 | |||
69 | ahb { | 74 | ahb { |
70 | compatible = "simple-bus"; | 75 | compatible = "simple-bus"; |
71 | #address-cells = <1>; | 76 | #address-cells = <1>; |
@@ -356,6 +361,13 @@ | |||
356 | interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>; | 361 | interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>; |
357 | }; | 362 | }; |
358 | 363 | ||
364 | rtc: rtc@fffffe00 { | ||
365 | compatible = "atmel,at91rm9200-rtc"; | ||
366 | reg = <0xfffffe00 0x40>; | ||
367 | interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>; | ||
368 | status = "disabled"; | ||
369 | }; | ||
370 | |||
359 | tcb0: timer@fffa0000 { | 371 | tcb0: timer@fffa0000 { |
360 | compatible = "atmel,at91rm9200-tcb"; | 372 | compatible = "atmel,at91rm9200-tcb"; |
361 | reg = <0xfffa0000 0x100>; | 373 | reg = <0xfffa0000 0x100>; |
diff --git a/arch/arm/boot/dts/at91rm9200ek.dts b/arch/arm/boot/dts/at91rm9200ek.dts index 43eb779dd6f6..2a5d21247d7e 100644 --- a/arch/arm/boot/dts/at91rm9200ek.dts +++ b/arch/arm/boot/dts/at91rm9200ek.dts | |||
@@ -77,6 +77,10 @@ | |||
77 | dbgu: serial@fffff200 { | 77 | dbgu: serial@fffff200 { |
78 | status = "okay"; | 78 | status = "okay"; |
79 | }; | 79 | }; |
80 | |||
81 | rtc: rtc@fffffe00 { | ||
82 | status = "okay"; | ||
83 | }; | ||
80 | }; | 84 | }; |
81 | 85 | ||
82 | usb0: ohci@00300000 { | 86 | usb0: ohci@00300000 { |
diff --git a/arch/arm/boot/dts/at91sam9260.dtsi b/arch/arm/boot/dts/at91sam9260.dtsi index dd1313cbc314..fff0ee69aab4 100644 --- a/arch/arm/boot/dts/at91sam9260.dtsi +++ b/arch/arm/boot/dts/at91sam9260.dtsi | |||
@@ -69,6 +69,11 @@ | |||
69 | }; | 69 | }; |
70 | }; | 70 | }; |
71 | 71 | ||
72 | sram0: sram@002ff000 { | ||
73 | compatible = "mmio-sram"; | ||
74 | reg = <0x002ff000 0x2000>; | ||
75 | }; | ||
76 | |||
72 | ahb { | 77 | ahb { |
73 | compatible = "simple-bus"; | 78 | compatible = "simple-bus"; |
74 | #address-cells = <1>; | 79 | #address-cells = <1>; |
diff --git a/arch/arm/boot/dts/at91sam9261.dtsi b/arch/arm/boot/dts/at91sam9261.dtsi index cdb9ed612109..e247b0b5fdab 100644 --- a/arch/arm/boot/dts/at91sam9261.dtsi +++ b/arch/arm/boot/dts/at91sam9261.dtsi | |||
@@ -60,6 +60,11 @@ | |||
60 | }; | 60 | }; |
61 | }; | 61 | }; |
62 | 62 | ||
63 | sram: sram@00300000 { | ||
64 | compatible = "mmio-sram"; | ||
65 | reg = <0x00300000 0x28000>; | ||
66 | }; | ||
67 | |||
63 | ahb { | 68 | ahb { |
64 | compatible = "simple-bus"; | 69 | compatible = "simple-bus"; |
65 | #address-cells = <1>; | 70 | #address-cells = <1>; |
diff --git a/arch/arm/boot/dts/at91sam9263.dtsi b/arch/arm/boot/dts/at91sam9263.dtsi index 1467750e3377..8a210d5033b1 100644 --- a/arch/arm/boot/dts/at91sam9263.dtsi +++ b/arch/arm/boot/dts/at91sam9263.dtsi | |||
@@ -62,6 +62,16 @@ | |||
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 | ahb { | 75 | ahb { |
66 | compatible = "simple-bus"; | 76 | compatible = "simple-bus"; |
67 | #address-cells = <1>; | 77 | #address-cells = <1>; |
@@ -294,7 +304,7 @@ | |||
294 | reg = <17>; | 304 | reg = <17>; |
295 | }; | 305 | }; |
296 | 306 | ||
297 | ac91_clk: ac97_clk { | 307 | ac97_clk: ac97_clk { |
298 | #clock-cells = <0>; | 308 | #clock-cells = <0>; |
299 | reg = <18>; | 309 | reg = <18>; |
300 | }; | 310 | }; |
diff --git a/arch/arm/boot/dts/at91sam9g20.dtsi b/arch/arm/boot/dts/at91sam9g20.dtsi index a50ee587a7af..f59301618163 100644 --- a/arch/arm/boot/dts/at91sam9g20.dtsi +++ b/arch/arm/boot/dts/at91sam9g20.dtsi | |||
@@ -16,6 +16,15 @@ | |||
16 | reg = <0x20000000 0x08000000>; | 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 | ahb { | 28 | ahb { |
20 | apb { | 29 | apb { |
21 | i2c0: i2c@fffac000 { | 30 | i2c0: i2c@fffac000 { |
diff --git a/arch/arm/boot/dts/at91sam9g45.dtsi b/arch/arm/boot/dts/at91sam9g45.dtsi index 2a8da8a884b4..ee80aa9c0759 100644 --- a/arch/arm/boot/dts/at91sam9g45.dtsi +++ b/arch/arm/boot/dts/at91sam9g45.dtsi | |||
@@ -74,6 +74,11 @@ | |||
74 | }; | 74 | }; |
75 | }; | 75 | }; |
76 | 76 | ||
77 | sram: sram@00300000 { | ||
78 | compatible = "mmio-sram"; | ||
79 | reg = <0x00300000 0x10000>; | ||
80 | }; | ||
81 | |||
77 | ahb { | 82 | ahb { |
78 | compatible = "simple-bus"; | 83 | compatible = "simple-bus"; |
79 | #address-cells = <1>; | 84 | #address-cells = <1>; |
@@ -1287,7 +1292,6 @@ | |||
1287 | compatible = "atmel,at91rm9200-ohci", "usb-ohci"; | 1292 | compatible = "atmel,at91rm9200-ohci", "usb-ohci"; |
1288 | reg = <0x00700000 0x100000>; | 1293 | reg = <0x00700000 0x100000>; |
1289 | interrupts = <22 IRQ_TYPE_LEVEL_HIGH 2>; | 1294 | interrupts = <22 IRQ_TYPE_LEVEL_HIGH 2>; |
1290 | //TODO | ||
1291 | clocks = <&usb>, <&uhphs_clk>, <&uhphs_clk>, <&uhpck>; | 1295 | clocks = <&usb>, <&uhphs_clk>, <&uhphs_clk>, <&uhpck>; |
1292 | clock-names = "usb_clk", "ohci_clk", "hclk", "uhpck"; | 1296 | clock-names = "usb_clk", "ohci_clk", "hclk", "uhpck"; |
1293 | status = "disabled"; | 1297 | status = "disabled"; |
@@ -1297,7 +1301,6 @@ | |||
1297 | compatible = "atmel,at91sam9g45-ehci", "usb-ehci"; | 1301 | compatible = "atmel,at91sam9g45-ehci", "usb-ehci"; |
1298 | reg = <0x00800000 0x100000>; | 1302 | reg = <0x00800000 0x100000>; |
1299 | interrupts = <22 IRQ_TYPE_LEVEL_HIGH 2>; | 1303 | interrupts = <22 IRQ_TYPE_LEVEL_HIGH 2>; |
1300 | //TODO | ||
1301 | clocks = <&usb>, <&uhphs_clk>, <&uhphs_clk>, <&uhpck>; | 1304 | clocks = <&usb>, <&uhphs_clk>, <&uhphs_clk>, <&uhpck>; |
1302 | clock-names = "usb_clk", "ehci_clk", "hclk", "uhpck"; | 1305 | clock-names = "usb_clk", "ehci_clk", "hclk", "uhpck"; |
1303 | status = "disabled"; | 1306 | status = "disabled"; |
diff --git a/arch/arm/boot/dts/at91sam9n12.dtsi b/arch/arm/boot/dts/at91sam9n12.dtsi index 68eb9aded164..c2666a7cb5b1 100644 --- a/arch/arm/boot/dts/at91sam9n12.dtsi +++ b/arch/arm/boot/dts/at91sam9n12.dtsi | |||
@@ -64,6 +64,11 @@ | |||
64 | }; | 64 | }; |
65 | }; | 65 | }; |
66 | 66 | ||
67 | sram: sram@00300000 { | ||
68 | compatible = "mmio-sram"; | ||
69 | reg = <0x00300000 0x8000>; | ||
70 | }; | ||
71 | |||
67 | ahb { | 72 | ahb { |
68 | compatible = "simple-bus"; | 73 | compatible = "simple-bus"; |
69 | #address-cells = <1>; | 74 | #address-cells = <1>; |
@@ -893,6 +898,13 @@ | |||
893 | status = "disabled"; | 898 | status = "disabled"; |
894 | }; | 899 | }; |
895 | 900 | ||
901 | rtc@fffffeb0 { | ||
902 | compatible = "atmel,at91rm9200-rtc"; | ||
903 | reg = <0xfffffeb0 0x40>; | ||
904 | interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>; | ||
905 | status = "disabled"; | ||
906 | }; | ||
907 | |||
896 | pwm0: pwm@f8034000 { | 908 | pwm0: pwm@f8034000 { |
897 | compatible = "atmel,at91sam9rl-pwm"; | 909 | compatible = "atmel,at91sam9rl-pwm"; |
898 | reg = <0xf8034000 0x300>; | 910 | reg = <0xf8034000 0x300>; |
diff --git a/arch/arm/boot/dts/at91sam9rl.dtsi b/arch/arm/boot/dts/at91sam9rl.dtsi index 72424371413e..40f645b8fe25 100644 --- a/arch/arm/boot/dts/at91sam9rl.dtsi +++ b/arch/arm/boot/dts/at91sam9rl.dtsi | |||
@@ -70,6 +70,11 @@ | |||
70 | }; | 70 | }; |
71 | }; | 71 | }; |
72 | 72 | ||
73 | sram: sram@00300000 { | ||
74 | compatible = "mmio-sram"; | ||
75 | reg = <0x00300000 0x10000>; | ||
76 | }; | ||
77 | |||
73 | ahb { | 78 | ahb { |
74 | compatible = "simple-bus"; | 79 | compatible = "simple-bus"; |
75 | #address-cells = <1>; | 80 | #address-cells = <1>; |
diff --git a/arch/arm/boot/dts/at91sam9x5.dtsi b/arch/arm/boot/dts/at91sam9x5.dtsi index bbb3ba65165f..818dabdd8c0e 100644 --- a/arch/arm/boot/dts/at91sam9x5.dtsi +++ b/arch/arm/boot/dts/at91sam9x5.dtsi | |||
@@ -72,6 +72,11 @@ | |||
72 | }; | 72 | }; |
73 | }; | 73 | }; |
74 | 74 | ||
75 | sram: sram@00300000 { | ||
76 | compatible = "mmio-sram"; | ||
77 | reg = <0x00300000 0x8000>; | ||
78 | }; | ||
79 | |||
75 | ahb { | 80 | ahb { |
76 | compatible = "simple-bus"; | 81 | compatible = "simple-bus"; |
77 | #address-cells = <1>; | 82 | #address-cells = <1>; |
diff --git a/arch/arm/boot/dts/at91sam9xe.dtsi b/arch/arm/boot/dts/at91sam9xe.dtsi new file mode 100644 index 000000000000..0278f63b2daf --- /dev/null +++ b/arch/arm/boot/dts/at91sam9xe.dtsi | |||
@@ -0,0 +1,60 @@ | |||
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 | }; | ||
diff --git a/arch/arm/boot/dts/ethernut5.dts b/arch/arm/boot/dts/ethernut5.dts index 8f941c2db7c6..243044343ee8 100644 --- a/arch/arm/boot/dts/ethernut5.dts +++ b/arch/arm/boot/dts/ethernut5.dts | |||
@@ -6,7 +6,7 @@ | |||
6 | * Licensed under GPLv2. | 6 | * Licensed under GPLv2. |
7 | */ | 7 | */ |
8 | /dts-v1/; | 8 | /dts-v1/; |
9 | #include "at91sam9260.dtsi" | 9 | #include "at91sam9xe.dtsi" |
10 | 10 | ||
11 | / { | 11 | / { |
12 | model = "Ethernut 5"; | 12 | model = "Ethernut 5"; |
diff --git a/arch/arm/boot/dts/sama5d3.dtsi b/arch/arm/boot/dts/sama5d3.dtsi index 5f4144d1e3a1..261311bdf65b 100644 --- a/arch/arm/boot/dts/sama5d3.dtsi +++ b/arch/arm/boot/dts/sama5d3.dtsi | |||
@@ -78,6 +78,11 @@ | |||
78 | }; | 78 | }; |
79 | }; | 79 | }; |
80 | 80 | ||
81 | sram: sram@00300000 { | ||
82 | compatible = "mmio-sram"; | ||
83 | reg = <0x00300000 0x20000>; | ||
84 | }; | ||
85 | |||
81 | ahb { | 86 | ahb { |
82 | compatible = "simple-bus"; | 87 | compatible = "simple-bus"; |
83 | #address-cells = <1>; | 88 | #address-cells = <1>; |
@@ -214,7 +219,20 @@ | |||
214 | compatible = "atmel,at91sam9g45-isi"; | 219 | compatible = "atmel,at91sam9g45-isi"; |
215 | reg = <0xf0034000 0x4000>; | 220 | reg = <0xf0034000 0x4000>; |
216 | interrupts = <37 IRQ_TYPE_LEVEL_HIGH 5>; | 221 | interrupts = <37 IRQ_TYPE_LEVEL_HIGH 5>; |
222 | pinctrl-names = "default"; | ||
223 | pinctrl-0 = <&pinctrl_isi_data_0_7>; | ||
224 | clocks = <&isi_clk>; | ||
225 | clock-names = "isi_clk"; | ||
217 | status = "disabled"; | 226 | status = "disabled"; |
227 | port { | ||
228 | #address-cells = <1>; | ||
229 | #size-cells = <0>; | ||
230 | }; | ||
231 | }; | ||
232 | |||
233 | sfr: sfr@f0038000 { | ||
234 | compatible = "atmel,sama5d3-sfr", "syscon"; | ||
235 | reg = <0xf0038000 0x60>; | ||
218 | }; | 236 | }; |
219 | 237 | ||
220 | mmc1: mmc@f8000000 { | 238 | mmc1: mmc@f8000000 { |
@@ -545,7 +563,7 @@ | |||
545 | }; | 563 | }; |
546 | 564 | ||
547 | isi { | 565 | isi { |
548 | pinctrl_isi: isi-0 { | 566 | pinctrl_isi_data_0_7: isi-0-data-0-7 { |
549 | atmel,pins = | 567 | atmel,pins = |
550 | <AT91_PIOA 16 AT91_PERIPH_C AT91_PINCTRL_NONE /* PA16 periph C ISI_D0, conflicts with LCDDAT16 */ | 568 | <AT91_PIOA 16 AT91_PERIPH_C AT91_PINCTRL_NONE /* PA16 periph C ISI_D0, conflicts with LCDDAT16 */ |
551 | AT91_PIOA 17 AT91_PERIPH_C AT91_PINCTRL_NONE /* PA17 periph C ISI_D1, conflicts with LCDDAT17 */ | 569 | AT91_PIOA 17 AT91_PERIPH_C AT91_PINCTRL_NONE /* PA17 periph C ISI_D1, conflicts with LCDDAT17 */ |
@@ -557,13 +575,19 @@ | |||
557 | AT91_PIOA 23 AT91_PERIPH_C AT91_PINCTRL_NONE /* PA23 periph C ISI_D7, conflicts with LCDDAT23, PWML1 */ | 575 | AT91_PIOA 23 AT91_PERIPH_C AT91_PINCTRL_NONE /* PA23 periph C ISI_D7, conflicts with LCDDAT23, PWML1 */ |
558 | AT91_PIOC 30 AT91_PERIPH_C AT91_PINCTRL_NONE /* PC30 periph C ISI_PCK, conflicts with UTXD0 */ | 576 | AT91_PIOC 30 AT91_PERIPH_C AT91_PINCTRL_NONE /* PC30 periph C ISI_PCK, conflicts with UTXD0 */ |
559 | AT91_PIOA 31 AT91_PERIPH_C AT91_PINCTRL_NONE /* PA31 periph C ISI_HSYNC, conflicts with TWCK0, UTXD1 */ | 577 | AT91_PIOA 31 AT91_PERIPH_C AT91_PINCTRL_NONE /* PA31 periph C ISI_HSYNC, conflicts with TWCK0, UTXD1 */ |
560 | AT91_PIOA 30 AT91_PERIPH_C AT91_PINCTRL_NONE /* PA30 periph C ISI_VSYNC, conflicts with TWD0, URXD1 */ | 578 | AT91_PIOA 30 AT91_PERIPH_C AT91_PINCTRL_NONE>; /* PA30 periph C ISI_VSYNC, conflicts with TWD0, URXD1 */ |
561 | AT91_PIOC 29 AT91_PERIPH_C AT91_PINCTRL_NONE /* PC29 periph C ISI_PD8, conflicts with URXD0, PWMFI2 */ | 579 | }; |
580 | |||
581 | pinctrl_isi_data_8_9: isi-0-data-8-9 { | ||
582 | atmel,pins = | ||
583 | <AT91_PIOC 29 AT91_PERIPH_C AT91_PINCTRL_NONE /* PC29 periph C ISI_PD8, conflicts with URXD0, PWMFI2 */ | ||
562 | AT91_PIOC 28 AT91_PERIPH_C AT91_PINCTRL_NONE>; /* PC28 periph C ISI_PD9, conflicts with SPI1_NPCS3, PWMFI0 */ | 584 | AT91_PIOC 28 AT91_PERIPH_C AT91_PINCTRL_NONE>; /* PC28 periph C ISI_PD9, conflicts with SPI1_NPCS3, PWMFI0 */ |
563 | }; | 585 | }; |
564 | pinctrl_isi_pck_as_mck: isi_pck_as_mck-0 { | 586 | |
587 | pinctrl_isi_data_10_11: isi-0-data-10-11 { | ||
565 | atmel,pins = | 588 | atmel,pins = |
566 | <AT91_PIOD 31 AT91_PERIPH_B AT91_PINCTRL_NONE>; /* PD31 periph B ISI_MCK */ | 589 | <AT91_PIOC 27 AT91_PERIPH_C AT91_PINCTRL_NONE /* PC27 periph C ISI_PD10, conflicts with SPI1_NPCS2, TWCK1 */ |
590 | AT91_PIOC 26 AT91_PERIPH_C AT91_PINCTRL_NONE>; /* PC26 periph C ISI_PD11, conflicts with SPI1_NPCS1, TWD1 */ | ||
567 | }; | 591 | }; |
568 | }; | 592 | }; |
569 | 593 | ||
diff --git a/arch/arm/boot/dts/sama5d3xcm.dtsi b/arch/arm/boot/dts/sama5d3xcm.dtsi index cfcd200b0c17..7d6babdab039 100644 --- a/arch/arm/boot/dts/sama5d3xcm.dtsi +++ b/arch/arm/boot/dts/sama5d3xcm.dtsi | |||
@@ -122,6 +122,7 @@ | |||
122 | d2 { | 122 | d2 { |
123 | label = "d2"; | 123 | label = "d2"; |
124 | gpios = <&pioE 25 GPIO_ACTIVE_LOW>; /* PE25, conflicts with A25, RXD2 */ | 124 | gpios = <&pioE 25 GPIO_ACTIVE_LOW>; /* PE25, conflicts with A25, RXD2 */ |
125 | linux,default-trigger = "heartbeat"; | ||
125 | }; | 126 | }; |
126 | }; | 127 | }; |
127 | }; | 128 | }; |
diff --git a/arch/arm/boot/dts/sama5d3xmb.dtsi b/arch/arm/boot/dts/sama5d3xmb.dtsi index 49c10d33df30..9fdb8a07b145 100644 --- a/arch/arm/boot/dts/sama5d3xmb.dtsi +++ b/arch/arm/boot/dts/sama5d3xmb.dtsi | |||
@@ -52,6 +52,29 @@ | |||
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 | usart1: serial@f0020000 { | 78 | usart1: serial@f0020000 { |
56 | dmas = <0>, <0>; /* Do not use DMA for usart1 */ | 79 | dmas = <0>, <0>; /* Do not use DMA for usart1 */ |
57 | pinctrl-names = "default"; | 80 | pinctrl-names = "default"; |
@@ -60,8 +83,12 @@ | |||
60 | }; | 83 | }; |
61 | 84 | ||
62 | isi: isi@f0034000 { | 85 | isi: isi@f0034000 { |
63 | pinctrl-names = "default"; | 86 | port { |
64 | pinctrl-0 = <&pinctrl_isi &pinctrl_isi_pck_as_mck &pinctrl_isi_power &pinctrl_isi_reset>; | 87 | isi_0: endpoint { |
88 | remote-endpoint = <&ov2640_0>; | ||
89 | bus-width = <8>; | ||
90 | }; | ||
91 | }; | ||
65 | }; | 92 | }; |
66 | 93 | ||
67 | mmc1: mmc@f8000000 { | 94 | mmc1: mmc@f8000000 { |
@@ -117,12 +144,17 @@ | |||
117 | <AT91_PIOD 30 AT91_PERIPH_B AT91_PINCTRL_NONE>; /* PD30 periph B */ | 144 | <AT91_PIOD 30 AT91_PERIPH_B AT91_PINCTRL_NONE>; /* PD30 periph B */ |
118 | }; | 145 | }; |
119 | 146 | ||
120 | pinctrl_isi_reset: isi_reset-0 { | 147 | pinctrl_pck1_as_isi_mck: pck1_as_isi_mck-0 { |
148 | atmel,pins = | ||
149 | <AT91_PIOD 31 AT91_PERIPH_B AT91_PINCTRL_NONE>; /* PD31 periph B ISI_MCK */ | ||
150 | }; | ||
151 | |||
152 | pinctrl_sensor_reset: sensor_reset-0 { | ||
121 | atmel,pins = | 153 | atmel,pins = |
122 | <AT91_PIOE 24 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>; /* PE24 gpio */ | 154 | <AT91_PIOE 24 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>; /* PE24 gpio */ |
123 | }; | 155 | }; |
124 | 156 | ||
125 | pinctrl_isi_power: isi_power-0 { | 157 | pinctrl_sensor_power: sensor_power-0 { |
126 | atmel,pins = | 158 | atmel,pins = |
127 | <AT91_PIOE 29 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>; /* PE29 gpio */ | 159 | <AT91_PIOE 29 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>; /* PE29 gpio */ |
128 | }; | 160 | }; |
diff --git a/arch/arm/boot/dts/sama5d4.dtsi b/arch/arm/boot/dts/sama5d4.dtsi index 1b0f30c2c4a5..1b4fe4e19721 100644 --- a/arch/arm/boot/dts/sama5d4.dtsi +++ b/arch/arm/boot/dts/sama5d4.dtsi | |||
@@ -103,6 +103,11 @@ | |||
103 | }; | 103 | }; |
104 | }; | 104 | }; |
105 | 105 | ||
106 | ns_sram: sram@00210000 { | ||
107 | compatible = "mmio-sram"; | ||
108 | reg = <0x00210000 0x10000>; | ||
109 | }; | ||
110 | |||
106 | ahb { | 111 | ahb { |
107 | compatible = "simple-bus"; | 112 | compatible = "simple-bus"; |
108 | #address-cells = <1>; | 113 | #address-cells = <1>; |
@@ -870,6 +875,11 @@ | |||
870 | status = "disabled"; | 875 | status = "disabled"; |
871 | }; | 876 | }; |
872 | 877 | ||
878 | sfr: sfr@f8028000 { | ||
879 | compatible = "atmel,sama5d4-sfr", "syscon"; | ||
880 | reg = <0xf8028000 0x60>; | ||
881 | }; | ||
882 | |||
873 | mmc1: mmc@fc000000 { | 883 | mmc1: mmc@fc000000 { |
874 | compatible = "atmel,hsmci"; | 884 | compatible = "atmel,hsmci"; |
875 | reg = <0xfc000000 0x600>; | 885 | reg = <0xfc000000 0x600>; |
diff --git a/arch/arm/mach-at91/include/mach/debug-macro.S b/arch/arm/include/debug/at91.S index 2103a90f2261..80a6501b4d50 100644 --- a/arch/arm/mach-at91/include/mach/debug-macro.S +++ b/arch/arm/include/debug/at91.S | |||
@@ -1,6 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * arch/arm/mach-at91/include/mach/debug-macro.S | ||
3 | * | ||
4 | * Copyright (C) 2003-2005 SAN People | 2 | * Copyright (C) 2003-2005 SAN People |
5 | * | 3 | * |
6 | * Debugging macro include header | 4 | * Debugging macro include header |
@@ -11,18 +9,23 @@ | |||
11 | * | 9 | * |
12 | */ | 10 | */ |
13 | 11 | ||
14 | #include <mach/hardware.h> | ||
15 | #include <mach/at91_dbgu.h> | ||
16 | |||
17 | #if defined(CONFIG_AT91_DEBUG_LL_DBGU0) | 12 | #if defined(CONFIG_AT91_DEBUG_LL_DBGU0) |
18 | #define AT91_DBGU AT91_BASE_DBGU0 | 13 | #define AT91_DBGU 0xfffff200 /* AT91_BASE_DBGU0 */ |
19 | #elif defined(CONFIG_AT91_DEBUG_LL_DBGU1) | 14 | #elif defined(CONFIG_AT91_DEBUG_LL_DBGU1) |
20 | #define AT91_DBGU AT91_BASE_DBGU1 | 15 | #define AT91_DBGU 0xffffee00 /* AT91_BASE_DBGU1 */ |
21 | #else | 16 | #else |
22 | /* On sama5d4, use USART3 as low level serial console */ | 17 | /* On sama5d4, use USART3 as low level serial console */ |
23 | #define AT91_DBGU SAMA5D4_BASE_USART3 | 18 | #define AT91_DBGU 0xfc00c000 /* SAMA5D4_BASE_USART3 */ |
24 | #endif | 19 | #endif |
25 | 20 | ||
21 | /* Keep in sync with mach-at91/include/mach/hardware.h */ | ||
22 | #define AT91_IO_P2V(x) ((x) - 0x01000000) | ||
23 | |||
24 | #define AT91_DBGU_SR (0x14) /* Status Register */ | ||
25 | #define AT91_DBGU_THR (0x1c) /* Transmitter Holding Register */ | ||
26 | #define AT91_DBGU_TXRDY (1 << 1) /* Transmitter Ready */ | ||
27 | #define AT91_DBGU_TXEMPTY (1 << 9) /* Transmitter Empty */ | ||
28 | |||
26 | .macro addruart, rp, rv, tmp | 29 | .macro addruart, rp, rv, tmp |
27 | ldr \rp, =AT91_DBGU @ System peripherals (phys address) | 30 | ldr \rp, =AT91_DBGU @ System peripherals (phys address) |
28 | ldr \rv, =AT91_IO_P2V(AT91_DBGU) @ System peripherals (virt address) | 31 | ldr \rv, =AT91_IO_P2V(AT91_DBGU) @ System peripherals (virt address) |
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig index 2395c68b3e32..b7dcef50db23 100644 --- a/arch/arm/mach-at91/Kconfig +++ b/arch/arm/mach-at91/Kconfig | |||
@@ -174,18 +174,11 @@ config SOC_AT91SAM9N12 | |||
174 | # ---------------------------------------------------------- | 174 | # ---------------------------------------------------------- |
175 | endif # SOC_SAM_V4_V5 | 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 | comment "AT91 Feature Selections" | 177 | comment "AT91 Feature Selections" |
186 | 178 | ||
187 | config AT91_SLOW_CLOCK | 179 | config AT91_SLOW_CLOCK |
188 | bool "Suspend-to-RAM disables main oscillator" | 180 | bool "Suspend-to-RAM disables main oscillator" |
181 | select SRAM | ||
189 | depends on SUSPEND | 182 | depends on SUSPEND |
190 | help | 183 | help |
191 | Select this if you want Suspend-to-RAM to save the most power | 184 | Select this if you want Suspend-to-RAM to save the most power |
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile index 7b6424d40764..8ef7d9a2e855 100644 --- a/arch/arm/mach-at91/Makefile +++ b/arch/arm/mach-at91/Makefile | |||
@@ -2,7 +2,7 @@ | |||
2 | # Makefile for the linux kernel. | 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 | obj-$(CONFIG_SOC_AT91SAM9) += sam9_smc.o | 7 | obj-$(CONFIG_SOC_AT91SAM9) += sam9_smc.o |
8 | 8 | ||
@@ -19,8 +19,8 @@ obj-$(CONFIG_SOC_SAMA5D3) += sama5d3.o | |||
19 | obj-$(CONFIG_SOC_SAMA5D4) += sama5d4.o | 19 | obj-$(CONFIG_SOC_SAMA5D4) += sama5d4.o |
20 | 20 | ||
21 | # AT91SAM board with device-tree | 21 | # AT91SAM board with device-tree |
22 | obj-$(CONFIG_MACH_AT91RM9200_DT) += board-dt-rm9200.o | 22 | obj-$(CONFIG_SOC_AT91RM9200) += board-dt-rm9200.o |
23 | obj-$(CONFIG_MACH_AT91SAM9_DT) += board-dt-sam9.o | 23 | obj-$(CONFIG_SOC_AT91SAM9) += board-dt-sam9.o |
24 | 24 | ||
25 | # SAMA5 board with device-tree | 25 | # SAMA5 board with device-tree |
26 | obj-$(CONFIG_SOC_SAMA5) += board-dt-sama5.o | 26 | obj-$(CONFIG_SOC_SAMA5) += board-dt-sama5.o |
diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c index b52916947535..3be1963f5c56 100644 --- a/arch/arm/mach-at91/at91rm9200.c +++ b/arch/arm/mach-at91/at91rm9200.c | |||
@@ -21,14 +21,6 @@ | |||
21 | #include "soc.h" | 21 | #include "soc.h" |
22 | #include "generic.h" | 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 | static void at91rm9200_restart(enum reboot_mode reboot_mode, const char *cmd) | 25 | static void at91rm9200_restart(enum reboot_mode reboot_mode, const char *cmd) |
34 | { | 26 | { |
@@ -42,11 +34,6 @@ static void at91rm9200_restart(enum reboot_mode reboot_mode, const char *cmd) | |||
42 | /* -------------------------------------------------------------------- | 34 | /* -------------------------------------------------------------------- |
43 | * AT91RM9200 processor initialization | 35 | * AT91RM9200 processor initialization |
44 | * -------------------------------------------------------------------- */ | 36 | * -------------------------------------------------------------------- */ |
45 | static void __init at91rm9200_map_io(void) | ||
46 | { | ||
47 | /* Map peripherals */ | ||
48 | at91_init_sram(0, AT91RM9200_SRAM_BASE, AT91RM9200_SRAM_SIZE); | ||
49 | } | ||
50 | 37 | ||
51 | static void __init at91rm9200_initialize(void) | 38 | static void __init at91rm9200_initialize(void) |
52 | { | 39 | { |
@@ -54,8 +41,6 @@ static void __init at91rm9200_initialize(void) | |||
54 | arm_pm_restart = at91rm9200_restart; | 41 | arm_pm_restart = at91rm9200_restart; |
55 | } | 42 | } |
56 | 43 | ||
57 | |||
58 | AT91_SOC_START(at91rm9200) | 44 | AT91_SOC_START(at91rm9200) |
59 | .map_io = at91rm9200_map_io, | ||
60 | .init = at91rm9200_initialize, | 45 | .init = at91rm9200_initialize, |
61 | AT91_SOC_END | 46 | AT91_SOC_END |
diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c index 78137c24d90b..ab9841c8b0d5 100644 --- a/arch/arm/mach-at91/at91sam9260.c +++ b/arch/arm/mach-at91/at91sam9260.c | |||
@@ -22,40 +22,11 @@ | |||
22 | * AT91SAM9260 processor initialization | 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 | static void __init at91sam9260_initialize(void) | 25 | static void __init at91sam9260_initialize(void) |
52 | { | 26 | { |
53 | arm_pm_idle = at91sam9_idle; | 27 | arm_pm_idle = at91sam9_idle; |
54 | |||
55 | at91_sysirq_mask_rtt(AT91SAM9260_BASE_RTT); | ||
56 | } | 28 | } |
57 | 29 | ||
58 | AT91_SOC_START(at91sam9260) | 30 | AT91_SOC_START(at91sam9260) |
59 | .map_io = at91sam9260_map_io, | ||
60 | .init = at91sam9260_initialize, | 31 | .init = at91sam9260_initialize, |
61 | AT91_SOC_END | 32 | AT91_SOC_END |
diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c index d29953ecb0c4..2029096b93fa 100644 --- a/arch/arm/mach-at91/at91sam9261.c +++ b/arch/arm/mach-at91/at91sam9261.c | |||
@@ -21,22 +21,11 @@ | |||
21 | * AT91SAM9261 processor initialization | 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 | static void __init at91sam9261_initialize(void) | 24 | static void __init at91sam9261_initialize(void) |
33 | { | 25 | { |
34 | arm_pm_idle = at91sam9_idle; | 26 | arm_pm_idle = at91sam9_idle; |
35 | |||
36 | at91_sysirq_mask_rtt(AT91SAM9261_BASE_RTT); | ||
37 | } | 27 | } |
38 | 28 | ||
39 | AT91_SOC_START(at91sam9261) | 29 | AT91_SOC_START(at91sam9261) |
40 | .map_io = at91sam9261_map_io, | ||
41 | .init = at91sam9261_initialize, | 30 | .init = at91sam9261_initialize, |
42 | AT91_SOC_END | 31 | AT91_SOC_END |
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c index e7ad14864083..1fe672a05513 100644 --- a/arch/arm/mach-at91/at91sam9263.c +++ b/arch/arm/mach-at91/at91sam9263.c | |||
@@ -20,21 +20,11 @@ | |||
20 | * AT91SAM9263 processor initialization | 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 | static void __init at91sam9263_initialize(void) | 23 | static void __init at91sam9263_initialize(void) |
30 | { | 24 | { |
31 | arm_pm_idle = at91sam9_idle; | 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 | AT91_SOC_START(at91sam9263) | 28 | AT91_SOC_START(at91sam9263) |
38 | .map_io = at91sam9263_map_io, | ||
39 | .init = at91sam9263_initialize, | 29 | .init = at91sam9263_initialize, |
40 | AT91_SOC_END | 30 | AT91_SOC_END |
diff --git a/arch/arm/mach-at91/at91sam9g45.c b/arch/arm/mach-at91/at91sam9g45.c index b6117bea9a6f..d0493df40a13 100644 --- a/arch/arm/mach-at91/at91sam9g45.c +++ b/arch/arm/mach-at91/at91sam9g45.c | |||
@@ -11,7 +11,6 @@ | |||
11 | */ | 11 | */ |
12 | 12 | ||
13 | #include <asm/system_misc.h> | 13 | #include <asm/system_misc.h> |
14 | #include <asm/irq.h> | ||
15 | #include <mach/hardware.h> | 14 | #include <mach/hardware.h> |
16 | 15 | ||
17 | #include "soc.h" | 16 | #include "soc.h" |
@@ -20,21 +19,11 @@ | |||
20 | /* -------------------------------------------------------------------- | 19 | /* -------------------------------------------------------------------- |
21 | * AT91SAM9G45 processor initialization | 20 | * AT91SAM9G45 processor initialization |
22 | * -------------------------------------------------------------------- */ | 21 | * -------------------------------------------------------------------- */ |
23 | |||
24 | static void __init at91sam9g45_map_io(void) | ||
25 | { | ||
26 | at91_init_sram(0, AT91SAM9G45_SRAM_BASE, AT91SAM9G45_SRAM_SIZE); | ||
27 | } | ||
28 | |||
29 | static void __init at91sam9g45_initialize(void) | 22 | static void __init at91sam9g45_initialize(void) |
30 | { | 23 | { |
31 | arm_pm_idle = at91sam9_idle; | 24 | arm_pm_idle = at91sam9_idle; |
32 | |||
33 | at91_sysirq_mask_rtc(AT91SAM9G45_BASE_RTC); | ||
34 | at91_sysirq_mask_rtt(AT91SAM9G45_BASE_RTT); | ||
35 | } | 25 | } |
36 | 26 | ||
37 | AT91_SOC_START(at91sam9g45) | 27 | AT91_SOC_START(at91sam9g45) |
38 | .map_io = at91sam9g45_map_io, | ||
39 | .init = at91sam9g45_initialize, | 28 | .init = at91sam9g45_initialize, |
40 | AT91_SOC_END | 29 | AT91_SOC_END |
diff --git a/arch/arm/mach-at91/at91sam9n12.c b/arch/arm/mach-at91/at91sam9n12.c index dee569b1987e..b5ea69a3eaf6 100644 --- a/arch/arm/mach-at91/at91sam9n12.c +++ b/arch/arm/mach-at91/at91sam9n12.c | |||
@@ -16,17 +16,5 @@ | |||
16 | * AT91SAM9N12 processor initialization | 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 | AT91_SOC_START(at91sam9n12) | 19 | AT91_SOC_START(at91sam9n12) |
30 | .map_io = at91sam9n12_map_io, | ||
31 | .init = at91sam9n12_initialize, | ||
32 | AT91_SOC_END | 20 | AT91_SOC_END |
diff --git a/arch/arm/mach-at91/at91sam9rl.c b/arch/arm/mach-at91/at91sam9rl.c index f25b9aec9c50..33acae30bb0b 100644 --- a/arch/arm/mach-at91/at91sam9rl.c +++ b/arch/arm/mach-at91/at91sam9rl.c | |||
@@ -10,7 +10,6 @@ | |||
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include <asm/system_misc.h> | 12 | #include <asm/system_misc.h> |
13 | #include <asm/irq.h> | ||
14 | #include <mach/cpu.h> | 13 | #include <mach/cpu.h> |
15 | #include <mach/at91_dbgu.h> | 14 | #include <mach/at91_dbgu.h> |
16 | #include <mach/hardware.h> | 15 | #include <mach/hardware.h> |
@@ -22,32 +21,11 @@ | |||
22 | * AT91SAM9RL processor initialization | 21 | * AT91SAM9RL processor initialization |
23 | * -------------------------------------------------------------------- */ | 22 | * -------------------------------------------------------------------- */ |
24 | 23 | ||
25 | static void __init at91sam9rl_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 | /* Map SRAM */ | ||
39 | at91_init_sram(0, AT91SAM9RL_SRAM_BASE, sram_size); | ||
40 | } | ||
41 | |||
42 | static void __init at91sam9rl_initialize(void) | 24 | static void __init at91sam9rl_initialize(void) |
43 | { | 25 | { |
44 | arm_pm_idle = at91sam9_idle; | 26 | arm_pm_idle = at91sam9_idle; |
45 | |||
46 | at91_sysirq_mask_rtc(AT91SAM9RL_BASE_RTC); | ||
47 | at91_sysirq_mask_rtt(AT91SAM9RL_BASE_RTT); | ||
48 | } | 27 | } |
49 | 28 | ||
50 | AT91_SOC_START(at91sam9rl) | 29 | AT91_SOC_START(at91sam9rl) |
51 | .map_io = at91sam9rl_map_io, | ||
52 | .init = at91sam9rl_initialize, | 30 | .init = at91sam9rl_initialize, |
53 | AT91_SOC_END | 31 | AT91_SOC_END |
diff --git a/arch/arm/mach-at91/at91sam9x5.c b/arch/arm/mach-at91/at91sam9x5.c index f0d5a69a7237..7b60a529db01 100644 --- a/arch/arm/mach-at91/at91sam9x5.c +++ b/arch/arm/mach-at91/at91sam9x5.c | |||
@@ -16,21 +16,5 @@ | |||
16 | * AT91SAM9x5 processor initialization | 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 | AT91_SOC_START(at91sam9x5) | 19 | AT91_SOC_START(at91sam9x5) |
34 | .map_io = at91sam9x5_map_io, | ||
35 | .init = at91sam9x5_initialize, | ||
36 | AT91_SOC_END | 20 | AT91_SOC_END |
diff --git a/arch/arm/mach-at91/board-dt-rm9200.c b/arch/arm/mach-at91/board-dt-rm9200.c index 76dfe8f9af50..5f82a65153e1 100644 --- a/arch/arm/mach-at91/board-dt-rm9200.c +++ b/arch/arm/mach-at91/board-dt-rm9200.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/gpio.h> | 14 | #include <linux/gpio.h> |
15 | #include <linux/of.h> | 15 | #include <linux/of.h> |
16 | #include <linux/of_irq.h> | 16 | #include <linux/of_irq.h> |
17 | #include <linux/of_platform.h> | ||
17 | #include <linux/clk-provider.h> | 18 | #include <linux/clk-provider.h> |
18 | 19 | ||
19 | #include <asm/setup.h> | 20 | #include <asm/setup.h> |
@@ -30,6 +31,15 @@ static void __init at91rm9200_dt_timer_init(void) | |||
30 | at91rm9200_timer_init(); | 31 | at91rm9200_timer_init(); |
31 | } | 32 | } |
32 | 33 | ||
34 | static void __init rm9200_dt_device_init(void) | ||
35 | { | ||
36 | at91_rm9200_pm_init(); | ||
37 | |||
38 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | ||
39 | } | ||
40 | |||
41 | |||
42 | |||
33 | static const char *at91rm9200_dt_board_compat[] __initdata = { | 43 | static const char *at91rm9200_dt_board_compat[] __initdata = { |
34 | "atmel,at91rm9200", | 44 | "atmel,at91rm9200", |
35 | NULL | 45 | NULL |
@@ -38,6 +48,7 @@ static const char *at91rm9200_dt_board_compat[] __initdata = { | |||
38 | DT_MACHINE_START(at91rm9200_dt, "Atmel AT91RM9200 (Device Tree)") | 48 | DT_MACHINE_START(at91rm9200_dt, "Atmel AT91RM9200 (Device Tree)") |
39 | .init_time = at91rm9200_dt_timer_init, | 49 | .init_time = at91rm9200_dt_timer_init, |
40 | .map_io = at91_map_io, | 50 | .map_io = at91_map_io, |
41 | .init_early = at91rm9200_dt_initialize, | 51 | .init_early = at91_dt_initialize, |
52 | .init_machine = rm9200_dt_device_init, | ||
42 | .dt_compat = at91rm9200_dt_board_compat, | 53 | .dt_compat = at91rm9200_dt_board_compat, |
43 | MACHINE_END | 54 | MACHINE_END |
diff --git a/arch/arm/mach-at91/board-dt-sam9.c b/arch/arm/mach-at91/board-dt-sam9.c index f99246aa9b38..0fe1ced608c5 100644 --- a/arch/arm/mach-at91/board-dt-sam9.c +++ b/arch/arm/mach-at91/board-dt-sam9.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/gpio.h> | 13 | #include <linux/gpio.h> |
14 | #include <linux/of.h> | 14 | #include <linux/of.h> |
15 | #include <linux/of_irq.h> | 15 | #include <linux/of_irq.h> |
16 | #include <linux/of_platform.h> | ||
16 | #include <linux/clk-provider.h> | 17 | #include <linux/clk-provider.h> |
17 | 18 | ||
18 | #include <asm/setup.h> | 19 | #include <asm/setup.h> |
@@ -23,6 +24,12 @@ | |||
23 | 24 | ||
24 | #include "generic.h" | 25 | #include "generic.h" |
25 | 26 | ||
27 | static void __init sam9_dt_device_init(void) | ||
28 | { | ||
29 | at91_sam9260_pm_init(); | ||
30 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | ||
31 | } | ||
32 | |||
26 | static const char *at91_dt_board_compat[] __initdata = { | 33 | static const char *at91_dt_board_compat[] __initdata = { |
27 | "atmel,at91sam9", | 34 | "atmel,at91sam9", |
28 | NULL | 35 | NULL |
@@ -32,5 +39,25 @@ DT_MACHINE_START(at91sam_dt, "Atmel AT91SAM (Device Tree)") | |||
32 | /* Maintainer: Atmel */ | 39 | /* Maintainer: Atmel */ |
33 | .map_io = at91_map_io, | 40 | .map_io = at91_map_io, |
34 | .init_early = at91_dt_initialize, | 41 | .init_early = at91_dt_initialize, |
42 | .init_machine = sam9_dt_device_init, | ||
35 | .dt_compat = at91_dt_board_compat, | 43 | .dt_compat = at91_dt_board_compat, |
36 | MACHINE_END | 44 | MACHINE_END |
45 | |||
46 | static void __init sam9g45_dt_device_init(void) | ||
47 | { | ||
48 | at91_sam9g45_pm_init(); | ||
49 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | ||
50 | } | ||
51 | |||
52 | static const char *at91_9g45_board_compat[] __initconst = { | ||
53 | "atmel,at91sam9g45", | ||
54 | NULL | ||
55 | }; | ||
56 | |||
57 | DT_MACHINE_START(at91sam9g45_dt, "Atmel AT91SAM9G45") | ||
58 | /* Maintainer: Atmel */ | ||
59 | .map_io = at91_map_io, | ||
60 | .init_early = at91_dt_initialize, | ||
61 | .init_machine = sam9g45_dt_device_init, | ||
62 | .dt_compat = at91_9g45_board_compat, | ||
63 | MACHINE_END | ||
diff --git a/arch/arm/mach-at91/board-dt-sama5.c b/arch/arm/mach-at91/board-dt-sama5.c index 8fb9ef5333f1..44d372a22a29 100644 --- a/arch/arm/mach-at91/board-dt-sama5.c +++ b/arch/arm/mach-at91/board-dt-sama5.c | |||
@@ -28,6 +28,7 @@ | |||
28 | 28 | ||
29 | static void __init sama5_dt_device_init(void) | 29 | static void __init sama5_dt_device_init(void) |
30 | { | 30 | { |
31 | at91_sam9260_pm_init(); | ||
31 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | 32 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); |
32 | } | 33 | } |
33 | 34 | ||
diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h index d53324210adf..44fc725edcf1 100644 --- a/arch/arm/mach-at91/generic.h +++ b/arch/arm/mach-at91/generic.h | |||
@@ -17,24 +17,29 @@ | |||
17 | /* Map io */ | 17 | /* Map io */ |
18 | extern void __init at91_map_io(void); | 18 | extern void __init at91_map_io(void); |
19 | extern void __init at91_alt_map_io(void); | 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 | /* Processors */ | 21 | /* Processors */ |
24 | extern void __init at91rm9200_set_type(int type); | ||
25 | extern void __init at91rm9200_dt_initialize(void); | ||
26 | extern void __init at91_dt_initialize(void); | 22 | extern void __init at91_dt_initialize(void); |
27 | 23 | ||
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 | |||
32 | /* Timer */ | 24 | /* Timer */ |
33 | extern void at91rm9200_timer_init(void); | 25 | extern void at91rm9200_timer_init(void); |
34 | 26 | ||
35 | /* idle */ | 27 | /* idle */ |
28 | extern void at91rm9200_idle(void); | ||
36 | extern void at91sam9_idle(void); | 29 | extern void at91sam9_idle(void); |
37 | 30 | ||
38 | /* Matrix */ | 31 | /* Matrix */ |
39 | extern void at91_ioremap_matrix(u32 base_addr); | 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 | #endif /* _AT91_GENERIC_H */ | 45 | #endif /* _AT91_GENERIC_H */ |
diff --git a/arch/arm/mach-at91/include/mach/at91_pio.h b/arch/arm/mach-at91/include/mach/at91_pio.h deleted file mode 100644 index 7b7366253ceb..000000000000 --- a/arch/arm/mach-at91/include/mach/at91_pio.h +++ /dev/null | |||
@@ -1,80 +0,0 @@ | |||
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 | ||
diff --git a/arch/arm/mach-at91/include/mach/at91_rtt.h b/arch/arm/mach-at91/include/mach/at91_rtt.h deleted file mode 100644 index 7ec75de8bbb6..000000000000 --- a/arch/arm/mach-at91/include/mach/at91_rtt.h +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
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 | ||
diff --git a/arch/arm/mach-at91/include/mach/memory.h b/arch/arm/mach-at91/include/mach/memory.h deleted file mode 100644 index 401c207f2f39..000000000000 --- a/arch/arm/mach-at91/include/mach/memory.h +++ /dev/null | |||
@@ -1,26 +0,0 @@ | |||
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 | ||
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c index 9b15169a1c62..81f2f12d3cc1 100644 --- a/arch/arm/mach-at91/pm.c +++ b/arch/arm/mach-at91/pm.c | |||
@@ -14,9 +14,12 @@ | |||
14 | #include <linux/suspend.h> | 14 | #include <linux/suspend.h> |
15 | #include <linux/sched.h> | 15 | #include <linux/sched.h> |
16 | #include <linux/proc_fs.h> | 16 | #include <linux/proc_fs.h> |
17 | #include <linux/genalloc.h> | ||
17 | #include <linux/interrupt.h> | 18 | #include <linux/interrupt.h> |
18 | #include <linux/sysfs.h> | 19 | #include <linux/sysfs.h> |
19 | #include <linux/module.h> | 20 | #include <linux/module.h> |
21 | #include <linux/of.h> | ||
22 | #include <linux/of_platform.h> | ||
20 | #include <linux/platform_device.h> | 23 | #include <linux/platform_device.h> |
21 | #include <linux/io.h> | 24 | #include <linux/io.h> |
22 | #include <linux/clk/at91_pmc.h> | 25 | #include <linux/clk/at91_pmc.h> |
@@ -32,6 +35,11 @@ | |||
32 | #include "generic.h" | 35 | #include "generic.h" |
33 | #include "pm.h" | 36 | #include "pm.h" |
34 | 37 | ||
38 | static struct { | ||
39 | unsigned long uhp_udp_mask; | ||
40 | int memctrl; | ||
41 | } at91_pm_data; | ||
42 | |||
35 | static void (*at91_pm_standby)(void); | 43 | static void (*at91_pm_standby)(void); |
36 | 44 | ||
37 | static int at91_pm_valid_state(suspend_state_t state) | 45 | static int at91_pm_valid_state(suspend_state_t state) |
@@ -71,17 +79,9 @@ static int at91_pm_verify_clocks(void) | |||
71 | scsr = at91_pmc_read(AT91_PMC_SCSR); | 79 | scsr = at91_pmc_read(AT91_PMC_SCSR); |
72 | 80 | ||
73 | /* USB must not be using PLLB */ | 81 | /* USB must not be using PLLB */ |
74 | if (cpu_is_at91rm9200()) { | 82 | if ((scsr & at91_pm_data.uhp_udp_mask) != 0) { |
75 | if ((scsr & (AT91RM9200_PMC_UHP | AT91RM9200_PMC_UDP)) != 0) { | 83 | pr_err("AT91: PM - Suspend-to-RAM with USB still active\n"); |
76 | pr_err("AT91: PM - Suspend-to-RAM with USB still active\n"); | 84 | return 0; |
77 | return 0; | ||
78 | } | ||
79 | } else if (cpu_is_at91sam9260() || cpu_is_at91sam9261() || cpu_is_at91sam9263() | ||
80 | || cpu_is_at91sam9g20() || cpu_is_at91sam9g10()) { | ||
81 | if ((scsr & (AT91SAM926x_PMC_UHP | AT91SAM926x_PMC_UDP)) != 0) { | ||
82 | pr_err("AT91: PM - Suspend-to-RAM with USB still active\n"); | ||
83 | return 0; | ||
84 | } | ||
85 | } | 85 | } |
86 | 86 | ||
87 | /* PCK0..PCK3 must be disabled, or configured to use clk32k */ | 87 | /* PCK0..PCK3 must be disabled, or configured to use clk32k */ |
@@ -149,18 +149,13 @@ static int at91_pm_enter(suspend_state_t state) | |||
149 | * turning off the main oscillator; reverse on wakeup. | 149 | * turning off the main oscillator; reverse on wakeup. |
150 | */ | 150 | */ |
151 | if (slow_clock) { | 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 | #ifdef CONFIG_AT91_SLOW_CLOCK | 152 | #ifdef CONFIG_AT91_SLOW_CLOCK |
159 | /* copy slow_clock handler to SRAM, and call it */ | 153 | /* copy slow_clock handler to SRAM, and call it */ |
160 | memcpy(slow_clock, at91_slow_clock, at91_slow_clock_sz); | 154 | memcpy(slow_clock, at91_slow_clock, at91_slow_clock_sz); |
161 | #endif | 155 | #endif |
162 | slow_clock(at91_pmc_base, at91_ramc_base[0], | 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 | break; | 159 | break; |
165 | } else { | 160 | } else { |
166 | pr_info("AT91: PM - no slow clock mode enabled ...\n"); | 161 | pr_info("AT91: PM - no slow clock mode enabled ...\n"); |
@@ -229,23 +224,85 @@ void at91_pm_set_standby(void (*at91_standby)(void)) | |||
229 | } | 224 | } |
230 | } | 225 | } |
231 | 226 | ||
232 | static int __init at91_pm_init(void) | 227 | #ifdef CONFIG_AT91_SLOW_CLOCK |
228 | static void __init at91_pm_sram_init(void) | ||
229 | { | ||
230 | struct gen_pool *sram_pool; | ||
231 | phys_addr_t sram_pbase; | ||
232 | unsigned long sram_base; | ||
233 | struct device_node *node; | ||
234 | struct platform_device *pdev; | ||
235 | |||
236 | node = of_find_compatible_node(NULL, NULL, "mmio-sram"); | ||
237 | if (!node) { | ||
238 | pr_warn("%s: failed to find sram node!\n", __func__); | ||
239 | return; | ||
240 | } | ||
241 | |||
242 | pdev = of_find_device_by_node(node); | ||
243 | if (!pdev) { | ||
244 | pr_warn("%s: failed to find sram device!\n", __func__); | ||
245 | goto put_node; | ||
246 | } | ||
247 | |||
248 | sram_pool = dev_get_gen_pool(&pdev->dev); | ||
249 | if (!sram_pool) { | ||
250 | pr_warn("%s: sram pool unavailable!\n", __func__); | ||
251 | goto put_node; | ||
252 | } | ||
253 | |||
254 | sram_base = gen_pool_alloc(sram_pool, at91_slow_clock_sz); | ||
255 | if (!sram_base) { | ||
256 | pr_warn("%s: unable to alloc ocram!\n", __func__); | ||
257 | goto put_node; | ||
258 | } | ||
259 | |||
260 | sram_pbase = gen_pool_virt_to_phys(sram_pool, sram_base); | ||
261 | slow_clock = __arm_ioremap_exec(sram_pbase, at91_slow_clock_sz, false); | ||
262 | |||
263 | put_node: | ||
264 | of_node_put(node); | ||
265 | } | ||
266 | #endif | ||
267 | |||
268 | |||
269 | static void __init at91_pm_init(void) | ||
233 | { | 270 | { |
234 | #ifdef CONFIG_AT91_SLOW_CLOCK | 271 | #ifdef CONFIG_AT91_SLOW_CLOCK |
235 | slow_clock = (void *) (AT91_IO_VIRT_BASE - at91_slow_clock_sz); | 272 | at91_pm_sram_init(); |
236 | #endif | 273 | #endif |
237 | 274 | ||
238 | pr_info("AT91: Power Management%s\n", (slow_clock ? " (with slow clock mode)" : "")); | 275 | pr_info("AT91: Power Management%s\n", (slow_clock ? " (with slow clock mode)" : "")); |
239 | 276 | ||
240 | /* AT91RM9200 SDRAM low-power mode cannot be used with self-refresh. */ | ||
241 | if (cpu_is_at91rm9200()) | ||
242 | at91_ramc_write(0, AT91RM9200_SDRAMC_LPR, 0); | ||
243 | |||
244 | if (at91_cpuidle_device.dev.platform_data) | 277 | if (at91_cpuidle_device.dev.platform_data) |
245 | platform_device_register(&at91_cpuidle_device); | 278 | platform_device_register(&at91_cpuidle_device); |
246 | 279 | ||
247 | suspend_set_ops(&at91_pm_ops); | 280 | suspend_set_ops(&at91_pm_ops); |
281 | } | ||
248 | 282 | ||
249 | return 0; | 283 | void __init at91_rm9200_pm_init(void) |
284 | { | ||
285 | /* | ||
286 | * AT91RM9200 SDRAM low-power mode cannot be used with self-refresh. | ||
287 | */ | ||
288 | at91_ramc_write(0, AT91RM9200_SDRAMC_LPR, 0); | ||
289 | |||
290 | at91_pm_data.uhp_udp_mask = AT91RM9200_PMC_UHP | AT91RM9200_PMC_UDP; | ||
291 | at91_pm_data.memctrl = AT91_MEMCTRL_MC; | ||
292 | |||
293 | at91_pm_init(); | ||
294 | } | ||
295 | |||
296 | void __init at91_sam9260_pm_init(void) | ||
297 | { | ||
298 | at91_pm_data.memctrl = AT91_MEMCTRL_SDRAMC; | ||
299 | at91_pm_data.uhp_udp_mask = AT91SAM926x_PMC_UHP | AT91SAM926x_PMC_UDP; | ||
300 | return at91_pm_init(); | ||
301 | } | ||
302 | |||
303 | void __init at91_sam9g45_pm_init(void) | ||
304 | { | ||
305 | at91_pm_data.uhp_udp_mask = AT91SAM926x_PMC_UHP; | ||
306 | at91_pm_data.memctrl = AT91_MEMCTRL_DDRSDR; | ||
307 | return at91_pm_init(); | ||
250 | } | 308 | } |
251 | arch_initcall(at91_pm_init); | ||
diff --git a/arch/arm/mach-at91/sama5d3.c b/arch/arm/mach-at91/sama5d3.c index 3d775d08de08..b7c64ca7107f 100644 --- a/arch/arm/mach-at91/sama5d3.c +++ b/arch/arm/mach-at91/sama5d3.c | |||
@@ -25,17 +25,5 @@ | |||
25 | * AT91SAM9x5 processor initialization | 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 | AT91_SOC_START(sama5d3) | 28 | AT91_SOC_START(sama5d3) |
39 | .map_io = sama5d3_map_io, | ||
40 | .init = sama5d3_initialize, | ||
41 | AT91_SOC_END | 29 | AT91_SOC_END |
diff --git a/arch/arm/mach-at91/sama5d4.c b/arch/arm/mach-at91/sama5d4.c index 7638509639f4..fa127fb79221 100644 --- a/arch/arm/mach-at91/sama5d4.c +++ b/arch/arm/mach-at91/sama5d4.c | |||
@@ -56,7 +56,6 @@ static struct map_desc at91_io_desc[] __initdata = { | |||
56 | static void __init sama5d4_map_io(void) | 56 | static void __init sama5d4_map_io(void) |
57 | { | 57 | { |
58 | iotable_init(at91_io_desc, ARRAY_SIZE(at91_io_desc)); | 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 | AT91_SOC_START(sama5d4) | 61 | AT91_SOC_START(sama5d4) |
diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c index ce25e85720fb..4c184285d38f 100644 --- a/arch/arm/mach-at91/setup.c +++ b/arch/arm/mach-at91/setup.c | |||
@@ -31,40 +31,9 @@ struct at91_init_soc __initdata at91_boot_soc; | |||
31 | struct at91_socinfo at91_soc_initdata; | 31 | struct at91_socinfo at91_soc_initdata; |
32 | EXPORT_SYMBOL(at91_soc_initdata); | 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 | void __iomem *at91_ramc_base[2]; | 34 | void __iomem *at91_ramc_base[2]; |
46 | EXPORT_SYMBOL_GPL(at91_ramc_base); | 35 | EXPORT_SYMBOL_GPL(at91_ramc_base); |
47 | 36 | ||
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 | |||
68 | static struct map_desc at91_io_desc __initdata __maybe_unused = { | 37 | static struct map_desc at91_io_desc __initdata __maybe_unused = { |
69 | .virtual = (unsigned long)AT91_VA_BASE_SYS, | 38 | .virtual = (unsigned long)AT91_VA_BASE_SYS, |
70 | .pfn = __phys_to_pfn(AT91_BASE_SYS), | 39 | .pfn = __phys_to_pfn(AT91_BASE_SYS), |
@@ -429,13 +398,6 @@ static void at91_dt_ramc(void) | |||
429 | at91_pm_set_standby(standby); | 398 | at91_pm_set_standby(standby); |
430 | } | 399 | } |
431 | 400 | ||
432 | void __init at91rm9200_dt_initialize(void) | ||
433 | { | ||
434 | at91_dt_ramc(); | ||
435 | |||
436 | at91_boot_soc.init(); | ||
437 | } | ||
438 | |||
439 | void __init at91_dt_initialize(void) | 401 | void __init at91_dt_initialize(void) |
440 | { | 402 | { |
441 | at91_dt_ramc(); | 403 | at91_dt_ramc(); |
diff --git a/arch/arm/mach-at91/sysirq_mask.c b/arch/arm/mach-at91/sysirq_mask.c deleted file mode 100644 index f8bc3511a8c8..000000000000 --- a/arch/arm/mach-at91/sysirq_mask.c +++ /dev/null | |||
@@ -1,75 +0,0 @@ | |||
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 | } | ||
diff --git a/drivers/clk/at91/pmc.c b/drivers/clk/at91/pmc.c index 386999b4f8eb..f07c8152e5cc 100644 --- a/drivers/clk/at91/pmc.c +++ b/drivers/clk/at91/pmc.c | |||
@@ -27,6 +27,15 @@ | |||
27 | void __iomem *at91_pmc_base; | 27 | void __iomem *at91_pmc_base; |
28 | EXPORT_SYMBOL_GPL(at91_pmc_base); | 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 | void at91sam9_idle(void) | 39 | void at91sam9_idle(void) |
31 | { | 40 | { |
32 | at91_pmc_write(AT91_PMC_SCDR, AT91_PMC_PCK); | 41 | at91_pmc_write(AT91_PMC_SCDR, AT91_PMC_PCK); |
diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig index f15cddfeb897..f211dfb7b913 100644 --- a/drivers/rtc/Kconfig +++ b/drivers/rtc/Kconfig | |||
@@ -1141,34 +1141,6 @@ config RTC_DRV_AT91SAM9 | |||
1141 | probably want to use the real RTC block instead of the "RTT as an | 1141 | probably want to use the real RTC block instead of the "RTT as an |
1142 | RTC" driver. | 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 | config RTC_DRV_AU1XXX | 1144 | config RTC_DRV_AU1XXX |
1173 | tristate "Au1xxx Counter0 RTC support" | 1145 | tristate "Au1xxx Counter0 RTC support" |
1174 | depends on MIPS_ALCHEMY | 1146 | depends on MIPS_ALCHEMY |