diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2011-01-11 09:56:40 -0500 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2011-01-25 02:39:58 -0500 |
commit | cf3567aaad0304410e465a55313c8f0d25ef306d (patch) | |
tree | 03a13b3b00adb99515dca16bae67170308e79156 /arch/arm/mach-mxs | |
parent | 47d37d6f94ccf32d302492f969209930b2411f9e (diff) |
ARM MXS: Add auart platform support for i.MX28
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mxs')
-rw-r--r-- | arch/arm/mach-mxs/clock-mx28.c | 5 | ||||
-rw-r--r-- | arch/arm/mach-mxs/devices-mx28.h | 8 | ||||
-rw-r--r-- | arch/arm/mach-mxs/devices/Kconfig | 3 | ||||
-rw-r--r-- | arch/arm/mach-mxs/devices/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-mxs/devices/platform-auart.c | 54 | ||||
-rw-r--r-- | arch/arm/mach-mxs/include/mach/devices-common.h | 10 |
6 files changed, 81 insertions, 0 deletions
diff --git a/arch/arm/mach-mxs/clock-mx28.c b/arch/arm/mach-mxs/clock-mx28.c index 56312c092a9e..2f1a9904a4e1 100644 --- a/arch/arm/mach-mxs/clock-mx28.c +++ b/arch/arm/mach-mxs/clock-mx28.c | |||
@@ -609,6 +609,11 @@ static struct clk_lookup lookups[] = { | |||
609 | _REGISTER_CLOCK("duart", NULL, uart_clk) | 609 | _REGISTER_CLOCK("duart", NULL, uart_clk) |
610 | _REGISTER_CLOCK("imx28-fec.0", NULL, fec_clk) | 610 | _REGISTER_CLOCK("imx28-fec.0", NULL, fec_clk) |
611 | _REGISTER_CLOCK("imx28-fec.1", NULL, fec_clk) | 611 | _REGISTER_CLOCK("imx28-fec.1", NULL, fec_clk) |
612 | _REGISTER_CLOCK("mxs-auart.0", NULL, uart_clk) | ||
613 | _REGISTER_CLOCK("mxs-auart.1", NULL, uart_clk) | ||
614 | _REGISTER_CLOCK("mxs-auart.2", NULL, uart_clk) | ||
615 | _REGISTER_CLOCK("mxs-auart.3", NULL, uart_clk) | ||
616 | _REGISTER_CLOCK("mxs-auart.4", NULL, uart_clk) | ||
612 | _REGISTER_CLOCK("fec.0", NULL, fec_clk) | 617 | _REGISTER_CLOCK("fec.0", NULL, fec_clk) |
613 | _REGISTER_CLOCK("rtc", NULL, rtc_clk) | 618 | _REGISTER_CLOCK("rtc", NULL, rtc_clk) |
614 | _REGISTER_CLOCK("pll2", NULL, pll2_clk) | 619 | _REGISTER_CLOCK("pll2", NULL, pll2_clk) |
diff --git a/arch/arm/mach-mxs/devices-mx28.h b/arch/arm/mach-mxs/devices-mx28.h index 33773a6333a2..1ab7bf0aa458 100644 --- a/arch/arm/mach-mxs/devices-mx28.h +++ b/arch/arm/mach-mxs/devices-mx28.h | |||
@@ -15,6 +15,14 @@ extern const struct amba_device mx28_duart_device __initconst; | |||
15 | #define mx28_add_duart() \ | 15 | #define mx28_add_duart() \ |
16 | mxs_add_duart(&mx28_duart_device) | 16 | mxs_add_duart(&mx28_duart_device) |
17 | 17 | ||
18 | extern const struct mxs_auart_data mx28_auart_data[] __initconst; | ||
19 | #define mx28_add_auart(id) mxs_add_auart(&mx28_auart_data[id]) | ||
20 | #define mx28_add_auart0() mx28_add_auart(0) | ||
21 | #define mx28_add_auart1() mx28_add_auart(1) | ||
22 | #define mx28_add_auart2() mx28_add_auart(2) | ||
23 | #define mx28_add_auart3() mx28_add_auart(3) | ||
24 | #define mx28_add_auart4() mx28_add_auart(4) | ||
25 | |||
18 | extern const struct mxs_fec_data mx28_fec_data[] __initconst; | 26 | extern const struct mxs_fec_data mx28_fec_data[] __initconst; |
19 | #define mx28_add_fec(id, pdata) \ | 27 | #define mx28_add_fec(id, pdata) \ |
20 | mxs_add_fec(&mx28_fec_data[id], pdata) | 28 | mxs_add_fec(&mx28_fec_data[id], pdata) |
diff --git a/arch/arm/mach-mxs/devices/Kconfig b/arch/arm/mach-mxs/devices/Kconfig index cf7dc1ae575b..3001b754948a 100644 --- a/arch/arm/mach-mxs/devices/Kconfig +++ b/arch/arm/mach-mxs/devices/Kconfig | |||
@@ -2,5 +2,8 @@ config MXS_HAVE_AMBA_DUART | |||
2 | bool | 2 | bool |
3 | select ARM_AMBA | 3 | select ARM_AMBA |
4 | 4 | ||
5 | config MXS_HAVE_PLATFORM_AUART | ||
6 | bool | ||
7 | |||
5 | config MXS_HAVE_PLATFORM_FEC | 8 | config MXS_HAVE_PLATFORM_FEC |
6 | bool | 9 | bool |
diff --git a/arch/arm/mach-mxs/devices/Makefile b/arch/arm/mach-mxs/devices/Makefile index d0a09f6934b8..c814d054bad7 100644 --- a/arch/arm/mach-mxs/devices/Makefile +++ b/arch/arm/mach-mxs/devices/Makefile | |||
@@ -1,2 +1,3 @@ | |||
1 | obj-$(CONFIG_MXS_HAVE_AMBA_DUART) += amba-duart.o | 1 | obj-$(CONFIG_MXS_HAVE_AMBA_DUART) += amba-duart.o |
2 | obj-$(CONFIG_MXS_HAVE_PLATFORM_AUART) += platform-auart.o | ||
2 | obj-$(CONFIG_MXS_HAVE_PLATFORM_FEC) += platform-fec.o | 3 | obj-$(CONFIG_MXS_HAVE_PLATFORM_FEC) += platform-fec.o |
diff --git a/arch/arm/mach-mxs/devices/platform-auart.c b/arch/arm/mach-mxs/devices/platform-auart.c new file mode 100644 index 000000000000..f0dbf8a21456 --- /dev/null +++ b/arch/arm/mach-mxs/devices/platform-auart.c | |||
@@ -0,0 +1,54 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Pengutronix | ||
3 | * Sascha Hauer <s.hauer@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 <asm/sizes.h> | ||
10 | #include <mach/mx28.h> | ||
11 | #include <mach/devices-common.h> | ||
12 | |||
13 | #define mxs_auart_data_entry_single(soc, _id) \ | ||
14 | { \ | ||
15 | .id = _id, \ | ||
16 | .iobase = soc ## _AUART ## _id ## _BASE_ADDR, \ | ||
17 | .irq = soc ## _INT_AUART ## _id, \ | ||
18 | } | ||
19 | |||
20 | #define mxs_auart_data_entry(soc, _id) \ | ||
21 | [_id] = mxs_auart_data_entry_single(soc, _id) | ||
22 | |||
23 | #ifdef CONFIG_SOC_IMX28 | ||
24 | const struct mxs_auart_data mx28_auart_data[] __initconst = { | ||
25 | #define mx28_auart_data_entry(_id) \ | ||
26 | mxs_auart_data_entry(MX28, _id) | ||
27 | mx28_auart_data_entry(0), | ||
28 | mx28_auart_data_entry(1), | ||
29 | mx28_auart_data_entry(2), | ||
30 | mx28_auart_data_entry(3), | ||
31 | mx28_auart_data_entry(4), | ||
32 | }; | ||
33 | #endif | ||
34 | |||
35 | struct platform_device *__init mxs_add_auart( | ||
36 | const struct mxs_auart_data *data) | ||
37 | { | ||
38 | struct resource res[] = { | ||
39 | { | ||
40 | .start = data->iobase, | ||
41 | .end = data->iobase + SZ_8K - 1, | ||
42 | .flags = IORESOURCE_MEM, | ||
43 | }, { | ||
44 | .start = data->irq, | ||
45 | .end = data->irq, | ||
46 | .flags = IORESOURCE_IRQ, | ||
47 | }, | ||
48 | }; | ||
49 | |||
50 | return mxs_add_platform_device_dmamask("mxs-auart", data->id, | ||
51 | res, ARRAY_SIZE(res), NULL, 0, | ||
52 | DMA_BIT_MASK(32)); | ||
53 | } | ||
54 | |||
diff --git a/arch/arm/mach-mxs/include/mach/devices-common.h b/arch/arm/mach-mxs/include/mach/devices-common.h index 6c3d1a103433..bed40021e2c2 100644 --- a/arch/arm/mach-mxs/include/mach/devices-common.h +++ b/arch/arm/mach-mxs/include/mach/devices-common.h | |||
@@ -30,6 +30,16 @@ int __init mxs_add_amba_device(const struct amba_device *dev); | |||
30 | /* duart */ | 30 | /* duart */ |
31 | int __init mxs_add_duart(const struct amba_device *dev); | 31 | int __init mxs_add_duart(const struct amba_device *dev); |
32 | 32 | ||
33 | /* auart */ | ||
34 | struct mxs_auart_data { | ||
35 | int id; | ||
36 | resource_size_t iobase; | ||
37 | resource_size_t iosize; | ||
38 | resource_size_t irq; | ||
39 | }; | ||
40 | struct platform_device *__init mxs_add_auart( | ||
41 | const struct mxs_auart_data *data); | ||
42 | |||
33 | /* fec */ | 43 | /* fec */ |
34 | #include <linux/fec.h> | 44 | #include <linux/fec.h> |
35 | struct mxs_fec_data { | 45 | struct mxs_fec_data { |