PageRenderTime 12ms CodeModel.GetById 2ms app.highlight 8ms RepoModel.GetById 1ms app.codeStats 0ms

/arch/arm/mach-imx/mx1ads.c

https://bitbucket.org/evzijst/gittest
C | 88 lines | 64 code | 10 blank | 14 comment | 0 complexity | 73e78186cad5e28b50124d83e9e3de57 MD5 | raw file
 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 <asm/system.h>
18#include <asm/hardware.h>
19#include <asm/irq.h>
20#include <asm/pgtable.h>
21#include <asm/page.h>
22
23#include <asm/mach/map.h>
24#include <asm/mach-types.h>
25
26#include <asm/mach/arch.h>
27#include <linux/interrupt.h>
28#include "generic.h"
29#include <asm/serial.h>
30
31static struct resource mx1ads_resources[] = {
32	[0] = {
33		.start	= IMX_CS4_VIRT,
34		.end	= IMX_CS4_VIRT + 16,
35		.flags	= IORESOURCE_MEM,
36	},
37	[1] = {
38		.start	= 13,
39		.end	= 13,
40		.flags	= IORESOURCE_IRQ,
41	},
42};
43
44static struct platform_device mx1ads_device = {
45	.name		= "mx1ads",
46	.num_resources	= ARRAY_SIZE(mx1ads_resources),
47	.resource	= mx1ads_resources,
48};
49
50static struct platform_device *devices[] __initdata = {
51	&mx1ads_device,
52};
53
54static void __init
55mx1ads_init(void)
56{
57#ifdef CONFIG_LEDS
58	imx_gpio_mode(GPIO_PORTA | GPIO_OUT | GPIO_GPIO | 2);
59#endif
60	platform_add_devices(devices, ARRAY_SIZE(devices));
61}
62
63static struct map_desc mx1ads_io_desc[] __initdata = {
64	/* virtual     physical    length      type */
65	{IMX_CS0_VIRT, IMX_CS0_PHYS, IMX_CS0_SIZE, MT_DEVICE},
66	{IMX_CS1_VIRT, IMX_CS1_PHYS, IMX_CS1_SIZE, MT_DEVICE},
67	{IMX_CS2_VIRT, IMX_CS2_PHYS, IMX_CS2_SIZE, MT_DEVICE},
68	{IMX_CS3_VIRT, IMX_CS3_PHYS, IMX_CS3_SIZE, MT_DEVICE},
69	{IMX_CS4_VIRT, IMX_CS4_PHYS, IMX_CS4_SIZE, MT_DEVICE},
70	{IMX_CS5_VIRT, IMX_CS5_PHYS, IMX_CS5_SIZE, MT_DEVICE},
71};
72
73static void __init
74mx1ads_map_io(void)
75{
76	imx_map_io();
77	iotable_init(mx1ads_io_desc, ARRAY_SIZE(mx1ads_io_desc));
78}
79
80MACHINE_START(MX1ADS, "Motorola MX1ADS")
81	MAINTAINER("Sascha Hauer, Pengutronix")
82	BOOT_MEM(0x08000000, 0x00200000, 0xe0200000)
83	BOOT_PARAMS(0x08000100)
84	MAPIO(mx1ads_map_io)
85	INITIRQ(imx_init_irq)
86	.timer		= &imx_timer,
87	INIT_MACHINE(mx1ads_init)
88MACHINE_END