21 #include <mach/board.h>
33 #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
37 static struct resource usbh_resources[] = {
54 .dma_mask = &ohci_dmamask,
56 .platform_data = &usbh_data,
58 .resource = usbh_resources,
70 for (i = 0; i < data->
ports; i++) {
87 #if defined(CONFIG_USB_AT91) || defined(CONFIG_USB_AT91_MODULE)
90 static struct resource udc_resources[] = {
107 .platform_data = &udc_data,
109 .resource = udc_resources,
118 if (gpio_is_valid(data->
vbus_pin)) {
137 #if defined(CONFIG_ARM_AT91_ETHER) || defined(CONFIG_ARM_AT91_ETHER_MODULE)
141 static struct resource eth_resources[] = {
155 .
name =
"at91_ether",
158 .dma_mask = ð_dmamask,
160 .platform_data = ð_data,
162 .resource = eth_resources,
211 #if defined(CONFIG_AT91_CF) || defined(CONFIG_AT91_CF_MODULE)
214 #define CF_BASE AT91_CHIPSELECT_4
216 static struct resource cf_resources[] = {
220 .end =
CF_BASE + (0x30000000 - 1),
229 .platform_data = &cf_data,
231 .resource = cf_resources,
264 if (gpio_is_valid(data->
irq_pin)) {
272 if (gpio_is_valid(data->
vcc_pin))
297 #if IS_ENABLED(CONFIG_MMC_ATMELMCI)
301 static struct resource mmc_resources[] = {
318 .dma_mask = &mmc_dmamask,
322 .resource = mmc_resources,
329 unsigned int slot_count = 0;
336 if (!data->
slot[i].bus_width)
340 if (gpio_is_valid(data->
slot[i].detect_pin)) {
344 if (gpio_is_valid(data->
slot[i].wp_pin))
353 if (data->
slot[i].bus_width == 4) {
365 if (data->
slot[i].bus_width == 4) {
374 "AT91: SD/MMC slot %d not available\n", i);
396 #if defined(CONFIG_MTD_NAND_ATMEL) || defined(CONFIG_MTD_NAND_ATMEL_MODULE)
399 #define NAND_BASE AT91_CHIPSELECT_3
401 static struct resource nand_resources[] = {
404 .end = NAND_BASE +
SZ_256M - 1,
410 .
name =
"atmel_nand",
413 .platform_data = &nand_data,
415 .resource = nand_resources,
443 if (gpio_is_valid(data->
rdy_pin))
447 if (gpio_is_valid(data->
det_pin))
470 #if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE)
474 .sda_is_open_drain = 1,
476 .scl_is_open_drain = 1,
483 .dev.platform_data = &
pdata,
498 #elif defined(CONFIG_I2C_AT91) || defined(CONFIG_I2C_AT91_MODULE)
500 static struct resource twi_resources[] = {
514 .
name =
"i2c-at91rm9200",
516 .resource = twi_resources,
541 #if defined(CONFIG_SPI_ATMEL) || defined(CONFIG_SPI_ATMEL_MODULE)
544 static struct resource spi_resources[] = {
561 .dma_mask = &spi_dmamask,
564 .resource = spi_resources,
573 unsigned long cs_pin;
580 for (i = 0; i < nr_devices; i++) {
581 if (devices[i].controller_data)
582 cs_pin = (
unsigned long) devices[i].controller_data;
593 devices[
i].controller_data = (
void *) cs_pin;
608 #ifdef CONFIG_ATMEL_TCLIB
610 static struct resource tcb0_resources[] = {
636 .resource = tcb0_resources,
640 static struct resource tcb1_resources[] = {
666 .resource = tcb1_resources,
670 static void __init at91_add_device_tc(
void)
676 static void __init at91_add_device_tc(
void) { }
684 #if defined(CONFIG_RTC_DRV_AT91RM9200) || defined(CONFIG_RTC_DRV_AT91RM9200_MODULE)
685 static struct resource rtc_resources[] = {
701 .resource = rtc_resources,
705 static void __init at91_add_device_rtc(
void)
710 static void __init at91_add_device_rtc(
void) {}
718 #if defined(CONFIG_AT91RM9200_WATCHDOG) || defined(CONFIG_AT91RM9200_WATCHDOG_MODULE)
725 static void __init at91_add_device_watchdog(
void)
730 static void __init at91_add_device_watchdog(
void) {}
738 #if defined(CONFIG_ATMEL_SSC) || defined(CONFIG_ATMEL_SSC_MODULE)
741 static struct resource ssc0_resources[] = {
758 .dma_mask = &ssc0_dmamask,
761 .resource = ssc0_resources,
765 static inline void configure_ssc0_pins(
unsigned pins)
783 static struct resource ssc1_resources[] = {
800 .dma_mask = &ssc1_dmamask,
803 .resource = ssc1_resources,
807 static inline void configure_ssc1_pins(
unsigned pins)
809 if (pins & ATMEL_SSC_TF)
811 if (pins & ATMEL_SSC_TK)
813 if (pins & ATMEL_SSC_TD)
815 if (pins & ATMEL_SSC_RD)
817 if (pins & ATMEL_SSC_RK)
825 static struct resource ssc2_resources[] = {
842 .dma_mask = &ssc2_dmamask,
845 .resource = ssc2_resources,
849 static inline void configure_ssc2_pins(
unsigned pins)
851 if (pins & ATMEL_SSC_TF)
853 if (pins & ATMEL_SSC_TK)
855 if (pins & ATMEL_SSC_TD)
857 if (pins & ATMEL_SSC_RD)
859 if (pins & ATMEL_SSC_RK)
881 pdev = &at91rm9200_ssc0_device;
882 configure_ssc0_pins(pins);
885 pdev = &at91rm9200_ssc1_device;
886 configure_ssc1_pins(pins);
889 pdev = &at91rm9200_ssc2_device;
890 configure_ssc2_pins(pins);
908 #if defined(CONFIG_SERIAL_ATMEL)
909 static struct resource dbgu_resources[] = {
930 .
name =
"atmel_usart",
933 .dma_mask = &dbgu_dmamask,
935 .platform_data = &dbgu_data,
937 .resource = dbgu_resources,
941 static inline void configure_dbgu_pins(
void)
947 static struct resource uart0_resources[] = {
968 .
name =
"atmel_usart",
971 .dma_mask = &uart0_dmamask,
973 .platform_data = &uart0_data,
975 .resource = uart0_resources,
979 static inline void configure_usart0_pins(
unsigned pins)
996 static struct resource uart1_resources[] = {
1017 .
name =
"atmel_usart",
1020 .dma_mask = &uart1_dmamask,
1022 .platform_data = &uart1_data,
1024 .resource = uart1_resources,
1025 .num_resources =
ARRAY_SIZE(uart1_resources),
1028 static inline void configure_usart1_pins(
unsigned pins)
1039 if (pins & ATMEL_UART_CTS)
1047 static struct resource uart2_resources[] = {
1068 .
name =
"atmel_usart",
1071 .dma_mask = &uart2_dmamask,
1073 .platform_data = &uart2_data,
1075 .resource = uart2_resources,
1076 .num_resources =
ARRAY_SIZE(uart2_resources),
1079 static inline void configure_usart2_pins(
unsigned pins)
1084 if (pins & ATMEL_UART_CTS)
1090 static struct resource uart3_resources[] = {
1111 .
name =
"atmel_usart",
1114 .dma_mask = &uart3_dmamask,
1116 .platform_data = &uart3_data,
1118 .resource = uart3_resources,
1119 .num_resources =
ARRAY_SIZE(uart3_resources),
1122 static inline void configure_usart3_pins(
unsigned pins)
1127 if (pins & ATMEL_UART_CTS)
1142 pdev = &at91rm9200_dbgu_device;
1143 configure_dbgu_pins();
1146 pdev = &at91rm9200_uart0_device;
1147 configure_usart0_pins(pins);
1150 pdev = &at91rm9200_uart1_device;
1151 configure_usart1_pins(pins);
1154 pdev = &at91rm9200_uart2_device;
1155 configure_usart2_pins(pins);
1158 pdev = &at91rm9200_uart3_device;
1159 configure_usart3_pins(pins);
1164 pdata = pdev->
dev.platform_data;
1165 pdata->
num = portnr;
1168 at91_uarts[portnr] = pdev;
1192 static int __init at91_add_standard_devices(
void)
1194 at91_add_device_rtc();
1195 at91_add_device_watchdog();
1196 at91_add_device_tc();