2 * arch/arm/mach-at91rm9200/at91sam9260_devices.c
4 * Copyright (C) 2006 Atmel
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
12 #include <asm/mach/arch.h>
13 #include <asm/mach/map.h>
15 #include <linux/platform_device.h>
17 #include <asm/arch/board.h>
18 #include <asm/arch/gpio.h>
19 #include <asm/arch/at91sam9260.h>
20 #include <asm/arch/at91sam926x_mc.h>
24 #define SZ_512 0x00000200
25 #define SZ_256 0x00000100
26 #define SZ_16 0x00000010
28 /* --------------------------------------------------------------------
30 * -------------------------------------------------------------------- */
32 #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
33 static u64 ohci_dmamask = 0xffffffffUL;
34 static struct at91_usbh_data usbh_data;
36 static struct resource usbh_resources[] = {
38 .start = AT91SAM9260_UHP_BASE,
39 .end = AT91SAM9260_UHP_BASE + SZ_1M - 1,
40 .flags = IORESOURCE_MEM,
43 .start = AT91SAM9260_ID_UHP,
44 .end = AT91SAM9260_ID_UHP,
45 .flags = IORESOURCE_IRQ,
49 static struct platform_device at91_usbh_device = {
53 .dma_mask = &ohci_dmamask,
54 .coherent_dma_mask = 0xffffffff,
55 .platform_data = &usbh_data,
57 .resource = usbh_resources,
58 .num_resources = ARRAY_SIZE(usbh_resources),
61 void __init at91_add_device_usbh(struct at91_usbh_data *data)
67 platform_device_register(&at91_usbh_device);
70 void __init at91_add_device_usbh(struct at91_usbh_data *data) {}
74 /* --------------------------------------------------------------------
76 * -------------------------------------------------------------------- */
78 #ifdef CONFIG_USB_GADGET_AT91
79 static struct at91_udc_data udc_data;
81 static struct resource udc_resources[] = {
83 .start = AT91SAM9260_BASE_UDP,
84 .end = AT91SAM9260_BASE_UDP + SZ_16K - 1,
85 .flags = IORESOURCE_MEM,
88 .start = AT91SAM9260_ID_UDP,
89 .end = AT91SAM9260_ID_UDP,
90 .flags = IORESOURCE_IRQ,
94 static struct platform_device at91_udc_device = {
98 .platform_data = &udc_data,
100 .resource = udc_resources,
101 .num_resources = ARRAY_SIZE(udc_resources),
104 void __init at91_add_device_udc(struct at91_udc_data *data)
109 if (data->vbus_pin) {
110 at91_set_gpio_input(data->vbus_pin, 0);
111 at91_set_deglitch(data->vbus_pin, 1);
114 /* Pullup pin is handled internally by USB device peripheral */
117 platform_device_register(&at91_udc_device);
120 void __init at91_add_device_udc(struct at91_udc_data *data) {}
124 /* --------------------------------------------------------------------
126 * -------------------------------------------------------------------- */
128 #if defined(CONFIG_MACB) || defined(CONFIG_MACB_MODULE)
129 static u64 eth_dmamask = 0xffffffffUL;
130 static struct eth_platform_data eth_data;
132 static struct resource eth_resources[] = {
134 .start = AT91SAM9260_BASE_EMAC,
135 .end = AT91SAM9260_BASE_EMAC + SZ_16K - 1,
136 .flags = IORESOURCE_MEM,
139 .start = AT91SAM9260_ID_EMAC,
140 .end = AT91SAM9260_ID_EMAC,
141 .flags = IORESOURCE_IRQ,
145 static struct platform_device at91sam9260_eth_device = {
149 .dma_mask = ð_dmamask,
150 .coherent_dma_mask = 0xffffffff,
151 .platform_data = ð_data,
153 .resource = eth_resources,
154 .num_resources = ARRAY_SIZE(eth_resources),
157 void __init at91_add_device_eth(struct eth_platform_data *data)
162 if (data->phy_irq_pin) {
163 at91_set_gpio_input(data->phy_irq_pin, 0);
164 at91_set_deglitch(data->phy_irq_pin, 1);
167 /* Pins used for MII and RMII */
168 at91_set_A_periph(AT91_PIN_PA19, 0); /* ETXCK_EREFCK */
169 at91_set_A_periph(AT91_PIN_PA17, 0); /* ERXDV */
170 at91_set_A_periph(AT91_PIN_PA14, 0); /* ERX0 */
171 at91_set_A_periph(AT91_PIN_PA15, 0); /* ERX1 */
172 at91_set_A_periph(AT91_PIN_PA18, 0); /* ERXER */
173 at91_set_A_periph(AT91_PIN_PA16, 0); /* ETXEN */
174 at91_set_A_periph(AT91_PIN_PA12, 0); /* ETX0 */
175 at91_set_A_periph(AT91_PIN_PA13, 0); /* ETX1 */
176 at91_set_A_periph(AT91_PIN_PA21, 0); /* EMDIO */
177 at91_set_A_periph(AT91_PIN_PA20, 0); /* EMDC */
179 if (!data->is_rmii) {
180 at91_set_B_periph(AT91_PIN_PA28, 0); /* ECRS */
181 at91_set_B_periph(AT91_PIN_PA29, 0); /* ECOL */
182 at91_set_B_periph(AT91_PIN_PA25, 0); /* ERX2 */
183 at91_set_B_periph(AT91_PIN_PA26, 0); /* ERX3 */
184 at91_set_B_periph(AT91_PIN_PA27, 0); /* ERXCK */
185 at91_set_B_periph(AT91_PIN_PA23, 0); /* ETX2 */
186 at91_set_B_periph(AT91_PIN_PA24, 0); /* ETX3 */
187 at91_set_B_periph(AT91_PIN_PA22, 0); /* ETXER */
191 platform_device_register(&at91sam9260_eth_device);
194 void __init at91_add_device_eth(struct eth_platform_data *data) {}
198 /* --------------------------------------------------------------------
200 * -------------------------------------------------------------------- */
202 #if defined(CONFIG_MMC_AT91) || defined(CONFIG_MMC_AT91_MODULE)
203 static u64 mmc_dmamask = 0xffffffffUL;
204 static struct at91_mmc_data mmc_data;
206 static struct resource mmc_resources[] = {
208 .start = AT91SAM9260_BASE_MCI,
209 .end = AT91SAM9260_BASE_MCI + SZ_16K - 1,
210 .flags = IORESOURCE_MEM,
213 .start = AT91SAM9260_ID_MCI,
214 .end = AT91SAM9260_ID_MCI,
215 .flags = IORESOURCE_IRQ,
219 static struct platform_device at91sam9260_mmc_device = {
223 .dma_mask = &mmc_dmamask,
224 .coherent_dma_mask = 0xffffffff,
225 .platform_data = &mmc_data,
227 .resource = mmc_resources,
228 .num_resources = ARRAY_SIZE(mmc_resources),
231 void __init at91_add_device_mmc(struct at91_mmc_data *data)
238 at91_set_gpio_input(data->det_pin, 1);
239 at91_set_deglitch(data->det_pin, 1);
242 at91_set_gpio_input(data->wp_pin, 1);
244 at91_set_gpio_output(data->vcc_pin, 0);
247 at91_set_A_periph(AT91_PIN_PA8, 0);
251 at91_set_B_periph(AT91_PIN_PA1, 1);
253 /* DAT0, maybe DAT1..DAT3 */
254 at91_set_B_periph(AT91_PIN_PA0, 1);
256 at91_set_B_periph(AT91_PIN_PA5, 1);
257 at91_set_B_periph(AT91_PIN_PA4, 1);
258 at91_set_B_periph(AT91_PIN_PA3, 1);
262 at91_set_A_periph(AT91_PIN_PA7, 1);
264 /* DAT0, maybe DAT1..DAT3 */
265 at91_set_A_periph(AT91_PIN_PA6, 1);
267 at91_set_A_periph(AT91_PIN_PA9, 1);
268 at91_set_A_periph(AT91_PIN_PA10, 1);
269 at91_set_A_periph(AT91_PIN_PA11, 1);
274 platform_device_register(&at91sam9260_mmc_device);
277 void __init at91_add_device_mmc(struct at91_mmc_data *data) {}
281 /* --------------------------------------------------------------------
283 * -------------------------------------------------------------------- */
285 #if defined(CONFIG_MTD_NAND_AT91) || defined(CONFIG_MTD_NAND_AT91_MODULE)
286 static struct at91_nand_data nand_data;
288 #define NAND_BASE AT91_CHIPSELECT_3
290 static struct resource nand_resources[] = {
293 .end = NAND_BASE + SZ_8M - 1,
294 .flags = IORESOURCE_MEM,
298 static struct platform_device at91sam9260_nand_device = {
302 .platform_data = &nand_data,
304 .resource = nand_resources,
305 .num_resources = ARRAY_SIZE(nand_resources),
308 void __init at91_add_device_nand(struct at91_nand_data *data)
310 unsigned long csa, mode;
315 csa = at91_sys_read(AT91_MATRIX_EBICSA);
316 at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_CS3A_SMC);
318 /* set the bus interface characteristics */
319 at91_sys_write(AT91_SMC_SETUP(3), AT91_SMC_NWESETUP_(0) | AT91_SMC_NCS_WRSETUP_(0)
320 | AT91_SMC_NRDSETUP_(0) | AT91_SMC_NCS_RDSETUP_(0));
322 at91_sys_write(AT91_SMC_PULSE(3), AT91_SMC_NWEPULSE_(2) | AT91_SMC_NCS_WRPULSE_(5)
323 | AT91_SMC_NRDPULSE_(2) | AT91_SMC_NCS_RDPULSE_(5));
325 at91_sys_write(AT91_SMC_CYCLE(3), AT91_SMC_NWECYCLE_(7) | AT91_SMC_NRDCYCLE_(7));
327 if (data->bus_width_16)
328 mode = AT91_SMC_DBW_16;
330 mode = AT91_SMC_DBW_8;
331 at91_sys_write(AT91_SMC_MODE(3), mode | AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_TDF_(1));
334 if (data->enable_pin)
335 at91_set_gpio_output(data->enable_pin, 1);
339 at91_set_gpio_input(data->rdy_pin, 1);
341 /* card detect pin */
343 at91_set_gpio_input(data->det_pin, 1);
346 platform_device_register(&at91sam9260_nand_device);
349 void __init at91_add_device_nand(struct at91_nand_data *data) {}
353 /* --------------------------------------------------------------------
355 * -------------------------------------------------------------------- */
357 #if defined(CONFIG_I2C_AT91) || defined(CONFIG_I2C_AT91_MODULE)
359 static struct resource twi_resources[] = {
361 .start = AT91SAM9260_BASE_TWI,
362 .end = AT91SAM9260_BASE_TWI + SZ_16K - 1,
363 .flags = IORESOURCE_MEM,
366 .start = AT91SAM9260_ID_TWI,
367 .end = AT91SAM9260_ID_TWI,
368 .flags = IORESOURCE_IRQ,
372 static struct platform_device at91sam9260_twi_device = {
375 .resource = twi_resources,
376 .num_resources = ARRAY_SIZE(twi_resources),
379 void __init at91_add_device_i2c(void)
381 /* pins used for TWI interface */
382 at91_set_A_periph(AT91_PIN_PA23, 0); /* TWD */
383 at91_set_multi_drive(AT91_PIN_PA23, 1);
385 at91_set_A_periph(AT91_PIN_PA24, 0); /* TWCK */
386 at91_set_multi_drive(AT91_PIN_PA24, 1);
388 platform_device_register(&at91sam9260_twi_device);
391 void __init at91_add_device_i2c(void) {}
395 /* --------------------------------------------------------------------
397 * -------------------------------------------------------------------- */
399 #if defined(CONFIG_SPI_ATMEL) || defined(CONFIG_SPI_ATMEL_MODULE)
400 static u64 spi_dmamask = 0xffffffffUL;
402 static struct resource spi0_resources[] = {
404 .start = AT91SAM9260_BASE_SPI0,
405 .end = AT91SAM9260_BASE_SPI0 + SZ_16K - 1,
406 .flags = IORESOURCE_MEM,
409 .start = AT91SAM9260_ID_SPI0,
410 .end = AT91SAM9260_ID_SPI0,
411 .flags = IORESOURCE_IRQ,
415 static struct platform_device at91sam9260_spi0_device = {
419 .dma_mask = &spi_dmamask,
420 .coherent_dma_mask = 0xffffffff,
422 .resource = spi0_resources,
423 .num_resources = ARRAY_SIZE(spi0_resources),
426 static const unsigned spi0_standard_cs[4] = { AT91_PIN_PA3, AT91_PIN_PC11, AT91_PIN_PC16, AT91_PIN_PC17 };
428 static struct resource spi1_resources[] = {
430 .start = AT91SAM9260_BASE_SPI1,
431 .end = AT91SAM9260_BASE_SPI1 + SZ_16K - 1,
432 .flags = IORESOURCE_MEM,
435 .start = AT91SAM9260_ID_SPI1,
436 .end = AT91SAM9260_ID_SPI1,
437 .flags = IORESOURCE_IRQ,
441 static struct platform_device at91sam9260_spi1_device = {
445 .dma_mask = &spi_dmamask,
446 .coherent_dma_mask = 0xffffffff,
448 .resource = spi1_resources,
449 .num_resources = ARRAY_SIZE(spi1_resources),
452 static const unsigned spi1_standard_cs[4] = { AT91_PIN_PB3, AT91_PIN_PC5, AT91_PIN_PC4, AT91_PIN_PC3 };
454 void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)
457 unsigned long cs_pin;
458 short enable_spi0 = 0;
459 short enable_spi1 = 0;
461 /* Choose SPI chip-selects */
462 for (i = 0; i < nr_devices; i++) {
463 if (devices[i].controller_data)
464 cs_pin = (unsigned long) devices[i].controller_data;
465 else if (devices[i].bus_num == 0)
466 cs_pin = spi0_standard_cs[devices[i].chip_select];
468 cs_pin = spi1_standard_cs[devices[i].chip_select];
470 if (devices[i].bus_num == 0)
475 /* enable chip-select pin */
476 at91_set_gpio_output(cs_pin, 1);
478 /* pass chip-select pin to driver */
479 devices[i].controller_data = (void *) cs_pin;
482 spi_register_board_info(devices, nr_devices);
484 /* Configure SPI bus(es) */
486 at91_set_A_periph(AT91_PIN_PA0, 0); /* SPI0_MISO */
487 at91_set_A_periph(AT91_PIN_PA1, 0); /* SPI0_MOSI */
488 at91_set_A_periph(AT91_PIN_PA2, 0); /* SPI1_SPCK */
490 at91_clock_associate("spi0_clk", &at91sam9260_spi0_device.dev, "spi_clk");
491 platform_device_register(&at91sam9260_spi0_device);
494 at91_set_A_periph(AT91_PIN_PB0, 0); /* SPI1_MISO */
495 at91_set_A_periph(AT91_PIN_PB1, 0); /* SPI1_MOSI */
496 at91_set_A_periph(AT91_PIN_PB2, 0); /* SPI1_SPCK */
498 at91_clock_associate("spi1_clk", &at91sam9260_spi1_device.dev, "spi_clk");
499 platform_device_register(&at91sam9260_spi1_device);
503 void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices) {}
507 /* --------------------------------------------------------------------
509 * -------------------------------------------------------------------- */
511 #if defined(CONFIG_LEDS)
515 void __init at91_init_leds(u8 cpu_led, u8 timer_led)
517 at91_leds_cpu = cpu_led;
518 at91_leds_timer = timer_led;
521 void __init at91_init_leds(u8 cpu_led, u8 timer_led) {}
525 /* --------------------------------------------------------------------
527 * -------------------------------------------------------------------- */
528 #if defined(CONFIG_SERIAL_ATMEL)
529 static struct resource dbgu_resources[] = {
531 .start = AT91_VA_BASE_SYS + AT91_DBGU,
532 .end = AT91_VA_BASE_SYS + AT91_DBGU + SZ_512 - 1,
533 .flags = IORESOURCE_MEM,
536 .start = AT91_ID_SYS,
538 .flags = IORESOURCE_IRQ,
542 static struct atmel_uart_data dbgu_data = {
544 .use_dma_rx = 0, /* DBGU not capable of receive DMA */
545 .regs = (void __iomem *)(AT91_VA_BASE_SYS + AT91_DBGU),
548 static struct platform_device at91sam9260_dbgu_device = {
549 .name = "atmel_usart",
552 .platform_data = &dbgu_data,
553 .coherent_dma_mask = 0xffffffff,
555 .resource = dbgu_resources,
556 .num_resources = ARRAY_SIZE(dbgu_resources),
559 static inline void configure_dbgu_pins(void)
561 at91_set_A_periph(AT91_PIN_PB14, 0); /* DRXD */
562 at91_set_A_periph(AT91_PIN_PB15, 1); /* DTXD */
565 static struct resource uart0_resources[] = {
567 .start = AT91SAM9260_BASE_US0,
568 .end = AT91SAM9260_BASE_US0 + SZ_16K - 1,
569 .flags = IORESOURCE_MEM,
572 .start = AT91SAM9260_ID_US0,
573 .end = AT91SAM9260_ID_US0,
574 .flags = IORESOURCE_IRQ,
578 static struct atmel_uart_data uart0_data = {
583 static struct platform_device at91sam9260_uart0_device = {
584 .name = "atmel_usart",
587 .platform_data = &uart0_data,
588 .coherent_dma_mask = 0xffffffff,
590 .resource = uart0_resources,
591 .num_resources = ARRAY_SIZE(uart0_resources),
594 static inline void configure_usart0_pins(void)
596 at91_set_A_periph(AT91_PIN_PB4, 1); /* TXD0 */
597 at91_set_A_periph(AT91_PIN_PB5, 0); /* RXD0 */
598 at91_set_A_periph(AT91_PIN_PB26, 0); /* RTS0 */
599 at91_set_A_periph(AT91_PIN_PB27, 0); /* CTS0 */
600 at91_set_A_periph(AT91_PIN_PB24, 0); /* DTR0 */
601 at91_set_A_periph(AT91_PIN_PB22, 0); /* DSR0 */
602 at91_set_A_periph(AT91_PIN_PB23, 0); /* DCD0 */
603 at91_set_A_periph(AT91_PIN_PB25, 0); /* RI0 */
606 static struct resource uart1_resources[] = {
608 .start = AT91SAM9260_BASE_US1,
609 .end = AT91SAM9260_BASE_US1 + SZ_16K - 1,
610 .flags = IORESOURCE_MEM,
613 .start = AT91SAM9260_ID_US1,
614 .end = AT91SAM9260_ID_US1,
615 .flags = IORESOURCE_IRQ,
619 static struct atmel_uart_data uart1_data = {
624 static struct platform_device at91sam9260_uart1_device = {
625 .name = "atmel_usart",
628 .platform_data = &uart1_data,
629 .coherent_dma_mask = 0xffffffff,
631 .resource = uart1_resources,
632 .num_resources = ARRAY_SIZE(uart1_resources),
635 static inline void configure_usart1_pins(void)
637 at91_set_A_periph(AT91_PIN_PB6, 1); /* TXD1 */
638 at91_set_A_periph(AT91_PIN_PB7, 0); /* RXD1 */
639 at91_set_A_periph(AT91_PIN_PB28, 0); /* RTS1 */
640 at91_set_A_periph(AT91_PIN_PB29, 0); /* CTS1 */
643 static struct resource uart2_resources[] = {
645 .start = AT91SAM9260_BASE_US2,
646 .end = AT91SAM9260_BASE_US2 + SZ_16K - 1,
647 .flags = IORESOURCE_MEM,
650 .start = AT91SAM9260_ID_US2,
651 .end = AT91SAM9260_ID_US2,
652 .flags = IORESOURCE_IRQ,
656 static struct atmel_uart_data uart2_data = {
661 static struct platform_device at91sam9260_uart2_device = {
662 .name = "atmel_usart",
665 .platform_data = &uart2_data,
666 .coherent_dma_mask = 0xffffffff,
668 .resource = uart2_resources,
669 .num_resources = ARRAY_SIZE(uart2_resources),
672 static inline void configure_usart2_pins(void)
674 at91_set_A_periph(AT91_PIN_PB8, 1); /* TXD2 */
675 at91_set_A_periph(AT91_PIN_PB9, 0); /* RXD2 */
678 static struct resource uart3_resources[] = {
680 .start = AT91SAM9260_BASE_US3,
681 .end = AT91SAM9260_BASE_US3 + SZ_16K - 1,
682 .flags = IORESOURCE_MEM,
685 .start = AT91SAM9260_ID_US3,
686 .end = AT91SAM9260_ID_US3,
687 .flags = IORESOURCE_IRQ,
691 static struct atmel_uart_data uart3_data = {
696 static struct platform_device at91sam9260_uart3_device = {
697 .name = "atmel_usart",
700 .platform_data = &uart3_data,
701 .coherent_dma_mask = 0xffffffff,
703 .resource = uart3_resources,
704 .num_resources = ARRAY_SIZE(uart3_resources),
707 static inline void configure_usart3_pins(void)
709 at91_set_A_periph(AT91_PIN_PB10, 1); /* TXD3 */
710 at91_set_A_periph(AT91_PIN_PB11, 0); /* RXD3 */
713 static struct resource uart4_resources[] = {
715 .start = AT91SAM9260_BASE_US4,
716 .end = AT91SAM9260_BASE_US4 + SZ_16K - 1,
717 .flags = IORESOURCE_MEM,
720 .start = AT91SAM9260_ID_US4,
721 .end = AT91SAM9260_ID_US4,
722 .flags = IORESOURCE_IRQ,
726 static struct atmel_uart_data uart4_data = {
731 static struct platform_device at91sam9260_uart4_device = {
732 .name = "atmel_usart",
735 .platform_data = &uart4_data,
736 .coherent_dma_mask = 0xffffffff,
738 .resource = uart4_resources,
739 .num_resources = ARRAY_SIZE(uart4_resources),
742 static inline void configure_usart4_pins(void)
744 at91_set_B_periph(AT91_PIN_PA31, 1); /* TXD4 */
745 at91_set_B_periph(AT91_PIN_PA30, 0); /* RXD4 */
748 static struct resource uart5_resources[] = {
750 .start = AT91SAM9260_BASE_US5,
751 .end = AT91SAM9260_BASE_US5 + SZ_16K - 1,
752 .flags = IORESOURCE_MEM,
755 .start = AT91SAM9260_ID_US5,
756 .end = AT91SAM9260_ID_US5,
757 .flags = IORESOURCE_IRQ,
761 static struct atmel_uart_data uart5_data = {
766 static struct platform_device at91sam9260_uart5_device = {
767 .name = "atmel_usart",
770 .platform_data = &uart5_data,
771 .coherent_dma_mask = 0xffffffff,
773 .resource = uart5_resources,
774 .num_resources = ARRAY_SIZE(uart5_resources),
777 static inline void configure_usart5_pins(void)
779 at91_set_A_periph(AT91_PIN_PB12, 1); /* TXD5 */
780 at91_set_A_periph(AT91_PIN_PB13, 0); /* RXD5 */
783 struct platform_device *at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */
784 struct platform_device *atmel_default_console_device; /* the serial console device */
786 void __init at91_init_serial(struct at91_uart_config *config)
790 /* Fill in list of supported UARTs */
791 for (i = 0; i < config->nr_tty; i++) {
792 switch (config->tty_map[i]) {
794 configure_usart0_pins();
795 at91_uarts[i] = &at91sam9260_uart0_device;
796 at91_clock_associate("usart0_clk", &at91sam9260_uart0_device.dev, "usart");
799 configure_usart1_pins();
800 at91_uarts[i] = &at91sam9260_uart1_device;
801 at91_clock_associate("usart1_clk", &at91sam9260_uart1_device.dev, "usart");
804 configure_usart2_pins();
805 at91_uarts[i] = &at91sam9260_uart2_device;
806 at91_clock_associate("usart2_clk", &at91sam9260_uart2_device.dev, "usart");
809 configure_usart3_pins();
810 at91_uarts[i] = &at91sam9260_uart3_device;
811 at91_clock_associate("usart3_clk", &at91sam9260_uart3_device.dev, "usart");
814 configure_usart4_pins();
815 at91_uarts[i] = &at91sam9260_uart4_device;
816 at91_clock_associate("usart4_clk", &at91sam9260_uart4_device.dev, "usart");
819 configure_usart5_pins();
820 at91_uarts[i] = &at91sam9260_uart5_device;
821 at91_clock_associate("usart5_clk", &at91sam9260_uart5_device.dev, "usart");
824 configure_dbgu_pins();
825 at91_uarts[i] = &at91sam9260_dbgu_device;
826 at91_clock_associate("mck", &at91sam9260_dbgu_device.dev, "usart");
831 at91_uarts[i]->id = i; /* update ID number to mapped ID */
834 /* Set serial console device */
835 if (config->console_tty < ATMEL_MAX_UART)
836 atmel_default_console_device = at91_uarts[config->console_tty];
837 if (!atmel_default_console_device)
838 printk(KERN_INFO "AT91: No default serial console defined.\n");
841 void __init at91_add_device_serial(void)
845 for (i = 0; i < ATMEL_MAX_UART; i++) {
847 platform_device_register(at91_uarts[i]);
851 void __init at91_init_serial(struct at91_uart_config *config) {}
852 void __init at91_add_device_serial(void) {}
856 /* -------------------------------------------------------------------- */
858 * These devices are always present and don't need any board-specific
861 static int __init at91_add_standard_devices(void)
866 arch_initcall(at91_add_standard_devices);