board-picotux200.c 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. /*
  2. * linux/arch/arm/mach-at91/board-picotux200.c
  3. *
  4. * Copyright (C) 2005 SAN People
  5. * Copyright (C) 2007 Kleinhenz Elektronik GmbH
  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 <linux/mtd/physmap.h>
  28. #include <mach/hardware.h>
  29. #include <asm/setup.h>
  30. #include <asm/mach-types.h>
  31. #include <asm/irq.h>
  32. #include <asm/mach/arch.h>
  33. #include <asm/mach/map.h>
  34. #include <asm/mach/irq.h>
  35. #include <mach/board.h>
  36. #include <mach/gpio.h>
  37. #include <mach/at91rm9200_mc.h>
  38. #include "generic.h"
  39. /*
  40. * Serial port configuration.
  41. * 0 .. 3 = USART0 .. USART3
  42. * 4 = DBGU
  43. */
  44. static struct at91_uart_config __initdata picotux200_uart_config = {
  45. .console_tty = 0, /* ttyS0 */
  46. .nr_tty = 2,
  47. .tty_map = { 4, 1, -1, -1, -1 } /* ttyS0, ..., ttyS4 */
  48. };
  49. static void __init picotux200_map_io(void)
  50. {
  51. /* Initialize processor: 18.432 MHz crystal */
  52. at91rm9200_initialize(18432000, AT91RM9200_BGA);
  53. /* Setup the serial ports and console */
  54. at91_init_serial(&picotux200_uart_config);
  55. }
  56. static void __init picotux200_init_irq(void)
  57. {
  58. at91rm9200_init_interrupts(NULL);
  59. }
  60. static struct at91_eth_data __initdata picotux200_eth_data = {
  61. .phy_irq_pin = AT91_PIN_PC4,
  62. .is_rmii = 1,
  63. };
  64. static struct at91_usbh_data __initdata picotux200_usbh_data = {
  65. .ports = 1,
  66. };
  67. // static struct at91_udc_data __initdata picotux200_udc_data = {
  68. // .vbus_pin = AT91_PIN_PD4,
  69. // .pullup_pin = AT91_PIN_PD5,
  70. // };
  71. static struct at91_mmc_data __initdata picotux200_mmc_data = {
  72. .det_pin = AT91_PIN_PB27,
  73. .slot_b = 0,
  74. .wire4 = 1,
  75. .wp_pin = AT91_PIN_PA17,
  76. };
  77. // static struct spi_board_info picotux200_spi_devices[] = {
  78. // { /* DataFlash chip */
  79. // .modalias = "mtd_dataflash",
  80. // .chip_select = 0,
  81. // .max_speed_hz = 15 * 1000 * 1000,
  82. // },
  83. // #ifdef CONFIG_MTD_AT91_DATAFLASH_CARD
  84. // { /* DataFlash card */
  85. // .modalias = "mtd_dataflash",
  86. // .chip_select = 3,
  87. // .max_speed_hz = 15 * 1000 * 1000,
  88. // },
  89. // #endif
  90. // };
  91. #define PICOTUX200_FLASH_BASE AT91_CHIPSELECT_0
  92. #define PICOTUX200_FLASH_SIZE SZ_4M
  93. static struct physmap_flash_data picotux200_flash_data = {
  94. .width = 2,
  95. };
  96. static struct resource picotux200_flash_resource = {
  97. .start = PICOTUX200_FLASH_BASE,
  98. .end = PICOTUX200_FLASH_BASE + PICOTUX200_FLASH_SIZE - 1,
  99. .flags = IORESOURCE_MEM,
  100. };
  101. static struct platform_device picotux200_flash = {
  102. .name = "physmap-flash",
  103. .id = 0,
  104. .dev = {
  105. .platform_data = &picotux200_flash_data,
  106. },
  107. .resource = &picotux200_flash_resource,
  108. .num_resources = 1,
  109. };
  110. static void __init picotux200_board_init(void)
  111. {
  112. /* Serial */
  113. at91_add_device_serial();
  114. /* Ethernet */
  115. at91_add_device_eth(&picotux200_eth_data);
  116. /* USB Host */
  117. at91_add_device_usbh(&picotux200_usbh_data);
  118. /* USB Device */
  119. // at91_add_device_udc(&picotux200_udc_data);
  120. // at91_set_multi_drive(picotux200_udc_data.pullup_pin, 1); /* pullup_pin is connected to reset */
  121. /* I2C */
  122. at91_add_device_i2c(NULL, 0);
  123. /* SPI */
  124. // at91_add_device_spi(picotux200_spi_devices, ARRAY_SIZE(picotux200_spi_devices));
  125. #ifdef CONFIG_MTD_AT91_DATAFLASH_CARD
  126. /* DataFlash card */
  127. at91_set_gpio_output(AT91_PIN_PB22, 0);
  128. #else
  129. /* MMC */
  130. at91_set_gpio_output(AT91_PIN_PB22, 1); /* this MMC card slot can optionally use SPI signaling (CS3). */
  131. at91_add_device_mmc(0, &picotux200_mmc_data);
  132. #endif
  133. /* NOR Flash */
  134. platform_device_register(&picotux200_flash);
  135. }
  136. MACHINE_START(PICOTUX2XX, "picotux 200")
  137. /* Maintainer: Kleinhenz Elektronik GmbH */
  138. .phys_io = AT91_BASE_SYS,
  139. .io_pg_offst = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
  140. .boot_params = AT91_SDRAM_BASE + 0x100,
  141. .timer = &at91rm9200_timer,
  142. .map_io = picotux200_map_io,
  143. .init_irq = picotux200_init_irq,
  144. .init_machine = picotux200_board_init,
  145. MACHINE_END