ixdp425-setup.c 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  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. if (cpu_is_ixp43x()) {
  105. ixdp425_uart.num_resources = 1;
  106. ixdp425_uart_data[1].flags = 0;
  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_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. #endif
  122. #ifdef CONFIG_MACH_IXDP465
  123. MACHINE_START(IXDP465, "Intel IXDP465 Development Platform")
  124. /* Maintainer: MontaVista Software, Inc. */
  125. .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
  126. .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
  127. .map_io = ixp4xx_map_io,
  128. .init_irq = ixp4xx_init_irq,
  129. .timer = &ixp4xx_timer,
  130. .boot_params = 0x0100,
  131. .init_machine = ixdp425_init,
  132. MACHINE_END
  133. #endif
  134. #ifdef CONFIG_ARCH_PRPMC1100
  135. MACHINE_START(IXCDP1100, "Intel IXCDP1100 Development Platform")
  136. /* Maintainer: MontaVista Software, Inc. */
  137. .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
  138. .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
  139. .map_io = ixp4xx_map_io,
  140. .init_irq = ixp4xx_init_irq,
  141. .timer = &ixp4xx_timer,
  142. .boot_params = 0x0100,
  143. .init_machine = ixdp425_init,
  144. MACHINE_END
  145. #endif
  146. #ifdef CONFIG_MACH_KIXRP435
  147. MACHINE_START(KIXRP435, "Intel KIXRP435 Reference Platform")
  148. /* Maintainer: MontaVista Software, Inc. */
  149. .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
  150. .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
  151. .map_io = ixp4xx_map_io,
  152. .init_irq = ixp4xx_init_irq,
  153. .timer = &ixp4xx_timer,
  154. .boot_params = 0x0100,
  155. .init_machine = ixdp425_init,
  156. MACHINE_END
  157. #endif