aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mx5
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2011-08-08 02:22:41 -0400
committerSascha Hauer <s.hauer@pengutronix.de>2011-08-08 02:22:41 -0400
commit1a43f2012455a977397deffe35912fd3f3ce17b9 (patch)
tree5189f337df44e7a495fbd097cd476b0380babd8c /arch/arm/mach-mx5
parente1b96ada659431669efaf3defa997abf5db68130 (diff)
parent322a8b034003c0d46d39af85bf24fee27b902f48 (diff)
Merge commit 'v3.1-rc1' into imx-fixes
Diffstat (limited to 'arch/arm/mach-mx5')
-rw-r--r--arch/arm/mach-mx5/Kconfig18
-rw-r--r--arch/arm/mach-mx5/Makefile2
-rw-r--r--arch/arm/mach-mx5/board-cpuimx51.c14
-rw-r--r--arch/arm/mach-mx5/board-cpuimx51sd.c2
-rw-r--r--arch/arm/mach-mx5/board-mx50_rdp.c2
-rw-r--r--arch/arm/mach-mx5/board-mx51_3ds.c5
-rw-r--r--arch/arm/mach-mx5/board-mx51_babbage.c60
-rw-r--r--arch/arm/mach-mx5/board-mx51_efikamx.c17
-rw-r--r--arch/arm/mach-mx5/board-mx51_efikasb.c18
-rw-r--r--arch/arm/mach-mx5/board-mx53_ard.c254
-rw-r--r--arch/arm/mach-mx5/board-mx53_evk.c19
-rw-r--r--arch/arm/mach-mx5/board-mx53_loco.c41
-rw-r--r--arch/arm/mach-mx5/board-mx53_smd.c2
-rw-r--r--arch/arm/mach-mx5/clock-mx51-mx53.c73
-rw-r--r--arch/arm/mach-mx5/crm_regs.h2
-rw-r--r--arch/arm/mach-mx5/devices-imx53.h8
-rw-r--r--arch/arm/mach-mx5/devices.c64
-rw-r--r--arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c24
-rw-r--r--arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c19
-rw-r--r--arch/arm/mach-mx5/mm-mx50.c22
-rw-r--r--arch/arm/mach-mx5/mm.c71
-rw-r--r--arch/arm/mach-mx5/mx51_efika.c4
-rw-r--r--arch/arm/mach-mx5/pm-imx5.c73
23 files changed, 621 insertions, 193 deletions
diff --git a/arch/arm/mach-mx5/Kconfig b/arch/arm/mach-mx5/Kconfig
index 799fbc40e53c..b4e7c58bbb38 100644
--- a/arch/arm/mach-mx5/Kconfig
+++ b/arch/arm/mach-mx5/Kconfig
@@ -109,6 +109,7 @@ config MACH_EUKREA_MBIMX51_BASEBOARD
109 bool 109 bool
110 select IMX_HAVE_PLATFORM_IMX_KEYPAD 110 select IMX_HAVE_PLATFORM_IMX_KEYPAD
111 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX 111 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
112 select LEDS_GPIO_REGISTER
112 help 113 help
113 This adds board specific devices that can be found on Eukrea's 114 This adds board specific devices that can be found on Eukrea's
114 MBIMX51 evaluation board. 115 MBIMX51 evaluation board.
@@ -135,6 +136,7 @@ config MACH_EUKREA_MBIMXSD51_BASEBOARD
135 prompt "Eukrea MBIMXSD development board" 136 prompt "Eukrea MBIMXSD development board"
136 bool 137 bool
137 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX 138 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
139 select LEDS_GPIO_REGISTER
138 help 140 help
139 This adds board specific devices that can be found on Eukrea's 141 This adds board specific devices that can be found on Eukrea's
140 MBIMXSD evaluation board. 142 MBIMXSD evaluation board.
@@ -151,6 +153,7 @@ config MX51_EFIKA_COMMON
151 153
152config MACH_MX51_EFIKAMX 154config MACH_MX51_EFIKAMX
153 bool "Support MX51 Genesi Efika MX nettop" 155 bool "Support MX51 Genesi Efika MX nettop"
156 select LEDS_GPIO_REGISTER
154 select MX51_EFIKA_COMMON 157 select MX51_EFIKA_COMMON
155 help 158 help
156 Include support for Genesi Efika MX nettop. This includes specific 159 Include support for Genesi Efika MX nettop. This includes specific
@@ -158,6 +161,7 @@ config MACH_MX51_EFIKAMX
158 161
159config MACH_MX51_EFIKASB 162config MACH_MX51_EFIKASB
160 bool "Support MX51 Genesi Efika Smartbook" 163 bool "Support MX51 Genesi Efika Smartbook"
164 select LEDS_GPIO_REGISTER
161 select MX51_EFIKA_COMMON 165 select MX51_EFIKA_COMMON
162 help 166 help
163 Include support for Genesi Efika Smartbook. This includes specific 167 Include support for Genesi Efika Smartbook. This includes specific
@@ -176,6 +180,7 @@ config MACH_MX53_EVK
176 select IMX_HAVE_PLATFORM_IMX_I2C 180 select IMX_HAVE_PLATFORM_IMX_I2C
177 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX 181 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
178 select IMX_HAVE_PLATFORM_SPI_IMX 182 select IMX_HAVE_PLATFORM_SPI_IMX
183 select LEDS_GPIO_REGISTER
179 help 184 help
180 Include support for MX53 EVK platform. This includes specific 185 Include support for MX53 EVK platform. This includes specific
181 configurations for the board and its peripherals. 186 configurations for the board and its peripherals.
@@ -199,10 +204,23 @@ config MACH_MX53_LOCO
199 select IMX_HAVE_PLATFORM_IMX_UART 204 select IMX_HAVE_PLATFORM_IMX_UART
200 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX 205 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
201 select IMX_HAVE_PLATFORM_GPIO_KEYS 206 select IMX_HAVE_PLATFORM_GPIO_KEYS
207 select LEDS_GPIO_REGISTER
202 help 208 help
203 Include support for MX53 LOCO platform. This includes specific 209 Include support for MX53 LOCO platform. This includes specific
204 configurations for the board and its peripherals. 210 configurations for the board and its peripherals.
205 211
212config MACH_MX53_ARD
213 bool "Support MX53 ARD platforms"
214 select SOC_IMX53
215 select IMX_HAVE_PLATFORM_IMX2_WDT
216 select IMX_HAVE_PLATFORM_IMX_I2C
217 select IMX_HAVE_PLATFORM_IMX_UART
218 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
219 select IMX_HAVE_PLATFORM_GPIO_KEYS
220 help
221 Include support for MX53 ARD platform. This includes specific
222 configurations for the board and its peripherals.
223
206endif # ARCH_MX53_SUPPORTED 224endif # ARCH_MX53_SUPPORTED
207 225
208endif 226endif
diff --git a/arch/arm/mach-mx5/Makefile b/arch/arm/mach-mx5/Makefile
index 0b9338cec516..383e7cd3fbcb 100644
--- a/arch/arm/mach-mx5/Makefile
+++ b/arch/arm/mach-mx5/Makefile
@@ -6,12 +6,14 @@
6obj-y := cpu.o mm.o clock-mx51-mx53.o devices.o ehci.o system.o 6obj-y := cpu.o mm.o clock-mx51-mx53.o devices.o ehci.o system.o
7obj-$(CONFIG_SOC_IMX50) += mm-mx50.o 7obj-$(CONFIG_SOC_IMX50) += mm-mx50.o
8 8
9obj-$(CONFIG_PM) += pm-imx5.o
9obj-$(CONFIG_CPU_FREQ_IMX) += cpu_op-mx51.o 10obj-$(CONFIG_CPU_FREQ_IMX) += cpu_op-mx51.o
10obj-$(CONFIG_MACH_MX51_BABBAGE) += board-mx51_babbage.o 11obj-$(CONFIG_MACH_MX51_BABBAGE) += board-mx51_babbage.o
11obj-$(CONFIG_MACH_MX51_3DS) += board-mx51_3ds.o 12obj-$(CONFIG_MACH_MX51_3DS) += board-mx51_3ds.o
12obj-$(CONFIG_MACH_MX53_EVK) += board-mx53_evk.o 13obj-$(CONFIG_MACH_MX53_EVK) += board-mx53_evk.o
13obj-$(CONFIG_MACH_MX53_SMD) += board-mx53_smd.o 14obj-$(CONFIG_MACH_MX53_SMD) += board-mx53_smd.o
14obj-$(CONFIG_MACH_MX53_LOCO) += board-mx53_loco.o 15obj-$(CONFIG_MACH_MX53_LOCO) += board-mx53_loco.o
16obj-$(CONFIG_MACH_MX53_ARD) += board-mx53_ard.o
15obj-$(CONFIG_MACH_EUKREA_CPUIMX51) += board-cpuimx51.o 17obj-$(CONFIG_MACH_EUKREA_CPUIMX51) += board-cpuimx51.o
16obj-$(CONFIG_MACH_EUKREA_MBIMX51_BASEBOARD) += eukrea_mbimx51-baseboard.o 18obj-$(CONFIG_MACH_EUKREA_MBIMX51_BASEBOARD) += eukrea_mbimx51-baseboard.o
17obj-$(CONFIG_MACH_EUKREA_CPUIMX51SD) += board-cpuimx51sd.o 19obj-$(CONFIG_MACH_EUKREA_CPUIMX51SD) += board-cpuimx51sd.o
diff --git a/arch/arm/mach-mx5/board-cpuimx51.c b/arch/arm/mach-mx5/board-cpuimx51.c
index 4efa02ee1639..7c893fa70266 100644
--- a/arch/arm/mach-mx5/board-cpuimx51.c
+++ b/arch/arm/mach-mx5/board-cpuimx51.c
@@ -43,10 +43,6 @@
43#define CPUIMX51_QUARTB_GPIO IMX_GPIO_NR(3, 25) 43#define CPUIMX51_QUARTB_GPIO IMX_GPIO_NR(3, 25)
44#define CPUIMX51_QUARTC_GPIO IMX_GPIO_NR(3, 26) 44#define CPUIMX51_QUARTC_GPIO IMX_GPIO_NR(3, 26)
45#define CPUIMX51_QUARTD_GPIO IMX_GPIO_NR(3, 27) 45#define CPUIMX51_QUARTD_GPIO IMX_GPIO_NR(3, 27)
46#define CPUIMX51_QUARTA_IRQ (MXC_INTERNAL_IRQS + CPUIMX51_QUARTA_GPIO)
47#define CPUIMX51_QUARTB_IRQ (MXC_INTERNAL_IRQS + CPUIMX51_QUARTB_GPIO)
48#define CPUIMX51_QUARTC_IRQ (MXC_INTERNAL_IRQS + CPUIMX51_QUARTC_GPIO)
49#define CPUIMX51_QUARTD_IRQ (MXC_INTERNAL_IRQS + CPUIMX51_QUARTD_GPIO)
50#define CPUIMX51_QUART_XTAL 14745600 46#define CPUIMX51_QUART_XTAL 14745600
51#define CPUIMX51_QUART_REGSHIFT 17 47#define CPUIMX51_QUART_REGSHIFT 17
52 48
@@ -61,7 +57,7 @@
61static struct plat_serial8250_port serial_platform_data[] = { 57static struct plat_serial8250_port serial_platform_data[] = {
62 { 58 {
63 .mapbase = (unsigned long)(MX51_CS1_BASE_ADDR + 0x400000), 59 .mapbase = (unsigned long)(MX51_CS1_BASE_ADDR + 0x400000),
64 .irq = CPUIMX51_QUARTA_IRQ, 60 .irq = gpio_to_irq(CPUIMX51_QUARTA_GPIO),
65 .irqflags = IRQF_TRIGGER_HIGH, 61 .irqflags = IRQF_TRIGGER_HIGH,
66 .uartclk = CPUIMX51_QUART_XTAL, 62 .uartclk = CPUIMX51_QUART_XTAL,
67 .regshift = CPUIMX51_QUART_REGSHIFT, 63 .regshift = CPUIMX51_QUART_REGSHIFT,
@@ -69,7 +65,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
69 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP, 65 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP,
70 }, { 66 }, {
71 .mapbase = (unsigned long)(MX51_CS1_BASE_ADDR + 0x800000), 67 .mapbase = (unsigned long)(MX51_CS1_BASE_ADDR + 0x800000),
72 .irq = CPUIMX51_QUARTB_IRQ, 68 .irq = gpio_to_irq(CPUIMX51_QUARTB_GPIO),
73 .irqflags = IRQF_TRIGGER_HIGH, 69 .irqflags = IRQF_TRIGGER_HIGH,
74 .uartclk = CPUIMX51_QUART_XTAL, 70 .uartclk = CPUIMX51_QUART_XTAL,
75 .regshift = CPUIMX51_QUART_REGSHIFT, 71 .regshift = CPUIMX51_QUART_REGSHIFT,
@@ -77,7 +73,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
77 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP, 73 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP,
78 }, { 74 }, {
79 .mapbase = (unsigned long)(MX51_CS1_BASE_ADDR + 0x1000000), 75 .mapbase = (unsigned long)(MX51_CS1_BASE_ADDR + 0x1000000),
80 .irq = CPUIMX51_QUARTC_IRQ, 76 .irq = gpio_to_irq(CPUIMX51_QUARTC_GPIO),
81 .irqflags = IRQF_TRIGGER_HIGH, 77 .irqflags = IRQF_TRIGGER_HIGH,
82 .uartclk = CPUIMX51_QUART_XTAL, 78 .uartclk = CPUIMX51_QUART_XTAL,
83 .regshift = CPUIMX51_QUART_REGSHIFT, 79 .regshift = CPUIMX51_QUART_REGSHIFT,
@@ -85,7 +81,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
85 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP, 81 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP,
86 }, { 82 }, {
87 .mapbase = (unsigned long)(MX51_CS1_BASE_ADDR + 0x2000000), 83 .mapbase = (unsigned long)(MX51_CS1_BASE_ADDR + 0x2000000),
88 .irq = CPUIMX51_QUARTD_IRQ, 84 .irq = irq_to_gpio(CPUIMX51_QUARTD_GPIO),
89 .irqflags = IRQF_TRIGGER_HIGH, 85 .irqflags = IRQF_TRIGGER_HIGH,
90 .uartclk = CPUIMX51_QUART_XTAL, 86 .uartclk = CPUIMX51_QUART_XTAL,
91 .regshift = CPUIMX51_QUART_REGSHIFT, 87 .regshift = CPUIMX51_QUART_REGSHIFT,
@@ -245,6 +241,8 @@ __setup("otg_mode=", eukrea_cpuimx51_otg_mode);
245 */ 241 */
246static void __init eukrea_cpuimx51_init(void) 242static void __init eukrea_cpuimx51_init(void)
247{ 243{
244 imx51_soc_init();
245
248 mxc_iomux_v3_setup_multiple_pads(eukrea_cpuimx51_pads, 246 mxc_iomux_v3_setup_multiple_pads(eukrea_cpuimx51_pads,
249 ARRAY_SIZE(eukrea_cpuimx51_pads)); 247 ARRAY_SIZE(eukrea_cpuimx51_pads));
250 248
diff --git a/arch/arm/mach-mx5/board-cpuimx51sd.c b/arch/arm/mach-mx5/board-cpuimx51sd.c
index 5ef25a596143..ff096d587299 100644
--- a/arch/arm/mach-mx5/board-cpuimx51sd.c
+++ b/arch/arm/mach-mx5/board-cpuimx51sd.c
@@ -264,6 +264,8 @@ static struct platform_device *platform_devices[] __initdata = {
264 264
265static void __init eukrea_cpuimx51sd_init(void) 265static void __init eukrea_cpuimx51sd_init(void)
266{ 266{
267 imx51_soc_init();
268
267 mxc_iomux_v3_setup_multiple_pads(eukrea_cpuimx51sd_pads, 269 mxc_iomux_v3_setup_multiple_pads(eukrea_cpuimx51sd_pads,
268 ARRAY_SIZE(eukrea_cpuimx51sd_pads)); 270 ARRAY_SIZE(eukrea_cpuimx51sd_pads));
269 271
diff --git a/arch/arm/mach-mx5/board-mx50_rdp.c b/arch/arm/mach-mx5/board-mx50_rdp.c
index 11210e1ae42a..7de25c6712eb 100644
--- a/arch/arm/mach-mx5/board-mx50_rdp.c
+++ b/arch/arm/mach-mx5/board-mx50_rdp.c
@@ -192,6 +192,8 @@ static const struct imxi2c_platform_data i2c_data __initconst = {
192 */ 192 */
193static void __init mx50_rdp_board_init(void) 193static void __init mx50_rdp_board_init(void)
194{ 194{
195 imx50_soc_init();
196
195 mxc_iomux_v3_setup_multiple_pads(mx50_rdp_pads, 197 mxc_iomux_v3_setup_multiple_pads(mx50_rdp_pads,
196 ARRAY_SIZE(mx50_rdp_pads)); 198 ARRAY_SIZE(mx50_rdp_pads));
197 199
diff --git a/arch/arm/mach-mx5/board-mx51_3ds.c b/arch/arm/mach-mx5/board-mx51_3ds.c
index 63dfbeafbc1e..07a38154da21 100644
--- a/arch/arm/mach-mx5/board-mx51_3ds.c
+++ b/arch/arm/mach-mx5/board-mx51_3ds.c
@@ -13,6 +13,7 @@
13#include <linux/irq.h> 13#include <linux/irq.h>
14#include <linux/platform_device.h> 14#include <linux/platform_device.h>
15#include <linux/spi/spi.h> 15#include <linux/spi/spi.h>
16#include <linux/gpio.h>
16 17
17#include <asm/mach-types.h> 18#include <asm/mach-types.h>
18#include <asm/mach/arch.h> 19#include <asm/mach/arch.h>
@@ -26,7 +27,7 @@
26#include "devices-imx51.h" 27#include "devices-imx51.h"
27#include "devices.h" 28#include "devices.h"
28 29
29#define EXPIO_PARENT_INT (MXC_INTERNAL_IRQS + GPIO_PORTA + 6) 30#define EXPIO_PARENT_INT gpio_to_irq(IMX_GPIO_NR(1, 6))
30#define MX51_3DS_ECSPI2_CS (GPIO_PORTC + 28) 31#define MX51_3DS_ECSPI2_CS (GPIO_PORTC + 28)
31 32
32static iomux_v3_cfg_t mx51_3ds_pads[] = { 33static iomux_v3_cfg_t mx51_3ds_pads[] = {
@@ -135,6 +136,8 @@ static struct spi_board_info mx51_3ds_spi_nor_device[] = {
135 */ 136 */
136static void __init mx51_3ds_init(void) 137static void __init mx51_3ds_init(void)
137{ 138{
139 imx51_soc_init();
140
138 mxc_iomux_v3_setup_multiple_pads(mx51_3ds_pads, 141 mxc_iomux_v3_setup_multiple_pads(mx51_3ds_pads,
139 ARRAY_SIZE(mx51_3ds_pads)); 142 ARRAY_SIZE(mx51_3ds_pads));
140 143
diff --git a/arch/arm/mach-mx5/board-mx51_babbage.c b/arch/arm/mach-mx5/board-mx51_babbage.c
index 98b40aae8aff..11b0ff67f89d 100644
--- a/arch/arm/mach-mx5/board-mx51_babbage.c
+++ b/arch/arm/mach-mx5/board-mx51_babbage.c
@@ -36,11 +36,13 @@
36 36
37#define BABBAGE_USB_HUB_RESET IMX_GPIO_NR(1, 7) 37#define BABBAGE_USB_HUB_RESET IMX_GPIO_NR(1, 7)
38#define BABBAGE_USBH1_STP IMX_GPIO_NR(1, 27) 38#define BABBAGE_USBH1_STP IMX_GPIO_NR(1, 27)
39#define BABBAGE_PHY_RESET IMX_GPIO_NR(2, 5) 39#define BABBAGE_USB_PHY_RESET IMX_GPIO_NR(2, 5)
40#define BABBAGE_FEC_PHY_RESET IMX_GPIO_NR(2, 14) 40#define BABBAGE_FEC_PHY_RESET IMX_GPIO_NR(2, 14)
41#define BABBAGE_POWER_KEY IMX_GPIO_NR(2, 21) 41#define BABBAGE_POWER_KEY IMX_GPIO_NR(2, 21)
42#define BABBAGE_ECSPI1_CS0 IMX_GPIO_NR(4, 24) 42#define BABBAGE_ECSPI1_CS0 IMX_GPIO_NR(4, 24)
43#define BABBAGE_ECSPI1_CS1 IMX_GPIO_NR(4, 25) 43#define BABBAGE_ECSPI1_CS1 IMX_GPIO_NR(4, 25)
44#define BABBAGE_SD2_CD IMX_GPIO_NR(1, 6)
45#define BABBAGE_SD2_WP IMX_GPIO_NR(1, 5)
44 46
45/* USB_CTRL_1 */ 47/* USB_CTRL_1 */
46#define MX51_USB_CTRL_1_OFFSET 0x10 48#define MX51_USB_CTRL_1_OFFSET 0x10
@@ -110,6 +112,9 @@ static iomux_v3_cfg_t mx51babbage_pads[] = {
110 /* USB HUB reset line*/ 112 /* USB HUB reset line*/
111 MX51_PAD_GPIO1_7__GPIO1_7, 113 MX51_PAD_GPIO1_7__GPIO1_7,
112 114
115 /* USB PHY reset line */
116 MX51_PAD_EIM_D21__GPIO2_5,
117
113 /* FEC */ 118 /* FEC */
114 MX51_PAD_EIM_EB2__FEC_MDIO, 119 MX51_PAD_EIM_EB2__FEC_MDIO,
115 MX51_PAD_EIM_EB3__FEC_RDATA1, 120 MX51_PAD_EIM_EB3__FEC_RDATA1,
@@ -139,6 +144,9 @@ static iomux_v3_cfg_t mx51babbage_pads[] = {
139 MX51_PAD_SD1_DATA1__SD1_DATA1, 144 MX51_PAD_SD1_DATA1__SD1_DATA1,
140 MX51_PAD_SD1_DATA2__SD1_DATA2, 145 MX51_PAD_SD1_DATA2__SD1_DATA2,
141 MX51_PAD_SD1_DATA3__SD1_DATA3, 146 MX51_PAD_SD1_DATA3__SD1_DATA3,
147 /* CD/WP from controller */
148 MX51_PAD_GPIO1_0__SD1_CD,
149 MX51_PAD_GPIO1_1__SD1_WP,
142 150
143 /* SD 2 */ 151 /* SD 2 */
144 MX51_PAD_SD2_CMD__SD2_CMD, 152 MX51_PAD_SD2_CMD__SD2_CMD,
@@ -147,6 +155,9 @@ static iomux_v3_cfg_t mx51babbage_pads[] = {
147 MX51_PAD_SD2_DATA1__SD2_DATA1, 155 MX51_PAD_SD2_DATA1__SD2_DATA1,
148 MX51_PAD_SD2_DATA2__SD2_DATA2, 156 MX51_PAD_SD2_DATA2__SD2_DATA2,
149 MX51_PAD_SD2_DATA3__SD2_DATA3, 157 MX51_PAD_SD2_DATA3__SD2_DATA3,
158 /* CD/WP gpio */
159 MX51_PAD_GPIO1_6__GPIO1_6,
160 MX51_PAD_GPIO1_5__GPIO1_5,
150 161
151 /* eCSPI1 */ 162 /* eCSPI1 */
152 MX51_PAD_CSPI1_MISO__ECSPI1_MISO, 163 MX51_PAD_CSPI1_MISO__ECSPI1_MISO,
@@ -169,34 +180,31 @@ static struct imxi2c_platform_data babbage_hsi2c_data = {
169 .bitrate = 400000, 180 .bitrate = 400000,
170}; 181};
171 182
183static struct gpio mx51_babbage_usbh1_gpios[] = {
184 { BABBAGE_USBH1_STP, GPIOF_OUT_INIT_LOW, "usbh1_stp" },
185 { BABBAGE_USB_PHY_RESET, GPIOF_OUT_INIT_LOW, "usbh1_phy_reset" },
186};
187
172static int gpio_usbh1_active(void) 188static int gpio_usbh1_active(void)
173{ 189{
174 iomux_v3_cfg_t usbh1stp_gpio = MX51_PAD_USBH1_STP__GPIO1_27; 190 iomux_v3_cfg_t usbh1stp_gpio = MX51_PAD_USBH1_STP__GPIO1_27;
175 iomux_v3_cfg_t phyreset_gpio = MX51_PAD_EIM_D21__GPIO2_5;
176 int ret; 191 int ret;
177 192
178 /* Set USBH1_STP to GPIO and toggle it */ 193 /* Set USBH1_STP to GPIO and toggle it */
179 mxc_iomux_v3_setup_pad(usbh1stp_gpio); 194 mxc_iomux_v3_setup_pad(usbh1stp_gpio);
180 ret = gpio_request(BABBAGE_USBH1_STP, "usbh1_stp"); 195 ret = gpio_request_array(mx51_babbage_usbh1_gpios,
196 ARRAY_SIZE(mx51_babbage_usbh1_gpios));
181 197
182 if (ret) { 198 if (ret) {
183 pr_debug("failed to get MX51_PAD_USBH1_STP__GPIO_1_27: %d\n", ret); 199 pr_debug("failed to get USBH1 pins: %d\n", ret);
184 return ret; 200 return ret;
185 } 201 }
186 gpio_direction_output(BABBAGE_USBH1_STP, 0);
187 gpio_set_value(BABBAGE_USBH1_STP, 1);
188 msleep(100);
189 gpio_free(BABBAGE_USBH1_STP);
190
191 /* De-assert USB PHY RESETB */
192 mxc_iomux_v3_setup_pad(phyreset_gpio);
193 ret = gpio_request(BABBAGE_PHY_RESET, "phy_reset");
194 202
195 if (ret) { 203 msleep(100);
196 pr_debug("failed to get MX51_PAD_EIM_D21__GPIO_2_5: %d\n", ret); 204 gpio_set_value(BABBAGE_USBH1_STP, 1);
197 return ret; 205 gpio_set_value(BABBAGE_USB_PHY_RESET, 1);
198 } 206 gpio_free_array(mx51_babbage_usbh1_gpios,
199 gpio_direction_output(BABBAGE_PHY_RESET, 1); 207 ARRAY_SIZE(mx51_babbage_usbh1_gpios));
200 return 0; 208 return 0;
201} 209}
202 210
@@ -331,6 +339,18 @@ static const struct spi_imx_master mx51_babbage_spi_pdata __initconst = {
331 .num_chipselect = ARRAY_SIZE(mx51_babbage_spi_cs), 339 .num_chipselect = ARRAY_SIZE(mx51_babbage_spi_cs),
332}; 340};
333 341
342static const struct esdhc_platform_data mx51_babbage_sd1_data __initconst = {
343 .cd_type = ESDHC_CD_CONTROLLER,
344 .wp_type = ESDHC_WP_CONTROLLER,
345};
346
347static const struct esdhc_platform_data mx51_babbage_sd2_data __initconst = {
348 .cd_gpio = BABBAGE_SD2_CD,
349 .wp_gpio = BABBAGE_SD2_WP,
350 .cd_type = ESDHC_CD_GPIO,
351 .wp_type = ESDHC_WP_GPIO,
352};
353
334/* 354/*
335 * Board specific initialization. 355 * Board specific initialization.
336 */ 356 */
@@ -340,6 +360,8 @@ static void __init mx51_babbage_init(void)
340 iomux_v3_cfg_t power_key = _MX51_PAD_EIM_A27__GPIO2_21 | 360 iomux_v3_cfg_t power_key = _MX51_PAD_EIM_A27__GPIO2_21 |
341 MUX_PAD_CTRL(PAD_CTL_SRE_FAST | PAD_CTL_DSE_HIGH | PAD_CTL_PUS_100K_UP); 361 MUX_PAD_CTRL(PAD_CTL_SRE_FAST | PAD_CTL_DSE_HIGH | PAD_CTL_PUS_100K_UP);
342 362
363 imx51_soc_init();
364
343#if defined(CONFIG_CPU_FREQ_IMX) 365#if defined(CONFIG_CPU_FREQ_IMX)
344 get_cpu_op = mx51_get_cpu_op; 366 get_cpu_op = mx51_get_cpu_op;
345#endif 367#endif
@@ -374,8 +396,8 @@ static void __init mx51_babbage_init(void)
374 mxc_iomux_v3_setup_pad(usbh1stp); 396 mxc_iomux_v3_setup_pad(usbh1stp);
375 babbage_usbhub_reset(); 397 babbage_usbhub_reset();
376 398
377 imx51_add_sdhci_esdhc_imx(0, NULL); 399 imx51_add_sdhci_esdhc_imx(0, &mx51_babbage_sd1_data);
378 imx51_add_sdhci_esdhc_imx(1, NULL); 400 imx51_add_sdhci_esdhc_imx(1, &mx51_babbage_sd2_data);
379 401
380 spi_register_board_info(mx51_babbage_spi_board_info, 402 spi_register_board_info(mx51_babbage_spi_board_info,
381 ARRAY_SIZE(mx51_babbage_spi_board_info)); 403 ARRAY_SIZE(mx51_babbage_spi_board_info));
diff --git a/arch/arm/mach-mx5/board-mx51_efikamx.c b/arch/arm/mach-mx5/board-mx51_efikamx.c
index 5e8dd6ad6934..551daf85ff8c 100644
--- a/arch/arm/mach-mx5/board-mx51_efikamx.c
+++ b/arch/arm/mach-mx5/board-mx51_efikamx.c
@@ -139,7 +139,7 @@ static void __init mx51_efikamx_board_id(void)
139 } 139 }
140} 140}
141 141
142static struct gpio_led mx51_efikamx_leds[] = { 142static struct gpio_led mx51_efikamx_leds[] __initdata = {
143 { 143 {
144 .name = "efikamx:green", 144 .name = "efikamx:green",
145 .default_trigger = "default-on", 145 .default_trigger = "default-on",
@@ -157,19 +157,12 @@ static struct gpio_led mx51_efikamx_leds[] = {
157 }, 157 },
158}; 158};
159 159
160static struct gpio_led_platform_data mx51_efikamx_leds_data = { 160static const struct gpio_led_platform_data
161 mx51_efikamx_leds_data __initconst = {
161 .leds = mx51_efikamx_leds, 162 .leds = mx51_efikamx_leds,
162 .num_leds = ARRAY_SIZE(mx51_efikamx_leds), 163 .num_leds = ARRAY_SIZE(mx51_efikamx_leds),
163}; 164};
164 165
165static struct platform_device mx51_efikamx_leds_device = {
166 .name = "leds-gpio",
167 .id = -1,
168 .dev = {
169 .platform_data = &mx51_efikamx_leds_data,
170 },
171};
172
173static struct gpio_keys_button mx51_efikamx_powerkey[] = { 166static struct gpio_keys_button mx51_efikamx_powerkey[] = {
174 { 167 {
175 .code = KEY_POWER, 168 .code = KEY_POWER,
@@ -236,6 +229,8 @@ late_initcall(mx51_efikamx_power_init);
236 229
237static void __init mx51_efikamx_init(void) 230static void __init mx51_efikamx_init(void)
238{ 231{
232 imx51_soc_init();
233
239 mxc_iomux_v3_setup_multiple_pads(mx51efikamx_pads, 234 mxc_iomux_v3_setup_multiple_pads(mx51efikamx_pads,
240 ARRAY_SIZE(mx51efikamx_pads)); 235 ARRAY_SIZE(mx51efikamx_pads));
241 efika_board_common_init(); 236 efika_board_common_init();
@@ -248,7 +243,7 @@ static void __init mx51_efikamx_init(void)
248 mx51_efikamx_leds[2].default_trigger = "mmc1"; 243 mx51_efikamx_leds[2].default_trigger = "mmc1";
249 } 244 }
250 245
251 platform_device_register(&mx51_efikamx_leds_device); 246 gpio_led_register_device(-1, &mx51_efikamx_leds_data);
252 imx_add_gpio_keys(&mx51_efikamx_powerkey_data); 247 imx_add_gpio_keys(&mx51_efikamx_powerkey_data);
253 248
254 if (system_rev == 0x11) { 249 if (system_rev == 0x11) {
diff --git a/arch/arm/mach-mx5/board-mx51_efikasb.c b/arch/arm/mach-mx5/board-mx51_efikasb.c
index f0c33b39d3e7..8a9bca22beb5 100644
--- a/arch/arm/mach-mx5/board-mx51_efikasb.c
+++ b/arch/arm/mach-mx5/board-mx51_efikasb.c
@@ -132,7 +132,7 @@ static void __init mx51_efikasb_usb(void)
132 mxc_register_device(&mxc_usbh2_device, &usbh2_config); 132 mxc_register_device(&mxc_usbh2_device, &usbh2_config);
133} 133}
134 134
135static struct gpio_led mx51_efikasb_leds[] = { 135static const struct gpio_led mx51_efikasb_leds[] __initconst = {
136 { 136 {
137 .name = "efikasb:green", 137 .name = "efikasb:green",
138 .default_trigger = "default-on", 138 .default_trigger = "default-on",
@@ -146,19 +146,12 @@ static struct gpio_led mx51_efikasb_leds[] = {
146 }, 146 },
147}; 147};
148 148
149static struct gpio_led_platform_data mx51_efikasb_leds_data = { 149static const struct gpio_led_platform_data
150 mx51_efikasb_leds_data __initconst = {
150 .leds = mx51_efikasb_leds, 151 .leds = mx51_efikasb_leds,
151 .num_leds = ARRAY_SIZE(mx51_efikasb_leds), 152 .num_leds = ARRAY_SIZE(mx51_efikasb_leds),
152}; 153};
153 154
154static struct platform_device mx51_efikasb_leds_device = {
155 .name = "leds-gpio",
156 .id = -1,
157 .dev = {
158 .platform_data = &mx51_efikasb_leds_data,
159 },
160};
161
162static struct gpio_keys_button mx51_efikasb_keys[] = { 155static struct gpio_keys_button mx51_efikasb_keys[] = {
163 { 156 {
164 .code = KEY_POWER, 157 .code = KEY_POWER,
@@ -249,6 +242,8 @@ static void __init mx51_efikasb_board_id(void)
249 242
250static void __init efikasb_board_init(void) 243static void __init efikasb_board_init(void)
251{ 244{
245 imx51_soc_init();
246
252 mxc_iomux_v3_setup_multiple_pads(mx51efikasb_pads, 247 mxc_iomux_v3_setup_multiple_pads(mx51efikasb_pads,
253 ARRAY_SIZE(mx51efikasb_pads)); 248 ARRAY_SIZE(mx51efikasb_pads));
254 efika_board_common_init(); 249 efika_board_common_init();
@@ -257,9 +252,8 @@ static void __init efikasb_board_init(void)
257 mx51_efikasb_usb(); 252 mx51_efikasb_usb();
258 imx51_add_sdhci_esdhc_imx(1, NULL); 253 imx51_add_sdhci_esdhc_imx(1, NULL);
259 254
260 platform_device_register(&mx51_efikasb_leds_device); 255 gpio_led_register_device(-1, &mx51_efikasb_leds_data);
261 imx_add_gpio_keys(&mx51_efikasb_keys_data); 256 imx_add_gpio_keys(&mx51_efikasb_keys_data);
262
263} 257}
264 258
265static void __init mx51_efikasb_timer_init(void) 259static void __init mx51_efikasb_timer_init(void)
diff --git a/arch/arm/mach-mx5/board-mx53_ard.c b/arch/arm/mach-mx5/board-mx53_ard.c
new file mode 100644
index 000000000000..76a67c4a2a0b
--- /dev/null
+++ b/arch/arm/mach-mx5/board-mx53_ard.c
@@ -0,0 +1,254 @@
1/*
2 * Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved.
3 */
4
5/*
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20
21#include <linux/init.h>
22#include <linux/clk.h>
23#include <linux/delay.h>
24#include <linux/gpio.h>
25#include <linux/smsc911x.h>
26
27#include <mach/common.h>
28#include <mach/hardware.h>
29#include <mach/iomux-mx53.h>
30
31#include <asm/mach-types.h>
32#include <asm/mach/arch.h>
33#include <asm/mach/time.h>
34
35#include "crm_regs.h"
36#include "devices-imx53.h"
37
38#define ARD_ETHERNET_INT_B IMX_GPIO_NR(2, 31)
39#define ARD_SD1_CD IMX_GPIO_NR(1, 1)
40#define ARD_SD1_WP IMX_GPIO_NR(1, 9)
41#define ARD_I2CPORTEXP_B IMX_GPIO_NR(2, 3)
42#define ARD_VOLUMEDOWN IMX_GPIO_NR(4, 0)
43#define ARD_HOME IMX_GPIO_NR(5, 10)
44#define ARD_BACK IMX_GPIO_NR(5, 11)
45#define ARD_PROG IMX_GPIO_NR(5, 12)
46#define ARD_VOLUMEUP IMX_GPIO_NR(5, 13)
47
48static iomux_v3_cfg_t mx53_ard_pads[] = {
49 /* UART1 */
50 MX53_PAD_PATA_DIOW__UART1_TXD_MUX,
51 MX53_PAD_PATA_DMACK__UART1_RXD_MUX,
52 /* WEIM for CS1 */
53 MX53_PAD_EIM_EB3__GPIO2_31, /* ETHERNET_INT_B */
54 MX53_PAD_EIM_D16__EMI_WEIM_D_16,
55 MX53_PAD_EIM_D17__EMI_WEIM_D_17,
56 MX53_PAD_EIM_D18__EMI_WEIM_D_18,
57 MX53_PAD_EIM_D19__EMI_WEIM_D_19,
58 MX53_PAD_EIM_D20__EMI_WEIM_D_20,
59 MX53_PAD_EIM_D21__EMI_WEIM_D_21,
60 MX53_PAD_EIM_D22__EMI_WEIM_D_22,
61 MX53_PAD_EIM_D23__EMI_WEIM_D_23,
62 MX53_PAD_EIM_D24__EMI_WEIM_D_24,
63 MX53_PAD_EIM_D25__EMI_WEIM_D_25,
64 MX53_PAD_EIM_D26__EMI_WEIM_D_26,
65 MX53_PAD_EIM_D27__EMI_WEIM_D_27,
66 MX53_PAD_EIM_D28__EMI_WEIM_D_28,
67 MX53_PAD_EIM_D29__EMI_WEIM_D_29,
68 MX53_PAD_EIM_D30__EMI_WEIM_D_30,
69 MX53_PAD_EIM_D31__EMI_WEIM_D_31,
70 MX53_PAD_EIM_DA0__EMI_NAND_WEIM_DA_0,
71 MX53_PAD_EIM_DA1__EMI_NAND_WEIM_DA_1,
72 MX53_PAD_EIM_DA2__EMI_NAND_WEIM_DA_2,
73 MX53_PAD_EIM_DA3__EMI_NAND_WEIM_DA_3,
74 MX53_PAD_EIM_DA4__EMI_NAND_WEIM_DA_4,
75 MX53_PAD_EIM_DA5__EMI_NAND_WEIM_DA_5,
76 MX53_PAD_EIM_DA6__EMI_NAND_WEIM_DA_6,
77 MX53_PAD_EIM_OE__EMI_WEIM_OE,
78 MX53_PAD_EIM_RW__EMI_WEIM_RW,
79 MX53_PAD_EIM_CS1__EMI_WEIM_CS_1,
80 /* SDHC1 */
81 MX53_PAD_SD1_CMD__ESDHC1_CMD,
82 MX53_PAD_SD1_CLK__ESDHC1_CLK,
83 MX53_PAD_SD1_DATA0__ESDHC1_DAT0,
84 MX53_PAD_SD1_DATA1__ESDHC1_DAT1,
85 MX53_PAD_SD1_DATA2__ESDHC1_DAT2,
86 MX53_PAD_SD1_DATA3__ESDHC1_DAT3,
87 MX53_PAD_PATA_DATA8__ESDHC1_DAT4,
88 MX53_PAD_PATA_DATA9__ESDHC1_DAT5,
89 MX53_PAD_PATA_DATA10__ESDHC1_DAT6,
90 MX53_PAD_PATA_DATA11__ESDHC1_DAT7,
91 MX53_PAD_GPIO_1__GPIO1_1,
92 MX53_PAD_GPIO_9__GPIO1_9,
93 /* I2C2 */
94 MX53_PAD_EIM_EB2__I2C2_SCL,
95 MX53_PAD_KEY_ROW3__I2C2_SDA,
96 /* I2C3 */
97 MX53_PAD_GPIO_3__I2C3_SCL,
98 MX53_PAD_GPIO_16__I2C3_SDA,
99 /* GPIO */
100 MX53_PAD_DISP0_DAT16__GPIO5_10, /* home */
101 MX53_PAD_DISP0_DAT17__GPIO5_11, /* back */
102 MX53_PAD_DISP0_DAT18__GPIO5_12, /* prog */
103 MX53_PAD_DISP0_DAT19__GPIO5_13, /* vol up */
104 MX53_PAD_GPIO_10__GPIO4_0, /* vol down */
105};
106
107#define GPIO_BUTTON(gpio_num, ev_code, act_low, descr, wake) \
108{ \
109 .gpio = gpio_num, \
110 .type = EV_KEY, \
111 .code = ev_code, \
112 .active_low = act_low, \
113 .desc = "btn " descr, \
114 .wakeup = wake, \
115}
116
117static struct gpio_keys_button ard_buttons[] = {
118 GPIO_BUTTON(ARD_HOME, KEY_HOME, 1, "home", 0),
119 GPIO_BUTTON(ARD_BACK, KEY_BACK, 1, "back", 0),
120 GPIO_BUTTON(ARD_PROG, KEY_PROGRAM, 1, "program", 0),
121 GPIO_BUTTON(ARD_VOLUMEUP, KEY_VOLUMEUP, 1, "volume-up", 0),
122 GPIO_BUTTON(ARD_VOLUMEDOWN, KEY_VOLUMEDOWN, 1, "volume-down", 0),
123};
124
125static const struct gpio_keys_platform_data ard_button_data __initconst = {
126 .buttons = ard_buttons,
127 .nbuttons = ARRAY_SIZE(ard_buttons),
128};
129
130static struct resource ard_smsc911x_resources[] = {
131 {
132 .start = MX53_CS1_64MB_BASE_ADDR,
133 .end = MX53_CS1_64MB_BASE_ADDR + SZ_32M - 1,
134 .flags = IORESOURCE_MEM,
135 },
136 {
137 .start = gpio_to_irq(ARD_ETHERNET_INT_B),
138 .end = gpio_to_irq(ARD_ETHERNET_INT_B),
139 .flags = IORESOURCE_IRQ,
140 },
141};
142
143struct smsc911x_platform_config ard_smsc911x_config = {
144 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
145 .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
146 .flags = SMSC911X_USE_32BIT,
147};
148
149static struct platform_device ard_smsc_lan9220_device = {
150 .name = "smsc911x",
151 .id = -1,
152 .num_resources = ARRAY_SIZE(ard_smsc911x_resources),
153 .resource = ard_smsc911x_resources,
154 .dev = {
155 .platform_data = &ard_smsc911x_config,
156 },
157};
158
159static const struct esdhc_platform_data mx53_ard_sd1_data __initconst = {
160 .cd_gpio = ARD_SD1_CD,
161 .wp_gpio = ARD_SD1_WP,
162};
163
164static struct imxi2c_platform_data mx53_ard_i2c2_data = {
165 .bitrate = 50000,
166};
167
168static struct imxi2c_platform_data mx53_ard_i2c3_data = {
169 .bitrate = 400000,
170};
171
172static void __init mx53_ard_io_init(void)
173{
174 mxc_iomux_v3_setup_multiple_pads(mx53_ard_pads,
175 ARRAY_SIZE(mx53_ard_pads));
176
177 gpio_request(ARD_ETHERNET_INT_B, "eth-int-b");
178 gpio_direction_input(ARD_ETHERNET_INT_B);
179
180 gpio_request(ARD_I2CPORTEXP_B, "i2cptexp-rst");
181 gpio_direction_output(ARD_I2CPORTEXP_B, 1);
182}
183
184/* Config CS1 settings for ethernet controller */
185static int weim_cs_config(void)
186{
187 u32 reg;
188 void __iomem *weim_base, *iomuxc_base;
189
190 weim_base = ioremap(MX53_WEIM_BASE_ADDR, SZ_4K);
191 if (!weim_base)
192 return -ENOMEM;
193
194 iomuxc_base = ioremap(MX53_IOMUXC_BASE_ADDR, SZ_4K);
195 if (!iomuxc_base)
196 return -ENOMEM;
197
198 /* CS1 timings for LAN9220 */
199 writel(0x20001, (weim_base + 0x18));
200 writel(0x0, (weim_base + 0x1C));
201 writel(0x16000202, (weim_base + 0x20));
202 writel(0x00000002, (weim_base + 0x24));
203 writel(0x16002082, (weim_base + 0x28));
204 writel(0x00000000, (weim_base + 0x2C));
205 writel(0x00000000, (weim_base + 0x90));
206
207 /* specify 64 MB on CS1 and CS0 on GPR1 */
208 reg = readl(iomuxc_base + 0x4);
209 reg &= ~0x3F;
210 reg |= 0x1B;
211 writel(reg, (iomuxc_base + 0x4));
212
213 iounmap(iomuxc_base);
214 iounmap(weim_base);
215
216 return 0;
217}
218
219static struct platform_device *devices[] __initdata = {
220 &ard_smsc_lan9220_device,
221};
222
223static void __init mx53_ard_board_init(void)
224{
225 imx53_soc_init();
226 imx53_add_imx_uart(0, NULL);
227
228 mx53_ard_io_init();
229 weim_cs_config();
230 platform_add_devices(devices, ARRAY_SIZE(devices));
231
232 imx53_add_sdhci_esdhc_imx(0, &mx53_ard_sd1_data);
233 imx53_add_imx2_wdt(0, NULL);
234 imx53_add_imx_i2c(1, &mx53_ard_i2c2_data);
235 imx53_add_imx_i2c(2, &mx53_ard_i2c3_data);
236 imx_add_gpio_keys(&ard_button_data);
237}
238
239static void __init mx53_ard_timer_init(void)
240{
241 mx53_clocks_init(32768, 24000000, 22579200, 0);
242}
243
244static struct sys_timer mx53_ard_timer = {
245 .init = mx53_ard_timer_init,
246};
247
248MACHINE_START(MX53_ARD, "Freescale MX53 ARD Board")
249 .map_io = mx53_map_io,
250 .init_early = imx53_init_early,
251 .init_irq = mx53_init_irq,
252 .timer = &mx53_ard_timer,
253 .init_machine = mx53_ard_board_init,
254MACHINE_END
diff --git a/arch/arm/mach-mx5/board-mx53_evk.c b/arch/arm/mach-mx5/board-mx53_evk.c
index f87d571882c6..1b417b06b736 100644
--- a/arch/arm/mach-mx5/board-mx53_evk.c
+++ b/arch/arm/mach-mx5/board-mx53_evk.c
@@ -35,6 +35,7 @@
35#define MX53_EVK_FEC_PHY_RST IMX_GPIO_NR(7, 6) 35#define MX53_EVK_FEC_PHY_RST IMX_GPIO_NR(7, 6)
36#define EVK_ECSPI1_CS0 IMX_GPIO_NR(2, 30) 36#define EVK_ECSPI1_CS0 IMX_GPIO_NR(2, 30)
37#define EVK_ECSPI1_CS1 IMX_GPIO_NR(3, 19) 37#define EVK_ECSPI1_CS1 IMX_GPIO_NR(3, 19)
38#define MX53EVK_LED IMX_GPIO_NR(7, 7)
38 39
39#include "crm_regs.h" 40#include "crm_regs.h"
40#include "devices-imx53.h" 41#include "devices-imx53.h"
@@ -58,12 +59,27 @@ static iomux_v3_cfg_t mx53_evk_pads[] = {
58 /* ecspi chip select lines */ 59 /* ecspi chip select lines */
59 MX53_PAD_EIM_EB2__GPIO2_30, 60 MX53_PAD_EIM_EB2__GPIO2_30,
60 MX53_PAD_EIM_D19__GPIO3_19, 61 MX53_PAD_EIM_D19__GPIO3_19,
62 /* LED */
63 MX53_PAD_PATA_DA_1__GPIO7_7,
61}; 64};
62 65
63static const struct imxuart_platform_data mx53_evk_uart_pdata __initconst = { 66static const struct imxuart_platform_data mx53_evk_uart_pdata __initconst = {
64 .flags = IMXUART_HAVE_RTSCTS, 67 .flags = IMXUART_HAVE_RTSCTS,
65}; 68};
66 69
70static const struct gpio_led mx53evk_leds[] __initconst = {
71 {
72 .name = "green",
73 .default_trigger = "heartbeat",
74 .gpio = MX53EVK_LED,
75 },
76};
77
78static const struct gpio_led_platform_data mx53evk_leds_data __initconst = {
79 .leds = mx53evk_leds,
80 .num_leds = ARRAY_SIZE(mx53evk_leds),
81};
82
67static inline void mx53_evk_init_uart(void) 83static inline void mx53_evk_init_uart(void)
68{ 84{
69 imx53_add_imx_uart(0, NULL); 85 imx53_add_imx_uart(0, NULL);
@@ -117,6 +133,8 @@ static const struct spi_imx_master mx53_evk_spi_data __initconst = {
117 133
118static void __init mx53_evk_board_init(void) 134static void __init mx53_evk_board_init(void)
119{ 135{
136 imx53_soc_init();
137
120 mxc_iomux_v3_setup_multiple_pads(mx53_evk_pads, 138 mxc_iomux_v3_setup_multiple_pads(mx53_evk_pads,
121 ARRAY_SIZE(mx53_evk_pads)); 139 ARRAY_SIZE(mx53_evk_pads));
122 mx53_evk_init_uart(); 140 mx53_evk_init_uart();
@@ -133,6 +151,7 @@ static void __init mx53_evk_board_init(void)
133 ARRAY_SIZE(mx53_evk_spi_board_info)); 151 ARRAY_SIZE(mx53_evk_spi_board_info));
134 imx53_add_ecspi(0, &mx53_evk_spi_data); 152 imx53_add_ecspi(0, &mx53_evk_spi_data);
135 imx53_add_imx2_wdt(0, NULL); 153 imx53_add_imx2_wdt(0, NULL);
154 gpio_led_register_device(-1, &mx53evk_leds_data);
136} 155}
137 156
138static void __init mx53_evk_timer_init(void) 157static void __init mx53_evk_timer_init(void)
diff --git a/arch/arm/mach-mx5/board-mx53_loco.c b/arch/arm/mach-mx5/board-mx53_loco.c
index 1b947e8c9c0c..4e1d51d252dc 100644
--- a/arch/arm/mach-mx5/board-mx53_loco.c
+++ b/arch/arm/mach-mx5/board-mx53_loco.c
@@ -38,6 +38,10 @@
38#define MX53_LOCO_UI1 IMX_GPIO_NR(2, 14) 38#define MX53_LOCO_UI1 IMX_GPIO_NR(2, 14)
39#define MX53_LOCO_UI2 IMX_GPIO_NR(2, 15) 39#define MX53_LOCO_UI2 IMX_GPIO_NR(2, 15)
40#define LOCO_FEC_PHY_RST IMX_GPIO_NR(7, 6) 40#define LOCO_FEC_PHY_RST IMX_GPIO_NR(7, 6)
41#define LOCO_LED IMX_GPIO_NR(7, 7)
42#define LOCO_SD3_CD IMX_GPIO_NR(3, 11)
43#define LOCO_SD3_WP IMX_GPIO_NR(3, 12)
44#define LOCO_SD1_CD IMX_GPIO_NR(3, 13)
41 45
42static iomux_v3_cfg_t mx53_loco_pads[] = { 46static iomux_v3_cfg_t mx53_loco_pads[] = {
43 /* FEC */ 47 /* FEC */
@@ -70,6 +74,8 @@ static iomux_v3_cfg_t mx53_loco_pads[] = {
70 MX53_PAD_SD1_DATA1__ESDHC1_DAT1, 74 MX53_PAD_SD1_DATA1__ESDHC1_DAT1,
71 MX53_PAD_SD1_DATA2__ESDHC1_DAT2, 75 MX53_PAD_SD1_DATA2__ESDHC1_DAT2,
72 MX53_PAD_SD1_DATA3__ESDHC1_DAT3, 76 MX53_PAD_SD1_DATA3__ESDHC1_DAT3,
77 /* SD1_CD */
78 MX53_PAD_EIM_DA13__GPIO3_13,
73 /* SD3 */ 79 /* SD3 */
74 MX53_PAD_PATA_DATA8__ESDHC3_DAT0, 80 MX53_PAD_PATA_DATA8__ESDHC3_DAT0,
75 MX53_PAD_PATA_DATA9__ESDHC3_DAT1, 81 MX53_PAD_PATA_DATA9__ESDHC3_DAT1,
@@ -163,7 +169,7 @@ static iomux_v3_cfg_t mx53_loco_pads[] = {
163 MX53_PAD_GPIO_7__SPDIF_PLOCK, 169 MX53_PAD_GPIO_7__SPDIF_PLOCK,
164 MX53_PAD_GPIO_17__SPDIF_OUT1, 170 MX53_PAD_GPIO_17__SPDIF_OUT1,
165 /* GPIO */ 171 /* GPIO */
166 MX53_PAD_PATA_DA_1__GPIO7_7, 172 MX53_PAD_PATA_DA_1__GPIO7_7, /* LED */
167 MX53_PAD_PATA_DA_2__GPIO7_8, 173 MX53_PAD_PATA_DA_2__GPIO7_8,
168 MX53_PAD_PATA_DATA5__GPIO2_5, 174 MX53_PAD_PATA_DATA5__GPIO2_5,
169 MX53_PAD_PATA_DATA6__GPIO2_6, 175 MX53_PAD_PATA_DATA6__GPIO2_6,
@@ -202,6 +208,19 @@ static const struct gpio_keys_platform_data loco_button_data __initconst = {
202 .nbuttons = ARRAY_SIZE(loco_buttons), 208 .nbuttons = ARRAY_SIZE(loco_buttons),
203}; 209};
204 210
211static const struct esdhc_platform_data mx53_loco_sd1_data __initconst = {
212 .cd_gpio = LOCO_SD1_CD,
213 .cd_type = ESDHC_CD_GPIO,
214 .wp_type = ESDHC_WP_NONE,
215};
216
217static const struct esdhc_platform_data mx53_loco_sd3_data __initconst = {
218 .cd_gpio = LOCO_SD3_CD,
219 .wp_gpio = LOCO_SD3_WP,
220 .cd_type = ESDHC_CD_GPIO,
221 .wp_type = ESDHC_WP_GPIO,
222};
223
205static inline void mx53_loco_fec_reset(void) 224static inline void mx53_loco_fec_reset(void)
206{ 225{
207 int ret; 226 int ret;
@@ -225,8 +244,23 @@ static const struct imxi2c_platform_data mx53_loco_i2c_data __initconst = {
225 .bitrate = 100000, 244 .bitrate = 100000,
226}; 245};
227 246
247static const struct gpio_led mx53loco_leds[] __initconst = {
248 {
249 .name = "green",
250 .default_trigger = "heartbeat",
251 .gpio = LOCO_LED,
252 },
253};
254
255static const struct gpio_led_platform_data mx53loco_leds_data __initconst = {
256 .leds = mx53loco_leds,
257 .num_leds = ARRAY_SIZE(mx53loco_leds),
258};
259
228static void __init mx53_loco_board_init(void) 260static void __init mx53_loco_board_init(void)
229{ 261{
262 imx53_soc_init();
263
230 mxc_iomux_v3_setup_multiple_pads(mx53_loco_pads, 264 mxc_iomux_v3_setup_multiple_pads(mx53_loco_pads,
231 ARRAY_SIZE(mx53_loco_pads)); 265 ARRAY_SIZE(mx53_loco_pads));
232 imx53_add_imx_uart(0, NULL); 266 imx53_add_imx_uart(0, NULL);
@@ -235,9 +269,10 @@ static void __init mx53_loco_board_init(void)
235 imx53_add_imx2_wdt(0, NULL); 269 imx53_add_imx2_wdt(0, NULL);
236 imx53_add_imx_i2c(0, &mx53_loco_i2c_data); 270 imx53_add_imx_i2c(0, &mx53_loco_i2c_data);
237 imx53_add_imx_i2c(1, &mx53_loco_i2c_data); 271 imx53_add_imx_i2c(1, &mx53_loco_i2c_data);
238 imx53_add_sdhci_esdhc_imx(0, NULL); 272 imx53_add_sdhci_esdhc_imx(0, &mx53_loco_sd1_data);
239 imx53_add_sdhci_esdhc_imx(2, NULL); 273 imx53_add_sdhci_esdhc_imx(2, &mx53_loco_sd3_data);
240 imx_add_gpio_keys(&loco_button_data); 274 imx_add_gpio_keys(&loco_button_data);
275 gpio_led_register_device(-1, &mx53loco_leds_data);
241} 276}
242 277
243static void __init mx53_loco_timer_init(void) 278static void __init mx53_loco_timer_init(void)
diff --git a/arch/arm/mach-mx5/board-mx53_smd.c b/arch/arm/mach-mx5/board-mx53_smd.c
index 817c08938f55..bc02894eafef 100644
--- a/arch/arm/mach-mx5/board-mx53_smd.c
+++ b/arch/arm/mach-mx5/board-mx53_smd.c
@@ -113,6 +113,8 @@ static const struct imxi2c_platform_data mx53_smd_i2c_data __initconst = {
113 113
114static void __init mx53_smd_board_init(void) 114static void __init mx53_smd_board_init(void)
115{ 115{
116 imx53_soc_init();
117
116 mxc_iomux_v3_setup_multiple_pads(mx53_smd_pads, 118 mxc_iomux_v3_setup_multiple_pads(mx53_smd_pads,
117 ARRAY_SIZE(mx53_smd_pads)); 119 ARRAY_SIZE(mx53_smd_pads));
118 mx53_smd_init_uart(); 120 mx53_smd_init_uart();
diff --git a/arch/arm/mach-mx5/clock-mx51-mx53.c b/arch/arm/mach-mx5/clock-mx51-mx53.c
index 0856482f376d..f7bf996f463b 100644
--- a/arch/arm/mach-mx5/clock-mx51-mx53.c
+++ b/arch/arm/mach-mx5/clock-mx51-mx53.c
@@ -1258,12 +1258,20 @@ DEFINE_CLOCK(uart2_ipg_clk, 1, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG5_OFFSET,
1258 NULL, NULL, &ipg_clk, &aips_tz1_clk); 1258 NULL, NULL, &ipg_clk, &aips_tz1_clk);
1259DEFINE_CLOCK(uart3_ipg_clk, 2, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG7_OFFSET, 1259DEFINE_CLOCK(uart3_ipg_clk, 2, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG7_OFFSET,
1260 NULL, NULL, &ipg_clk, &spba_clk); 1260 NULL, NULL, &ipg_clk, &spba_clk);
1261DEFINE_CLOCK(uart4_ipg_clk, 3, MXC_CCM_CCGR7, MXC_CCM_CCGRx_CG4_OFFSET,
1262 NULL, NULL, &ipg_clk, &spba_clk);
1263DEFINE_CLOCK(uart5_ipg_clk, 4, MXC_CCM_CCGR7, MXC_CCM_CCGRx_CG6_OFFSET,
1264 NULL, NULL, &ipg_clk, &spba_clk);
1261DEFINE_CLOCK(uart1_clk, 0, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG4_OFFSET, 1265DEFINE_CLOCK(uart1_clk, 0, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG4_OFFSET,
1262 NULL, NULL, &uart_root_clk, &uart1_ipg_clk); 1266 NULL, NULL, &uart_root_clk, &uart1_ipg_clk);
1263DEFINE_CLOCK(uart2_clk, 1, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG6_OFFSET, 1267DEFINE_CLOCK(uart2_clk, 1, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG6_OFFSET,
1264 NULL, NULL, &uart_root_clk, &uart2_ipg_clk); 1268 NULL, NULL, &uart_root_clk, &uart2_ipg_clk);
1265DEFINE_CLOCK(uart3_clk, 2, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG8_OFFSET, 1269DEFINE_CLOCK(uart3_clk, 2, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG8_OFFSET,
1266 NULL, NULL, &uart_root_clk, &uart3_ipg_clk); 1270 NULL, NULL, &uart_root_clk, &uart3_ipg_clk);
1271DEFINE_CLOCK(uart4_clk, 3, MXC_CCM_CCGR7, MXC_CCM_CCGRx_CG5_OFFSET,
1272 NULL, NULL, &uart_root_clk, &uart4_ipg_clk);
1273DEFINE_CLOCK(uart5_clk, 4, MXC_CCM_CCGR7, MXC_CCM_CCGRx_CG7_OFFSET,
1274 NULL, NULL, &uart_root_clk, &uart5_ipg_clk);
1267 1275
1268/* GPT */ 1276/* GPT */
1269DEFINE_CLOCK(gpt_ipg_clk, 0, MXC_CCM_CCGR2, MXC_CCM_CCGRx_CG10_OFFSET, 1277DEFINE_CLOCK(gpt_ipg_clk, 0, MXC_CCM_CCGR2, MXC_CCM_CCGRx_CG10_OFFSET,
@@ -1278,11 +1286,13 @@ DEFINE_CLOCK(pwm2_clk, 0, MXC_CCM_CCGR2, MXC_CCM_CCGRx_CG8_OFFSET,
1278 1286
1279/* I2C */ 1287/* I2C */
1280DEFINE_CLOCK(i2c1_clk, 0, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG9_OFFSET, 1288DEFINE_CLOCK(i2c1_clk, 0, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG9_OFFSET,
1281 NULL, NULL, &ipg_clk, NULL); 1289 NULL, NULL, &ipg_perclk, NULL);
1282DEFINE_CLOCK(i2c2_clk, 1, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG10_OFFSET, 1290DEFINE_CLOCK(i2c2_clk, 1, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG10_OFFSET,
1283 NULL, NULL, &ipg_clk, NULL); 1291 NULL, NULL, &ipg_perclk, NULL);
1284DEFINE_CLOCK(hsi2c_clk, 0, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG11_OFFSET, 1292DEFINE_CLOCK(hsi2c_clk, 0, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG11_OFFSET,
1285 NULL, NULL, &ipg_clk, NULL); 1293 NULL, NULL, &ipg_clk, NULL);
1294DEFINE_CLOCK(i2c3_mx53_clk, 0, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG11_OFFSET,
1295 NULL, NULL, &ipg_perclk, NULL);
1286 1296
1287/* FEC */ 1297/* FEC */
1288DEFINE_CLOCK(fec_clk, 0, MXC_CCM_CCGR2, MXC_CCM_CCGRx_CG12_OFFSET, 1298DEFINE_CLOCK(fec_clk, 0, MXC_CCM_CCGR2, MXC_CCM_CCGRx_CG12_OFFSET,
@@ -1416,11 +1426,13 @@ DEFINE_CLOCK(ipu_di1_clk, 0, MXC_CCM_CCGR6, MXC_CCM_CCGRx_CG6_OFFSET,
1416 }, 1426 },
1417 1427
1418static struct clk_lookup mx51_lookups[] = { 1428static struct clk_lookup mx51_lookups[] = {
1419 _REGISTER_CLOCK("imx-uart.0", NULL, uart1_clk) 1429 /* i.mx51 has the i.mx21 type uart */
1420 _REGISTER_CLOCK("imx-uart.1", NULL, uart2_clk) 1430 _REGISTER_CLOCK("imx21-uart.0", NULL, uart1_clk)
1421 _REGISTER_CLOCK("imx-uart.2", NULL, uart3_clk) 1431 _REGISTER_CLOCK("imx21-uart.1", NULL, uart2_clk)
1432 _REGISTER_CLOCK("imx21-uart.2", NULL, uart3_clk)
1422 _REGISTER_CLOCK(NULL, "gpt", gpt_clk) 1433 _REGISTER_CLOCK(NULL, "gpt", gpt_clk)
1423 _REGISTER_CLOCK("fec.0", NULL, fec_clk) 1434 /* i.mx51 has the i.mx27 type fec */
1435 _REGISTER_CLOCK("imx27-fec.0", NULL, fec_clk)
1424 _REGISTER_CLOCK("mxc_pwm.0", "pwm", pwm1_clk) 1436 _REGISTER_CLOCK("mxc_pwm.0", "pwm", pwm1_clk)
1425 _REGISTER_CLOCK("mxc_pwm.1", "pwm", pwm2_clk) 1437 _REGISTER_CLOCK("mxc_pwm.1", "pwm", pwm2_clk)
1426 _REGISTER_CLOCK("imx-i2c.0", NULL, i2c1_clk) 1438 _REGISTER_CLOCK("imx-i2c.0", NULL, i2c1_clk)
@@ -1440,17 +1452,19 @@ static struct clk_lookup mx51_lookups[] = {
1440 _REGISTER_CLOCK("imx-ssi.0", NULL, ssi1_clk) 1452 _REGISTER_CLOCK("imx-ssi.0", NULL, ssi1_clk)
1441 _REGISTER_CLOCK("imx-ssi.1", NULL, ssi2_clk) 1453 _REGISTER_CLOCK("imx-ssi.1", NULL, ssi2_clk)
1442 _REGISTER_CLOCK("imx-ssi.2", NULL, ssi3_clk) 1454 _REGISTER_CLOCK("imx-ssi.2", NULL, ssi3_clk)
1443 _REGISTER_CLOCK("imx-sdma", NULL, sdma_clk) 1455 /* i.mx51 has the i.mx35 type sdma */
1456 _REGISTER_CLOCK("imx35-sdma", NULL, sdma_clk)
1444 _REGISTER_CLOCK(NULL, "ckih", ckih_clk) 1457 _REGISTER_CLOCK(NULL, "ckih", ckih_clk)
1445 _REGISTER_CLOCK(NULL, "ckih2", ckih2_clk) 1458 _REGISTER_CLOCK(NULL, "ckih2", ckih2_clk)
1446 _REGISTER_CLOCK(NULL, "gpt_32k", gpt_32k_clk) 1459 _REGISTER_CLOCK(NULL, "gpt_32k", gpt_32k_clk)
1447 _REGISTER_CLOCK("imx51-ecspi.0", NULL, ecspi1_clk) 1460 _REGISTER_CLOCK("imx51-ecspi.0", NULL, ecspi1_clk)
1448 _REGISTER_CLOCK("imx51-ecspi.1", NULL, ecspi2_clk) 1461 _REGISTER_CLOCK("imx51-ecspi.1", NULL, ecspi2_clk)
1449 _REGISTER_CLOCK("imx51-cspi.0", NULL, cspi_clk) 1462 /* i.mx51 has the i.mx35 type cspi */
1450 _REGISTER_CLOCK("sdhci-esdhc-imx.0", NULL, esdhc1_clk) 1463 _REGISTER_CLOCK("imx35-cspi.0", NULL, cspi_clk)
1451 _REGISTER_CLOCK("sdhci-esdhc-imx.1", NULL, esdhc2_clk) 1464 _REGISTER_CLOCK("sdhci-esdhc-imx51.0", NULL, esdhc1_clk)
1452 _REGISTER_CLOCK("sdhci-esdhc-imx.2", NULL, esdhc3_clk) 1465 _REGISTER_CLOCK("sdhci-esdhc-imx51.1", NULL, esdhc2_clk)
1453 _REGISTER_CLOCK("sdhci-esdhc-imx.3", NULL, esdhc4_clk) 1466 _REGISTER_CLOCK("sdhci-esdhc-imx51.2", NULL, esdhc3_clk)
1467 _REGISTER_CLOCK("sdhci-esdhc-imx51.3", NULL, esdhc4_clk)
1454 _REGISTER_CLOCK(NULL, "cpu_clk", cpu_clk) 1468 _REGISTER_CLOCK(NULL, "cpu_clk", cpu_clk)
1455 _REGISTER_CLOCK(NULL, "iim_clk", iim_clk) 1469 _REGISTER_CLOCK(NULL, "iim_clk", iim_clk)
1456 _REGISTER_CLOCK("imx2-wdt.0", NULL, dummy_clk) 1470 _REGISTER_CLOCK("imx2-wdt.0", NULL, dummy_clk)
@@ -1463,23 +1477,36 @@ static struct clk_lookup mx51_lookups[] = {
1463}; 1477};
1464 1478
1465static struct clk_lookup mx53_lookups[] = { 1479static struct clk_lookup mx53_lookups[] = {
1466 _REGISTER_CLOCK("imx-uart.0", NULL, uart1_clk) 1480 /* i.mx53 has the i.mx21 type uart */
1467 _REGISTER_CLOCK("imx-uart.1", NULL, uart2_clk) 1481 _REGISTER_CLOCK("imx21-uart.0", NULL, uart1_clk)
1468 _REGISTER_CLOCK("imx-uart.2", NULL, uart3_clk) 1482 _REGISTER_CLOCK("imx21-uart.1", NULL, uart2_clk)
1483 _REGISTER_CLOCK("imx21-uart.2", NULL, uart3_clk)
1484 _REGISTER_CLOCK("imx21-uart.3", NULL, uart4_clk)
1485 _REGISTER_CLOCK("imx21-uart.4", NULL, uart5_clk)
1469 _REGISTER_CLOCK(NULL, "gpt", gpt_clk) 1486 _REGISTER_CLOCK(NULL, "gpt", gpt_clk)
1470 _REGISTER_CLOCK("fec.0", NULL, fec_clk) 1487 /* i.mx53 has the i.mx25 type fec */
1488 _REGISTER_CLOCK("imx25-fec.0", NULL, fec_clk)
1471 _REGISTER_CLOCK(NULL, "iim_clk", iim_clk) 1489 _REGISTER_CLOCK(NULL, "iim_clk", iim_clk)
1472 _REGISTER_CLOCK("imx-i2c.0", NULL, i2c1_clk) 1490 _REGISTER_CLOCK("imx-i2c.0", NULL, i2c1_clk)
1473 _REGISTER_CLOCK("imx-i2c.1", NULL, i2c2_clk) 1491 _REGISTER_CLOCK("imx-i2c.1", NULL, i2c2_clk)
1474 _REGISTER_CLOCK("sdhci-esdhc-imx.0", NULL, esdhc1_clk) 1492 _REGISTER_CLOCK("imx-i2c.2", NULL, i2c3_mx53_clk)
1475 _REGISTER_CLOCK("sdhci-esdhc-imx.1", NULL, esdhc2_mx53_clk) 1493 /* i.mx53 has the i.mx51 type ecspi */
1476 _REGISTER_CLOCK("sdhci-esdhc-imx.2", NULL, esdhc3_mx53_clk) 1494 _REGISTER_CLOCK("imx51-ecspi.0", NULL, ecspi1_clk)
1477 _REGISTER_CLOCK("sdhci-esdhc-imx.3", NULL, esdhc4_mx53_clk) 1495 _REGISTER_CLOCK("imx51-ecspi.1", NULL, ecspi2_clk)
1478 _REGISTER_CLOCK("imx53-ecspi.0", NULL, ecspi1_clk) 1496 /* i.mx53 has the i.mx25 type cspi */
1479 _REGISTER_CLOCK("imx53-ecspi.1", NULL, ecspi2_clk) 1497 _REGISTER_CLOCK("imx35-cspi.0", NULL, cspi_clk)
1480 _REGISTER_CLOCK("imx53-cspi.0", NULL, cspi_clk) 1498 _REGISTER_CLOCK("sdhci-esdhc-imx53.0", NULL, esdhc1_clk)
1499 _REGISTER_CLOCK("sdhci-esdhc-imx53.1", NULL, esdhc2_mx53_clk)
1500 _REGISTER_CLOCK("sdhci-esdhc-imx53.2", NULL, esdhc3_mx53_clk)
1501 _REGISTER_CLOCK("sdhci-esdhc-imx53.3", NULL, esdhc4_mx53_clk)
1481 _REGISTER_CLOCK("imx2-wdt.0", NULL, dummy_clk) 1502 _REGISTER_CLOCK("imx2-wdt.0", NULL, dummy_clk)
1482 _REGISTER_CLOCK("imx2-wdt.1", NULL, dummy_clk) 1503 _REGISTER_CLOCK("imx2-wdt.1", NULL, dummy_clk)
1504 /* i.mx53 has the i.mx35 type sdma */
1505 _REGISTER_CLOCK("imx35-sdma", NULL, sdma_clk)
1506 _REGISTER_CLOCK("imx-ssi.0", NULL, ssi1_clk)
1507 _REGISTER_CLOCK("imx-ssi.1", NULL, ssi2_clk)
1508 _REGISTER_CLOCK("imx-ssi.2", NULL, ssi3_clk)
1509 _REGISTER_CLOCK("imx-keypad", NULL, dummy_clk)
1483}; 1510};
1484 1511
1485static void clk_tree_init(void) 1512static void clk_tree_init(void)
diff --git a/arch/arm/mach-mx5/crm_regs.h b/arch/arm/mach-mx5/crm_regs.h
index 87c0c58f27a7..5e11ba7daee2 100644
--- a/arch/arm/mach-mx5/crm_regs.h
+++ b/arch/arm/mach-mx5/crm_regs.h
@@ -114,6 +114,8 @@
114#define MXC_CCM_CCGR4 (MX51_CCM_BASE + 0x78) 114#define MXC_CCM_CCGR4 (MX51_CCM_BASE + 0x78)
115#define MXC_CCM_CCGR5 (MX51_CCM_BASE + 0x7C) 115#define MXC_CCM_CCGR5 (MX51_CCM_BASE + 0x7C)
116#define MXC_CCM_CCGR6 (MX51_CCM_BASE + 0x80) 116#define MXC_CCM_CCGR6 (MX51_CCM_BASE + 0x80)
117#define MXC_CCM_CCGR7 (MX51_CCM_BASE + 0x84)
118
117#define MXC_CCM_CMEOR (MX51_CCM_BASE + 0x84) 119#define MXC_CCM_CMEOR (MX51_CCM_BASE + 0x84)
118 120
119/* Define the bits in register CCR */ 121/* Define the bits in register CCR */
diff --git a/arch/arm/mach-mx5/devices-imx53.h b/arch/arm/mach-mx5/devices-imx53.h
index 48f4c8cc42f5..c27fe8bb4762 100644
--- a/arch/arm/mach-mx5/devices-imx53.h
+++ b/arch/arm/mach-mx5/devices-imx53.h
@@ -32,3 +32,11 @@ extern const struct imx_spi_imx_data imx53_ecspi_data[];
32extern const struct imx_imx2_wdt_data imx53_imx2_wdt_data[]; 32extern const struct imx_imx2_wdt_data imx53_imx2_wdt_data[];
33#define imx53_add_imx2_wdt(id, pdata) \ 33#define imx53_add_imx2_wdt(id, pdata) \
34 imx_add_imx2_wdt(&imx53_imx2_wdt_data[id]) 34 imx_add_imx2_wdt(&imx53_imx2_wdt_data[id])
35
36extern const struct imx_imx_ssi_data imx53_imx_ssi_data[];
37#define imx53_add_imx_ssi(id, pdata) \
38 imx_add_imx_ssi(&imx53_imx_ssi_data[id], pdata)
39
40extern const struct imx_imx_keypad_data imx53_imx_keypad_data;
41#define imx53_add_imx_keypad(pdata) \
42 imx_add_imx_keypad(&imx53_imx_keypad_data, pdata)
diff --git a/arch/arm/mach-mx5/devices.c b/arch/arm/mach-mx5/devices.c
index 153ada53e575..371ca8c8414c 100644
--- a/arch/arm/mach-mx5/devices.c
+++ b/arch/arm/mach-mx5/devices.c
@@ -12,7 +12,6 @@
12 12
13#include <linux/platform_device.h> 13#include <linux/platform_device.h>
14#include <linux/dma-mapping.h> 14#include <linux/dma-mapping.h>
15#include <linux/gpio.h>
16#include <mach/hardware.h> 15#include <mach/hardware.h>
17#include <mach/imx-uart.h> 16#include <mach/imx-uart.h>
18#include <mach/irqs.h> 17#include <mach/irqs.h>
@@ -119,66 +118,3 @@ struct platform_device mxc_usbh2_device = {
119 .coherent_dma_mask = DMA_BIT_MASK(32), 118 .coherent_dma_mask = DMA_BIT_MASK(32),
120 }, 119 },
121}; 120};
122
123static struct mxc_gpio_port mxc_gpio_ports[] = {
124 {
125 .chip.label = "gpio-0",
126 .base = MX51_IO_ADDRESS(MX51_GPIO1_BASE_ADDR),
127 .irq = MX51_MXC_INT_GPIO1_LOW,
128 .irq_high = MX51_MXC_INT_GPIO1_HIGH,
129 .virtual_irq_start = MXC_GPIO_IRQ_START
130 },
131 {
132 .chip.label = "gpio-1",
133 .base = MX51_IO_ADDRESS(MX51_GPIO2_BASE_ADDR),
134 .irq = MX51_MXC_INT_GPIO2_LOW,
135 .irq_high = MX51_MXC_INT_GPIO2_HIGH,
136 .virtual_irq_start = MXC_GPIO_IRQ_START + 32 * 1
137 },
138 {
139 .chip.label = "gpio-2",
140 .base = MX51_IO_ADDRESS(MX51_GPIO3_BASE_ADDR),
141 .irq = MX51_MXC_INT_GPIO3_LOW,
142 .irq_high = MX51_MXC_INT_GPIO3_HIGH,
143 .virtual_irq_start = MXC_GPIO_IRQ_START + 32 * 2
144 },
145 {
146 .chip.label = "gpio-3",
147 .base = MX51_IO_ADDRESS(MX51_GPIO4_BASE_ADDR),
148 .irq = MX51_MXC_INT_GPIO4_LOW,
149 .irq_high = MX51_MXC_INT_GPIO4_HIGH,
150 .virtual_irq_start = MXC_GPIO_IRQ_START + 32 * 3
151 },
152 {
153 .chip.label = "gpio-4",
154 .base = MX53_IO_ADDRESS(MX53_GPIO5_BASE_ADDR),
155 .irq = MX53_INT_GPIO5_LOW,
156 .irq_high = MX53_INT_GPIO5_HIGH,
157 .virtual_irq_start = MXC_GPIO_IRQ_START + 32 * 4
158 },
159 {
160 .chip.label = "gpio-5",
161 .base = MX53_IO_ADDRESS(MX53_GPIO6_BASE_ADDR),
162 .irq = MX53_INT_GPIO6_LOW,
163 .irq_high = MX53_INT_GPIO6_HIGH,
164 .virtual_irq_start = MXC_GPIO_IRQ_START + 32 * 5
165 },
166 {
167 .chip.label = "gpio-6",
168 .base = MX53_IO_ADDRESS(MX53_GPIO7_BASE_ADDR),
169 .irq = MX53_INT_GPIO7_LOW,
170 .irq_high = MX53_INT_GPIO7_HIGH,
171 .virtual_irq_start = MXC_GPIO_IRQ_START + 32 * 6
172 },
173};
174
175int __init imx51_register_gpios(void)
176{
177 return mxc_gpio_init(mxc_gpio_ports, 4);
178}
179
180int __init imx53_register_gpios(void)
181{
182 return mxc_gpio_init(mxc_gpio_ports, ARRAY_SIZE(mxc_gpio_ports));
183}
184
diff --git a/arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c b/arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c
index 97292d20f1f3..bbf4564bd050 100644
--- a/arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c
+++ b/arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c
@@ -31,13 +31,12 @@
31#include "devices.h" 31#include "devices.h"
32 32
33#define MBIMX51_TSC2007_GPIO IMX_GPIO_NR(3, 30) 33#define MBIMX51_TSC2007_GPIO IMX_GPIO_NR(3, 30)
34#define MBIMX51_TSC2007_IRQ (MXC_INTERNAL_IRQS + MBIMX51_TSC2007_GPIO)
35#define MBIMX51_LED0 IMX_GPIO_NR(3, 5) 34#define MBIMX51_LED0 IMX_GPIO_NR(3, 5)
36#define MBIMX51_LED1 IMX_GPIO_NR(3, 6) 35#define MBIMX51_LED1 IMX_GPIO_NR(3, 6)
37#define MBIMX51_LED2 IMX_GPIO_NR(3, 7) 36#define MBIMX51_LED2 IMX_GPIO_NR(3, 7)
38#define MBIMX51_LED3 IMX_GPIO_NR(3, 8) 37#define MBIMX51_LED3 IMX_GPIO_NR(3, 8)
39 38
40static struct gpio_led mbimx51_leds[] = { 39static const struct gpio_led mbimx51_leds[] __initconst = {
41 { 40 {
42 .name = "led0", 41 .name = "led0",
43 .default_trigger = "heartbeat", 42 .default_trigger = "heartbeat",
@@ -64,23 +63,11 @@ static struct gpio_led mbimx51_leds[] = {
64 }, 63 },
65}; 64};
66 65
67static struct gpio_led_platform_data mbimx51_leds_info = { 66static const struct gpio_led_platform_data mbimx51_leds_info __initconst = {
68 .leds = mbimx51_leds, 67 .leds = mbimx51_leds,
69 .num_leds = ARRAY_SIZE(mbimx51_leds), 68 .num_leds = ARRAY_SIZE(mbimx51_leds),
70}; 69};
71 70
72static struct platform_device mbimx51_leds_gpio = {
73 .name = "leds-gpio",
74 .id = -1,
75 .dev = {
76 .platform_data = &mbimx51_leds_info,
77 },
78};
79
80static struct platform_device *devices[] __initdata = {
81 &mbimx51_leds_gpio,
82};
83
84static iomux_v3_cfg_t mbimx51_pads[] = { 71static iomux_v3_cfg_t mbimx51_pads[] = {
85 /* UART2 */ 72 /* UART2 */
86 MX51_PAD_UART2_RXD__UART2_RXD, 73 MX51_PAD_UART2_RXD__UART2_RXD,
@@ -173,7 +160,7 @@ struct tsc2007_platform_data tsc2007_data = {
173static struct i2c_board_info mbimx51_i2c_devices[] = { 160static struct i2c_board_info mbimx51_i2c_devices[] = {
174 { 161 {
175 I2C_BOARD_INFO("tsc2007", 0x49), 162 I2C_BOARD_INFO("tsc2007", 0x49),
176 .irq = MBIMX51_TSC2007_IRQ, 163 .irq = gpio_to_irq(MBIMX51_TSC2007_GPIO),
177 .platform_data = &tsc2007_data, 164 .platform_data = &tsc2007_data,
178 }, { 165 }, {
179 I2C_BOARD_INFO("tlv320aic23", 0x1a), 166 I2C_BOARD_INFO("tlv320aic23", 0x1a),
@@ -204,13 +191,14 @@ void __init eukrea_mbimx51_baseboard_init(void)
204 gpio_direction_output(MBIMX51_LED3, 1); 191 gpio_direction_output(MBIMX51_LED3, 1);
205 gpio_free(MBIMX51_LED3); 192 gpio_free(MBIMX51_LED3);
206 193
207 platform_add_devices(devices, ARRAY_SIZE(devices)); 194 gpio_led_register_device(-1, &mbimx51_leds_info);
208 195
209 imx51_add_imx_keypad(&mbimx51_map_data); 196 imx51_add_imx_keypad(&mbimx51_map_data);
210 197
211 gpio_request(MBIMX51_TSC2007_GPIO, "tsc2007_irq"); 198 gpio_request(MBIMX51_TSC2007_GPIO, "tsc2007_irq");
212 gpio_direction_input(MBIMX51_TSC2007_GPIO); 199 gpio_direction_input(MBIMX51_TSC2007_GPIO);
213 irq_set_irq_type(MBIMX51_TSC2007_IRQ, IRQF_TRIGGER_FALLING); 200 irq_set_irq_type(gpio_to_irq(MBIMX51_TSC2007_GPIO),
201 IRQF_TRIGGER_FALLING);
214 i2c_register_board_info(1, mbimx51_i2c_devices, 202 i2c_register_board_info(1, mbimx51_i2c_devices,
215 ARRAY_SIZE(mbimx51_i2c_devices)); 203 ARRAY_SIZE(mbimx51_i2c_devices));
216 204
diff --git a/arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c b/arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c
index 31c871ec46a6..261923997643 100644
--- a/arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c
+++ b/arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c
@@ -74,7 +74,7 @@ static iomux_v3_cfg_t eukrea_mbimxsd_pads[] = {
74#define GPIO_LED1 IMX_GPIO_NR(3, 30) 74#define GPIO_LED1 IMX_GPIO_NR(3, 30)
75#define GPIO_SWITCH1 IMX_GPIO_NR(3, 31) 75#define GPIO_SWITCH1 IMX_GPIO_NR(3, 31)
76 76
77static struct gpio_led eukrea_mbimxsd_leds[] = { 77static const struct gpio_led eukrea_mbimxsd_leds[] __initconst = {
78 { 78 {
79 .name = "led1", 79 .name = "led1",
80 .default_trigger = "heartbeat", 80 .default_trigger = "heartbeat",
@@ -83,19 +83,12 @@ static struct gpio_led eukrea_mbimxsd_leds[] = {
83 }, 83 },
84}; 84};
85 85
86static struct gpio_led_platform_data eukrea_mbimxsd_led_info = { 86static const struct gpio_led_platform_data
87 eukrea_mbimxsd_led_info __initconst = {
87 .leds = eukrea_mbimxsd_leds, 88 .leds = eukrea_mbimxsd_leds,
88 .num_leds = ARRAY_SIZE(eukrea_mbimxsd_leds), 89 .num_leds = ARRAY_SIZE(eukrea_mbimxsd_leds),
89}; 90};
90 91
91static struct platform_device eukrea_mbimxsd_leds_gpio = {
92 .name = "leds-gpio",
93 .id = -1,
94 .dev = {
95 .platform_data = &eukrea_mbimxsd_led_info,
96 },
97};
98
99static struct gpio_keys_button eukrea_mbimxsd_gpio_buttons[] = { 92static struct gpio_keys_button eukrea_mbimxsd_gpio_buttons[] = {
100 { 93 {
101 .gpio = GPIO_SWITCH1, 94 .gpio = GPIO_SWITCH1,
@@ -112,10 +105,6 @@ static const struct gpio_keys_platform_data
112 .nbuttons = ARRAY_SIZE(eukrea_mbimxsd_gpio_buttons), 105 .nbuttons = ARRAY_SIZE(eukrea_mbimxsd_gpio_buttons),
113}; 106};
114 107
115static struct platform_device *platform_devices[] __initdata = {
116 &eukrea_mbimxsd_leds_gpio,
117};
118
119static const struct imxuart_platform_data uart_pdata __initconst = { 108static const struct imxuart_platform_data uart_pdata __initconst = {
120 .flags = IMXUART_HAVE_RTSCTS, 109 .flags = IMXUART_HAVE_RTSCTS,
121}; 110};
@@ -154,6 +143,6 @@ void __init eukrea_mbimxsd51_baseboard_init(void)
154 i2c_register_board_info(0, eukrea_mbimxsd_i2c_devices, 143 i2c_register_board_info(0, eukrea_mbimxsd_i2c_devices,
155 ARRAY_SIZE(eukrea_mbimxsd_i2c_devices)); 144 ARRAY_SIZE(eukrea_mbimxsd_i2c_devices));
156 145
157 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); 146 gpio_led_register_device(-1, &eukrea_mbimxsd_led_info);
158 imx_add_gpio_keys(&eukrea_mbimxsd_button_data); 147 imx_add_gpio_keys(&eukrea_mbimxsd_button_data);
159} 148}
diff --git a/arch/arm/mach-mx5/mm-mx50.c b/arch/arm/mach-mx5/mm-mx50.c
index b9c363b514a9..77e374c726fa 100644
--- a/arch/arm/mach-mx5/mm-mx50.c
+++ b/arch/arm/mach-mx5/mm-mx50.c
@@ -26,7 +26,6 @@
26#include <mach/hardware.h> 26#include <mach/hardware.h>
27#include <mach/common.h> 27#include <mach/common.h>
28#include <mach/iomux-v3.h> 28#include <mach/iomux-v3.h>
29#include <mach/gpio.h>
30#include <mach/irqs.h> 29#include <mach/irqs.h>
31 30
32/* 31/*
@@ -56,17 +55,18 @@ void __init imx50_init_early(void)
56 mxc_arch_reset_init(MX50_IO_ADDRESS(MX50_WDOG_BASE_ADDR)); 55 mxc_arch_reset_init(MX50_IO_ADDRESS(MX50_WDOG_BASE_ADDR));
57} 56}
58 57
59static struct mxc_gpio_port imx50_gpio_ports[] = {
60 DEFINE_IMX_GPIO_PORT_IRQ_HIGH(MX50, 0, 1, MX50_INT_GPIO1_LOW, MX50_INT_GPIO1_HIGH),
61 DEFINE_IMX_GPIO_PORT_IRQ_HIGH(MX50, 1, 2, MX50_INT_GPIO2_LOW, MX50_INT_GPIO2_HIGH),
62 DEFINE_IMX_GPIO_PORT_IRQ_HIGH(MX50, 2, 3, MX50_INT_GPIO3_LOW, MX50_INT_GPIO3_HIGH),
63 DEFINE_IMX_GPIO_PORT_IRQ_HIGH(MX50, 3, 4, MX50_INT_GPIO3_LOW, MX50_INT_GPIO3_HIGH),
64 DEFINE_IMX_GPIO_PORT_IRQ_HIGH(MX50, 4, 5, MX50_INT_GPIO3_LOW, MX50_INT_GPIO3_HIGH),
65 DEFINE_IMX_GPIO_PORT_IRQ_HIGH(MX50, 5, 6, MX50_INT_GPIO3_LOW, MX50_INT_GPIO3_HIGH),
66};
67
68void __init mx50_init_irq(void) 58void __init mx50_init_irq(void)
69{ 59{
70 tzic_init_irq(MX50_IO_ADDRESS(MX50_TZIC_BASE_ADDR)); 60 tzic_init_irq(MX50_IO_ADDRESS(MX50_TZIC_BASE_ADDR));
71 mxc_gpio_init(imx50_gpio_ports, ARRAY_SIZE(imx50_gpio_ports)); 61}
62
63void __init imx50_soc_init(void)
64{
65 /* i.mx50 has the i.mx31 type gpio */
66 mxc_register_gpio("imx31-gpio", 0, MX50_GPIO1_BASE_ADDR, SZ_16K, MX50_INT_GPIO1_LOW, MX50_INT_GPIO1_HIGH);
67 mxc_register_gpio("imx31-gpio", 1, MX50_GPIO2_BASE_ADDR, SZ_16K, MX50_INT_GPIO2_LOW, MX50_INT_GPIO2_HIGH);
68 mxc_register_gpio("imx31-gpio", 2, MX50_GPIO3_BASE_ADDR, SZ_16K, MX50_INT_GPIO3_LOW, MX50_INT_GPIO3_HIGH);
69 mxc_register_gpio("imx31-gpio", 3, MX50_GPIO4_BASE_ADDR, SZ_16K, MX50_INT_GPIO4_LOW, MX50_INT_GPIO4_HIGH);
70 mxc_register_gpio("imx31-gpio", 4, MX50_GPIO5_BASE_ADDR, SZ_16K, MX50_INT_GPIO5_LOW, MX50_INT_GPIO5_HIGH);
71 mxc_register_gpio("imx31-gpio", 5, MX50_GPIO6_BASE_ADDR, SZ_16K, MX50_INT_GPIO6_LOW, MX50_INT_GPIO6_HIGH);
72} 72}
diff --git a/arch/arm/mach-mx5/mm.c b/arch/arm/mach-mx5/mm.c
index ff557301b42b..baea6e5cddd9 100644
--- a/arch/arm/mach-mx5/mm.c
+++ b/arch/arm/mach-mx5/mm.c
@@ -18,6 +18,7 @@
18 18
19#include <mach/hardware.h> 19#include <mach/hardware.h>
20#include <mach/common.h> 20#include <mach/common.h>
21#include <mach/devices-common.h>
21#include <mach/iomux-v3.h> 22#include <mach/iomux-v3.h>
22 23
23/* 24/*
@@ -69,8 +70,6 @@ void __init imx53_init_early(void)
69 mxc_arch_reset_init(MX53_IO_ADDRESS(MX53_WDOG1_BASE_ADDR)); 70 mxc_arch_reset_init(MX53_IO_ADDRESS(MX53_WDOG1_BASE_ADDR));
70} 71}
71 72
72int imx51_register_gpios(void);
73
74void __init mx51_init_irq(void) 73void __init mx51_init_irq(void)
75{ 74{
76 unsigned long tzic_addr; 75 unsigned long tzic_addr;
@@ -86,11 +85,8 @@ void __init mx51_init_irq(void)
86 panic("unable to map TZIC interrupt controller\n"); 85 panic("unable to map TZIC interrupt controller\n");
87 86
88 tzic_init_irq(tzic_virt); 87 tzic_init_irq(tzic_virt);
89 imx51_register_gpios();
90} 88}
91 89
92int imx53_register_gpios(void);
93
94void __init mx53_init_irq(void) 90void __init mx53_init_irq(void)
95{ 91{
96 unsigned long tzic_addr; 92 unsigned long tzic_addr;
@@ -103,5 +99,68 @@ void __init mx53_init_irq(void)
103 panic("unable to map TZIC interrupt controller\n"); 99 panic("unable to map TZIC interrupt controller\n");
104 100
105 tzic_init_irq(tzic_virt); 101 tzic_init_irq(tzic_virt);
106 imx53_register_gpios(); 102}
103
104static struct sdma_script_start_addrs imx51_sdma_script __initdata = {
105 .ap_2_ap_addr = 642,
106 .uart_2_mcu_addr = 817,
107 .mcu_2_app_addr = 747,
108 .mcu_2_shp_addr = 961,
109 .ata_2_mcu_addr = 1473,
110 .mcu_2_ata_addr = 1392,
111 .app_2_per_addr = 1033,
112 .app_2_mcu_addr = 683,
113 .shp_2_per_addr = 1251,
114 .shp_2_mcu_addr = 892,
115};
116
117static struct sdma_platform_data imx51_sdma_pdata __initdata = {
118 .fw_name = "sdma-imx51.bin",
119 .script_addrs = &imx51_sdma_script,
120};
121
122static struct sdma_script_start_addrs imx53_sdma_script __initdata = {
123 .ap_2_ap_addr = 642,
124 .app_2_mcu_addr = 683,
125 .mcu_2_app_addr = 747,
126 .uart_2_mcu_addr = 817,
127 .shp_2_mcu_addr = 891,
128 .mcu_2_shp_addr = 960,
129 .uartsh_2_mcu_addr = 1032,
130 .spdif_2_mcu_addr = 1100,
131 .mcu_2_spdif_addr = 1134,
132 .firi_2_mcu_addr = 1193,
133 .mcu_2_firi_addr = 1290,
134};
135
136static struct sdma_platform_data imx53_sdma_pdata __initdata = {
137 .fw_name = "sdma-imx53.bin",
138 .script_addrs = &imx53_sdma_script,
139};
140
141void __init imx51_soc_init(void)
142{
143 /* i.mx51 has the i.mx31 type gpio */
144 mxc_register_gpio("imx31-gpio", 0, MX51_GPIO1_BASE_ADDR, SZ_16K, MX51_MXC_INT_GPIO1_LOW, MX51_MXC_INT_GPIO1_HIGH);
145 mxc_register_gpio("imx31-gpio", 1, MX51_GPIO2_BASE_ADDR, SZ_16K, MX51_MXC_INT_GPIO2_LOW, MX51_MXC_INT_GPIO2_HIGH);
146 mxc_register_gpio("imx31-gpio", 2, MX51_GPIO3_BASE_ADDR, SZ_16K, MX51_MXC_INT_GPIO3_LOW, MX51_MXC_INT_GPIO3_HIGH);
147 mxc_register_gpio("imx31-gpio", 3, MX51_GPIO4_BASE_ADDR, SZ_16K, MX51_MXC_INT_GPIO4_LOW, MX51_MXC_INT_GPIO4_HIGH);
148
149 /* i.mx51 has the i.mx35 type sdma */
150 imx_add_imx_sdma("imx35-sdma", MX51_SDMA_BASE_ADDR, MX51_INT_SDMA, &imx51_sdma_pdata);
151}
152
153void __init imx53_soc_init(void)
154{
155 /* i.mx53 has the i.mx31 type gpio */
156 mxc_register_gpio("imx31-gpio", 0, MX53_GPIO1_BASE_ADDR, SZ_16K, MX53_INT_GPIO1_LOW, MX53_INT_GPIO1_HIGH);
157 mxc_register_gpio("imx31-gpio", 1, MX53_GPIO2_BASE_ADDR, SZ_16K, MX53_INT_GPIO2_LOW, MX53_INT_GPIO2_HIGH);
158 mxc_register_gpio("imx31-gpio", 2, MX53_GPIO3_BASE_ADDR, SZ_16K, MX53_INT_GPIO3_LOW, MX53_INT_GPIO3_HIGH);
159 mxc_register_gpio("imx31-gpio", 3, MX53_GPIO4_BASE_ADDR, SZ_16K, MX53_INT_GPIO4_LOW, MX53_INT_GPIO4_HIGH);
160 mxc_register_gpio("imx31-gpio", 4, MX53_GPIO5_BASE_ADDR, SZ_16K, MX53_INT_GPIO5_LOW, MX53_INT_GPIO5_HIGH);
161 mxc_register_gpio("imx31-gpio", 5, MX53_GPIO6_BASE_ADDR, SZ_16K, MX53_INT_GPIO6_LOW, MX53_INT_GPIO6_HIGH);
162 mxc_register_gpio("imx31-gpio", 6, MX53_GPIO7_BASE_ADDR, SZ_16K, MX53_INT_GPIO7_LOW, MX53_INT_GPIO7_HIGH);
163
164 /* i.mx53 has the i.mx35 type sdma */
165 imx_add_imx_sdma("imx35-sdma", MX53_SDMA_BASE_ADDR, MX53_INT_SDMA, &imx53_sdma_pdata);
107} 166}
diff --git a/arch/arm/mach-mx5/mx51_efika.c b/arch/arm/mach-mx5/mx51_efika.c
index 1105ef3d22a4..c9209454807a 100644
--- a/arch/arm/mach-mx5/mx51_efika.c
+++ b/arch/arm/mach-mx5/mx51_efika.c
@@ -260,8 +260,8 @@ static struct regulator_consumer_supply vvideo_consumers[] = {
260}; 260};
261 261
262static struct regulator_consumer_supply vsd_consumers[] = { 262static struct regulator_consumer_supply vsd_consumers[] = {
263 REGULATOR_SUPPLY("vmmc", "sdhci-esdhc-imx.0"), 263 REGULATOR_SUPPLY("vmmc", "sdhci-esdhc-imx51.0"),
264 REGULATOR_SUPPLY("vmmc", "sdhci-esdhc-imx.1"), 264 REGULATOR_SUPPLY("vmmc", "sdhci-esdhc-imx51.1"),
265}; 265};
266 266
267static struct regulator_consumer_supply pwgt1_consumer[] = { 267static struct regulator_consumer_supply pwgt1_consumer[] = {
diff --git a/arch/arm/mach-mx5/pm-imx5.c b/arch/arm/mach-mx5/pm-imx5.c
new file mode 100644
index 000000000000..e4529af0da72
--- /dev/null
+++ b/arch/arm/mach-mx5/pm-imx5.c
@@ -0,0 +1,73 @@
1/*
2 * Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved.
3 *
4 * The code contained herein is licensed under the GNU General Public
5 * License. You may obtain a copy of the GNU General Public License
6 * Version 2 or later at the following locations:
7 *
8 * http://www.opensource.org/licenses/gpl-license.html
9 * http://www.gnu.org/copyleft/gpl.html
10 */
11#include <linux/suspend.h>
12#include <linux/clk.h>
13#include <linux/io.h>
14#include <linux/err.h>
15#include <asm/cacheflush.h>
16#include <asm/tlbflush.h>
17#include <mach/system.h>
18#include "crm_regs.h"
19
20static struct clk *gpc_dvfs_clk;
21
22static int mx5_suspend_enter(suspend_state_t state)
23{
24 clk_enable(gpc_dvfs_clk);
25 switch (state) {
26 case PM_SUSPEND_MEM:
27 mx5_cpu_lp_set(STOP_POWER_OFF);
28 break;
29 case PM_SUSPEND_STANDBY:
30 mx5_cpu_lp_set(WAIT_UNCLOCKED_POWER_OFF);
31 break;
32 default:
33 return -EINVAL;
34 }
35
36 if (state == PM_SUSPEND_MEM) {
37 local_flush_tlb_all();
38 flush_cache_all();
39
40 /*clear the EMPGC0/1 bits */
41 __raw_writel(0, MXC_SRPG_EMPGC0_SRPGCR);
42 __raw_writel(0, MXC_SRPG_EMPGC1_SRPGCR);
43 }
44 cpu_do_idle();
45 clk_disable(gpc_dvfs_clk);
46
47 return 0;
48}
49
50static int mx5_pm_valid(suspend_state_t state)
51{
52 return (state > PM_SUSPEND_ON && state <= PM_SUSPEND_MAX);
53}
54
55static const struct platform_suspend_ops mx5_suspend_ops = {
56 .valid = mx5_pm_valid,
57 .enter = mx5_suspend_enter,
58};
59
60static int __init mx5_pm_init(void)
61{
62 if (gpc_dvfs_clk == NULL)
63 gpc_dvfs_clk = clk_get(NULL, "gpc_dvfs");
64
65 if (!IS_ERR(gpc_dvfs_clk)) {
66 if (cpu_is_mx51())
67 suspend_set_ops(&mx5_suspend_ops);
68 } else
69 return -EPERM;
70
71 return 0;
72}
73device_initcall(mx5_pm_init);