board-sam9263ek.c 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. /*
  2. * linux/arch/arm/mach-at91/board-sam9263ek.c
  3. *
  4. * Copyright (C) 2005 SAN People
  5. * Copyright (C) 2007 Atmel Corporation.
  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 .. 2 = USART0 .. USART2
  41. * 3 = DBGU
  42. */
  43. static struct at91_uart_config __initdata ek_uart_config = {
  44. .console_tty = 0, /* ttyS0 */
  45. .nr_tty = 2,
  46. .tty_map = { 3, 0, -1, -1, } /* ttyS0, ..., ttyS3 */
  47. };
  48. static void __init ek_map_io(void)
  49. {
  50. /* Initialize processor: 16.367 MHz crystal */
  51. at91sam9263_initialize(16367660);
  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. at91sam9263_init_interrupts(NULL);
  58. }
  59. /*
  60. * USB Host port
  61. */
  62. static struct at91_usbh_data __initdata ek_usbh_data = {
  63. .ports = 2,
  64. .vbus_pin = { AT91_PIN_PA24, AT91_PIN_PA21 },
  65. };
  66. /*
  67. * USB Device port
  68. */
  69. static struct at91_udc_data __initdata ek_udc_data = {
  70. .vbus_pin = AT91_PIN_PA25,
  71. .pullup_pin = 0, /* pull-up driven by UDC */
  72. };
  73. /*
  74. * SPI devices.
  75. */
  76. static struct spi_board_info ek_spi_devices[] = {
  77. #if defined(CONFIG_MTD_AT91_DATAFLASH_CARD)
  78. { /* DataFlash card */
  79. .modalias = "mtd_dataflash",
  80. .chip_select = 0,
  81. .max_speed_hz = 15 * 1000 * 1000,
  82. .bus_num = 0,
  83. },
  84. #endif
  85. };
  86. /*
  87. * MCI (SD/MMC)
  88. */
  89. static struct at91_mmc_data __initdata ek_mmc_data = {
  90. .wire4 = 1,
  91. .det_pin = AT91_PIN_PE18,
  92. .wp_pin = AT91_PIN_PE19,
  93. // .vcc_pin = ... not connected
  94. };
  95. /*
  96. * NAND flash
  97. */
  98. static struct mtd_partition __initdata ek_nand_partition[] = {
  99. {
  100. .name = "Partition 1",
  101. .offset = 0,
  102. .size = 64 * 1024 * 1024,
  103. },
  104. {
  105. .name = "Partition 2",
  106. .offset = 64 * 1024 * 1024,
  107. .size = MTDPART_SIZ_FULL,
  108. },
  109. };
  110. static struct mtd_partition *nand_partitions(int size, int *num_partitions)
  111. {
  112. *num_partitions = ARRAY_SIZE(ek_nand_partition);
  113. return ek_nand_partition;
  114. }
  115. static struct at91_nand_data __initdata ek_nand_data = {
  116. .ale = 21,
  117. .cle = 22,
  118. // .det_pin = ... not connected
  119. .rdy_pin = AT91_PIN_PA22,
  120. .enable_pin = AT91_PIN_PD15,
  121. .partition_info = nand_partitions,
  122. #if defined(CONFIG_MTD_NAND_AT91_BUSWIDTH_16)
  123. .bus_width_16 = 1,
  124. #else
  125. .bus_width_16 = 0,
  126. #endif
  127. };
  128. static void __init ek_board_init(void)
  129. {
  130. /* Serial */
  131. at91_add_device_serial();
  132. /* USB Host */
  133. at91_add_device_usbh(&ek_usbh_data);
  134. /* USB Device */
  135. at91_add_device_udc(&ek_udc_data);
  136. /* SPI */
  137. at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices));
  138. /* MMC */
  139. at91_add_device_mmc(1, &ek_mmc_data);
  140. /* NAND */
  141. at91_add_device_nand(&ek_nand_data);
  142. }
  143. MACHINE_START(AT91SAM9263EK, "Atmel AT91SAM9263-EK")
  144. /* Maintainer: Atmel */
  145. .phys_io = AT91_BASE_SYS,
  146. .io_pg_offst = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
  147. .boot_params = AT91_SDRAM_BASE + 0x100,
  148. .timer = &at91sam926x_timer,
  149. .map_io = ek_map_io,
  150. .init_irq = ek_init_irq,
  151. .init_machine = ek_board_init,
  152. MACHINE_END