ixdp425-setup.c 4.4 KB

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