diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2010-08-10 16:57:24 -0400 |
---|---|---|
committer | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2010-09-27 09:46:37 -0400 |
commit | 5162de08d116fe7bbb912b17d84169983bfa16a8 (patch) | |
tree | 406d776cca714de1bdb819ef1009867fd6bb4de7 /arch | |
parent | 35bab0589b9a71533b37280eefa430c21dc102fe (diff) |
ARM: imx: change the way imx-uarts are registered
For mx1_defconfig this yields:
add/remove: 1/0 grow/shrink: 1/4 up/down: 49/-108 (-59)
function old new delta
imx1_imx_uart_data - 48 +48
kernel_config_data 7277 7278 +1
imx_add_imx_uart_1irq 132 128 -4
imx_add_imx_uart_3irq 164 156 -8
scb9328_init 96 64 -32
mx1ads_init 220 156 -64
for mx21_defconfig this yields:
add/remove: 1/0 grow/shrink: 0/3 up/down: 64/-52 (12)
function old new delta
imx21_imx_uart_data - 64 +64
imx_add_imx_uart_3irq 160 156 -4
imx_add_imx_uart_1irq 140 136 -4
mx21ads_board_init 220 176 -44
for a random mx25 config this yields:
add/remove: 1/0 grow/shrink: 0/5 up/down: 80/-56 (24)
function old new delta
imx25_imx_uart_data - 80 +80
imx_add_imx_uart_3irq 160 156 -4
imx_add_imx_uart_1irq 140 136 -4
mx25pdk_init 288 272 -16
eukrea_mbimxsd_baseboard_init 272 256 -16
eukrea_cpuimx25_init 252 236 -16
for mx27_defconfig this yields:
add/remove: 1/0 grow/shrink: 0/10 up/down: 96/-280 (-184)
function old new delta
imx27_imx_uart_data - 96 +96
imx_add_imx_uart_3irq 160 156 -4
imx_add_imx_uart_1irq 140 136 -4
pca100_init 560 544 -16
mx27pdk_init 112 96 -16
mx27lite_init 92 76 -16
eukrea_cpuimx27_init 332 316 -16
pcm038_init 388 348 -40
mxt_td60_board_init 320 280 -40
eukrea_mbimx27_baseboard_init 476 436 -40
mx27ads_board_init 368 280 -88
and finally for mx3_defconfig:
add/remove: 2/0 grow/shrink: 0/9 up/down: 128/-344 (-216)
function old new delta
imx31_imx_uart_data - 80 +80
imx35_imx_uart_data - 48 +48
imx_add_imx_uart_1irq 132 128 -4
imx_add_imx_uart_3irq 164 152 -12
mx31moboard_devboard_init 360 344 -16
mx31lite_db_init 176 160 -16
mx31moboard_smartbot_init 384 360 -24
kzm_board_init 232 208 -24
armadillo5x0_init 392 364 -28
mx31lilly_db_init 248 208 -40
mxc_board_init 3760 3580 -180
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-imx/devices-imx1.h | 9 | ||||
-rw-r--r-- | arch/arm/mach-imx/devices-imx21.h | 15 | ||||
-rw-r--r-- | arch/arm/mach-imx/devices-imx27.h | 21 | ||||
-rw-r--r-- | arch/arm/mach-mx25/devices-imx25.h | 18 | ||||
-rw-r--r-- | arch/arm/mach-mx3/devices-imx31.h | 18 | ||||
-rw-r--r-- | arch/arm/mach-mx3/devices-imx35.h | 12 | ||||
-rw-r--r-- | arch/arm/plat-mxc/devices/platform-imx-uart.c | 127 | ||||
-rw-r--r-- | arch/arm/plat-mxc/include/mach/devices-common.h | 26 |
8 files changed, 167 insertions, 79 deletions
diff --git a/arch/arm/mach-imx/devices-imx1.h b/arch/arm/mach-imx/devices-imx1.h index a8d94f078196..2861cb8b100a 100644 --- a/arch/arm/mach-imx/devices-imx1.h +++ b/arch/arm/mach-imx/devices-imx1.h | |||
@@ -12,7 +12,8 @@ | |||
12 | #define imx1_add_i2c_imx(pdata) \ | 12 | #define imx1_add_i2c_imx(pdata) \ |
13 | imx_add_imx_i2c(0, MX1_I2C_BASE_ADDR, SZ_4K, MX1_INT_I2C, pdata) | 13 | imx_add_imx_i2c(0, MX1_I2C_BASE_ADDR, SZ_4K, MX1_INT_I2C, pdata) |
14 | 14 | ||
15 | #define imx1_add_imx_uart0(pdata) \ | 15 | extern const struct imx_imx_uart_3irq_data imx1_imx_uart_data[] __initconst; |
16 | imx_add_imx_uart_3irq(0, MX1_UART1_BASE_ADDR, 0xd0, MX1_INT_UART1RX, MX1_INT_UART1TX, MX1_INT_UART1RTS, pdata) | 16 | #define imx1_add_imx_uart(id, pdata) \ |
17 | #define imx1_add_imx_uart1(pdata) \ | 17 | imx_add_imx_uart_3irq(&imx1_imx_uart_data[id], pdata) |
18 | imx_add_imx_uart_3irq(0, MX1_UART2_BASE_ADDR, 0xd0, MX1_INT_UART2RX, MX1_INT_UART2TX, MX1_INT_UART2RTS, pdata) | 18 | #define imx1_add_imx_uart0(pdata) imx1_add_imx_uart(0, pdata) |
19 | #define imx1_add_imx_uart1(pdata) imx1_add_imx_uart(1, pdata) | ||
diff --git a/arch/arm/mach-imx/devices-imx21.h b/arch/arm/mach-imx/devices-imx21.h index 2b45d3316267..f75b5e4d0ed5 100644 --- a/arch/arm/mach-imx/devices-imx21.h +++ b/arch/arm/mach-imx/devices-imx21.h | |||
@@ -12,14 +12,13 @@ | |||
12 | #define imx21_add_i2c_imx(pdata) \ | 12 | #define imx21_add_i2c_imx(pdata) \ |
13 | imx_add_imx_i2c(0, MX2x_I2C_BASE_ADDR, SZ_4K, MX2x_INT_I2C, pdata) | 13 | imx_add_imx_i2c(0, MX2x_I2C_BASE_ADDR, SZ_4K, MX2x_INT_I2C, pdata) |
14 | 14 | ||
15 | #define imx21_add_imx_uart0(pdata) \ | 15 | extern const struct imx_imx_uart_1irq_data imx21_imx_uart_data[] __initconst; |
16 | imx_add_imx_uart_1irq(0, MX21_UART1_BASE_ADDR, SZ_4K, MX21_INT_UART1, pdata) | 16 | #define imx21_add_imx_uart(id, pdata) \ |
17 | #define imx21_add_imx_uart1(pdata) \ | 17 | imx_add_imx_uart_1irq(&imx21_imx_uart_data[id], pdata) |
18 | imx_add_imx_uart_1irq(1, MX21_UART2_BASE_ADDR, SZ_4K, MX21_INT_UART2, pdata) | 18 | #define imx21_add_imx_uart0(pdata) imx21_add_imx_uart(0, pdata) |
19 | #define imx21_add_imx_uart2(pdata) \ | 19 | #define imx21_add_imx_uart1(pdata) imx21_add_imx_uart(1, pdata) |
20 | imx_add_imx_uart_1irq(2, MX21_UART3_BASE_ADDR, SZ_4K, MX21_INT_UART3, pdata) | 20 | #define imx21_add_imx_uart2(pdata) imx21_add_imx_uart(2, pdata) |
21 | #define imx21_add_imx_uart3(pdata) \ | 21 | #define imx21_add_imx_uart3(pdata) imx21_add_imx_uart(3, pdata) |
22 | imx_add_imx_uart_1irq(3, MX21_UART4_BASE_ADDR, SZ_4K, MX21_INT_UART4, pdata) | ||
23 | 22 | ||
24 | #define imx21_add_mxc_nand(pdata) \ | 23 | #define imx21_add_mxc_nand(pdata) \ |
25 | imx_add_mxc_nand_v1(MX21_NFC_BASE_ADDR, MX21_INT_NANDFC, pdata) | 24 | imx_add_mxc_nand_v1(MX21_NFC_BASE_ADDR, MX21_INT_NANDFC, pdata) |
diff --git a/arch/arm/mach-imx/devices-imx27.h b/arch/arm/mach-imx/devices-imx27.h index 04bfcf0f63d2..bf9dab3a0858 100644 --- a/arch/arm/mach-imx/devices-imx27.h +++ b/arch/arm/mach-imx/devices-imx27.h | |||
@@ -14,18 +14,15 @@ | |||
14 | #define imx27_add_i2c_imx1(pdata) \ | 14 | #define imx27_add_i2c_imx1(pdata) \ |
15 | imx_add_imx_i2c(1, MX27_I2C2_BASE_ADDR, SZ_4K, MX27_INT_I2C2, pdata) | 15 | imx_add_imx_i2c(1, MX27_I2C2_BASE_ADDR, SZ_4K, MX27_INT_I2C2, pdata) |
16 | 16 | ||
17 | #define imx27_add_imx_uart0(pdata) \ | 17 | extern const struct imx_imx_uart_1irq_data imx27_imx_uart_data[] __initconst; |
18 | imx_add_imx_uart_1irq(0, MX27_UART1_BASE_ADDR, SZ_4K, MX27_INT_UART1, pdata) | 18 | #define imx27_add_imx_uart(id, pdata) \ |
19 | #define imx27_add_imx_uart1(pdata) \ | 19 | imx_add_imx_uart_1irq(&imx27_imx_uart_data[id], pdata) |
20 | imx_add_imx_uart_1irq(1, MX27_UART2_BASE_ADDR, SZ_4K, MX27_INT_UART2, pdata) | 20 | #define imx27_add_imx_uart0(pdata) imx27_add_imx_uart(0, pdata) |
21 | #define imx27_add_imx_uart2(pdata) \ | 21 | #define imx27_add_imx_uart1(pdata) imx27_add_imx_uart(1, pdata) |
22 | imx_add_imx_uart_1irq(2, MX27_UART3_BASE_ADDR, SZ_4K, MX27_INT_UART3, pdata) | 22 | #define imx27_add_imx_uart2(pdata) imx27_add_imx_uart(2, pdata) |
23 | #define imx27_add_imx_uart3(pdata) \ | 23 | #define imx27_add_imx_uart3(pdata) imx27_add_imx_uart(3, pdata) |
24 | imx_add_imx_uart_1irq(3, MX27_UART4_BASE_ADDR, SZ_4K, MX27_INT_UART4, pdata) | 24 | #define imx27_add_imx_uart4(pdata) imx27_add_imx_uart(4, pdata) |
25 | #define imx27_add_imx_uart4(pdata) \ | 25 | #define imx27_add_imx_uart5(pdata) imx27_add_imx_uart(5, pdata) |
26 | imx_add_imx_uart_1irq(4, MX27_UART5_BASE_ADDR, SZ_4K, MX27_INT_UART5, pdata) | ||
27 | #define imx27_add_imx_uart5(pdata) \ | ||
28 | imx_add_imx_uart_1irq(5, MX27_UART6_BASE_ADDR, SZ_4K, MX27_INT_UART6, pdata) | ||
29 | 26 | ||
30 | #define imx27_add_mxc_nand(pdata) \ | 27 | #define imx27_add_mxc_nand(pdata) \ |
31 | imx_add_mxc_nand_v1(MX27_NFC_BASE_ADDR, MX27_INT_NANDFC, pdata) | 28 | imx_add_mxc_nand_v1(MX27_NFC_BASE_ADDR, MX27_INT_NANDFC, pdata) |
diff --git a/arch/arm/mach-mx25/devices-imx25.h b/arch/arm/mach-mx25/devices-imx25.h index 34a706105064..439400b5d275 100644 --- a/arch/arm/mach-mx25/devices-imx25.h +++ b/arch/arm/mach-mx25/devices-imx25.h | |||
@@ -21,16 +21,14 @@ | |||
21 | #define imx25_add_imx_i2c2(pdata) \ | 21 | #define imx25_add_imx_i2c2(pdata) \ |
22 | imx_add_imx_i2c(2, MX25_I2C3_BASE_ADDR, SZ_16K, MX25_INT_I2C3, pdata) | 22 | imx_add_imx_i2c(2, MX25_I2C3_BASE_ADDR, SZ_16K, MX25_INT_I2C3, pdata) |
23 | 23 | ||
24 | #define imx25_add_imx_uart0(pdata) \ | 24 | extern const struct imx_imx_uart_1irq_data imx25_imx_uart_data[] __initconst; |
25 | imx_add_imx_uart_1irq(0, MX25_UART1_BASE_ADDR, SZ_16K, MX25_INT_UART1, pdata) | 25 | #define imx25_add_imx_uart(id, pdata) \ |
26 | #define imx25_add_imx_uart1(pdata) \ | 26 | imx_add_imx_uart_1irq(&imx25_imx_uart_data[id], pdata) |
27 | imx_add_imx_uart_1irq(1, MX25_UART2_BASE_ADDR, SZ_16K, MX25_INT_UART2, pdata) | 27 | #define imx25_add_imx_uart0(pdata) imx25_add_imx_uart(0, pdata) |
28 | #define imx25_add_imx_uart2(pdata) \ | 28 | #define imx25_add_imx_uart1(pdata) imx25_add_imx_uart(1, pdata) |
29 | imx_add_imx_uart_1irq(2, MX25_UART3_BASE_ADDR, SZ_16K, MX25_INT_UART3, pdata) | 29 | #define imx25_add_imx_uart2(pdata) imx25_add_imx_uart(2, pdata) |
30 | #define imx25_add_imx_uart3(pdata) \ | 30 | #define imx25_add_imx_uart3(pdata) imx25_add_imx_uart(3, pdata) |
31 | imx_add_imx_uart_1irq(3, MX25_UART4_BASE_ADDR, SZ_16K, MX25_INT_UART4, pdata) | 31 | #define imx25_add_imx_uart4(pdata) imx25_add_imx_uart(4, pdata) |
32 | #define imx25_add_imx_uart4(pdata) \ | ||
33 | imx_add_imx_uart_1irq(4, MX25_UART5_BASE_ADDR, SZ_16K, MX25_INT_UART5, pdata) | ||
34 | 32 | ||
35 | #define imx25_add_mxc_nand(pdata) \ | 33 | #define imx25_add_mxc_nand(pdata) \ |
36 | imx_add_mxc_nand_v21(MX25_NFC_BASE_ADDR, MX25_INT_NANDFC, pdata) | 34 | imx_add_mxc_nand_v21(MX25_NFC_BASE_ADDR, MX25_INT_NANDFC, pdata) |
diff --git a/arch/arm/mach-mx3/devices-imx31.h b/arch/arm/mach-mx3/devices-imx31.h index 7b4d022a59fa..a8c5f1bfce3b 100644 --- a/arch/arm/mach-mx3/devices-imx31.h +++ b/arch/arm/mach-mx3/devices-imx31.h | |||
@@ -16,16 +16,14 @@ | |||
16 | #define imx31_add_imx_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) | 17 | imx_add_imx_i2c(2, MX31_I2C3_BASE_ADDR, SZ_4K, MX31_INT_I2C3, pdata) |
18 | 18 | ||
19 | #define imx31_add_imx_uart0(pdata) \ | 19 | extern const struct imx_imx_uart_1irq_data imx31_imx_uart_data[] __initconst; |
20 | imx_add_imx_uart_1irq(0, MX31_UART1_BASE_ADDR, SZ_16K, MX31_INT_UART1, pdata) | 20 | #define imx31_add_imx_uart(id, pdata) \ |
21 | #define imx31_add_imx_uart1(pdata) \ | 21 | imx_add_imx_uart_1irq(&imx31_imx_uart_data[id], pdata) |
22 | imx_add_imx_uart_1irq(1, MX31_UART2_BASE_ADDR, SZ_16K, MX31_INT_UART2, pdata) | 22 | #define imx31_add_imx_uart0(pdata) imx31_add_imx_uart(0, pdata) |
23 | #define imx31_add_imx_uart2(pdata) \ | 23 | #define imx31_add_imx_uart1(pdata) imx31_add_imx_uart(1, pdata) |
24 | imx_add_imx_uart_1irq(2, MX31_UART3_BASE_ADDR, SZ_16K, MX31_INT_UART3, pdata) | 24 | #define imx31_add_imx_uart2(pdata) imx31_add_imx_uart(2, pdata) |
25 | #define imx31_add_imx_uart3(pdata) \ | 25 | #define imx31_add_imx_uart3(pdata) imx31_add_imx_uart(3, pdata) |
26 | imx_add_imx_uart_1irq(3, MX31_UART4_BASE_ADDR, SZ_16K, MX31_INT_UART4, pdata) | 26 | #define imx31_add_imx_uart4(pdata) imx31_add_imx_uart(4, 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 | 27 | ||
30 | #define imx31_add_mxc_nand(pdata) \ | 28 | #define imx31_add_mxc_nand(pdata) \ |
31 | imx_add_mxc_nand_v1(MX31_NFC_BASE_ADDR, MX31_INT_NANDFC, pdata) | 29 | imx_add_mxc_nand_v1(MX31_NFC_BASE_ADDR, MX31_INT_NANDFC, pdata) |
diff --git a/arch/arm/mach-mx3/devices-imx35.h b/arch/arm/mach-mx3/devices-imx35.h index af0bc1f86237..6a76b4d72e49 100644 --- a/arch/arm/mach-mx3/devices-imx35.h +++ b/arch/arm/mach-mx3/devices-imx35.h | |||
@@ -21,12 +21,12 @@ | |||
21 | #define imx35_add_imx_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) | 22 | imx_add_imx_i2c(2, MX35_I2C3_BASE_ADDR, SZ_4K, MX35_INT_I2C3, pdata) |
23 | 23 | ||
24 | #define imx35_add_imx_uart0(pdata) \ | 24 | extern const struct imx_imx_uart_1irq_data imx35_imx_uart_data[] __initconst; |
25 | imx_add_imx_uart_1irq(0, MX35_UART1_BASE_ADDR, SZ_16K, MX35_INT_UART1, pdata) | 25 | #define imx35_add_imx_uart(id, pdata) \ |
26 | #define imx35_add_imx_uart1(pdata) \ | 26 | imx_add_imx_uart_1irq(&imx35_imx_uart_data[id], pdata) |
27 | imx_add_imx_uart_1irq(1, MX35_UART2_BASE_ADDR, SZ_16K, MX35_INT_UART2, pdata) | 27 | #define imx35_add_imx_uart0(pdata) imx35_add_imx_uart(0, pdata) |
28 | #define imx35_add_imx_uart2(pdata) \ | 28 | #define imx35_add_imx_uart1(pdata) imx35_add_imx_uart(1, pdata) |
29 | imx_add_imx_uart_1irq(2, MX35_UART3_BASE_ADDR, SZ_16K, MX35_INT_UART3, pdata) | 29 | #define imx35_add_imx_uart2(pdata) imx35_add_imx_uart(2, pdata) |
30 | 30 | ||
31 | #define imx35_add_mxc_nand(pdata) \ | 31 | #define imx35_add_mxc_nand(pdata) \ |
32 | imx_add_mxc_nand_v21(MX35_NFC_BASE_ADDR, MX35_INT_NANDFC, pdata) | 32 | imx_add_mxc_nand_v21(MX35_NFC_BASE_ADDR, MX35_INT_NANDFC, pdata) |
diff --git a/arch/arm/plat-mxc/devices/platform-imx-uart.c b/arch/arm/plat-mxc/devices/platform-imx-uart.c index fa3dff1433e8..af7fabba4e71 100644 --- a/arch/arm/plat-mxc/devices/platform-imx-uart.c +++ b/arch/arm/plat-mxc/devices/platform-imx-uart.c | |||
@@ -6,55 +6,138 @@ | |||
6 | * the terms of the GNU General Public License version 2 as published by the | 6 | * the terms of the GNU General Public License version 2 as published by the |
7 | * Free Software Foundation. | 7 | * Free Software Foundation. |
8 | */ | 8 | */ |
9 | #include <mach/hardware.h> | ||
9 | #include <mach/devices-common.h> | 10 | #include <mach/devices-common.h> |
10 | 11 | ||
11 | struct platform_device *__init imx_add_imx_uart_3irq(int id, | 12 | #define imx_imx_uart_3irq_data_entry(soc, _id, _hwid, _size) \ |
12 | resource_size_t iobase, resource_size_t iosize, | 13 | [_id] = { \ |
13 | resource_size_t irqrx, resource_size_t irqtx, | 14 | .id = _id, \ |
14 | resource_size_t irqrts, | 15 | .iobase = soc ## _UART ## _hwid ## _BASE_ADDR, \ |
16 | .iosize = _size, \ | ||
17 | .irqrx = soc ## _INT_UART ## _hwid ## RX, \ | ||
18 | .irqtx = soc ## _INT_UART ## _hwid ## TX, \ | ||
19 | .irqrts = soc ## _INT_UART ## _hwid ## RTS, \ | ||
20 | } | ||
21 | |||
22 | #define imx_imx_uart_1irq_data_entry(soc, _id, _hwid, _size) \ | ||
23 | [_id] = { \ | ||
24 | .id = _id, \ | ||
25 | .iobase = soc ## _UART ## _hwid ## _BASE_ADDR, \ | ||
26 | .iosize = _size, \ | ||
27 | .irq = soc ## _INT_UART ## _hwid, \ | ||
28 | } | ||
29 | |||
30 | #ifdef CONFIG_SOC_IMX1 | ||
31 | const struct imx_imx_uart_3irq_data imx1_imx_uart_data[] __initconst = { | ||
32 | #define imx1_imx_uart_data_entry(_id, _hwid) \ | ||
33 | imx_imx_uart_3irq_data_entry(MX1, _id, _hwid, 0xd0) | ||
34 | imx1_imx_uart_data_entry(0, 1), | ||
35 | imx1_imx_uart_data_entry(1, 2), | ||
36 | }; | ||
37 | #endif /* ifdef CONFIG_SOC_IMX1 */ | ||
38 | |||
39 | #ifdef CONFIG_SOC_IMX21 | ||
40 | const struct imx_imx_uart_1irq_data imx21_imx_uart_data[] __initconst = { | ||
41 | #define imx21_imx_uart_data_entry(_id, _hwid) \ | ||
42 | imx_imx_uart_1irq_data_entry(MX21, _id, _hwid, SZ_4K) | ||
43 | imx21_imx_uart_data_entry(0, 1), | ||
44 | imx21_imx_uart_data_entry(1, 2), | ||
45 | imx21_imx_uart_data_entry(2, 3), | ||
46 | imx21_imx_uart_data_entry(3, 4), | ||
47 | }; | ||
48 | #endif | ||
49 | |||
50 | #ifdef CONFIG_ARCH_MX25 | ||
51 | const struct imx_imx_uart_1irq_data imx25_imx_uart_data[] __initconst = { | ||
52 | #define imx25_imx_uart_data_entry(_id, _hwid) \ | ||
53 | imx_imx_uart_1irq_data_entry(MX25, _id, _hwid, SZ_16K) | ||
54 | imx25_imx_uart_data_entry(0, 1), | ||
55 | imx25_imx_uart_data_entry(1, 2), | ||
56 | imx25_imx_uart_data_entry(2, 3), | ||
57 | imx25_imx_uart_data_entry(3, 4), | ||
58 | imx25_imx_uart_data_entry(4, 5), | ||
59 | }; | ||
60 | #endif /* ifdef CONFIG_ARCH_MX25 */ | ||
61 | |||
62 | #ifdef CONFIG_SOC_IMX27 | ||
63 | const struct imx_imx_uart_1irq_data imx27_imx_uart_data[] __initconst = { | ||
64 | #define imx27_imx_uart_data_entry(_id, _hwid) \ | ||
65 | imx_imx_uart_1irq_data_entry(MX27, _id, _hwid, SZ_4K) | ||
66 | imx27_imx_uart_data_entry(0, 1), | ||
67 | imx27_imx_uart_data_entry(1, 2), | ||
68 | imx27_imx_uart_data_entry(2, 3), | ||
69 | imx27_imx_uart_data_entry(3, 4), | ||
70 | imx27_imx_uart_data_entry(4, 5), | ||
71 | imx27_imx_uart_data_entry(5, 6), | ||
72 | }; | ||
73 | #endif /* ifdef CONFIG_SOC_IMX27 */ | ||
74 | |||
75 | #ifdef CONFIG_ARCH_MX31 | ||
76 | const struct imx_imx_uart_1irq_data imx31_imx_uart_data[] __initconst = { | ||
77 | #define imx31_imx_uart_data_entry(_id, _hwid) \ | ||
78 | imx_imx_uart_1irq_data_entry(MX31, _id, _hwid, SZ_4K) | ||
79 | imx31_imx_uart_data_entry(0, 1), | ||
80 | imx31_imx_uart_data_entry(1, 2), | ||
81 | imx31_imx_uart_data_entry(2, 3), | ||
82 | imx31_imx_uart_data_entry(3, 4), | ||
83 | imx31_imx_uart_data_entry(4, 5), | ||
84 | }; | ||
85 | #endif /* ifdef CONFIG_ARCH_MX31 */ | ||
86 | |||
87 | #ifdef CONFIG_ARCH_MX35 | ||
88 | const struct imx_imx_uart_1irq_data imx35_imx_uart_data[] __initconst = { | ||
89 | #define imx35_imx_uart_data_entry(_id, _hwid) \ | ||
90 | imx_imx_uart_1irq_data_entry(MX31, _id, _hwid, SZ_16K) | ||
91 | imx35_imx_uart_data_entry(0, 1), | ||
92 | imx35_imx_uart_data_entry(1, 2), | ||
93 | imx35_imx_uart_data_entry(2, 3), | ||
94 | }; | ||
95 | #endif /* ifdef CONFIG_ARCH_MX35 */ | ||
96 | |||
97 | struct platform_device *__init imx_add_imx_uart_3irq( | ||
98 | const struct imx_imx_uart_3irq_data *data, | ||
15 | const struct imxuart_platform_data *pdata) | 99 | const struct imxuart_platform_data *pdata) |
16 | { | 100 | { |
17 | struct resource res[] = { | 101 | struct resource res[] = { |
18 | { | 102 | { |
19 | .start = iobase, | 103 | .start = data->iobase, |
20 | .end = iobase + iosize - 1, | 104 | .end = data->iobase + data->iosize - 1, |
21 | .flags = IORESOURCE_MEM, | 105 | .flags = IORESOURCE_MEM, |
22 | }, { | 106 | }, { |
23 | .start = irqrx, | 107 | .start = data->irqrx, |
24 | .end = irqrx, | 108 | .end = data->irqrx, |
25 | .flags = IORESOURCE_IRQ, | 109 | .flags = IORESOURCE_IRQ, |
26 | }, { | 110 | }, { |
27 | .start = irqtx, | 111 | .start = data->irqtx, |
28 | .end = irqtx, | 112 | .end = data->irqtx, |
29 | .flags = IORESOURCE_IRQ, | 113 | .flags = IORESOURCE_IRQ, |
30 | }, { | 114 | }, { |
31 | .start = irqrts, | 115 | .start = data->irqrts, |
32 | .end = irqrx, | 116 | .end = data->irqrx, |
33 | .flags = IORESOURCE_IRQ, | 117 | .flags = IORESOURCE_IRQ, |
34 | }, | 118 | }, |
35 | }; | 119 | }; |
36 | 120 | ||
37 | return imx_add_platform_device("imx-uart", id, res, ARRAY_SIZE(res), | 121 | return imx_add_platform_device("imx-uart", data->id, res, |
38 | pdata, sizeof(*pdata)); | 122 | ARRAY_SIZE(res), pdata, sizeof(*pdata)); |
39 | } | 123 | } |
40 | 124 | ||
41 | struct platform_device *__init imx_add_imx_uart_1irq(int id, | 125 | struct platform_device *__init imx_add_imx_uart_1irq( |
42 | resource_size_t iobase, resource_size_t iosize, | 126 | const struct imx_imx_uart_1irq_data *data, |
43 | resource_size_t irq, | ||
44 | const struct imxuart_platform_data *pdata) | 127 | const struct imxuart_platform_data *pdata) |
45 | { | 128 | { |
46 | struct resource res[] = { | 129 | struct resource res[] = { |
47 | { | 130 | { |
48 | .start = iobase, | 131 | .start = data->iobase, |
49 | .end = iobase + iosize - 1, | 132 | .end = data->iobase + data->iosize - 1, |
50 | .flags = IORESOURCE_MEM, | 133 | .flags = IORESOURCE_MEM, |
51 | }, { | 134 | }, { |
52 | .start = irq, | 135 | .start = data->irq, |
53 | .end = irq, | 136 | .end = data->irq, |
54 | .flags = IORESOURCE_IRQ, | 137 | .flags = IORESOURCE_IRQ, |
55 | }, | 138 | }, |
56 | }; | 139 | }; |
57 | 140 | ||
58 | return imx_add_platform_device("imx-uart", id, res, ARRAY_SIZE(res), | 141 | return imx_add_platform_device("imx-uart", data->id, res, ARRAY_SIZE(res), |
59 | pdata, sizeof(*pdata)); | 142 | pdata, sizeof(*pdata)); |
60 | } | 143 | } |
diff --git a/arch/arm/plat-mxc/include/mach/devices-common.h b/arch/arm/plat-mxc/include/mach/devices-common.h index e654287f0ba8..12bdc7d027c7 100644 --- a/arch/arm/plat-mxc/include/mach/devices-common.h +++ b/arch/arm/plat-mxc/include/mach/devices-common.h | |||
@@ -26,14 +26,26 @@ struct platform_device *__init imx_add_imx_i2c(int id, | |||
26 | const struct imxi2c_platform_data *pdata); | 26 | const struct imxi2c_platform_data *pdata); |
27 | 27 | ||
28 | #include <mach/imx-uart.h> | 28 | #include <mach/imx-uart.h> |
29 | struct platform_device *__init imx_add_imx_uart_3irq(int id, | 29 | struct imx_imx_uart_3irq_data { |
30 | resource_size_t iobase, resource_size_t iosize, | 30 | int id; |
31 | resource_size_t irqrx, resource_size_t irqtx, | 31 | resource_size_t iobase; |
32 | resource_size_t irqrts, | 32 | resource_size_t iosize; |
33 | resource_size_t irqrx; | ||
34 | resource_size_t irqtx; | ||
35 | resource_size_t irqrts; | ||
36 | }; | ||
37 | struct platform_device *__init imx_add_imx_uart_3irq( | ||
38 | const struct imx_imx_uart_3irq_data *data, | ||
33 | const struct imxuart_platform_data *pdata); | 39 | const struct imxuart_platform_data *pdata); |
34 | struct platform_device *__init imx_add_imx_uart_1irq(int id, | 40 | |
35 | resource_size_t iobase, resource_size_t iosize, | 41 | struct imx_imx_uart_1irq_data { |
36 | resource_size_t irq, | 42 | int id; |
43 | resource_size_t iobase; | ||
44 | resource_size_t iosize; | ||
45 | resource_size_t irq; | ||
46 | }; | ||
47 | struct platform_device *__init imx_add_imx_uart_1irq( | ||
48 | const struct imx_imx_uart_1irq_data *data, | ||
37 | const struct imxuart_platform_data *pdata); | 49 | const struct imxuart_platform_data *pdata); |
38 | 50 | ||
39 | #include <mach/mxc_nand.h> | 51 | #include <mach/mxc_nand.h> |