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 <linux/slab.h>
  17. #include <asm/types.h>
  18. #include <asm/setup.h>
  19. #include <asm/memory.h>
  20. #include <mach/hardware.h>
  21. #include <asm/irq.h>
  22. #include <asm/mach-types.h>
  23. #include <asm/mach/arch.h>
  24. #include <asm/mach/flash.h>
  25. static struct flash_platform_data coyote_flash_data = {
  26. .map_name = "cfi_probe",
  27. .width = 2,
  28. };
  29. static struct resource coyote_flash_resource = {
  30. .flags = IORESOURCE_MEM,
  31. };
  32. static struct platform_device coyote_flash = {
  33. .name = "IXP4XX-Flash",
  34. .id = 0,
  35. .dev = {
  36. .platform_data = &coyote_flash_data,
  37. },
  38. .num_resources = 1,
  39. .resource = &coyote_flash_resource,
  40. };
  41. static struct resource coyote_uart_resource = {
  42. .start = IXP4XX_UART2_BASE_PHYS,
  43. .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
  44. .flags = IORESOURCE_MEM,
  45. };
  46. static struct plat_serial8250_port coyote_uart_data[] = {
  47. {
  48. .mapbase = IXP4XX_UART2_BASE_PHYS,
  49. .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
  50. .irq = IRQ_IXP4XX_UART2,
  51. .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
  52. .iotype = UPIO_MEM,
  53. .regshift = 2,
  54. .uartclk = IXP4XX_UART_XTAL,
  55. },
  56. { },
  57. };
  58. static struct platform_device coyote_uart = {
  59. .name = "serial8250",
  60. .id = PLAT8250_DEV_PLATFORM,
  61. .dev = {
  62. .platform_data = coyote_uart_data,
  63. },
  64. .num_resources = 1,
  65. .resource = &coyote_uart_resource,
  66. };
  67. static struct platform_device *coyote_devices[] __initdata = {
  68. &coyote_flash,
  69. &coyote_uart
  70. };
  71. static void __init coyote_init(void)
  72. {
  73. ixp4xx_sys_init();
  74. coyote_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
  75. coyote_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1;
  76. *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
  77. *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
  78. if (machine_is_ixdpg425()) {
  79. coyote_uart_data[0].membase =
  80. (char*)(IXP4XX_UART1_BASE_VIRT + REG_OFFSET);
  81. coyote_uart_data[0].mapbase = IXP4XX_UART1_BASE_PHYS;
  82. coyote_uart_data[0].irq = IRQ_IXP4XX_UART1;
  83. }
  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. .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_io = IXP4XX_PERIPHERAL_BASE_PHYS,
  106. .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
  107. .map_io = ixp4xx_map_io,
  108. .init_irq = ixp4xx_init_irq,
  109. .timer = &ixp4xx_timer,
  110. .boot_params = 0x0100,
  111. .init_machine = coyote_init,
  112. MACHINE_END
  113. #endif