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