diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-07-31 09:20:16 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-07-31 09:20:16 -0400 |
commit | 7b70c4275f28702b76b273c8534c38f8313812e9 (patch) | |
tree | 1df2229ca02466bd1adda814ac5c37aa0a597db1 /arch/arm/mach-mx3 | |
parent | ceb0885d3b01bb2e2f18765770e212914f2864be (diff) | |
parent | a20df564d15bd28e3df24e1c65b885bd74d23f17 (diff) |
Merge branch 'devel-stable' into devel
Conflicts:
arch/arm/kernel/entry-armv.S
arch/arm/kernel/setup.c
arch/arm/mm/init.c
Diffstat (limited to 'arch/arm/mach-mx3')
27 files changed, 873 insertions, 621 deletions
diff --git a/arch/arm/mach-mx3/Kconfig b/arch/arm/mach-mx3/Kconfig index 344753fdf25e..85beece802aa 100644 --- a/arch/arm/mach-mx3/Kconfig +++ b/arch/arm/mach-mx3/Kconfig | |||
@@ -15,6 +15,8 @@ comment "MX3 platforms:" | |||
15 | config MACH_MX31ADS | 15 | config MACH_MX31ADS |
16 | bool "Support MX31ADS platforms" | 16 | bool "Support MX31ADS platforms" |
17 | select ARCH_MX31 | 17 | select ARCH_MX31 |
18 | select IMX_HAVE_PLATFORM_IMX_I2C | ||
19 | select IMX_HAVE_PLATFORM_IMX_UART | ||
18 | default y | 20 | default y |
19 | help | 21 | help |
20 | Include support for MX31ADS platform. This includes specific | 22 | Include support for MX31ADS platform. This includes specific |
@@ -34,6 +36,9 @@ config MACH_MX31ADS_WM1133_EV1 | |||
34 | config MACH_PCM037 | 36 | config MACH_PCM037 |
35 | bool "Support Phytec pcm037 (i.MX31) platforms" | 37 | bool "Support Phytec pcm037 (i.MX31) platforms" |
36 | select ARCH_MX31 | 38 | select ARCH_MX31 |
39 | select IMX_HAVE_PLATFORM_IMX_I2C | ||
40 | select IMX_HAVE_PLATFORM_IMX_UART | ||
41 | select IMX_HAVE_PLATFORM_MXC_NAND | ||
37 | select MXC_ULPI if USB_ULPI | 42 | select MXC_ULPI if USB_ULPI |
38 | help | 43 | help |
39 | Include support for Phytec pcm037 platform. This includes | 44 | Include support for Phytec pcm037 platform. This includes |
@@ -42,6 +47,7 @@ config MACH_PCM037 | |||
42 | config MACH_PCM037_EET | 47 | config MACH_PCM037_EET |
43 | bool "Support pcm037 EET board extensions" | 48 | bool "Support pcm037 EET board extensions" |
44 | depends on MACH_PCM037 | 49 | depends on MACH_PCM037 |
50 | select IMX_HAVE_PLATFORM_SPI_IMX | ||
45 | help | 51 | help |
46 | Add support for PCM037 EET baseboard extensions. If you are using the | 52 | Add support for PCM037 EET baseboard extensions. If you are using the |
47 | OLED display with EET, use "video=mx3fb:CMEL-OLED" kernel | 53 | OLED display with EET, use "video=mx3fb:CMEL-OLED" kernel |
@@ -51,6 +57,9 @@ config MACH_MX31LITE | |||
51 | bool "Support MX31 LITEKIT (LogicPD)" | 57 | bool "Support MX31 LITEKIT (LogicPD)" |
52 | select ARCH_MX31 | 58 | select ARCH_MX31 |
53 | select MXC_ULPI if USB_ULPI | 59 | select MXC_ULPI if USB_ULPI |
60 | select IMX_HAVE_PLATFORM_IMX_UART | ||
61 | select IMX_HAVE_PLATFORM_MXC_NAND | ||
62 | select IMX_HAVE_PLATFORM_SPI_IMX | ||
54 | help | 63 | help |
55 | Include support for MX31 LITEKIT platform. This includes specific | 64 | Include support for MX31 LITEKIT platform. This includes specific |
56 | configurations for the board and its peripherals. | 65 | configurations for the board and its peripherals. |
@@ -58,6 +67,10 @@ config MACH_MX31LITE | |||
58 | config MACH_MX31_3DS | 67 | config MACH_MX31_3DS |
59 | bool "Support MX31PDK (3DS)" | 68 | bool "Support MX31PDK (3DS)" |
60 | select ARCH_MX31 | 69 | select ARCH_MX31 |
70 | select MXC_DEBUG_BOARD | ||
71 | select IMX_HAVE_PLATFORM_IMX_UART | ||
72 | select IMX_HAVE_PLATFORM_MXC_NAND | ||
73 | select IMX_HAVE_PLATFORM_SPI_IMX | ||
61 | help | 74 | help |
62 | Include support for MX31PDK (3DS) platform. This includes specific | 75 | Include support for MX31PDK (3DS) platform. This includes specific |
63 | configurations for the board and its peripherals. | 76 | configurations for the board and its peripherals. |
@@ -74,6 +87,9 @@ config MACH_MX31_3DS_MXC_NAND_USE_BBT | |||
74 | config MACH_MX31MOBOARD | 87 | config MACH_MX31MOBOARD |
75 | bool "Support mx31moboard platforms (EPFL Mobots group)" | 88 | bool "Support mx31moboard platforms (EPFL Mobots group)" |
76 | select ARCH_MX31 | 89 | select ARCH_MX31 |
90 | select IMX_HAVE_PLATFORM_IMX_I2C | ||
91 | select IMX_HAVE_PLATFORM_IMX_UART | ||
92 | select IMX_HAVE_PLATFORM_SPI_IMX | ||
77 | select MXC_ULPI if USB_ULPI | 93 | select MXC_ULPI if USB_ULPI |
78 | help | 94 | help |
79 | Include support for mx31moboard platform. This includes specific | 95 | Include support for mx31moboard platform. This includes specific |
@@ -82,6 +98,8 @@ config MACH_MX31MOBOARD | |||
82 | config MACH_MX31LILLY | 98 | config MACH_MX31LILLY |
83 | bool "Support MX31 LILLY-1131 platforms (INCO startec)" | 99 | bool "Support MX31 LILLY-1131 platforms (INCO startec)" |
84 | select ARCH_MX31 | 100 | select ARCH_MX31 |
101 | select IMX_HAVE_PLATFORM_IMX_UART | ||
102 | select IMX_HAVE_PLATFORM_SPI_IMX | ||
85 | select MXC_ULPI if USB_ULPI | 103 | select MXC_ULPI if USB_ULPI |
86 | help | 104 | help |
87 | Include support for mx31 based LILLY1131 modules. This includes | 105 | Include support for mx31 based LILLY1131 modules. This includes |
@@ -90,6 +108,7 @@ config MACH_MX31LILLY | |||
90 | config MACH_QONG | 108 | config MACH_QONG |
91 | bool "Support Dave/DENX QongEVB-LITE platform" | 109 | bool "Support Dave/DENX QongEVB-LITE platform" |
92 | select ARCH_MX31 | 110 | select ARCH_MX31 |
111 | select IMX_HAVE_PLATFORM_IMX_UART | ||
93 | help | 112 | help |
94 | Include support for Dave/DENX QongEVB-LITE platform. This includes | 113 | Include support for Dave/DENX QongEVB-LITE platform. This includes |
95 | specific configurations for the board and its peripherals. | 114 | specific configurations for the board and its peripherals. |
@@ -97,6 +116,10 @@ config MACH_QONG | |||
97 | config MACH_PCM043 | 116 | config MACH_PCM043 |
98 | bool "Support Phytec pcm043 (i.MX35) platforms" | 117 | bool "Support Phytec pcm043 (i.MX35) platforms" |
99 | select ARCH_MX35 | 118 | select ARCH_MX35 |
119 | select IMX_HAVE_PLATFORM_IMX_I2C | ||
120 | select IMX_HAVE_PLATFORM_IMX_UART | ||
121 | select IMX_HAVE_PLATFORM_MXC_NAND | ||
122 | select IMX_HAVE_PLATFORM_FLEXCAN | ||
100 | select MXC_ULPI if USB_ULPI | 123 | select MXC_ULPI if USB_ULPI |
101 | help | 124 | help |
102 | Include support for Phytec pcm043 platform. This includes | 125 | Include support for Phytec pcm043 platform. This includes |
@@ -105,6 +128,9 @@ config MACH_PCM043 | |||
105 | config MACH_ARMADILLO5X0 | 128 | config MACH_ARMADILLO5X0 |
106 | bool "Support Atmark Armadillo-500 Development Base Board" | 129 | bool "Support Atmark Armadillo-500 Development Base Board" |
107 | select ARCH_MX31 | 130 | select ARCH_MX31 |
131 | select IMX_HAVE_PLATFORM_IMX_I2C | ||
132 | select IMX_HAVE_PLATFORM_IMX_UART | ||
133 | select IMX_HAVE_PLATFORM_MXC_NAND | ||
108 | select MXC_ULPI if USB_ULPI | 134 | select MXC_ULPI if USB_ULPI |
109 | help | 135 | help |
110 | Include support for Atmark Armadillo-500 platform. This includes | 136 | Include support for Atmark Armadillo-500 platform. This includes |
@@ -113,6 +139,7 @@ config MACH_ARMADILLO5X0 | |||
113 | config MACH_MX35_3DS | 139 | config MACH_MX35_3DS |
114 | bool "Support MX35PDK platform" | 140 | bool "Support MX35PDK platform" |
115 | select ARCH_MX35 | 141 | select ARCH_MX35 |
142 | select IMX_HAVE_PLATFORM_IMX_UART | ||
116 | default n | 143 | default n |
117 | help | 144 | help |
118 | Include support for MX35PDK platform. This includes specific | 145 | Include support for MX35PDK platform. This includes specific |
@@ -121,8 +148,34 @@ config MACH_MX35_3DS | |||
121 | config MACH_KZM_ARM11_01 | 148 | config MACH_KZM_ARM11_01 |
122 | bool "Support KZM-ARM11-01(Kyoto Microcomputer)" | 149 | bool "Support KZM-ARM11-01(Kyoto Microcomputer)" |
123 | select ARCH_MX31 | 150 | select ARCH_MX31 |
151 | select IMX_HAVE_PLATFORM_IMX_UART | ||
124 | help | 152 | help |
125 | Include support for KZM-ARM11-01. This includes specific | 153 | Include support for KZM-ARM11-01. This includes specific |
126 | configurations for the board and its peripherals. | 154 | configurations for the board and its peripherals. |
127 | 155 | ||
156 | config MACH_EUKREA_CPUIMX35 | ||
157 | bool "Support Eukrea CPUIMX35 Platform" | ||
158 | select ARCH_MX35 | ||
159 | select IMX_HAVE_PLATFORM_IMX_UART | ||
160 | select IMX_HAVE_PLATFORM_IMX_I2C | ||
161 | select IMX_HAVE_PLATFORM_MXC_NAND | ||
162 | select MXC_ULPI if USB_ULPI | ||
163 | help | ||
164 | Include support for Eukrea CPUIMX35 platform. This includes | ||
165 | specific configurations for the board and its peripherals. | ||
166 | |||
167 | choice | ||
168 | prompt "Baseboard" | ||
169 | depends on MACH_EUKREA_CPUIMX35 | ||
170 | default MACH_EUKREA_MBIMXSD35_BASEBOARD | ||
171 | |||
172 | config MACH_EUKREA_MBIMXSD35_BASEBOARD | ||
173 | prompt "Eukrea MBIMXSD development board" | ||
174 | bool | ||
175 | help | ||
176 | This adds board specific devices that can be found on Eukrea's | ||
177 | MBIMXSD evaluation board. | ||
178 | |||
179 | endchoice | ||
180 | |||
128 | endif | 181 | endif |
diff --git a/arch/arm/mach-mx3/Makefile b/arch/arm/mach-mx3/Makefile index 5d650fda5d5d..2bd7beceb991 100644 --- a/arch/arm/mach-mx3/Makefile +++ b/arch/arm/mach-mx3/Makefile | |||
@@ -22,5 +22,7 @@ obj-$(CONFIG_MACH_MX31MOBOARD) += mach-mx31moboard.o mx31moboard-devboard.o \ | |||
22 | obj-$(CONFIG_MACH_QONG) += mach-qong.o | 22 | obj-$(CONFIG_MACH_QONG) += mach-qong.o |
23 | obj-$(CONFIG_MACH_PCM043) += mach-pcm043.o | 23 | obj-$(CONFIG_MACH_PCM043) += mach-pcm043.o |
24 | obj-$(CONFIG_MACH_ARMADILLO5X0) += mach-armadillo5x0.o | 24 | obj-$(CONFIG_MACH_ARMADILLO5X0) += mach-armadillo5x0.o |
25 | obj-$(CONFIG_MACH_MX35_3DS) += mach-mx35pdk.o | 25 | obj-$(CONFIG_MACH_MX35_3DS) += mach-mx35_3ds.o |
26 | obj-$(CONFIG_MACH_KZM_ARM11_01) += mach-kzm_arm11_01.o | 26 | obj-$(CONFIG_MACH_KZM_ARM11_01) += mach-kzm_arm11_01.o |
27 | obj-$(CONFIG_MACH_EUKREA_CPUIMX35) += mach-cpuimx35.o | ||
28 | obj-$(CONFIG_MACH_EUKREA_MBIMXSD35_BASEBOARD) += eukrea_mbimxsd-baseboard.o | ||
diff --git a/arch/arm/mach-mx3/clock-imx35.c b/arch/arm/mach-mx3/clock-imx35.c index 9f3e943e2232..d3af0fdf8475 100644 --- a/arch/arm/mach-mx3/clock-imx35.c +++ b/arch/arm/mach-mx3/clock-imx35.c | |||
@@ -359,7 +359,7 @@ DEFINE_CLOCK(i2c1_clk, 0, CCM_CGR1, 10, get_rate_ipg_per, NULL); | |||
359 | DEFINE_CLOCK(i2c2_clk, 1, CCM_CGR1, 12, get_rate_ipg_per, NULL); | 359 | DEFINE_CLOCK(i2c2_clk, 1, CCM_CGR1, 12, get_rate_ipg_per, NULL); |
360 | DEFINE_CLOCK(i2c3_clk, 2, CCM_CGR1, 14, get_rate_ipg_per, NULL); | 360 | DEFINE_CLOCK(i2c3_clk, 2, CCM_CGR1, 14, get_rate_ipg_per, NULL); |
361 | DEFINE_CLOCK(iomuxc_clk, 0, CCM_CGR1, 16, NULL, NULL); | 361 | DEFINE_CLOCK(iomuxc_clk, 0, CCM_CGR1, 16, NULL, NULL); |
362 | DEFINE_CLOCK(ipu_clk, 0, CCM_CGR1, 18, NULL, NULL); | 362 | DEFINE_CLOCK(ipu_clk, 0, CCM_CGR1, 18, get_rate_ahb, NULL); |
363 | DEFINE_CLOCK(kpp_clk, 0, CCM_CGR1, 20, get_rate_ipg, NULL); | 363 | DEFINE_CLOCK(kpp_clk, 0, CCM_CGR1, 20, get_rate_ipg, NULL); |
364 | DEFINE_CLOCK(mlb_clk, 0, CCM_CGR1, 22, get_rate_ahb, NULL); | 364 | DEFINE_CLOCK(mlb_clk, 0, CCM_CGR1, 22, get_rate_ahb, NULL); |
365 | DEFINE_CLOCK(mshc_clk, 0, CCM_CGR1, 24, get_rate_mshc, NULL); | 365 | DEFINE_CLOCK(mshc_clk, 0, CCM_CGR1, 24, get_rate_mshc, NULL); |
@@ -428,8 +428,8 @@ static struct clk nfc_clk = { | |||
428 | static struct clk_lookup lookups[] = { | 428 | static struct clk_lookup lookups[] = { |
429 | _REGISTER_CLOCK(NULL, "asrc", asrc_clk) | 429 | _REGISTER_CLOCK(NULL, "asrc", asrc_clk) |
430 | _REGISTER_CLOCK(NULL, "ata", ata_clk) | 430 | _REGISTER_CLOCK(NULL, "ata", ata_clk) |
431 | _REGISTER_CLOCK(NULL, "can", can1_clk) | 431 | _REGISTER_CLOCK("flexcan.0", NULL, can1_clk) |
432 | _REGISTER_CLOCK(NULL, "can", can2_clk) | 432 | _REGISTER_CLOCK("flexcan.1", NULL, can2_clk) |
433 | _REGISTER_CLOCK("spi_imx.0", NULL, cspi1_clk) | 433 | _REGISTER_CLOCK("spi_imx.0", NULL, cspi1_clk) |
434 | _REGISTER_CLOCK("spi_imx.1", NULL, cspi2_clk) | 434 | _REGISTER_CLOCK("spi_imx.1", NULL, cspi2_clk) |
435 | _REGISTER_CLOCK(NULL, "ect", ect_clk) | 435 | _REGISTER_CLOCK(NULL, "ect", ect_clk) |
diff --git a/arch/arm/mach-mx3/devices-imx31.h b/arch/arm/mach-mx3/devices-imx31.h new file mode 100644 index 000000000000..3b1a44a20585 --- /dev/null +++ b/arch/arm/mach-mx3/devices-imx31.h | |||
@@ -0,0 +1,38 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Pengutronix | ||
3 | * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it under | ||
6 | * the terms of the GNU General Public License version 2 as published by the | ||
7 | * Free Software Foundation. | ||
8 | */ | ||
9 | #include <mach/mx31.h> | ||
10 | #include <mach/devices-common.h> | ||
11 | |||
12 | #define imx31_add_imx_i2c0(pdata) \ | ||
13 | imx_add_imx_i2c(0, MX31_I2C1_BASE_ADDR, SZ_4K, MX31_INT_I2C1, pdata) | ||
14 | #define imx31_add_imx_i2c1(pdata) \ | ||
15 | imx_add_imx_i2c(1, MX31_I2C2_BASE_ADDR, SZ_4K, MX31_INT_I2C2, pdata) | ||
16 | #define imx31_add_imx_i2c2(pdata) \ | ||
17 | imx_add_imx_i2c(2, MX31_I2C3_BASE_ADDR, SZ_4K, MX31_INT_I2C3, pdata) | ||
18 | |||
19 | #define imx31_add_imx_uart0(pdata) \ | ||
20 | imx_add_imx_uart_1irq(0, MX31_UART1_BASE_ADDR, SZ_16K, MX31_INT_UART1, pdata) | ||
21 | #define imx31_add_imx_uart1(pdata) \ | ||
22 | imx_add_imx_uart_1irq(1, MX31_UART2_BASE_ADDR, SZ_16K, MX31_INT_UART2, pdata) | ||
23 | #define imx31_add_imx_uart2(pdata) \ | ||
24 | imx_add_imx_uart_1irq(2, MX31_UART3_BASE_ADDR, SZ_16K, MX31_INT_UART3, pdata) | ||
25 | #define imx31_add_imx_uart3(pdata) \ | ||
26 | imx_add_imx_uart_1irq(3, MX31_UART4_BASE_ADDR, SZ_16K, MX31_INT_UART4, pdata) | ||
27 | #define imx31_add_imx_uart4(pdata) \ | ||
28 | imx_add_imx_uart_1irq(4, MX31_UART5_BASE_ADDR, SZ_16K, MX31_INT_UART5, pdata) | ||
29 | |||
30 | #define imx31_add_mxc_nand(pdata) \ | ||
31 | imx_add_mxc_nand_v1(MX31_NFC_BASE_ADDR, MX31_INT_NANDFC, pdata) | ||
32 | |||
33 | #define imx31_add_spi_imx0(pdata) \ | ||
34 | imx_add_spi_imx(0, MX31_CSPI1_BASE_ADDR, SZ_4K, MX31_INT_CSPI1, pdata) | ||
35 | #define imx31_add_spi_imx1(pdata) \ | ||
36 | imx_add_spi_imx(1, MX31_CSPI2_BASE_ADDR, SZ_4K, MX31_INT_CSPI2, pdata) | ||
37 | #define imx31_add_spi_imx2(pdata) \ | ||
38 | imx_add_spi_imx(2, MX31_CSPI3_BASE_ADDR, SZ_4K, MX31_INT_CSPI3, pdata) | ||
diff --git a/arch/arm/mach-mx3/devices-imx35.h b/arch/arm/mach-mx3/devices-imx35.h new file mode 100644 index 000000000000..f6a431a4c3d2 --- /dev/null +++ b/arch/arm/mach-mx3/devices-imx35.h | |||
@@ -0,0 +1,37 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Pengutronix | ||
3 | * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it under | ||
6 | * the terms of the GNU General Public License version 2 as published by the | ||
7 | * Free Software Foundation. | ||
8 | */ | ||
9 | #include <mach/mx35.h> | ||
10 | #include <mach/devices-common.h> | ||
11 | |||
12 | #define imx35_add_flexcan0(pdata) \ | ||
13 | imx_add_flexcan(0, MX35_CAN1_BASE_ADDR, SZ_16K, MX35_INT_CAN1, pdata) | ||
14 | #define imx35_add_flexcan1(pdata) \ | ||
15 | imx_add_flexcan(1, MX35_CAN2_BASE_ADDR, SZ_16K, MX35_INT_CAN2, pdata) | ||
16 | |||
17 | #define imx35_add_imx_i2c0(pdata) \ | ||
18 | imx_add_imx_i2c(0, MX35_I2C1_BASE_ADDR, SZ_4K, MX35_INT_I2C1, pdata) | ||
19 | #define imx35_add_imx_i2c1(pdata) \ | ||
20 | imx_add_imx_i2c(1, MX35_I2C2_BASE_ADDR, SZ_4K, MX35_INT_I2C2, pdata) | ||
21 | #define imx35_add_imx_i2c2(pdata) \ | ||
22 | imx_add_imx_i2c(2, MX35_I2C3_BASE_ADDR, SZ_4K, MX35_INT_I2C3, pdata) | ||
23 | |||
24 | #define imx35_add_imx_uart0(pdata) \ | ||
25 | imx_add_imx_uart_1irq(0, MX35_UART1_BASE_ADDR, SZ_16K, MX35_INT_UART1, pdata) | ||
26 | #define imx35_add_imx_uart1(pdata) \ | ||
27 | imx_add_imx_uart_1irq(1, MX35_UART2_BASE_ADDR, SZ_16K, MX35_INT_UART2, pdata) | ||
28 | #define imx35_add_imx_uart2(pdata) \ | ||
29 | imx_add_imx_uart_1irq(2, MX35_UART3_BASE_ADDR, SZ_16K, MX35_INT_UART3, pdata) | ||
30 | |||
31 | #define imx35_add_mxc_nand(pdata) \ | ||
32 | imx_add_mxc_nand_v21(MX35_NFC_BASE_ADDR, MX35_INT_NANDFC, pdata) | ||
33 | |||
34 | #define imx35_add_spi_imx0(pdata) \ | ||
35 | imx_add_spi_imx(0, MX35_CSPI1_BASE_ADDR, SZ_4K, MX35_INT_CSPI1, pdata) | ||
36 | #define imx35_add_spi_imx1(pdata) \ | ||
37 | imx_add_spi_imx(1, MX35_CSPI2_BASE_ADDR, SZ_4K, MX35_INT_CSPI2, pdata) | ||
diff --git a/arch/arm/mach-mx3/devices.c b/arch/arm/mach-mx3/devices.c index db7acd6e9101..a4fd1a26fc91 100644 --- a/arch/arm/mach-mx3/devices.c +++ b/arch/arm/mach-mx3/devices.c | |||
@@ -25,108 +25,10 @@ | |||
25 | #include <mach/hardware.h> | 25 | #include <mach/hardware.h> |
26 | #include <mach/irqs.h> | 26 | #include <mach/irqs.h> |
27 | #include <mach/common.h> | 27 | #include <mach/common.h> |
28 | #include <mach/imx-uart.h> | ||
29 | #include <mach/mx3_camera.h> | 28 | #include <mach/mx3_camera.h> |
30 | 29 | ||
31 | #include "devices.h" | 30 | #include "devices.h" |
32 | 31 | ||
33 | static struct resource uart0[] = { | ||
34 | { | ||
35 | .start = UART1_BASE_ADDR, | ||
36 | .end = UART1_BASE_ADDR + 0x0B5, | ||
37 | .flags = IORESOURCE_MEM, | ||
38 | }, { | ||
39 | .start = MXC_INT_UART1, | ||
40 | .end = MXC_INT_UART1, | ||
41 | .flags = IORESOURCE_IRQ, | ||
42 | }, | ||
43 | }; | ||
44 | |||
45 | struct platform_device mxc_uart_device0 = { | ||
46 | .name = "imx-uart", | ||
47 | .id = 0, | ||
48 | .resource = uart0, | ||
49 | .num_resources = ARRAY_SIZE(uart0), | ||
50 | }; | ||
51 | |||
52 | static struct resource uart1[] = { | ||
53 | { | ||
54 | .start = UART2_BASE_ADDR, | ||
55 | .end = UART2_BASE_ADDR + 0x0B5, | ||
56 | .flags = IORESOURCE_MEM, | ||
57 | }, { | ||
58 | .start = MXC_INT_UART2, | ||
59 | .end = MXC_INT_UART2, | ||
60 | .flags = IORESOURCE_IRQ, | ||
61 | }, | ||
62 | }; | ||
63 | |||
64 | struct platform_device mxc_uart_device1 = { | ||
65 | .name = "imx-uart", | ||
66 | .id = 1, | ||
67 | .resource = uart1, | ||
68 | .num_resources = ARRAY_SIZE(uart1), | ||
69 | }; | ||
70 | |||
71 | static struct resource uart2[] = { | ||
72 | { | ||
73 | .start = UART3_BASE_ADDR, | ||
74 | .end = UART3_BASE_ADDR + 0x0B5, | ||
75 | .flags = IORESOURCE_MEM, | ||
76 | }, { | ||
77 | .start = MXC_INT_UART3, | ||
78 | .end = MXC_INT_UART3, | ||
79 | .flags = IORESOURCE_IRQ, | ||
80 | }, | ||
81 | }; | ||
82 | |||
83 | struct platform_device mxc_uart_device2 = { | ||
84 | .name = "imx-uart", | ||
85 | .id = 2, | ||
86 | .resource = uart2, | ||
87 | .num_resources = ARRAY_SIZE(uart2), | ||
88 | }; | ||
89 | |||
90 | #ifdef CONFIG_ARCH_MX31 | ||
91 | static struct resource uart3[] = { | ||
92 | { | ||
93 | .start = UART4_BASE_ADDR, | ||
94 | .end = UART4_BASE_ADDR + 0x0B5, | ||
95 | .flags = IORESOURCE_MEM, | ||
96 | }, { | ||
97 | .start = MXC_INT_UART4, | ||
98 | .end = MXC_INT_UART4, | ||
99 | .flags = IORESOURCE_IRQ, | ||
100 | }, | ||
101 | }; | ||
102 | |||
103 | struct platform_device mxc_uart_device3 = { | ||
104 | .name = "imx-uart", | ||
105 | .id = 3, | ||
106 | .resource = uart3, | ||
107 | .num_resources = ARRAY_SIZE(uart3), | ||
108 | }; | ||
109 | |||
110 | static struct resource uart4[] = { | ||
111 | { | ||
112 | .start = UART5_BASE_ADDR, | ||
113 | .end = UART5_BASE_ADDR + 0x0B5, | ||
114 | .flags = IORESOURCE_MEM, | ||
115 | }, { | ||
116 | .start = MXC_INT_UART5, | ||
117 | .end = MXC_INT_UART5, | ||
118 | .flags = IORESOURCE_IRQ, | ||
119 | }, | ||
120 | }; | ||
121 | |||
122 | struct platform_device mxc_uart_device4 = { | ||
123 | .name = "imx-uart", | ||
124 | .id = 4, | ||
125 | .resource = uart4, | ||
126 | .num_resources = ARRAY_SIZE(uart4), | ||
127 | }; | ||
128 | #endif /* CONFIG_ARCH_MX31 */ | ||
129 | |||
130 | /* GPIO port description */ | 32 | /* GPIO port description */ |
131 | static struct mxc_gpio_port imx_gpio_ports[] = { | 33 | static struct mxc_gpio_port imx_gpio_ports[] = { |
132 | { | 34 | { |
@@ -147,7 +49,7 @@ static struct mxc_gpio_port imx_gpio_ports[] = { | |||
147 | } | 49 | } |
148 | }; | 50 | }; |
149 | 51 | ||
150 | int __init mxc_register_gpios(void) | 52 | int __init imx3x_register_gpios(void) |
151 | { | 53 | { |
152 | return mxc_gpio_init(imx_gpio_ports, ARRAY_SIZE(imx_gpio_ports)); | 54 | return mxc_gpio_init(imx_gpio_ports, ARRAY_SIZE(imx_gpio_ports)); |
153 | } | 55 | } |
@@ -167,82 +69,6 @@ struct platform_device mxc_w1_master_device = { | |||
167 | .resource = mxc_w1_master_resources, | 69 | .resource = mxc_w1_master_resources, |
168 | }; | 70 | }; |
169 | 71 | ||
170 | static struct resource mxc_nand_resources[] = { | ||
171 | { | ||
172 | .start = 0, /* runtime dependent */ | ||
173 | .end = 0, | ||
174 | .flags = IORESOURCE_MEM, | ||
175 | }, { | ||
176 | .start = MXC_INT_NANDFC, | ||
177 | .end = MXC_INT_NANDFC, | ||
178 | .flags = IORESOURCE_IRQ, | ||
179 | }, | ||
180 | }; | ||
181 | |||
182 | struct platform_device mxc_nand_device = { | ||
183 | .name = "mxc_nand", | ||
184 | .id = 0, | ||
185 | .num_resources = ARRAY_SIZE(mxc_nand_resources), | ||
186 | .resource = mxc_nand_resources, | ||
187 | }; | ||
188 | |||
189 | static struct resource mxc_i2c0_resources[] = { | ||
190 | { | ||
191 | .start = I2C_BASE_ADDR, | ||
192 | .end = I2C_BASE_ADDR + SZ_4K - 1, | ||
193 | .flags = IORESOURCE_MEM, | ||
194 | }, { | ||
195 | .start = MXC_INT_I2C, | ||
196 | .end = MXC_INT_I2C, | ||
197 | .flags = IORESOURCE_IRQ, | ||
198 | }, | ||
199 | }; | ||
200 | |||
201 | struct platform_device mxc_i2c_device0 = { | ||
202 | .name = "imx-i2c", | ||
203 | .id = 0, | ||
204 | .num_resources = ARRAY_SIZE(mxc_i2c0_resources), | ||
205 | .resource = mxc_i2c0_resources, | ||
206 | }; | ||
207 | |||
208 | static struct resource mxc_i2c1_resources[] = { | ||
209 | { | ||
210 | .start = I2C2_BASE_ADDR, | ||
211 | .end = I2C2_BASE_ADDR + SZ_4K - 1, | ||
212 | .flags = IORESOURCE_MEM, | ||
213 | }, { | ||
214 | .start = MXC_INT_I2C2, | ||
215 | .end = MXC_INT_I2C2, | ||
216 | .flags = IORESOURCE_IRQ, | ||
217 | }, | ||
218 | }; | ||
219 | |||
220 | struct platform_device mxc_i2c_device1 = { | ||
221 | .name = "imx-i2c", | ||
222 | .id = 1, | ||
223 | .num_resources = ARRAY_SIZE(mxc_i2c1_resources), | ||
224 | .resource = mxc_i2c1_resources, | ||
225 | }; | ||
226 | |||
227 | static struct resource mxc_i2c2_resources[] = { | ||
228 | { | ||
229 | .start = I2C3_BASE_ADDR, | ||
230 | .end = I2C3_BASE_ADDR + SZ_4K - 1, | ||
231 | .flags = IORESOURCE_MEM, | ||
232 | }, { | ||
233 | .start = MXC_INT_I2C3, | ||
234 | .end = MXC_INT_I2C3, | ||
235 | .flags = IORESOURCE_IRQ, | ||
236 | }, | ||
237 | }; | ||
238 | |||
239 | struct platform_device mxc_i2c_device2 = { | ||
240 | .name = "imx-i2c", | ||
241 | .id = 2, | ||
242 | .num_resources = ARRAY_SIZE(mxc_i2c2_resources), | ||
243 | .resource = mxc_i2c2_resources, | ||
244 | }; | ||
245 | |||
246 | #ifdef CONFIG_ARCH_MX31 | 72 | #ifdef CONFIG_ARCH_MX31 |
247 | static struct resource mxcsdhc0_resources[] = { | 73 | static struct resource mxcsdhc0_resources[] = { |
248 | { | 74 | { |
@@ -455,68 +281,7 @@ struct platform_device mxc_usbh2 = { | |||
455 | .num_resources = ARRAY_SIZE(mxc_usbh2_resources), | 281 | .num_resources = ARRAY_SIZE(mxc_usbh2_resources), |
456 | }; | 282 | }; |
457 | 283 | ||
458 | /* | 284 | #if defined(CONFIG_ARCH_MX35) |
459 | * SPI master controller | ||
460 | * 3 channels | ||
461 | */ | ||
462 | static struct resource mxc_spi_0_resources[] = { | ||
463 | { | ||
464 | .start = CSPI1_BASE_ADDR, | ||
465 | .end = CSPI1_BASE_ADDR + SZ_4K - 1, | ||
466 | .flags = IORESOURCE_MEM, | ||
467 | }, { | ||
468 | .start = MXC_INT_CSPI1, | ||
469 | .end = MXC_INT_CSPI1, | ||
470 | .flags = IORESOURCE_IRQ, | ||
471 | }, | ||
472 | }; | ||
473 | |||
474 | static struct resource mxc_spi_1_resources[] = { | ||
475 | { | ||
476 | .start = CSPI2_BASE_ADDR, | ||
477 | .end = CSPI2_BASE_ADDR + SZ_4K - 1, | ||
478 | .flags = IORESOURCE_MEM, | ||
479 | }, { | ||
480 | .start = MXC_INT_CSPI2, | ||
481 | .end = MXC_INT_CSPI2, | ||
482 | .flags = IORESOURCE_IRQ, | ||
483 | }, | ||
484 | }; | ||
485 | |||
486 | static struct resource mxc_spi_2_resources[] = { | ||
487 | { | ||
488 | .start = CSPI3_BASE_ADDR, | ||
489 | .end = CSPI3_BASE_ADDR + SZ_4K - 1, | ||
490 | .flags = IORESOURCE_MEM, | ||
491 | }, { | ||
492 | .start = MXC_INT_CSPI3, | ||
493 | .end = MXC_INT_CSPI3, | ||
494 | .flags = IORESOURCE_IRQ, | ||
495 | }, | ||
496 | }; | ||
497 | |||
498 | struct platform_device mxc_spi_device0 = { | ||
499 | .name = "spi_imx", | ||
500 | .id = 0, | ||
501 | .num_resources = ARRAY_SIZE(mxc_spi_0_resources), | ||
502 | .resource = mxc_spi_0_resources, | ||
503 | }; | ||
504 | |||
505 | struct platform_device mxc_spi_device1 = { | ||
506 | .name = "spi_imx", | ||
507 | .id = 1, | ||
508 | .num_resources = ARRAY_SIZE(mxc_spi_1_resources), | ||
509 | .resource = mxc_spi_1_resources, | ||
510 | }; | ||
511 | |||
512 | struct platform_device mxc_spi_device2 = { | ||
513 | .name = "spi_imx", | ||
514 | .id = 2, | ||
515 | .num_resources = ARRAY_SIZE(mxc_spi_2_resources), | ||
516 | .resource = mxc_spi_2_resources, | ||
517 | }; | ||
518 | |||
519 | #ifdef CONFIG_ARCH_MX35 | ||
520 | static struct resource mxc_fec_resources[] = { | 285 | static struct resource mxc_fec_resources[] = { |
521 | { | 286 | { |
522 | .start = MXC_FEC_BASE_ADDR, | 287 | .start = MXC_FEC_BASE_ADDR, |
@@ -628,16 +393,15 @@ struct platform_device imx_kpp_device = { | |||
628 | 393 | ||
629 | static int __init mx3_devices_init(void) | 394 | static int __init mx3_devices_init(void) |
630 | { | 395 | { |
396 | #if defined(CONFIG_ARCH_MX31) | ||
631 | if (cpu_is_mx31()) { | 397 | if (cpu_is_mx31()) { |
632 | mxc_nand_resources[0].start = MX31_NFC_BASE_ADDR; | ||
633 | mxc_nand_resources[0].end = MX31_NFC_BASE_ADDR + 0xfff; | ||
634 | imx_wdt_resources[0].start = MX31_WDOG_BASE_ADDR; | 398 | imx_wdt_resources[0].start = MX31_WDOG_BASE_ADDR; |
635 | imx_wdt_resources[0].end = MX31_WDOG_BASE_ADDR + 0x3fff; | 399 | imx_wdt_resources[0].end = MX31_WDOG_BASE_ADDR + 0x3fff; |
636 | mxc_register_device(&mxc_rnga_device, NULL); | 400 | mxc_register_device(&mxc_rnga_device, NULL); |
637 | } | 401 | } |
402 | #endif | ||
403 | #if defined(CONFIG_ARCH_MX35) | ||
638 | if (cpu_is_mx35()) { | 404 | if (cpu_is_mx35()) { |
639 | mxc_nand_resources[0].start = MX35_NFC_BASE_ADDR; | ||
640 | mxc_nand_resources[0].end = MX35_NFC_BASE_ADDR + 0x1fff; | ||
641 | otg_resources[0].start = MX35_OTG_BASE_ADDR; | 405 | otg_resources[0].start = MX35_OTG_BASE_ADDR; |
642 | otg_resources[0].end = MX35_OTG_BASE_ADDR + 0x1ff; | 406 | otg_resources[0].end = MX35_OTG_BASE_ADDR + 0x1ff; |
643 | otg_resources[1].start = MXC_INT_USBOTG; | 407 | otg_resources[1].start = MXC_INT_USBOTG; |
@@ -653,6 +417,7 @@ static int __init mx3_devices_init(void) | |||
653 | imx_wdt_resources[0].start = MX35_WDOG_BASE_ADDR; | 417 | imx_wdt_resources[0].start = MX35_WDOG_BASE_ADDR; |
654 | imx_wdt_resources[0].end = MX35_WDOG_BASE_ADDR + 0x3fff; | 418 | imx_wdt_resources[0].end = MX35_WDOG_BASE_ADDR + 0x3fff; |
655 | } | 419 | } |
420 | #endif | ||
656 | 421 | ||
657 | return 0; | 422 | return 0; |
658 | } | 423 | } |
diff --git a/arch/arm/mach-mx3/devices.h b/arch/arm/mach-mx3/devices.h index 2c3c8646a29e..e5535234839f 100644 --- a/arch/arm/mach-mx3/devices.h +++ b/arch/arm/mach-mx3/devices.h | |||
@@ -1,14 +1,4 @@ | |||
1 | |||
2 | extern struct platform_device mxc_uart_device0; | ||
3 | extern struct platform_device mxc_uart_device1; | ||
4 | extern struct platform_device mxc_uart_device2; | ||
5 | extern struct platform_device mxc_uart_device3; | ||
6 | extern struct platform_device mxc_uart_device4; | ||
7 | extern struct platform_device mxc_w1_master_device; | 1 | extern struct platform_device mxc_w1_master_device; |
8 | extern struct platform_device mxc_nand_device; | ||
9 | extern struct platform_device mxc_i2c_device0; | ||
10 | extern struct platform_device mxc_i2c_device1; | ||
11 | extern struct platform_device mxc_i2c_device2; | ||
12 | extern struct platform_device mx3_ipu; | 2 | extern struct platform_device mx3_ipu; |
13 | extern struct platform_device mx3_fb; | 3 | extern struct platform_device mx3_fb; |
14 | extern struct platform_device mx3_camera; | 4 | extern struct platform_device mx3_camera; |
@@ -20,9 +10,6 @@ extern struct platform_device mxc_otg_host; | |||
20 | extern struct platform_device mxc_usbh1; | 10 | extern struct platform_device mxc_usbh1; |
21 | extern struct platform_device mxc_usbh2; | 11 | extern struct platform_device mxc_usbh2; |
22 | extern struct platform_device mxc_rnga_device; | 12 | extern struct platform_device mxc_rnga_device; |
23 | extern struct platform_device mxc_spi_device0; | ||
24 | extern struct platform_device mxc_spi_device1; | ||
25 | extern struct platform_device mxc_spi_device2; | ||
26 | extern struct platform_device imx_ssi_device0; | 13 | extern struct platform_device imx_ssi_device0; |
27 | extern struct platform_device imx_ssi_device1; | 14 | extern struct platform_device imx_ssi_device1; |
28 | extern struct platform_device imx_ssi_device1; | 15 | extern struct platform_device imx_ssi_device1; |
diff --git a/arch/arm/mach-mx3/eukrea_mbimxsd-baseboard.c b/arch/arm/mach-mx3/eukrea_mbimxsd-baseboard.c new file mode 100644 index 000000000000..1dc5004df866 --- /dev/null +++ b/arch/arm/mach-mx3/eukrea_mbimxsd-baseboard.c | |||
@@ -0,0 +1,263 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Eric Benard - eric@eukrea.com | ||
3 | * | ||
4 | * Based on pcm970-baseboard.c which is : | ||
5 | * Copyright (C) 2008 Juergen Beisert (kernel@pengutronix.de) | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or | ||
8 | * modify it under the terms of the GNU General Public License | ||
9 | * as published by the Free Software Foundation; either version 2 | ||
10 | * of the License, or (at your option) any later version. | ||
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 | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | ||
19 | * MA 02110-1301, USA. | ||
20 | */ | ||
21 | |||
22 | #include <linux/types.h> | ||
23 | #include <linux/init.h> | ||
24 | |||
25 | #include <linux/gpio.h> | ||
26 | #include <linux/interrupt.h> | ||
27 | #include <linux/leds.h> | ||
28 | #include <linux/platform_device.h> | ||
29 | #include <linux/gpio_keys.h> | ||
30 | #include <linux/input.h> | ||
31 | #include <video/platform_lcd.h> | ||
32 | #include <linux/i2c.h> | ||
33 | |||
34 | #include <asm/mach-types.h> | ||
35 | #include <asm/mach/arch.h> | ||
36 | #include <asm/mach/time.h> | ||
37 | #include <asm/mach/map.h> | ||
38 | |||
39 | #include <mach/hardware.h> | ||
40 | #include <mach/common.h> | ||
41 | #include <mach/imx-uart.h> | ||
42 | #include <mach/iomux-mx35.h> | ||
43 | #include <mach/ipu.h> | ||
44 | #include <mach/mx3fb.h> | ||
45 | #include <mach/audmux.h> | ||
46 | #include <mach/ssi.h> | ||
47 | |||
48 | #include "devices-imx35.h" | ||
49 | #include "devices.h" | ||
50 | |||
51 | static const struct fb_videomode fb_modedb[] = { | ||
52 | { | ||
53 | .name = "CMO_QVGA", | ||
54 | .refresh = 60, | ||
55 | .xres = 320, | ||
56 | .yres = 240, | ||
57 | .pixclock = KHZ2PICOS(6500), | ||
58 | .left_margin = 68, | ||
59 | .right_margin = 20, | ||
60 | .upper_margin = 15, | ||
61 | .lower_margin = 4, | ||
62 | .hsync_len = 30, | ||
63 | .vsync_len = 3, | ||
64 | .sync = 0, | ||
65 | .vmode = FB_VMODE_NONINTERLACED, | ||
66 | .flag = 0, | ||
67 | }, | ||
68 | }; | ||
69 | |||
70 | static struct ipu_platform_data mx3_ipu_data = { | ||
71 | .irq_base = MXC_IPU_IRQ_START, | ||
72 | }; | ||
73 | |||
74 | static struct mx3fb_platform_data mx3fb_pdata = { | ||
75 | .dma_dev = &mx3_ipu.dev, | ||
76 | .name = "CMO_QVGA", | ||
77 | .mode = fb_modedb, | ||
78 | .num_modes = ARRAY_SIZE(fb_modedb), | ||
79 | }; | ||
80 | |||
81 | static struct pad_desc eukrea_mbimxsd_pads[] = { | ||
82 | /* LCD */ | ||
83 | MX35_PAD_LD0__IPU_DISPB_DAT_0, | ||
84 | MX35_PAD_LD1__IPU_DISPB_DAT_1, | ||
85 | MX35_PAD_LD2__IPU_DISPB_DAT_2, | ||
86 | MX35_PAD_LD3__IPU_DISPB_DAT_3, | ||
87 | MX35_PAD_LD4__IPU_DISPB_DAT_4, | ||
88 | MX35_PAD_LD5__IPU_DISPB_DAT_5, | ||
89 | MX35_PAD_LD6__IPU_DISPB_DAT_6, | ||
90 | MX35_PAD_LD7__IPU_DISPB_DAT_7, | ||
91 | MX35_PAD_LD8__IPU_DISPB_DAT_8, | ||
92 | MX35_PAD_LD9__IPU_DISPB_DAT_9, | ||
93 | MX35_PAD_LD10__IPU_DISPB_DAT_10, | ||
94 | MX35_PAD_LD11__IPU_DISPB_DAT_11, | ||
95 | MX35_PAD_LD12__IPU_DISPB_DAT_12, | ||
96 | MX35_PAD_LD13__IPU_DISPB_DAT_13, | ||
97 | MX35_PAD_LD14__IPU_DISPB_DAT_14, | ||
98 | MX35_PAD_LD15__IPU_DISPB_DAT_15, | ||
99 | MX35_PAD_LD16__IPU_DISPB_DAT_16, | ||
100 | MX35_PAD_LD17__IPU_DISPB_DAT_17, | ||
101 | MX35_PAD_D3_HSYNC__IPU_DISPB_D3_HSYNC, | ||
102 | MX35_PAD_D3_FPSHIFT__IPU_DISPB_D3_CLK, | ||
103 | MX35_PAD_D3_DRDY__IPU_DISPB_D3_DRDY, | ||
104 | MX35_PAD_D3_VSYNC__IPU_DISPB_D3_VSYNC, | ||
105 | /* Backlight */ | ||
106 | MX35_PAD_CONTRAST__IPU_DISPB_CONTR, | ||
107 | /* LCD_PWR */ | ||
108 | MX35_PAD_D3_CLS__GPIO1_4, | ||
109 | /* LED */ | ||
110 | MX35_PAD_LD23__GPIO3_29, | ||
111 | /* SWITCH */ | ||
112 | MX35_PAD_LD19__GPIO3_25, | ||
113 | /* UART2 */ | ||
114 | MX35_PAD_CTS2__UART2_CTS, | ||
115 | MX35_PAD_RTS2__UART2_RTS, | ||
116 | MX35_PAD_TXD2__UART2_TXD_MUX, | ||
117 | MX35_PAD_RXD2__UART2_RXD_MUX, | ||
118 | /* I2S */ | ||
119 | MX35_PAD_STXFS4__AUDMUX_AUD4_TXFS, | ||
120 | MX35_PAD_STXD4__AUDMUX_AUD4_TXD, | ||
121 | MX35_PAD_SRXD4__AUDMUX_AUD4_RXD, | ||
122 | MX35_PAD_SCK4__AUDMUX_AUD4_TXC, | ||
123 | }; | ||
124 | |||
125 | #define GPIO_LED1 (2 * 32 + 29) | ||
126 | #define GPIO_SWITCH1 (2 * 32 + 25) | ||
127 | #define GPIO_LCDPWR (4) | ||
128 | |||
129 | static void eukrea_mbimxsd_lcd_power_set(struct plat_lcd_data *pd, | ||
130 | unsigned int power) | ||
131 | { | ||
132 | if (power) | ||
133 | gpio_direction_output(GPIO_LCDPWR, 1); | ||
134 | else | ||
135 | gpio_direction_output(GPIO_LCDPWR, 0); | ||
136 | } | ||
137 | |||
138 | static struct plat_lcd_data eukrea_mbimxsd_lcd_power_data = { | ||
139 | .set_power = eukrea_mbimxsd_lcd_power_set, | ||
140 | }; | ||
141 | |||
142 | static struct platform_device eukrea_mbimxsd_lcd_powerdev = { | ||
143 | .name = "platform-lcd", | ||
144 | .dev.platform_data = &eukrea_mbimxsd_lcd_power_data, | ||
145 | }; | ||
146 | |||
147 | static struct gpio_led eukrea_mbimxsd_leds[] = { | ||
148 | { | ||
149 | .name = "led1", | ||
150 | .default_trigger = "heartbeat", | ||
151 | .active_low = 1, | ||
152 | .gpio = GPIO_LED1, | ||
153 | }, | ||
154 | }; | ||
155 | |||
156 | static struct gpio_led_platform_data eukrea_mbimxsd_led_info = { | ||
157 | .leds = eukrea_mbimxsd_leds, | ||
158 | .num_leds = ARRAY_SIZE(eukrea_mbimxsd_leds), | ||
159 | }; | ||
160 | |||
161 | static struct platform_device eukrea_mbimxsd_leds_gpio = { | ||
162 | .name = "leds-gpio", | ||
163 | .id = -1, | ||
164 | .dev = { | ||
165 | .platform_data = &eukrea_mbimxsd_led_info, | ||
166 | }, | ||
167 | }; | ||
168 | |||
169 | static struct gpio_keys_button eukrea_mbimxsd_gpio_buttons[] = { | ||
170 | { | ||
171 | .gpio = GPIO_SWITCH1, | ||
172 | .code = BTN_0, | ||
173 | .desc = "BP1", | ||
174 | .active_low = 1, | ||
175 | .wakeup = 1, | ||
176 | }, | ||
177 | }; | ||
178 | |||
179 | static struct gpio_keys_platform_data eukrea_mbimxsd_button_data = { | ||
180 | .buttons = eukrea_mbimxsd_gpio_buttons, | ||
181 | .nbuttons = ARRAY_SIZE(eukrea_mbimxsd_gpio_buttons), | ||
182 | }; | ||
183 | |||
184 | static struct platform_device eukrea_mbimxsd_button_device = { | ||
185 | .name = "gpio-keys", | ||
186 | .id = -1, | ||
187 | .num_resources = 0, | ||
188 | .dev = { | ||
189 | .platform_data = &eukrea_mbimxsd_button_data, | ||
190 | } | ||
191 | }; | ||
192 | |||
193 | static struct platform_device *platform_devices[] __initdata = { | ||
194 | &eukrea_mbimxsd_leds_gpio, | ||
195 | &eukrea_mbimxsd_button_device, | ||
196 | &eukrea_mbimxsd_lcd_powerdev, | ||
197 | }; | ||
198 | |||
199 | static const struct imxuart_platform_data uart_pdata __initconst = { | ||
200 | .flags = IMXUART_HAVE_RTSCTS, | ||
201 | }; | ||
202 | |||
203 | static struct i2c_board_info eukrea_mbimxsd_i2c_devices[] = { | ||
204 | { | ||
205 | I2C_BOARD_INFO("tlv320aic23", 0x1a), | ||
206 | }, | ||
207 | }; | ||
208 | |||
209 | struct imx_ssi_platform_data eukrea_mbimxsd_ssi_pdata = { | ||
210 | .flags = IMX_SSI_SYN | IMX_SSI_NET | IMX_SSI_USE_I2S_SLAVE, | ||
211 | }; | ||
212 | |||
213 | /* | ||
214 | * system init for baseboard usage. Will be called by cpuimx35 init. | ||
215 | * | ||
216 | * Add platform devices present on this baseboard and init | ||
217 | * them from CPU side as far as required to use them later on | ||
218 | */ | ||
219 | void __init eukrea_mbimxsd_baseboard_init(void) | ||
220 | { | ||
221 | if (mxc_iomux_v3_setup_multiple_pads(eukrea_mbimxsd_pads, | ||
222 | ARRAY_SIZE(eukrea_mbimxsd_pads))) | ||
223 | printk(KERN_ERR "error setting mbimxsd pads !\n"); | ||
224 | |||
225 | #if defined(CONFIG_SND_SOC_EUKREA_TLV320) | ||
226 | /* SSI unit master I2S codec connected to SSI_AUD4 */ | ||
227 | mxc_audmux_v2_configure_port(0, | ||
228 | MXC_AUDMUX_V2_PTCR_SYN | | ||
229 | MXC_AUDMUX_V2_PTCR_TFSDIR | | ||
230 | MXC_AUDMUX_V2_PTCR_TFSEL(3) | | ||
231 | MXC_AUDMUX_V2_PTCR_TCLKDIR | | ||
232 | MXC_AUDMUX_V2_PTCR_TCSEL(3), | ||
233 | MXC_AUDMUX_V2_PDCR_RXDSEL(3) | ||
234 | ); | ||
235 | mxc_audmux_v2_configure_port(3, | ||
236 | MXC_AUDMUX_V2_PTCR_SYN, | ||
237 | MXC_AUDMUX_V2_PDCR_RXDSEL(0) | ||
238 | ); | ||
239 | #endif | ||
240 | |||
241 | imx35_add_imx_uart1(&uart_pdata); | ||
242 | mxc_register_device(&mx3_ipu, &mx3_ipu_data); | ||
243 | mxc_register_device(&mx3_fb, &mx3fb_pdata); | ||
244 | |||
245 | mxc_register_device(&imx_ssi_device0, &eukrea_mbimxsd_ssi_pdata); | ||
246 | |||
247 | gpio_request(GPIO_LED1, "LED1"); | ||
248 | gpio_direction_output(GPIO_LED1, 1); | ||
249 | gpio_free(GPIO_LED1); | ||
250 | |||
251 | gpio_request(GPIO_SWITCH1, "SWITCH1"); | ||
252 | gpio_direction_input(GPIO_SWITCH1); | ||
253 | gpio_free(GPIO_SWITCH1); | ||
254 | |||
255 | gpio_request(GPIO_LCDPWR, "LCDPWR"); | ||
256 | gpio_direction_output(GPIO_LCDPWR, 1); | ||
257 | gpio_free(GPIO_SWITCH1); | ||
258 | |||
259 | i2c_register_board_info(0, eukrea_mbimxsd_i2c_devices, | ||
260 | ARRAY_SIZE(eukrea_mbimxsd_i2c_devices)); | ||
261 | |||
262 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); | ||
263 | } | ||
diff --git a/arch/arm/mach-mx3/mach-armadillo5x0.c b/arch/arm/mach-mx3/mach-armadillo5x0.c index 5f72ec91af2d..96aadcadb4ff 100644 --- a/arch/arm/mach-mx3/mach-armadillo5x0.c +++ b/arch/arm/mach-mx3/mach-armadillo5x0.c | |||
@@ -48,16 +48,14 @@ | |||
48 | #include <asm/mach/map.h> | 48 | #include <asm/mach/map.h> |
49 | 49 | ||
50 | #include <mach/common.h> | 50 | #include <mach/common.h> |
51 | #include <mach/imx-uart.h> | ||
52 | #include <mach/iomux-mx3.h> | 51 | #include <mach/iomux-mx3.h> |
53 | #include <mach/board-armadillo5x0.h> | ||
54 | #include <mach/mmc.h> | 52 | #include <mach/mmc.h> |
55 | #include <mach/ipu.h> | 53 | #include <mach/ipu.h> |
56 | #include <mach/mx3fb.h> | 54 | #include <mach/mx3fb.h> |
57 | #include <mach/mxc_nand.h> | ||
58 | #include <mach/mxc_ehci.h> | 55 | #include <mach/mxc_ehci.h> |
59 | #include <mach/ulpi.h> | 56 | #include <mach/ulpi.h> |
60 | 57 | ||
58 | #include "devices-imx31.h" | ||
61 | #include "devices.h" | 59 | #include "devices.h" |
62 | #include "crm_regs.h" | 60 | #include "crm_regs.h" |
63 | 61 | ||
@@ -301,7 +299,8 @@ static struct platform_device armadillo5x0_button_device = { | |||
301 | /* | 299 | /* |
302 | * NAND Flash | 300 | * NAND Flash |
303 | */ | 301 | */ |
304 | static struct mxc_nand_platform_data armadillo5x0_nand_flash_pdata = { | 302 | static const struct mxc_nand_platform_data |
303 | armadillo5x0_nand_board_info __initconst = { | ||
305 | .width = 1, | 304 | .width = 1, |
306 | .hw_ecc = 1, | 305 | .hw_ecc = 1, |
307 | }; | 306 | }; |
@@ -493,13 +492,12 @@ static struct platform_device armadillo5x0_smc911x_device = { | |||
493 | }; | 492 | }; |
494 | 493 | ||
495 | /* UART device data */ | 494 | /* UART device data */ |
496 | static struct imxuart_platform_data uart_pdata = { | 495 | static const struct imxuart_platform_data uart_pdata __initconst = { |
497 | .flags = IMXUART_HAVE_RTSCTS, | 496 | .flags = IMXUART_HAVE_RTSCTS, |
498 | }; | 497 | }; |
499 | 498 | ||
500 | static struct platform_device *devices[] __initdata = { | 499 | static struct platform_device *devices[] __initdata = { |
501 | &armadillo5x0_smc911x_device, | 500 | &armadillo5x0_smc911x_device, |
502 | &mxc_i2c_device1, | ||
503 | &armadillo5x0_button_device, | 501 | &armadillo5x0_button_device, |
504 | }; | 502 | }; |
505 | 503 | ||
@@ -512,10 +510,11 @@ static void __init armadillo5x0_init(void) | |||
512 | ARRAY_SIZE(armadillo5x0_pins), "armadillo5x0"); | 510 | ARRAY_SIZE(armadillo5x0_pins), "armadillo5x0"); |
513 | 511 | ||
514 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 512 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
513 | imx31_add_imx_i2c1(NULL); | ||
515 | 514 | ||
516 | /* Register UART */ | 515 | /* Register UART */ |
517 | mxc_register_device(&mxc_uart_device0, &uart_pdata); | 516 | imx31_add_imx_uart0(&uart_pdata); |
518 | mxc_register_device(&mxc_uart_device1, &uart_pdata); | 517 | imx31_add_imx_uart1(&uart_pdata); |
519 | 518 | ||
520 | /* SMSC9118 IRQ pin */ | 519 | /* SMSC9118 IRQ pin */ |
521 | gpio_direction_input(MX31_PIN_GPIO1_0); | 520 | gpio_direction_input(MX31_PIN_GPIO1_0); |
@@ -532,7 +531,7 @@ static void __init armadillo5x0_init(void) | |||
532 | &armadillo5x0_nor_flash_pdata); | 531 | &armadillo5x0_nor_flash_pdata); |
533 | 532 | ||
534 | /* Register NAND Flash */ | 533 | /* Register NAND Flash */ |
535 | mxc_register_device(&mxc_nand_device, &armadillo5x0_nand_flash_pdata); | 534 | imx31_add_mxc_nand(&armadillo5x0_nand_board_info); |
536 | 535 | ||
537 | /* set NAND page size to 2k if not configured via boot mode pins */ | 536 | /* set NAND page size to 2k if not configured via boot mode pins */ |
538 | __raw_writel(__raw_readl(MXC_CCM_RCSR) | (1 << 30), MXC_CCM_RCSR); | 537 | __raw_writel(__raw_readl(MXC_CCM_RCSR) | (1 << 30), MXC_CCM_RCSR); |
diff --git a/arch/arm/mach-mx3/mach-cpuimx35.c b/arch/arm/mach-mx3/mach-cpuimx35.c new file mode 100644 index 000000000000..63f970f340a2 --- /dev/null +++ b/arch/arm/mach-mx3/mach-cpuimx35.c | |||
@@ -0,0 +1,227 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Eric Benard - eric@eukrea.com | ||
3 | * Copyright (C) 2009 Sascha Hauer, Pengutronix | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | |||
20 | #include <linux/types.h> | ||
21 | #include <linux/init.h> | ||
22 | |||
23 | #include <linux/platform_device.h> | ||
24 | #include <linux/mtd/physmap.h> | ||
25 | #include <linux/memory.h> | ||
26 | #include <linux/gpio.h> | ||
27 | #include <linux/interrupt.h> | ||
28 | #include <linux/delay.h> | ||
29 | #include <linux/i2c.h> | ||
30 | #include <linux/i2c/tsc2007.h> | ||
31 | #include <linux/usb/otg.h> | ||
32 | #include <linux/usb/ulpi.h> | ||
33 | #include <linux/fsl_devices.h> | ||
34 | |||
35 | #include <asm/mach-types.h> | ||
36 | #include <asm/mach/arch.h> | ||
37 | #include <asm/mach/time.h> | ||
38 | #include <asm/mach/map.h> | ||
39 | |||
40 | #include <mach/eukrea-baseboards.h> | ||
41 | #include <mach/hardware.h> | ||
42 | #include <mach/common.h> | ||
43 | #include <mach/iomux-mx35.h> | ||
44 | #include <mach/mxc_nand.h> | ||
45 | #include <mach/mxc_ehci.h> | ||
46 | #include <mach/ulpi.h> | ||
47 | |||
48 | #include "devices-imx35.h" | ||
49 | #include "devices.h" | ||
50 | |||
51 | static const struct imxuart_platform_data uart_pdata __initconst = { | ||
52 | .flags = IMXUART_HAVE_RTSCTS, | ||
53 | }; | ||
54 | |||
55 | static const struct imxi2c_platform_data | ||
56 | eukrea_cpuimx35_i2c0_data __initconst = { | ||
57 | .bitrate = 50000, | ||
58 | }; | ||
59 | |||
60 | #define TSC2007_IRQGPIO (2 * 32 + 2) | ||
61 | static int ts_get_pendown_state(void) | ||
62 | { | ||
63 | int val = 0; | ||
64 | gpio_free(TSC2007_IRQGPIO); | ||
65 | gpio_request(TSC2007_IRQGPIO, NULL); | ||
66 | gpio_direction_input(TSC2007_IRQGPIO); | ||
67 | |||
68 | val = gpio_get_value(TSC2007_IRQGPIO); | ||
69 | |||
70 | gpio_free(TSC2007_IRQGPIO); | ||
71 | gpio_request(TSC2007_IRQGPIO, NULL); | ||
72 | |||
73 | return val ? 0 : 1; | ||
74 | } | ||
75 | |||
76 | static int ts_init(void) | ||
77 | { | ||
78 | gpio_request(TSC2007_IRQGPIO, NULL); | ||
79 | return 0; | ||
80 | } | ||
81 | |||
82 | static struct tsc2007_platform_data tsc2007_info = { | ||
83 | .model = 2007, | ||
84 | .x_plate_ohms = 180, | ||
85 | .get_pendown_state = ts_get_pendown_state, | ||
86 | .init_platform_hw = ts_init, | ||
87 | }; | ||
88 | |||
89 | static struct i2c_board_info eukrea_cpuimx35_i2c_devices[] = { | ||
90 | { | ||
91 | I2C_BOARD_INFO("pcf8563", 0x51), | ||
92 | }, { | ||
93 | I2C_BOARD_INFO("tsc2007", 0x48), | ||
94 | .type = "tsc2007", | ||
95 | .platform_data = &tsc2007_info, | ||
96 | .irq = gpio_to_irq(TSC2007_IRQGPIO), | ||
97 | }, | ||
98 | }; | ||
99 | |||
100 | static struct platform_device *devices[] __initdata = { | ||
101 | &mxc_fec_device, | ||
102 | &imx_wdt_device0, | ||
103 | }; | ||
104 | |||
105 | static struct pad_desc eukrea_cpuimx35_pads[] = { | ||
106 | /* UART1 */ | ||
107 | MX35_PAD_CTS1__UART1_CTS, | ||
108 | MX35_PAD_RTS1__UART1_RTS, | ||
109 | MX35_PAD_TXD1__UART1_TXD_MUX, | ||
110 | MX35_PAD_RXD1__UART1_RXD_MUX, | ||
111 | /* FEC */ | ||
112 | MX35_PAD_FEC_TX_CLK__FEC_TX_CLK, | ||
113 | MX35_PAD_FEC_RX_CLK__FEC_RX_CLK, | ||
114 | MX35_PAD_FEC_RX_DV__FEC_RX_DV, | ||
115 | MX35_PAD_FEC_COL__FEC_COL, | ||
116 | MX35_PAD_FEC_RDATA0__FEC_RDATA_0, | ||
117 | MX35_PAD_FEC_TDATA0__FEC_TDATA_0, | ||
118 | MX35_PAD_FEC_TX_EN__FEC_TX_EN, | ||
119 | MX35_PAD_FEC_MDC__FEC_MDC, | ||
120 | MX35_PAD_FEC_MDIO__FEC_MDIO, | ||
121 | MX35_PAD_FEC_TX_ERR__FEC_TX_ERR, | ||
122 | MX35_PAD_FEC_RX_ERR__FEC_RX_ERR, | ||
123 | MX35_PAD_FEC_CRS__FEC_CRS, | ||
124 | MX35_PAD_FEC_RDATA1__FEC_RDATA_1, | ||
125 | MX35_PAD_FEC_TDATA1__FEC_TDATA_1, | ||
126 | MX35_PAD_FEC_RDATA2__FEC_RDATA_2, | ||
127 | MX35_PAD_FEC_TDATA2__FEC_TDATA_2, | ||
128 | MX35_PAD_FEC_RDATA3__FEC_RDATA_3, | ||
129 | MX35_PAD_FEC_TDATA3__FEC_TDATA_3, | ||
130 | /* I2C1 */ | ||
131 | MX35_PAD_I2C1_CLK__I2C1_SCL, | ||
132 | MX35_PAD_I2C1_DAT__I2C1_SDA, | ||
133 | /* TSC2007 IRQ */ | ||
134 | MX35_PAD_ATA_DA2__GPIO3_2, | ||
135 | }; | ||
136 | |||
137 | static const struct mxc_nand_platform_data | ||
138 | eukrea_cpuimx35_nand_board_info __initconst = { | ||
139 | .width = 1, | ||
140 | .hw_ecc = 1, | ||
141 | .flash_bbt = 1, | ||
142 | }; | ||
143 | |||
144 | static struct mxc_usbh_platform_data otg_pdata = { | ||
145 | .portsc = MXC_EHCI_MODE_UTMI, | ||
146 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, | ||
147 | }; | ||
148 | |||
149 | static struct mxc_usbh_platform_data usbh1_pdata = { | ||
150 | .portsc = MXC_EHCI_MODE_SERIAL, | ||
151 | .flags = MXC_EHCI_INTERFACE_SINGLE_UNI | MXC_EHCI_INTERNAL_PHY | | ||
152 | MXC_EHCI_IPPUE_DOWN, | ||
153 | }; | ||
154 | |||
155 | static struct fsl_usb2_platform_data otg_device_pdata = { | ||
156 | .operating_mode = FSL_USB2_DR_DEVICE, | ||
157 | .phy_mode = FSL_USB2_PHY_UTMI, | ||
158 | }; | ||
159 | |||
160 | static int otg_mode_host; | ||
161 | |||
162 | static int __init eukrea_cpuimx35_otg_mode(char *options) | ||
163 | { | ||
164 | if (!strcmp(options, "host")) | ||
165 | otg_mode_host = 1; | ||
166 | else if (!strcmp(options, "device")) | ||
167 | otg_mode_host = 0; | ||
168 | else | ||
169 | pr_info("otg_mode neither \"host\" nor \"device\". " | ||
170 | "Defaulting to device\n"); | ||
171 | return 0; | ||
172 | } | ||
173 | __setup("otg_mode=", eukrea_cpuimx35_otg_mode); | ||
174 | |||
175 | /* | ||
176 | * Board specific initialization. | ||
177 | */ | ||
178 | static void __init mxc_board_init(void) | ||
179 | { | ||
180 | mxc_iomux_v3_setup_multiple_pads(eukrea_cpuimx35_pads, | ||
181 | ARRAY_SIZE(eukrea_cpuimx35_pads)); | ||
182 | |||
183 | platform_add_devices(devices, ARRAY_SIZE(devices)); | ||
184 | |||
185 | imx35_add_imx_uart0(&uart_pdata); | ||
186 | imx35_add_mxc_nand(&eukrea_cpuimx35_nand_board_info); | ||
187 | |||
188 | i2c_register_board_info(0, eukrea_cpuimx35_i2c_devices, | ||
189 | ARRAY_SIZE(eukrea_cpuimx35_i2c_devices)); | ||
190 | imx35_add_imx_i2c0(&eukrea_cpuimx35_i2c0_data); | ||
191 | |||
192 | #if defined(CONFIG_USB_ULPI) | ||
193 | if (otg_mode_host) { | ||
194 | otg_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | ||
195 | USB_OTG_DRV_VBUS | USB_OTG_DRV_VBUS_EXT); | ||
196 | |||
197 | mxc_register_device(&mxc_otg_host, &otg_pdata); | ||
198 | } | ||
199 | mxc_register_device(&mxc_usbh1, &usbh1_pdata); | ||
200 | #endif | ||
201 | if (!otg_mode_host) | ||
202 | mxc_register_device(&mxc_otg_udc_device, &otg_device_pdata); | ||
203 | |||
204 | #ifdef CONFIG_MACH_EUKREA_MBIMXSD_BASEBOARD | ||
205 | eukrea_mbimxsd_baseboard_init(); | ||
206 | #endif | ||
207 | } | ||
208 | |||
209 | static void __init eukrea_cpuimx35_timer_init(void) | ||
210 | { | ||
211 | mx35_clocks_init(); | ||
212 | } | ||
213 | |||
214 | struct sys_timer eukrea_cpuimx35_timer = { | ||
215 | .init = eukrea_cpuimx35_timer_init, | ||
216 | }; | ||
217 | |||
218 | MACHINE_START(EUKREA_CPUIMX35, "Eukrea CPUIMX35") | ||
219 | /* Maintainer: Eukrea Electromatique */ | ||
220 | .phys_io = MX35_AIPS1_BASE_ADDR, | ||
221 | .io_pg_offst = ((MX35_AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc, | ||
222 | .boot_params = MX3x_PHYS_OFFSET + 0x100, | ||
223 | .map_io = mx35_map_io, | ||
224 | .init_irq = mx35_init_irq, | ||
225 | .init_machine = mxc_board_init, | ||
226 | .timer = &eukrea_cpuimx35_timer, | ||
227 | MACHINE_END | ||
diff --git a/arch/arm/mach-mx3/mach-kzm_arm11_01.c b/arch/arm/mach-mx3/mach-kzm_arm11_01.c index f085d5d1a6de..5b23e416d6c7 100644 --- a/arch/arm/mach-mx3/mach-kzm_arm11_01.c +++ b/arch/arm/mach-mx3/mach-kzm_arm11_01.c | |||
@@ -16,10 +16,6 @@ | |||
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
18 | * GNU General Public License for more details. | 18 | * GNU General Public License for more details. |
19 | * | ||
20 | * You should have received a copy of the GNU General Public License | ||
21 | * along with this program; if not, write to the Free Software | ||
22 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
23 | */ | 19 | */ |
24 | 20 | ||
25 | #include <linux/gpio.h> | 21 | #include <linux/gpio.h> |
@@ -37,13 +33,12 @@ | |||
37 | #include <asm/mach/map.h> | 33 | #include <asm/mach/map.h> |
38 | #include <asm/mach/time.h> | 34 | #include <asm/mach/time.h> |
39 | 35 | ||
40 | #include <mach/board-kzmarm11.h> | ||
41 | #include <mach/clock.h> | 36 | #include <mach/clock.h> |
42 | #include <mach/common.h> | 37 | #include <mach/common.h> |
43 | #include <mach/imx-uart.h> | ||
44 | #include <mach/iomux-mx3.h> | 38 | #include <mach/iomux-mx3.h> |
45 | #include <mach/memory.h> | 39 | #include <mach/memory.h> |
46 | 40 | ||
41 | #include "devices-imx31.h" | ||
47 | #include "devices.h" | 42 | #include "devices.h" |
48 | 43 | ||
49 | #define KZM_ARM11_IO_ADDRESS(x) ( \ | 44 | #define KZM_ARM11_IO_ADDRESS(x) ( \ |
@@ -51,6 +46,23 @@ | |||
51 | IMX_IO_ADDRESS(x, MX31_CS5) ?: \ | 46 | IMX_IO_ADDRESS(x, MX31_CS5) ?: \ |
52 | MX31_IO_ADDRESS(x)) | 47 | MX31_IO_ADDRESS(x)) |
53 | 48 | ||
49 | /* | ||
50 | * KZM-ARM11-01 Board Control Registers on FPGA | ||
51 | */ | ||
52 | #define KZM_ARM11_CTL1 (MX31_CS4_BASE_ADDR + 0x1000) | ||
53 | #define KZM_ARM11_CTL2 (MX31_CS4_BASE_ADDR + 0x1001) | ||
54 | #define KZM_ARM11_RSW1 (MX31_CS4_BASE_ADDR + 0x1002) | ||
55 | #define KZM_ARM11_BACK_LIGHT (MX31_CS4_BASE_ADDR + 0x1004) | ||
56 | #define KZM_ARM11_FPGA_REV (MX31_CS4_BASE_ADDR + 0x1008) | ||
57 | #define KZM_ARM11_7SEG_LED (MX31_CS4_BASE_ADDR + 0x1010) | ||
58 | #define KZM_ARM11_LEDS (MX31_CS4_BASE_ADDR + 0x1020) | ||
59 | #define KZM_ARM11_DIPSW2 (MX31_CS4_BASE_ADDR + 0x1003) | ||
60 | |||
61 | /* | ||
62 | * External UART for touch panel on FPGA | ||
63 | */ | ||
64 | #define KZM_ARM11_16550 (MX31_CS4_BASE_ADDR + 0x1050) | ||
65 | |||
54 | #if defined(CONFIG_SERIAL_8250) || defined(CONFIG_SERIAL_8250_MODULE) | 66 | #if defined(CONFIG_SERIAL_8250) || defined(CONFIG_SERIAL_8250_MODULE) |
55 | /* | 67 | /* |
56 | * KZM-ARM11-01 has an external UART on FPGA | 68 | * KZM-ARM11-01 has an external UART on FPGA |
@@ -173,15 +185,14 @@ static inline int kzm_init_smsc9118(void) | |||
173 | #endif | 185 | #endif |
174 | 186 | ||
175 | #if defined(CONFIG_SERIAL_IMX) || defined(CONFIG_SERIAL_IMX_MODULE) | 187 | #if defined(CONFIG_SERIAL_IMX) || defined(CONFIG_SERIAL_IMX_MODULE) |
176 | static struct imxuart_platform_data uart_pdata = { | 188 | static const struct imxuart_platform_data uart_pdata __initconst = { |
177 | .flags = IMXUART_HAVE_RTSCTS, | 189 | .flags = IMXUART_HAVE_RTSCTS, |
178 | }; | 190 | }; |
179 | 191 | ||
180 | static void __init kzm_init_imx_uart(void) | 192 | static void __init kzm_init_imx_uart(void) |
181 | { | 193 | { |
182 | mxc_register_device(&mxc_uart_device0, &uart_pdata); | 194 | imx31_add_imx_uart0(&uart_pdata); |
183 | 195 | imx31_add_imx_uart1(&uart_pdata); | |
184 | mxc_register_device(&mxc_uart_device1, &uart_pdata); | ||
185 | } | 196 | } |
186 | #else | 197 | #else |
187 | static inline void kzm_init_imx_uart(void) | 198 | static inline void kzm_init_imx_uart(void) |
diff --git a/arch/arm/mach-mx3/mach-mx31_3ds.c b/arch/arm/mach-mx3/mach-mx31_3ds.c index 58e57291b79d..6fe69e124d30 100644 --- a/arch/arm/mach-mx3/mach-mx31_3ds.c +++ b/arch/arm/mach-mx3/mach-mx31_3ds.c | |||
@@ -10,10 +10,6 @@ | |||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | * GNU General Public License for more details. | 12 | * GNU General Public License for more details. |
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
17 | */ | 13 | */ |
18 | 14 | ||
19 | #include <linux/delay.h> | 15 | #include <linux/delay.h> |
@@ -22,7 +18,6 @@ | |||
22 | #include <linux/clk.h> | 18 | #include <linux/clk.h> |
23 | #include <linux/irq.h> | 19 | #include <linux/irq.h> |
24 | #include <linux/gpio.h> | 20 | #include <linux/gpio.h> |
25 | #include <linux/smsc911x.h> | ||
26 | #include <linux/platform_device.h> | 21 | #include <linux/platform_device.h> |
27 | #include <linux/mfd/mc13783.h> | 22 | #include <linux/mfd/mc13783.h> |
28 | #include <linux/spi/spi.h> | 23 | #include <linux/spi/spi.h> |
@@ -37,19 +32,47 @@ | |||
37 | #include <asm/memory.h> | 32 | #include <asm/memory.h> |
38 | #include <asm/mach/map.h> | 33 | #include <asm/mach/map.h> |
39 | #include <mach/common.h> | 34 | #include <mach/common.h> |
40 | #include <mach/board-mx31_3ds.h> | ||
41 | #include <mach/imx-uart.h> | ||
42 | #include <mach/iomux-mx3.h> | 35 | #include <mach/iomux-mx3.h> |
43 | #include <mach/mxc_nand.h> | 36 | #include <mach/3ds_debugboard.h> |
44 | #include <mach/spi.h> | 37 | |
38 | #include "devices-imx31.h" | ||
45 | #include "devices.h" | 39 | #include "devices.h" |
46 | 40 | ||
47 | /*! | 41 | /* Definitions for components on the Debug board */ |
48 | * @file mx31_3ds.c | 42 | |
49 | * | 43 | /* Base address of CPLD controller on the Debug board */ |
50 | * @brief This file contains the board-specific initialization routines. | 44 | #define DEBUG_BASE_ADDRESS CS5_IO_ADDRESS(MX3x_CS5_BASE_ADDR) |
51 | * | 45 | |
52 | * @ingroup System | 46 | /* LAN9217 ethernet base address */ |
47 | #define LAN9217_BASE_ADDR MX3x_CS5_BASE_ADDR | ||
48 | |||
49 | /* CPLD config and interrupt base address */ | ||
50 | #define CPLD_ADDR (DEBUG_BASE_ADDRESS + 0x20000) | ||
51 | |||
52 | /* status, interrupt */ | ||
53 | #define CPLD_INT_STATUS_REG (CPLD_ADDR + 0x10) | ||
54 | #define CPLD_INT_MASK_REG (CPLD_ADDR + 0x38) | ||
55 | #define CPLD_INT_RESET_REG (CPLD_ADDR + 0x20) | ||
56 | /* magic word for debug CPLD */ | ||
57 | #define CPLD_MAGIC_NUMBER1_REG (CPLD_ADDR + 0x40) | ||
58 | #define CPLD_MAGIC_NUMBER2_REG (CPLD_ADDR + 0x48) | ||
59 | /* CPLD code version */ | ||
60 | #define CPLD_CODE_VER_REG (CPLD_ADDR + 0x50) | ||
61 | /* magic word for debug CPLD */ | ||
62 | #define CPLD_MAGIC_NUMBER3_REG (CPLD_ADDR + 0x58) | ||
63 | |||
64 | /* CPLD IRQ line for external uart, external ethernet etc */ | ||
65 | #define EXPIO_PARENT_INT IOMUX_TO_IRQ(MX31_PIN_GPIO1_1) | ||
66 | |||
67 | #define MXC_EXP_IO_BASE (MXC_BOARD_IRQ_START) | ||
68 | #define MXC_IRQ_TO_EXPIO(irq) ((irq) - MXC_EXP_IO_BASE) | ||
69 | |||
70 | #define EXPIO_INT_ENET (MXC_EXP_IO_BASE + 0) | ||
71 | |||
72 | #define MXC_MAX_EXP_IO_LINES 16 | ||
73 | |||
74 | /* | ||
75 | * This file contains the board-specific initialization routines. | ||
53 | */ | 76 | */ |
54 | 77 | ||
55 | static int mx31_3ds_pins[] = { | 78 | static int mx31_3ds_pins[] = { |
@@ -145,7 +168,7 @@ static int spi1_internal_chipselect[] = { | |||
145 | MXC_SPI_CS(2), | 168 | MXC_SPI_CS(2), |
146 | }; | 169 | }; |
147 | 170 | ||
148 | static struct spi_imx_master spi1_pdata = { | 171 | static const struct spi_imx_master spi1_pdata __initconst = { |
149 | .chipselect = spi1_internal_chipselect, | 172 | .chipselect = spi1_internal_chipselect, |
150 | .num_chipselect = ARRAY_SIZE(spi1_internal_chipselect), | 173 | .num_chipselect = ARRAY_SIZE(spi1_internal_chipselect), |
151 | }; | 174 | }; |
@@ -165,7 +188,8 @@ static struct spi_board_info mx31_3ds_spi_devs[] __initdata = { | |||
165 | /* | 188 | /* |
166 | * NAND Flash | 189 | * NAND Flash |
167 | */ | 190 | */ |
168 | static struct mxc_nand_platform_data imx31_3ds_nand_flash_pdata = { | 191 | static const struct mxc_nand_platform_data |
192 | mx31_3ds_nand_board_info __initconst = { | ||
169 | .width = 1, | 193 | .width = 1, |
170 | .hw_ecc = 1, | 194 | .hw_ecc = 1, |
171 | #ifdef MACH_MX31_3DS_MXC_NAND_USE_BBT | 195 | #ifdef MACH_MX31_3DS_MXC_NAND_USE_BBT |
@@ -182,8 +206,10 @@ static struct mxc_nand_platform_data imx31_3ds_nand_flash_pdata = { | |||
182 | 206 | ||
183 | #define USBOTG_RST_B IOMUX_TO_GPIO(MX31_PIN_USB_PWR) | 207 | #define USBOTG_RST_B IOMUX_TO_GPIO(MX31_PIN_USB_PWR) |
184 | 208 | ||
185 | static void mx31_3ds_usbotg_init(void) | 209 | static int mx31_3ds_usbotg_init(void) |
186 | { | 210 | { |
211 | int err; | ||
212 | |||
187 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA0, USB_PAD_CFG); | 213 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA0, USB_PAD_CFG); |
188 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA1, USB_PAD_CFG); | 214 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA1, USB_PAD_CFG); |
189 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA2, USB_PAD_CFG); | 215 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA2, USB_PAD_CFG); |
@@ -197,10 +223,25 @@ static void mx31_3ds_usbotg_init(void) | |||
197 | mxc_iomux_set_pad(MX31_PIN_USBOTG_NXT, USB_PAD_CFG); | 223 | mxc_iomux_set_pad(MX31_PIN_USBOTG_NXT, USB_PAD_CFG); |
198 | mxc_iomux_set_pad(MX31_PIN_USBOTG_STP, USB_PAD_CFG); | 224 | mxc_iomux_set_pad(MX31_PIN_USBOTG_STP, USB_PAD_CFG); |
199 | 225 | ||
200 | gpio_request(USBOTG_RST_B, "otgusb-reset"); | 226 | err = gpio_request(USBOTG_RST_B, "otgusb-reset"); |
201 | gpio_direction_output(USBOTG_RST_B, 0); | 227 | if (err) { |
228 | pr_err("Failed to request the USB OTG reset gpio\n"); | ||
229 | return err; | ||
230 | } | ||
231 | |||
232 | err = gpio_direction_output(USBOTG_RST_B, 0); | ||
233 | if (err) { | ||
234 | pr_err("Failed to drive the USB OTG reset gpio\n"); | ||
235 | goto usbotg_free_reset; | ||
236 | } | ||
237 | |||
202 | mdelay(1); | 238 | mdelay(1); |
203 | gpio_set_value(USBOTG_RST_B, 1); | 239 | gpio_set_value(USBOTG_RST_B, 1); |
240 | return 0; | ||
241 | |||
242 | usbotg_free_reset: | ||
243 | gpio_free(USBOTG_RST_B); | ||
244 | return err; | ||
204 | } | 245 | } |
205 | 246 | ||
206 | static struct fsl_usb2_platform_data usbotg_pdata = { | 247 | static struct fsl_usb2_platform_data usbotg_pdata = { |
@@ -208,178 +249,16 @@ static struct fsl_usb2_platform_data usbotg_pdata = { | |||
208 | .phy_mode = FSL_USB2_PHY_ULPI, | 249 | .phy_mode = FSL_USB2_PHY_ULPI, |
209 | }; | 250 | }; |
210 | 251 | ||
211 | static struct imxuart_platform_data uart_pdata = { | 252 | static const struct imxuart_platform_data uart_pdata __initconst = { |
212 | .flags = IMXUART_HAVE_RTSCTS, | 253 | .flags = IMXUART_HAVE_RTSCTS, |
213 | }; | 254 | }; |
214 | 255 | ||
215 | /* | 256 | /* |
216 | * Support for the SMSC9217 on the Debug board. | ||
217 | */ | ||
218 | |||
219 | static struct smsc911x_platform_config smsc911x_config = { | ||
220 | .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, | ||
221 | .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL, | ||
222 | .flags = SMSC911X_USE_16BIT | SMSC911X_FORCE_INTERNAL_PHY, | ||
223 | .phy_interface = PHY_INTERFACE_MODE_MII, | ||
224 | }; | ||
225 | |||
226 | static struct resource smsc911x_resources[] = { | ||
227 | { | ||
228 | .start = LAN9217_BASE_ADDR, | ||
229 | .end = LAN9217_BASE_ADDR + 0xff, | ||
230 | .flags = IORESOURCE_MEM, | ||
231 | }, { | ||
232 | .start = EXPIO_INT_ENET, | ||
233 | .end = EXPIO_INT_ENET, | ||
234 | .flags = IORESOURCE_IRQ, | ||
235 | }, | ||
236 | }; | ||
237 | |||
238 | static struct platform_device smsc911x_device = { | ||
239 | .name = "smsc911x", | ||
240 | .id = -1, | ||
241 | .num_resources = ARRAY_SIZE(smsc911x_resources), | ||
242 | .resource = smsc911x_resources, | ||
243 | .dev = { | ||
244 | .platform_data = &smsc911x_config, | ||
245 | }, | ||
246 | }; | ||
247 | |||
248 | /* | ||
249 | * Routines for the CPLD on the debug board. It contains a CPLD handling | ||
250 | * LEDs, switches, interrupts for Ethernet. | ||
251 | */ | ||
252 | |||
253 | static void mx31_3ds_expio_irq_handler(uint32_t irq, struct irq_desc *desc) | ||
254 | { | ||
255 | uint32_t imr_val; | ||
256 | uint32_t int_valid; | ||
257 | uint32_t expio_irq; | ||
258 | |||
259 | imr_val = __raw_readw(CPLD_INT_MASK_REG); | ||
260 | int_valid = __raw_readw(CPLD_INT_STATUS_REG) & ~imr_val; | ||
261 | |||
262 | expio_irq = MXC_EXP_IO_BASE; | ||
263 | for (; int_valid != 0; int_valid >>= 1, expio_irq++) { | ||
264 | if ((int_valid & 1) == 0) | ||
265 | continue; | ||
266 | generic_handle_irq(expio_irq); | ||
267 | } | ||
268 | } | ||
269 | |||
270 | /* | ||
271 | * Disable an expio pin's interrupt by setting the bit in the imr. | ||
272 | * @param irq an expio virtual irq number | ||
273 | */ | ||
274 | static void expio_mask_irq(uint32_t irq) | ||
275 | { | ||
276 | uint16_t reg; | ||
277 | uint32_t expio = MXC_IRQ_TO_EXPIO(irq); | ||
278 | |||
279 | /* mask the interrupt */ | ||
280 | reg = __raw_readw(CPLD_INT_MASK_REG); | ||
281 | reg |= 1 << expio; | ||
282 | __raw_writew(reg, CPLD_INT_MASK_REG); | ||
283 | } | ||
284 | |||
285 | /* | ||
286 | * Acknowledge an expanded io pin's interrupt by clearing the bit in the isr. | ||
287 | * @param irq an expanded io virtual irq number | ||
288 | */ | ||
289 | static void expio_ack_irq(uint32_t irq) | ||
290 | { | ||
291 | uint32_t expio = MXC_IRQ_TO_EXPIO(irq); | ||
292 | |||
293 | /* clear the interrupt status */ | ||
294 | __raw_writew(1 << expio, CPLD_INT_RESET_REG); | ||
295 | __raw_writew(0, CPLD_INT_RESET_REG); | ||
296 | /* mask the interrupt */ | ||
297 | expio_mask_irq(irq); | ||
298 | } | ||
299 | |||
300 | /* | ||
301 | * Enable a expio pin's interrupt by clearing the bit in the imr. | ||
302 | * @param irq a expio virtual irq number | ||
303 | */ | ||
304 | static void expio_unmask_irq(uint32_t irq) | ||
305 | { | ||
306 | uint16_t reg; | ||
307 | uint32_t expio = MXC_IRQ_TO_EXPIO(irq); | ||
308 | |||
309 | /* unmask the interrupt */ | ||
310 | reg = __raw_readw(CPLD_INT_MASK_REG); | ||
311 | reg &= ~(1 << expio); | ||
312 | __raw_writew(reg, CPLD_INT_MASK_REG); | ||
313 | } | ||
314 | |||
315 | static struct irq_chip expio_irq_chip = { | ||
316 | .ack = expio_ack_irq, | ||
317 | .mask = expio_mask_irq, | ||
318 | .unmask = expio_unmask_irq, | ||
319 | }; | ||
320 | |||
321 | static int __init mx31_3ds_init_expio(void) | ||
322 | { | ||
323 | int i; | ||
324 | int ret; | ||
325 | |||
326 | /* Check if there's a debug board connected */ | ||
327 | if ((__raw_readw(CPLD_MAGIC_NUMBER1_REG) != 0xAAAA) || | ||
328 | (__raw_readw(CPLD_MAGIC_NUMBER2_REG) != 0x5555) || | ||
329 | (__raw_readw(CPLD_MAGIC_NUMBER3_REG) != 0xCAFE)) { | ||
330 | /* No Debug board found */ | ||
331 | return -ENODEV; | ||
332 | } | ||
333 | |||
334 | pr_info("i.MX31 3DS Debug board detected, rev = 0x%04X\n", | ||
335 | __raw_readw(CPLD_CODE_VER_REG)); | ||
336 | |||
337 | /* | ||
338 | * Configure INT line as GPIO input | ||
339 | */ | ||
340 | ret = gpio_request(IOMUX_TO_GPIO(MX31_PIN_GPIO1_1), "sms9217-irq"); | ||
341 | if (ret) | ||
342 | pr_warning("could not get LAN irq gpio\n"); | ||
343 | else | ||
344 | gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_GPIO1_1)); | ||
345 | |||
346 | /* Disable the interrupts and clear the status */ | ||
347 | __raw_writew(0, CPLD_INT_MASK_REG); | ||
348 | __raw_writew(0xFFFF, CPLD_INT_RESET_REG); | ||
349 | __raw_writew(0, CPLD_INT_RESET_REG); | ||
350 | __raw_writew(0x1F, CPLD_INT_MASK_REG); | ||
351 | for (i = MXC_EXP_IO_BASE; | ||
352 | i < (MXC_EXP_IO_BASE + MXC_MAX_EXP_IO_LINES); | ||
353 | i++) { | ||
354 | set_irq_chip(i, &expio_irq_chip); | ||
355 | set_irq_handler(i, handle_level_irq); | ||
356 | set_irq_flags(i, IRQF_VALID); | ||
357 | } | ||
358 | set_irq_type(EXPIO_PARENT_INT, IRQ_TYPE_LEVEL_LOW); | ||
359 | set_irq_chained_handler(EXPIO_PARENT_INT, mx31_3ds_expio_irq_handler); | ||
360 | |||
361 | return 0; | ||
362 | } | ||
363 | |||
364 | /* | ||
365 | * This structure defines the MX31 memory map. | ||
366 | */ | ||
367 | static struct map_desc mx31_3ds_io_desc[] __initdata = { | ||
368 | { | ||
369 | .virtual = MX31_CS5_BASE_ADDR_VIRT, | ||
370 | .pfn = __phys_to_pfn(MX31_CS5_BASE_ADDR), | ||
371 | .length = MX31_CS5_SIZE, | ||
372 | .type = MT_DEVICE, | ||
373 | }, | ||
374 | }; | ||
375 | |||
376 | /* | ||
377 | * Set up static virtual mappings. | 257 | * Set up static virtual mappings. |
378 | */ | 258 | */ |
379 | static void __init mx31_3ds_map_io(void) | 259 | static void __init mx31_3ds_map_io(void) |
380 | { | 260 | { |
381 | mx31_map_io(); | 261 | mx31_map_io(); |
382 | iotable_init(mx31_3ds_io_desc, ARRAY_SIZE(mx31_3ds_io_desc)); | ||
383 | } | 262 | } |
384 | 263 | ||
385 | /*! | 264 | /*! |
@@ -390,10 +269,10 @@ static void __init mxc_board_init(void) | |||
390 | mxc_iomux_setup_multiple_pins(mx31_3ds_pins, ARRAY_SIZE(mx31_3ds_pins), | 269 | mxc_iomux_setup_multiple_pins(mx31_3ds_pins, ARRAY_SIZE(mx31_3ds_pins), |
391 | "mx31_3ds"); | 270 | "mx31_3ds"); |
392 | 271 | ||
393 | mxc_register_device(&mxc_uart_device0, &uart_pdata); | 272 | imx31_add_imx_uart0(&uart_pdata); |
394 | mxc_register_device(&mxc_nand_device, &imx31_3ds_nand_flash_pdata); | 273 | imx31_add_mxc_nand(&mx31_3ds_nand_board_info); |
395 | 274 | ||
396 | mxc_register_device(&mxc_spi_device1, &spi1_pdata); | 275 | imx31_add_spi_imx0(&spi1_pdata); |
397 | spi_register_board_info(mx31_3ds_spi_devs, | 276 | spi_register_board_info(mx31_3ds_spi_devs, |
398 | ARRAY_SIZE(mx31_3ds_spi_devs)); | 277 | ARRAY_SIZE(mx31_3ds_spi_devs)); |
399 | 278 | ||
@@ -402,8 +281,9 @@ static void __init mxc_board_init(void) | |||
402 | mx31_3ds_usbotg_init(); | 281 | mx31_3ds_usbotg_init(); |
403 | mxc_register_device(&mxc_otg_udc_device, &usbotg_pdata); | 282 | mxc_register_device(&mxc_otg_udc_device, &usbotg_pdata); |
404 | 283 | ||
405 | if (!mx31_3ds_init_expio()) | 284 | if (!mxc_expio_init(CS5_BASE_ADDR, EXPIO_PARENT_INT)) |
406 | platform_device_register(&smsc911x_device); | 285 | printk(KERN_WARNING "Init of the debugboard failed, all " |
286 | "devices on the board are unusable.\n"); | ||
407 | } | 287 | } |
408 | 288 | ||
409 | static void __init mx31_3ds_timer_init(void) | 289 | static void __init mx31_3ds_timer_init(void) |
diff --git a/arch/arm/mach-mx3/mach-mx31ads.c b/arch/arm/mach-mx3/mach-mx31ads.c index b3d1a1895c20..94b3e7c42404 100644 --- a/arch/arm/mach-mx3/mach-mx31ads.c +++ b/arch/arm/mach-mx3/mach-mx31ads.c | |||
@@ -12,10 +12,6 @@ | |||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | * GNU General Public License for more details. | 14 | * GNU General Public License for more details. |
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | */ | 15 | */ |
20 | 16 | ||
21 | #include <linux/types.h> | 17 | #include <linux/types.h> |
@@ -33,8 +29,6 @@ | |||
33 | #include <asm/memory.h> | 29 | #include <asm/memory.h> |
34 | #include <asm/mach/map.h> | 30 | #include <asm/mach/map.h> |
35 | #include <mach/common.h> | 31 | #include <mach/common.h> |
36 | #include <mach/board-mx31ads.h> | ||
37 | #include <mach/imx-uart.h> | ||
38 | #include <mach/iomux-mx3.h> | 32 | #include <mach/iomux-mx3.h> |
39 | 33 | ||
40 | #ifdef CONFIG_MACH_MX31ADS_WM1133_EV1 | 34 | #ifdef CONFIG_MACH_MX31ADS_WM1133_EV1 |
@@ -43,14 +37,45 @@ | |||
43 | #include <linux/mfd/wm8350/pmic.h> | 37 | #include <linux/mfd/wm8350/pmic.h> |
44 | #endif | 38 | #endif |
45 | 39 | ||
40 | #include "devices-imx31.h" | ||
46 | #include "devices.h" | 41 | #include "devices.h" |
47 | 42 | ||
48 | /*! | 43 | /* Base address of PBC controller */ |
49 | * @file mx31ads.c | 44 | #define PBC_BASE_ADDRESS MX31_CS4_BASE_ADDR_VIRT |
50 | * | 45 | /* Offsets for the PBC Controller register */ |
51 | * @brief This file contains the board-specific initialization routines. | 46 | |
52 | * | 47 | /* PBC Board interrupt status register */ |
53 | * @ingroup System | 48 | #define PBC_INTSTATUS 0x000016 |
49 | |||
50 | /* PBC Board interrupt current status register */ | ||
51 | #define PBC_INTCURR_STATUS 0x000018 | ||
52 | |||
53 | /* PBC Interrupt mask register set address */ | ||
54 | #define PBC_INTMASK_SET 0x00001A | ||
55 | |||
56 | /* PBC Interrupt mask register clear address */ | ||
57 | #define PBC_INTMASK_CLEAR 0x00001C | ||
58 | |||
59 | /* External UART A */ | ||
60 | #define PBC_SC16C652_UARTA 0x010000 | ||
61 | |||
62 | /* External UART B */ | ||
63 | #define PBC_SC16C652_UARTB 0x010010 | ||
64 | |||
65 | #define PBC_INTSTATUS_REG (PBC_INTSTATUS + PBC_BASE_ADDRESS) | ||
66 | #define PBC_INTMASK_SET_REG (PBC_INTMASK_SET + PBC_BASE_ADDRESS) | ||
67 | #define PBC_INTMASK_CLEAR_REG (PBC_INTMASK_CLEAR + PBC_BASE_ADDRESS) | ||
68 | #define EXPIO_PARENT_INT IOMUX_TO_IRQ(MX31_PIN_GPIO1_4) | ||
69 | |||
70 | #define MXC_EXP_IO_BASE (MXC_BOARD_IRQ_START) | ||
71 | #define MXC_IRQ_TO_EXPIO(irq) ((irq) - MXC_EXP_IO_BASE) | ||
72 | |||
73 | #define EXPIO_INT_XUART_INTA (MXC_EXP_IO_BASE + 10) | ||
74 | #define EXPIO_INT_XUART_INTB (MXC_EXP_IO_BASE + 11) | ||
75 | |||
76 | #define MXC_MAX_EXP_IO_LINES 16 | ||
77 | /* | ||
78 | * This file contains the board-specific initialization routines. | ||
54 | */ | 79 | */ |
55 | 80 | ||
56 | #if defined(CONFIG_SERIAL_8250) || defined(CONFIG_SERIAL_8250_MODULE) | 81 | #if defined(CONFIG_SERIAL_8250) || defined(CONFIG_SERIAL_8250_MODULE) |
@@ -98,7 +123,7 @@ static inline int mxc_init_extuart(void) | |||
98 | #endif | 123 | #endif |
99 | 124 | ||
100 | #if defined(CONFIG_SERIAL_IMX) || defined(CONFIG_SERIAL_IMX_MODULE) | 125 | #if defined(CONFIG_SERIAL_IMX) || defined(CONFIG_SERIAL_IMX_MODULE) |
101 | static struct imxuart_platform_data uart_pdata = { | 126 | static const struct imxuart_platform_data uart_pdata __initconst = { |
102 | .flags = IMXUART_HAVE_RTSCTS, | 127 | .flags = IMXUART_HAVE_RTSCTS, |
103 | }; | 128 | }; |
104 | 129 | ||
@@ -112,7 +137,7 @@ static unsigned int uart_pins[] = { | |||
112 | static inline void mxc_init_imx_uart(void) | 137 | static inline void mxc_init_imx_uart(void) |
113 | { | 138 | { |
114 | mxc_iomux_setup_multiple_pins(uart_pins, ARRAY_SIZE(uart_pins), "uart-0"); | 139 | mxc_iomux_setup_multiple_pins(uart_pins, ARRAY_SIZE(uart_pins), "uart-0"); |
115 | mxc_register_device(&mxc_uart_device0, &uart_pdata); | 140 | imx31_add_imx_uart0(&uart_pdata); |
116 | } | 141 | } |
117 | #else /* !SERIAL_IMX */ | 142 | #else /* !SERIAL_IMX */ |
118 | static inline void mxc_init_imx_uart(void) | 143 | static inline void mxc_init_imx_uart(void) |
@@ -475,7 +500,7 @@ static void mxc_init_i2c(void) | |||
475 | mxc_iomux_mode(IOMUX_MODE(MX31_PIN_CSPI2_MOSI, IOMUX_CONFIG_ALT1)); | 500 | mxc_iomux_mode(IOMUX_MODE(MX31_PIN_CSPI2_MOSI, IOMUX_CONFIG_ALT1)); |
476 | mxc_iomux_mode(IOMUX_MODE(MX31_PIN_CSPI2_MISO, IOMUX_CONFIG_ALT1)); | 501 | mxc_iomux_mode(IOMUX_MODE(MX31_PIN_CSPI2_MISO, IOMUX_CONFIG_ALT1)); |
477 | 502 | ||
478 | mxc_register_device(&mxc_i2c_device1, NULL); | 503 | imx31_add_imx_i2c1(NULL); |
479 | } | 504 | } |
480 | #else | 505 | #else |
481 | static void mxc_init_i2c(void) | 506 | static void mxc_init_i2c(void) |
diff --git a/arch/arm/mach-mx3/mach-mx31lilly.c b/arch/arm/mach-mx3/mach-mx31lilly.c index b2c7f512070f..8f66f65e80e2 100644 --- a/arch/arm/mach-mx3/mach-mx31lilly.c +++ b/arch/arm/mach-mx3/mach-mx31lilly.c | |||
@@ -18,10 +18,6 @@ | |||
18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
20 | * GNU General Public License for more details. | 20 | * GNU General Public License for more details. |
21 | * | ||
22 | * You should have received a copy of the GNU General Public License | ||
23 | * along with this program; if not, write to the Free Software | ||
24 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
25 | */ | 21 | */ |
26 | 22 | ||
27 | #include <linux/types.h> | 23 | #include <linux/types.h> |
@@ -46,10 +42,10 @@ | |||
46 | #include <mach/common.h> | 42 | #include <mach/common.h> |
47 | #include <mach/iomux-mx3.h> | 43 | #include <mach/iomux-mx3.h> |
48 | #include <mach/board-mx31lilly.h> | 44 | #include <mach/board-mx31lilly.h> |
49 | #include <mach/spi.h> | ||
50 | #include <mach/mxc_ehci.h> | 45 | #include <mach/mxc_ehci.h> |
51 | #include <mach/ulpi.h> | 46 | #include <mach/ulpi.h> |
52 | 47 | ||
48 | #include "devices-imx31.h" | ||
53 | #include "devices.h" | 49 | #include "devices.h" |
54 | 50 | ||
55 | /* | 51 | /* |
@@ -269,12 +265,12 @@ static int spi_internal_chipselect[] = { | |||
269 | MXC_SPI_CS(2), | 265 | MXC_SPI_CS(2), |
270 | }; | 266 | }; |
271 | 267 | ||
272 | static struct spi_imx_master spi0_pdata = { | 268 | static const struct spi_imx_master spi0_pdata __initconst = { |
273 | .chipselect = spi_internal_chipselect, | 269 | .chipselect = spi_internal_chipselect, |
274 | .num_chipselect = ARRAY_SIZE(spi_internal_chipselect), | 270 | .num_chipselect = ARRAY_SIZE(spi_internal_chipselect), |
275 | }; | 271 | }; |
276 | 272 | ||
277 | static struct spi_imx_master spi1_pdata = { | 273 | static const struct spi_imx_master spi1_pdata __initconst = { |
278 | .chipselect = spi_internal_chipselect, | 274 | .chipselect = spi_internal_chipselect, |
279 | .num_chipselect = ARRAY_SIZE(spi_internal_chipselect), | 275 | .num_chipselect = ARRAY_SIZE(spi_internal_chipselect), |
280 | }; | 276 | }; |
@@ -289,6 +285,7 @@ static struct spi_board_info mc13783_dev __initdata = { | |||
289 | .bus_num = 1, | 285 | .bus_num = 1, |
290 | .chip_select = 0, | 286 | .chip_select = 0, |
291 | .platform_data = &mc13783_pdata, | 287 | .platform_data = &mc13783_pdata, |
288 | .irq = IOMUX_TO_IRQ(MX31_PIN_GPIO1_3), | ||
292 | }; | 289 | }; |
293 | 290 | ||
294 | static struct platform_device *devices[] __initdata = { | 291 | static struct platform_device *devices[] __initdata = { |
@@ -331,8 +328,8 @@ static void __init mx31lilly_board_init(void) | |||
331 | mxc_iomux_alloc_pin(MX31_PIN_CSPI2_SS1__SS1, "SPI2_SS1"); | 328 | mxc_iomux_alloc_pin(MX31_PIN_CSPI2_SS1__SS1, "SPI2_SS1"); |
332 | mxc_iomux_alloc_pin(MX31_PIN_CSPI2_SS2__SS2, "SPI2_SS2"); | 329 | mxc_iomux_alloc_pin(MX31_PIN_CSPI2_SS2__SS2, "SPI2_SS2"); |
333 | 330 | ||
334 | mxc_register_device(&mxc_spi_device0, &spi0_pdata); | 331 | imx31_add_spi_imx0(&spi0_pdata); |
335 | mxc_register_device(&mxc_spi_device1, &spi1_pdata); | 332 | imx31_add_spi_imx1(&spi1_pdata); |
336 | spi_register_board_info(&mc13783_dev, 1); | 333 | spi_register_board_info(&mc13783_dev, 1); |
337 | 334 | ||
338 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 335 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
diff --git a/arch/arm/mach-mx3/mach-mx31lite.c b/arch/arm/mach-mx3/mach-mx31lite.c index 2b6d11400877..da236c497d2a 100644 --- a/arch/arm/mach-mx3/mach-mx31lite.c +++ b/arch/arm/mach-mx3/mach-mx31lite.c | |||
@@ -13,10 +13,6 @@ | |||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | * GNU General Public License for more details. | 15 | * GNU General Public License for more details. |
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
20 | */ | 16 | */ |
21 | 17 | ||
22 | #include <linux/types.h> | 18 | #include <linux/types.h> |
@@ -42,14 +38,12 @@ | |||
42 | #include <mach/hardware.h> | 38 | #include <mach/hardware.h> |
43 | #include <mach/common.h> | 39 | #include <mach/common.h> |
44 | #include <mach/board-mx31lite.h> | 40 | #include <mach/board-mx31lite.h> |
45 | #include <mach/imx-uart.h> | ||
46 | #include <mach/iomux-mx3.h> | 41 | #include <mach/iomux-mx3.h> |
47 | #include <mach/irqs.h> | 42 | #include <mach/irqs.h> |
48 | #include <mach/mxc_nand.h> | ||
49 | #include <mach/spi.h> | ||
50 | #include <mach/mxc_ehci.h> | 43 | #include <mach/mxc_ehci.h> |
51 | #include <mach/ulpi.h> | 44 | #include <mach/ulpi.h> |
52 | 45 | ||
46 | #include "devices-imx31.h" | ||
53 | #include "devices.h" | 47 | #include "devices.h" |
54 | 48 | ||
55 | /* | 49 | /* |
@@ -69,7 +63,8 @@ static unsigned int mx31lite_pins[] = { | |||
69 | MX31_PIN_CSPI2_SS2__SS2, | 63 | MX31_PIN_CSPI2_SS2__SS2, |
70 | }; | 64 | }; |
71 | 65 | ||
72 | static struct mxc_nand_platform_data mx31lite_nand_board_info = { | 66 | static const struct mxc_nand_platform_data |
67 | mx31lite_nand_board_info __initconst = { | ||
73 | .width = 1, | 68 | .width = 1, |
74 | .hw_ecc = 1, | 69 | .hw_ecc = 1, |
75 | }; | 70 | }; |
@@ -112,7 +107,7 @@ static int spi_internal_chipselect[] = { | |||
112 | MXC_SPI_CS(0), | 107 | MXC_SPI_CS(0), |
113 | }; | 108 | }; |
114 | 109 | ||
115 | static struct spi_imx_master spi1_pdata = { | 110 | static const struct spi_imx_master spi1_pdata __initconst = { |
116 | .chipselect = spi_internal_chipselect, | 111 | .chipselect = spi_internal_chipselect, |
117 | .num_chipselect = ARRAY_SIZE(spi_internal_chipselect), | 112 | .num_chipselect = ARRAY_SIZE(spi_internal_chipselect), |
118 | }; | 113 | }; |
@@ -253,9 +248,9 @@ static void __init mxc_board_init(void) | |||
253 | 248 | ||
254 | /* NOR and NAND flash */ | 249 | /* NOR and NAND flash */ |
255 | platform_device_register(&physmap_flash_device); | 250 | platform_device_register(&physmap_flash_device); |
256 | mxc_register_device(&mxc_nand_device, &mx31lite_nand_board_info); | 251 | imx31_add_mxc_nand(&mx31lite_nand_board_info); |
257 | 252 | ||
258 | mxc_register_device(&mxc_spi_device1, &spi1_pdata); | 253 | imx31_add_spi_imx1(&spi1_pdata); |
259 | spi_register_board_info(&mc13783_spi_dev, 1); | 254 | spi_register_board_info(&mc13783_spi_dev, 1); |
260 | 255 | ||
261 | #if defined(CONFIG_USB_ULPI) | 256 | #if defined(CONFIG_USB_ULPI) |
diff --git a/arch/arm/mach-mx3/mach-mx31moboard.c b/arch/arm/mach-mx3/mach-mx31moboard.c index 62b5e40165df..67776bc61c33 100644 --- a/arch/arm/mach-mx3/mach-mx31moboard.c +++ b/arch/arm/mach-mx3/mach-mx31moboard.c | |||
@@ -10,10 +10,6 @@ | |||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | * GNU General Public License for more details. | 12 | * GNU General Public License for more details. |
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
17 | */ | 13 | */ |
18 | 14 | ||
19 | #include <linux/delay.h> | 15 | #include <linux/delay.h> |
@@ -42,16 +38,15 @@ | |||
42 | #include <mach/board-mx31moboard.h> | 38 | #include <mach/board-mx31moboard.h> |
43 | #include <mach/common.h> | 39 | #include <mach/common.h> |
44 | #include <mach/hardware.h> | 40 | #include <mach/hardware.h> |
45 | #include <mach/imx-uart.h> | ||
46 | #include <mach/iomux-mx3.h> | 41 | #include <mach/iomux-mx3.h> |
47 | #include <mach/ipu.h> | 42 | #include <mach/ipu.h> |
48 | #include <mach/i2c.h> | ||
49 | #include <mach/mmc.h> | 43 | #include <mach/mmc.h> |
50 | #include <mach/mxc_ehci.h> | 44 | #include <mach/mxc_ehci.h> |
51 | #include <mach/mx3_camera.h> | 45 | #include <mach/mx3_camera.h> |
52 | #include <mach/spi.h> | 46 | #include <mach/spi.h> |
53 | #include <mach/ulpi.h> | 47 | #include <mach/ulpi.h> |
54 | 48 | ||
49 | #include "devices-imx31.h" | ||
55 | #include "devices.h" | 50 | #include "devices.h" |
56 | 51 | ||
57 | static unsigned int moboard_pins[] = { | 52 | static unsigned int moboard_pins[] = { |
@@ -130,24 +125,36 @@ static struct platform_device mx31moboard_flash = { | |||
130 | 125 | ||
131 | static int moboard_uart0_init(struct platform_device *pdev) | 126 | static int moboard_uart0_init(struct platform_device *pdev) |
132 | { | 127 | { |
133 | gpio_request(IOMUX_TO_GPIO(MX31_PIN_CTS1), "uart0-cts-hack"); | 128 | int ret = gpio_request(IOMUX_TO_GPIO(MX31_PIN_CTS1), "uart0-cts-hack"); |
134 | gpio_direction_output(IOMUX_TO_GPIO(MX31_PIN_CTS1), 0); | 129 | if (ret) |
135 | return 0; | 130 | return ret; |
131 | |||
132 | ret = gpio_direction_output(IOMUX_TO_GPIO(MX31_PIN_CTS1), 0); | ||
133 | if (ret) | ||
134 | gpio_free(IOMUX_TO_GPIO(MX31_PIN_CTS1)); | ||
135 | |||
136 | return ret; | ||
137 | } | ||
138 | |||
139 | static void moboard_uart0_exit(struct platform_device *pdev) | ||
140 | { | ||
141 | gpio_free(IOMUX_TO_GPIO(MX31_PIN_CTS1)); | ||
136 | } | 142 | } |
137 | 143 | ||
138 | static struct imxuart_platform_data uart0_pdata = { | 144 | static const struct imxuart_platform_data uart0_pdata __initconst = { |
139 | .init = moboard_uart0_init, | 145 | .init = moboard_uart0_init, |
146 | .exit = moboard_uart0_exit, | ||
140 | }; | 147 | }; |
141 | 148 | ||
142 | static struct imxuart_platform_data uart4_pdata = { | 149 | static const struct imxuart_platform_data uart4_pdata __initconst = { |
143 | .flags = IMXUART_HAVE_RTSCTS, | 150 | .flags = IMXUART_HAVE_RTSCTS, |
144 | }; | 151 | }; |
145 | 152 | ||
146 | static struct imxi2c_platform_data moboard_i2c0_pdata = { | 153 | static const struct imxi2c_platform_data moboard_i2c0_data __initconst = { |
147 | .bitrate = 400000, | 154 | .bitrate = 400000, |
148 | }; | 155 | }; |
149 | 156 | ||
150 | static struct imxi2c_platform_data moboard_i2c1_pdata = { | 157 | static const struct imxi2c_platform_data moboard_i2c1_data __initconst = { |
151 | .bitrate = 100000, | 158 | .bitrate = 100000, |
152 | }; | 159 | }; |
153 | 160 | ||
@@ -156,7 +163,7 @@ static int moboard_spi1_cs[] = { | |||
156 | MXC_SPI_CS(2), | 163 | MXC_SPI_CS(2), |
157 | }; | 164 | }; |
158 | 165 | ||
159 | static struct spi_imx_master moboard_spi1_master = { | 166 | static const struct spi_imx_master moboard_spi1_pdata __initconst = { |
160 | .chipselect = moboard_spi1_cs, | 167 | .chipselect = moboard_spi1_cs, |
161 | .num_chipselect = ARRAY_SIZE(moboard_spi1_cs), | 168 | .num_chipselect = ARRAY_SIZE(moboard_spi1_cs), |
162 | }; | 169 | }; |
@@ -286,7 +293,7 @@ static int moboard_spi2_cs[] = { | |||
286 | MXC_SPI_CS(1), | 293 | MXC_SPI_CS(1), |
287 | }; | 294 | }; |
288 | 295 | ||
289 | static struct spi_imx_master moboard_spi2_master = { | 296 | static const struct spi_imx_master moboard_spi2_pdata __initconst = { |
290 | .chipselect = moboard_spi2_cs, | 297 | .chipselect = moboard_spi2_cs, |
291 | .num_chipselect = ARRAY_SIZE(moboard_spi2_cs), | 298 | .num_chipselect = ARRAY_SIZE(moboard_spi2_cs), |
292 | }; | 299 | }; |
@@ -499,15 +506,14 @@ static void __init mxc_board_init(void) | |||
499 | 506 | ||
500 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 507 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
501 | 508 | ||
502 | mxc_register_device(&mxc_uart_device0, &uart0_pdata); | 509 | imx31_add_imx_uart0(&uart0_pdata); |
503 | 510 | imx31_add_imx_uart4(&uart4_pdata); | |
504 | mxc_register_device(&mxc_uart_device4, &uart4_pdata); | ||
505 | 511 | ||
506 | mxc_register_device(&mxc_i2c_device0, &moboard_i2c0_pdata); | 512 | imx31_add_imx_i2c0(&moboard_i2c0_data); |
507 | mxc_register_device(&mxc_i2c_device1, &moboard_i2c1_pdata); | 513 | imx31_add_imx_i2c1(&moboard_i2c1_data); |
508 | 514 | ||
509 | mxc_register_device(&mxc_spi_device1, &moboard_spi1_master); | 515 | imx31_add_spi_imx1(&moboard_spi1_pdata); |
510 | mxc_register_device(&mxc_spi_device2, &moboard_spi2_master); | 516 | imx31_add_spi_imx2(&moboard_spi2_pdata); |
511 | 517 | ||
512 | gpio_request(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3), "pmic-irq"); | 518 | gpio_request(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3), "pmic-irq"); |
513 | gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3)); | 519 | gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3)); |
diff --git a/arch/arm/mach-mx3/mach-mx35pdk.c b/arch/arm/mach-mx3/mach-mx35_3ds.c index bcac84d4dca4..1c30d7212f17 100644 --- a/arch/arm/mach-mx3/mach-mx35pdk.c +++ b/arch/arm/mach-mx3/mach-mx35_3ds.c | |||
@@ -12,10 +12,12 @@ | |||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | * GNU General Public License for more details. | 14 | * GNU General Public License for more details. |
15 | * | 15 | */ |
16 | * You should have received a copy of the GNU General Public License | 16 | |
17 | * along with this program; if not, write to the Free Software | 17 | /* |
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 18 | * This machine is known as: |
19 | * - i.MX35 3-Stack Development System | ||
20 | * - i.MX35 Platform Development Kit (i.MX35 PDK) | ||
19 | */ | 21 | */ |
20 | 22 | ||
21 | #include <linux/types.h> | 23 | #include <linux/types.h> |
@@ -32,12 +34,12 @@ | |||
32 | 34 | ||
33 | #include <mach/hardware.h> | 35 | #include <mach/hardware.h> |
34 | #include <mach/common.h> | 36 | #include <mach/common.h> |
35 | #include <mach/imx-uart.h> | ||
36 | #include <mach/iomux-mx35.h> | 37 | #include <mach/iomux-mx35.h> |
37 | 38 | ||
39 | #include "devices-imx35.h" | ||
38 | #include "devices.h" | 40 | #include "devices.h" |
39 | 41 | ||
40 | static struct imxuart_platform_data uart_pdata = { | 42 | static const struct imxuart_platform_data uart_pdata __initconst = { |
41 | .flags = IMXUART_HAVE_RTSCTS, | 43 | .flags = IMXUART_HAVE_RTSCTS, |
42 | }; | 44 | }; |
43 | 45 | ||
@@ -90,7 +92,7 @@ static void __init mxc_board_init(void) | |||
90 | 92 | ||
91 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 93 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
92 | 94 | ||
93 | mxc_register_device(&mxc_uart_device0, &uart_pdata); | 95 | imx35_add_imx_uart0(&uart_pdata); |
94 | 96 | ||
95 | mxc_register_device(&mxc_otg_udc_device, &usb_pdata); | 97 | mxc_register_device(&mxc_otg_udc_device, &usb_pdata); |
96 | } | 98 | } |
diff --git a/arch/arm/mach-mx3/mach-pcm037.c b/arch/arm/mach-mx3/mach-pcm037.c index cce410662383..8a292dd1a714 100644 --- a/arch/arm/mach-mx3/mach-pcm037.c +++ b/arch/arm/mach-mx3/mach-pcm037.c | |||
@@ -10,10 +10,6 @@ | |||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | * GNU General Public License for more details. | 12 | * GNU General Public License for more details. |
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
17 | */ | 13 | */ |
18 | 14 | ||
19 | #include <linux/types.h> | 15 | #include <linux/types.h> |
@@ -43,20 +39,17 @@ | |||
43 | #include <asm/mach/arch.h> | 39 | #include <asm/mach/arch.h> |
44 | #include <asm/mach/time.h> | 40 | #include <asm/mach/time.h> |
45 | #include <asm/mach/map.h> | 41 | #include <asm/mach/map.h> |
46 | #include <mach/board-pcm037.h> | ||
47 | #include <mach/common.h> | 42 | #include <mach/common.h> |
48 | #include <mach/hardware.h> | 43 | #include <mach/hardware.h> |
49 | #include <mach/i2c.h> | ||
50 | #include <mach/imx-uart.h> | ||
51 | #include <mach/iomux-mx3.h> | 44 | #include <mach/iomux-mx3.h> |
52 | #include <mach/ipu.h> | 45 | #include <mach/ipu.h> |
53 | #include <mach/mmc.h> | 46 | #include <mach/mmc.h> |
54 | #include <mach/mx3_camera.h> | 47 | #include <mach/mx3_camera.h> |
55 | #include <mach/mx3fb.h> | 48 | #include <mach/mx3fb.h> |
56 | #include <mach/mxc_nand.h> | ||
57 | #include <mach/mxc_ehci.h> | 49 | #include <mach/mxc_ehci.h> |
58 | #include <mach/ulpi.h> | 50 | #include <mach/ulpi.h> |
59 | 51 | ||
52 | #include "devices-imx31.h" | ||
60 | #include "devices.h" | 53 | #include "devices.h" |
61 | #include "pcm037.h" | 54 | #include "pcm037.h" |
62 | 55 | ||
@@ -225,7 +218,7 @@ static struct platform_device pcm037_flash = { | |||
225 | .num_resources = 1, | 218 | .num_resources = 1, |
226 | }; | 219 | }; |
227 | 220 | ||
228 | static struct imxuart_platform_data uart_pdata = { | 221 | static const struct imxuart_platform_data uart_pdata __initconst = { |
229 | .flags = IMXUART_HAVE_RTSCTS, | 222 | .flags = IMXUART_HAVE_RTSCTS, |
230 | }; | 223 | }; |
231 | 224 | ||
@@ -279,16 +272,17 @@ static struct platform_device pcm037_sram_device = { | |||
279 | .resource = &pcm038_sram_resource, | 272 | .resource = &pcm038_sram_resource, |
280 | }; | 273 | }; |
281 | 274 | ||
282 | static struct mxc_nand_platform_data pcm037_nand_board_info = { | 275 | static const struct mxc_nand_platform_data |
276 | pcm037_nand_board_info __initconst = { | ||
283 | .width = 1, | 277 | .width = 1, |
284 | .hw_ecc = 1, | 278 | .hw_ecc = 1, |
285 | }; | 279 | }; |
286 | 280 | ||
287 | static struct imxi2c_platform_data pcm037_i2c_1_data = { | 281 | static const struct imxi2c_platform_data pcm037_i2c1_data __initconst = { |
288 | .bitrate = 100000, | 282 | .bitrate = 100000, |
289 | }; | 283 | }; |
290 | 284 | ||
291 | static struct imxi2c_platform_data pcm037_i2c_2_data = { | 285 | static const struct imxi2c_platform_data pcm037_i2c2_data __initconst = { |
292 | .bitrate = 20000, | 286 | .bitrate = 20000, |
293 | }; | 287 | }; |
294 | 288 | ||
@@ -545,6 +539,7 @@ static struct platform_device pcm970_sja1000 = { | |||
545 | .num_resources = ARRAY_SIZE(pcm970_sja1000_resources), | 539 | .num_resources = ARRAY_SIZE(pcm970_sja1000_resources), |
546 | }; | 540 | }; |
547 | 541 | ||
542 | #if defined(CONFIG_USB_ULPI) | ||
548 | static struct mxc_usbh_platform_data otg_pdata = { | 543 | static struct mxc_usbh_platform_data otg_pdata = { |
549 | .portsc = MXC_EHCI_MODE_ULPI, | 544 | .portsc = MXC_EHCI_MODE_ULPI, |
550 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, | 545 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, |
@@ -554,6 +549,7 @@ static struct mxc_usbh_platform_data usbh2_pdata = { | |||
554 | .portsc = MXC_EHCI_MODE_ULPI, | 549 | .portsc = MXC_EHCI_MODE_ULPI, |
555 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, | 550 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, |
556 | }; | 551 | }; |
552 | #endif | ||
557 | 553 | ||
558 | static struct fsl_usb2_platform_data otg_device_pdata = { | 554 | static struct fsl_usb2_platform_data otg_device_pdata = { |
559 | .operating_mode = FSL_USB2_DR_DEVICE, | 555 | .operating_mode = FSL_USB2_DR_DEVICE, |
@@ -581,7 +577,6 @@ __setup("otg_mode=", pcm037_otg_mode); | |||
581 | static void __init mxc_board_init(void) | 577 | static void __init mxc_board_init(void) |
582 | { | 578 | { |
583 | int ret; | 579 | int ret; |
584 | u32 tmp; | ||
585 | 580 | ||
586 | mxc_iomux_set_gpr(MUX_PGP_UH2, 1); | 581 | mxc_iomux_set_gpr(MUX_PGP_UH2, 1); |
587 | 582 | ||
@@ -614,9 +609,10 @@ static void __init mxc_board_init(void) | |||
614 | 609 | ||
615 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 610 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
616 | 611 | ||
617 | mxc_register_device(&mxc_uart_device0, &uart_pdata); | 612 | imx31_add_imx_uart0(&uart_pdata); |
618 | mxc_register_device(&mxc_uart_device1, &uart_pdata); | 613 | /* XXX: should't this have .flags = 0 (i.e. no RTSCTS) on PCM037_EET? */ |
619 | mxc_register_device(&mxc_uart_device2, &uart_pdata); | 614 | imx31_add_imx_uart1(&uart_pdata); |
615 | imx31_add_imx_uart2(&uart_pdata); | ||
620 | 616 | ||
621 | mxc_register_device(&mxc_w1_master_device, NULL); | 617 | mxc_register_device(&mxc_w1_master_device, NULL); |
622 | 618 | ||
@@ -634,10 +630,10 @@ static void __init mxc_board_init(void) | |||
634 | i2c_register_board_info(1, pcm037_i2c_devices, | 630 | i2c_register_board_info(1, pcm037_i2c_devices, |
635 | ARRAY_SIZE(pcm037_i2c_devices)); | 631 | ARRAY_SIZE(pcm037_i2c_devices)); |
636 | 632 | ||
637 | mxc_register_device(&mxc_i2c_device1, &pcm037_i2c_1_data); | 633 | imx31_add_imx_i2c1(&pcm037_i2c1_data); |
638 | mxc_register_device(&mxc_i2c_device2, &pcm037_i2c_2_data); | 634 | imx31_add_imx_i2c2(&pcm037_i2c2_data); |
639 | 635 | ||
640 | mxc_register_device(&mxc_nand_device, &pcm037_nand_board_info); | 636 | imx31_add_mxc_nand(&pcm037_nand_board_info); |
641 | mxc_register_device(&mxcsdhc_device0, &sdhc_pdata); | 637 | mxc_register_device(&mxcsdhc_device0, &sdhc_pdata); |
642 | mxc_register_device(&mx3_ipu, &mx3_ipu_data); | 638 | mxc_register_device(&mx3_ipu, &mx3_ipu_data); |
643 | mxc_register_device(&mx3_fb, &mx3fb_pdata); | 639 | mxc_register_device(&mx3_fb, &mx3fb_pdata); |
diff --git a/arch/arm/mach-mx3/mach-pcm037_eet.c b/arch/arm/mach-mx3/mach-pcm037_eet.c index 8d386000fc40..c8b98218efee 100644 --- a/arch/arm/mach-mx3/mach-pcm037_eet.c +++ b/arch/arm/mach-mx3/mach-pcm037_eet.c | |||
@@ -13,9 +13,6 @@ | |||
13 | #include <linux/spi/spi.h> | 13 | #include <linux/spi/spi.h> |
14 | 14 | ||
15 | #include <mach/common.h> | 15 | #include <mach/common.h> |
16 | #if defined(CONFIG_SPI_IMX) || defined(CONFIG_SPI_IMX_MODULE) | ||
17 | #include <mach/spi.h> | ||
18 | #endif | ||
19 | #include <mach/iomux-mx3.h> | 16 | #include <mach/iomux-mx3.h> |
20 | 17 | ||
21 | #include <asm/mach-types.h> | 18 | #include <asm/mach-types.h> |
@@ -64,7 +61,7 @@ static struct spi_board_info pcm037_spi_dev[] = { | |||
64 | #if defined(CONFIG_SPI_IMX) || defined(CONFIG_SPI_IMX_MODULE) | 61 | #if defined(CONFIG_SPI_IMX) || defined(CONFIG_SPI_IMX_MODULE) |
65 | static int pcm037_spi1_cs[] = {MXC_SPI_CS(1), IOMUX_TO_GPIO(MX31_PIN_KEY_COL7)}; | 62 | static int pcm037_spi1_cs[] = {MXC_SPI_CS(1), IOMUX_TO_GPIO(MX31_PIN_KEY_COL7)}; |
66 | 63 | ||
67 | struct spi_imx_master pcm037_spi1_master = { | 64 | static const struct spi_imx_master pcm037_spi1_pdata __initconst = { |
68 | .chipselect = pcm037_spi1_cs, | 65 | .chipselect = pcm037_spi1_cs, |
69 | .num_chipselect = ARRAY_SIZE(pcm037_spi1_cs), | 66 | .num_chipselect = ARRAY_SIZE(pcm037_spi1_cs), |
70 | }; | 67 | }; |
@@ -184,7 +181,7 @@ static int eet_init_devices(void) | |||
184 | /* SPI */ | 181 | /* SPI */ |
185 | spi_register_board_info(pcm037_spi_dev, ARRAY_SIZE(pcm037_spi_dev)); | 182 | spi_register_board_info(pcm037_spi_dev, ARRAY_SIZE(pcm037_spi_dev)); |
186 | #if defined(CONFIG_SPI_IMX) || defined(CONFIG_SPI_IMX_MODULE) | 183 | #if defined(CONFIG_SPI_IMX) || defined(CONFIG_SPI_IMX_MODULE) |
187 | mxc_register_device(&mxc_spi_device0, &pcm037_spi1_master); | 184 | imx35_add_spi_imx0(&pcm037_spi1_pdata); |
188 | #endif | 185 | #endif |
189 | 186 | ||
190 | platform_device_register(&pcm037_gpio_keys_device); | 187 | platform_device_register(&pcm037_gpio_keys_device); |
diff --git a/arch/arm/mach-mx3/mach-pcm043.c b/arch/arm/mach-mx3/mach-pcm043.c index 78d9185a9d4b..47f5311b301a 100644 --- a/arch/arm/mach-mx3/mach-pcm043.c +++ b/arch/arm/mach-mx3/mach-pcm043.c | |||
@@ -10,10 +10,6 @@ | |||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | * GNU General Public License for more details. | 12 | * GNU General Public License for more details. |
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
17 | */ | 13 | */ |
18 | 14 | ||
19 | #include <linux/types.h> | 15 | #include <linux/types.h> |
@@ -40,19 +36,15 @@ | |||
40 | 36 | ||
41 | #include <mach/hardware.h> | 37 | #include <mach/hardware.h> |
42 | #include <mach/common.h> | 38 | #include <mach/common.h> |
43 | #include <mach/imx-uart.h> | ||
44 | #if defined CONFIG_I2C_IMX || defined CONFIG_I2C_IMX_MODULE | ||
45 | #include <mach/i2c.h> | ||
46 | #endif | ||
47 | #include <mach/iomux-mx35.h> | 39 | #include <mach/iomux-mx35.h> |
48 | #include <mach/ipu.h> | 40 | #include <mach/ipu.h> |
49 | #include <mach/mx3fb.h> | 41 | #include <mach/mx3fb.h> |
50 | #include <mach/mxc_nand.h> | ||
51 | #include <mach/mxc_ehci.h> | 42 | #include <mach/mxc_ehci.h> |
52 | #include <mach/ulpi.h> | 43 | #include <mach/ulpi.h> |
53 | #include <mach/audmux.h> | 44 | #include <mach/audmux.h> |
54 | #include <mach/ssi.h> | 45 | #include <mach/ssi.h> |
55 | 46 | ||
47 | #include "devices-imx35.h" | ||
56 | #include "devices.h" | 48 | #include "devices.h" |
57 | 49 | ||
58 | static const struct fb_videomode fb_modedb[] = { | 50 | static const struct fb_videomode fb_modedb[] = { |
@@ -122,12 +114,12 @@ static struct platform_device pcm043_flash = { | |||
122 | .num_resources = 1, | 114 | .num_resources = 1, |
123 | }; | 115 | }; |
124 | 116 | ||
125 | static struct imxuart_platform_data uart_pdata = { | 117 | static const struct imxuart_platform_data uart_pdata __initconst = { |
126 | .flags = IMXUART_HAVE_RTSCTS, | 118 | .flags = IMXUART_HAVE_RTSCTS, |
127 | }; | 119 | }; |
128 | 120 | ||
129 | #if defined CONFIG_I2C_IMX || defined CONFIG_I2C_IMX_MODULE | 121 | #if defined CONFIG_I2C_IMX || defined CONFIG_I2C_IMX_MODULE |
130 | static struct imxi2c_platform_data pcm043_i2c_1_data = { | 122 | static const struct imxi2c_platform_data pcm043_i2c0_data __initconst = { |
131 | .bitrate = 50000, | 123 | .bitrate = 50000, |
132 | }; | 124 | }; |
133 | 125 | ||
@@ -222,6 +214,9 @@ static struct pad_desc pcm043_pads[] = { | |||
222 | MX35_PAD_STXD4__AUDMUX_AUD4_TXD, | 214 | MX35_PAD_STXD4__AUDMUX_AUD4_TXD, |
223 | MX35_PAD_SRXD4__AUDMUX_AUD4_RXD, | 215 | MX35_PAD_SRXD4__AUDMUX_AUD4_RXD, |
224 | MX35_PAD_SCK4__AUDMUX_AUD4_TXC, | 216 | MX35_PAD_SCK4__AUDMUX_AUD4_TXC, |
217 | /* CAN2 */ | ||
218 | MX35_PAD_TX5_RX0__CAN2_TXCAN, | ||
219 | MX35_PAD_TX4_RX1__CAN2_RXCAN, | ||
225 | }; | 220 | }; |
226 | 221 | ||
227 | #define AC97_GPIO_TXFS (1 * 32 + 31) | 222 | #define AC97_GPIO_TXFS (1 * 32 + 31) |
@@ -304,11 +299,13 @@ static struct imx_ssi_platform_data pcm043_ssi_pdata = { | |||
304 | .flags = IMX_SSI_USE_AC97, | 299 | .flags = IMX_SSI_USE_AC97, |
305 | }; | 300 | }; |
306 | 301 | ||
307 | static struct mxc_nand_platform_data pcm037_nand_board_info = { | 302 | static const struct mxc_nand_platform_data |
303 | pcm037_nand_board_info __initconst = { | ||
308 | .width = 1, | 304 | .width = 1, |
309 | .hw_ecc = 1, | 305 | .hw_ecc = 1, |
310 | }; | 306 | }; |
311 | 307 | ||
308 | #if defined(CONFIG_USB_ULPI) | ||
312 | static struct mxc_usbh_platform_data otg_pdata = { | 309 | static struct mxc_usbh_platform_data otg_pdata = { |
313 | .portsc = MXC_EHCI_MODE_UTMI, | 310 | .portsc = MXC_EHCI_MODE_UTMI, |
314 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, | 311 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, |
@@ -319,6 +316,7 @@ static struct mxc_usbh_platform_data usbh1_pdata = { | |||
319 | .flags = MXC_EHCI_INTERFACE_SINGLE_UNI | MXC_EHCI_INTERNAL_PHY | | 316 | .flags = MXC_EHCI_INTERFACE_SINGLE_UNI | MXC_EHCI_INTERNAL_PHY | |
320 | MXC_EHCI_IPPUE_DOWN, | 317 | MXC_EHCI_IPPUE_DOWN, |
321 | }; | 318 | }; |
319 | #endif | ||
322 | 320 | ||
323 | static struct fsl_usb2_platform_data otg_device_pdata = { | 321 | static struct fsl_usb2_platform_data otg_device_pdata = { |
324 | .operating_mode = FSL_USB2_DR_DEVICE, | 322 | .operating_mode = FSL_USB2_DR_DEVICE, |
@@ -361,17 +359,17 @@ static void __init mxc_board_init(void) | |||
361 | 359 | ||
362 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 360 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
363 | 361 | ||
364 | mxc_register_device(&mxc_uart_device0, &uart_pdata); | 362 | imx35_add_imx_uart0(&uart_pdata); |
365 | mxc_register_device(&mxc_nand_device, &pcm037_nand_board_info); | 363 | imx35_add_mxc_nand(&pcm037_nand_board_info); |
366 | mxc_register_device(&imx_ssi_device0, &pcm043_ssi_pdata); | 364 | mxc_register_device(&imx_ssi_device0, &pcm043_ssi_pdata); |
367 | 365 | ||
368 | mxc_register_device(&mxc_uart_device1, &uart_pdata); | 366 | imx35_add_imx_uart1(&uart_pdata); |
369 | 367 | ||
370 | #if defined CONFIG_I2C_IMX || defined CONFIG_I2C_IMX_MODULE | 368 | #if defined CONFIG_I2C_IMX || defined CONFIG_I2C_IMX_MODULE |
371 | i2c_register_board_info(0, pcm043_i2c_devices, | 369 | i2c_register_board_info(0, pcm043_i2c_devices, |
372 | ARRAY_SIZE(pcm043_i2c_devices)); | 370 | ARRAY_SIZE(pcm043_i2c_devices)); |
373 | 371 | ||
374 | mxc_register_device(&mxc_i2c_device0, &pcm043_i2c_1_data); | 372 | imx35_add_imx_i2c0(&pcm043_i2c0_data); |
375 | #endif | 373 | #endif |
376 | 374 | ||
377 | mxc_register_device(&mx3_ipu, &mx3_ipu_data); | 375 | mxc_register_device(&mx3_ipu, &mx3_ipu_data); |
@@ -390,6 +388,7 @@ static void __init mxc_board_init(void) | |||
390 | if (!otg_mode_host) | 388 | if (!otg_mode_host) |
391 | mxc_register_device(&mxc_otg_udc_device, &otg_device_pdata); | 389 | mxc_register_device(&mxc_otg_udc_device, &otg_device_pdata); |
392 | 390 | ||
391 | imx35_add_flexcan1(NULL); | ||
393 | } | 392 | } |
394 | 393 | ||
395 | static void __init pcm043_timer_init(void) | 394 | static void __init pcm043_timer_init(void) |
diff --git a/arch/arm/mach-mx3/mach-qong.c b/arch/arm/mach-mx3/mach-qong.c index e5b5b8323a17..d44ac70222a5 100644 --- a/arch/arm/mach-mx3/mach-qong.c +++ b/arch/arm/mach-mx3/mach-qong.c | |||
@@ -10,10 +10,6 @@ | |||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | * GNU General Public License for more details. | 12 | * GNU General Public License for more details. |
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
17 | */ | 13 | */ |
18 | 14 | ||
19 | #include <linux/types.h> | 15 | #include <linux/types.h> |
@@ -34,9 +30,9 @@ | |||
34 | #include <mach/common.h> | 30 | #include <mach/common.h> |
35 | #include <asm/page.h> | 31 | #include <asm/page.h> |
36 | #include <asm/setup.h> | 32 | #include <asm/setup.h> |
37 | #include <mach/board-qong.h> | ||
38 | #include <mach/imx-uart.h> | ||
39 | #include <mach/iomux-mx3.h> | 33 | #include <mach/iomux-mx3.h> |
34 | |||
35 | #include "devices-imx31.h" | ||
40 | #include "devices.h" | 36 | #include "devices.h" |
41 | 37 | ||
42 | /* FPGA defines */ | 38 | /* FPGA defines */ |
@@ -62,7 +58,7 @@ | |||
62 | * This file contains the board-specific initialization routines. | 58 | * This file contains the board-specific initialization routines. |
63 | */ | 59 | */ |
64 | 60 | ||
65 | static struct imxuart_platform_data uart_pdata = { | 61 | static const struct imxuart_platform_data uart_pdata __initconst = { |
66 | .flags = IMXUART_HAVE_RTSCTS, | 62 | .flags = IMXUART_HAVE_RTSCTS, |
67 | }; | 63 | }; |
68 | 64 | ||
@@ -73,11 +69,11 @@ static int uart_pins[] = { | |||
73 | MX31_PIN_RXD1__RXD1 | 69 | MX31_PIN_RXD1__RXD1 |
74 | }; | 70 | }; |
75 | 71 | ||
76 | static inline void mxc_init_imx_uart(void) | 72 | static inline void __init mxc_init_imx_uart(void) |
77 | { | 73 | { |
78 | mxc_iomux_setup_multiple_pins(uart_pins, ARRAY_SIZE(uart_pins), | 74 | mxc_iomux_setup_multiple_pins(uart_pins, ARRAY_SIZE(uart_pins), |
79 | "uart-0"); | 75 | "uart-0"); |
80 | mxc_register_device(&mxc_uart_device0, &uart_pdata); | 76 | imx31_add_imx_uart0(&uart_pdata); |
81 | } | 77 | } |
82 | 78 | ||
83 | static struct resource dnet_resources[] = { | 79 | static struct resource dnet_resources[] = { |
@@ -116,7 +112,7 @@ static struct physmap_flash_data qong_flash_data = { | |||
116 | 112 | ||
117 | static struct resource qong_flash_resource = { | 113 | static struct resource qong_flash_resource = { |
118 | .start = MX31_CS0_BASE_ADDR, | 114 | .start = MX31_CS0_BASE_ADDR, |
119 | .end = MX31_CS0_BASE_ADDR + QONG_NOR_SIZE - 1, | 115 | .end = MX31_CS0_BASE_ADDR + SZ_128M - 1, |
120 | .flags = IORESOURCE_MEM, | 116 | .flags = IORESOURCE_MEM, |
121 | }; | 117 | }; |
122 | 118 | ||
diff --git a/arch/arm/mach-mx3/mm.c b/arch/arm/mach-mx3/mm.c index 6858a4f9806c..20e48c0195c4 100644 --- a/arch/arm/mach-mx3/mm.c +++ b/arch/arm/mach-mx3/mm.c | |||
@@ -14,10 +14,6 @@ | |||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | * GNU General Public License for more details. | 16 | * GNU General Public License for more details. |
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
21 | */ | 17 | */ |
22 | 18 | ||
23 | #include <linux/mm.h> | 19 | #include <linux/mm.h> |
@@ -97,9 +93,12 @@ void __init mx35_map_io(void) | |||
97 | } | 93 | } |
98 | #endif | 94 | #endif |
99 | 95 | ||
96 | int imx3x_register_gpios(void); | ||
97 | |||
100 | void __init mx31_init_irq(void) | 98 | void __init mx31_init_irq(void) |
101 | { | 99 | { |
102 | mxc_init_irq(IO_ADDRESS(AVIC_BASE_ADDR)); | 100 | mxc_init_irq(IO_ADDRESS(AVIC_BASE_ADDR)); |
101 | imx3x_register_gpios(); | ||
103 | } | 102 | } |
104 | 103 | ||
105 | void __init mx35_init_irq(void) | 104 | void __init mx35_init_irq(void) |
diff --git a/arch/arm/mach-mx3/mx31lilly-db.c b/arch/arm/mach-mx3/mx31lilly-db.c index 7aebd74a12e8..827fd3c80201 100644 --- a/arch/arm/mach-mx3/mx31lilly-db.c +++ b/arch/arm/mach-mx3/mx31lilly-db.c | |||
@@ -18,10 +18,6 @@ | |||
18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
20 | * GNU General Public License for more details. | 20 | * GNU General Public License for more details. |
21 | * | ||
22 | * You should have received a copy of the GNU General Public License | ||
23 | * along with this program; if not, write to the Free Software | ||
24 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
25 | */ | 21 | */ |
26 | 22 | ||
27 | #include <linux/kernel.h> | 23 | #include <linux/kernel.h> |
@@ -36,13 +32,13 @@ | |||
36 | 32 | ||
37 | #include <mach/hardware.h> | 33 | #include <mach/hardware.h> |
38 | #include <mach/common.h> | 34 | #include <mach/common.h> |
39 | #include <mach/imx-uart.h> | ||
40 | #include <mach/iomux-mx3.h> | 35 | #include <mach/iomux-mx3.h> |
41 | #include <mach/board-mx31lilly.h> | 36 | #include <mach/board-mx31lilly.h> |
42 | #include <mach/mmc.h> | 37 | #include <mach/mmc.h> |
43 | #include <mach/mx3fb.h> | 38 | #include <mach/mx3fb.h> |
44 | #include <mach/ipu.h> | 39 | #include <mach/ipu.h> |
45 | 40 | ||
41 | #include "devices-imx31.h" | ||
46 | #include "devices.h" | 42 | #include "devices.h" |
47 | 43 | ||
48 | /* | 44 | /* |
@@ -96,7 +92,7 @@ static unsigned int lilly_db_board_pins[] __initdata = { | |||
96 | }; | 92 | }; |
97 | 93 | ||
98 | /* UART */ | 94 | /* UART */ |
99 | static struct imxuart_platform_data uart_pdata __initdata = { | 95 | static const struct imxuart_platform_data uart_pdata __initconst = { |
100 | .flags = IMXUART_HAVE_RTSCTS, | 96 | .flags = IMXUART_HAVE_RTSCTS, |
101 | }; | 97 | }; |
102 | 98 | ||
@@ -217,9 +213,9 @@ void __init mx31lilly_db_init(void) | |||
217 | mxc_iomux_setup_multiple_pins(lilly_db_board_pins, | 213 | mxc_iomux_setup_multiple_pins(lilly_db_board_pins, |
218 | ARRAY_SIZE(lilly_db_board_pins), | 214 | ARRAY_SIZE(lilly_db_board_pins), |
219 | "development board pins"); | 215 | "development board pins"); |
220 | mxc_register_device(&mxc_uart_device0, &uart_pdata); | 216 | imx31_add_imx_uart0(&uart_pdata); |
221 | mxc_register_device(&mxc_uart_device1, &uart_pdata); | 217 | imx31_add_imx_uart1(&uart_pdata); |
222 | mxc_register_device(&mxc_uart_device2, &uart_pdata); | 218 | imx31_add_imx_uart2(&uart_pdata); |
223 | mxc_register_device(&mxcsdhc_device0, &mmc_pdata); | 219 | mxc_register_device(&mxcsdhc_device0, &mmc_pdata); |
224 | mx31lilly_init_fb(); | 220 | mx31lilly_init_fb(); |
225 | } | 221 | } |
diff --git a/arch/arm/mach-mx3/mx31lite-db.c b/arch/arm/mach-mx3/mx31lite-db.c index 5f05bfbec380..7b0e74e275ba 100644 --- a/arch/arm/mach-mx3/mx31lite-db.c +++ b/arch/arm/mach-mx3/mx31lite-db.c | |||
@@ -18,10 +18,6 @@ | |||
18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
20 | * GNU General Public License for more details. | 20 | * GNU General Public License for more details. |
21 | * | ||
22 | * You should have received a copy of the GNU General Public License | ||
23 | * along with this program; if not, write to the Free Software | ||
24 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
25 | */ | 21 | */ |
26 | 22 | ||
27 | #include <linux/kernel.h> | 23 | #include <linux/kernel.h> |
@@ -37,12 +33,11 @@ | |||
37 | 33 | ||
38 | #include <mach/hardware.h> | 34 | #include <mach/hardware.h> |
39 | #include <mach/common.h> | 35 | #include <mach/common.h> |
40 | #include <mach/imx-uart.h> | ||
41 | #include <mach/iomux-mx3.h> | 36 | #include <mach/iomux-mx3.h> |
42 | #include <mach/board-mx31lite.h> | 37 | #include <mach/board-mx31lite.h> |
43 | #include <mach/mmc.h> | 38 | #include <mach/mmc.h> |
44 | #include <mach/spi.h> | ||
45 | 39 | ||
40 | #include "devices-imx31.h" | ||
46 | #include "devices.h" | 41 | #include "devices.h" |
47 | 42 | ||
48 | /* | 43 | /* |
@@ -76,7 +71,7 @@ static unsigned int litekit_db_board_pins[] __initdata = { | |||
76 | }; | 71 | }; |
77 | 72 | ||
78 | /* UART */ | 73 | /* UART */ |
79 | static struct imxuart_platform_data uart_pdata __initdata = { | 74 | static const struct imxuart_platform_data uart_pdata __initconst = { |
80 | .flags = IMXUART_HAVE_RTSCTS, | 75 | .flags = IMXUART_HAVE_RTSCTS, |
81 | }; | 76 | }; |
82 | 77 | ||
@@ -161,7 +156,7 @@ static int spi_internal_chipselect[] = { | |||
161 | MXC_SPI_CS(2), | 156 | MXC_SPI_CS(2), |
162 | }; | 157 | }; |
163 | 158 | ||
164 | static struct spi_imx_master spi0_pdata = { | 159 | static const struct spi_imx_master spi0_pdata __initconst = { |
165 | .chipselect = spi_internal_chipselect, | 160 | .chipselect = spi_internal_chipselect, |
166 | .num_chipselect = ARRAY_SIZE(spi_internal_chipselect), | 161 | .num_chipselect = ARRAY_SIZE(spi_internal_chipselect), |
167 | }; | 162 | }; |
@@ -201,9 +196,9 @@ void __init mx31lite_db_init(void) | |||
201 | mxc_iomux_setup_multiple_pins(litekit_db_board_pins, | 196 | mxc_iomux_setup_multiple_pins(litekit_db_board_pins, |
202 | ARRAY_SIZE(litekit_db_board_pins), | 197 | ARRAY_SIZE(litekit_db_board_pins), |
203 | "development board pins"); | 198 | "development board pins"); |
204 | mxc_register_device(&mxc_uart_device0, &uart_pdata); | 199 | imx31_add_imx_uart0(&uart_pdata); |
205 | mxc_register_device(&mxcsdhc_device0, &mmc_pdata); | 200 | mxc_register_device(&mxcsdhc_device0, &mmc_pdata); |
206 | mxc_register_device(&mxc_spi_device0, &spi0_pdata); | 201 | imx31_add_spi_imx0(&spi0_pdata); |
207 | platform_device_register(&litekit_led_device); | 202 | platform_device_register(&litekit_led_device); |
208 | mxc_register_device(&imx_wdt_device0, NULL); | 203 | mxc_register_device(&imx_wdt_device0, NULL); |
209 | mxc_register_device(&imx_rtc_device0, NULL); | 204 | mxc_register_device(&imx_rtc_device0, NULL); |
diff --git a/arch/arm/mach-mx3/mx31moboard-devboard.c b/arch/arm/mach-mx3/mx31moboard-devboard.c index 582299cb2c08..fc395a7a8599 100644 --- a/arch/arm/mach-mx3/mx31moboard-devboard.c +++ b/arch/arm/mach-mx3/mx31moboard-devboard.c | |||
@@ -10,10 +10,6 @@ | |||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | * GNU General Public License for more details. | 12 | * GNU General Public License for more details. |
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
17 | */ | 13 | */ |
18 | 14 | ||
19 | #include <linux/gpio.h> | 15 | #include <linux/gpio.h> |
@@ -27,13 +23,13 @@ | |||
27 | #include <linux/usb/otg.h> | 23 | #include <linux/usb/otg.h> |
28 | 24 | ||
29 | #include <mach/common.h> | 25 | #include <mach/common.h> |
30 | #include <mach/imx-uart.h> | ||
31 | #include <mach/iomux-mx3.h> | 26 | #include <mach/iomux-mx3.h> |
32 | #include <mach/hardware.h> | 27 | #include <mach/hardware.h> |
33 | #include <mach/mmc.h> | 28 | #include <mach/mmc.h> |
34 | #include <mach/mxc_ehci.h> | 29 | #include <mach/mxc_ehci.h> |
35 | #include <mach/ulpi.h> | 30 | #include <mach/ulpi.h> |
36 | 31 | ||
32 | #include "devices-imx31.h" | ||
37 | #include "devices.h" | 33 | #include "devices.h" |
38 | 34 | ||
39 | static unsigned int devboard_pins[] = { | 35 | static unsigned int devboard_pins[] = { |
@@ -56,7 +52,7 @@ static unsigned int devboard_pins[] = { | |||
56 | MX31_PIN_RI_DCE1__GPIO2_10, MX31_PIN_DCD_DCE1__GPIO2_11, | 52 | MX31_PIN_RI_DCE1__GPIO2_10, MX31_PIN_DCD_DCE1__GPIO2_11, |
57 | }; | 53 | }; |
58 | 54 | ||
59 | static struct imxuart_platform_data uart_pdata = { | 55 | static const struct imxuart_platform_data uart_pdata __initconst = { |
60 | .flags = IMXUART_HAVE_RTSCTS, | 56 | .flags = IMXUART_HAVE_RTSCTS, |
61 | }; | 57 | }; |
62 | 58 | ||
@@ -230,7 +226,7 @@ void __init mx31moboard_devboard_init(void) | |||
230 | mxc_iomux_setup_multiple_pins(devboard_pins, ARRAY_SIZE(devboard_pins), | 226 | mxc_iomux_setup_multiple_pins(devboard_pins, ARRAY_SIZE(devboard_pins), |
231 | "devboard"); | 227 | "devboard"); |
232 | 228 | ||
233 | mxc_register_device(&mxc_uart_device1, &uart_pdata); | 229 | imx31_add_imx_uart1(&uart_pdata); |
234 | 230 | ||
235 | mxc_register_device(&mxcsdhc_device1, &sdhc2_pdata); | 231 | mxc_register_device(&mxcsdhc_device1, &sdhc2_pdata); |
236 | 232 | ||
diff --git a/arch/arm/mach-mx3/mx31moboard-marxbot.c b/arch/arm/mach-mx3/mx31moboard-marxbot.c index 4930f8c27e66..0551eb39d97e 100644 --- a/arch/arm/mach-mx3/mx31moboard-marxbot.c +++ b/arch/arm/mach-mx3/mx31moboard-marxbot.c | |||
@@ -10,10 +10,6 @@ | |||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | * GNU General Public License for more details. | 12 | * GNU General Public License for more details. |
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
17 | */ | 13 | */ |
18 | 14 | ||
19 | #include <linux/delay.h> | 15 | #include <linux/delay.h> |
diff --git a/arch/arm/mach-mx3/mx31moboard-smartbot.c b/arch/arm/mach-mx3/mx31moboard-smartbot.c index 293eea6d9d97..40c3e7564cb6 100644 --- a/arch/arm/mach-mx3/mx31moboard-smartbot.c +++ b/arch/arm/mach-mx3/mx31moboard-smartbot.c | |||
@@ -10,10 +10,6 @@ | |||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | * GNU General Public License for more details. | 12 | * GNU General Public License for more details. |
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
17 | */ | 13 | */ |
18 | 14 | ||
19 | #include <linux/delay.h> | 15 | #include <linux/delay.h> |
@@ -30,7 +26,6 @@ | |||
30 | 26 | ||
31 | #include <mach/common.h> | 27 | #include <mach/common.h> |
32 | #include <mach/hardware.h> | 28 | #include <mach/hardware.h> |
33 | #include <mach/imx-uart.h> | ||
34 | #include <mach/iomux-mx3.h> | 29 | #include <mach/iomux-mx3.h> |
35 | #include <mach/board-mx31moboard.h> | 30 | #include <mach/board-mx31moboard.h> |
36 | #include <mach/mxc_ehci.h> | 31 | #include <mach/mxc_ehci.h> |
@@ -38,6 +33,7 @@ | |||
38 | 33 | ||
39 | #include <media/soc_camera.h> | 34 | #include <media/soc_camera.h> |
40 | 35 | ||
36 | #include "devices-imx31.h" | ||
41 | #include "devices.h" | 37 | #include "devices.h" |
42 | 38 | ||
43 | static unsigned int smartbot_pins[] = { | 39 | static unsigned int smartbot_pins[] = { |
@@ -59,7 +55,7 @@ static unsigned int smartbot_pins[] = { | |||
59 | MX31_PIN_RI_DCE1__GPIO2_10, MX31_PIN_DCD_DCE1__GPIO2_11, | 55 | MX31_PIN_RI_DCE1__GPIO2_10, MX31_PIN_DCD_DCE1__GPIO2_11, |
60 | }; | 56 | }; |
61 | 57 | ||
62 | static struct imxuart_platform_data uart_pdata = { | 58 | static const struct imxuart_platform_data uart_pdata __initconst = { |
63 | .flags = IMXUART_HAVE_RTSCTS, | 59 | .flags = IMXUART_HAVE_RTSCTS, |
64 | }; | 60 | }; |
65 | 61 | ||
@@ -183,8 +179,7 @@ void __init mx31moboard_smartbot_init(int board) | |||
183 | mxc_iomux_setup_multiple_pins(smartbot_pins, ARRAY_SIZE(smartbot_pins), | 179 | mxc_iomux_setup_multiple_pins(smartbot_pins, ARRAY_SIZE(smartbot_pins), |
184 | "smartbot"); | 180 | "smartbot"); |
185 | 181 | ||
186 | mxc_register_device(&mxc_uart_device1, &uart_pdata); | 182 | imx31_add_imx_uart1(&uart_pdata); |
187 | |||
188 | 183 | ||
189 | switch (board) { | 184 | switch (board) { |
190 | case MX31SMARTBOT: | 185 | case MX31SMARTBOT: |