24 #include <mach/board.h>
37 #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
41 static struct resource usbh_resources[] = {
58 .dma_mask = &ohci_dmamask,
60 .platform_data = &usbh_data,
62 .resource = usbh_resources,
74 for (i = 0; i < data->
ports; i++) {
91 #if defined(CONFIG_USB_AT91) || defined(CONFIG_USB_AT91_MODULE)
94 static struct resource udc_resources[] = {
111 .platform_data = &udc_data,
113 .resource = udc_resources,
122 if (gpio_is_valid(data->
vbus_pin)) {
140 #if IS_ENABLED(CONFIG_MMC_ATMELMCI)
144 static struct resource mmc_resources[] = {
161 .dma_mask = &mmc_dmamask,
165 .resource = mmc_resources,
174 if (data->
slot[0].bus_width) {
176 if (gpio_is_valid(data->
slot[0].detect_pin)) {
180 if (gpio_is_valid(data->
slot[0].wp_pin))
191 if (data->
slot[0].bus_width == 4) {
210 #if defined(CONFIG_MTD_NAND_ATMEL) || defined(CONFIG_MTD_NAND_ATMEL_MODULE)
213 #define NAND_BASE AT91_CHIPSELECT_3
215 static struct resource nand_resources[] = {
218 .end = NAND_BASE +
SZ_256M - 1,
224 .
name =
"atmel_nand",
227 .platform_data = &nand_data,
229 .resource = nand_resources,
248 if (gpio_is_valid(data->
rdy_pin))
252 if (gpio_is_valid(data->
det_pin))
276 #if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE)
280 .sda_is_open_drain = 1,
282 .scl_is_open_drain = 1,
289 .dev.platform_data = &
pdata,
304 #elif defined(CONFIG_I2C_AT91) || defined(CONFIG_I2C_AT91_MODULE)
306 static struct resource twi_resources[] = {
321 .resource = twi_resources,
329 at91sam9261_twi_device.
name =
"i2c-at91sam9g10";
332 at91sam9261_twi_device.
name =
"i2c-at91sam9261";
353 #if defined(CONFIG_SPI_ATMEL) || defined(CONFIG_SPI_ATMEL_MODULE)
356 static struct resource spi0_resources[] = {
373 .dma_mask = &spi_dmamask,
376 .resource = spi0_resources,
382 static struct resource spi1_resources[] = {
399 .dma_mask = &spi_dmamask,
402 .resource = spi1_resources,
411 unsigned long cs_pin;
412 short enable_spi0 = 0;
413 short enable_spi1 = 0;
416 for (i = 0; i < nr_devices; i++) {
417 if (devices[i].controller_data)
418 cs_pin = (
unsigned long) devices[i].controller_data;
419 else if (devices[i].bus_num == 0)
422 cs_pin = spi1_standard_cs[devices[
i].chip_select];
424 if (!gpio_is_valid(cs_pin))
427 if (devices[i].bus_num == 0)
436 devices[
i].controller_data = (
void *) cs_pin;
466 #if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE)
470 static struct resource lcdc_resources[] = {
481 #if defined(CONFIG_FB_INTSRAM)
491 .
name =
"atmel_lcdfb",
494 .dma_mask = &lcdc_dmamask,
496 .platform_data = &lcdc_data,
498 .resource = lcdc_resources,
508 #if defined(CONFIG_FB_ATMEL_STN)
545 struct resource *fb_res = &lcdc_resources[2];
546 size_t fb_len = resource_size(fb_res);
566 #ifdef CONFIG_ATMEL_TCLIB
568 static struct resource tcb_resources[] = {
594 .resource = tcb_resources,
598 static void __init at91_add_device_tc(
void)
603 static void __init at91_add_device_tc(
void) { }
611 static struct resource rtt_resources[] = {
626 .resource = rtt_resources,
629 #if IS_ENABLED(CONFIG_RTC_DRV_AT91SAM9)
630 static void __init at91_add_device_rtt_rtc(
void)
632 at91sam9261_rtt_device.
name =
"rtc-at91sam9";
639 4 * CONFIG_RTC_DRV_AT91SAM9_GPBR;
640 rtt_resources[1].
end = rtt_resources[1].
start + 3;
645 static void __init at91_add_device_rtt_rtc(
void)
652 static void __init at91_add_device_rtt(
void)
654 at91_add_device_rtt_rtc();
663 #if defined(CONFIG_AT91SAM9X_WATCHDOG) || defined(CONFIG_AT91SAM9X_WATCHDOG_MODULE)
664 static struct resource wdt_resources[] = {
675 .resource = wdt_resources,
679 static void __init at91_add_device_watchdog(
void)
684 static void __init at91_add_device_watchdog(
void) {}
692 #if defined(CONFIG_ATMEL_SSC) || defined(CONFIG_ATMEL_SSC_MODULE)
695 static struct resource ssc0_resources[] = {
712 .dma_mask = &ssc0_dmamask,
715 .resource = ssc0_resources,
719 static inline void configure_ssc0_pins(
unsigned pins)
737 static struct resource ssc1_resources[] = {
754 .dma_mask = &ssc1_dmamask,
757 .resource = ssc1_resources,
761 static inline void configure_ssc1_pins(
unsigned pins)
763 if (pins & ATMEL_SSC_TF)
765 if (pins & ATMEL_SSC_TK)
767 if (pins & ATMEL_SSC_TD)
769 if (pins & ATMEL_SSC_RD)
771 if (pins & ATMEL_SSC_RK)
779 static struct resource ssc2_resources[] = {
796 .dma_mask = &ssc2_dmamask,
799 .resource = ssc2_resources,
803 static inline void configure_ssc2_pins(
unsigned pins)
805 if (pins & ATMEL_SSC_TF)
807 if (pins & ATMEL_SSC_TK)
809 if (pins & ATMEL_SSC_TD)
811 if (pins & ATMEL_SSC_RD)
813 if (pins & ATMEL_SSC_RK)
835 pdev = &at91sam9261_ssc0_device;
836 configure_ssc0_pins(pins);
839 pdev = &at91sam9261_ssc1_device;
840 configure_ssc1_pins(pins);
843 pdev = &at91sam9261_ssc2_device;
844 configure_ssc2_pins(pins);
862 #if defined(CONFIG_SERIAL_ATMEL)
863 static struct resource dbgu_resources[] = {
884 .
name =
"atmel_usart",
887 .dma_mask = &dbgu_dmamask,
889 .platform_data = &dbgu_data,
891 .resource = dbgu_resources,
895 static inline void configure_dbgu_pins(
void)
901 static struct resource uart0_resources[] = {
922 .
name =
"atmel_usart",
925 .dma_mask = &uart0_dmamask,
927 .platform_data = &uart0_data,
929 .resource = uart0_resources,
933 static inline void configure_usart0_pins(
unsigned pins)
944 static struct resource uart1_resources[] = {
965 .
name =
"atmel_usart",
968 .dma_mask = &uart1_dmamask,
970 .platform_data = &uart1_data,
972 .resource = uart1_resources,
976 static inline void configure_usart1_pins(
unsigned pins)
981 if (pins & ATMEL_UART_RTS)
987 static struct resource uart2_resources[] = {
1008 .
name =
"atmel_usart",
1011 .dma_mask = &uart2_dmamask,
1013 .platform_data = &uart2_data,
1015 .resource = uart2_resources,
1016 .num_resources =
ARRAY_SIZE(uart2_resources),
1019 static inline void configure_usart2_pins(
unsigned pins)
1024 if (pins & ATMEL_UART_RTS)
1039 pdev = &at91sam9261_dbgu_device;
1040 configure_dbgu_pins();
1043 pdev = &at91sam9261_uart0_device;
1044 configure_usart0_pins(pins);
1047 pdev = &at91sam9261_uart1_device;
1048 configure_usart1_pins(pins);
1051 pdev = &at91sam9261_uart2_device;
1052 configure_usart2_pins(pins);
1057 pdata = pdev->
dev.platform_data;
1058 pdata->
num = portnr;
1061 at91_uarts[portnr] = pdev;
1085 static int __init at91_add_standard_devices(
void)
1087 at91_add_device_rtt();
1088 at91_add_device_watchdog();
1089 at91_add_device_tc();