coyote-setup.c 3.4 KB

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