aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91/at91sam9g45_devices.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-03-27 19:47:35 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-03-27 19:47:35 -0400
commit66f03c614c0902ccf7d6160459362a9352f33271 (patch)
treeb9a8864efe5aa7fc5c96cc5ccbeca41f5cd6f6a7 /arch/arm/mach-at91/at91sam9g45_devices.c
parent34800598b2eebe061445216473b1e4c2ff5cba99 (diff)
parentcdc3df6f44f72c5924a16a47e1663c3fb0e57820 (diff)
Merge tag 'dt' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull "ARM: device tree work" from Arnd Bergmann: "Most of these patches convert code from using static platform data to describing the hardware in the device tree. This is only the first half of the changes for v3.4 because a lot of patches for this topic came in the last week before the merge window. Signed-off-by: Arnd Bergmann <arnd@arndb.de>" Fix up trivial conflicts in arch/arm/mach-vexpress/{Kconfig,core.h} * tag 'dt' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (86 commits) Document: devicetree: add OF documents for arch-mmp ARM: dts: append DTS file of pxa168 ARM: mmp: append OF support on pxa168 ARM: mmp: enable rtc clk in pxa168 i2c: pxa: add OF support serial: pxa: add OF support arm/dts: mt_ventoux: very basic support for TeeJet Mt.Ventoux board ARM: OMAP2+: Remove extra ifdefs for board-generic ARM: OMAP2+: Fix build error when only ARCH_OMAP2/3 or 4 is selected ASoC: DT: Add digital microphone binding to PAZ00 board. ARM: dt: Add ARM PMU to tegra*.dtsi ARM: at91: at91sam9x5cm/dt: add leds support ARM: at91: usb_a9g20/dt: add gpio-keys support ARM: at91: at91sam9m10g45ek/dt: add gpio-keys support ARM: at91: at91sam9m10g45ek/dt: add leds support ARM: at91: usb_a9g20/dt: add leds support ARM: at91/pio: add new PIO3 features ARM: at91: add sam9_smc.o to at91sam9x5 build ARM: at91/tc/clocksource: Add 32 bit variant to Timer Counter ARM: at91/tc: add device tree support to atmel_tclib ...
Diffstat (limited to 'arch/arm/mach-at91/at91sam9g45_devices.c')
-rw-r--r--arch/arm/mach-at91/at91sam9g45_devices.c52
1 files changed, 46 insertions, 6 deletions
diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c
index bd4e68cd3e2f..4320b2096789 100644
--- a/arch/arm/mach-at91/at91sam9g45_devices.c
+++ b/arch/arm/mach-at91/at91sam9g45_devices.c
@@ -25,6 +25,7 @@
25#include <mach/board.h> 25#include <mach/board.h>
26#include <mach/at91sam9g45.h> 26#include <mach/at91sam9g45.h>
27#include <mach/at91sam9g45_matrix.h> 27#include <mach/at91sam9g45_matrix.h>
28#include <mach/at91_matrix.h>
28#include <mach/at91sam9_smc.h> 29#include <mach/at91sam9_smc.h>
29#include <mach/at_hdmac.h> 30#include <mach/at_hdmac.h>
30#include <mach/atmel-mci.h> 31#include <mach/atmel-mci.h>
@@ -557,8 +558,8 @@ void __init at91_add_device_nand(struct atmel_nand_data *data)
557 if (!data) 558 if (!data)
558 return; 559 return;
559 560
560 csa = at91_sys_read(AT91_MATRIX_EBICSA); 561 csa = at91_matrix_read(AT91_MATRIX_EBICSA);
561 at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_EBI_CS3A_SMC_SMARTMEDIA); 562 at91_matrix_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_EBI_CS3A_SMC_SMARTMEDIA);
562 563
563 /* enable pin */ 564 /* enable pin */
564 if (gpio_is_valid(data->enable_pin)) 565 if (gpio_is_valid(data->enable_pin))
@@ -1051,7 +1052,7 @@ void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) {}
1051static struct resource tcb0_resources[] = { 1052static struct resource tcb0_resources[] = {
1052 [0] = { 1053 [0] = {
1053 .start = AT91SAM9G45_BASE_TCB0, 1054 .start = AT91SAM9G45_BASE_TCB0,
1054 .end = AT91SAM9G45_BASE_TCB0 + SZ_16K - 1, 1055 .end = AT91SAM9G45_BASE_TCB0 + SZ_256 - 1,
1055 .flags = IORESOURCE_MEM, 1056 .flags = IORESOURCE_MEM,
1056 }, 1057 },
1057 [1] = { 1058 [1] = {
@@ -1072,7 +1073,7 @@ static struct platform_device at91sam9g45_tcb0_device = {
1072static struct resource tcb1_resources[] = { 1073static struct resource tcb1_resources[] = {
1073 [0] = { 1074 [0] = {
1074 .start = AT91SAM9G45_BASE_TCB1, 1075 .start = AT91SAM9G45_BASE_TCB1,
1075 .end = AT91SAM9G45_BASE_TCB1 + SZ_16K - 1, 1076 .end = AT91SAM9G45_BASE_TCB1 + SZ_256 - 1,
1076 .flags = IORESOURCE_MEM, 1077 .flags = IORESOURCE_MEM,
1077 }, 1078 },
1078 [1] = { 1079 [1] = {
@@ -1089,8 +1090,25 @@ static struct platform_device at91sam9g45_tcb1_device = {
1089 .num_resources = ARRAY_SIZE(tcb1_resources), 1090 .num_resources = ARRAY_SIZE(tcb1_resources),
1090}; 1091};
1091 1092
1093#if defined(CONFIG_OF)
1094static struct of_device_id tcb_ids[] = {
1095 { .compatible = "atmel,at91rm9200-tcb" },
1096 { /*sentinel*/ }
1097};
1098#endif
1099
1092static void __init at91_add_device_tc(void) 1100static void __init at91_add_device_tc(void)
1093{ 1101{
1102#if defined(CONFIG_OF)
1103 struct device_node *np;
1104
1105 np = of_find_matching_node(NULL, tcb_ids);
1106 if (np) {
1107 of_node_put(np);
1108 return;
1109 }
1110#endif
1111
1094 platform_device_register(&at91sam9g45_tcb0_device); 1112 platform_device_register(&at91sam9g45_tcb0_device);
1095 platform_device_register(&at91sam9g45_tcb1_device); 1113 platform_device_register(&at91sam9g45_tcb1_device);
1096} 1114}
@@ -1193,6 +1211,8 @@ static struct resource rtt_resources[] = {
1193 .start = AT91SAM9G45_BASE_RTT, 1211 .start = AT91SAM9G45_BASE_RTT,
1194 .end = AT91SAM9G45_BASE_RTT + SZ_16 - 1, 1212 .end = AT91SAM9G45_BASE_RTT + SZ_16 - 1,
1195 .flags = IORESOURCE_MEM, 1213 .flags = IORESOURCE_MEM,
1214 }, {
1215 .flags = IORESOURCE_MEM,
1196 } 1216 }
1197}; 1217};
1198 1218
@@ -1200,11 +1220,32 @@ static struct platform_device at91sam9g45_rtt_device = {
1200 .name = "at91_rtt", 1220 .name = "at91_rtt",
1201 .id = 0, 1221 .id = 0,
1202 .resource = rtt_resources, 1222 .resource = rtt_resources,
1203 .num_resources = ARRAY_SIZE(rtt_resources),
1204}; 1223};
1205 1224
1225#if IS_ENABLED(CONFIG_RTC_DRV_AT91SAM9)
1226static void __init at91_add_device_rtt_rtc(void)
1227{
1228 at91sam9g45_rtt_device.name = "rtc-at91sam9";
1229 /*
1230 * The second resource is needed:
1231 * GPBR will serve as the storage for RTC time offset
1232 */
1233 at91sam9g45_rtt_device.num_resources = 2;
1234 rtt_resources[1].start = AT91SAM9G45_BASE_GPBR +
1235 4 * CONFIG_RTC_DRV_AT91SAM9_GPBR;
1236 rtt_resources[1].end = rtt_resources[1].start + 3;
1237}
1238#else
1239static void __init at91_add_device_rtt_rtc(void)
1240{
1241 /* Only one resource is needed: RTT not used as RTC */
1242 at91sam9g45_rtt_device.num_resources = 1;
1243}
1244#endif
1245
1206static void __init at91_add_device_rtt(void) 1246static void __init at91_add_device_rtt(void)
1207{ 1247{
1248 at91_add_device_rtt_rtc();
1208 platform_device_register(&at91sam9g45_rtt_device); 1249 platform_device_register(&at91sam9g45_rtt_device);
1209} 1250}
1210 1251
@@ -1659,7 +1700,6 @@ static inline void configure_usart3_pins(unsigned pins)
1659} 1700}
1660 1701
1661static struct platform_device *__initdata at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */ 1702static struct platform_device *__initdata at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */
1662struct platform_device *atmel_default_console_device; /* the serial console device */
1663 1703
1664void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) 1704void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
1665{ 1705{