board-sam9260ek.c 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. /*
  2. * linux/arch/arm/mach-at91/board-sam9260ek.c
  3. *
  4. * Copyright (C) 2005 SAN People
  5. * Copyright (C) 2006 Atmel
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  20. */
  21. #include <linux/types.h>
  22. #include <linux/init.h>
  23. #include <linux/mm.h>
  24. #include <linux/module.h>
  25. #include <linux/platform_device.h>
  26. #include <linux/spi/spi.h>
  27. #include <asm/hardware.h>
  28. #include <asm/setup.h>
  29. #include <asm/mach-types.h>
  30. #include <asm/irq.h>
  31. #include <asm/mach/arch.h>
  32. #include <asm/mach/map.h>
  33. #include <asm/mach/irq.h>
  34. #include <asm/arch/board.h>
  35. #include <asm/arch/gpio.h>
  36. #include <asm/arch/at91sam926x_mc.h>
  37. #include "generic.h"
  38. /*
  39. * Serial port configuration.
  40. * 0 .. 5 = USART0 .. USART5
  41. * 6 = DBGU
  42. */
  43. static struct at91_uart_config __initdata ek_uart_config = {
  44. .console_tty = 0, /* ttyS0 */
  45. .nr_tty = 3,
  46. .tty_map = { 6, 0, 1, -1, -1, -1, -1 } /* ttyS0, ..., ttyS6 */
  47. };
  48. static void __init ek_map_io(void)
  49. {
  50. /* Initialize processor: 18.432 MHz crystal */
  51. at91sam9260_initialize(18432000);
  52. /* Setup the serial ports and console */
  53. at91_init_serial(&ek_uart_config);
  54. }
  55. static void __init ek_init_irq(void)
  56. {
  57. at91sam9260_init_interrupts(NULL);
  58. }
  59. /*
  60. * USB Host port
  61. */
  62. static struct at91_usbh_data __initdata ek_usbh_data = {
  63. .ports = 2,
  64. };
  65. /*
  66. * USB Device port
  67. */
  68. static struct at91_udc_data __initdata ek_udc_data = {
  69. .vbus_pin = AT91_PIN_PC5,
  70. .pullup_pin = 0, /* pull-up driven by UDC */
  71. };
  72. /*
  73. * SPI devices.
  74. */
  75. static struct spi_board_info ek_spi_devices[] = {
  76. #if !defined(CONFIG_MMC_AT91)
  77. { /* DataFlash chip */
  78. .modalias = "mtd_dataflash",
  79. .chip_select = 1,
  80. .max_speed_hz = 15 * 1000 * 1000,
  81. .bus_num = 0,
  82. },
  83. #if defined(CONFIG_MTD_AT91_DATAFLASH_CARD)
  84. { /* DataFlash card */
  85. .modalias = "mtd_dataflash",
  86. .chip_select = 0,
  87. .max_speed_hz = 15 * 1000 * 1000,
  88. .bus_num = 0,
  89. },
  90. #endif
  91. #endif
  92. #if defined(CONFIG_SND_AT73C213) || defined(CONFIG_SND_AT73C213_MODULE)
  93. { /* AT73C213 DAC */
  94. .modalias = "at73c213",
  95. .chip_select = 0,
  96. .max_speed_hz = 10 * 1000 * 1000,
  97. .bus_num = 1,
  98. },
  99. #endif
  100. };
  101. /*
  102. * MACB Ethernet device
  103. */
  104. static struct at91_eth_data __initdata ek_macb_data = {
  105. .phy_irq_pin = AT91_PIN_PA7,
  106. .is_rmii = 1,
  107. };
  108. /*
  109. * NAND flash
  110. */
  111. static struct mtd_partition __initdata ek_nand_partition[] = {
  112. {
  113. .name = "Partition 1",
  114. .offset = 0,
  115. .size = 256 * 1024,
  116. },
  117. {
  118. .name = "Partition 2",
  119. .offset = 256 * 1024,
  120. .size = MTDPART_SIZ_FULL,
  121. },
  122. };
  123. static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)
  124. {
  125. *num_partitions = ARRAY_SIZE(ek_nand_partition);
  126. return ek_nand_partition;
  127. }
  128. static struct at91_nand_data __initdata ek_nand_data = {
  129. .ale = 21,
  130. .cle = 22,
  131. // .det_pin = ... not connected
  132. .rdy_pin = AT91_PIN_PC13,
  133. .enable_pin = AT91_PIN_PC14,
  134. .partition_info = nand_partitions,
  135. #if defined(CONFIG_MTD_NAND_AT91_BUSWIDTH_16)
  136. .bus_width_16 = 1,
  137. #else
  138. .bus_width_16 = 0,
  139. #endif
  140. };
  141. /*
  142. * MCI (SD/MMC)
  143. */
  144. static struct at91_mmc_data __initdata ek_mmc_data = {
  145. .slot_b = 1,
  146. .wire4 = 1,
  147. // .det_pin = ... not connected
  148. // .wp_pin = ... not connected
  149. // .vcc_pin = ... not connected
  150. };
  151. static void __init ek_board_init(void)
  152. {
  153. /* Serial */
  154. at91_add_device_serial();
  155. /* USB Host */
  156. at91_add_device_usbh(&ek_usbh_data);
  157. /* USB Device */
  158. at91_add_device_udc(&ek_udc_data);
  159. /* SPI */
  160. at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices));
  161. /* NAND */
  162. at91_add_device_nand(&ek_nand_data);
  163. /* Ethernet */
  164. at91_add_device_eth(&ek_macb_data);
  165. /* MMC */
  166. at91_add_device_mmc(0, &ek_mmc_data);
  167. /* I2C */
  168. at91_add_device_i2c();
  169. }
  170. MACHINE_START(AT91SAM9260EK, "Atmel AT91SAM9260-EK")
  171. /* Maintainer: Atmel */
  172. .phys_io = AT91_BASE_SYS,
  173. .io_pg_offst = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
  174. .boot_params = AT91_SDRAM_BASE + 0x100,
  175. .timer = &at91sam926x_timer,
  176. .map_io = ek_map_io,
  177. .init_irq = ek_init_irq,
  178. .init_machine = ek_board_init,
  179. MACHINE_END