ixdp425-setup.c 4.5 KB

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