aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2013-01-05 17:10:09 -0500
committerLinus Walleij <linus.walleij@linaro.org>2013-01-28 17:24:39 -0500
commit6010d40320f8827441414886c46a7dbc6460439a (patch)
tree3ed1ef4fb1c52356815f4edb5c891a9187da668c /arch/arm
parentba785205502f9a03d4ee31bdc3a1228ba5465f00 (diff)
ARM: nomadik: move GPIO and pinctrl to device tree
This moves the instances of the Nomadik pin controller and the Nomadik GPIO blocks (also handled by the GPIO driver) over to the device tree. A new compatible string is added to the pin control driver in the process. Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/boot/dts/ste-nomadik-stn8815.dtsi52
-rw-r--r--arch/arm/mach-nomadik/cpu-8815.c21
2 files changed, 69 insertions, 4 deletions
diff --git a/arch/arm/boot/dts/ste-nomadik-stn8815.dtsi b/arch/arm/boot/dts/ste-nomadik-stn8815.dtsi
index c73df370373b..2c8aaa5c6ac4 100644
--- a/arch/arm/boot/dts/ste-nomadik-stn8815.dtsi
+++ b/arch/arm/boot/dts/ste-nomadik-stn8815.dtsi
@@ -35,6 +35,58 @@
35 interrupts = <5>; 35 interrupts = <5>;
36 }; 36 };
37 37
38 gpio0: gpio@101e4000 {
39 compatible = "st,nomadik-gpio";
40 reg = <0x101e4000 0x80>;
41 interrupt-parent = <&vica>;
42 interrupts = <6>;
43 interrupt-controller;
44 #interrupt-cells = <2>;
45 gpio-controller;
46 #gpio-cells = <2>;
47 gpio-bank = <0>;
48 };
49
50 gpio1: gpio@101e5000 {
51 compatible = "st,nomadik-gpio";
52 reg = <0x101e5000 0x80>;
53 interrupt-parent = <&vica>;
54 interrupts = <7>;
55 interrupt-controller;
56 #interrupt-cells = <2>;
57 gpio-controller;
58 #gpio-cells = <2>;
59 gpio-bank = <1>;
60 };
61
62 gpio2: gpio@101e6000 {
63 compatible = "st,nomadik-gpio";
64 reg = <0x101e6000 0x80>;
65 interrupt-parent = <&vica>;
66 interrupts = <8>;
67 interrupt-controller;
68 #interrupt-cells = <2>;
69 gpio-controller;
70 #gpio-cells = <2>;
71 gpio-bank = <2>;
72 };
73
74 gpio3: gpio@101e7000 {
75 compatible = "st,nomadik-gpio";
76 reg = <0x101e7000 0x80>;
77 interrupt-parent = <&vica>;
78 interrupts = <9>;
79 interrupt-controller;
80 #interrupt-cells = <2>;
81 gpio-controller;
82 #gpio-cells = <2>;
83 gpio-bank = <3>;
84 };
85
86 pinctrl {
87 compatible = "stericsson,nmk-pinctrl-stn8815";
88 };
89
38 /* A NAND flash of 128 MiB */ 90 /* A NAND flash of 128 MiB */
39 fsmc: flash@40000000 { 91 fsmc: flash@40000000 {
40 compatible = "stericsson,fsmc-nand"; 92 compatible = "stericsson,fsmc-nand";
diff --git a/arch/arm/mach-nomadik/cpu-8815.c b/arch/arm/mach-nomadik/cpu-8815.c
index a3894ca45bb8..3a59459d6e9a 100644
--- a/arch/arm/mach-nomadik/cpu-8815.c
+++ b/arch/arm/mach-nomadik/cpu-8815.c
@@ -153,13 +153,15 @@ static int __init cpu8815_init(void)
153 /* No custom data yet */ 153 /* No custom data yet */
154 }; 154 };
155 155
156 /* For e.g. device tree boots */
157 if (!machine_is_nomadik())
158 return 0;
159
156 cpu8815_add_gpios(cpu8815_gpio_base, ARRAY_SIZE(cpu8815_gpio_base), 160 cpu8815_add_gpios(cpu8815_gpio_base, ARRAY_SIZE(cpu8815_gpio_base),
157 IRQ_GPIO0, &pdata); 161 IRQ_GPIO0, &pdata);
158 cpu8815_add_pinctrl(NULL, "pinctrl-stn8815"); 162 cpu8815_add_pinctrl(NULL, "pinctrl-stn8815");
159 if (machine_is_nomadik()) { 163 amba_apb_device_add(NULL, "rng", NOMADIK_RNG_BASE, SZ_4K, 0, 0, NULL, 0);
160 amba_apb_device_add(NULL, "rng", NOMADIK_RNG_BASE, SZ_4K, 0, 0, NULL, 0); 164 amba_apb_device_add(NULL, "rtc-pl031", NOMADIK_RTC_BASE, SZ_4K, IRQ_RTC_RTT, 0, NULL, 0);
161 amba_apb_device_add(NULL, "rtc-pl031", NOMADIK_RTC_BASE, SZ_4K, IRQ_RTC_RTT, 0, NULL, 0);
162 }
163 return 0; 165 return 0;
164} 166}
165arch_initcall(cpu8815_init); 167arch_initcall(cpu8815_init);
@@ -263,6 +265,16 @@ static struct fsmc_nand_platform_data cpu8815_nand_data = {
263 265
264/* These are mostly to get the right device names for the clock lookups */ 266/* These are mostly to get the right device names for the clock lookups */
265static struct of_dev_auxdata cpu8815_auxdata_lookup[] __initdata = { 267static struct of_dev_auxdata cpu8815_auxdata_lookup[] __initdata = {
268 OF_DEV_AUXDATA("st,nomadik-gpio", NOMADIK_GPIO0_BASE,
269 "gpio.0", NULL),
270 OF_DEV_AUXDATA("st,nomadik-gpio", NOMADIK_GPIO1_BASE,
271 "gpio.1", NULL),
272 OF_DEV_AUXDATA("st,nomadik-gpio", NOMADIK_GPIO2_BASE,
273 "gpio.2", NULL),
274 OF_DEV_AUXDATA("st,nomadik-gpio", NOMADIK_GPIO3_BASE,
275 "gpio.3", NULL),
276 OF_DEV_AUXDATA("stericsson,nmk-pinctrl-stn8815", 0,
277 "pinctrl-stn8815", NULL),
266 OF_DEV_AUXDATA("arm,primecell", NOMADIK_UART0_BASE, 278 OF_DEV_AUXDATA("arm,primecell", NOMADIK_UART0_BASE,
267 "uart0", NULL), 279 "uart0", NULL),
268 OF_DEV_AUXDATA("arm,primecell", NOMADIK_UART1_BASE, 280 OF_DEV_AUXDATA("arm,primecell", NOMADIK_UART1_BASE,
@@ -283,6 +295,7 @@ static void __init cpu8815_init_of(void)
283 /* At full speed latency must be >=2, so 0x249 in low bits */ 295 /* At full speed latency must be >=2, so 0x249 in low bits */
284 l2x0_of_init(0x00730249, 0xfe000fff); 296 l2x0_of_init(0x00730249, 0xfe000fff);
285#endif 297#endif
298 pinctrl_register_mappings(nhk8815_pinmap, ARRAY_SIZE(nhk8815_pinmap));
286 of_platform_populate(NULL, of_default_bus_match_table, 299 of_platform_populate(NULL, of_default_bus_match_table,
287 cpu8815_auxdata_lookup, NULL); 300 cpu8815_auxdata_lookup, NULL);
288} 301}