* [PATCH] Add auart devices for mx23 and mx28 evk boards
@ 2011-02-17 6:28 Shawn Guo
2011-02-17 6:28 ` [PATCH 1/4] ARM: mx23: rename mx23 auart irq definition to align with mx28 Shawn Guo
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Shawn Guo @ 2011-02-17 6:28 UTC (permalink / raw)
To: linux-arm-kernel
This patch set is to add auart devices for mx23evk and mx28evk board.
Regards,
Shawn
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/4] ARM: mx23: rename mx23 auart irq definition to align with mx28
2011-02-17 6:28 [PATCH] Add auart devices for mx23 and mx28 evk boards Shawn Guo
@ 2011-02-17 6:28 ` Shawn Guo
2011-02-17 6:28 ` [PATCH 2/4] ARM: mx23: dynamically allocate mx23 auart device Shawn Guo
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Shawn Guo @ 2011-02-17 6:28 UTC (permalink / raw)
To: linux-arm-kernel
i.MX23 Reference Manual names auart irq differently from i.MX28.
This patch is to align the naming with mx28, so that some device
registration codes can be shared.
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
---
arch/arm/mach-mxs/include/mach/mx23.h | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/arch/arm/mach-mxs/include/mach/mx23.h b/arch/arm/mach-mxs/include/mach/mx23.h
index 9edd02e..4768402 100644
--- a/arch/arm/mach-mxs/include/mach/mx23.h
+++ b/arch/arm/mach-mxs/include/mach/mx23.h
@@ -101,9 +101,9 @@
#define MX23_INT_SSP2_DMA 20
#define MX23_INT_ECC8_IRQ 21
#define MX23_INT_RTC_ALARM 22
-#define MX23_INT_UARTAPP_TX_DMA 23
-#define MX23_INT_UARTAPP_INTERNAL 24
-#define MX23_INT_UARTAPP_RX_DMA 25
+#define MX23_INT_AUART1_TX_DMA 23
+#define MX23_INT_AUART1 24
+#define MX23_INT_AUART1_RX_DMA 25
#define MX23_INT_I2C_DMA 26
#define MX23_INT_I2C_ERROR 27
#define MX23_INT_TIMER0 28
@@ -135,9 +135,9 @@
#define MX23_INT_DCP 54
#define MX23_INT_BCH 56
#define MX23_INT_PXP 57
-#define MX23_INT_UARTAPP2_TX_DMA 58
-#define MX23_INT_UARTAPP2_INTERNAL 59
-#define MX23_INT_UARTAPP2_RX_DMA 60
+#define MX23_INT_AUART2_TX_DMA 58
+#define MX23_INT_AUART2 59
+#define MX23_INT_AUART2_RX_DMA 60
#define MX23_INT_VDAC_DETECT 61
#define MX23_INT_VDD5V_DROOP 64
#define MX23_INT_DCDC4P2_BO 65
--
1.7.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/4] ARM: mx23: dynamically allocate mx23 auart device
2011-02-17 6:28 [PATCH] Add auart devices for mx23 and mx28 evk boards Shawn Guo
2011-02-17 6:28 ` [PATCH 1/4] ARM: mx23: rename mx23 auart irq definition to align with mx28 Shawn Guo
@ 2011-02-17 6:28 ` Shawn Guo
2011-02-17 6:28 ` [PATCH 3/4] ARM: mxs/mx23evk: add " Shawn Guo
2011-02-17 6:28 ` [PATCH 4/4] ARM: mxs/mx28evk: add auart devices Shawn Guo
3 siblings, 0 replies; 5+ messages in thread
From: Shawn Guo @ 2011-02-17 6:28 UTC (permalink / raw)
To: linux-arm-kernel
i.MX23 Reference Manaul starts auart index from 1 than 0. Changing
the index to start from 0 requires corresponding changes on base
address, irq, and iomux definitions, and will probably confuse people
who reads codes and hardware documents together.
This patch introduced the field 'hwid' to distinguish the driver id
and controller id. These two ids are different on mx23 while
identical on mx28.
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
---
arch/arm/mach-mxs/clock-mx23.c | 1 +
arch/arm/mach-mxs/devices-mx23.h | 5 +++++
arch/arm/mach-mxs/devices/platform-auart.c | 22 ++++++++++++++++------
3 files changed, 22 insertions(+), 6 deletions(-)
diff --git a/arch/arm/mach-mxs/clock-mx23.c b/arch/arm/mach-mxs/clock-mx23.c
index ca72a05..7c5dace 100644
--- a/arch/arm/mach-mxs/clock-mx23.c
+++ b/arch/arm/mach-mxs/clock-mx23.c
@@ -442,6 +442,7 @@ static struct clk_lookup lookups[] = {
_REGISTER_CLOCK("duart", "apb_pclk", xbus_clk)
/* for amba-pl011 driver */
_REGISTER_CLOCK("duart", NULL, uart_clk)
+ _REGISTER_CLOCK("mxs-auart.0", NULL, uart_clk)
_REGISTER_CLOCK("rtc", NULL, rtc_clk)
_REGISTER_CLOCK(NULL, "hclk", hbus_clk)
_REGISTER_CLOCK(NULL, "usb", usb_clk)
diff --git a/arch/arm/mach-mxs/devices-mx23.h b/arch/arm/mach-mxs/devices-mx23.h
index 1256788..c4d4773 100644
--- a/arch/arm/mach-mxs/devices-mx23.h
+++ b/arch/arm/mach-mxs/devices-mx23.h
@@ -14,3 +14,8 @@
extern const struct amba_device mx23_duart_device __initconst;
#define mx23_add_duart() \
mxs_add_duart(&mx23_duart_device)
+
+extern const struct mxs_auart_data mx23_auart_data[] __initconst;
+#define mx23_add_auart(id) mxs_add_auart(&mx23_auart_data[id])
+#define mx23_add_auart0() mx23_add_auart(0)
+#define mx23_add_auart1() mx23_add_auart(1)
diff --git a/arch/arm/mach-mxs/devices/platform-auart.c b/arch/arm/mach-mxs/devices/platform-auart.c
index f0dbf8a..796606c 100644
--- a/arch/arm/mach-mxs/devices/platform-auart.c
+++ b/arch/arm/mach-mxs/devices/platform-auart.c
@@ -7,23 +7,33 @@
* Free Software Foundation.
*/
#include <asm/sizes.h>
+#include <mach/mx23.h>
#include <mach/mx28.h>
#include <mach/devices-common.h>
-#define mxs_auart_data_entry_single(soc, _id) \
+#define mxs_auart_data_entry_single(soc, _id, hwid) \
{ \
.id = _id, \
- .iobase = soc ## _AUART ## _id ## _BASE_ADDR, \
- .irq = soc ## _INT_AUART ## _id, \
+ .iobase = soc ## _AUART ## hwid ## _BASE_ADDR, \
+ .irq = soc ## _INT_AUART ## hwid, \
}
-#define mxs_auart_data_entry(soc, _id) \
- [_id] = mxs_auart_data_entry_single(soc, _id)
+#define mxs_auart_data_entry(soc, _id, hwid) \
+ [_id] = mxs_auart_data_entry_single(soc, _id, hwid)
+
+#ifdef CONFIG_SOC_IMX23
+const struct mxs_auart_data mx23_auart_data[] __initconst = {
+#define mx23_auart_data_entry(_id, hwid) \
+ mxs_auart_data_entry(MX23, _id, hwid)
+ mx23_auart_data_entry(0, 1),
+ mx23_auart_data_entry(1, 2),
+};
+#endif
#ifdef CONFIG_SOC_IMX28
const struct mxs_auart_data mx28_auart_data[] __initconst = {
#define mx28_auart_data_entry(_id) \
- mxs_auart_data_entry(MX28, _id)
+ mxs_auart_data_entry(MX28, _id, _id)
mx28_auart_data_entry(0),
mx28_auart_data_entry(1),
mx28_auart_data_entry(2),
--
1.7.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/4] ARM: mxs/mx23evk: add auart device
2011-02-17 6:28 [PATCH] Add auart devices for mx23 and mx28 evk boards Shawn Guo
2011-02-17 6:28 ` [PATCH 1/4] ARM: mx23: rename mx23 auart irq definition to align with mx28 Shawn Guo
2011-02-17 6:28 ` [PATCH 2/4] ARM: mx23: dynamically allocate mx23 auart device Shawn Guo
@ 2011-02-17 6:28 ` Shawn Guo
2011-02-17 6:28 ` [PATCH 4/4] ARM: mxs/mx28evk: add auart devices Shawn Guo
3 siblings, 0 replies; 5+ messages in thread
From: Shawn Guo @ 2011-02-17 6:28 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
---
arch/arm/mach-mxs/Kconfig | 1 +
arch/arm/mach-mxs/mach-mx23evk.c | 11 +++++++++++
2 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-mxs/Kconfig b/arch/arm/mach-mxs/Kconfig
index cd2fbdf..3c5ce09 100644
--- a/arch/arm/mach-mxs/Kconfig
+++ b/arch/arm/mach-mxs/Kconfig
@@ -19,6 +19,7 @@ config MACH_MX23EVK
bool "Support MX23EVK Platform"
select SOC_IMX23
select MXS_HAVE_AMBA_DUART
+ select MXS_HAVE_PLATFORM_AUART
default y
help
Include support for MX23EVK platform. This includes specific
diff --git a/arch/arm/mach-mxs/mach-mx23evk.c b/arch/arm/mach-mxs/mach-mx23evk.c
index aa06400..0737ce2 100644
--- a/arch/arm/mach-mxs/mach-mx23evk.c
+++ b/arch/arm/mach-mxs/mach-mx23evk.c
@@ -30,6 +30,16 @@ static const iomux_cfg_t mx23evk_pads[] __initconst = {
/* duart */
MX23_PAD_PWM0__DUART_RX | MXS_PAD_4MA,
MX23_PAD_PWM1__DUART_TX | MXS_PAD_4MA,
+
+ /* auart */
+ MX23_PAD_AUART1_RX__AUART1_RX |
+ (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
+ MX23_PAD_AUART1_TX__AUART1_TX |
+ (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
+ MX23_PAD_AUART1_CTS__AUART1_CTS |
+ (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
+ MX23_PAD_AUART1_RTS__AUART1_RTS |
+ (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
};
static void __init mx23evk_init(void)
@@ -37,6 +47,7 @@ static void __init mx23evk_init(void)
mxs_iomux_setup_multiple_pads(mx23evk_pads, ARRAY_SIZE(mx23evk_pads));
mx23_add_duart();
+ mx23_add_auart0();
}
static void __init mx23evk_timer_init(void)
--
1.7.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 4/4] ARM: mxs/mx28evk: add auart devices
2011-02-17 6:28 [PATCH] Add auart devices for mx23 and mx28 evk boards Shawn Guo
` (2 preceding siblings ...)
2011-02-17 6:28 ` [PATCH 3/4] ARM: mxs/mx23evk: add " Shawn Guo
@ 2011-02-17 6:28 ` Shawn Guo
3 siblings, 0 replies; 5+ messages in thread
From: Shawn Guo @ 2011-02-17 6:28 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
---
arch/arm/mach-mxs/Kconfig | 1 +
arch/arm/mach-mxs/mach-mx28evk.c | 21 +++++++++++++++++++++
2 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-mxs/Kconfig b/arch/arm/mach-mxs/Kconfig
index 3c5ce09..55bf075 100644
--- a/arch/arm/mach-mxs/Kconfig
+++ b/arch/arm/mach-mxs/Kconfig
@@ -29,6 +29,7 @@ config MACH_MX28EVK
bool "Support MX28EVK Platform"
select SOC_IMX28
select MXS_HAVE_AMBA_DUART
+ select MXS_HAVE_PLATFORM_AUART
select MXS_HAVE_PLATFORM_FEC
select MXS_OCOTP
default y
diff --git a/arch/arm/mach-mxs/mach-mx28evk.c b/arch/arm/mach-mxs/mach-mx28evk.c
index e8db99f..1f0b708 100644
--- a/arch/arm/mach-mxs/mach-mx28evk.c
+++ b/arch/arm/mach-mxs/mach-mx28evk.c
@@ -38,6 +38,25 @@ static const iomux_cfg_t mx28evk_pads[] __initconst = {
MX28_PAD_PWM1__DUART_TX |
(MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
+ /* auart0 */
+ MX28_PAD_AUART0_RX__AUART0_RX |
+ (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
+ MX28_PAD_AUART0_TX__AUART0_TX |
+ (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
+ MX28_PAD_AUART0_CTS__AUART0_CTS |
+ (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
+ MX28_PAD_AUART0_RTS__AUART0_RTS |
+ (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
+ /* auart3 */
+ MX28_PAD_AUART3_RX__AUART3_RX |
+ (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
+ MX28_PAD_AUART3_TX__AUART3_TX |
+ (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
+ MX28_PAD_AUART3_CTS__AUART3_CTS |
+ (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
+ MX28_PAD_AUART3_RTS__AUART3_RTS |
+ (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
+
/* fec0 */
MX28_PAD_ENET0_MDC__ENET0_MDC |
(MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
@@ -164,6 +183,8 @@ static void __init mx28evk_init(void)
mxs_iomux_setup_multiple_pads(mx28evk_pads, ARRAY_SIZE(mx28evk_pads));
mx28_add_duart();
+ mx28_add_auart0();
+ mx28_add_auart3();
if (mx28evk_fec_get_mac())
pr_warn("%s: failed on fec mac setup\n", __func__);
--
1.7.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-02-17 6:28 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-17 6:28 [PATCH] Add auart devices for mx23 and mx28 evk boards Shawn Guo
2011-02-17 6:28 ` [PATCH 1/4] ARM: mx23: rename mx23 auart irq definition to align with mx28 Shawn Guo
2011-02-17 6:28 ` [PATCH 2/4] ARM: mx23: dynamically allocate mx23 auart device Shawn Guo
2011-02-17 6:28 ` [PATCH 3/4] ARM: mxs/mx23evk: add " Shawn Guo
2011-02-17 6:28 ` [PATCH 4/4] ARM: mxs/mx28evk: add auart devices Shawn Guo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).