coyote-setup.c 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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 <mach/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. #define COYOTE_IDE_BASE_PHYS IXP4XX_EXP_BUS_BASE(3)
  25. #define COYOTE_IDE_BASE_VIRT 0xFFFE1000
  26. #define COYOTE_IDE_REGION_SIZE 0x1000
  27. #define COYOTE_IDE_DATA_PORT 0xFFFE10E0
  28. #define COYOTE_IDE_CTRL_PORT 0xFFFE10FC
  29. #define COYOTE_IDE_ERROR_PORT 0xFFFE10E2
  30. #define IRQ_COYOTE_IDE IRQ_IXP4XX_GPIO5
  31. static struct flash_platform_data coyote_flash_data = {
  32. .map_name = "cfi_probe",
  33. .width = 2,
  34. };
  35. static struct resource coyote_flash_resource = {
  36. .flags = IORESOURCE_MEM,
  37. };
  38. static struct platform_device coyote_flash = {
  39. .name = "IXP4XX-Flash",
  40. .id = 0,
  41. .dev = {
  42. .platform_data = &coyote_flash_data,
  43. },
  44. .num_resources = 1,
  45. .resource = &coyote_flash_resource,
  46. };
  47. static struct resource coyote_uart_resource = {
  48. .start = IXP4XX_UART2_BASE_PHYS,
  49. .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
  50. .flags = IORESOURCE_MEM,
  51. };
  52. static struct plat_serial8250_port coyote_uart_data[] = {
  53. {
  54. .mapbase = IXP4XX_UART2_BASE_PHYS,
  55. .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
  56. .irq = IRQ_IXP4XX_UART2,
  57. .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
  58. .iotype = UPIO_MEM,
  59. .regshift = 2,
  60. .uartclk = IXP4XX_UART_XTAL,
  61. },
  62. { },
  63. };
  64. static struct platform_device coyote_uart = {
  65. .name = "serial8250",
  66. .id = PLAT8250_DEV_PLATFORM,
  67. .dev = {
  68. .platform_data = coyote_uart_data,
  69. },
  70. .num_resources = 1,
  71. .resource = &coyote_uart_resource,
  72. };
  73. static struct platform_device *coyote_devices[] __initdata = {
  74. &coyote_flash,
  75. &coyote_uart
  76. };
  77. static void __init coyote_init(void)
  78. {
  79. ixp4xx_sys_init();
  80. coyote_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
  81. coyote_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1;
  82. *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
  83. *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
  84. if (machine_is_ixdpg425()) {
  85. coyote_uart_data[0].membase =
  86. (char*)(IXP4XX_UART1_BASE_VIRT + REG_OFFSET);
  87. coyote_uart_data[0].mapbase = IXP4XX_UART1_BASE_PHYS;
  88. coyote_uart_data[0].irq = IRQ_IXP4XX_UART1;
  89. }
  90. platform_add_devices(coyote_devices, ARRAY_SIZE(coyote_devices));
  91. }
  92. #ifdef CONFIG_ARCH_ADI_COYOTE
  93. MACHINE_START(ADI_COYOTE, "ADI Engineering Coyote")
  94. /* Maintainer: MontaVista Software, Inc. */
  95. .map_io = ixp4xx_map_io,
  96. .init_early = ixp4xx_init_early,
  97. .init_irq = ixp4xx_init_irq,
  98. .init_time = ixp4xx_timer_init,
  99. .atag_offset = 0x100,
  100. .init_machine = coyote_init,
  101. #if defined(CONFIG_PCI)
  102. .dma_zone_size = SZ_64M,
  103. #endif
  104. .restart = ixp4xx_restart,
  105. MACHINE_END
  106. #endif
  107. /*
  108. * IXDPG425 is identical to Coyote except for which serial port
  109. * is connected.
  110. */
  111. #ifdef CONFIG_MACH_IXDPG425
  112. MACHINE_START(IXDPG425, "Intel IXDPG425")
  113. /* Maintainer: MontaVista Software, Inc. */
  114. .map_io = ixp4xx_map_io,
  115. .init_early = ixp4xx_init_early,
  116. .init_irq = ixp4xx_init_irq,
  117. .init_time = ixp4xx_timer_init,
  118. .atag_offset = 0x100,
  119. .init_machine = coyote_init,
  120. .restart = ixp4xx_restart,
  121. MACHINE_END
  122. #endif