ixdp425-setup.c 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. /*
  2. * arch/arm/mach-ixp4xx/ixdp425-setup.c
  3. *
  4. * IXDP425/IXCDP1100 board-setup
  5. *
  6. * Copyright (C) 2003-2005 MontaVista Software, Inc.
  7. *
  8. * Author: Deepak Saxena <dsaxena@plexity.net>
  9. */
  10. #include <linux/kernel.h>
  11. #include <linux/init.h>
  12. #include <linux/device.h>
  13. #include <linux/serial.h>
  14. #include <linux/tty.h>
  15. #include <linux/serial_8250.h>
  16. #include <asm/types.h>
  17. #include <asm/setup.h>
  18. #include <asm/memory.h>
  19. #include <asm/hardware.h>
  20. #include <asm/mach-types.h>
  21. #include <asm/irq.h>
  22. #include <asm/mach/arch.h>
  23. #include <asm/mach/flash.h>
  24. static struct flash_platform_data ixdp425_flash_data = {
  25. .map_name = "cfi_probe",
  26. .width = 2,
  27. };
  28. static struct resource ixdp425_flash_resource = {
  29. .start = IXDP425_FLASH_BASE,
  30. .end = IXDP425_FLASH_BASE + IXDP425_FLASH_SIZE - 1,
  31. .flags = IORESOURCE_MEM,
  32. };
  33. static struct platform_device ixdp425_flash = {
  34. .name = "IXP4XX-Flash",
  35. .id = 0,
  36. .dev = {
  37. .platform_data = &ixdp425_flash_data,
  38. },
  39. .num_resources = 1,
  40. .resource = &ixdp425_flash_resource,
  41. };
  42. static struct ixp4xx_i2c_pins ixdp425_i2c_gpio_pins = {
  43. .sda_pin = IXDP425_SDA_PIN,
  44. .scl_pin = IXDP425_SCL_PIN,
  45. };
  46. static struct platform_device ixdp425_i2c_controller = {
  47. .name = "IXP4XX-I2C",
  48. .id = 0,
  49. .dev = {
  50. .platform_data = &ixdp425_i2c_gpio_pins,
  51. },
  52. .num_resources = 0
  53. };
  54. static struct resource ixdp425_uart_resources[] = {
  55. {
  56. .start = IXP4XX_UART1_BASE_PHYS,
  57. .end = IXP4XX_UART1_BASE_PHYS + 0x0fff,
  58. .flags = IORESOURCE_MEM
  59. },
  60. {
  61. .start = IXP4XX_UART2_BASE_PHYS,
  62. .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
  63. .flags = IORESOURCE_MEM
  64. }
  65. };
  66. static struct plat_serial8250_port ixdp425_uart_data[] = {
  67. {
  68. .mapbase = IXP4XX_UART1_BASE_PHYS,
  69. .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
  70. .irq = IRQ_IXP4XX_UART1,
  71. .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
  72. .iotype = UPIO_MEM,
  73. .regshift = 2,
  74. .uartclk = IXP4XX_UART_XTAL,
  75. },
  76. {
  77. .mapbase = IXP4XX_UART2_BASE_PHYS,
  78. .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
  79. .irq = IRQ_IXP4XX_UART1,
  80. .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
  81. .iotype = UPIO_MEM,
  82. .regshift = 2,
  83. .uartclk = IXP4XX_UART_XTAL,
  84. },
  85. { },
  86. };
  87. static struct platform_device ixdp425_uart = {
  88. .name = "serial8250",
  89. .id = PLAT8250_DEV_PLATFORM,
  90. .dev.platform_data = ixdp425_uart_data,
  91. .num_resources = 2,
  92. .resource = ixdp425_uart_resources
  93. };
  94. static struct platform_device *ixdp425_devices[] __initdata = {
  95. &ixdp425_i2c_controller,
  96. &ixdp425_flash,
  97. &ixdp425_uart
  98. };
  99. static void __init ixdp425_init(void)
  100. {
  101. ixp4xx_sys_init();
  102. /*
  103. * IXP465 has 32MB window
  104. */
  105. if (machine_is_ixdp465()) {
  106. ixdp425_flash_resource.end += IXDP425_FLASH_SIZE;
  107. }
  108. platform_add_devices(ixdp425_devices, ARRAY_SIZE(ixdp425_devices));
  109. }
  110. #ifdef CONFIG_ARCH_IXDP425
  111. MACHINE_START(IXDP425, "Intel IXDP425 Development Platform")
  112. /* Maintainer: MontaVista Software, Inc. */
  113. .phys_ram = PHYS_OFFSET,
  114. .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
  115. .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
  116. .map_io = ixp4xx_map_io,
  117. .init_irq = ixp4xx_init_irq,
  118. .timer = &ixp4xx_timer,
  119. .boot_params = 0x0100,
  120. .init_machine = ixdp425_init,
  121. MACHINE_END
  122. #endif
  123. #ifdef CONFIG_MACH_IXDP465
  124. MACHINE_START(IXDP465, "Intel IXDP465 Development Platform")
  125. /* Maintainer: MontaVista Software, Inc. */
  126. .phys_ram = PHYS_OFFSET,
  127. .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
  128. .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
  129. .map_io = ixp4xx_map_io,
  130. .init_irq = ixp4xx_init_irq,
  131. .timer = &ixp4xx_timer,
  132. .boot_params = 0x0100,
  133. .init_machine = ixdp425_init,
  134. MACHINE_END
  135. #endif
  136. #ifdef CONFIG_ARCH_PRPMC1100
  137. MACHINE_START(IXCDP1100, "Intel IXCDP1100 Development Platform")
  138. /* Maintainer: MontaVista Software, Inc. */
  139. .phys_ram = PHYS_OFFSET,
  140. .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
  141. .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
  142. .map_io = ixp4xx_map_io,
  143. .init_irq = ixp4xx_init_irq,
  144. .timer = &ixp4xx_timer,
  145. .boot_params = 0x0100,
  146. .init_machine = ixdp425_init,
  147. MACHINE_END
  148. #endif
  149. /*
  150. * Avila is functionally equivalent to IXDP425 except that it adds
  151. * a CF IDE slot hanging off the expansion bus. When we have a
  152. * driver for IXP4xx CF IDE with driver model support we'll move
  153. * Avila to it's own setup file.
  154. */
  155. #ifdef CONFIG_ARCH_AVILA
  156. MACHINE_START(AVILA, "Gateworks Avila Network Platform")
  157. /* Maintainer: Deepak Saxena <dsaxena@plexity.net> */
  158. .phys_ram = PHYS_OFFSET,
  159. .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
  160. .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
  161. .map_io = ixp4xx_map_io,
  162. .init_irq = ixp4xx_init_irq,
  163. .timer = &ixp4xx_timer,
  164. .boot_params = 0x0100,
  165. .init_machine = ixdp425_init,
  166. MACHINE_END
  167. #endif