diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2013-01-05 17:10:09 -0500 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2013-01-28 17:24:39 -0500 |
commit | 6010d40320f8827441414886c46a7dbc6460439a (patch) | |
tree | 3ed1ef4fb1c52356815f4edb5c891a9187da668c /arch/arm/mach-nomadik | |
parent | ba785205502f9a03d4ee31bdc3a1228ba5465f00 (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/mach-nomadik')
-rw-r--r-- | arch/arm/mach-nomadik/cpu-8815.c | 21 |
1 files changed, 17 insertions, 4 deletions
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 | } |
165 | arch_initcall(cpu8815_init); | 167 | arch_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 */ |
265 | static struct of_dev_auxdata cpu8815_auxdata_lookup[] __initdata = { | 267 | static 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 | } |