diff options
-rw-r--r-- | arch/arm/boot/dts/at91sam9263.dtsi | 220 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9263.c | 10 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9263_devices.c | 20 |
3 files changed, 250 insertions, 0 deletions
diff --git a/arch/arm/boot/dts/at91sam9263.dtsi b/arch/arm/boot/dts/at91sam9263.dtsi new file mode 100644 index 000000000000..0209913a65a2 --- /dev/null +++ b/arch/arm/boot/dts/at91sam9263.dtsi | |||
@@ -0,0 +1,220 @@ | |||
1 | /* | ||
2 | * at91sam9263.dtsi - Device Tree Include file for AT91SAM9263 family SoC | ||
3 | * | ||
4 | * Copyright (C) 2012 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | ||
5 | * | ||
6 | * Licensed under GPLv2 only. | ||
7 | */ | ||
8 | |||
9 | /include/ "skeleton.dtsi" | ||
10 | |||
11 | / { | ||
12 | model = "Atmel AT91SAM9263 family SoC"; | ||
13 | compatible = "atmel,at91sam9263"; | ||
14 | interrupt-parent = <&aic>; | ||
15 | |||
16 | aliases { | ||
17 | serial0 = &dbgu; | ||
18 | serial1 = &usart0; | ||
19 | serial2 = &usart1; | ||
20 | serial3 = &usart2; | ||
21 | gpio0 = &pioA; | ||
22 | gpio1 = &pioB; | ||
23 | gpio2 = &pioC; | ||
24 | gpio3 = &pioD; | ||
25 | gpio4 = &pioE; | ||
26 | tcb0 = &tcb0; | ||
27 | }; | ||
28 | cpus { | ||
29 | cpu@0 { | ||
30 | compatible = "arm,arm926ejs"; | ||
31 | }; | ||
32 | }; | ||
33 | |||
34 | memory { | ||
35 | reg = <0x20000000 0x08000000>; | ||
36 | }; | ||
37 | |||
38 | ahb { | ||
39 | compatible = "simple-bus"; | ||
40 | #address-cells = <1>; | ||
41 | #size-cells = <1>; | ||
42 | ranges; | ||
43 | |||
44 | apb { | ||
45 | compatible = "simple-bus"; | ||
46 | #address-cells = <1>; | ||
47 | #size-cells = <1>; | ||
48 | ranges; | ||
49 | |||
50 | aic: interrupt-controller@fffff000 { | ||
51 | #interrupt-cells = <2>; | ||
52 | compatible = "atmel,at91rm9200-aic"; | ||
53 | interrupt-controller; | ||
54 | reg = <0xfffff000 0x200>; | ||
55 | }; | ||
56 | |||
57 | pmc: pmc@fffffc00 { | ||
58 | compatible = "atmel,at91rm9200-pmc"; | ||
59 | reg = <0xfffffc00 0x100>; | ||
60 | }; | ||
61 | |||
62 | ramc: ramc@ffffe200 { | ||
63 | compatible = "atmel,at91sam9260-sdramc"; | ||
64 | reg = <0xffffe200 0x200 | ||
65 | 0xffffe800 0x200>; | ||
66 | }; | ||
67 | |||
68 | pit: timer@fffffd30 { | ||
69 | compatible = "atmel,at91sam9260-pit"; | ||
70 | reg = <0xfffffd30 0xf>; | ||
71 | interrupts = <1 4>; | ||
72 | }; | ||
73 | |||
74 | tcb0: timer@fff7c000 { | ||
75 | compatible = "atmel,at91rm9200-tcb"; | ||
76 | reg = <0xfff7c000 0x100>; | ||
77 | interrupts = <19 4>; | ||
78 | }; | ||
79 | |||
80 | rstc@fffffd00 { | ||
81 | compatible = "atmel,at91sam9260-rstc"; | ||
82 | reg = <0xfffffd00 0x10>; | ||
83 | }; | ||
84 | |||
85 | shdwc@fffffd10 { | ||
86 | compatible = "atmel,at91sam9260-shdwc"; | ||
87 | reg = <0xfffffd10 0x10>; | ||
88 | }; | ||
89 | |||
90 | pioA: gpio@fffff200 { | ||
91 | compatible = "atmel,at91rm9200-gpio"; | ||
92 | reg = <0xfffff200 0x100>; | ||
93 | interrupts = <2 4>; | ||
94 | #gpio-cells = <2>; | ||
95 | gpio-controller; | ||
96 | interrupt-controller; | ||
97 | }; | ||
98 | |||
99 | pioB: gpio@fffff400 { | ||
100 | compatible = "atmel,at91rm9200-gpio"; | ||
101 | reg = <0xfffff400 0x100>; | ||
102 | interrupts = <3 4>; | ||
103 | #gpio-cells = <2>; | ||
104 | gpio-controller; | ||
105 | interrupt-controller; | ||
106 | }; | ||
107 | |||
108 | pioC: gpio@fffff600 { | ||
109 | compatible = "atmel,at91rm9200-gpio"; | ||
110 | reg = <0xfffff600 0x100>; | ||
111 | interrupts = <4 4>; | ||
112 | #gpio-cells = <2>; | ||
113 | gpio-controller; | ||
114 | interrupt-controller; | ||
115 | }; | ||
116 | |||
117 | pioD: gpio@fffff800 { | ||
118 | compatible = "atmel,at91rm9200-gpio"; | ||
119 | reg = <0xfffff800 0x100>; | ||
120 | interrupts = <4 4>; | ||
121 | #gpio-cells = <2>; | ||
122 | gpio-controller; | ||
123 | interrupt-controller; | ||
124 | }; | ||
125 | |||
126 | pioE: gpio@fffffa00 { | ||
127 | compatible = "atmel,at91rm9200-gpio"; | ||
128 | reg = <0xfffffa00 0x100>; | ||
129 | interrupts = <4 4>; | ||
130 | #gpio-cells = <2>; | ||
131 | gpio-controller; | ||
132 | interrupt-controller; | ||
133 | }; | ||
134 | |||
135 | dbgu: serial@ffffee00 { | ||
136 | compatible = "atmel,at91sam9260-usart"; | ||
137 | reg = <0xffffee00 0x200>; | ||
138 | interrupts = <1 4>; | ||
139 | status = "disabled"; | ||
140 | }; | ||
141 | |||
142 | usart0: serial@fff8c000 { | ||
143 | compatible = "atmel,at91sam9260-usart"; | ||
144 | reg = <0xfff8c000 0x200>; | ||
145 | interrupts = <7 4>; | ||
146 | atmel,use-dma-rx; | ||
147 | atmel,use-dma-tx; | ||
148 | status = "disabled"; | ||
149 | }; | ||
150 | |||
151 | usart1: serial@fff90000 { | ||
152 | compatible = "atmel,at91sam9260-usart"; | ||
153 | reg = <0xfff90000 0x200>; | ||
154 | interrupts = <8 4>; | ||
155 | atmel,use-dma-rx; | ||
156 | atmel,use-dma-tx; | ||
157 | status = "disabled"; | ||
158 | }; | ||
159 | |||
160 | usart2: serial@fff94000 { | ||
161 | compatible = "atmel,at91sam9260-usart"; | ||
162 | reg = <0xfff94000 0x200>; | ||
163 | interrupts = <9 4>; | ||
164 | atmel,use-dma-rx; | ||
165 | atmel,use-dma-tx; | ||
166 | status = "disabled"; | ||
167 | }; | ||
168 | |||
169 | macb0: ethernet@fffbc000 { | ||
170 | compatible = "cdns,at32ap7000-macb", "cdns,macb"; | ||
171 | reg = <0xfffbc000 0x100>; | ||
172 | interrupts = <21 4>; | ||
173 | status = "disabled"; | ||
174 | }; | ||
175 | |||
176 | usb1: gadget@fff78000 { | ||
177 | compatible = "atmel,at91rm9200-udc"; | ||
178 | reg = <0xfff78000 0x4000>; | ||
179 | interrupts = <24 4>; | ||
180 | status = "disabled"; | ||
181 | }; | ||
182 | }; | ||
183 | |||
184 | nand0: nand@40000000 { | ||
185 | compatible = "atmel,at91rm9200-nand"; | ||
186 | #address-cells = <1>; | ||
187 | #size-cells = <1>; | ||
188 | reg = <0x40000000 0x10000000 | ||
189 | 0xffffe000 0x200 | ||
190 | >; | ||
191 | atmel,nand-addr-offset = <21>; | ||
192 | atmel,nand-cmd-offset = <22>; | ||
193 | gpios = <&pioA 22 0 | ||
194 | &pioD 15 0 | ||
195 | 0 | ||
196 | >; | ||
197 | status = "disabled"; | ||
198 | }; | ||
199 | |||
200 | usb0: ohci@00a00000 { | ||
201 | compatible = "atmel,at91rm9200-ohci", "usb-ohci"; | ||
202 | reg = <0x00a00000 0x100000>; | ||
203 | interrupts = <29 4>; | ||
204 | status = "disabled"; | ||
205 | }; | ||
206 | }; | ||
207 | |||
208 | i2c@0 { | ||
209 | compatible = "i2c-gpio"; | ||
210 | gpios = <&pioB 4 0 /* sda */ | ||
211 | &pioB 5 0 /* scl */ | ||
212 | >; | ||
213 | i2c-gpio,sda-open-drain; | ||
214 | i2c-gpio,scl-open-drain; | ||
215 | i2c-gpio,delay-us = <2>; /* ~100 kHz */ | ||
216 | #address-cells = <1>; | ||
217 | #size-cells = <0>; | ||
218 | status = "disabled"; | ||
219 | }; | ||
220 | }; | ||
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c index 7fae36502fbb..ed91c7e9f7c2 100644 --- a/arch/arm/mach-at91/at91sam9263.c +++ b/arch/arm/mach-at91/at91sam9263.c | |||
@@ -199,6 +199,16 @@ static struct clk_lookup periph_clocks_lookups[] = { | |||
199 | CLKDEV_CON_ID("pioC", &pioCDE_clk), | 199 | CLKDEV_CON_ID("pioC", &pioCDE_clk), |
200 | CLKDEV_CON_ID("pioD", &pioCDE_clk), | 200 | CLKDEV_CON_ID("pioD", &pioCDE_clk), |
201 | CLKDEV_CON_ID("pioE", &pioCDE_clk), | 201 | CLKDEV_CON_ID("pioE", &pioCDE_clk), |
202 | /* more usart lookup table for DT entries */ | ||
203 | CLKDEV_CON_DEV_ID("usart", "ffffee00.serial", &mck), | ||
204 | CLKDEV_CON_DEV_ID("usart", "fff8c000.serial", &usart0_clk), | ||
205 | CLKDEV_CON_DEV_ID("usart", "fff90000.serial", &usart1_clk), | ||
206 | CLKDEV_CON_DEV_ID("usart", "fff94000.serial", &usart2_clk), | ||
207 | /* more tc lookup table for DT entries */ | ||
208 | CLKDEV_CON_DEV_ID("t0_clk", "fff7c000.timer", &tcb_clk), | ||
209 | CLKDEV_CON_DEV_ID("hclk", "a00000.ohci", &ohci_clk), | ||
210 | CLKDEV_CON_DEV_ID("spi_clk", "fffa4000.spi", &spi0_clk), | ||
211 | CLKDEV_CON_DEV_ID("spi_clk", "fffa8000.spi", &spi1_clk), | ||
202 | }; | 212 | }; |
203 | 213 | ||
204 | static struct clk_lookup usart_clocks_lookups[] = { | 214 | static struct clk_lookup usart_clocks_lookups[] = { |
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c index dfe5bc006d5e..175e0009eaa9 100644 --- a/arch/arm/mach-at91/at91sam9263_devices.c +++ b/arch/arm/mach-at91/at91sam9263_devices.c | |||
@@ -953,8 +953,25 @@ static struct platform_device at91sam9263_tcb_device = { | |||
953 | .num_resources = ARRAY_SIZE(tcb_resources), | 953 | .num_resources = ARRAY_SIZE(tcb_resources), |
954 | }; | 954 | }; |
955 | 955 | ||
956 | #if defined(CONFIG_OF) | ||
957 | static struct of_device_id tcb_ids[] = { | ||
958 | { .compatible = "atmel,at91rm9200-tcb" }, | ||
959 | { /*sentinel*/ } | ||
960 | }; | ||
961 | #endif | ||
962 | |||
956 | static void __init at91_add_device_tc(void) | 963 | static void __init at91_add_device_tc(void) |
957 | { | 964 | { |
965 | #if defined(CONFIG_OF) | ||
966 | struct device_node *np; | ||
967 | |||
968 | np = of_find_matching_node(NULL, tcb_ids); | ||
969 | if (np) { | ||
970 | of_node_put(np); | ||
971 | return; | ||
972 | } | ||
973 | #endif | ||
974 | |||
958 | platform_device_register(&at91sam9263_tcb_device); | 975 | platform_device_register(&at91sam9263_tcb_device); |
959 | } | 976 | } |
960 | #else | 977 | #else |
@@ -1483,6 +1500,9 @@ void __init at91_add_device_serial(void) {} | |||
1483 | */ | 1500 | */ |
1484 | static int __init at91_add_standard_devices(void) | 1501 | static int __init at91_add_standard_devices(void) |
1485 | { | 1502 | { |
1503 | if (of_have_populated_dt()) | ||
1504 | return 0; | ||
1505 | |||
1486 | at91_add_device_rtt(); | 1506 | at91_add_device_rtt(); |
1487 | at91_add_device_watchdog(); | 1507 | at91_add_device_watchdog(); |
1488 | at91_add_device_tc(); | 1508 | at91_add_device_tc(); |