gtwx5715-setup.c 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. /*
  2. * arch/arm/mach-ixp4xx/gtwx5715-setup.c
  3. *
  4. * Gemtek GTWX5715 (Linksys WRV54G) board setup
  5. *
  6. * Copyright (C) 2004 George T. Joseph
  7. * Derived from Coyote
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License
  11. * as published by the Free Software Foundation; either version 2
  12. * of the License, or (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  22. *
  23. */
  24. #include <linux/init.h>
  25. #include <linux/device.h>
  26. #include <linux/serial.h>
  27. #include <linux/tty.h>
  28. #include <linux/serial_8250.h>
  29. #include <asm/types.h>
  30. #include <asm/setup.h>
  31. #include <asm/memory.h>
  32. #include <mach/hardware.h>
  33. #include <asm/irq.h>
  34. #include <asm/mach-types.h>
  35. #include <asm/mach/arch.h>
  36. #include <asm/mach/flash.h>
  37. /* GPIO 5,6,7 and 12 are hard wired to the Kendin KS8995M Switch
  38. and operate as an SPI type interface. The details of the interface
  39. are available on Kendin/Micrel's web site. */
  40. #define GTWX5715_KSSPI_SELECT 5
  41. #define GTWX5715_KSSPI_TXD 6
  42. #define GTWX5715_KSSPI_CLOCK 7
  43. #define GTWX5715_KSSPI_RXD 12
  44. /* The "reset" button is wired to GPIO 3.
  45. The GPIO is brought "low" when the button is pushed. */
  46. #define GTWX5715_BUTTON_GPIO 3
  47. /* Board Label Front Label
  48. LED1 Power
  49. LED2 Wireless-G
  50. LED3 not populated but could be
  51. LED4 Internet
  52. LED5 - LED8 Controlled by KS8995M Switch
  53. LED9 DMZ */
  54. #define GTWX5715_LED1_GPIO 2
  55. #define GTWX5715_LED2_GPIO 9
  56. #define GTWX5715_LED3_GPIO 8
  57. #define GTWX5715_LED4_GPIO 1
  58. #define GTWX5715_LED9_GPIO 4
  59. /*
  60. * Xscale UART registers are 32 bits wide with only the least
  61. * significant 8 bits having any meaning. From a configuration
  62. * perspective, this means 2 things...
  63. *
  64. * Setting .regshift = 2 so that the standard 16550 registers
  65. * line up on every 4th byte.
  66. *
  67. * Shifting the register start virtual address +3 bytes when
  68. * compiled big-endian. Since register writes are done on a
  69. * single byte basis, if the shift isn't done the driver will
  70. * write the value into the most significant byte of the register,
  71. * which is ignored, instead of the least significant.
  72. */
  73. #ifdef __ARMEB__
  74. #define REG_OFFSET 3
  75. #else
  76. #define REG_OFFSET 0
  77. #endif
  78. /*
  79. * Only the second or "console" uart is connected on the gtwx5715.
  80. */
  81. static struct resource gtwx5715_uart_resources[] = {
  82. {
  83. .start = IXP4XX_UART2_BASE_PHYS,
  84. .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
  85. .flags = IORESOURCE_MEM,
  86. },
  87. {
  88. .start = IRQ_IXP4XX_UART2,
  89. .end = IRQ_IXP4XX_UART2,
  90. .flags = IORESOURCE_IRQ,
  91. },
  92. { },
  93. };
  94. static struct plat_serial8250_port gtwx5715_uart_platform_data[] = {
  95. {
  96. .mapbase = IXP4XX_UART2_BASE_PHYS,
  97. .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
  98. .irq = IRQ_IXP4XX_UART2,
  99. .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
  100. .iotype = UPIO_MEM,
  101. .regshift = 2,
  102. .uartclk = IXP4XX_UART_XTAL,
  103. },
  104. { },
  105. };
  106. static struct platform_device gtwx5715_uart_device = {
  107. .name = "serial8250",
  108. .id = PLAT8250_DEV_PLATFORM,
  109. .dev = {
  110. .platform_data = gtwx5715_uart_platform_data,
  111. },
  112. .num_resources = 2,
  113. .resource = gtwx5715_uart_resources,
  114. };
  115. static struct flash_platform_data gtwx5715_flash_data = {
  116. .map_name = "cfi_probe",
  117. .width = 2,
  118. };
  119. static struct resource gtwx5715_flash_resource = {
  120. .flags = IORESOURCE_MEM,
  121. };
  122. static struct platform_device gtwx5715_flash = {
  123. .name = "IXP4XX-Flash",
  124. .id = 0,
  125. .dev = {
  126. .platform_data = &gtwx5715_flash_data,
  127. },
  128. .num_resources = 1,
  129. .resource = &gtwx5715_flash_resource,
  130. };
  131. static struct platform_device *gtwx5715_devices[] __initdata = {
  132. &gtwx5715_uart_device,
  133. &gtwx5715_flash,
  134. };
  135. static void __init gtwx5715_init(void)
  136. {
  137. ixp4xx_sys_init();
  138. gtwx5715_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
  139. gtwx5715_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_8M - 1;
  140. platform_add_devices(gtwx5715_devices, ARRAY_SIZE(gtwx5715_devices));
  141. }
  142. MACHINE_START(GTWX5715, "Gemtek GTWX5715 (Linksys WRV54G)")
  143. /* Maintainer: George Joseph */
  144. .map_io = ixp4xx_map_io,
  145. .init_early = ixp4xx_init_early,
  146. .init_irq = ixp4xx_init_irq,
  147. .init_time = ixp4xx_timer_init,
  148. .atag_offset = 0x100,
  149. .init_machine = gtwx5715_init,
  150. #if defined(CONFIG_PCI)
  151. .dma_zone_size = SZ_64M,
  152. #endif
  153. .restart = ixp4xx_restart,
  154. MACHINE_END