Skip to contentSkip to conversation

ARM: mxs: Add initial support for MX23 and MX28

PATCH Superseded Shawn Guo 4 participants 23 messages Dec 20, 2010 – Jan 10, 2011

Subsystems (3)
lore
Share & tools
lore

Shawn Guo

author
#0 lore raw

v8 cover ARM: mxs: Add initial support for MX23 and MX28

Changes for v8:
- Reuse debug-pl01x.S as mxs DUART is just an amba-pl011
- Remove extra space in iomux.c
- Remove uncessary line breaker in mach-mx23evk.c

[PATCH v8 05/15] ARM: mxs: Add low-level debug UART support [PATCH v8 08/15] ARM: mxs: Add iomux support [PATCH v8 13/15] ARM: mxs: Add initial mx23evk support

Thanks for the review comments.

Regards,
Shawn

author
#1 lore raw

PATCH v8 5/15 ARM: mxs: Add low-level debug UART support

- DEBUG_LL support, which is incompatible with multi-soc MXS image because of different DUART base address on MX23 and MX28
- uncompress message support

---
Changes for v8:
- Reuse debug-pl01x.S as mxs DUART is just an amba-pl011

Changes for v7:
- Add namespace for uart_base and UART()

Changes for v3:
- debug-macro.S: change inclusion of hardware.h to mx23.h plus mx28.h
- Remove #define __MXS_BOOT_UNCOMPRESS
- Add namespace MXS_DUART_ for macros
- Add comment "If it's not, the output is simply discarded."

Changes for v2:
- Remove incorrect comments

 arch/arm/mach-mxs/include/mach/debug-macro.S |   38 +++++++++++++
 arch/arm/mach-mxs/include/mach/uncompress.h  |   76 ++++++++++++++++++++++++++
 2 files changed, 114 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-mxs/include/mach/debug-macro.S
 create mode 100644 arch/arm/mach-mxs/include/mach/uncompress.h
arch/arm/mach-mxs/include/mach/debug-macro.S new file +38 -0
new file mode 100644
index 0000000..79650a1
@@ -0,0 +1,38 @@
+/* arch/arm/mach-mxs/include/mach/debug-macro.S
+ *
+ * Debugging macro include header
+ *
+ *  Copyright (C) 1994-1999 Russell King
+ *  Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#include <mach/mx23.h>
+#include <mach/mx28.h>
+
+#ifdef CONFIG_SOC_IMX23
+#ifdef UART_PADDR
+#error "CONFIG_DEBUG_LL is incompatible with multiple archs"
+#endif
+#define UART_PADDR	MX23_DUART_BASE_ADDR
+#endif
+
+#ifdef CONFIG_SOC_IMX28
+#ifdef UART_PADDR
+#error "CONFIG_DEBUG_LL is incompatible with multiple archs"
+#endif
+#define UART_PADDR	MX28_DUART_BASE_ADDR
+#endif
+
+#define UART_VADDR	MXS_IO_ADDRESS(UART_PADDR)
+
+		.macro	addruart, rp, rv
+		ldr	\rp, =UART_PADDR	@ physical
+		ldr	\rv, =UART_VADDR	@ virtual
+		.endm
+
+#include <asm/hardware/debug-pl01x.S>
arch/arm/mach-mxs/include/mach/uncompress.h new file +76 -0

76 lines not on this page · raw message

Signature · 1 line
1.7.1
author
#2 lore raw

PATCH v8 8/15 ARM: mxs: Add iomux support

In reply to Shawn Guo

MXS-based SoCs implements iomux functions in block PINCTRL.

---
Changes for v8
- Remove extra space

Changes for v7
- Define naked pad and introduce validity bits for mA/vol/pull to ease the pad modification
- List all pad definitions at once generated from Freescale pinmux Excel sheet

Changes for v6:
- Use __mxs_setl() and __mxs_clrl() for bit set/clear

Changes for v5:
- Change iomux_cfg_t from u64 to u16
- Add namespace MXS_ to shift, mask, and pad definitions
- Use SET/CLR register for 1 bit setting
- Get "if" and "{" at the same line
- Remove space in middle of tabs
- Change "setups" to "configures" in comments

Changes for v3:
- Change iomux_cfg_t to u64 to facilitate adding platform specific pad_ctrl settings to an existing pad definition
- Change inclusion of hardware.h to mxs.h
- Get iomux_base a hard-assignment in mxs_iomux_setup_pad(), since mx23 and mx28 share the common pinctrl base adress and it's only used in mxs_iomux_setup_pad().
- Remove EXPORT_SYMBOL and the static of mxs_iomux_setup_pad()

Changes for v2:
- Define iomux_cfg_t as u64
- Turn mxs_iomux_setup_pad() into a static function
- Fix a bug in mxs_iomux_setup_pad(), muxsel starts at offset 0x100 than 0 of pinctrl block.

 arch/arm/mach-mxs/include/mach/iomux-mx23.h |  355 ++++++++++++++++++
 arch/arm/mach-mxs/include/mach/iomux-mx28.h |  537 +++++++++++++++++++++++++++
 arch/arm/mach-mxs/include/mach/iomux.h      |  165 ++++++++
 arch/arm/mach-mxs/iomux.c                   |  101 +++++
 4 files changed, 1158 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-mxs/include/mach/iomux-mx23.h
 create mode 100644 arch/arm/mach-mxs/include/mach/iomux-mx28.h
 create mode 100644 arch/arm/mach-mxs/include/mach/iomux.h
 create mode 100644 arch/arm/mach-mxs/iomux.c
arch/arm/mach-mxs/include/mach/iomux-mx23.h new file +355 -0
new file mode 100644
index 0000000..94e5dd8
@@ -0,0 +1,355 @@
+/*
+ * Copyright (C) 2009-2010 Amit Kucheria <[email protected]>
+ * Copyright (C) 2010 Freescale Semiconductor, Inc.
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+#ifndef __MACH_IOMUX_MX23_H__
+#define __MACH_IOMUX_MX23_H__
+
+#include <mach/iomux.h>
+
+/*
+ * The naming convention for the pad modes is MX23_PAD_<padname>__<padmode>
+ * If <padname> or <padmode> refers to a GPIO, it is named GPIO_<unit>_<num>
+ * See also iomux.h
+ *
+ *									BANK	PIN	MUX
+ */
+/* MUXSEL_0 */
+#define MX23_PAD_GPMI_D00__GPMI_D00		MXS_IOMUX_PAD_NAKED(0,  0, PAD_MUXSEL_0)
+#define MX23_PAD_GPMI_D01__GPMI_D01		MXS_IOMUX_PAD_NAKED(0,  1, PAD_MUXSEL_0)
+#define MX23_PAD_GPMI_D02__GPMI_D02		MXS_IOMUX_PAD_NAKED(0,  2, PAD_MUXSEL_0)
+#define MX23_PAD_GPMI_D03__GPMI_D03		MXS_IOMUX_PAD_NAKED(0,  3, PAD_MUXSEL_0)
+#define MX23_PAD_GPMI_D04__GPMI_D04		MXS_IOMUX_PAD_NAKED(0,  4, PAD_MUXSEL_0)
+#define MX23_PAD_GPMI_D05__GPMI_D05		MXS_IOMUX_PAD_NAKED(0,  5, PAD_MUXSEL_0)
+#define MX23_PAD_GPMI_D06__GPMI_D06		MXS_IOMUX_PAD_NAKED(0,  6, PAD_MUXSEL_0)
+#define MX23_PAD_GPMI_D07__GPMI_D07		MXS_IOMUX_PAD_NAKED(0,  7, PAD_MUXSEL_0)
+#define MX23_PAD_GPMI_D08__GPMI_D08		MXS_IOMUX_PAD_NAKED(0,  8, PAD_MUXSEL_0)
+#define MX23_PAD_GPMI_D09__GPMI_D09		MXS_IOMUX_PAD_NAKED(0,  9, PAD_MUXSEL_0)
+#define MX23_PAD_GPMI_D10__GPMI_D10		MXS_IOMUX_PAD_NAKED(0, 10, PAD_MUXSEL_0)
+#define MX23_PAD_GPMI_D11__GPMI_D11		MXS_IOMUX_PAD_NAKED(0, 11, PAD_MUXSEL_0)
+#define MX23_PAD_GPMI_D12__GPMI_D12		MXS_IOMUX_PAD_NAKED(0, 12, PAD_MUXSEL_0)
+#define MX23_PAD_GPMI_D13__GPMI_D13		MXS_IOMUX_PAD_NAKED(0, 13, PAD_MUXSEL_0)
+#define MX23_PAD_GPMI_D14__GPMI_D14		MXS_IOMUX_PAD_NAKED(0, 14, PAD_MUXSEL_0)
+#define MX23_PAD_GPMI_D15__GPMI_D15		MXS_IOMUX_PAD_NAKED(0, 15, PAD_MUXSEL_0)
+#define MX23_PAD_GPMI_CLE__GPMI_CLE		MXS_IOMUX_PAD_NAKED(0, 16, PAD_MUXSEL_0)
+#define MX23_PAD_GPMI_ALE__GPMI_ALE		MXS_IOMUX_PAD_NAKED(0, 17, PAD_MUXSEL_0)
+#define MX23_PAD_GPMI_CE2N__GPMI_CE2N		MXS_IOMUX_PAD_NAKED(0, 18, PAD_MUXSEL_0)
+#define MX23_PAD_GPMI_RDY0__GPMI_RDY0		MXS_IOMUX_PAD_NAKED(0, 19, PAD_MUXSEL_0)
+#define MX23_PAD_GPMI_RDY1__GPMI_RDY1		MXS_IOMUX_PAD_NAKED(0, 20, PAD_MUXSEL_0)
+#define MX23_PAD_GPMI_RDY2__GPMI_RDY2		MXS_IOMUX_PAD_NAKED(0, 21, PAD_MUXSEL_0)
+#define MX23_PAD_GPMI_RDY3__GPMI_RDY3		MXS_IOMUX_PAD_NAKED(0, 22, PAD_MUXSEL_0)
+#define MX23_PAD_GPMI_WPN__GPMI_WPN		MXS_IOMUX_PAD_NAKED(0, 23, PAD_MUXSEL_0)
+#define MX23_PAD_GPMI_WRN__GPMI_WRN		MXS_IOMUX_PAD_NAKED(0, 24, PAD_MUXSEL_0)
+#define MX23_PAD_GPMI_RDN__GPMI_RDN		MXS_IOMUX_PAD_NAKED(0, 25, PAD_MUXSEL_0)
+#define MX23_PAD_AUART1_CTS__AUART1_CTS		MXS_IOMUX_PAD_NAKED(0, 26, PAD_MUXSEL_0)
+#define MX23_PAD_AUART1_RTS__AUART1_RTS		MXS_IOMUX_PAD_NAKED(0, 27, PAD_MUXSEL_0)
+#define MX23_PAD_AUART1_RX__AUART1_RX		MXS_IOMUX_PAD_NAKED(0, 28, PAD_MUXSEL_0)
+#define MX23_PAD_AUART1_TX__AUART1_TX		MXS_IOMUX_PAD_NAKED(0, 29, PAD_MUXSEL_0)
+#define MX23_PAD_I2C_SCL__I2C_SCL		MXS_IOMUX_PAD_NAKED(0, 30, PAD_MUXSEL_0)
+#define MX23_PAD_I2C_SDA__I2C_SDA		MXS_IOMUX_PAD_NAKED(0, 31, PAD_MUXSEL_0)
+
+#define MX23_PAD_LCD_D00__LCD_D00		MXS_IOMUX_PAD_NAKED(1,  0, PAD_MUXSEL_0)
+#define MX23_PAD_LCD_D01__LCD_D01		MXS_IOMUX_PAD_NAKED(1,  1, PAD_MUXSEL_0)
+#define MX23_PAD_LCD_D02__LCD_D02		MXS_IOMUX_PAD_NAKED(1,  2, PAD_MUXSEL_0)
+#define MX23_PAD_LCD_D03__LCD_D03		MXS_IOMUX_PAD_NAKED(1,  3, PAD_MUXSEL_0)
+#define MX23_PAD_LCD_D04__LCD_D04		MXS_IOMUX_PAD_NAKED(1,  4, PAD_MUXSEL_0)
+#define MX23_PAD_LCD_D05__LCD_D05		MXS_IOMUX_PAD_NAKED(1,  5, PAD_MUXSEL_0)
+#define MX23_PAD_LCD_D06__LCD_D06		MXS_IOMUX_PAD_NAKED(1,  6, PAD_MUXSEL_0)
+#define MX23_PAD_LCD_D07__LCD_D07		MXS_IOMUX_PAD_NAKED(1,  7, PAD_MUXSEL_0)
+#define MX23_PAD_LCD_D08__LCD_D08		MXS_IOMUX_PAD_NAKED(1,  8, PAD_MUXSEL_0)
+#define MX23_PAD_LCD_D09__LCD_D09		MXS_IOMUX_PAD_NAKED(1,  9, PAD_MUXSEL_0)
+#define MX23_PAD_LCD_D10__LCD_D10		MXS_IOMUX_PAD_NAKED(1, 10, PAD_MUXSEL_0)
+#define MX23_PAD_LCD_D11__LCD_D11		MXS_IOMUX_PAD_NAKED(1, 11, PAD_MUXSEL_0)
+#define MX23_PAD_LCD_D12__LCD_D12		MXS_IOMUX_PAD_NAKED(1, 12, PAD_MUXSEL_0)
+#define MX23_PAD_LCD_D13__LCD_D13		MXS_IOMUX_PAD_NAKED(1, 13, PAD_MUXSEL_0)
+#define MX23_PAD_LCD_D14__LCD_D14		MXS_IOMUX_PAD_NAKED(1, 14, PAD_MUXSEL_0)
+#define MX23_PAD_LCD_D15__LCD_D15		MXS_IOMUX_PAD_NAKED(1, 15, PAD_MUXSEL_0)
+#define MX23_PAD_LCD_D16__LCD_D16		MXS_IOMUX_PAD_NAKED(1, 16, PAD_MUXSEL_0)
+#define MX23_PAD_LCD_D17__LCD_D17		MXS_IOMUX_PAD_NAKED(1, 17, PAD_MUXSEL_0)
+#define MX23_PAD_LCD_RESET__LCD_RESET		MXS_IOMUX_PAD_NAKED(1, 18, PAD_MUXSEL_0)
+#define MX23_PAD_LCD_RS__LCD_RS			MXS_IOMUX_PAD_NAKED(1, 19, PAD_MUXSEL_0)
+#define MX23_PAD_LCD_WR__LCD_WR			MXS_IOMUX_PAD_NAKED(1, 20, PAD_MUXSEL_0)
+#define MX23_PAD_LCD_CS__LCD_CS			MXS_IOMUX_PAD_NAKED(1, 21, PAD_MUXSEL_0)
+#define MX23_PAD_LCD_DOTCK__LCD_DOTCK		MXS_IOMUX_PAD_NAKED(1, 22, PAD_MUXSEL_0)
+#define MX23_PAD_LCD_ENABLE__LCD_ENABLE		MXS_IOMUX_PAD_NAKED(1, 23, PAD_MUXSEL_0)
+#define MX23_PAD_LCD_HSYNC__LCD_HSYNC		MXS_IOMUX_PAD_NAKED(1, 24, PAD_MUXSEL_0)
+#define MX23_PAD_LCD_VSYNC__LCD_VSYNC		MXS_IOMUX_PAD_NAKED(1, 25, PAD_MUXSEL_0)
+#define MX23_PAD_PWM0__PWM0			MXS_IOMUX_PAD_NAKED(1, 26, PAD_MUXSEL_0)
+#define MX23_PAD_PWM1__PWM1			MXS_IOMUX_PAD_NAKED(1, 27, PAD_MUXSEL_0)
+#define MX23_PAD_PWM2__PWM2			MXS_IOMUX_PAD_NAKED(1, 28, PAD_MUXSEL_0)
+#define MX23_PAD_PWM3__PWM3			MXS_IOMUX_PAD_NAKED(1, 29, PAD_MUXSEL_0)
+#define MX23_PAD_PWM4__PWM4			MXS_IOMUX_PAD_NAKED(1, 30, PAD_MUXSEL_0)
+
+#define MX23_PAD_SSP1_CMD__SSP1_CMD		MXS_IOMUX_PAD_NAKED(2,  0, PAD_MUXSEL_0)
+#define MX23_PAD_SSP1_DETECT__SSP1_DETECT	MXS_IOMUX_PAD_NAKED(2,  1, PAD_MUXSEL_0)
+#define MX23_PAD_SSP1_DATA0__SSP1_DATA0		MXS_IOMUX_PAD_NAKED(2,  2, PAD_MUXSEL_0)
+#define MX23_PAD_SSP1_DATA1__SSP1_DATA1		MXS_IOMUX_PAD_NAKED(2,  3, PAD_MUXSEL_0)
+#define MX23_PAD_SSP1_DATA2__SSP1_DATA2		MXS_IOMUX_PAD_NAKED(2,  4, PAD_MUXSEL_0)
+#define MX23_PAD_SSP1_DATA3__SSP1_DATA3		MXS_IOMUX_PAD_NAKED(2,  5, PAD_MUXSEL_0)
+#define MX23_PAD_SSP1_SCK__SSP1_SCK		MXS_IOMUX_PAD_NAKED(2,  6, PAD_MUXSEL_0)
+#define MX23_PAD_ROTARYA__ROTARYA		MXS_IOMUX_PAD_NAKED(2,  7, PAD_MUXSEL_0)
+#define MX23_PAD_ROTARYB__ROTARYB		MXS_IOMUX_PAD_NAKED(2,  8, PAD_MUXSEL_0)
+#define MX23_PAD_EMI_A00__EMI_A00		MXS_IOMUX_PAD_NAKED(2,  9, PAD_MUXSEL_0)
+#define MX23_PAD_EMI_A01__EMI_A01		MXS_IOMUX_PAD_NAKED(2, 10, PAD_MUXSEL_0)
+#define MX23_PAD_EMI_A02__EMI_A02		MXS_IOMUX_PAD_NAKED(2, 11, PAD_MUXSEL_0)
+#define MX23_PAD_EMI_A03__EMI_A03		MXS_IOMUX_PAD_NAKED(2, 12, PAD_MUXSEL_0)
+#define MX23_PAD_EMI_A04__EMI_A04		MXS_IOMUX_PAD_NAKED(2, 13, PAD_MUXSEL_0)
+#define MX23_PAD_EMI_A05__EMI_A05		MXS_IOMUX_PAD_NAKED(2, 14, PAD_MUXSEL_0)
+#define MX23_PAD_EMI_A06__EMI_A06		MXS_IOMUX_PAD_NAKED(2, 15, PAD_MUXSEL_0)
+#define MX23_PAD_EMI_A07__EMI_A07		MXS_IOMUX_PAD_NAKED(2, 16, PAD_MUXSEL_0)
+#define MX23_PAD_EMI_A08__EMI_A08		MXS_IOMUX_PAD_NAKED(2, 17, PAD_MUXSEL_0)
+#define MX23_PAD_EMI_A09__EMI_A09		MXS_IOMUX_PAD_NAKED(2, 18, PAD_MUXSEL_0)
+#define MX23_PAD_EMI_A10__EMI_A10		MXS_IOMUX_PAD_NAKED(2, 19, PAD_MUXSEL_0)
+#define MX23_PAD_EMI_A11__EMI_A11		MXS_IOMUX_PAD_NAKED(2, 20, PAD_MUXSEL_0)
+#define MX23_PAD_EMI_A12__EMI_A12		MXS_IOMUX_PAD_NAKED(2, 21, PAD_MUXSEL_0)
+#define MX23_PAD_EMI_BA0__EMI_BA0		MXS_IOMUX_PAD_NAKED(2, 22, PAD_MUXSEL_0)
+#define MX23_PAD_EMI_BA1__EMI_BA1		MXS_IOMUX_PAD_NAKED(2, 23, PAD_MUXSEL_0)
+#define MX23_PAD_EMI_CASN__EMI_CASN		MXS_IOMUX_PAD_NAKED(2, 24, PAD_MUXSEL_0)
+#define MX23_PAD_EMI_CE0N__EMI_CE0N		MXS_IOMUX_PAD_NAKED(2, 25, PAD_MUXSEL_0)
+#define MX23_PAD_EMI_CE1N__EMI_CE1N		MXS_IOMUX_PAD_NAKED(2, 26, PAD_MUXSEL_0)
+#define MX23_PAD_GPMI_CE1N__GPMI_CE1N		MXS_IOMUX_PAD_NAKED(2, 27, PAD_MUXSEL_0)
+#define MX23_PAD_GPMI_CE0N__GPMI_CE0N		MXS_IOMUX_PAD_NAKED(2, 28, PAD_MUXSEL_0)
+#define MX23_PAD_EMI_CKE__EMI_CKE		MXS_IOMUX_PAD_NAKED(2, 29, PAD_MUXSEL_0)
+#define MX23_PAD_EMI_RASN__EMI_RASN		MXS_IOMUX_PAD_NAKED(2, 30, PAD_MUXSEL_0)
+#define MX23_PAD_EMI_WEN__EMI_WEN		MXS_IOMUX_PAD_NAKED(2, 31, PAD_MUXSEL_0)
+
+#define MX23_PAD_EMI_D00__EMI_D00		MXS_IOMUX_PAD_NAKED(3,  0, PAD_MUXSEL_0)
+#define MX23_PAD_EMI_D01__EMI_D01		MXS_IOMUX_PAD_NAKED(3,  1, PAD_MUXSEL_0)
+#define MX23_PAD_EMI_D02__EMI_D02		MXS_IOMUX_PAD_NAKED(3,  2, PAD_MUXSEL_0)
+#define MX23_PAD_EMI_D03__EMI_D03		MXS_IOMUX_PAD_NAKED(3,  3, PAD_MUXSEL_0)
+#define MX23_PAD_EMI_D04__EMI_D04		MXS_IOMUX_PAD_NAKED(3,  4, PAD_MUXSEL_0)
+#define MX23_PAD_EMI_D05__EMI_D05		MXS_IOMUX_PAD_NAKED(3,  5, PAD_MUXSEL_0)
+#define MX23_PAD_EMI_D06__EMI_D06		MXS_IOMUX_PAD_NAKED(3,  6, PAD_MUXSEL_0)
+#define MX23_PAD_EMI_D07__EMI_D07		MXS_IOMUX_PAD_NAKED(3,  7, PAD_MUXSEL_0)
+#define MX23_PAD_EMI_D08__EMI_D08		MXS_IOMUX_PAD_NAKED(3,  8, PAD_MUXSEL_0)
+#define MX23_PAD_EMI_D09__EMI_D09		MXS_IOMUX_PAD_NAKED(3,  9, PAD_MUXSEL_0)
+#define MX23_PAD_EMI_D10__EMI_D10		MXS_IOMUX_PAD_NAKED(3, 10, PAD_MUXSEL_0)
+#define MX23_PAD_EMI_D11__EMI_D11		MXS_IOMUX_PAD_NAKED(3, 11, PAD_MUXSEL_0)
+#define MX23_PAD_EMI_D12__EMI_D12		MXS_IOMUX_PAD_NAKED(3, 12, PAD_MUXSEL_0)
+#define MX23_PAD_EMI_D13__EMI_D13		MXS_IOMUX_PAD_NAKED(3, 13, PAD_MUXSEL_0)
+#define MX23_PAD_EMI_D14__EMI_D14		MXS_IOMUX_PAD_NAKED(3, 14, PAD_MUXSEL_0)
+#define MX23_PAD_EMI_D15__EMI_D15		MXS_IOMUX_PAD_NAKED(3, 15, PAD_MUXSEL_0)
+#define MX23_PAD_EMI_DQM0__EMI_DQM0		MXS_IOMUX_PAD_NAKED(3, 16, PAD_MUXSEL_0)
+#define MX23_PAD_EMI_DQM1__EMI_DQM1		MXS_IOMUX_PAD_NAKED(3, 17, PAD_MUXSEL_0)
+#define MX23_PAD_EMI_DQS0__EMI_DQS0		MXS_IOMUX_PAD_NAKED(3, 18, PAD_MUXSEL_0)
+#define MX23_PAD_EMI_DQS1__EMI_DQS1		MXS_IOMUX_PAD_NAKED(3, 19, PAD_MUXSEL_0)
+#define MX23_PAD_EMI_CLK__EMI_CLK		MXS_IOMUX_PAD_NAKED(3, 20, PAD_MUXSEL_0)
+#define MX23_PAD_EMI_CLKN__EMI_CLKN		MXS_IOMUX_PAD_NAKED(3, 21, PAD_MUXSEL_0)
+
+/* MUXSEL_1 */
+#define MX23_PAD_GPMI_D00__LCD_D8		MXS_IOMUX_PAD_NAKED(0,  0, PAD_MUXSEL_1)
+#define MX23_PAD_GPMI_D01__LCD_D9		MXS_IOMUX_PAD_NAKED(0,  1, PAD_MUXSEL_1)
+#define MX23_PAD_GPMI_D02__LCD_D10		MXS_IOMUX_PAD_NAKED(0,  2, PAD_MUXSEL_1)
+#define MX23_PAD_GPMI_D03__LCD_D11		MXS_IOMUX_PAD_NAKED(0,  3, PAD_MUXSEL_1)
+#define MX23_PAD_GPMI_D04__LCD_D12		MXS_IOMUX_PAD_NAKED(0,  4, PAD_MUXSEL_1)
+#define MX23_PAD_GPMI_D05__LCD_D13		MXS_IOMUX_PAD_NAKED(0,  5, PAD_MUXSEL_1)
+#define MX23_PAD_GPMI_D06__LCD_D14		MXS_IOMUX_PAD_NAKED(0,  6, PAD_MUXSEL_1)
+#define MX23_PAD_GPMI_D07__LCD_D15		MXS_IOMUX_PAD_NAKED(0,  7, PAD_MUXSEL_1)
+#define MX23_PAD_GPMI_D08__LCD_D18		MXS_IOMUX_PAD_NAKED(0,  8, PAD_MUXSEL_1)
+#define MX23_PAD_GPMI_D09__LCD_D19		MXS_IOMUX_PAD_NAKED(0,  9, PAD_MUXSEL_1)
+#define MX23_PAD_GPMI_D10__LCD_D20		MXS_IOMUX_PAD_NAKED(0, 10, PAD_MUXSEL_1)
+#define MX23_PAD_GPMI_D11__LCD_D21		MXS_IOMUX_PAD_NAKED(0, 11, PAD_MUXSEL_1)
+#define MX23_PAD_GPMI_D12__LCD_D22		MXS_IOMUX_PAD_NAKED(0, 12, PAD_MUXSEL_1)
+#define MX23_PAD_GPMI_D13__LCD_D23		MXS_IOMUX_PAD_NAKED(0, 13, PAD_MUXSEL_1)
+#define MX23_PAD_GPMI_D14__AUART2_RX		MXS_IOMUX_PAD_NAKED(0, 14, PAD_MUXSEL_1)
+#define MX23_PAD_GPMI_D15__AUART2_TX		MXS_IOMUX_PAD_NAKED(0, 15, PAD_MUXSEL_1)
+#define MX23_PAD_GPMI_CLE__LCD_D16		MXS_IOMUX_PAD_NAKED(0, 16, PAD_MUXSEL_1)
+#define MX23_PAD_GPMI_ALE__LCD_D17		MXS_IOMUX_PAD_NAKED(0, 17, PAD_MUXSEL_1)
+#define MX23_PAD_GPMI_CE2N__ATA_A2		MXS_IOMUX_PAD_NAKED(0, 18, PAD_MUXSEL_1)
+#define MX23_PAD_AUART1_RTS__IR_CLK		MXS_IOMUX_PAD_NAKED(0, 27, PAD_MUXSEL_1)
+#define MX23_PAD_AUART1_RX__IR_RX		MXS_IOMUX_PAD_NAKED(0, 28, PAD_MUXSEL_1)
+#define MX23_PAD_AUART1_TX__IR_TX		MXS_IOMUX_PAD_NAKED(0, 29, PAD_MUXSEL_1)
+#define MX23_PAD_I2C_SCL__GPMI_RDY2		MXS_IOMUX_PAD_NAKED(0, 30, PAD_MUXSEL_1)
+#define MX23_PAD_I2C_SDA__GPMI_CE2N		MXS_IOMUX_PAD_NAKED(0, 31, PAD_MUXSEL_1)
+
+#define MX23_PAD_LCD_D00__ETM_DA8		MXS_IOMUX_PAD_NAKED(1,  0, PAD_MUXSEL_1)
+#define MX23_PAD_LCD_D01__ETM_DA9		MXS_IOMUX_PAD_NAKED(1,  1, PAD_MUXSEL_1)
+#define MX23_PAD_LCD_D02__ETM_DA10		MXS_IOMUX_PAD_NAKED(1,  2, PAD_MUXSEL_1)
+#define MX23_PAD_LCD_D03__ETM_DA11		MXS_IOMUX_PAD_NAKED(1,  3, PAD_MUXSEL_1)
+#define MX23_PAD_LCD_D04__ETM_DA12		MXS_IOMUX_PAD_NAKED(1,  4, PAD_MUXSEL_1)
+#define MX23_PAD_LCD_D05__ETM_DA13		MXS_IOMUX_PAD_NAKED(1,  5, PAD_MUXSEL_1)
+#define MX23_PAD_LCD_D06__ETM_DA14		MXS_IOMUX_PAD_NAKED(1,  6, PAD_MUXSEL_1)
+#define MX23_PAD_LCD_D07__ETM_DA15		MXS_IOMUX_PAD_NAKED(1,  7, PAD_MUXSEL_1)
+#define MX23_PAD_LCD_D08__ETM_DA0		MXS_IOMUX_PAD_NAKED(1,  8, PAD_MUXSEL_1)
+#define MX23_PAD_LCD_D09__ETM_DA1		MXS_IOMUX_PAD_NAKED(1,  9, PAD_MUXSEL_1)
+#define MX23_PAD_LCD_D10__ETM_DA2		MXS_IOMUX_PAD_NAKED(1, 10, PAD_MUXSEL_1)
+#define MX23_PAD_LCD_D11__ETM_DA3		MXS_IOMUX_PAD_NAKED(1, 11, PAD_MUXSEL_1)
+#define MX23_PAD_LCD_D12__ETM_DA4		MXS_IOMUX_PAD_NAKED(1, 12, PAD_MUXSEL_1)
+#define MX23_PAD_LCD_D13__ETM_DA5		MXS_IOMUX_PAD_NAKED(1, 13, PAD_MUXSEL_1)
+#define MX23_PAD_LCD_D14__ETM_DA6		MXS_IOMUX_PAD_NAKED(1, 14, PAD_MUXSEL_1)
+#define MX23_PAD_LCD_D15__ETM_DA7		MXS_IOMUX_PAD_NAKED(1, 15, PAD_MUXSEL_1)
+#define MX23_PAD_LCD_RESET__ETM_TCTL		MXS_IOMUX_PAD_NAKED(1, 18, PAD_MUXSEL_1)
+#define MX23_PAD_LCD_RS__ETM_TCLK		MXS_IOMUX_PAD_NAKED(1, 19, PAD_MUXSEL_1)
+#define MX23_PAD_LCD_DOTCK__GPMI_RDY3		MXS_IOMUX_PAD_NAKED(1, 22, PAD_MUXSEL_1)
+#define MX23_PAD_LCD_ENABLE__I2C_SCL		MXS_IOMUX_PAD_NAKED(1, 23, PAD_MUXSEL_1)
+#define MX23_PAD_LCD_HSYNC__I2C_SDA		MXS_IOMUX_PAD_NAKED(1, 24, PAD_MUXSEL_1)
+#define MX23_PAD_LCD_VSYNC__LCD_BUSY		MXS_IOMUX_PAD_NAKED(1, 25, PAD_MUXSEL_1)
+#define MX23_PAD_PWM0__ROTARYA			MXS_IOMUX_PAD_NAKED(1, 26, PAD_MUXSEL_1)
+#define MX23_PAD_PWM1__ROTARYB			MXS_IOMUX_PAD_NAKED(1, 27, PAD_MUXSEL_1)
+#define MX23_PAD_PWM2__GPMI_RDY3		MXS_IOMUX_PAD_NAKED(1, 28, PAD_MUXSEL_1)
+#define MX23_PAD_PWM3__ETM_TCTL			MXS_IOMUX_PAD_NAKED(1, 29, PAD_MUXSEL_1)
+#define MX23_PAD_PWM4__ETM_TCLK			MXS_IOMUX_PAD_NAKED(1, 30, PAD_MUXSEL_1)
+
+#define MX23_PAD_SSP1_DETECT__GPMI_CE3N		MXS_IOMUX_PAD_NAKED(2,  1, PAD_MUXSEL_1)
+#define MX23_PAD_SSP1_DATA1__I2C_SCL		MXS_IOMUX_PAD_NAKED(2,  3, PAD_MUXSEL_1)
+#define MX23_PAD_SSP1_DATA2__I2C_SDA		MXS_IOMUX_PAD_NAKED(2,  4, PAD_MUXSEL_1)
+#define MX23_PAD_ROTARYA__AUART2_RTS		MXS_IOMUX_PAD_NAKED(2,  7, PAD_MUXSEL_1)
+#define MX23_PAD_ROTARYB__AUART2_CTS		MXS_IOMUX_PAD_NAKED(2,  8, PAD_MUXSEL_1)
+
+/* MUXSEL_2 */
+#define MX23_PAD_GPMI_D00__SSP2_DATA0		MXS_IOMUX_PAD_NAKED(0,  0, PAD_MUXSEL_2)
+#define MX23_PAD_GPMI_D01__SSP2_DATA1		MXS_IOMUX_PAD_NAKED(0,  1, PAD_MUXSEL_2)
+#define MX23_PAD_GPMI_D02__SSP2_DATA2		MXS_IOMUX_PAD_NAKED(0,  2, PAD_MUXSEL_2)
+#define MX23_PAD_GPMI_D03__SSP2_DATA3		MXS_IOMUX_PAD_NAKED(0,  3, PAD_MUXSEL_2)
+#define MX23_PAD_GPMI_D04__SSP2_DATA4		MXS_IOMUX_PAD_NAKED(0,  4, PAD_MUXSEL_2)
+#define MX23_PAD_GPMI_D05__SSP2_DATA5		MXS_IOMUX_PAD_NAKED(0,  5, PAD_MUXSEL_2)
+#define MX23_PAD_GPMI_D06__SSP2_DATA6		MXS_IOMUX_PAD_NAKED(0,  6, PAD_MUXSEL_2)
+#define MX23_PAD_GPMI_D07__SSP2_DATA7		MXS_IOMUX_PAD_NAKED(0,  7, PAD_MUXSEL_2)
+#define MX23_PAD_GPMI_D08__SSP1_DATA4		MXS_IOMUX_PAD_NAKED(0,  8, PAD_MUXSEL_2)
+#define MX23_PAD_GPMI_D09__SSP1_DATA5		MXS_IOMUX_PAD_NAKED(0,  9, PAD_MUXSEL_2)
+#define MX23_PAD_GPMI_D10__SSP1_DATA6		MXS_IOMUX_PAD_NAKED(0, 10, PAD_MUXSEL_2)
+#define MX23_PAD_GPMI_D11__SSP1_DATA7		MXS_IOMUX_PAD_NAKED(0, 11, PAD_MUXSEL_2)
+#define MX23_PAD_GPMI_D15__GPMI_CE3N		MXS_IOMUX_PAD_NAKED(0, 15, PAD_MUXSEL_2)
+#define MX23_PAD_GPMI_RDY0__SSP2_DETECT		MXS_IOMUX_PAD_NAKED(0, 19, PAD_MUXSEL_2)
+#define MX23_PAD_GPMI_RDY1__SSP2_CMD		MXS_IOMUX_PAD_NAKED(0, 20, PAD_MUXSEL_2)
+#define MX23_PAD_GPMI_WRN__SSP2_SCK		MXS_IOMUX_PAD_NAKED(0, 24, PAD_MUXSEL_2)
+#define MX23_PAD_AUART1_CTS__SSP1_DATA4		MXS_IOMUX_PAD_NAKED(0, 26, PAD_MUXSEL_2)
+#define MX23_PAD_AUART1_RTS__SSP1_DATA5		MXS_IOMUX_PAD_NAKED(0, 27, PAD_MUXSEL_2)
+#define MX23_PAD_AUART1_RX__SSP1_DATA6		MXS_IOMUX_PAD_NAKED(0, 28, PAD_MUXSEL_2)
+#define MX23_PAD_AUART1_TX__SSP1_DATA7		MXS_IOMUX_PAD_NAKED(0, 29, PAD_MUXSEL_2)
+#define MX23_PAD_I2C_SCL__AUART1_TX		MXS_IOMUX_PAD_NAKED(0, 30, PAD_MUXSEL_2)
+#define MX23_PAD_I2C_SDA__AUART1_RX		MXS_IOMUX_PAD_NAKED(0, 31, PAD_MUXSEL_2)
+
+#define MX23_PAD_LCD_D08__SAIF2_SDATA0		MXS_IOMUX_PAD_NAKED(1,  8, PAD_MUXSEL_2)
+#define MX23_PAD_LCD_D09__SAIF1_SDATA0		MXS_IOMUX_PAD_NAKED(1,  9, PAD_MUXSEL_2)
+#define MX23_PAD_LCD_D10__SAIF_MCLK_BITCLK	MXS_IOMUX_PAD_NAKED(1, 10, PAD_MUXSEL_2)
+#define MX23_PAD_LCD_D11__SAIF_LRCLK		MXS_IOMUX_PAD_NAKED(1, 11, PAD_MUXSEL_2)
+#define MX23_PAD_LCD_D12__SAIF2_SDATA1		MXS_IOMUX_PAD_NAKED(1, 12, PAD_MUXSEL_2)
+#define MX23_PAD_LCD_D13__SAIF2_SDATA2		MXS_IOMUX_PAD_NAKED(1, 13, PAD_MUXSEL_2)
+#define MX23_PAD_LCD_D14__SAIF1_SDATA2		MXS_IOMUX_PAD_NAKED(1, 14, PAD_MUXSEL_2)
+#define MX23_PAD_LCD_D15__SAIF1_SDATA1		MXS_IOMUX_PAD_NAKED(1, 15, PAD_MUXSEL_2)
+#define MX23_PAD_LCD_D16__SAIF_ALT_BITCLK	MXS_IOMUX_PAD_NAKED(1, 16, PAD_MUXSEL_2)
+#define MX23_PAD_LCD_RESET__GPMI_CE3N		MXS_IOMUX_PAD_NAKED(1, 18, PAD_MUXSEL_2)
+#define MX23_PAD_PWM0__DUART_RX			MXS_IOMUX_PAD_NAKED(1, 26, PAD_MUXSEL_2)
+#define MX23_PAD_PWM1__DUART_TX			MXS_IOMUX_PAD_NAKED(1, 27, PAD_MUXSEL_2)
+#define MX23_PAD_PWM3__AUART1_CTS		MXS_IOMUX_PAD_NAKED(1, 29, PAD_MUXSEL_2)
+#define MX23_PAD_PWM4__AUART1_RTS		MXS_IOMUX_PAD_NAKED(1, 30, PAD_MUXSEL_2)
+
+#define MX23_PAD_SSP1_CMD__JTAG_TDO		MXS_IOMUX_PAD_NAKED(2,  0, PAD_MUXSEL_2)
+#define MX23_PAD_SSP1_DETECT__USB_OTG_ID	MXS_IOMUX_PAD_NAKED(2,  1, PAD_MUXSEL_2)
+#define MX23_PAD_SSP1_DATA0__JTAG_TDI		MXS_IOMUX_PAD_NAKED(2,  2, PAD_MUXSEL_2)
+#define MX23_PAD_SSP1_DATA1__JTAG_TCLK		MXS_IOMUX_PAD_NAKED(2,  3, PAD_MUXSEL_2)
+#define MX23_PAD_SSP1_DATA2__JTAG_RTCK		MXS_IOMUX_PAD_NAKED(2,  4, PAD_MUXSEL_2)
+#define MX23_PAD_SSP1_DATA3__JTAG_TMS		MXS_IOMUX_PAD_NAKED(2,  5, PAD_MUXSEL_2)
+#define MX23_PAD_SSP1_SCK__JTAG_TRST		MXS_IOMUX_PAD_NAKED(2,  6, PAD_MUXSEL_2)
+#define MX23_PAD_ROTARYA__SPDIF			MXS_IOMUX_PAD_NAKED(2,  7, PAD_MUXSEL_2)
+#define MX23_PAD_ROTARYB__GPMI_CE3N		MXS_IOMUX_PAD_NAKED(2,  8, PAD_MUXSEL_2)
+
+/* MUXSEL_GPIO */
+#define MX23_PAD_GPMI_D00__GPO_0_0		MXS_IOMUX_PAD_NAKED(0,  0, PAD_MUXSEL_GPIO)
+#define MX23_PAD_GPMI_D01__GPO_0_1		MXS_IOMUX_PAD_NAKED(0,  1, PAD_MUXSEL_GPIO)
+#define MX23_PAD_GPMI_D02__GPO_0_2		MXS_IOMUX_PAD_NAKED(0,  2, PAD_MUXSEL_GPIO)
+#define MX23_PAD_GPMI_D03__GPO_0_3		MXS_IOMUX_PAD_NAKED(0,  3, PAD_MUXSEL_GPIO)
+#define MX23_PAD_GPMI_D04__GPO_0_4		MXS_IOMUX_PAD_NAKED(0,  4, PAD_MUXSEL_GPIO)
+#define MX23_PAD_GPMI_D05__GPO_0_5		MXS_IOMUX_PAD_NAKED(0,  5, PAD_MUXSEL_GPIO)
+#define MX23_PAD_GPMI_D06__GPO_0_6		MXS_IOMUX_PAD_NAKED(0,  6, PAD_MUXSEL_GPIO)
+#define MX23_PAD_GPMI_D07__GPO_0_7		MXS_IOMUX_PAD_NAKED(0,  7, PAD_MUXSEL_GPIO)
+#define MX23_PAD_GPMI_D08__GPO_0_8		MXS_IOMUX_PAD_NAKED(0,  8, PAD_MUXSEL_GPIO)
+#define MX23_PAD_GPMI_D09__GPO_0_9		MXS_IOMUX_PAD_NAKED(0,  9, PAD_MUXSEL_GPIO)
+#define MX23_PAD_GPMI_D10__GPO_0_10		MXS_IOMUX_PAD_NAKED(0, 10, PAD_MUXSEL_GPIO)
+#define MX23_PAD_GPMI_D11__GPO_0_11		MXS_IOMUX_PAD_NAKED(0, 11, PAD_MUXSEL_GPIO)
+#define MX23_PAD_GPMI_D12__GPO_0_12		MXS_IOMUX_PAD_NAKED(0, 12, PAD_MUXSEL_GPIO)
+#define MX23_PAD_GPMI_D13__GPO_0_13		MXS_IOMUX_PAD_NAKED(0, 13, PAD_MUXSEL_GPIO)
+#define MX23_PAD_GPMI_D14__GPO_0_14		MXS_IOMUX_PAD_NAKED(0, 14, PAD_MUXSEL_GPIO)
+#define MX23_PAD_GPMI_D15__GPO_0_15		MXS_IOMUX_PAD_NAKED(0, 15, PAD_MUXSEL_GPIO)
+#define MX23_PAD_GPMI_CLE__GPO_0_16		MXS_IOMUX_PAD_NAKED(0, 16, PAD_MUXSEL_GPIO)
+#define MX23_PAD_GPMI_ALE__GPO_0_17		MXS_IOMUX_PAD_NAKED(0, 17, PAD_MUXSEL_GPIO)
+#define MX23_PAD_GPMI_CE2N__GPO_0_18		MXS_IOMUX_PAD_NAKED(0, 18, PAD_MUXSEL_GPIO)
+#define MX23_PAD_GPMI_RDY0__GPO_0_19		MXS_IOMUX_PAD_NAKED(0, 19, PAD_MUXSEL_GPIO)
+#define MX23_PAD_GPMI_RDY1__GPO_0_20		MXS_IOMUX_PAD_NAKED(0, 20, PAD_MUXSEL_GPIO)
+#define MX23_PAD_GPMI_RDY2__GPO_0_21		MXS_IOMUX_PAD_NAKED(0, 21, PAD_MUXSEL_GPIO)
+#define MX23_PAD_GPMI_RDY3__GPO_0_22		MXS_IOMUX_PAD_NAKED(0, 22, PAD_MUXSEL_GPIO)
+#define MX23_PAD_GPMI_WPN__GPO_0_23		MXS_IOMUX_PAD_NAKED(0, 23, PAD_MUXSEL_GPIO)
+#define MX23_PAD_GPMI_WRN__GPO_0_24		MXS_IOMUX_PAD_NAKED(0, 24, PAD_MUXSEL_GPIO)
+#define MX23_PAD_GPMI_RDN__GPO_0_25		MXS_IOMUX_PAD_NAKED(0, 25, PAD_MUXSEL_GPIO)
+#define MX23_PAD_AUART1_CTS__GPO_0_26		MXS_IOMUX_PAD_NAKED(0, 26, PAD_MUXSEL_GPIO)
+#define MX23_PAD_AUART1_RTS__GPO_0_27		MXS_IOMUX_PAD_NAKED(0, 27, PAD_MUXSEL_GPIO)
+#define MX23_PAD_AUART1_RX__GPO_0_28		MXS_IOMUX_PAD_NAKED(0, 28, PAD_MUXSEL_GPIO)
+#define MX23_PAD_AUART1_TX__GPO_0_29		MXS_IOMUX_PAD_NAKED(0, 29, PAD_MUXSEL_GPIO)
+#define MX23_PAD_I2C_SCL__GPO_0_30		MXS_IOMUX_PAD_NAKED(0, 30, PAD_MUXSEL_GPIO)
+#define MX23_PAD_I2C_SDA__GPO_0_31		MXS_IOMUX_PAD_NAKED(0, 31, PAD_MUXSEL_GPIO)
+
+#define MX23_PAD_LCD_D00__GPO_1_0		MXS_IOMUX_PAD_NAKED(1,  0, PAD_MUXSEL_GPIO)
+#define MX23_PAD_LCD_D01__GPO_1_1		MXS_IOMUX_PAD_NAKED(1,  1, PAD_MUXSEL_GPIO)
+#define MX23_PAD_LCD_D02__GPO_1_2		MXS_IOMUX_PAD_NAKED(1,  2, PAD_MUXSEL_GPIO)
+#define MX23_PAD_LCD_D03__GPO_1_3		MXS_IOMUX_PAD_NAKED(1,  3, PAD_MUXSEL_GPIO)
+#define MX23_PAD_LCD_D04__GPO_1_4		MXS_IOMUX_PAD_NAKED(1,  4, PAD_MUXSEL_GPIO)
+#define MX23_PAD_LCD_D05__GPO_1_5		MXS_IOMUX_PAD_NAKED(1,  5, PAD_MUXSEL_GPIO)
+#define MX23_PAD_LCD_D06__GPO_1_6		MXS_IOMUX_PAD_NAKED(1,  6, PAD_MUXSEL_GPIO)
+#define MX23_PAD_LCD_D07__GPO_1_7		MXS_IOMUX_PAD_NAKED(1,  7, PAD_MUXSEL_GPIO)
+#define MX23_PAD_LCD_D08__GPO_1_8		MXS_IOMUX_PAD_NAKED(1,  8, PAD_MUXSEL_GPIO)
+#define MX23_PAD_LCD_D09__GPO_1_9		MXS_IOMUX_PAD_NAKED(1,  9, PAD_MUXSEL_GPIO)
+#define MX23_PAD_LCD_D10__GPO_1_10		MXS_IOMUX_PAD_NAKED(1, 10, PAD_MUXSEL_GPIO)
+#define MX23_PAD_LCD_D11__GPO_1_11		MXS_IOMUX_PAD_NAKED(1, 11, PAD_MUXSEL_GPIO)
+#define MX23_PAD_LCD_D12__GPO_1_12		MXS_IOMUX_PAD_NAKED(1, 12, PAD_MUXSEL_GPIO)
+#define MX23_PAD_LCD_D13__GPO_1_13		MXS_IOMUX_PAD_NAKED(1, 13, PAD_MUXSEL_GPIO)
+#define MX23_PAD_LCD_D14__GPO_1_14		MXS_IOMUX_PAD_NAKED(1, 14, PAD_MUXSEL_GPIO)
+#define MX23_PAD_LCD_D15__GPO_1_15		MXS_IOMUX_PAD_NAKED(1, 15, PAD_MUXSEL_GPIO)
+#define MX23_PAD_LCD_D16__GPO_1_16		MXS_IOMUX_PAD_NAKED(1, 16, PAD_MUXSEL_GPIO)
+#define MX23_PAD_LCD_D17__GPO_1_17		MXS_IOMUX_PAD_NAKED(1, 17, PAD_MUXSEL_GPIO)
+#define MX23_PAD_LCD_RESET__GPO_1_18		MXS_IOMUX_PAD_NAKED(1, 18, PAD_MUXSEL_GPIO)
+#define MX23_PAD_LCD_RS__GPO_1_19		MXS_IOMUX_PAD_NAKED(1, 19, PAD_MUXSEL_GPIO)
+#define MX23_PAD_LCD_WR__GPO_1_20		MXS_IOMUX_PAD_NAKED(1, 20, PAD_MUXSEL_GPIO)
+#define MX23_PAD_LCD_CS__GPO_1_21		MXS_IOMUX_PAD_NAKED(1, 21, PAD_MUXSEL_GPIO)
+#define MX23_PAD_LCD_DOTCK__GPO_1_22		MXS_IOMUX_PAD_NAKED(1, 22, PAD_MUXSEL_GPIO)
+#define MX23_PAD_LCD_ENABLE__GPO_1_23		MXS_IOMUX_PAD_NAKED(1, 23, PAD_MUXSEL_GPIO)
+#define MX23_PAD_LCD_HSYNC__GPO_1_24		MXS_IOMUX_PAD_NAKED(1, 24, PAD_MUXSEL_GPIO)
+#define MX23_PAD_LCD_VSYNC__GPO_1_25		MXS_IOMUX_PAD_NAKED(1, 25, PAD_MUXSEL_GPIO)
+#define MX23_PAD_PWM0__GPO_1_26			MXS_IOMUX_PAD_NAKED(1, 26, PAD_MUXSEL_GPIO)
+#define MX23_PAD_PWM1__GPO_1_27			MXS_IOMUX_PAD_NAKED(1, 27, PAD_MUXSEL_GPIO)
+#define MX23_PAD_PWM2__GPO_1_28			MXS_IOMUX_PAD_NAKED(1, 28, PAD_MUXSEL_GPIO)
+#define MX23_PAD_PWM3__GPO_1_29			MXS_IOMUX_PAD_NAKED(1, 29, PAD_MUXSEL_GPIO)
+#define MX23_PAD_PWM4__GPO_1_30			MXS_IOMUX_PAD_NAKED(1, 30, PAD_MUXSEL_GPIO)
+
+#define MX23_PAD_SSP1_CMD__GPO_2_0		MXS_IOMUX_PAD_NAKED(2,  0, PAD_MUXSEL_GPIO)
+#define MX23_PAD_SSP1_DETECT__GPO_2_1		MXS_IOMUX_PAD_NAKED(2,  1, PAD_MUXSEL_GPIO)
+#define MX23_PAD_SSP1_DATA0__GPO_2_2		MXS_IOMUX_PAD_NAKED(2,  2, PAD_MUXSEL_GPIO)
+#define MX23_PAD_SSP1_DATA1__GPO_2_3		MXS_IOMUX_PAD_NAKED(2,  3, PAD_MUXSEL_GPIO)
+#define MX23_PAD_SSP1_DATA2__GPO_2_4		MXS_IOMUX_PAD_NAKED(2,  4, PAD_MUXSEL_GPIO)
+#define MX23_PAD_SSP1_DATA3__GPO_2_5		MXS_IOMUX_PAD_NAKED(2,  5, PAD_MUXSEL_GPIO)
+#define MX23_PAD_SSP1_SCK__GPO_2_6		MXS_IOMUX_PAD_NAKED(2,  6, PAD_MUXSEL_GPIO)
+#define MX23_PAD_ROTARYA__GPO_2_7		MXS_IOMUX_PAD_NAKED(2,  7, PAD_MUXSEL_GPIO)
+#define MX23_PAD_ROTARYB__GPO_2_8		MXS_IOMUX_PAD_NAKED(2,  8, PAD_MUXSEL_GPIO)
+#define MX23_PAD_EMI_A00__GPO_2_9		MXS_IOMUX_PAD_NAKED(2,  9, PAD_MUXSEL_GPIO)
+#define MX23_PAD_EMI_A01__GPO_2_10		MXS_IOMUX_PAD_NAKED(2, 10, PAD_MUXSEL_GPIO)
+#define MX23_PAD_EMI_A02__GPO_2_11		MXS_IOMUX_PAD_NAKED(2, 11, PAD_MUXSEL_GPIO)
+#define MX23_PAD_EMI_A03__GPO_2_12		MXS_IOMUX_PAD_NAKED(2, 12, PAD_MUXSEL_GPIO)
+#define MX23_PAD_EMI_A04__GPO_2_13		MXS_IOMUX_PAD_NAKED(2, 13, PAD_MUXSEL_GPIO)
+#define MX23_PAD_EMI_A05__GPO_2_14		MXS_IOMUX_PAD_NAKED(2, 14, PAD_MUXSEL_GPIO)
+#define MX23_PAD_EMI_A06__GPO_2_15		MXS_IOMUX_PAD_NAKED(2, 15, PAD_MUXSEL_GPIO)
+#define MX23_PAD_EMI_A07__GPO_2_16		MXS_IOMUX_PAD_NAKED(2, 16, PAD_MUXSEL_GPIO)
+#define MX23_PAD_EMI_A08__GPO_2_17		MXS_IOMUX_PAD_NAKED(2, 17, PAD_MUXSEL_GPIO)
+#define MX23_PAD_EMI_A09__GPO_2_18		MXS_IOMUX_PAD_NAKED(2, 18, PAD_MUXSEL_GPIO)
+#define MX23_PAD_EMI_A10__GPO_2_19		MXS_IOMUX_PAD_NAKED(2, 19, PAD_MUXSEL_GPIO)
+#define MX23_PAD_EMI_A11__GPO_2_20		MXS_IOMUX_PAD_NAKED(2, 20, PAD_MUXSEL_GPIO)
+#define MX23_PAD_EMI_A12__GPO_2_21		MXS_IOMUX_PAD_NAKED(2, 21, PAD_MUXSEL_GPIO)
+#define MX23_PAD_EMI_BA0__GPO_2_22		MXS_IOMUX_PAD_NAKED(2, 22, PAD_MUXSEL_GPIO)
+#define MX23_PAD_EMI_BA1__GPO_2_23		MXS_IOMUX_PAD_NAKED(2, 23, PAD_MUXSEL_GPIO)
+#define MX23_PAD_EMI_CASN__GPO_2_24		MXS_IOMUX_PAD_NAKED(2, 24, PAD_MUXSEL_GPIO)
+#define MX23_PAD_EMI_CE0N__GPO_2_25		MXS_IOMUX_PAD_NAKED(2, 25, PAD_MUXSEL_GPIO)
+#define MX23_PAD_EMI_CE1N__GPO_2_26		MXS_IOMUX_PAD_NAKED(2, 26, PAD_MUXSEL_GPIO)
+#define MX23_PAD_GPMI_CE1N__GPO_2_27		MXS_IOMUX_PAD_NAKED(2, 27, PAD_MUXSEL_GPIO)
+#define MX23_PAD_GPMI_CE0N__GPO_2_28		MXS_IOMUX_PAD_NAKED(2, 28, PAD_MUXSEL_GPIO)
+#define MX23_PAD_EMI_CKE__GPO_2_29		MXS_IOMUX_PAD_NAKED(2, 29, PAD_MUXSEL_GPIO)
+#define MX23_PAD_EMI_RASN__GPO_2_30		MXS_IOMUX_PAD_NAKED(2, 30, PAD_MUXSEL_GPIO)
+#define MX23_PAD_EMI_WEN__GPO_2_31		MXS_IOMUX_PAD_NAKED(2, 31, PAD_MUXSEL_GPIO)
+
+#endif /* __MACH_IOMUX_MX23_H__ */
arch/arm/mach-mxs/include/mach/iomux-mx28.h new file +537 -0

537 lines not on this page · raw message

arch/arm/mach-mxs/include/mach/iomux.h new file +165 -0

165 lines not on this page · raw message

arch/arm/mach-mxs/iomux.c new file +101 -0

101 lines not on this page · raw message

Signature · 1 line
1.7.1
author
#3 lore raw

PATCH v8 13/15 ARM: mxs: Add initial mx23evk support

In reply to Shawn Guo

Add initial mx23evk support with duart.

---
Changes for v8:
- Remove unnecessary line breaker

Changes for v7:
- Define mx23evk pads using naked pad "OR" mA/vol/pull configurations

Changes for v3:
- Remove inclusion of hardware.h
- Add __initconst for mx23evk_pads[]

Changes for v2:
- Remove boot_params

 arch/arm/mach-mxs/mach-mx23evk.c |   57 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 57 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-mxs/mach-mx23evk.c
arch/arm/mach-mxs/mach-mx23evk.c new file +57 -0
new file mode 100644
index 0000000..aa06400
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <linux/delay.h>
+#include <linux/platform_device.h>
+#include <linux/gpio.h>
+#include <linux/irq.h>
+
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/time.h>
+
+#include <mach/common.h>
+#include <mach/iomux-mx23.h>
+
+#include "devices-mx23.h"
+
+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,
+};
+
+static void __init mx23evk_init(void)
+{
+	mxs_iomux_setup_multiple_pads(mx23evk_pads, ARRAY_SIZE(mx23evk_pads));
+
+	mx23_add_duart();
+}
+
+static void __init mx23evk_timer_init(void)
+{
+	mx23_clocks_init();
+}
+
+static struct sys_timer mx23evk_timer = {
+	.init	= mx23evk_timer_init,
+};
+
+MACHINE_START(MX23EVK, "Freescale MX23 EVK")
+	/* Maintainer: Freescale Semiconductor, Inc. */
+	.map_io		= mx23_map_io,
+	.init_irq	= mx23_init_irq,
+	.init_machine	= mx23evk_init,
+	.timer		= &mx23evk_timer,
+MACHINE_END
Signature · 1 line
1.7.1
#4 lore raw

v8 cover ARM: mxs: Add initial support for MX23 and MX28

In reply to Shawn Guo
Quoted 2 lines · Shawn Guo

Changes for v8:
- Reuse debug-pl01x.S as mxs DUART is just an amba-pl011

So shouldn't "ARM: mxs: Dynamically allocate duart devices" create an amba-pl011 device?

Quoted 6 lines

- Remove extra space in iomux.c
- Remove uncessary line breaker in mach-mx23evk.c

[PATCH v8 05/15] ARM: mxs: Add low-level debug UART support [PATCH v8 08/15] ARM: mxs: Add iomux support [PATCH v8 13/15] ARM: mxs: Add initial mx23evk support

I was not yet able to boot a machine with an imx28 because of a missing rootfs (no flash, no ethernet driver) but up to there it looks good.

I suggest to let Sascha take the current series to get it into the next merge window and to be able to start patching based on something. (Well unless Russell or Sascha still have objections.)

I already have a few (simple) patches; I will clean them up and send them in reply to this mail.

My next step is to look into the fec driver to make it work on mx28, so if anyone already has something and wants to stop me doing duplicate work, please tell me.

The following changes since commit 81e8d2162566379adcf4b3700f03845c62577145:

Merge branch 'irq-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip (2010-12-07 08:14:28 -0800)

are available in the git repository at:

git://git.pengutronix.de/git/ukl/linux-2.6.git sgu/mxs-core-v8

Shawn Guo (15):
ARM: mxs: Add core definitions
ARM: mxs: Add helper definition and function
ARM: mxs: Add reset routines
ARM: mxs: Add interrupt support
ARM: mxs: Add low-level debug UART support
ARM: mxs: Add timer support
ARM: mxs: Add gpio support
ARM: mxs: Add iomux support
ARM: mxs: Add clock support
ARM: mxs: Add static memory mapping
ARM: mxs: Dynamically allocate duart devices
ARM: mxs: Dynamically allocate fec devices
ARM: mxs: Add initial mx23evk support
ARM: mxs: Add initial mx28evk support
ARM: mxs: Add build configuration for mxs

 arch/arm/Kconfig                                |   10 +
 arch/arm/Makefile                               |    1 +
 arch/arm/mach-mxs/Kconfig                       |   34 +
 arch/arm/mach-mxs/Makefile                      |   10 +
 arch/arm/mach-mxs/Makefile.boot                 |    1 +
 arch/arm/mach-mxs/clock-mx23.c                  |  526 ++++++++++++++++
 arch/arm/mach-mxs/clock-mx28.c                  |  734 +++++++++++++++++++++++
 arch/arm/mach-mxs/clock.c                       |  200 ++++++
 arch/arm/mach-mxs/devices-mx23.h                |   16 +
 arch/arm/mach-mxs/devices-mx28.h                |   20 +
 arch/arm/mach-mxs/devices.c                     |   75 +++
 arch/arm/mach-mxs/devices/Kconfig               |    5 +
 arch/arm/mach-mxs/devices/Makefile              |    2 +
 arch/arm/mach-mxs/devices/platform-duart.c      |   48 ++
 arch/arm/mach-mxs/devices/platform-fec.c        |   50 ++
 arch/arm/mach-mxs/gpio.c                        |  325 ++++++++++
 arch/arm/mach-mxs/gpio.h                        |   34 +
 arch/arm/mach-mxs/icoll.c                       |   81 +++
 arch/arm/mach-mxs/include/mach/clkdev.h         |    7 +
 arch/arm/mach-mxs/include/mach/clock.h          |   64 ++
 arch/arm/mach-mxs/include/mach/common.h         |   31 +
 arch/arm/mach-mxs/include/mach/debug-macro.S    |   38 ++
 arch/arm/mach-mxs/include/mach/devices-common.h |   46 ++
 arch/arm/mach-mxs/include/mach/entry-macro.S    |   41 ++
 arch/arm/mach-mxs/include/mach/gpio.h           |   35 ++
 arch/arm/mach-mxs/include/mach/hardware.h       |   29 +
 arch/arm/mach-mxs/include/mach/io.h             |   22 +
 arch/arm/mach-mxs/include/mach/iomux-mx23.h     |  355 +++++++++++
 arch/arm/mach-mxs/include/mach/iomux-mx28.h     |  537 +++++++++++++++++
 arch/arm/mach-mxs/include/mach/iomux.h          |  165 +++++
 arch/arm/mach-mxs/include/mach/irqs.h           |   32 +
 arch/arm/mach-mxs/include/mach/memory.h         |   24 +
 arch/arm/mach-mxs/include/mach/mx23.h           |  145 +++++
 arch/arm/mach-mxs/include/mach/mx28.h           |  188 ++++++
 arch/arm/mach-mxs/include/mach/mxs.h            |  105 ++++
 arch/arm/mach-mxs/include/mach/system.h         |   27 +
 arch/arm/mach-mxs/include/mach/timex.h          |   21 +
 arch/arm/mach-mxs/include/mach/uncompress.h     |   76 +++
 arch/arm/mach-mxs/include/mach/vmalloc.h        |   22 +
 arch/arm/mach-mxs/iomux.c                       |  101 ++++
 arch/arm/mach-mxs/mach-mx23evk.c                |   57 ++
 arch/arm/mach-mxs/mach-mx28evk.c                |  138 +++++
 arch/arm/mach-mxs/mm-mx23.c                     |   45 ++
 arch/arm/mach-mxs/mm-mx28.c                     |   45 ++
 arch/arm/mach-mxs/regs-clkctrl-mx23.h           |  455 ++++++++++++++
 arch/arm/mach-mxs/regs-clkctrl-mx28.h           |  663 ++++++++++++++++++++
 arch/arm/mach-mxs/system.c                      |  137 +++++
 arch/arm/mach-mxs/timer.c                       |  296 +++++++++
 48 files changed, 6119 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-mxs/Kconfig
 create mode 100644 arch/arm/mach-mxs/Makefile
 create mode 100644 arch/arm/mach-mxs/Makefile.boot
 create mode 100644 arch/arm/mach-mxs/clock-mx23.c
 create mode 100644 arch/arm/mach-mxs/clock-mx28.c
 create mode 100644 arch/arm/mach-mxs/clock.c
 create mode 100644 arch/arm/mach-mxs/devices-mx23.h
 create mode 100644 arch/arm/mach-mxs/devices-mx28.h
 create mode 100644 arch/arm/mach-mxs/devices.c
 create mode 100644 arch/arm/mach-mxs/devices/Kconfig
 create mode 100644 arch/arm/mach-mxs/devices/Makefile
 create mode 100644 arch/arm/mach-mxs/devices/platform-duart.c
 create mode 100644 arch/arm/mach-mxs/devices/platform-fec.c
 create mode 100644 arch/arm/mach-mxs/gpio.c
 create mode 100644 arch/arm/mach-mxs/gpio.h
 create mode 100644 arch/arm/mach-mxs/icoll.c
 create mode 100644 arch/arm/mach-mxs/include/mach/clkdev.h
 create mode 100644 arch/arm/mach-mxs/include/mach/clock.h
 create mode 100644 arch/arm/mach-mxs/include/mach/common.h
 create mode 100644 arch/arm/mach-mxs/include/mach/debug-macro.S
 create mode 100644 arch/arm/mach-mxs/include/mach/devices-common.h
 create mode 100644 arch/arm/mach-mxs/include/mach/entry-macro.S
 create mode 100644 arch/arm/mach-mxs/include/mach/gpio.h
 create mode 100644 arch/arm/mach-mxs/include/mach/hardware.h
 create mode 100644 arch/arm/mach-mxs/include/mach/io.h
 create mode 100644 arch/arm/mach-mxs/include/mach/iomux-mx23.h
 create mode 100644 arch/arm/mach-mxs/include/mach/iomux-mx28.h
 create mode 100644 arch/arm/mach-mxs/include/mach/iomux.h
 create mode 100644 arch/arm/mach-mxs/include/mach/irqs.h
 create mode 100644 arch/arm/mach-mxs/include/mach/memory.h
 create mode 100644 arch/arm/mach-mxs/include/mach/mx23.h
 create mode 100644 arch/arm/mach-mxs/include/mach/mx28.h
 create mode 100644 arch/arm/mach-mxs/include/mach/mxs.h
 create mode 100644 arch/arm/mach-mxs/include/mach/system.h
 create mode 100644 arch/arm/mach-mxs/include/mach/timex.h
 create mode 100644 arch/arm/mach-mxs/include/mach/uncompress.h
 create mode 100644 arch/arm/mach-mxs/include/mach/vmalloc.h
 create mode 100644 arch/arm/mach-mxs/iomux.c
 create mode 100644 arch/arm/mach-mxs/mach-mx23evk.c
 create mode 100644 arch/arm/mach-mxs/mach-mx28evk.c
 create mode 100644 arch/arm/mach-mxs/mm-mx23.c
 create mode 100644 arch/arm/mach-mxs/mm-mx28.c
 create mode 100644 arch/arm/mach-mxs/regs-clkctrl-mx23.h
 create mode 100644 arch/arm/mach-mxs/regs-clkctrl-mx28.h
 create mode 100644 arch/arm/mach-mxs/system.c
 create mode 100644 arch/arm/mach-mxs/timer.c
Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
author
#5 lore raw

v8 cover ARM: mxs: Add initial support for MX23 and MX28

Hi Uwe,

Quoted 6 lines · Uwe Kleine-K?nig
Quoted 2 lines · Shawn Guo

Changes for v8:
- Reuse debug-pl01x.S as mxs DUART is just an amba-pl011

So shouldn't "ARM: mxs: Dynamically allocate duart devices" create an amba-pl011 device?

Yes, since doing this could save the duart driver in drivers/serial. Will send a follow up patch for this soon.

Signature · 2 lines
Regards,
Shawn
author
#6 lore raw

v8 cover ARM: mxs: Add initial support for MX23 and MX28

In reply to Uwe Kleine-König

Hi Uwe,

Quoted 20 lines · Uwe Kleine-K?nig
Quoted 2 lines · Shawn Guo

Changes for v8:
- Reuse debug-pl01x.S as mxs DUART is just an amba-pl011

So shouldn't "ARM: mxs: Dynamically allocate duart devices" create an amba-pl011 device?

Quoted 6 lines

- Remove extra space in iomux.c
- Remove uncessary line breaker in mach-mx23evk.c

[PATCH v8 05/15] ARM: mxs: Add low-level debug UART support [PATCH v8 08/15] ARM: mxs: Add iomux support [PATCH v8 13/15] ARM: mxs: Add initial mx23evk support

I was not yet able to boot a machine with an imx28 because of a missing rootfs (no flash, no ethernet driver) but up to there it looks good.

I suggest to let Sascha take the current series to get it into the next merge window and to be able to start patching based on something. (Well unless Russell or Sascha still have objections.)

Quoted 7 lines

I already have a few (simple) patches; I will clean them up and send them in reply to this mail.

My next step is to look into the fec driver to make it work on mx28, so if anyone already has something and wants to stop me doing duplicate work, please tell me.

I already have a workable fec driver to mount nfs. If you do not mind, I would continue the effort to send out a patch in the next a few days.

Signature · 2 lines
Regards,
Shawn
author
#7 lore raw

PATCH 1/1 ARM: mxs: Change duart device to use amba-pl011

In reply to Shawn Guo

The mxs duart is actually an amba-pl011 device. This commit changes the duart device code to dynamically allocate amba-pl011 device, so that drivers/serial/amba-pl011.c can be used on mxs.

---
This is a follow-up patch again the patch series below, which is waiting for the merge.

[PATCH v8 00/15] ARM: mxs: Add initial support for MX23 and MX28

 arch/arm/mach-mxs/Kconfig                       |    6 ++-
 arch/arm/mach-mxs/clock-mx23.c                  |    2 +-
 arch/arm/mach-mxs/clock-mx28.c                  |    2 +-
 arch/arm/mach-mxs/devices-mx23.h                |    4 +-
 arch/arm/mach-mxs/devices-mx28.h                |    4 +-
 arch/arm/mach-mxs/devices/Kconfig               |    2 +-
 arch/arm/mach-mxs/devices/Makefile              |    2 +-
 arch/arm/mach-mxs/devices/amba-duart.c          |   39 ++++++++++++++++++
 arch/arm/mach-mxs/devices/platform-duart.c      |   48 -----------------------
 arch/arm/mach-mxs/include/mach/devices-common.h |    9 +---
 10 files changed, 53 insertions(+), 65 deletions(-)
 create mode 100644 arch/arm/mach-mxs/devices/amba-duart.c
 delete mode 100644 arch/arm/mach-mxs/devices/platform-duart.c
arch/arm/mach-mxs/Kconfig +4 -2
index c4ac7b4..0d072e9 100644
@@ -5,17 +5,19 @@ source "arch/arm/mach-mxs/devices/Kconfig"
 config SOC_IMX23
 	bool
 	select CPU_ARM926T
+	select ARM_AMBA
 
 config SOC_IMX28
 	bool
 	select CPU_ARM926T
+	select ARM_AMBA
 
 comment "MXS platforms:"
 
 config MACH_MX23EVK
 	bool "Support MX23EVK Platform"
 	select SOC_IMX23
-	select MXS_HAVE_PLATFORM_DUART
+	select MXS_HAVE_AMBA_DUART
 	default y
 	help
 	  Include support for MX23EVK platform. This includes specific
@@ -24,7 +26,7 @@ config MACH_MX23EVK
 config MACH_MX28EVK
 	bool "Support MX28EVK Platform"
 	select SOC_IMX28
-	select MXS_HAVE_PLATFORM_DUART
+	select MXS_HAVE_AMBA_DUART
 	select MXS_HAVE_PLATFORM_FEC
 	default y
 	help
arch/arm/mach-mxs/clock-mx23.c +1 -1
index 8f5a19a..0f65d15 100644
@@ -437,7 +437,7 @@ _DEFINE_CLOCK(clk32k_clk, XTAL, TIMROT_CLK32K_GATE, &ref_xtal_clk);
 	},
 
 static struct clk_lookup lookups[] = {
-	_REGISTER_CLOCK("mxs-duart.0", NULL, uart_clk)
+	_REGISTER_CLOCK("uart", NULL, uart_clk)
 	_REGISTER_CLOCK("rtc", NULL, rtc_clk)
 	_REGISTER_CLOCK(NULL, "hclk", hbus_clk)
 	_REGISTER_CLOCK(NULL, "xclk", xbus_clk)
arch/arm/mach-mxs/clock-mx28.c +1 -1
index 74e2103..dd6d158 100644
@@ -602,7 +602,7 @@ _DEFINE_CLOCK(fec_clk, ENET, DISABLE, &hbus_clk);
 	},
 
 static struct clk_lookup lookups[] = {
-	_REGISTER_CLOCK("mxs-duart.0", NULL, uart_clk)
+	_REGISTER_CLOCK("uart", NULL, uart_clk)
 	_REGISTER_CLOCK("fec.0", NULL, fec_clk)
 	_REGISTER_CLOCK("rtc", NULL, rtc_clk)
 	_REGISTER_CLOCK("pll2", NULL, pll2_clk)
arch/arm/mach-mxs/devices-mx23.h +2 -2
index d0f49fc..36397ff 100644
@@ -11,6 +11,6 @@
 #include <mach/mx23.h>
 #include <mach/devices-common.h>
 
-extern const struct mxs_duart_data mx23_duart_data __initconst;
+extern struct amba_device mx23_duart_device;
 #define mx23_add_duart() \
-	mxs_add_duart(&mx23_duart_data)
+	mxs_add_duart(&mx23_duart_device)
arch/arm/mach-mxs/devices-mx28.h +2 -2
index 00b736c..e84a7fe 100644
@@ -11,9 +11,9 @@
 #include <mach/mx28.h>
 #include <mach/devices-common.h>
 
-extern const struct mxs_duart_data mx28_duart_data __initconst;
+extern struct amba_device mx28_duart_device;
 #define mx28_add_duart() \
-	mxs_add_duart(&mx28_duart_data)
+	mxs_add_duart(&mx28_duart_device)
 
 extern const struct mxs_fec_data mx28_fec_data[] __initconst;
 #define mx28_add_fec(id, pdata) \
arch/arm/mach-mxs/devices/Kconfig +1 -1
index a35a2dc..3dff25c 100644
@@ -1,4 +1,4 @@
-config MXS_HAVE_PLATFORM_DUART
+config MXS_HAVE_AMBA_DUART
 	bool
 
 config MXS_HAVE_PLATFORM_FEC
arch/arm/mach-mxs/devices/Makefile +1 -1
index 4b5266a..d0a09f6 100644
@@ -1,2 +1,2 @@
-obj-$(CONFIG_MXS_HAVE_PLATFORM_DUART) += platform-duart.o
+obj-$(CONFIG_MXS_HAVE_AMBA_DUART) += amba-duart.o
 obj-$(CONFIG_MXS_HAVE_PLATFORM_FEC) += platform-fec.o
arch/arm/mach-mxs/devices/amba-duart.c new file +39 -0
new file mode 100644
index 0000000..d805e22
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2009-2010 Pengutronix
+ * Uwe Kleine-Koenig <[email protected]>
+ *
+ * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License version 2 as published by the
+ * Free Software Foundation.
+ */
+#include <mach/mx23.h>
+#include <mach/mx28.h>
+#include <mach/devices-common.h>
+
+#define MXS_AMBA_DEVICE(name, soc)				\
+struct amba_device name##_device = {				\
+	.dev = {						\
+		.init_name = "uart",				\
+	},							\
+	.res = {						\
+		.start = soc ## _DUART_BASE_ADDR,		\
+		.end = (soc ## _DUART_BASE_ADDR) + SZ_8K - 1,	\
+		.flags = IORESOURCE_MEM,			\
+	},							\
+	.irq = {soc ## _INT_DUART, NO_IRQ},			\
+}
+
+#ifdef CONFIG_SOC_IMX23
+MXS_AMBA_DEVICE(mx23_duart, MX23);
+#endif
+
+#ifdef CONFIG_SOC_IMX28
+MXS_AMBA_DEVICE(mx28_duart, MX28);
+#endif
+
+int __init mxs_add_duart(struct amba_device *dev)
+{
+	return amba_device_register(dev, &iomem_resource);
+}
arch/arm/mach-mxs/devices/platform-duart.c deleted +0 -48

48 lines not on this page · raw message

arch/arm/mach-mxs/include/mach/devices-common.h +2 -7
index 3da48d4..fca0551 100644
@@ -9,6 +9,7 @@
 #include <linux/kernel.h>
 #include <linux/platform_device.h>
 #include <linux/init.h>
+#include <linux/amba/bus.h>
 
 struct platform_device *mxs_add_platform_device_dmamask(
 		const char *name, int id,
@@ -25,13 +26,7 @@ static inline struct platform_device *mxs_add_platform_device(
 }
 
 /* duart */
-struct mxs_duart_data {
-	resource_size_t iobase;
-	resource_size_t iosize;
-	resource_size_t irq;
-};
-struct platform_device *__init mxs_add_duart(
-		const struct mxs_duart_data *data);
+int __init mxs_add_duart(struct amba_device *dev);
 
 /* fec */
 #include <linux/fec.h>
Signature · 1 line
1.7.1
#8 lore raw

PATCH 1/1 ARM: mxs: Change duart device to use amba-pl011

Hi Shawn,

Quoted 5 lines · Shawn Guo

The mxs duart is actually an amba-pl011 device. This commit changes the duart device code to dynamically allocate amba-pl011 device, so that drivers/serial/amba-pl011.c can be used on mxs.

Great that it works!

Quoted 59 lines

---
This is a follow-up patch again the patch series below, which is waiting for the merge.

[PATCH v8 00/15] ARM: mxs: Add initial support for MX23 and MX28

 arch/arm/mach-mxs/Kconfig                       |    6 ++-
 arch/arm/mach-mxs/clock-mx23.c                  |    2 +-
 arch/arm/mach-mxs/clock-mx28.c                  |    2 +-
 arch/arm/mach-mxs/devices-mx23.h                |    4 +-
 arch/arm/mach-mxs/devices-mx28.h                |    4 +-
 arch/arm/mach-mxs/devices/Kconfig               |    2 +-
 arch/arm/mach-mxs/devices/Makefile              |    2 +-
 arch/arm/mach-mxs/devices/amba-duart.c          |   39 ++++++++++++++++++
 arch/arm/mach-mxs/devices/platform-duart.c      |   48 -----------------------
 arch/arm/mach-mxs/include/mach/devices-common.h |    9 +---
 10 files changed, 53 insertions(+), 65 deletions(-)
 create mode 100644 arch/arm/mach-mxs/devices/amba-duart.c
 delete mode 100644 arch/arm/mach-mxs/devices/platform-duart.c
arch/arm/mach-mxs/Kconfig +4 -2
index c4ac7b4..0d072e9 100644
@@ -5,17 +5,19 @@ source "arch/arm/mach-mxs/devices/Kconfig"
 config SOC_IMX23
 	bool
 	select CPU_ARM926T
+	select ARM_AMBA
 
 config SOC_IMX28
 	bool
 	select CPU_ARM926T
+	select ARM_AMBA
 
 comment "MXS platforms:"
 
 config MACH_MX23EVK
 	bool "Support MX23EVK Platform"
 	select SOC_IMX23
-	select MXS_HAVE_PLATFORM_DUART
+	select MXS_HAVE_AMBA_DUART
 	default y
 	help
 	  Include support for MX23EVK platform. This includes specific
@@ -24,7 +26,7 @@ config MACH_MX23EVK
 config MACH_MX28EVK
 	bool "Support MX28EVK Platform"
 	select SOC_IMX28
-	select MXS_HAVE_PLATFORM_DUART
+	select MXS_HAVE_AMBA_DUART
 	select MXS_HAVE_PLATFORM_FEC
 	default y
 	help
arch/arm/mach-mxs/clock-mx23.c +0 -0
index 8f5a19a..0f65d15 100644

arch/arm/mach-mxs/clock-mx23.c _DEFINE_CLOCK(clk32k_clk, XTAL, TIMROT_CLK32K_GATE, &ref_xtal_clk); · line 440

Quoted 5 lines
arch/arm/mach-mxs/clock-mx23.c +1 -1
@@ -437,7 +437,7 @@ _DEFINE_CLOCK(clk32k_clk, XTAL, TIMROT_CLK32K_GATE, &ref_xtal_clk);
 	},
 
 static struct clk_lookup lookups[] = {
-	_REGISTER_CLOCK("mxs-duart.0", NULL, uart_clk)
+	_REGISTER_CLOCK("uart", NULL, uart_clk)

Maybe "duart"?

arch/arm/mach-mxs/clock-mx28.c _DEFINE_CLOCK(fec_clk, ENET, DISABLE, &hbus_clk); · line 605

Quoted 13 lines
arch/arm/mach-mxs/clock-mx23.c +0 -0
 	_REGISTER_CLOCK("rtc", NULL, rtc_clk)
 	_REGISTER_CLOCK(NULL, "hclk", hbus_clk)
 	_REGISTER_CLOCK(NULL, "xclk", xbus_clk)
arch/arm/mach-mxs/clock-mx28.c +1 -1
index 74e2103..dd6d158 100644
@@ -602,7 +602,7 @@ _DEFINE_CLOCK(fec_clk, ENET, DISABLE, &hbus_clk);
 	},
 
 static struct clk_lookup lookups[] = {
-	_REGISTER_CLOCK("mxs-duart.0", NULL, uart_clk)
+	_REGISTER_CLOCK("uart", NULL, uart_clk)

Maybe "duart"?

Quoted 61 lines
arch/arm/mach-mxs/clock-mx28.c +0 -0
 	_REGISTER_CLOCK("fec.0", NULL, fec_clk)
 	_REGISTER_CLOCK("rtc", NULL, rtc_clk)
 	_REGISTER_CLOCK("pll2", NULL, pll2_clk)
arch/arm/mach-mxs/devices-mx23.h +2 -2
index d0f49fc..36397ff 100644
@@ -11,6 +11,6 @@
 #include <mach/mx23.h>
 #include <mach/devices-common.h>
 
-extern const struct mxs_duart_data mx23_duart_data __initconst;
+extern struct amba_device mx23_duart_device;
 #define mx23_add_duart() \
-	mxs_add_duart(&mx23_duart_data)
+	mxs_add_duart(&mx23_duart_device)
arch/arm/mach-mxs/devices-mx28.h +2 -2
index 00b736c..e84a7fe 100644
@@ -11,9 +11,9 @@
 #include <mach/mx28.h>
 #include <mach/devices-common.h>
 
-extern const struct mxs_duart_data mx28_duart_data __initconst;
+extern struct amba_device mx28_duart_device;
 #define mx28_add_duart() \
-	mxs_add_duart(&mx28_duart_data)
+	mxs_add_duart(&mx28_duart_device)
 
 extern const struct mxs_fec_data mx28_fec_data[] __initconst;
 #define mx28_add_fec(id, pdata) \
arch/arm/mach-mxs/devices/Kconfig +1 -1
index a35a2dc..3dff25c 100644
@@ -1,4 +1,4 @@
-config MXS_HAVE_PLATFORM_DUART
+config MXS_HAVE_AMBA_DUART
 	bool
 
 config MXS_HAVE_PLATFORM_FEC
arch/arm/mach-mxs/devices/Makefile +1 -1
index 4b5266a..d0a09f6 100644
@@ -1,2 +1,2 @@
-obj-$(CONFIG_MXS_HAVE_PLATFORM_DUART) += platform-duart.o
+obj-$(CONFIG_MXS_HAVE_AMBA_DUART) += amba-duart.o
 obj-$(CONFIG_MXS_HAVE_PLATFORM_FEC) += platform-fec.o
arch/arm/mach-mxs/devices/amba-duart.c new file +5 -0
new file mode 100644
index 0000000..d805e22
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2009-2010 Pengutronix
+ * Uwe Kleine-Koenig <[email protected]>
+ *
+ * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved.

arch/arm/mach-mxs/devices/amba-duart.c line 15

Quoted 10 lines
arch/arm/mach-mxs/devices/amba-duart.c new file +10 -0
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License version 2 as published by the
+ * Free Software Foundation.
+ */
+#include <mach/mx23.h>
+#include <mach/mx28.h>
+#include <mach/devices-common.h>
+
+#define MXS_AMBA_DEVICE(name, soc)				\

Maybe MXS_AMBA_DUART_DEVICE? It now sounds more generic than it actually is ;)

arch/arm/mach-mxs/devices/amba-duart.c line 18

Quoted 3 lines
arch/arm/mach-mxs/devices/amba-duart.c new file +3 -0
+struct amba_device name##_device = {				\
+	.dev = {						\
+		.init_name = "uart",				\

"duart" again?

arch/arm/mach-mxs/devices/amba-duart.c line 26

Quoted 8 lines
arch/arm/mach-mxs/devices/amba-duart.c new file +8 -0
+	},							\
+	.res = {						\
+		.start = soc ## _DUART_BASE_ADDR,		\
+		.end = (soc ## _DUART_BASE_ADDR) + SZ_8K - 1,	\
+		.flags = IORESOURCE_MEM,			\
+	},							\
+	.irq = {soc ## _INT_DUART, NO_IRQ},			\
+}

[...]

Kind regards,

Wolfram

Signature · 9 lines
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20101221/349e7817/attachment.sig>
author
#9 lore raw

PATCH 1/1 ARM: mxs: Change duart device to use amba-pl011

Hi Wolfram,

Thanks for the review.

Quoted 11 lines · Wolfram Sang

Hi Shawn,

Quoted 5 lines · Shawn Guo

The mxs duart is actually an amba-pl011 device. This commit changes the duart device code to dynamically allocate amba-pl011 device, so that drivers/serial/amba-pl011.c can be used on mxs.

Great that it works!

[...]

Quoted 6 lines

Review

Quoted 3 lines

static struct clk_lookup lookups[] = {

(quoted diff) +1 -1
-	_REGISTER_CLOCK("mxs-duart.0", NULL, uart_clk)
+	_REGISTER_CLOCK("uart", NULL, uart_clk)

Maybe "duart"?

I was thinking about the naming "uart" vs "duart" here, and decided to pick the "uart", because this is the name of clock "uart_clk", which is the clock for uart domain, not only duart.

[...]

Quoted 8 lines

arch/arm/mach-mxs/devices/amba-duart.c line 15

Quoted 5 lines
arch/arm/mach-mxs/devices/amba-duart.c new file +5 -0
+#include <mach/mx23.h>
+#include <mach/mx28.h>
+#include <mach/devices-common.h>
+
+#define MXS_AMBA_DEVICE(name, soc)				\

Maybe MXS_AMBA_DUART_DEVICE? It now sounds more generic than it actually is ;)

OK. Will change.

Signature · 2 lines
Regards,
Shawn
#10 lore raw

PATCH 1/1 ARM: mxs: Change duart device to use amba-pl011

Hi Shawn,

Quoted 10 lines · Shawn Guo

[...]

Quoted 6 lines

Review

Quoted 3 lines

static struct clk_lookup lookups[] = {

(quoted diff) +1 -1
-	_REGISTER_CLOCK("mxs-duart.0", NULL, uart_clk)
+	_REGISTER_CLOCK("uart", NULL, uart_clk)

Maybe "duart"?

I was thinking about the naming "uart" vs "duart" here, and decided to pick the "uart", because this is the name of clock "uart_clk", which is the clock for uart domain, not only duart.

Makes sense.

Thanks,

Wolfram

Signature · 9 lines
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20101222/aab050cb/attachment.sig>
#11 lore raw

PATCH 1/1 ARM: mxs: Change duart device to use amba-pl011

In reply to Shawn Guo

Hello Shawn,

Quoted 3 lines · Shawn Guo

The mxs duart is actually an amba-pl011 device. This commit changes the duart device code to dynamically allocate amba-pl011 device, so that drivers/serial/amba-pl011.c can be used on mxs.

I have problems using this. The problem I found up to now is that during probe of the device (triggered by mxs_add_duart -> amba_device_register -> amba_put_disable_pclk) the uart clock is disabled. This happens because initially its usage count is 0 but the clock is enabled by barebox. clk_enable doesn't hurt, but in the matching clk_disable the usage count drops to zero again and so the clock is disabled in hardware. After that no further outputs can be seen.

I assume the machine dies with a circular exception while trying to write something out (e.g. that it cannot write to the console :-), but I havn't checked that.

My first try to put an clk_enable(&uart_clk) after it is registered didn't help.

Did you face the same problem?

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
author
#12 lore raw

PATCH 1/1 ARM: mxs: Change duart device to use amba-pl011

Hi Uwe,

Quoted 6 lines · Uwe Kleine-K?nig

Hello Shawn,

Quoted 3 lines · Shawn Guo

The mxs duart is actually an amba-pl011 device. This commit changes the duart device code to dynamically allocate amba-pl011 device, so that drivers/serial/amba-pl011.c can be used on mxs.

Quoted 9 lines

I have problems using this. The problem I found up to now is that during probe of the device (triggered by mxs_add_duart -> amba_device_register -> amba_put_disable_pclk) the uart clock is disabled. This happens because initially its usage count is 0 but the clock is enabled by barebox. clk_enable doesn't hurt, but in the matching clk_disable the usage count drops to zero again and so the clock is disabled in hardware. After that no further outputs can be seen.

I did not see this problem. It's true that the clock is turned off in amba_device_register. But later, the clock will be turned on again by amba_probe -> amba_get_enable_pclk very soon.

But we should add something like below in mx28_clocks_init to reflect the clock status and get usecount updated.

clk_enable(&uart_clk)

I ran into similar problem with fec driver, and would cover that in fec patch set.

Quoted 16 lines

I assume the machine dies with a circular exception while trying to write something out (e.g. that it cannot write to the console :-), but I havn't checked that.

My first try to put an clk_enable(&uart_clk) after it is registered didn't help.

Did you face the same problem?

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Signature · 2 lines
Regards,
Shawn
#13 lore raw

PATCH 1/1 ARM: mxs: Change duart device to use amba-pl011

Hello Shawn,

Quoted 14 lines · Shawn Guo
Quoted 4 lines · Uwe Kleine-K?nig
Quoted 3 lines · Shawn Guo

The mxs duart is actually an amba-pl011 device. This commit changes the duart device code to dynamically allocate amba-pl011 device, so that drivers/serial/amba-pl011.c can be used on mxs.

Quoted 9 lines

I have problems using this. The problem I found up to now is that during probe of the device (triggered by mxs_add_duart -> amba_device_register -> amba_put_disable_pclk) the uart clock is disabled. This happens because initially its usage count is 0 but the clock is enabled by barebox. clk_enable doesn't hurt, but in the matching clk_disable the usage count drops to zero again and so the clock is disabled in hardware. After that no further outputs can be seen.

Quoted 3 lines

I did not see this problem. It's true that the clock is turned off in amba_device_register. But later, the clock will be turned on again by amba_probe -> amba_get_enable_pclk very soon.

This is only a problem with DEBUG_LL I guess.

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
#14 lore raw

PATCH 1/1 ARM: mxs: Change duart device to use amba-pl011

In reply to Shawn Guo
Quoted 11 lines · Shawn Guo

I did not see this problem. It's true that the clock is turned off in amba_device_register. But later, the clock will be turned on again by amba_probe -> amba_get_enable_pclk very soon.

But we should add something like below in mx28_clocks_init to reflect the clock status and get usecount updated.

clk_enable(&uart_clk)

I ran into similar problem with fec driver, and would cover that in fec patch set.

This sounds like entirely the wrong approach. Please take some time to understand that there are different clocks which do different things.

The PCLK is the name ARM Ltd give to the APB bus clock. This we name apb_pclk, and we expect platforms to provide it where possible. This name will be looked up for every primecell device on the system.

If you don't provide an apb_pclk, it will find the device specific function clock. This in itself is no bad thing, unless you use the device outside of the AMBA driver (iow, before probe or after remove) and helps identify when you've forgotten to provide an apb_pclk.

author
#15 lore raw

PATCH 1/1 ARM: mxs: Change duart device to use amba-pl011

Hi Russell,

Quoted 16 lines · Russell King - ARM Linux
Quoted 11 lines · Shawn Guo

I did not see this problem. It's true that the clock is turned off in amba_device_register. But later, the clock will be turned on again by amba_probe -> amba_get_enable_pclk very soon.

But we should add something like below in mx28_clocks_init to reflect the clock status and get usecount updated.

clk_enable(&uart_clk)

I ran into similar problem with fec driver, and would cover that in fec patch set.

This sounds like entirely the wrong approach. Please take some time to understand that there are different clocks which do different things.

Quoted 9 lines

The PCLK is the name ARM Ltd give to the APB bus clock. This we name apb_pclk, and we expect platforms to provide it where possible. This name will be looked up for every primecell device on the system.

If you don't provide an apb_pclk, it will find the device specific function clock. This in itself is no bad thing, unless you use the device outside of the AMBA driver (iow, before probe or after remove) and helps identify when you've forgotten to provide an apb_pclk.

I intended to let the amba bus driver get duart clock. But you are right, I should provide an apb_pclk since it actually exists on mxs processors. In case of duart, it is xbus (apbx) clock.

	_REGISTER_CLOCK("duart", "apb_pclk", xbus_clk)

Thanks for the comment.

Signature · 2 lines
Regards,
Shawn
#16 lore raw

PATCH 1/1 ARM: mxs: Change duart device to use amba-pl011

In reply to Uwe Kleine-König
Quoted 10 lines · Uwe Kleine-K?nig

Hello Shawn,

Quoted 3 lines · Shawn Guo

The mxs duart is actually an amba-pl011 device. This commit changes the duart device code to dynamically allocate amba-pl011 device, so that drivers/serial/amba-pl011.c can be used on mxs.

I have problems using this. The problem I found up to now is that during probe of the device (triggered by mxs_add_duart -> amba_device_register -> amba_put_disable_pclk) the uart clock is disabled.

Which uart clock is disabled? The PCLK or the UARTCLK (names as defined in the ARM PL011 TRM).

If the pclk code is disabling the UARTCLK, then add a dummy apb_pclk to your clock lookups, which is what everyone else who can't control the APB PCLK does.

author
#17 lore raw

PATCH v2 1/1 ARM: mxs: Change duart device to use amba-pl011

In reply to Shawn Guo

The mxs duart is actually an amba-pl011 device. This commit changes the duart device code to dynamically allocate amba-pl011 device, so that drivers/serial/amba-pl011.c can be used on mxs.

---
Changes for v2:
- Add #include <asm/irq.h> into amba-duart.c. When cleaning headers includsion in other files, compiler start complaining NO_IRQ not defined, so add the inclusion to fix it.
- Change MXS_AMBA_DEVICE to MXS_AMBA_DUART_DEVICE

 arch/arm/mach-mxs/Kconfig                       |    6 ++-
 arch/arm/mach-mxs/clock-mx23.c                  |    2 +-
 arch/arm/mach-mxs/clock-mx28.c                  |    2 +-
 arch/arm/mach-mxs/devices-mx23.h                |    4 +-
 arch/arm/mach-mxs/devices-mx28.h                |    4 +-
 arch/arm/mach-mxs/devices/Kconfig               |    2 +-
 arch/arm/mach-mxs/devices/Makefile              |    2 +-
 arch/arm/mach-mxs/devices/amba-duart.c          |   40 +++++++++++++++++++
 arch/arm/mach-mxs/devices/platform-duart.c      |   48 -----------------------
 arch/arm/mach-mxs/include/mach/devices-common.h |    9 +---
 10 files changed, 54 insertions(+), 65 deletions(-)
 create mode 100644 arch/arm/mach-mxs/devices/amba-duart.c
 delete mode 100644 arch/arm/mach-mxs/devices/platform-duart.c
arch/arm/mach-mxs/Kconfig +4 -2
index c4ac7b4..0d072e9 100644
@@ -5,17 +5,19 @@ source "arch/arm/mach-mxs/devices/Kconfig"
 config SOC_IMX23
 	bool
 	select CPU_ARM926T
+	select ARM_AMBA
 
 config SOC_IMX28
 	bool
 	select CPU_ARM926T
+	select ARM_AMBA
 
 comment "MXS platforms:"
 
 config MACH_MX23EVK
 	bool "Support MX23EVK Platform"
 	select SOC_IMX23
-	select MXS_HAVE_PLATFORM_DUART
+	select MXS_HAVE_AMBA_DUART
 	default y
 	help
 	  Include support for MX23EVK platform. This includes specific
@@ -24,7 +26,7 @@ config MACH_MX23EVK
 config MACH_MX28EVK
 	bool "Support MX28EVK Platform"
 	select SOC_IMX28
-	select MXS_HAVE_PLATFORM_DUART
+	select MXS_HAVE_AMBA_DUART
 	select MXS_HAVE_PLATFORM_FEC
 	default y
 	help
arch/arm/mach-mxs/clock-mx23.c +1 -1
index 8f5a19a..0f65d15 100644
@@ -437,7 +437,7 @@ _DEFINE_CLOCK(clk32k_clk, XTAL, TIMROT_CLK32K_GATE, &ref_xtal_clk);
 	},
 
 static struct clk_lookup lookups[] = {
-	_REGISTER_CLOCK("mxs-duart.0", NULL, uart_clk)
+	_REGISTER_CLOCK("uart", NULL, uart_clk)
 	_REGISTER_CLOCK("rtc", NULL, rtc_clk)
 	_REGISTER_CLOCK(NULL, "hclk", hbus_clk)
 	_REGISTER_CLOCK(NULL, "xclk", xbus_clk)
arch/arm/mach-mxs/clock-mx28.c +1 -1
index 74e2103..dd6d158 100644
@@ -602,7 +602,7 @@ _DEFINE_CLOCK(fec_clk, ENET, DISABLE, &hbus_clk);
 	},
 
 static struct clk_lookup lookups[] = {
-	_REGISTER_CLOCK("mxs-duart.0", NULL, uart_clk)
+	_REGISTER_CLOCK("uart", NULL, uart_clk)
 	_REGISTER_CLOCK("fec.0", NULL, fec_clk)
 	_REGISTER_CLOCK("rtc", NULL, rtc_clk)
 	_REGISTER_CLOCK("pll2", NULL, pll2_clk)
arch/arm/mach-mxs/devices-mx23.h +2 -2
index d0f49fc..36397ff 100644
@@ -11,6 +11,6 @@
 #include <mach/mx23.h>
 #include <mach/devices-common.h>
 
-extern const struct mxs_duart_data mx23_duart_data __initconst;
+extern struct amba_device mx23_duart_device;
 #define mx23_add_duart() \
-	mxs_add_duart(&mx23_duart_data)
+	mxs_add_duart(&mx23_duart_device)
arch/arm/mach-mxs/devices-mx28.h +2 -2
index 00b736c..e84a7fe 100644
@@ -11,9 +11,9 @@
 #include <mach/mx28.h>
 #include <mach/devices-common.h>
 
-extern const struct mxs_duart_data mx28_duart_data __initconst;
+extern struct amba_device mx28_duart_device;
 #define mx28_add_duart() \
-	mxs_add_duart(&mx28_duart_data)
+	mxs_add_duart(&mx28_duart_device)
 
 extern const struct mxs_fec_data mx28_fec_data[] __initconst;
 #define mx28_add_fec(id, pdata) \
arch/arm/mach-mxs/devices/Kconfig +1 -1
index a35a2dc..3dff25c 100644
@@ -1,4 +1,4 @@
-config MXS_HAVE_PLATFORM_DUART
+config MXS_HAVE_AMBA_DUART
 	bool
 
 config MXS_HAVE_PLATFORM_FEC
arch/arm/mach-mxs/devices/Makefile +1 -1
index 4b5266a..d0a09f6 100644
@@ -1,2 +1,2 @@
-obj-$(CONFIG_MXS_HAVE_PLATFORM_DUART) += platform-duart.o
+obj-$(CONFIG_MXS_HAVE_AMBA_DUART) += amba-duart.o
 obj-$(CONFIG_MXS_HAVE_PLATFORM_FEC) += platform-fec.o
arch/arm/mach-mxs/devices/amba-duart.c new file +40 -0
new file mode 100644
index 0000000..aa77d28
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2009-2010 Pengutronix
+ * Uwe Kleine-Koenig <[email protected]>
+ *
+ * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License version 2 as published by the
+ * Free Software Foundation.
+ */
+#include <asm/irq.h>
+#include <mach/mx23.h>
+#include <mach/mx28.h>
+#include <mach/devices-common.h>
+
+#define MXS_AMBA_DUART_DEVICE(name, soc)			\
+struct amba_device name##_device = {				\
+	.dev = {						\
+		.init_name = "uart",				\
+	},							\
+	.res = {						\
+		.start = soc ## _DUART_BASE_ADDR,		\
+		.end = (soc ## _DUART_BASE_ADDR) + SZ_8K - 1,	\
+		.flags = IORESOURCE_MEM,			\
+	},							\
+	.irq = {soc ## _INT_DUART, NO_IRQ},			\
+}
+
+#ifdef CONFIG_SOC_IMX23
+MXS_AMBA_DUART_DEVICE(mx23_duart, MX23);
+#endif
+
+#ifdef CONFIG_SOC_IMX28
+MXS_AMBA_DUART_DEVICE(mx28_duart, MX28);
+#endif
+
+int __init mxs_add_duart(struct amba_device *dev)
+{
+	return amba_device_register(dev, &iomem_resource);
+}
arch/arm/mach-mxs/devices/platform-duart.c deleted +0 -48

48 lines not on this page · raw message

arch/arm/mach-mxs/include/mach/devices-common.h +2 -7
index 3da48d4..fca0551 100644
@@ -9,6 +9,7 @@
 #include <linux/kernel.h>
 #include <linux/platform_device.h>
 #include <linux/init.h>
+#include <linux/amba/bus.h>
 
 struct platform_device *mxs_add_platform_device_dmamask(
 		const char *name, int id,
@@ -25,13 +26,7 @@ static inline struct platform_device *mxs_add_platform_device(
 }
 
 /* duart */
-struct mxs_duart_data {
-	resource_size_t iobase;
-	resource_size_t iosize;
-	resource_size_t irq;
-};
-struct platform_device *__init mxs_add_duart(
-		const struct mxs_duart_data *data);
+int __init mxs_add_duart(struct amba_device *dev);
 
 /* fec */
 #include <linux/fec.h>
Signature · 1 line
1.7.1
#18 lore raw

PATCH v2 1/1 ARM: mxs: Change duart device to use amba-pl011

Hello Shawn,

just a few thought that came to my mind when reading your patch ...

Quoted 31 lines · Shawn Guo

The mxs duart is actually an amba-pl011 device. This commit changes the duart device code to dynamically allocate amba-pl011 device, so that drivers/serial/amba-pl011.c can be used on mxs.

---
Changes for v2:
- Add #include <asm/irq.h> into amba-duart.c. When cleaning headers includsion in other files, compiler start complaining NO_IRQ not defined, so add the inclusion to fix it.
- Change MXS_AMBA_DEVICE to MXS_AMBA_DUART_DEVICE

 arch/arm/mach-mxs/Kconfig                       |    6 ++-
 arch/arm/mach-mxs/clock-mx23.c                  |    2 +-
 arch/arm/mach-mxs/clock-mx28.c                  |    2 +-
 arch/arm/mach-mxs/devices-mx23.h                |    4 +-
 arch/arm/mach-mxs/devices-mx28.h                |    4 +-
 arch/arm/mach-mxs/devices/Kconfig               |    2 +-
 arch/arm/mach-mxs/devices/Makefile              |    2 +-
 arch/arm/mach-mxs/devices/amba-duart.c          |   40 +++++++++++++++++++
 arch/arm/mach-mxs/devices/platform-duart.c      |   48 -----------------------
 arch/arm/mach-mxs/include/mach/devices-common.h |    9 +---
 10 files changed, 54 insertions(+), 65 deletions(-)
 create mode 100644 arch/arm/mach-mxs/devices/amba-duart.c
 delete mode 100644 arch/arm/mach-mxs/devices/platform-duart.c
arch/arm/mach-mxs/Kconfig +0 -0
index c4ac7b4..0d072e9 100644

arch/arm/mach-mxs/Kconfig source "arch/arm/mach-mxs/devices/Kconfig" · line 13

Quoted 9 lines
arch/arm/mach-mxs/Kconfig +2 -0
@@ -5,17 +5,19 @@ source "arch/arm/mach-mxs/devices/Kconfig"
 config SOC_IMX23
 	bool
 	select CPU_ARM926T
+	select ARM_AMBA
 
 config SOC_IMX28
 	bool
 	select CPU_ARM926T
+	select ARM_AMBA

Maybe let MXS_HAVE_AMBA_DUART let select ARM_AMBA?

Quoted 24 lines
arch/arm/mach-mxs/Kconfig +2 -2
 comment "MXS platforms:"
 
 config MACH_MX23EVK
 	bool "Support MX23EVK Platform"
 	select SOC_IMX23
-	select MXS_HAVE_PLATFORM_DUART
+	select MXS_HAVE_AMBA_DUART
 	default y
 	help
 	  Include support for MX23EVK platform. This includes specific
@@ -24,7 +26,7 @@ config MACH_MX23EVK
 config MACH_MX28EVK
 	bool "Support MX28EVK Platform"
 	select SOC_IMX28
-	select MXS_HAVE_PLATFORM_DUART
+	select MXS_HAVE_AMBA_DUART
 	select MXS_HAVE_PLATFORM_FEC
 	default y
 	help
arch/arm/mach-mxs/clock-mx23.c +0 -0
index 8f5a19a..0f65d15 100644

arch/arm/mach-mxs/clock-mx23.c _DEFINE_CLOCK(clk32k_clk, XTAL, TIMROT_CLK32K_GATE, &ref_xtal_clk); · line 440

Quoted 5 lines
arch/arm/mach-mxs/clock-mx23.c +1 -1
@@ -437,7 +437,7 @@ _DEFINE_CLOCK(clk32k_clk, XTAL, TIMROT_CLK32K_GATE, &ref_xtal_clk);
 	},
 
 static struct clk_lookup lookups[] = {
-	_REGISTER_CLOCK("mxs-duart.0", NULL, uart_clk)
+	_REGISTER_CLOCK("uart", NULL, uart_clk)

hmm, I still don't like that. What do you think about having an alias for uart_clk that is named "duart" or similar?

Quoted 99 lines
arch/arm/mach-mxs/clock-mx23.c +0 -0
 	_REGISTER_CLOCK("rtc", NULL, rtc_clk)
 	_REGISTER_CLOCK(NULL, "hclk", hbus_clk)
 	_REGISTER_CLOCK(NULL, "xclk", xbus_clk)
arch/arm/mach-mxs/clock-mx28.c +1 -1
index 74e2103..dd6d158 100644
@@ -602,7 +602,7 @@ _DEFINE_CLOCK(fec_clk, ENET, DISABLE, &hbus_clk);
 	},
 
 static struct clk_lookup lookups[] = {
-	_REGISTER_CLOCK("mxs-duart.0", NULL, uart_clk)
+	_REGISTER_CLOCK("uart", NULL, uart_clk)
 	_REGISTER_CLOCK("fec.0", NULL, fec_clk)
 	_REGISTER_CLOCK("rtc", NULL, rtc_clk)
 	_REGISTER_CLOCK("pll2", NULL, pll2_clk)
arch/arm/mach-mxs/devices-mx23.h +2 -2
index d0f49fc..36397ff 100644
@@ -11,6 +11,6 @@
 #include <mach/mx23.h>
 #include <mach/devices-common.h>
 
-extern const struct mxs_duart_data mx23_duart_data __initconst;
+extern struct amba_device mx23_duart_device;
 #define mx23_add_duart() \
-	mxs_add_duart(&mx23_duart_data)
+	mxs_add_duart(&mx23_duart_device)
arch/arm/mach-mxs/devices-mx28.h +2 -2
index 00b736c..e84a7fe 100644
@@ -11,9 +11,9 @@
 #include <mach/mx28.h>
 #include <mach/devices-common.h>
 
-extern const struct mxs_duart_data mx28_duart_data __initconst;
+extern struct amba_device mx28_duart_device;
 #define mx28_add_duart() \
-	mxs_add_duart(&mx28_duart_data)
+	mxs_add_duart(&mx28_duart_device)
 
 extern const struct mxs_fec_data mx28_fec_data[] __initconst;
 #define mx28_add_fec(id, pdata) \
arch/arm/mach-mxs/devices/Kconfig +1 -1
index a35a2dc..3dff25c 100644
@@ -1,4 +1,4 @@
-config MXS_HAVE_PLATFORM_DUART
+config MXS_HAVE_AMBA_DUART
 	bool
 
 config MXS_HAVE_PLATFORM_FEC
arch/arm/mach-mxs/devices/Makefile +1 -1
index 4b5266a..d0a09f6 100644
@@ -1,2 +1,2 @@
-obj-$(CONFIG_MXS_HAVE_PLATFORM_DUART) += platform-duart.o
+obj-$(CONFIG_MXS_HAVE_AMBA_DUART) += amba-duart.o
 obj-$(CONFIG_MXS_HAVE_PLATFORM_FEC) += platform-fec.o
arch/arm/mach-mxs/devices/amba-duart.c new file +30 -0
new file mode 100644
index 0000000..aa77d28
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2009-2010 Pengutronix
+ * Uwe Kleine-Koenig <[email protected]>
+ *
+ * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License version 2 as published by the
+ * Free Software Foundation.
+ */
+#include <asm/irq.h>
+#include <mach/mx23.h>
+#include <mach/mx28.h>
+#include <mach/devices-common.h>
+
+#define MXS_AMBA_DUART_DEVICE(name, soc)			\
+struct amba_device name##_device = {				\
+	.dev = {						\
+		.init_name = "uart",				\
+	},							\
+	.res = {						\
+		.start = soc ## _DUART_BASE_ADDR,		\
+		.end = (soc ## _DUART_BASE_ADDR) + SZ_8K - 1,	\
+		.flags = IORESOURCE_MEM,			\
+	},							\
+	.irq = {soc ## _INT_DUART, NO_IRQ},			\
+}
+
+#ifdef CONFIG_SOC_IMX23
+MXS_AMBA_DUART_DEVICE(mx23_duart, MX23);

arch/arm/mach-mxs/devices/amba-duart.c line 40

Quoted 10 lines
arch/arm/mach-mxs/devices/amba-duart.c new file +10 -0
+#endif
+
+#ifdef CONFIG_SOC_IMX28
+MXS_AMBA_DUART_DEVICE(mx28_duart, MX28);
+#endif
+
+int __init mxs_add_duart(struct amba_device *dev)
+{
+	return amba_device_register(dev, &iomem_resource);
+}

This doesn't have the benefits of the construct for platform devices. (i.e. mx23_duart_device isn't marked with __initdata (or __initconst) and so occupies memory even when the kernel runs on an i.MX28.) At least making it __initconst and then do

	struct amba_device *adev = kmalloc(sizeof(*adev));
	*adev = *dev
	return amba_device_register(adev, ...);

(plus some error checking) would be nice. Maybe put that into a wrapper similar to mxs_add_platform_device? I didn't check the size of a struct ambadevice, so I cannot tell if it's worth to create an extra struct to just carry the relevant data.

Best regards
Uwe

Quoted 81 lines
arch/arm/mach-mxs/devices/platform-duart.c deleted +0 -48
deleted file mode 100644
index 2fe0df5..0000000
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2009-2010 Pengutronix
- * Uwe Kleine-Koenig <[email protected]>
- *
- * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License version 2 as published by the
- * Free Software Foundation.
- */
-#include <mach/mx23.h>
-#include <mach/mx28.h>
-#include <mach/devices-common.h>
-
-#define mxs_duart_data_entry(soc)					\
-	{								\
-		.iobase = soc ## _DUART_BASE_ADDR,			\
-		.irq = soc ## _INT_DUART,				\
-	}
-
-#ifdef CONFIG_SOC_IMX23
-const struct mxs_duart_data mx23_duart_data __initconst =
-	mxs_duart_data_entry(MX23);
-#endif
-
-#ifdef CONFIG_SOC_IMX28
-const struct mxs_duart_data mx28_duart_data __initconst =
-	mxs_duart_data_entry(MX28);
-#endif
-
-struct platform_device *__init mxs_add_duart(
-		const struct mxs_duart_data *data)
-{
-	struct resource res[] = {
-		{
-			.start = data->iobase,
-			.end = data->iobase + SZ_8K - 1,
-			.flags = IORESOURCE_MEM,
-		}, {
-			.start = data->irq,
-			.end = data->irq,
-			.flags = IORESOURCE_IRQ,
-		},
-	};
-
-	return mxs_add_platform_device("mxs-duart", 0, res, ARRAY_SIZE(res),
-					NULL, 0);
-}
arch/arm/mach-mxs/include/mach/devices-common.h +2 -7
index 3da48d4..fca0551 100644
@@ -9,6 +9,7 @@
 #include <linux/kernel.h>
 #include <linux/platform_device.h>
 #include <linux/init.h>
+#include <linux/amba/bus.h>
 
 struct platform_device *mxs_add_platform_device_dmamask(
 		const char *name, int id,
@@ -25,13 +26,7 @@ static inline struct platform_device *mxs_add_platform_device(
 }
 
 /* duart */
-struct mxs_duart_data {
-	resource_size_t iobase;
-	resource_size_t iosize;
-	resource_size_t irq;
-};
-struct platform_device *__init mxs_add_duart(
-		const struct mxs_duart_data *data);
+int __init mxs_add_duart(struct amba_device *dev);
 
 /* fec */
 #include <linux/fec.h>
Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
author
#19 lore raw

PATCH v2 1/1 ARM: mxs: Change duart device to use amba-pl011

Hi Uwe,

Quoted 41 lines · Uwe Kleine-K?nig

Hello Shawn,

just a few thought that came to my mind when reading your patch ...

Quoted 36 lines · Shawn Guo

The mxs duart is actually an amba-pl011 device. This commit changes the duart device code to dynamically allocate amba-pl011 device, so that drivers/serial/amba-pl011.c can be used on mxs.

---
Changes for v2:
- Add #include <asm/irq.h> into amba-duart.c. When cleaning headers includsion in other files, compiler start complaining NO_IRQ not defined, so add the inclusion to fix it.
- Change MXS_AMBA_DEVICE to MXS_AMBA_DUART_DEVICE

 arch/arm/mach-mxs/Kconfig                       |    6 ++-
 arch/arm/mach-mxs/clock-mx23.c                  |    2 +-
 arch/arm/mach-mxs/clock-mx28.c                  |    2 +-
 arch/arm/mach-mxs/devices-mx23.h                |    4 +-
 arch/arm/mach-mxs/devices-mx28.h                |    4 +-
 arch/arm/mach-mxs/devices/Kconfig               |    2 +-
 arch/arm/mach-mxs/devices/Makefile              |    2 +-
 arch/arm/mach-mxs/devices/amba-duart.c          |   40 +++++++++++++++++++
 arch/arm/mach-mxs/devices/platform-duart.c      |   48 -----------------------
 arch/arm/mach-mxs/include/mach/devices-common.h |    9 +---
 10 files changed, 54 insertions(+), 65 deletions(-)
 create mode 100644 arch/arm/mach-mxs/devices/amba-duart.c
 delete mode 100644 arch/arm/mach-mxs/devices/platform-duart.c
arch/arm/mach-mxs/Kconfig +1 -0
index c4ac7b4..0d072e9 100644
@@ -5,17 +5,19 @@ source "arch/arm/mach-mxs/devices/Kconfig"
 config SOC_IMX23
      bool
      select CPU_ARM926T
+     select ARM_AMBA
 
Quoted 6 lines

arch/arm/mach-mxs/Kconfig source "arch/arm/mach-mxs/devices/Kconfig" · line 13

Quoted 4 lines
arch/arm/mach-mxs/Kconfig +1 -0
 config SOC_IMX28
      bool
      select CPU_ARM926T
+     select ARM_AMBA

Maybe let MXS_HAVE_AMBA_DUART let select ARM_AMBA?

OK.

Quoted 26 lines
Quoted 26 lines
arch/arm/mach-mxs/Kconfig +2 -2
 comment "MXS platforms:"
 
 config MACH_MX23EVK
      bool "Support MX23EVK Platform"
      select SOC_IMX23
-     select MXS_HAVE_PLATFORM_DUART
+     select MXS_HAVE_AMBA_DUART
      default y
      help
        Include support for MX23EVK platform. This includes specific
@@ -24,7 +26,7 @@ config MACH_MX23EVK
 config MACH_MX28EVK
      bool "Support MX28EVK Platform"
      select SOC_IMX28
-     select MXS_HAVE_PLATFORM_DUART
+     select MXS_HAVE_AMBA_DUART
      select MXS_HAVE_PLATFORM_FEC
      default y
      help
arch/arm/mach-mxs/clock-mx23.c +0 -0
index 8f5a19a..0f65d15 100644
@@ -437,7 +437,7 @@ _DEFINE_CLOCK(clk32k_clk, XTAL, TIMROT_CLK32K_GATE, &ref_xtal_clk);
      },
 
Quoted 6 lines

arch/arm/mach-mxs/clock-mx23.c _DEFINE_CLOCK(clk32k_clk, XTAL, TIMROT_CLK32K_GATE, &ref_xtal_clk); · line 440

Quoted 3 lines
arch/arm/mach-mxs/clock-mx23.c +1 -1
 static struct clk_lookup lookups[] = {
-     _REGISTER_CLOCK("mxs-duart.0", NULL, uart_clk)
+     _REGISTER_CLOCK("uart", NULL, uart_clk)

hmm, I still don't like that. What do you think about having an alias for uart_clk that is named "duart" or similar?

So you are expecting something below, when application uart comes in? I'm okay with it.

_REGISTER_CLOCK("duart", NULL, uart_clk)
_REGISTER_CLOCK("auart", NULL, uart_clk)

Quoted 114 lines
Quoted 99 lines
arch/arm/mach-mxs/clock-mx23.c +0 -0
      _REGISTER_CLOCK("rtc", NULL, rtc_clk)
      _REGISTER_CLOCK(NULL, "hclk", hbus_clk)
      _REGISTER_CLOCK(NULL, "xclk", xbus_clk)
arch/arm/mach-mxs/clock-mx28.c +1 -1
index 74e2103..dd6d158 100644
@@ -602,7 +602,7 @@ _DEFINE_CLOCK(fec_clk, ENET, DISABLE, &hbus_clk);
      },
 
 static struct clk_lookup lookups[] = {
-     _REGISTER_CLOCK("mxs-duart.0", NULL, uart_clk)
+     _REGISTER_CLOCK("uart", NULL, uart_clk)
      _REGISTER_CLOCK("fec.0", NULL, fec_clk)
      _REGISTER_CLOCK("rtc", NULL, rtc_clk)
      _REGISTER_CLOCK("pll2", NULL, pll2_clk)
arch/arm/mach-mxs/devices-mx23.h +2 -2
index d0f49fc..36397ff 100644
@@ -11,6 +11,6 @@
 #include <mach/mx23.h>
 #include <mach/devices-common.h>
 
-extern const struct mxs_duart_data mx23_duart_data __initconst;
+extern struct amba_device mx23_duart_device;
 #define mx23_add_duart() \
-     mxs_add_duart(&mx23_duart_data)
+     mxs_add_duart(&mx23_duart_device)
arch/arm/mach-mxs/devices-mx28.h +2 -2
index 00b736c..e84a7fe 100644
@@ -11,9 +11,9 @@
 #include <mach/mx28.h>
 #include <mach/devices-common.h>
 
-extern const struct mxs_duart_data mx28_duart_data __initconst;
+extern struct amba_device mx28_duart_device;
 #define mx28_add_duart() \
-     mxs_add_duart(&mx28_duart_data)
+     mxs_add_duart(&mx28_duart_device)
 
 extern const struct mxs_fec_data mx28_fec_data[] __initconst;
 #define mx28_add_fec(id, pdata) \
arch/arm/mach-mxs/devices/Kconfig +1 -1
index a35a2dc..3dff25c 100644
@@ -1,4 +1,4 @@
-config MXS_HAVE_PLATFORM_DUART
+config MXS_HAVE_AMBA_DUART
      bool
 
 config MXS_HAVE_PLATFORM_FEC
arch/arm/mach-mxs/devices/Makefile +1 -1
index 4b5266a..d0a09f6 100644
@@ -1,2 +1,2 @@
-obj-$(CONFIG_MXS_HAVE_PLATFORM_DUART) += platform-duart.o
+obj-$(CONFIG_MXS_HAVE_AMBA_DUART) += amba-duart.o
 obj-$(CONFIG_MXS_HAVE_PLATFORM_FEC) += platform-fec.o
arch/arm/mach-mxs/devices/amba-duart.c new file +30 -0
new file mode 100644
index 0000000..aa77d28
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2009-2010 Pengutronix
+ * Uwe Kleine-Koenig <[email protected]>
+ *
+ * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License version 2 as published by the
+ * Free Software Foundation.
+ */
+#include <asm/irq.h>
+#include <mach/mx23.h>
+#include <mach/mx28.h>
+#include <mach/devices-common.h>
+
+#define MXS_AMBA_DUART_DEVICE(name, soc)                     \
+struct amba_device name##_device = {                         \
+     .dev = {                                                \
+             .init_name = "uart",                            \
+     },                                                      \
+     .res = {                                                \
+             .start = soc ## _DUART_BASE_ADDR,               \
+             .end = (soc ## _DUART_BASE_ADDR) + SZ_8K - 1,   \
+             .flags = IORESOURCE_MEM,                        \
+     },                                                      \
+     .irq = {soc ## _INT_DUART, NO_IRQ},                     \
+}
+
+#ifdef CONFIG_SOC_IMX23
+MXS_AMBA_DUART_DEVICE(mx23_duart, MX23);

arch/arm/mach-mxs/devices/amba-duart.c line 40

Quoted 10 lines
arch/arm/mach-mxs/devices/amba-duart.c new file +10 -0
+#endif
+
+#ifdef CONFIG_SOC_IMX28
+MXS_AMBA_DUART_DEVICE(mx28_duart, MX28);
+#endif
+
+int __init mxs_add_duart(struct amba_device *dev)
+{
+     return amba_device_register(dev, &iomem_resource);
+}

This doesn't have the benefits of the construct for platform devices. (i.e. mx23_duart_device isn't marked with __initdata (or __initconst) and so occupies memory even when the kernel runs on an i.MX28.) At least making it __initconst and then do

Quoted 6 lines
        struct amba_device *adev = kmalloc(sizeof(*adev));
        *adev = *dev
        return amba_device_register(adev, ...);

(plus some error checking) would be nice. Maybe put that into a wrapper similar to mxs_add_platform_device? I didn't check the size of a struct

OK. Will address it in v3 coming soon.

Quoted 3 lines

ambadevice, so I cannot tell if it's worth to create an extra struct to just carry the relevant data.

Signature · 2 lines
Regards,
Shawn
author
#20 lore raw

PATCH v3 1/1 ARM: mxs: Change duart device to use amba-pl011

In reply to Shawn Guo

The mxs duart is actually an amba-pl011 device. This commit changes the duart device code to dynamically allocate amba-pl011 device, so that drivers/serial/amba-pl011.c can be used on mxs.

---
Changes for v3:
- Use alias "duart" of uart_clk for duart serial driver
- Add __initconst for duart amba_device
- Let MXS_HAVE_AMBA_DUART select ARM_AMBA

Changes for v2:
- Add #include <asm/irq.h> into amba-duart.c. When cleaning headers includsion in other files, compiler start complaining NO_IRQ not defined, so add the inclusion to fix it.
- Change MXS_AMBA_DEVICE to MXS_AMBA_DUART_DEVICE

 arch/arm/mach-mxs/Kconfig                       |    4 +-
 arch/arm/mach-mxs/clock-mx23.c                  |    2 +-
 arch/arm/mach-mxs/clock-mx28.c                  |    2 +-
 arch/arm/mach-mxs/devices-mx23.h                |    4 +-
 arch/arm/mach-mxs/devices-mx28.h                |    4 +-
 arch/arm/mach-mxs/devices.c                     |   17 +++++++-
 arch/arm/mach-mxs/devices/Kconfig               |    3 +-
 arch/arm/mach-mxs/devices/Makefile              |    2 +-
 arch/arm/mach-mxs/devices/amba-duart.c          |   40 +++++++++++++++++++
 arch/arm/mach-mxs/devices/platform-duart.c      |   48 -----------------------
 arch/arm/mach-mxs/include/mach/devices-common.h |   11 ++---
 11 files changed, 70 insertions(+), 67 deletions(-)
 create mode 100644 arch/arm/mach-mxs/devices/amba-duart.c
 delete mode 100644 arch/arm/mach-mxs/devices/platform-duart.c
arch/arm/mach-mxs/Kconfig +2 -2
index c4ac7b4..8bfc8df 100644
@@ -15,7 +15,7 @@ comment "MXS platforms:"
 config MACH_MX23EVK
 	bool "Support MX23EVK Platform"
 	select SOC_IMX23
-	select MXS_HAVE_PLATFORM_DUART
+	select MXS_HAVE_AMBA_DUART
 	default y
 	help
 	  Include support for MX23EVK platform. This includes specific
@@ -24,7 +24,7 @@ config MACH_MX23EVK
 config MACH_MX28EVK
 	bool "Support MX28EVK Platform"
 	select SOC_IMX28
-	select MXS_HAVE_PLATFORM_DUART
+	select MXS_HAVE_AMBA_DUART
 	select MXS_HAVE_PLATFORM_FEC
 	default y
 	help
arch/arm/mach-mxs/clock-mx23.c +1 -1
index 8f5a19a..d6b6fee 100644
@@ -437,7 +437,7 @@ _DEFINE_CLOCK(clk32k_clk, XTAL, TIMROT_CLK32K_GATE, &ref_xtal_clk);
 	},
 
 static struct clk_lookup lookups[] = {
-	_REGISTER_CLOCK("mxs-duart.0", NULL, uart_clk)
+	_REGISTER_CLOCK("duart", NULL, uart_clk)
 	_REGISTER_CLOCK("rtc", NULL, rtc_clk)
 	_REGISTER_CLOCK(NULL, "hclk", hbus_clk)
 	_REGISTER_CLOCK(NULL, "xclk", xbus_clk)
arch/arm/mach-mxs/clock-mx28.c +1 -1
index 74e2103..9e836e9 100644
@@ -602,7 +602,7 @@ _DEFINE_CLOCK(fec_clk, ENET, DISABLE, &hbus_clk);
 	},
 
 static struct clk_lookup lookups[] = {
-	_REGISTER_CLOCK("mxs-duart.0", NULL, uart_clk)
+	_REGISTER_CLOCK("duart", NULL, uart_clk)
 	_REGISTER_CLOCK("fec.0", NULL, fec_clk)
 	_REGISTER_CLOCK("rtc", NULL, rtc_clk)
 	_REGISTER_CLOCK("pll2", NULL, pll2_clk)
arch/arm/mach-mxs/devices-mx23.h +2 -2
index d0f49fc..1256788 100644
@@ -11,6 +11,6 @@
 #include <mach/mx23.h>
 #include <mach/devices-common.h>
 
-extern const struct mxs_duart_data mx23_duart_data __initconst;
+extern const struct amba_device mx23_duart_device __initconst;
 #define mx23_add_duart() \
-	mxs_add_duart(&mx23_duart_data)
+	mxs_add_duart(&mx23_duart_device)
arch/arm/mach-mxs/devices-mx28.h +2 -2
index 00b736c..33773a6 100644
@@ -11,9 +11,9 @@
 #include <mach/mx28.h>
 #include <mach/devices-common.h>
 
-extern const struct mxs_duart_data mx28_duart_data __initconst;
+extern const struct amba_device mx28_duart_device __initconst;
 #define mx28_add_duart() \
-	mxs_add_duart(&mx28_duart_data)
+	mxs_add_duart(&mx28_duart_device)
 
 extern const struct mxs_fec_data mx28_fec_data[] __initconst;
 #define mx28_add_fec(id, pdata) \
arch/arm/mach-mxs/devices.c +15 -2
index 6b60f02..c20d547 100644
@@ -19,9 +19,8 @@
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/init.h>
-#include <linux/err.h>
 #include <linux/platform_device.h>
-#include <mach/common.h>
+#include <linux/amba/bus.h>
 
 struct platform_device *__init mxs_add_platform_device_dmamask(
 		const char *name, int id,
@@ -73,3 +72,17 @@ err:
 
 	return pdev;
 }
+
+int __init mxs_add_amba_device(const struct amba_device *dev)
+{
+	struct amba_device *adev = kmalloc(sizeof(*adev), GFP_KERNEL);
+
+	if (!adev) {
+		pr_err("%s: failed to allocate memory", __func__);
+		return -ENOMEM;
+	}
+
+	*adev = *dev;
+
+	return amba_device_register(adev, &iomem_resource);
+}
arch/arm/mach-mxs/devices/Kconfig +2 -1
index a35a2dc..cf7dc1a 100644
@@ -1,5 +1,6 @@
-config MXS_HAVE_PLATFORM_DUART
+config MXS_HAVE_AMBA_DUART
 	bool
+	select ARM_AMBA
 
 config MXS_HAVE_PLATFORM_FEC
 	bool
arch/arm/mach-mxs/devices/Makefile +1 -1
index 4b5266a..d0a09f6 100644
@@ -1,2 +1,2 @@
-obj-$(CONFIG_MXS_HAVE_PLATFORM_DUART) += platform-duart.o
+obj-$(CONFIG_MXS_HAVE_AMBA_DUART) += amba-duart.o
 obj-$(CONFIG_MXS_HAVE_PLATFORM_FEC) += platform-fec.o
arch/arm/mach-mxs/devices/amba-duart.c new file +40 -0
new file mode 100644
index 0000000..a559db0
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2009-2010 Pengutronix
+ * Uwe Kleine-Koenig <[email protected]>
+ *
+ * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License version 2 as published by the
+ * Free Software Foundation.
+ */
+#include <asm/irq.h>
+#include <mach/mx23.h>
+#include <mach/mx28.h>
+#include <mach/devices-common.h>
+
+#define MXS_AMBA_DUART_DEVICE(name, soc)			\
+const struct amba_device name##_device __initconst = {		\
+	.dev = {						\
+		.init_name = "duart",				\
+	},							\
+	.res = {						\
+		.start = soc ## _DUART_BASE_ADDR,		\
+		.end = (soc ## _DUART_BASE_ADDR) + SZ_8K - 1,	\
+		.flags = IORESOURCE_MEM,			\
+	},							\
+	.irq = {soc ## _INT_DUART, NO_IRQ},			\
+}
+
+#ifdef CONFIG_SOC_IMX23
+MXS_AMBA_DUART_DEVICE(mx23_duart, MX23);
+#endif
+
+#ifdef CONFIG_SOC_IMX28
+MXS_AMBA_DUART_DEVICE(mx28_duart, MX28);
+#endif
+
+int __init mxs_add_duart(const struct amba_device *dev)
+{
+	return mxs_add_amba_device(dev);
+}
arch/arm/mach-mxs/devices/platform-duart.c deleted +0 -48

48 lines not on this page · raw message

arch/arm/mach-mxs/include/mach/devices-common.h +4 -7
index 3da48d4..6c3d1a1 100644
@@ -9,6 +9,7 @@
 #include <linux/kernel.h>
 #include <linux/platform_device.h>
 #include <linux/init.h>
+#include <linux/amba/bus.h>
 
 struct platform_device *mxs_add_platform_device_dmamask(
 		const char *name, int id,
@@ -24,14 +25,10 @@ static inline struct platform_device *mxs_add_platform_device(
 			name, id, res, num_resources, data, size_data, 0);
 }
 
+int __init mxs_add_amba_device(const struct amba_device *dev);
+
 /* duart */
-struct mxs_duart_data {
-	resource_size_t iobase;
-	resource_size_t iosize;
-	resource_size_t irq;
-};
-struct platform_device *__init mxs_add_duart(
-		const struct mxs_duart_data *data);
+int __init mxs_add_duart(const struct amba_device *dev);
 
 /* fec */
 #include <linux/fec.h>
Signature · 1 line
1.7.1
author
#21 lore raw

PATCH v4 1/1 ARM: mxs: Change duart device to use amba-pl011

In reply to Shawn Guo

The mxs duart is actually an amba-pl011 device. This commit changes the duart device code to dynamically allocate amba-pl011 device, so that drivers/serial/amba-pl011.c can be used on mxs.

---
Changes for v4:
- Register xbus_clk for amba bus driver to get, in form of dev_id="duart" and con_id="apb_pclk"
- Explicitly call clk_enable for some fundamental clocks that have been on, to reflect the clock status and get its and parent's usecount updated.

Changes for v3:
- Use alias "duart" of uart_clk for duart serial driver
- Add __initconst for duart amba_device
- Let MXS_HAVE_AMBA_DUART select ARM_AMBA

Changes for v2:
- Add #include <asm/irq.h> into amba-duart.c. When cleaning headers includsion in other files, compiler start complaining NO_IRQ not defined, so add the inclusion to fix it.
- Change MXS_AMBA_DEVICE to MXS_AMBA_DUART_DEVICE

 arch/arm/mach-mxs/Kconfig                       |    4 +-
 arch/arm/mach-mxs/clock-mx23.c                  |   12 +++++-
 arch/arm/mach-mxs/clock-mx28.c                  |   12 +++++-
 arch/arm/mach-mxs/devices-mx23.h                |    4 +-
 arch/arm/mach-mxs/devices-mx28.h                |    4 +-
 arch/arm/mach-mxs/devices.c                     |   17 +++++++-
 arch/arm/mach-mxs/devices/Kconfig               |    3 +-
 arch/arm/mach-mxs/devices/Makefile              |    2 +-
 arch/arm/mach-mxs/devices/amba-duart.c          |   40 +++++++++++++++++++
 arch/arm/mach-mxs/devices/platform-duart.c      |   48 -----------------------
 arch/arm/mach-mxs/include/mach/devices-common.h |   11 ++---
 11 files changed, 88 insertions(+), 69 deletions(-)
 create mode 100644 arch/arm/mach-mxs/devices/amba-duart.c
 delete mode 100644 arch/arm/mach-mxs/devices/platform-duart.c
arch/arm/mach-mxs/Kconfig +2 -2
index c4ac7b4..8bfc8df 100644
@@ -15,7 +15,7 @@ comment "MXS platforms:"
 config MACH_MX23EVK
 	bool "Support MX23EVK Platform"
 	select SOC_IMX23
-	select MXS_HAVE_PLATFORM_DUART
+	select MXS_HAVE_AMBA_DUART
 	default y
 	help
 	  Include support for MX23EVK platform. This includes specific
@@ -24,7 +24,7 @@ config MACH_MX23EVK
 config MACH_MX28EVK
 	bool "Support MX28EVK Platform"
 	select SOC_IMX28
-	select MXS_HAVE_PLATFORM_DUART
+	select MXS_HAVE_AMBA_DUART
 	select MXS_HAVE_PLATFORM_FEC
 	default y
 	help
arch/arm/mach-mxs/clock-mx23.c +10 -2
index 8f5a19a..136341d 100644
@@ -437,10 +437,12 @@ _DEFINE_CLOCK(clk32k_clk, XTAL, TIMROT_CLK32K_GATE, &ref_xtal_clk);
 	},
 
 static struct clk_lookup lookups[] = {
-	_REGISTER_CLOCK("mxs-duart.0", NULL, uart_clk)
+	/* for amba bus driver */
+	_REGISTER_CLOCK("duart", "apb_pclk", xbus_clk)
+	/* for amba-pl011 driver */
+	_REGISTER_CLOCK("duart", NULL, uart_clk)
 	_REGISTER_CLOCK("rtc", NULL, rtc_clk)
 	_REGISTER_CLOCK(NULL, "hclk", hbus_clk)
-	_REGISTER_CLOCK(NULL, "xclk", xbus_clk)
 	_REGISTER_CLOCK(NULL, "usb", usb_clk)
 	_REGISTER_CLOCK(NULL, "audio", audio_clk)
 	_REGISTER_CLOCK(NULL, "pwm", pwm_clk)
@@ -518,6 +520,12 @@ int __init mx23_clocks_init(void)
 {
 	clk_misc_init();
 
+	clk_enable(&cpu_clk);
+	clk_enable(&hbus_clk);
+	clk_enable(&xbus_clk);
+	clk_enable(&emi_clk);
+	clk_enable(&uart_clk);
+
 	clkdev_add_table(lookups, ARRAY_SIZE(lookups));
 
 	mxs_timer_init(&clk32k_clk, MX23_INT_TIMER0);
arch/arm/mach-mxs/clock-mx28.c +10 -2
index 74e2103..f20b254 100644
@@ -602,12 +602,14 @@ _DEFINE_CLOCK(fec_clk, ENET, DISABLE, &hbus_clk);
 	},
 
 static struct clk_lookup lookups[] = {
-	_REGISTER_CLOCK("mxs-duart.0", NULL, uart_clk)
+	/* for amba bus driver */
+	_REGISTER_CLOCK("duart", "apb_pclk", xbus_clk)
+	/* for amba-pl011 driver */
+	_REGISTER_CLOCK("duart", NULL, uart_clk)
 	_REGISTER_CLOCK("fec.0", NULL, fec_clk)
 	_REGISTER_CLOCK("rtc", NULL, rtc_clk)
 	_REGISTER_CLOCK("pll2", NULL, pll2_clk)
 	_REGISTER_CLOCK(NULL, "hclk", hbus_clk)
-	_REGISTER_CLOCK(NULL, "xclk", xbus_clk)
 	_REGISTER_CLOCK(NULL, "can0", can0_clk)
 	_REGISTER_CLOCK(NULL, "can1", can1_clk)
 	_REGISTER_CLOCK(NULL, "usb0", usb0_clk)
@@ -726,6 +728,12 @@ int __init mx28_clocks_init(void)
 {
 	clk_misc_init();
 
+	clk_enable(&cpu_clk);
+	clk_enable(&hbus_clk);
+	clk_enable(&xbus_clk);
+	clk_enable(&emi_clk);
+	clk_enable(&uart_clk);
+
 	clkdev_add_table(lookups, ARRAY_SIZE(lookups));
 
 	mxs_timer_init(&clk32k_clk, MX28_INT_TIMER0);
arch/arm/mach-mxs/devices-mx23.h +2 -2
index d0f49fc..1256788 100644
@@ -11,6 +11,6 @@
 #include <mach/mx23.h>
 #include <mach/devices-common.h>
 
-extern const struct mxs_duart_data mx23_duart_data __initconst;
+extern const struct amba_device mx23_duart_device __initconst;
 #define mx23_add_duart() \
-	mxs_add_duart(&mx23_duart_data)
+	mxs_add_duart(&mx23_duart_device)
arch/arm/mach-mxs/devices-mx28.h +2 -2
index 00b736c..33773a6 100644
@@ -11,9 +11,9 @@
 #include <mach/mx28.h>
 #include <mach/devices-common.h>
 
-extern const struct mxs_duart_data mx28_duart_data __initconst;
+extern const struct amba_device mx28_duart_device __initconst;
 #define mx28_add_duart() \
-	mxs_add_duart(&mx28_duart_data)
+	mxs_add_duart(&mx28_duart_device)
 
 extern const struct mxs_fec_data mx28_fec_data[] __initconst;
 #define mx28_add_fec(id, pdata) \
arch/arm/mach-mxs/devices.c +15 -2
index 6b60f02..c20d547 100644
@@ -19,9 +19,8 @@
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/init.h>
-#include <linux/err.h>
 #include <linux/platform_device.h>
-#include <mach/common.h>
+#include <linux/amba/bus.h>
 
 struct platform_device *__init mxs_add_platform_device_dmamask(
 		const char *name, int id,
@@ -73,3 +72,17 @@ err:
 
 	return pdev;
 }
+
+int __init mxs_add_amba_device(const struct amba_device *dev)
+{
+	struct amba_device *adev = kmalloc(sizeof(*adev), GFP_KERNEL);
+
+	if (!adev) {
+		pr_err("%s: failed to allocate memory", __func__);
+		return -ENOMEM;
+	}
+
+	*adev = *dev;
+
+	return amba_device_register(adev, &iomem_resource);
+}
arch/arm/mach-mxs/devices/Kconfig +2 -1
index a35a2dc..cf7dc1a 100644
@@ -1,5 +1,6 @@
-config MXS_HAVE_PLATFORM_DUART
+config MXS_HAVE_AMBA_DUART
 	bool
+	select ARM_AMBA
 
 config MXS_HAVE_PLATFORM_FEC
 	bool
arch/arm/mach-mxs/devices/Makefile +1 -1
index 4b5266a..d0a09f6 100644
@@ -1,2 +1,2 @@
-obj-$(CONFIG_MXS_HAVE_PLATFORM_DUART) += platform-duart.o
+obj-$(CONFIG_MXS_HAVE_AMBA_DUART) += amba-duart.o
 obj-$(CONFIG_MXS_HAVE_PLATFORM_FEC) += platform-fec.o
arch/arm/mach-mxs/devices/amba-duart.c new file +40 -0
new file mode 100644
index 0000000..a559db0
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2009-2010 Pengutronix
+ * Uwe Kleine-Koenig <[email protected]>
+ *
+ * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License version 2 as published by the
+ * Free Software Foundation.
+ */
+#include <asm/irq.h>
+#include <mach/mx23.h>
+#include <mach/mx28.h>
+#include <mach/devices-common.h>
+
+#define MXS_AMBA_DUART_DEVICE(name, soc)			\
+const struct amba_device name##_device __initconst = {		\
+	.dev = {						\
+		.init_name = "duart",				\
+	},							\
+	.res = {						\
+		.start = soc ## _DUART_BASE_ADDR,		\
+		.end = (soc ## _DUART_BASE_ADDR) + SZ_8K - 1,	\
+		.flags = IORESOURCE_MEM,			\
+	},							\
+	.irq = {soc ## _INT_DUART, NO_IRQ},			\
+}
+
+#ifdef CONFIG_SOC_IMX23
+MXS_AMBA_DUART_DEVICE(mx23_duart, MX23);
+#endif
+
+#ifdef CONFIG_SOC_IMX28
+MXS_AMBA_DUART_DEVICE(mx28_duart, MX28);
+#endif
+
+int __init mxs_add_duart(const struct amba_device *dev)
+{
+	return mxs_add_amba_device(dev);
+}
arch/arm/mach-mxs/devices/platform-duart.c deleted +0 -48

48 lines not on this page · raw message

arch/arm/mach-mxs/include/mach/devices-common.h +4 -7
index 3da48d4..6c3d1a1 100644
@@ -9,6 +9,7 @@
 #include <linux/kernel.h>
 #include <linux/platform_device.h>
 #include <linux/init.h>
+#include <linux/amba/bus.h>
 
 struct platform_device *mxs_add_platform_device_dmamask(
 		const char *name, int id,
@@ -24,14 +25,10 @@ static inline struct platform_device *mxs_add_platform_device(
 			name, id, res, num_resources, data, size_data, 0);
 }
 
+int __init mxs_add_amba_device(const struct amba_device *dev);
+
 /* duart */
-struct mxs_duart_data {
-	resource_size_t iobase;
-	resource_size_t iosize;
-	resource_size_t irq;
-};
-struct platform_device *__init mxs_add_duart(
-		const struct mxs_duart_data *data);
+int __init mxs_add_duart(const struct amba_device *dev);
 
 /* fec */
 #include <linux/fec.h>
Signature · 1 line
1.7.1
#22 lore raw

PATCH v4 1/1 ARM: mxs: Change duart device to use amba-pl011

Quoted 5 lines · Shawn Guo

The mxs duart is actually an amba-pl011 device. This commit changes the duart device code to dynamically allocate amba-pl011 device, so that drivers/serial/amba-pl011.c can be used on mxs.

Signature · 9 lines
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20110110/ea3d0e4f/attachment-0001.sig>