coyote-setup.c 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. /*
  2. * arch/arm/mach-ixp4xx/coyote-setup.c
  3. *
  4. * Board setup for ADI Engineering and IXDGP425 boards
  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/irq.h>
  21. #include <asm/mach-types.h>
  22. #include <asm/mach/arch.h>
  23. #include <asm/mach/flash.h>
  24. void __init coyote_map_io(void)
  25. {
  26. ixp4xx_map_io();
  27. }
  28. static struct flash_platform_data coyote_flash_data = {
  29. .map_name = "cfi_probe",
  30. .width = 2,
  31. };
  32. static struct resource coyote_flash_resource = {
  33. .start = COYOTE_FLASH_BASE,
  34. .end = COYOTE_FLASH_BASE + COYOTE_FLASH_SIZE,
  35. .flags = IORESOURCE_MEM,
  36. };
  37. static struct platform_device coyote_flash = {
  38. .name = "IXP4XX-Flash",
  39. .id = 0,
  40. .dev = {
  41. .platform_data = &coyote_flash_data,
  42. },
  43. .num_resources = 1,
  44. .resource = &coyote_flash_resource,
  45. };
  46. static struct resource coyote_uart_resource = {
  47. .start = IXP4XX_UART2_BASE_PHYS,
  48. .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
  49. .flags = IORESOURCE_MEM,
  50. };
  51. static struct plat_serial8250_port coyote_uart_data = {
  52. .mapbase = IXP4XX_UART2_BASE_PHYS,
  53. .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
  54. .irq = IRQ_IXP4XX_UART2,
  55. .flags = UPF_BOOT_AUTOCONF,
  56. .iotype = UPIO_MEM,
  57. .regshift = 2,
  58. .uartclk = IXP4XX_UART_XTAL,
  59. };
  60. static struct platform_device coyote_uart = {
  61. .name = "serial8250",
  62. .id = 0,
  63. .dev = {
  64. .platform_data = &coyote_uart_data,
  65. },
  66. .num_resources = 1,
  67. .resource = &coyote_uart_resource,
  68. };
  69. static struct platform_device *coyote_devices[] __initdata = {
  70. &coyote_flash,
  71. &coyote_uart
  72. };
  73. static void __init coyote_init(void)
  74. {
  75. *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
  76. *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
  77. if (machine_is_ixdpg425()) {
  78. coyote_uart_data.membase =
  79. (char*)(IXP4XX_UART1_BASE_VIRT + REG_OFFSET);
  80. coyote_uart_data.mapbase = IXP4XX_UART1_BASE_PHYS;
  81. coyote_uart_data.irq = IRQ_IXP4XX_UART1;
  82. }
  83. ixp4xx_sys_init();
  84. platform_add_devices(coyote_devices, ARRAY_SIZE(coyote_devices));
  85. }
  86. #ifdef CONFIG_ARCH_ADI_COYOTE
  87. MACHINE_START(ADI_COYOTE, "ADI Engineering Coyote")
  88. MAINTAINER("MontaVista Software, Inc.")
  89. BOOT_MEM(PHYS_OFFSET, IXP4XX_PERIPHERAL_BASE_PHYS,
  90. IXP4XX_PERIPHERAL_BASE_VIRT)
  91. MAPIO(coyote_map_io)
  92. INITIRQ(ixp4xx_init_irq)
  93. .timer = &ixp4xx_timer,
  94. BOOT_PARAMS(0x0100)
  95. INIT_MACHINE(coyote_init)
  96. MACHINE_END
  97. #endif
  98. /*
  99. * IXDPG425 is identical to Coyote except for which serial port
  100. * is connected.
  101. */
  102. #ifdef CONFIG_MACH_IXDPG425
  103. MACHINE_START(IXDPG425, "Intel IXDPG425")
  104. MAINTAINER("MontaVista Software, Inc.")
  105. BOOT_MEM(PHYS_OFFSET, IXP4XX_PERIPHERAL_BASE_PHYS,
  106. IXP4XX_PERIPHERAL_BASE_VIRT)
  107. MAPIO(coyote_map_io)
  108. INITIRQ(ixp4xx_init_irq)
  109. .timer = &ixp4xx_timer,
  110. BOOT_PARAMS(0x0100)
  111. INIT_MACHINE(coyote_init)
  112. MACHINE_END
  113. #endif