ixdp425-setup.c 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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. static struct platform_device ixdp425_uart = {
  91. .name = "serial8250",
  92. .id = 0,
  93. .dev.platform_data = ixdp425_uart_data,
  94. .num_resources = 2,
  95. .resource = ixdp425_uart_resources
  96. };
  97. static struct platform_device *ixdp425_devices[] __initdata = {
  98. &ixdp425_i2c_controller,
  99. &ixdp425_flash,
  100. &ixdp425_uart
  101. };
  102. static void __init ixdp425_init(void)
  103. {
  104. ixp4xx_sys_init();
  105. /*
  106. * IXP465 has 32MB window
  107. */
  108. if (machine_is_ixdp465()) {
  109. ixdp425_flash_resource.end += IXDP425_FLASH_SIZE;
  110. }
  111. platform_add_devices(ixdp425_devices, ARRAY_SIZE(ixdp425_devices));
  112. }
  113. MACHINE_START(IXDP425, "Intel IXDP425 Development Platform")
  114. MAINTAINER("MontaVista Software, Inc.")
  115. BOOT_MEM(PHYS_OFFSET, IXP4XX_PERIPHERAL_BASE_PHYS,
  116. IXP4XX_PERIPHERAL_BASE_VIRT)
  117. MAPIO(ixdp425_map_io)
  118. INITIRQ(ixp4xx_init_irq)
  119. .timer = &ixp4xx_timer,
  120. BOOT_PARAMS(0x0100)
  121. INIT_MACHINE(ixdp425_init)
  122. MACHINE_END
  123. MACHINE_START(IXDP465, "Intel IXDP465 Development Platform")
  124. MAINTAINER("MontaVista Software, Inc.")
  125. BOOT_MEM(PHYS_OFFSET, IXP4XX_PERIPHERAL_BASE_PHYS,
  126. IXP4XX_PERIPHERAL_BASE_VIRT)
  127. MAPIO(ixdp425_map_io)
  128. INITIRQ(ixp4xx_init_irq)
  129. .timer = &ixp4xx_timer,
  130. BOOT_PARAMS(0x0100)
  131. INIT_MACHINE(ixdp425_init)
  132. MACHINE_END
  133. MACHINE_START(IXCDP1100, "Intel IXCDP1100 Development Platform")
  134. MAINTAINER("MontaVista Software, Inc.")
  135. BOOT_MEM(PHYS_OFFSET, IXP4XX_PERIPHERAL_BASE_PHYS,
  136. IXP4XX_PERIPHERAL_BASE_VIRT)
  137. MAPIO(ixdp425_map_io)
  138. INITIRQ(ixp4xx_init_irq)
  139. .timer = &ixp4xx_timer,
  140. BOOT_PARAMS(0x0100)
  141. INIT_MACHINE(ixdp425_init)
  142. MACHINE_END
  143. /*
  144. * Avila is functionally equivalent to IXDP425 except that it adds
  145. * a CF IDE slot hanging off the expansion bus. When we have a
  146. * driver for IXP4xx CF IDE with driver model support we'll move
  147. * Avila to it's own setup file.
  148. */
  149. #ifdef CONFIG_ARCH_AVILA
  150. MACHINE_START(AVILA, "Gateworks Avila Network Platform")
  151. MAINTAINER("Deepak Saxena <dsaxena@plexity.net>")
  152. BOOT_MEM(PHYS_OFFSET, IXP4XX_PERIPHERAL_BASE_PHYS,
  153. IXP4XX_PERIPHERAL_BASE_VIRT)
  154. MAPIO(ixdp425_map_io)
  155. INITIRQ(ixp4xx_init_irq)
  156. .timer = &ixp4xx_timer,
  157. BOOT_PARAMS(0x0100)
  158. INIT_MACHINE(ixdp425_init)
  159. MACHINE_END
  160. #endif