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