diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-at91rm9200/devices.c | 135 |
1 files changed, 127 insertions, 8 deletions
diff --git a/arch/arm/mach-at91rm9200/devices.c b/arch/arm/mach-at91rm9200/devices.c index aa36760efbc3..1781b8f342c4 100644 --- a/arch/arm/mach-at91rm9200/devices.c +++ b/arch/arm/mach-at91rm9200/devices.c | |||
@@ -28,10 +28,10 @@ | |||
28 | static u64 ohci_dmamask = 0xffffffffUL; | 28 | static u64 ohci_dmamask = 0xffffffffUL; |
29 | static struct at91_usbh_data usbh_data; | 29 | static struct at91_usbh_data usbh_data; |
30 | 30 | ||
31 | static struct resource at91rm9200_usbh_resource[] = { | 31 | static struct resource at91_usbh_resource[] = { |
32 | [0] = { | 32 | [0] = { |
33 | .start = AT91_UHP_BASE, | 33 | .start = AT91_UHP_BASE, |
34 | .end = AT91_UHP_BASE + SZ_1M -1, | 34 | .end = AT91_UHP_BASE + SZ_1M - 1, |
35 | .flags = IORESOURCE_MEM, | 35 | .flags = IORESOURCE_MEM, |
36 | }, | 36 | }, |
37 | [1] = { | 37 | [1] = { |
@@ -49,8 +49,8 @@ static struct platform_device at91rm9200_usbh_device = { | |||
49 | .coherent_dma_mask = 0xffffffff, | 49 | .coherent_dma_mask = 0xffffffff, |
50 | .platform_data = &usbh_data, | 50 | .platform_data = &usbh_data, |
51 | }, | 51 | }, |
52 | .resource = at91rm9200_usbh_resource, | 52 | .resource = at91_usbh_resource, |
53 | .num_resources = ARRAY_SIZE(at91rm9200_usbh_resource), | 53 | .num_resources = ARRAY_SIZE(at91_usbh_resource), |
54 | }; | 54 | }; |
55 | 55 | ||
56 | void __init at91_add_device_usbh(struct at91_usbh_data *data) | 56 | void __init at91_add_device_usbh(struct at91_usbh_data *data) |
@@ -121,6 +121,19 @@ void __init at91_add_device_udc(struct at91_udc_data *data) {} | |||
121 | static u64 eth_dmamask = 0xffffffffUL; | 121 | static u64 eth_dmamask = 0xffffffffUL; |
122 | static struct at91_eth_data eth_data; | 122 | static struct at91_eth_data eth_data; |
123 | 123 | ||
124 | static struct resource at91_eth_resources[] = { | ||
125 | [0] = { | ||
126 | .start = AT91_BASE_EMAC, | ||
127 | .end = AT91_BASE_EMAC + SZ_16K - 1, | ||
128 | .flags = IORESOURCE_MEM, | ||
129 | }, | ||
130 | [1] = { | ||
131 | .start = AT91_ID_EMAC, | ||
132 | .end = AT91_ID_EMAC, | ||
133 | .flags = IORESOURCE_IRQ, | ||
134 | }, | ||
135 | }; | ||
136 | |||
124 | static struct platform_device at91rm9200_eth_device = { | 137 | static struct platform_device at91rm9200_eth_device = { |
125 | .name = "at91_ether", | 138 | .name = "at91_ether", |
126 | .id = -1, | 139 | .id = -1, |
@@ -129,7 +142,8 @@ static struct platform_device at91rm9200_eth_device = { | |||
129 | .coherent_dma_mask = 0xffffffff, | 142 | .coherent_dma_mask = 0xffffffff, |
130 | .platform_data = ð_data, | 143 | .platform_data = ð_data, |
131 | }, | 144 | }, |
132 | .num_resources = 0, | 145 | .resource = at91_eth_resources, |
146 | .num_resources = ARRAY_SIZE(at91_eth_resources), | ||
133 | }; | 147 | }; |
134 | 148 | ||
135 | void __init at91_add_device_eth(struct at91_eth_data *data) | 149 | void __init at91_add_device_eth(struct at91_eth_data *data) |
@@ -224,15 +238,20 @@ static u64 mmc_dmamask = 0xffffffffUL; | |||
224 | static struct at91_mmc_data mmc_data; | 238 | static struct at91_mmc_data mmc_data; |
225 | 239 | ||
226 | static struct resource at91_mmc_resources[] = { | 240 | static struct resource at91_mmc_resources[] = { |
227 | { | 241 | [0] = { |
228 | .start = AT91_BASE_MCI, | 242 | .start = AT91_BASE_MCI, |
229 | .end = AT91_BASE_MCI + SZ_16K - 1, | 243 | .end = AT91_BASE_MCI + SZ_16K - 1, |
230 | .flags = IORESOURCE_MEM, | 244 | .flags = IORESOURCE_MEM, |
231 | } | 245 | }, |
246 | [1] = { | ||
247 | .start = AT91_ID_MCI, | ||
248 | .end = AT91_ID_MCI, | ||
249 | .flags = IORESOURCE_IRQ, | ||
250 | }, | ||
232 | }; | 251 | }; |
233 | 252 | ||
234 | static struct platform_device at91rm9200_mmc_device = { | 253 | static struct platform_device at91rm9200_mmc_device = { |
235 | .name = "at91rm9200_mci", | 254 | .name = "at91_mci", |
236 | .id = -1, | 255 | .id = -1, |
237 | .dev = { | 256 | .dev = { |
238 | .dma_mask = &mmc_dmamask, | 257 | .dma_mask = &mmc_dmamask, |
@@ -291,6 +310,106 @@ void __init at91_add_device_mmc(struct at91_mmc_data *data) {} | |||
291 | #endif | 310 | #endif |
292 | 311 | ||
293 | /* -------------------------------------------------------------------- | 312 | /* -------------------------------------------------------------------- |
313 | * NAND / SmartMedia | ||
314 | * -------------------------------------------------------------------- */ | ||
315 | |||
316 | #if defined(CONFIG_MTD_NAND_AT91) || defined(CONFIG_MTD_NAND_AT91_MODULE) | ||
317 | static struct at91_nand_data nand_data; | ||
318 | |||
319 | static struct resource at91_nand_resources[] = { | ||
320 | { | ||
321 | .start = AT91_SMARTMEDIA_BASE, | ||
322 | .end = AT91_SMARTMEDIA_BASE + SZ_8M - 1, | ||
323 | .flags = IORESOURCE_MEM, | ||
324 | } | ||
325 | }; | ||
326 | |||
327 | static struct platform_device at91_nand_device = { | ||
328 | .name = "at91_nand", | ||
329 | .id = -1, | ||
330 | .dev = { | ||
331 | .platform_data = &nand_data, | ||
332 | }, | ||
333 | .resource = at91_nand_resources, | ||
334 | .num_resources = ARRAY_SIZE(at91_nand_resources), | ||
335 | }; | ||
336 | |||
337 | void __init at91_add_device_nand(struct at91_nand_data *data) | ||
338 | { | ||
339 | if (!data) | ||
340 | return; | ||
341 | |||
342 | /* enable pin */ | ||
343 | if (data->enable_pin) | ||
344 | at91_set_gpio_output(data->enable_pin, 1); | ||
345 | |||
346 | /* ready/busy pin */ | ||
347 | if (data->rdy_pin) | ||
348 | at91_set_gpio_input(data->rdy_pin, 1); | ||
349 | |||
350 | /* card detect pin */ | ||
351 | if (data->det_pin) | ||
352 | at91_set_gpio_input(data->det_pin, 1); | ||
353 | |||
354 | at91_set_A_periph(AT91_PIN_PC1, 0); /* SMOE */ | ||
355 | at91_set_A_periph(AT91_PIN_PC3, 0); /* SMWE */ | ||
356 | |||
357 | nand_data = *data; | ||
358 | platform_device_register(&at91_nand_device); | ||
359 | } | ||
360 | #else | ||
361 | void __init at91_add_device_nand(struct at91_nand_data *data) {} | ||
362 | #endif | ||
363 | |||
364 | |||
365 | /* -------------------------------------------------------------------- | ||
366 | * TWI (i2c) | ||
367 | * -------------------------------------------------------------------- */ | ||
368 | |||
369 | #if defined(CONFIG_I2C_AT91) || defined(CONFIG_I2C_AT91_MODULE) | ||
370 | static struct platform_device at91rm9200_twi_device = { | ||
371 | .name = "at91_i2c", | ||
372 | .id = -1, | ||
373 | .num_resources = 0, | ||
374 | }; | ||
375 | |||
376 | void __init at91_add_device_i2c(void) | ||
377 | { | ||
378 | /* pins used for TWI interface */ | ||
379 | at91_set_A_periph(AT91_PIN_PA25, 0); /* TWD */ | ||
380 | at91_set_multi_drive(AT91_PIN_PA25, 1); | ||
381 | |||
382 | at91_set_A_periph(AT91_PIN_PA26, 0); /* TWCK */ | ||
383 | at91_set_multi_drive(AT91_PIN_PA26, 1); | ||
384 | |||
385 | platform_device_register(&at91rm9200_twi_device); | ||
386 | } | ||
387 | #else | ||
388 | void __init at91_add_device_i2c(void) {} | ||
389 | #endif | ||
390 | |||
391 | |||
392 | /* -------------------------------------------------------------------- | ||
393 | * RTC | ||
394 | * -------------------------------------------------------------------- */ | ||
395 | |||
396 | #if defined(CONFIG_AT91_RTC) || defined(CONFIG_AT91_RTC_MODULE) | ||
397 | static struct platform_device at91rm9200_rtc_device = { | ||
398 | .name = "at91_rtc", | ||
399 | .id = -1, | ||
400 | .num_resources = 0, | ||
401 | }; | ||
402 | |||
403 | void __init at91_add_device_rtc(void) | ||
404 | { | ||
405 | platform_device_register(&at91rm9200_rtc_device); | ||
406 | } | ||
407 | #else | ||
408 | void __init at91_add_device_rtc(void) {} | ||
409 | #endif | ||
410 | |||
411 | |||
412 | /* -------------------------------------------------------------------- | ||
294 | * LEDs | 413 | * LEDs |
295 | * -------------------------------------------------------------------- */ | 414 | * -------------------------------------------------------------------- */ |
296 | 415 | ||