2 * arch/arm/mach-imx/mx1ads.c
5 * linux-2.6.7-imx/arch/arm/mach-imx/scb9328.c
6 * Copyright (c) 2004 Sascha Hauer <sascha@saschahauer.de>
8 * 2004 (c) MontaVista Software, Inc.
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.
15 #include <linux/kernel.h>
16 #include <linux/init.h>
17 #include <linux/platform_device.h>
18 #include <linux/mtd/physmap.h>
19 #include <linux/i2c.h>
20 #include <linux/i2c/pcf857x.h>
22 #include <asm/mach-types.h>
23 #include <asm/mach/arch.h>
24 #include <asm/mach/time.h>
26 #include <mach/hardware.h>
27 #include <mach/common.h>
28 #include <mach/imx-uart.h>
29 #include <mach/irqs.h>
33 #include <mach/iomux.h>
39 static int mxc_uart1_pins[] = {
46 static int uart1_mxc_init(struct platform_device *pdev)
48 return mxc_gpio_setup_multiple_pins(mxc_uart1_pins,
49 ARRAY_SIZE(mxc_uart1_pins), "UART1");
52 static int uart1_mxc_exit(struct platform_device *pdev)
54 mxc_gpio_release_multiple_pins(mxc_uart1_pins,
55 ARRAY_SIZE(mxc_uart1_pins));
59 static int mxc_uart2_pins[] = {
66 static int uart2_mxc_init(struct platform_device *pdev)
68 return mxc_gpio_setup_multiple_pins(mxc_uart2_pins,
69 ARRAY_SIZE(mxc_uart2_pins), "UART2");
72 static int uart2_mxc_exit(struct platform_device *pdev)
74 mxc_gpio_release_multiple_pins(mxc_uart2_pins,
75 ARRAY_SIZE(mxc_uart2_pins));
79 static struct imxuart_platform_data uart_pdata[] = {
81 .init = uart1_mxc_init,
82 .exit = uart1_mxc_exit,
83 .flags = IMXUART_HAVE_RTSCTS,
85 .init = uart2_mxc_init,
86 .exit = uart2_mxc_exit,
87 .flags = IMXUART_HAVE_RTSCTS,
95 static struct physmap_flash_data mx1ads_flash_data = {
96 .width = 4, /* bankwidth in bytes */
99 static struct resource flash_resource = {
100 .start = IMX_CS0_PHYS,
101 .end = IMX_CS0_PHYS + SZ_32M - 1,
102 .flags = IORESOURCE_MEM,
105 static struct platform_device flash_device = {
106 .name = "physmap-flash",
108 .resource = &flash_resource,
116 #ifdef CONFIG_I2C_IMX
117 static int i2c_pins[] = {
122 static int i2c_init(struct device *dev)
124 return mxc_gpio_setup_multiple_pins(i2c_pins,
125 ARRAY_SIZE(i2c_pins), "I2C");
128 static void i2c_exit(struct device *dev)
130 mxc_gpio_release_multiple_pins(i2c_pins,
131 ARRAY_SIZE(i2c_pins));
134 static struct pcf857x_platform_data pcf857x_data[] = {
138 .gpio_base = 4 * 32 + 16,
142 static struct imxi2c_platform_data mx1ads_i2c_data = {
148 static struct i2c_board_info mx1ads_i2c_devices[] = {
150 I2C_BOARD_INFO("pcf857x", 0x22),
152 .platform_data = &pcf857x_data[0],
154 I2C_BOARD_INFO("pcf857x", 0x24),
156 .platform_data = &pcf857x_data[1],
164 static void __init mx1ads_init(void)
167 mxc_register_device(&imx_uart1_device, &uart_pdata[0]);
168 mxc_register_device(&imx_uart2_device, &uart_pdata[1]);
171 mxc_register_device(&flash_device, &mx1ads_flash_data);
174 #ifdef CONFIG_I2C_IMX
175 i2c_register_board_info(0, mx1ads_i2c_devices,
176 ARRAY_SIZE(mx1ads_i2c_devices));
178 mxc_register_device(&imx_i2c_device, &mx1ads_i2c_data);
182 static void __init mx1ads_timer_init(void)
184 mx1_clocks_init(32000);
187 struct sys_timer mx1ads_timer = {
188 .init = mx1ads_timer_init,
191 MACHINE_START(MX1ADS, "Freescale MX1ADS")
192 /* Maintainer: Sascha Hauer, Pengutronix */
193 .phys_io = IMX_IO_PHYS,
194 .io_pg_offst = (IMX_IO_BASE >> 18) & 0xfffc,
195 .boot_params = PHYS_OFFSET + 0x100,
196 .map_io = mxc_map_io,
197 .init_irq = mxc_init_irq,
198 .timer = &mx1ads_timer,
199 .init_machine = mx1ads_init,
202 MACHINE_START(MXLADS, "Freescale MXLADS")
203 .phys_io = IMX_IO_PHYS,
204 .io_pg_offst = (IMX_IO_BASE >> 18) & 0xfffc,
205 .boot_params = PHYS_OFFSET + 0x100,
206 .map_io = mxc_map_io,
207 .init_irq = mxc_init_irq,
208 .timer = &mx1ads_timer,
209 .init_machine = mx1ads_init,