coyote-setup.c 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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. {
  53. .mapbase = IXP4XX_UART2_BASE_PHYS,
  54. .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
  55. .irq = IRQ_IXP4XX_UART2,
  56. .flags = UPF_BOOT_AUTOCONF,
  57. .iotype = UPIO_MEM,
  58. .regshift = 2,
  59. .uartclk = IXP4XX_UART_XTAL,
  60. },
  61. { },
  62. };
  63. static struct platform_device coyote_uart = {
  64. .name = "serial8250",
  65. .id = 0,
  66. .dev = {
  67. .platform_data = coyote_uart_data,
  68. },
  69. .num_resources = 1,
  70. .resource = &coyote_uart_resource,
  71. };
  72. static struct platform_device *coyote_devices[] __initdata = {
  73. &coyote_flash,
  74. &coyote_uart
  75. };
  76. static void __init coyote_init(void)
  77. {
  78. *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
  79. *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
  80. if (machine_is_ixdpg425()) {
  81. coyote_uart_data[0].membase =
  82. (char*)(IXP4XX_UART1_BASE_VIRT + REG_OFFSET);
  83. coyote_uart_data[0].mapbase = IXP4XX_UART1_BASE_PHYS;
  84. coyote_uart_data[0].irq = IRQ_IXP4XX_UART1;
  85. }
  86. ixp4xx_sys_init();
  87. platform_add_devices(coyote_devices, ARRAY_SIZE(coyote_devices));
  88. }
  89. #ifdef CONFIG_ARCH_ADI_COYOTE
  90. MACHINE_START(ADI_COYOTE, "ADI Engineering Coyote")
  91. /* Maintainer: MontaVista Software, Inc. */
  92. .phys_ram = PHYS_OFFSET,
  93. .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
  94. .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
  95. .map_io = coyote_map_io,
  96. .init_irq = ixp4xx_init_irq,
  97. .timer = &ixp4xx_timer,
  98. .boot_params = 0x0100,
  99. .init_machine = coyote_init,
  100. MACHINE_END
  101. #endif
  102. /*
  103. * IXDPG425 is identical to Coyote except for which serial port
  104. * is connected.
  105. */
  106. #ifdef CONFIG_MACH_IXDPG425
  107. MACHINE_START(IXDPG425, "Intel IXDPG425")
  108. /* Maintainer: MontaVista Software, Inc. */
  109. .phys_ram = PHYS_OFFSET,
  110. .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
  111. .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
  112. .map_io = coyote_map_io,
  113. .init_irq = ixp4xx_init_irq,
  114. .timer = &ixp4xx_timer,
  115. .boot_params = 0x0100,
  116. .init_machine = coyote_init,
  117. MACHINE_END
  118. #endif