mx1ads.c 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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 <linux/platform_device.h>
  17. #include <asm/system.h>
  18. #include <asm/hardware.h>
  19. #include <asm/irq.h>
  20. #include <asm/pgtable.h>
  21. #include <asm/page.h>
  22. #include <asm/mach/map.h>
  23. #include <asm/mach-types.h>
  24. #include <asm/mach/arch.h>
  25. #include <linux/interrupt.h>
  26. #include "generic.h"
  27. #include <asm/serial.h>
  28. static struct resource mx1ads_resources[] = {
  29. [0] = {
  30. .start = IMX_CS4_VIRT,
  31. .end = IMX_CS4_VIRT + 16,
  32. .flags = IORESOURCE_MEM,
  33. },
  34. [1] = {
  35. .start = 13,
  36. .end = 13,
  37. .flags = IORESOURCE_IRQ,
  38. },
  39. };
  40. static struct platform_device mx1ads_device = {
  41. .name = "mx1ads",
  42. .num_resources = ARRAY_SIZE(mx1ads_resources),
  43. .resource = mx1ads_resources,
  44. };
  45. static struct platform_device *devices[] __initdata = {
  46. &mx1ads_device,
  47. };
  48. static void __init
  49. mx1ads_init(void)
  50. {
  51. #ifdef CONFIG_LEDS
  52. imx_gpio_mode(GPIO_PORTA | GPIO_OUT | 2);
  53. #endif
  54. platform_add_devices(devices, ARRAY_SIZE(devices));
  55. }
  56. static struct map_desc mx1ads_io_desc[] __initdata = {
  57. {
  58. .virtual = IMX_CS0_VIRT,
  59. .pfn = __phys_to_pfn(IMX_CS0_PHYS),
  60. .length = IMX_CS0_SIZE,
  61. .type = MT_DEVICE
  62. }, {
  63. .virtual = IMX_CS1_VIRT,
  64. .pfn = __phys_to_pfn(IMX_CS1_PHYS),
  65. .length = IMX_CS1_SIZE,
  66. .type = MT_DEVICE
  67. }, {
  68. .virtual = IMX_CS2_VIRT,
  69. .pfn = __phys_to_pfn(IMX_CS2_PHYS),
  70. .length = IMX_CS2_SIZE,
  71. .type = MT_DEVICE
  72. }, {
  73. .virtual = IMX_CS3_VIRT,
  74. .pfn = __phys_to_pfn(IMX_CS3_PHYS),
  75. .length = IMX_CS3_SIZE,
  76. .type = MT_DEVICE
  77. }, {
  78. .virtual = IMX_CS4_VIRT,
  79. .pfn = __phys_to_pfn(IMX_CS4_PHYS),
  80. .length = IMX_CS4_SIZE,
  81. .type = MT_DEVICE
  82. }, {
  83. .virtual = IMX_CS5_VIRT,
  84. .pfn = __phys_to_pfn(IMX_CS5_PHYS),
  85. .length = IMX_CS5_SIZE,
  86. .type = MT_DEVICE
  87. }
  88. };
  89. static void __init
  90. mx1ads_map_io(void)
  91. {
  92. imx_map_io();
  93. iotable_init(mx1ads_io_desc, ARRAY_SIZE(mx1ads_io_desc));
  94. }
  95. MACHINE_START(MX1ADS, "Motorola MX1ADS")
  96. /* Maintainer: Sascha Hauer, Pengutronix */
  97. .phys_ram = 0x08000000,
  98. .phys_io = 0x00200000,
  99. .io_pg_offst = ((0xe0200000) >> 18) & 0xfffc,
  100. .boot_params = 0x08000100,
  101. .map_io = mx1ads_map_io,
  102. .init_irq = imx_init_irq,
  103. .timer = &imx_timer,
  104. .init_machine = mx1ads_init,
  105. MACHINE_END