blob: e34d0df90aed897e606d44a4ab8f5f607bbfd25a [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
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>
Russell Kingd052d1b2005-10-29 19:07:23 +010017#include <linux/platform_device.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070018#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>
Pavel Pisad66e35f2006-04-02 16:58:38 +010028#include <asm/arch/mmc.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070029#include <linux/interrupt.h>
30#include "generic.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -070031
Sascha Hauer6a2273d2006-01-05 20:44:58 +000032static struct resource cs89x0_resources[] = {
Linus Torvalds1da177e2005-04-16 15:20:36 -070033 [0] = {
Sascha Hauer6a2273d2006-01-05 20:44:58 +000034 .start = IMX_CS4_PHYS + 0x300,
35 .end = IMX_CS4_PHYS + 0x300 + 16,
Linus Torvalds1da177e2005-04-16 15:20:36 -070036 .flags = IORESOURCE_MEM,
37 },
38 [1] = {
Sascha Hauer6a2273d2006-01-05 20:44:58 +000039 .start = IRQ_GPIOC(17),
40 .end = IRQ_GPIOC(17),
Linus Torvalds1da177e2005-04-16 15:20:36 -070041 .flags = IORESOURCE_IRQ,
42 },
43};
44
Sascha Hauer6a2273d2006-01-05 20:44:58 +000045static struct platform_device cs89x0_device = {
46 .name = "cirrus-cs89x0",
47 .num_resources = ARRAY_SIZE(cs89x0_resources),
48 .resource = cs89x0_resources,
Linus Torvalds1da177e2005-04-16 15:20:36 -070049};
50
51static struct platform_device *devices[] __initdata = {
Sascha Hauer6a2273d2006-01-05 20:44:58 +000052 &cs89x0_device,
Linus Torvalds1da177e2005-04-16 15:20:36 -070053};
54
Pavel Pisad66e35f2006-04-02 16:58:38 +010055#ifdef CONFIG_MMC_IMX
56static int mx1ads_mmc_card_present(void)
57{
58 /* MMC/SD Card Detect is PB 20 on MX1ADS V1.0.7 */
59 return (SSR(1) & (1 << 20) ? 0 : 1);
60}
61
62static struct imxmmc_platform_data mx1ads_mmc_info = {
63 .card_present = mx1ads_mmc_card_present,
64};
65#endif
66
Linus Torvalds1da177e2005-04-16 15:20:36 -070067static void __init
68mx1ads_init(void)
69{
70#ifdef CONFIG_LEDS
Sascha Hauer0a5b0aa2005-10-04 23:17:52 +010071 imx_gpio_mode(GPIO_PORTA | GPIO_OUT | 2);
Linus Torvalds1da177e2005-04-16 15:20:36 -070072#endif
Pavel Pisad66e35f2006-04-02 16:58:38 +010073#ifdef CONFIG_MMC_IMX
74 /* SD/MMC card detect */
75 imx_gpio_mode(GPIO_PORTB | GPIO_GIUS | GPIO_IN | 20);
76 imx_set_mmc_info(&mx1ads_mmc_info);
77#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070078 platform_add_devices(devices, ARRAY_SIZE(devices));
79}
80
Linus Torvalds1da177e2005-04-16 15:20:36 -070081static void __init
82mx1ads_map_io(void)
83{
84 imx_map_io();
Linus Torvalds1da177e2005-04-16 15:20:36 -070085}
86
87MACHINE_START(MX1ADS, "Motorola MX1ADS")
Russell Kinge9dea0c2005-07-03 17:38:58 +010088 /* Maintainer: Sascha Hauer, Pengutronix */
Russell Kinge9dea0c2005-07-03 17:38:58 +010089 .phys_io = 0x00200000,
90 .io_pg_offst = ((0xe0200000) >> 18) & 0xfffc,
91 .boot_params = 0x08000100,
92 .map_io = mx1ads_map_io,
93 .init_irq = imx_init_irq,
Linus Torvalds1da177e2005-04-16 15:20:36 -070094 .timer = &imx_timer,
Russell Kinge9dea0c2005-07-03 17:38:58 +010095 .init_machine = mx1ads_init,
Linus Torvalds1da177e2005-04-16 15:20:36 -070096MACHINE_END