aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2013-05-24 15:56:38 -0400
committerLinus Walleij <linus.walleij@linaro.org>2013-05-26 16:25:36 -0400
commit49932f5ef13fa6a5a8bd71cf2f0b721d0e0b495d (patch)
tree4995b45def6bddccf5bfcf9ad97d31a3849332f7 /arch/arm
parent175210a842e2c05cb5dc606ad43a5dbefe12977f (diff)
ARM: nomadik: move the pin configuration to DT
This moves the pin configuration for the Nomadik over to the device tree using Gabriel's bindings. Remove the auxdata nailing down the name of the pin controller as this is no longer necessary. Cc: Gabriel Fernandez <gabriel.fernandez@st.com> Cc: Patrice Chotard <patrice.chotard@st.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/boot/dts/ste-nomadik-s8815.dts41
-rw-r--r--arch/arm/boot/dts/ste-nomadik-stn8815.dtsi82
-rw-r--r--arch/arm/mach-nomadik/cpu-8815.c51
3 files changed, 123 insertions, 51 deletions
diff --git a/arch/arm/boot/dts/ste-nomadik-s8815.dts b/arch/arm/boot/dts/ste-nomadik-s8815.dts
index 666945adc120..638ec8df5802 100644
--- a/arch/arm/boot/dts/ste-nomadik-s8815.dts
+++ b/arch/arm/boot/dts/ste-nomadik-s8815.dts
@@ -14,6 +14,43 @@
14 bootargs = "root=/dev/ram0 console=ttyAMA1,115200n8 earlyprintk"; 14 bootargs = "root=/dev/ram0 console=ttyAMA1,115200n8 earlyprintk";
15 }; 15 };
16 16
17 pinctrl {
18 /* Hog CD pins */
19 pinctrl-names = "default";
20 pinctrl-0 = <&cd_default_mode>;
21
22 mmcsd-cd {
23 cd_default_mode: cd_default {
24 cd_default_cfg1 {
25 /* CD input GPIO */
26 ste,pins = "GPIO111_H21";
27 ste,input = <0>;
28 };
29 cd_default_cfg2 {
30 /* CD GPIO biasing */
31 ste,pins = "GPIO112_J21";
32 ste,output = <0>;
33 };
34 };
35 };
36 user-led {
37 user_led_default_mode: user_led_default {
38 user_led_default_cfg {
39 ste,pins = "GPIO2_C5";
40 ste,output = <1>;
41 };
42 };
43 };
44 user-button {
45 user_button_default_mode: user_button_default {
46 user_button_default_cfg {
47 ste,pins = "GPIO3_A4";
48 ste,input = <0>;
49 };
50 };
51 };
52 };
53
17 /* Custom board node with GPIO pins to active etc */ 54 /* Custom board node with GPIO pins to active etc */
18 usb-s8815 { 55 usb-s8815 {
19 /* The S8815 is using this very GPIO pin for the SMSC91x IRQs */ 56 /* The S8815 is using this very GPIO pin for the SMSC91x IRQs */
@@ -36,6 +73,8 @@
36 gpios = <&gpio0 2 0x1>; 73 gpios = <&gpio0 2 0x1>;
37 default-state = "off"; 74 default-state = "off";
38 linux,default-trigger = "heartbeat"; 75 linux,default-trigger = "heartbeat";
76 pinctrl-names = "default";
77 pinctrl-0 = <&user_led_default_mode>;
39 }; 78 };
40 }; 79 };
41 80
@@ -47,6 +86,8 @@
47 gpios = <&gpio0 3 0x1>; 86 gpios = <&gpio0 3 0x1>;
48 linux,code = <1>; /* KEY_ESC */ 87 linux,code = <1>; /* KEY_ESC */
49 gpio-key,wakeup; 88 gpio-key,wakeup;
89 pinctrl-names = "default";
90 pinctrl-0 = <&user_button_default_mode>;
50 }; 91 };
51 }; 92 };
52}; 93};
diff --git a/arch/arm/boot/dts/ste-nomadik-stn8815.dtsi b/arch/arm/boot/dts/ste-nomadik-stn8815.dtsi
index 51a33e080ca9..615da8798a0d 100644
--- a/arch/arm/boot/dts/ste-nomadik-stn8815.dtsi
+++ b/arch/arm/boot/dts/ste-nomadik-stn8815.dtsi
@@ -94,6 +94,75 @@
94 94
95 pinctrl { 95 pinctrl {
96 compatible = "stericsson,nmk-pinctrl-stn8815"; 96 compatible = "stericsson,nmk-pinctrl-stn8815";
97 /* Pin configurations */
98 uart0 {
99 uart0_default_mux: uart0_mux {
100 u0_default_mux {
101 ste,function = "u0";
102 ste,pins = "u0_a_1";
103 };
104 };
105 };
106 uart1 {
107 uart1_default_mux: uart1_mux {
108 u1_default_mux {
109 ste,function = "u1";
110 ste,pins = "u1_a_1";
111 };
112 };
113 };
114 mmcsd {
115 mmcsd_default_mux: mmcsd_mux {
116 mmcsd_default_mux {
117 ste,function = "mmcsd";
118 ste,pins = "mmcsd_a_1";
119 };
120 };
121 mmcsd_default_mode: mmcsd_default {
122 mmcsd_default_cfg1 {
123 /* MCCLK */
124 ste,pins = "GPIO8_B10";
125 ste,output = <0>;
126 };
127 mmcsd_default_cfg2 {
128 /* MCCMDDIR, MCDAT0DIR, MCDAT31DIR */
129 ste,pins = "GPIO10_C11", "GPIO15_A12",
130 "GPIO16_C13";
131 ste,output = <1>;
132 };
133 mmcsd_default_cfg3 {
134 /* MCCMD, MCDAT3-0, MCMSFBCLK */
135 ste,pins = "GPIO9_A10", "GPIO11_B11",
136 "GPIO12_A11", "GPIO13_C12",
137 "GPIO14_B12", "GPIO24_C15";
138 ste,input = <1>;
139 };
140 };
141 };
142 i2c0 {
143 i2c0_default_mode: i2c0_default {
144 i2c0_default_cfg {
145 ste,pins = "GPIO62_D3", "GPIO63_D2";
146 ste,input = <1>;
147 };
148 };
149 };
150 i2c1 {
151 i2c1_default_mode: i2c1_default {
152 i2c1_default_cfg {
153 ste,pins = "GPIO53_L4", "GPIO54_L3";
154 ste,input = <1>;
155 };
156 };
157 };
158 i2c2 {
159 i2c2_default_mode: i2c2_default {
160 i2c2_default_cfg {
161 ste,pins = "GPIO73_C21", "GPIO74_C20";
162 ste,input = <1>;
163 };
164 };
165 };
97 }; 166 };
98 167
99 src: src@101e0000 { 168 src: src@101e0000 {
@@ -191,6 +260,8 @@
191 <&gpio1 30 0>; /* scl */ 260 <&gpio1 30 0>; /* scl */
192 #address-cells = <1>; 261 #address-cells = <1>;
193 #size-cells = <0>; 262 #size-cells = <0>;
263 pinctrl-names = "default";
264 pinctrl-0 = <&i2c0_default_mode>;
194 265
195 stw4811@2d { 266 stw4811@2d {
196 compatible = "st,stw4811"; 267 compatible = "st,stw4811";
@@ -205,6 +276,8 @@
205 <&gpio1 21 0>; /* scl */ 276 <&gpio1 21 0>; /* scl */
206 #address-cells = <1>; 277 #address-cells = <1>;
207 #size-cells = <0>; 278 #size-cells = <0>;
279 pinctrl-names = "default";
280 pinctrl-0 = <&i2c1_default_mode>;
208 281
209 camera@2d { 282 camera@2d {
210 compatible = "st,camera"; 283 compatible = "st,camera";
@@ -227,6 +300,9 @@
227 <&gpio2 9 0>; /* scl */ 300 <&gpio2 9 0>; /* scl */
228 #address-cells = <1>; 301 #address-cells = <1>;
229 #size-cells = <0>; 302 #size-cells = <0>;
303 pinctrl-names = "default";
304 pinctrl-0 = <&i2c2_default_mode>;
305
230 stw4811@2d { 306 stw4811@2d {
231 compatible = "st,stw4811-usb"; 307 compatible = "st,stw4811-usb";
232 reg = <0x2d>; 308 reg = <0x2d>;
@@ -260,6 +336,8 @@
260 interrupts = <12>; 336 interrupts = <12>;
261 clocks = <&clk48>, <&pclk>; 337 clocks = <&clk48>, <&pclk>;
262 clock-names = "uartclk", "apb_pclk"; 338 clock-names = "uartclk", "apb_pclk";
339 pinctrl-names = "default";
340 pinctrl-0 = <&uart0_default_mux>;
263 }; 341 };
264 342
265 uart1: uart@101fb000 { 343 uart1: uart@101fb000 {
@@ -269,6 +347,8 @@
269 interrupts = <17>; 347 interrupts = <17>;
270 clocks = <&clk48>, <&pclk>; 348 clocks = <&clk48>, <&pclk>;
271 clock-names = "uartclk", "apb_pclk"; 349 clock-names = "uartclk", "apb_pclk";
350 pinctrl-names = "default";
351 pinctrl-0 = <&uart1_default_mux>;
272 }; 352 };
273 353
274 uart2: uart@101f2000 { 354 uart2: uart@101f2000 {
@@ -310,6 +390,8 @@
310 mmc-cap-sd-highspeed; 390 mmc-cap-sd-highspeed;
311 cd-gpios = <&gpio3 15 0x1>; 391 cd-gpios = <&gpio3 15 0x1>;
312 cd-inverted; 392 cd-inverted;
393 pinctrl-names = "default";
394 pinctrl-0 = <&mmcsd_default_mux>, <&mmcsd_default_mode>;
313 }; 395 };
314 }; 396 };
315}; 397};
diff --git a/arch/arm/mach-nomadik/cpu-8815.c b/arch/arm/mach-nomadik/cpu-8815.c
index 835161709c62..89e2c03db178 100644
--- a/arch/arm/mach-nomadik/cpu-8815.c
+++ b/arch/arm/mach-nomadik/cpu-8815.c
@@ -27,8 +27,6 @@
27#include <linux/dma-mapping.h> 27#include <linux/dma-mapping.h>
28#include <linux/irqchip.h> 28#include <linux/irqchip.h>
29#include <linux/platform_data/clk-nomadik.h> 29#include <linux/platform_data/clk-nomadik.h>
30#include <linux/platform_data/pinctrl-nomadik.h>
31#include <linux/pinctrl/machine.h>
32#include <linux/clocksource.h> 30#include <linux/clocksource.h>
33#include <linux/of_irq.h> 31#include <linux/of_irq.h>
34#include <linux/of_gpio.h> 32#include <linux/of_gpio.h>
@@ -91,52 +89,6 @@
91#define NOMADIK_L2CC_BASE 0x10210000 /* L2 Cache controller */ 89#define NOMADIK_L2CC_BASE 0x10210000 /* L2 Cache controller */
92#define NOMADIK_UART1_VBASE 0xF01FB000 90#define NOMADIK_UART1_VBASE 0xF01FB000
93 91
94static unsigned long out_low[] = { PIN_OUTPUT_LOW };
95static unsigned long out_high[] = { PIN_OUTPUT_HIGH };
96static unsigned long in_nopull[] = { PIN_INPUT_NOPULL };
97static unsigned long in_pullup[] = { PIN_INPUT_PULLUP };
98
99static struct pinctrl_map __initdata nhk8815_pinmap[] = {
100 PIN_MAP_MUX_GROUP_DEFAULT("uart0", "pinctrl-stn8815", "u0_a_1", "u0"),
101 PIN_MAP_MUX_GROUP_DEFAULT("uart1", "pinctrl-stn8815", "u1_a_1", "u1"),
102 /* User LED on S8815 */
103 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO2_C5", out_high),
104 /* User button on S8815 */
105 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO3_A4", in_nopull),
106 /* Hog in MMC/SD card mux */
107 PIN_MAP_MUX_GROUP_HOG_DEFAULT("pinctrl-stn8815", "mmcsd_a_1", "mmcsd"),
108 /* MCCLK */
109 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO8_B10", out_low),
110 /* MCCMD */
111 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO9_A10", in_pullup),
112 /* MCCMDDIR */
113 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO10_C11", out_high),
114 /* MCDAT3-0 */
115 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO11_B11", in_pullup),
116 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO12_A11", in_pullup),
117 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO13_C12", in_pullup),
118 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO14_B12", in_pullup),
119 /* MCDAT0DIR */
120 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO15_A12", out_high),
121 /* MCDAT31DIR */
122 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO16_C13", out_high),
123 /* MCMSFBCLK */
124 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO24_C15", in_pullup),
125 /* CD input GPIO */
126 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO111_H21", in_nopull),
127 /* CD bias drive */
128 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO112_J21", out_low),
129 /* I2C0 */
130 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO62_D3", in_pullup),
131 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO63_D2", in_pullup),
132 /* I2C1 */
133 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO53_L4", in_pullup),
134 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO54_L3", in_pullup),
135 /* I2C2 */
136 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO73_C21", in_pullup),
137 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO74_C20", in_pullup),
138};
139
140/* This is needed for LL-debug/earlyprintk/debug-macro.S */ 92/* This is needed for LL-debug/earlyprintk/debug-macro.S */
141static struct map_desc cpu8815_io_desc[] __initdata = { 93static struct map_desc cpu8815_io_desc[] __initdata = {
142 { 94 {
@@ -284,8 +236,6 @@ device_initcall(cpu8815_mmcsd_init);
284 236
285/* These are mostly to get the right device names for the clock lookups */ 237/* These are mostly to get the right device names for the clock lookups */
286static struct of_dev_auxdata cpu8815_auxdata_lookup[] __initdata = { 238static struct of_dev_auxdata cpu8815_auxdata_lookup[] __initdata = {
287 OF_DEV_AUXDATA("stericsson,nmk-pinctrl-stn8815", 0,
288 "pinctrl-stn8815", NULL),
289 OF_DEV_AUXDATA("stericsson,fsmc-nand", NOMADIK_FSMC_BASE, 239 OF_DEV_AUXDATA("stericsson,fsmc-nand", NOMADIK_FSMC_BASE,
290 NULL, &cpu8815_nand_data), 240 NULL, &cpu8815_nand_data),
291 OF_DEV_AUXDATA("arm,primecell", NOMADIK_SDI_BASE, 241 OF_DEV_AUXDATA("arm,primecell", NOMADIK_SDI_BASE,
@@ -299,7 +249,6 @@ static void __init cpu8815_init_of(void)
299 /* At full speed latency must be >=2, so 0x249 in low bits */ 249 /* At full speed latency must be >=2, so 0x249 in low bits */
300 l2x0_of_init(0x00730249, 0xfe000fff); 250 l2x0_of_init(0x00730249, 0xfe000fff);
301#endif 251#endif
302 pinctrl_register_mappings(nhk8815_pinmap, ARRAY_SIZE(nhk8815_pinmap));
303 of_platform_populate(NULL, of_default_bus_match_table, 252 of_platform_populate(NULL, of_default_bus_match_table,
304 cpu8815_auxdata_lookup, NULL); 253 cpu8815_auxdata_lookup, NULL);
305} 254}