ixdp425-setup.c 4.5 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. 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. MACHINE_START(IXDP425, "Intel IXDP425 Development Platform")
  111. /* Maintainer: MontaVista Software, Inc. */
  112. .phys_ram = PHYS_OFFSET,
  113. .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
  114. .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
  115. .map_io = ixp4xx_map_io,
  116. .init_irq = ixp4xx_init_irq,
  117. .timer = &ixp4xx_timer,
  118. .boot_params = 0x0100,
  119. .init_machine = ixdp425_init,
  120. MACHINE_END
  121. MACHINE_START(IXDP465, "Intel IXDP465 Development Platform")
  122. /* Maintainer: MontaVista Software, Inc. */
  123. .phys_ram = PHYS_OFFSET,
  124. .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
  125. .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
  126. .map_io = ixp4xx_map_io,
  127. .init_irq = ixp4xx_init_irq,
  128. .timer = &ixp4xx_timer,
  129. .boot_params = 0x0100,
  130. .init_machine = ixdp425_init,
  131. MACHINE_END
  132. MACHINE_START(IXCDP1100, "Intel IXCDP1100 Development Platform")
  133. /* Maintainer: MontaVista Software, Inc. */
  134. .phys_ram = PHYS_OFFSET,
  135. .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
  136. .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
  137. .map_io = ixp4xx_map_io,
  138. .init_irq = 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. .phys_ram = PHYS_OFFSET,
  153. .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
  154. .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
  155. .map_io = ixp4xx_map_io,
  156. .init_irq = ixp4xx_init_irq,
  157. .timer = &ixp4xx_timer,
  158. .boot_params = 0x0100,
  159. .init_machine = ixdp425_init,
  160. MACHINE_END
  161. #endif