Merge tag 'pm+acpi-3.11-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael...
[deliverable/linux.git] / arch / arm / mach-imx / mach-mx1ads.c
CommitLineData
cfca8b53 1/*
95c00464 2 * arch/arm/mach-imx/mach-mx1ads.c
cfca8b53
PZ
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
5b68421f
SH
15#include <linux/i2c.h>
16#include <linux/i2c/pcf857x.h>
cfca8b53 17#include <linux/init.h>
5b68421f 18#include <linux/kernel.h>
cfca8b53
PZ
19#include <linux/platform_device.h>
20#include <linux/mtd/physmap.h>
21
22#include <asm/mach-types.h>
23#include <asm/mach/arch.h>
24#include <asm/mach/time.h>
25
e3372474 26#include "common.h"
6348e6b5 27#include "devices-imx1.h"
50f2de61 28#include "hardware.h"
267dd34c 29#include "iomux-mx1.h"
cfca8b53 30
6c80ee51 31static const int mx1ads_pins[] __initconst = {
5ae07daa 32 /* UART1 */
cfca8b53
PZ
33 PC9_PF_UART1_CTS,
34 PC10_PF_UART1_RTS,
35 PC11_PF_UART1_TXD,
36 PC12_PF_UART1_RXD,
5ae07daa 37 /* UART2 */
cfca8b53
PZ
38 PB28_PF_UART2_CTS,
39 PB29_PF_UART2_RTS,
40 PB30_PF_UART2_TXD,
41 PB31_PF_UART2_RXD,
5ae07daa
SH
42 /* I2C */
43 PA15_PF_I2C_SDA,
44 PA16_PF_I2C_SCL,
45 /* SPI */
46 PC13_PF_SPI1_SPI_RDY,
47 PC14_PF_SPI1_SCLK,
48 PC15_PF_SPI1_SS,
49 PC16_PF_SPI1_MISO,
50 PC17_PF_SPI1_MOSI,
cfca8b53
PZ
51};
52
5ae07daa
SH
53/*
54 * UARTs platform data
55 */
cfca8b53 56
d112f4e4
UKK
57static const struct imxuart_platform_data uart0_pdata __initconst = {
58 .flags = IMXUART_HAVE_RTSCTS,
59};
60
61static const struct imxuart_platform_data uart1_pdata __initconst = {
62 .flags = IMXUART_HAVE_RTSCTS,
cfca8b53
PZ
63};
64
65/*
66 * Physmap flash
67 */
68
f2f07be0 69static const struct physmap_flash_data mx1ads_flash_data __initconst = {
cfca8b53
PZ
70 .width = 4, /* bankwidth in bytes */
71};
72
f2f07be0 73static const struct resource flash_resource __initconst = {
05a3185c
UKK
74 .start = MX1_CS0_PHYS,
75 .end = MX1_CS0_PHYS + SZ_32M - 1,
cfca8b53
PZ
76 .flags = IORESOURCE_MEM,
77};
78
b8b19b0d
SH
79/*
80 * I2C
81 */
b8b19b0d
SH
82static struct pcf857x_platform_data pcf857x_data[] = {
83 {
84 .gpio_base = 4 * 32,
85 }, {
86 .gpio_base = 4 * 32 + 16,
87 }
88};
89
6348e6b5 90static const struct imxi2c_platform_data mx1ads_i2c_data __initconst = {
b8b19b0d 91 .bitrate = 100000,
b8b19b0d
SH
92};
93
94static struct i2c_board_info mx1ads_i2c_devices[] = {
95 {
cf87a6e2 96 I2C_BOARD_INFO("pcf8575", 0x22),
b8b19b0d
SH
97 .platform_data = &pcf857x_data[0],
98 }, {
cf87a6e2 99 I2C_BOARD_INFO("pcf8575", 0x24),
b8b19b0d
SH
100 .platform_data = &pcf857x_data[1],
101 },
102};
b8b19b0d 103
cfca8b53
PZ
104/*
105 * Board init
106 */
107static void __init mx1ads_init(void)
108{
b78d8e59
SG
109 imx1_soc_init();
110
5ae07daa
SH
111 mxc_gpio_setup_multiple_pins(mx1ads_pins,
112 ARRAY_SIZE(mx1ads_pins), "mx1ads");
113
cfca8b53 114 /* UART */
d112f4e4
UKK
115 imx1_add_imx_uart0(&uart0_pdata);
116 imx1_add_imx_uart1(&uart1_pdata);
cfca8b53
PZ
117
118 /* Physmap flash */
f2f07be0
UKK
119 platform_device_register_resndata(NULL, "physmap-flash", 0,
120 &flash_resource, 1,
121 &mx1ads_flash_data, sizeof(mx1ads_flash_data));
b8b19b0d
SH
122
123 /* I2C */
b8b19b0d
SH
124 i2c_register_board_info(0, mx1ads_i2c_devices,
125 ARRAY_SIZE(mx1ads_i2c_devices));
126
77a406da 127 imx1_add_imx_i2c(&mx1ads_i2c_data);
cfca8b53
PZ
128}
129
130static void __init mx1ads_timer_init(void)
131{
30c730f8 132 mx1_clocks_init(32000);
cfca8b53
PZ
133}
134
cfca8b53
PZ
135MACHINE_START(MX1ADS, "Freescale MX1ADS")
136 /* Maintainer: Sascha Hauer, Pengutronix */
dc8f1907 137 .atag_offset = 0x100,
3dac2196
UKK
138 .map_io = mx1_map_io,
139 .init_early = imx1_init_early,
140 .init_irq = mx1_init_irq,
ffa2ea3f 141 .handle_irq = imx1_handle_irq,
6bb27d73 142 .init_time = mx1ads_timer_init,
3dac2196 143 .init_machine = mx1ads_init,
65ea7884 144 .restart = mxc_restart,
cfca8b53
PZ
145MACHINE_END
146
147MACHINE_START(MXLADS, "Freescale MXLADS")
dc8f1907 148 .atag_offset = 0x100,
3dac2196
UKK
149 .map_io = mx1_map_io,
150 .init_early = imx1_init_early,
151 .init_irq = mx1_init_irq,
ffa2ea3f 152 .handle_irq = imx1_handle_irq,
6bb27d73 153 .init_time = mx1ads_timer_init,
3dac2196 154 .init_machine = mx1ads_init,
65ea7884 155 .restart = mxc_restart,
cfca8b53 156MACHINE_END
This page took 0.236004 seconds and 5 git commands to generate.