mx1ads.c 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. /*
  2. * arch/arm/mach-imx/mx1ads.c
  3. *
  4. * Initially based on:
  5. * linux-2.6.7-imx/arch/arm/mach-imx/scb9328.c
  6. * Copyright (c) 2004 Sascha Hauer <sascha@saschahauer.de>
  7. *
  8. * 2004 (c) MontaVista Software, Inc.
  9. *
  10. * This file is licensed under the terms of the GNU General Public
  11. * License version 2. This program is licensed "as is" without any
  12. * warranty of any kind, whether express or implied.
  13. */
  14. #include <linux/device.h>
  15. #include <linux/init.h>
  16. #include <asm/system.h>
  17. #include <asm/hardware.h>
  18. #include <asm/irq.h>
  19. #include <asm/pgtable.h>
  20. #include <asm/page.h>
  21. #include <asm/mach/map.h>
  22. #include <asm/mach-types.h>
  23. #include <asm/mach/arch.h>
  24. #include <linux/interrupt.h>
  25. #include "generic.h"
  26. #include <asm/serial.h>
  27. static struct resource mx1ads_resources[] = {
  28. [0] = {
  29. .start = IMX_CS4_VIRT,
  30. .end = IMX_CS4_VIRT + 16,
  31. .flags = IORESOURCE_MEM,
  32. },
  33. [1] = {
  34. .start = 13,
  35. .end = 13,
  36. .flags = IORESOURCE_IRQ,
  37. },
  38. };
  39. static struct platform_device mx1ads_device = {
  40. .name = "mx1ads",
  41. .num_resources = ARRAY_SIZE(mx1ads_resources),
  42. .resource = mx1ads_resources,
  43. };
  44. static struct platform_device *devices[] __initdata = {
  45. &mx1ads_device,
  46. };
  47. static void __init
  48. mx1ads_init(void)
  49. {
  50. #ifdef CONFIG_LEDS
  51. imx_gpio_mode(GPIO_PORTA | GPIO_OUT | 2);
  52. #endif
  53. platform_add_devices(devices, ARRAY_SIZE(devices));
  54. }
  55. static struct map_desc mx1ads_io_desc[] __initdata = {
  56. {
  57. .virtual = IMX_CS0_VIRT,
  58. .pfn = __phys_to_pfn(IMX_CS0_PHYS),
  59. .length = IMX_CS0_SIZE,
  60. .type = MT_DEVICE
  61. }, {
  62. .virtual = IMX_CS1_VIRT,
  63. .pfn = __phys_to_pfn(IMX_CS1_PHYS),
  64. .length = IMX_CS1_SIZE,
  65. .type = MT_DEVICE
  66. }, {
  67. .virtual = IMX_CS2_VIRT,
  68. .pfn = __phys_to_pfn(IMX_CS2_PHYS),
  69. .length = IMX_CS2_SIZE,
  70. .type = MT_DEVICE
  71. }, {
  72. .virtual = IMX_CS3_VIRT,
  73. .pfn = __phys_to_pfn(IMX_CS3_PHYS),
  74. .length = IMX_CS3_SIZE,
  75. .type = MT_DEVICE
  76. }, {
  77. .virtual = IMX_CS4_VIRT,
  78. .pfn = __phys_to_pfn(IMX_CS4_PHYS),
  79. .length = IMX_CS4_SIZE,
  80. .type = MT_DEVICE
  81. }, {
  82. .virtual = IMX_CS5_VIRT,
  83. .pfn = __phys_to_pfn(IMX_CS5_PHYS),
  84. .length = IMX_CS5_SIZE,
  85. .type = MT_DEVICE
  86. }
  87. };
  88. static void __init
  89. mx1ads_map_io(void)
  90. {
  91. imx_map_io();
  92. iotable_init(mx1ads_io_desc, ARRAY_SIZE(mx1ads_io_desc));
  93. }
  94. MACHINE_START(MX1ADS, "Motorola MX1ADS")
  95. /* Maintainer: Sascha Hauer, Pengutronix */
  96. .phys_ram = 0x08000000,
  97. .phys_io = 0x00200000,
  98. .io_pg_offst = ((0xe0200000) >> 18) & 0xfffc,
  99. .boot_params = 0x08000100,
  100. .map_io = mx1ads_map_io,
  101. .init_irq = imx_init_irq,
  102. .timer = &imx_timer,
  103. .init_machine = mx1ads_init,
  104. MACHINE_END