mx1ads.c 1.7 KB
Newer Older
L
Linus Torvalds 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
/*
 * arch/arm/mach-imx/mx1ads.c
 *
 * Initially based on:
 *	linux-2.6.7-imx/arch/arm/mach-imx/scb9328.c
 *	Copyright (c) 2004 Sascha Hauer <sascha@saschahauer.de>
 *
 * 2004 (c) MontaVista Software, Inc.
 *
 * This file is licensed under the terms of the GNU General Public
 * License version 2. This program is licensed "as is" without any
 * warranty of any kind, whether express or implied.
 */

#include <linux/device.h>
#include <linux/init.h>
17
#include <linux/platform_device.h>
L
Linus Torvalds 已提交
18 19 20 21 22 23 24 25 26 27 28 29 30
#include <asm/system.h>
#include <asm/hardware.h>
#include <asm/irq.h>
#include <asm/pgtable.h>
#include <asm/page.h>

#include <asm/mach/map.h>
#include <asm/mach-types.h>

#include <asm/mach/arch.h>
#include <linux/interrupt.h>
#include "generic.h"

31
static struct resource cs89x0_resources[] = {
L
Linus Torvalds 已提交
32
	[0] = {
33 34
		.start	= IMX_CS4_PHYS + 0x300,
		.end	= IMX_CS4_PHYS + 0x300 + 16,
L
Linus Torvalds 已提交
35 36 37
		.flags	= IORESOURCE_MEM,
	},
	[1] = {
38 39
		.start	= IRQ_GPIOC(17),
		.end	= IRQ_GPIOC(17),
L
Linus Torvalds 已提交
40 41 42 43
		.flags	= IORESOURCE_IRQ,
	},
};

44 45 46 47
static struct platform_device cs89x0_device = {
	.name		= "cirrus-cs89x0",
	.num_resources	= ARRAY_SIZE(cs89x0_resources),
	.resource	= cs89x0_resources,
L
Linus Torvalds 已提交
48 49 50
};

static struct platform_device *devices[] __initdata = {
51
	&cs89x0_device,
L
Linus Torvalds 已提交
52 53 54 55 56 57
};

static void __init
mx1ads_init(void)
{
#ifdef CONFIG_LEDS
58
	imx_gpio_mode(GPIO_PORTA | GPIO_OUT | 2);
L
Linus Torvalds 已提交
59 60 61 62 63 64 65 66 67 68 69
#endif
	platform_add_devices(devices, ARRAY_SIZE(devices));
}

static void __init
mx1ads_map_io(void)
{
	imx_map_io();
}

MACHINE_START(MX1ADS, "Motorola MX1ADS")
70 71 72 73 74 75
	/* Maintainer: Sascha Hauer, Pengutronix */
	.phys_io	= 0x00200000,
	.io_pg_offst	= ((0xe0200000) >> 18) & 0xfffc,
	.boot_params	= 0x08000100,
	.map_io		= mx1ads_map_io,
	.init_irq	= imx_init_irq,
L
Linus Torvalds 已提交
76
	.timer		= &imx_timer,
77
	.init_machine	= mx1ads_init,
L
Linus Torvalds 已提交
78
MACHINE_END