gateway7001-setup.c 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /*
  2. * arch/arm/mach-ixp4xx/gateway7001-setup.c
  3. *
  4. * Board setup for the Gateway 7001 board
  5. *
  6. * Copyright (C) 2007 Imre Kaloz <kaloz@openwrt.org>
  7. *
  8. * based on coyote-setup.c:
  9. * Copyright (C) 2003-2005 MontaVista Software, Inc.
  10. *
  11. * Author: Imre Kaloz <Kaloz@openwrt.org>
  12. */
  13. #include <linux/kernel.h>
  14. #include <linux/init.h>
  15. #include <linux/device.h>
  16. #include <linux/serial.h>
  17. #include <linux/tty.h>
  18. #include <linux/serial_8250.h>
  19. #include <asm/types.h>
  20. #include <asm/setup.h>
  21. #include <asm/memory.h>
  22. #include <mach/hardware.h>
  23. #include <asm/irq.h>
  24. #include <asm/mach-types.h>
  25. #include <asm/mach/arch.h>
  26. #include <asm/mach/flash.h>
  27. static struct flash_platform_data gateway7001_flash_data = {
  28. .map_name = "cfi_probe",
  29. .width = 2,
  30. };
  31. static struct resource gateway7001_flash_resource = {
  32. .flags = IORESOURCE_MEM,
  33. };
  34. static struct platform_device gateway7001_flash = {
  35. .name = "IXP4XX-Flash",
  36. .id = 0,
  37. .dev = {
  38. .platform_data = &gateway7001_flash_data,
  39. },
  40. .num_resources = 1,
  41. .resource = &gateway7001_flash_resource,
  42. };
  43. static struct resource gateway7001_uart_resource = {
  44. .start = IXP4XX_UART2_BASE_PHYS,
  45. .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
  46. .flags = IORESOURCE_MEM,
  47. };
  48. static struct plat_serial8250_port gateway7001_uart_data[] = {
  49. {
  50. .mapbase = IXP4XX_UART2_BASE_PHYS,
  51. .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
  52. .irq = IRQ_IXP4XX_UART2,
  53. .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
  54. .iotype = UPIO_MEM,
  55. .regshift = 2,
  56. .uartclk = IXP4XX_UART_XTAL,
  57. },
  58. { },
  59. };
  60. static struct platform_device gateway7001_uart = {
  61. .name = "serial8250",
  62. .id = PLAT8250_DEV_PLATFORM,
  63. .dev = {
  64. .platform_data = gateway7001_uart_data,
  65. },
  66. .num_resources = 1,
  67. .resource = &gateway7001_uart_resource,
  68. };
  69. static struct platform_device *gateway7001_devices[] __initdata = {
  70. &gateway7001_flash,
  71. &gateway7001_uart
  72. };
  73. static void __init gateway7001_init(void)
  74. {
  75. ixp4xx_sys_init();
  76. gateway7001_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
  77. gateway7001_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1;
  78. *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
  79. *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
  80. platform_add_devices(gateway7001_devices, ARRAY_SIZE(gateway7001_devices));
  81. }
  82. #ifdef CONFIG_MACH_GATEWAY7001
  83. MACHINE_START(GATEWAY7001, "Gateway 7001 AP")
  84. /* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
  85. .map_io = ixp4xx_map_io,
  86. .init_irq = ixp4xx_init_irq,
  87. .timer = &ixp4xx_timer,
  88. .boot_params = 0x0100,
  89. .init_machine = gateway7001_init,
  90. MACHINE_END
  91. #endif