board-flexibity.c 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. /*
  2. * linux/arch/arm/mach-at91/board-flexibity.c
  3. *
  4. * Copyright (C) 2010 Flexibity
  5. * Copyright (C) 2005 SAN People
  6. * Copyright (C) 2006 Atmel
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  21. */
  22. #include <linux/init.h>
  23. #include <linux/platform_device.h>
  24. #include <linux/spi/spi.h>
  25. #include <linux/input.h>
  26. #include <linux/gpio.h>
  27. #include <asm/mach-types.h>
  28. #include <asm/mach/arch.h>
  29. #include <asm/mach/map.h>
  30. #include <asm/mach/irq.h>
  31. #include <mach/hardware.h>
  32. #include <mach/board.h>
  33. #include "generic.h"
  34. static void __init flexibity_map_io(void)
  35. {
  36. /* Initialize processor: 18.432 MHz crystal */
  37. at91sam9260_initialize(18432000);
  38. /* DBGU on ttyS0. (Rx & Tx only) */
  39. at91_register_uart(0, 0, 0);
  40. /* set serial console to ttyS0 (ie, DBGU) */
  41. at91_set_serial_console(0);
  42. }
  43. static void __init flexibity_init_irq(void)
  44. {
  45. at91sam9260_init_interrupts(NULL);
  46. }
  47. /* USB Host port */
  48. static struct at91_usbh_data __initdata flexibity_usbh_data = {
  49. .ports = 2,
  50. };
  51. /* USB Device port */
  52. static struct at91_udc_data __initdata flexibity_udc_data = {
  53. .vbus_pin = AT91_PIN_PC5,
  54. .pullup_pin = 0, /* pull-up driven by UDC */
  55. };
  56. /* SPI devices */
  57. static struct spi_board_info flexibity_spi_devices[] = {
  58. { /* DataFlash chip */
  59. .modalias = "mtd_dataflash",
  60. .chip_select = 1,
  61. .max_speed_hz = 15 * 1000 * 1000,
  62. .bus_num = 0,
  63. },
  64. };
  65. /* MCI (SD/MMC) */
  66. static struct at91_mmc_data __initdata flexibity_mmc_data = {
  67. .slot_b = 0,
  68. .wire4 = 1,
  69. .det_pin = AT91_PIN_PC9,
  70. .wp_pin = AT91_PIN_PC4,
  71. };
  72. /* LEDs */
  73. static struct gpio_led flexibity_leds[] = {
  74. {
  75. .name = "usb1:green",
  76. .gpio = AT91_PIN_PA12,
  77. .active_low = 1,
  78. .default_trigger = "default-on",
  79. },
  80. {
  81. .name = "usb1:red",
  82. .gpio = AT91_PIN_PA13,
  83. .active_low = 1,
  84. .default_trigger = "default-on",
  85. },
  86. {
  87. .name = "usb2:green",
  88. .gpio = AT91_PIN_PB26,
  89. .active_low = 1,
  90. .default_trigger = "default-on",
  91. },
  92. {
  93. .name = "usb2:red",
  94. .gpio = AT91_PIN_PB27,
  95. .active_low = 1,
  96. .default_trigger = "default-on",
  97. },
  98. {
  99. .name = "usb3:green",
  100. .gpio = AT91_PIN_PC8,
  101. .active_low = 1,
  102. .default_trigger = "default-on",
  103. },
  104. {
  105. .name = "usb3:red",
  106. .gpio = AT91_PIN_PC6,
  107. .active_low = 1,
  108. .default_trigger = "default-on",
  109. },
  110. {
  111. .name = "usb4:green",
  112. .gpio = AT91_PIN_PB4,
  113. .active_low = 1,
  114. .default_trigger = "default-on",
  115. },
  116. {
  117. .name = "usb4:red",
  118. .gpio = AT91_PIN_PB5,
  119. .active_low = 1,
  120. .default_trigger = "default-on",
  121. }
  122. };
  123. static void __init flexibity_board_init(void)
  124. {
  125. /* Serial */
  126. at91_add_device_serial();
  127. /* USB Host */
  128. at91_add_device_usbh(&flexibity_usbh_data);
  129. /* USB Device */
  130. at91_add_device_udc(&flexibity_udc_data);
  131. /* SPI */
  132. at91_add_device_spi(flexibity_spi_devices,
  133. ARRAY_SIZE(flexibity_spi_devices));
  134. /* MMC */
  135. at91_add_device_mmc(0, &flexibity_mmc_data);
  136. /* LEDs */
  137. at91_gpio_leds(flexibity_leds, ARRAY_SIZE(flexibity_leds));
  138. }
  139. MACHINE_START(FLEXIBITY, "Flexibity Connect")
  140. /* Maintainer: Maxim Osipov */
  141. .boot_params = AT91_SDRAM_BASE + 0x100,
  142. .timer = &at91sam926x_timer,
  143. .map_io = flexibity_map_io,
  144. .init_irq = flexibity_init_irq,
  145. .init_machine = flexibity_board_init,
  146. MACHINE_END