coyote-setup.c 3.1 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. static struct flash_platform_data coyote_flash_data = {
  25. .map_name = "cfi_probe",
  26. .width = 2,
  27. };
  28. static struct resource coyote_flash_resource = {
  29. .start = COYOTE_FLASH_BASE,
  30. .end = COYOTE_FLASH_BASE + COYOTE_FLASH_SIZE - 1,
  31. .flags = IORESOURCE_MEM,
  32. };
  33. static struct platform_device coyote_flash = {
  34. .name = "IXP4XX-Flash",
  35. .id = 0,
  36. .dev = {
  37. .platform_data = &coyote_flash_data,
  38. },
  39. .num_resources = 1,
  40. .resource = &coyote_flash_resource,
  41. };
  42. static struct resource coyote_uart_resource = {
  43. .start = IXP4XX_UART2_BASE_PHYS,
  44. .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
  45. .flags = IORESOURCE_MEM,
  46. };
  47. static struct plat_serial8250_port coyote_uart_data[] = {
  48. {
  49. .mapbase = IXP4XX_UART2_BASE_PHYS,
  50. .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
  51. .irq = IRQ_IXP4XX_UART2,
  52. .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
  53. .iotype = UPIO_MEM,
  54. .regshift = 2,
  55. .uartclk = IXP4XX_UART_XTAL,
  56. },
  57. { },
  58. };
  59. static struct platform_device coyote_uart = {
  60. .name = "serial8250",
  61. .id = PLAT8250_DEV_PLATFORM,
  62. .dev = {
  63. .platform_data = coyote_uart_data,
  64. },
  65. .num_resources = 1,
  66. .resource = &coyote_uart_resource,
  67. };
  68. static struct platform_device *coyote_devices[] __initdata = {
  69. &coyote_flash,
  70. &coyote_uart
  71. };
  72. static void __init coyote_init(void)
  73. {
  74. *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
  75. *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
  76. if (machine_is_ixdpg425()) {
  77. coyote_uart_data[0].membase =
  78. (char*)(IXP4XX_UART1_BASE_VIRT + REG_OFFSET);
  79. coyote_uart_data[0].mapbase = IXP4XX_UART1_BASE_PHYS;
  80. coyote_uart_data[0].irq = IRQ_IXP4XX_UART1;
  81. }
  82. ixp4xx_sys_init();
  83. platform_add_devices(coyote_devices, ARRAY_SIZE(coyote_devices));
  84. }
  85. #ifdef CONFIG_ARCH_ADI_COYOTE
  86. MACHINE_START(ADI_COYOTE, "ADI Engineering Coyote")
  87. /* Maintainer: MontaVista Software, Inc. */
  88. .phys_ram = PHYS_OFFSET,
  89. .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
  90. .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
  91. .map_io = ixp4xx_map_io,
  92. .init_irq = 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. .phys_ram = PHYS_OFFSET,
  106. .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
  107. .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
  108. .map_io = ixp4xx_map_io,
  109. .init_irq = ixp4xx_init_irq,
  110. .timer = &ixp4xx_timer,
  111. .boot_params = 0x0100,
  112. .init_machine = coyote_init,
  113. MACHINE_END
  114. #endif