Commit | Line | Data |
---|---|---|
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 | ||
cfca8b53 | 26 | #include <mach/common.h> |
5b68421f | 27 | #include <mach/hardware.h> |
b8b19b0d | 28 | #include <mach/i2c.h> |
e835d88e | 29 | #include <mach/iomux-mx1.h> |
5b68421f SH |
30 | #include <mach/irqs.h> |
31 | ||
6348e6b5 | 32 | #include "devices-imx1.h" |
cfca8b53 | 33 | |
6c80ee51 | 34 | static const int mx1ads_pins[] __initconst = { |
5ae07daa | 35 | /* UART1 */ |
cfca8b53 PZ |
36 | PC9_PF_UART1_CTS, |
37 | PC10_PF_UART1_RTS, | |
38 | PC11_PF_UART1_TXD, | |
39 | PC12_PF_UART1_RXD, | |
5ae07daa | 40 | /* UART2 */ |
cfca8b53 PZ |
41 | PB28_PF_UART2_CTS, |
42 | PB29_PF_UART2_RTS, | |
43 | PB30_PF_UART2_TXD, | |
44 | PB31_PF_UART2_RXD, | |
5ae07daa SH |
45 | /* I2C */ |
46 | PA15_PF_I2C_SDA, | |
47 | PA16_PF_I2C_SCL, | |
48 | /* SPI */ | |
49 | PC13_PF_SPI1_SPI_RDY, | |
50 | PC14_PF_SPI1_SCLK, | |
51 | PC15_PF_SPI1_SS, | |
52 | PC16_PF_SPI1_MISO, | |
53 | PC17_PF_SPI1_MOSI, | |
cfca8b53 PZ |
54 | }; |
55 | ||
5ae07daa SH |
56 | /* |
57 | * UARTs platform data | |
58 | */ | |
cfca8b53 | 59 | |
d112f4e4 UKK |
60 | static const struct imxuart_platform_data uart0_pdata __initconst = { |
61 | .flags = IMXUART_HAVE_RTSCTS, | |
62 | }; | |
63 | ||
64 | static const struct imxuart_platform_data uart1_pdata __initconst = { | |
65 | .flags = IMXUART_HAVE_RTSCTS, | |
cfca8b53 PZ |
66 | }; |
67 | ||
68 | /* | |
69 | * Physmap flash | |
70 | */ | |
71 | ||
72 | static struct physmap_flash_data mx1ads_flash_data = { | |
73 | .width = 4, /* bankwidth in bytes */ | |
74 | }; | |
75 | ||
76 | static struct resource flash_resource = { | |
05a3185c UKK |
77 | .start = MX1_CS0_PHYS, |
78 | .end = MX1_CS0_PHYS + SZ_32M - 1, | |
cfca8b53 PZ |
79 | .flags = IORESOURCE_MEM, |
80 | }; | |
81 | ||
82 | static struct platform_device flash_device = { | |
83 | .name = "physmap-flash", | |
84 | .id = 0, | |
85 | .resource = &flash_resource, | |
86 | .num_resources = 1, | |
87 | }; | |
88 | ||
b8b19b0d SH |
89 | /* |
90 | * I2C | |
91 | */ | |
b8b19b0d SH |
92 | static struct pcf857x_platform_data pcf857x_data[] = { |
93 | { | |
94 | .gpio_base = 4 * 32, | |
95 | }, { | |
96 | .gpio_base = 4 * 32 + 16, | |
97 | } | |
98 | }; | |
99 | ||
6348e6b5 | 100 | static const struct imxi2c_platform_data mx1ads_i2c_data __initconst = { |
b8b19b0d | 101 | .bitrate = 100000, |
b8b19b0d SH |
102 | }; |
103 | ||
104 | static struct i2c_board_info mx1ads_i2c_devices[] = { | |
105 | { | |
cf87a6e2 | 106 | I2C_BOARD_INFO("pcf8575", 0x22), |
b8b19b0d SH |
107 | .platform_data = &pcf857x_data[0], |
108 | }, { | |
cf87a6e2 | 109 | I2C_BOARD_INFO("pcf8575", 0x24), |
b8b19b0d SH |
110 | .platform_data = &pcf857x_data[1], |
111 | }, | |
112 | }; | |
b8b19b0d | 113 | |
cfca8b53 PZ |
114 | /* |
115 | * Board init | |
116 | */ | |
117 | static void __init mx1ads_init(void) | |
118 | { | |
5ae07daa SH |
119 | mxc_gpio_setup_multiple_pins(mx1ads_pins, |
120 | ARRAY_SIZE(mx1ads_pins), "mx1ads"); | |
121 | ||
cfca8b53 | 122 | /* UART */ |
d112f4e4 UKK |
123 | imx1_add_imx_uart0(&uart0_pdata); |
124 | imx1_add_imx_uart1(&uart1_pdata); | |
cfca8b53 PZ |
125 | |
126 | /* Physmap flash */ | |
127 | mxc_register_device(&flash_device, &mx1ads_flash_data); | |
b8b19b0d SH |
128 | |
129 | /* I2C */ | |
b8b19b0d SH |
130 | i2c_register_board_info(0, mx1ads_i2c_devices, |
131 | ARRAY_SIZE(mx1ads_i2c_devices)); | |
132 | ||
77a406da | 133 | imx1_add_imx_i2c(&mx1ads_i2c_data); |
cfca8b53 PZ |
134 | } |
135 | ||
136 | static void __init mx1ads_timer_init(void) | |
137 | { | |
30c730f8 | 138 | mx1_clocks_init(32000); |
cfca8b53 PZ |
139 | } |
140 | ||
141 | struct sys_timer mx1ads_timer = { | |
142 | .init = mx1ads_timer_init, | |
143 | }; | |
144 | ||
145 | MACHINE_START(MX1ADS, "Freescale MX1ADS") | |
146 | /* Maintainer: Sascha Hauer, Pengutronix */ | |
34101237 | 147 | .boot_params = MX1_PHYS_OFFSET + 0x100, |
74fe030e | 148 | .map_io = mx1_map_io, |
c5aa0ad0 | 149 | .init_irq = mx1_init_irq, |
cfca8b53 PZ |
150 | .timer = &mx1ads_timer, |
151 | .init_machine = mx1ads_init, | |
152 | MACHINE_END | |
153 | ||
154 | MACHINE_START(MXLADS, "Freescale MXLADS") | |
34101237 | 155 | .boot_params = MX1_PHYS_OFFSET + 0x100, |
cd4a05f9 | 156 | .map_io = mx1_map_io, |
c5aa0ad0 | 157 | .init_irq = mx1_init_irq, |
cfca8b53 PZ |
158 | .timer = &mx1ads_timer, |
159 | .init_machine = mx1ads_init, | |
160 | MACHINE_END |