| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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> |
| Russell King | d052d1b | 2005-10-29 19:07:23 +0100 | [diff] [blame] | 17 | #include <linux/platform_device.h> |
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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" |
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 30 | |
| Sascha Hauer | 6a2273d | 2006-01-05 20:44:58 +0000 | [diff] [blame] | 31 | static struct resource cs89x0_resources[] = { |
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 32 | [0] = { |
| Sascha Hauer | 6a2273d | 2006-01-05 20:44:58 +0000 | [diff] [blame] | 33 | .start = IMX_CS4_PHYS + 0x300, |
| 34 | .end = IMX_CS4_PHYS + 0x300 + 16, |
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 35 | .flags = IORESOURCE_MEM, |
| 36 | }, |
| 37 | [1] = { |
| Sascha Hauer | 6a2273d | 2006-01-05 20:44:58 +0000 | [diff] [blame] | 38 | .start = IRQ_GPIOC(17), |
| 39 | .end = IRQ_GPIOC(17), |
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 40 | .flags = IORESOURCE_IRQ, |
| 41 | }, |
| 42 | }; |
| 43 | |
| Sascha Hauer | 6a2273d | 2006-01-05 20:44:58 +0000 | [diff] [blame] | 44 | static struct platform_device cs89x0_device = { |
| 45 | .name = "cirrus-cs89x0", |
| 46 | .num_resources = ARRAY_SIZE(cs89x0_resources), |
| 47 | .resource = cs89x0_resources, |
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 48 | }; |
| 49 | |
| 50 | static struct platform_device *devices[] __initdata = { |
| Sascha Hauer | 6a2273d | 2006-01-05 20:44:58 +0000 | [diff] [blame] | 51 | &cs89x0_device, |
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 52 | }; |
| 53 | |
| 54 | static void __init |
| 55 | mx1ads_init(void) |
| 56 | { |
| 57 | #ifdef CONFIG_LEDS |
| Sascha Hauer | 0a5b0aa | 2005-10-04 23:17:52 +0100 | [diff] [blame] | 58 | imx_gpio_mode(GPIO_PORTA | GPIO_OUT | 2); |
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 59 | #endif |
| 60 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
| 61 | } |
| 62 | |
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 63 | static void __init |
| 64 | mx1ads_map_io(void) |
| 65 | { |
| 66 | imx_map_io(); |
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 67 | } |
| 68 | |
| 69 | MACHINE_START(MX1ADS, "Motorola MX1ADS") |
| Russell King | e9dea0c | 2005-07-03 17:38:58 +0100 | [diff] [blame] | 70 | /* Maintainer: Sascha Hauer, Pengutronix */ |
| Russell King | e9dea0c | 2005-07-03 17:38:58 +0100 | [diff] [blame] | 71 | .phys_io = 0x00200000, |
| 72 | .io_pg_offst = ((0xe0200000) >> 18) & 0xfffc, |
| 73 | .boot_params = 0x08000100, |
| 74 | .map_io = mx1ads_map_io, |
| 75 | .init_irq = imx_init_irq, |
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 76 | .timer = &imx_timer, |
| Russell King | e9dea0c | 2005-07-03 17:38:58 +0100 | [diff] [blame] | 77 | .init_machine = mx1ads_init, |
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 78 | MACHINE_END |