Patchwork [U-Boot,v2,2/3] MX5: Add iomux structure

login
register
mail settings
Submitter Fabio Estevam
Date May 16, 2011, 10:29 p.m.
Message ID <1305584991-13040-2-git-send-email-fabio.estevam@freescale.com>
Download mbox | patch
Permalink /patch/95841/
State Changes Requested
Headers show

Comments

Fabio Estevam - May 16, 2011, 10:29 p.m.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
Changes since v1:
- iomuxc was accessed directly in v1, so create a iomux struct
so that we can use io accessors

 arch/arm/include/asm/arch-mx5/imx-regs.h |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
Jason Liu - May 17, 2011, 4:55 a.m.
Hi, Fabio,

2011/5/17 Fabio Estevam <fabio.estevam@freescale.com>:
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
> Changes since v1:
> - iomuxc was accessed directly in v1, so create a iomux struct
> so that we can use io accessors
>
>  arch/arm/include/asm/arch-mx5/imx-regs.h |   11 +++++++++++
>  1 files changed, 11 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/include/asm/arch-mx5/imx-regs.h b/arch/arm/include/asm/arch-mx5/imx-regs.h
> index d80e0c0..eb690ec 100644
> --- a/arch/arm/include/asm/arch-mx5/imx-regs.h
> +++ b/arch/arm/include/asm/arch-mx5/imx-regs.h
> @@ -273,6 +273,17 @@ struct weim {
>        u32     ear;
>  };
>
> +struct iomuxc {
> +       u32     gpr0;
> +       u32     gpr1;
> +       u32     gpr2;
> +       u32     omux0;
> +       u32     omux1;
> +       u32     omux2;
> +       u32     omux3;
> +       u32     omux4;
> +};

I think iomux register does not limited to the above registers and you
defined some unused register
such as IOMUXC_OBSERVE_MUX_0, if you only use gpr, you can just define
iomuxc_gpr etc.

And what's more, mx51 and mx53 has different layout, on i.mx51, the layout is:

IOMUXC_GPR0,
IOMUXC_GPR1,
IOMUXC_OBSERVE_MUX_0,
IOMUXC_OBSERVE_MUX_1,
IOMUXC_OBSERVE_MUX_2,
IOMUXC_OBSERVE_MUX_3,

so, you can't simply put it to the common head file for all the i.mx5 soc.

> +
>  /* GPIO Registers */
>  struct gpio_regs {
>        u32     gpio_dr;
> --
> 1.6.0.4
>
>
> _______________________________________________
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
Stefano Babic - May 17, 2011, 12:53 p.m.
On 05/17/2011 12:29 AM, Fabio Estevam wrote:

Hi Fabio,

> +struct iomuxc {
> +	u32	gpr0;
> +	u32	gpr1;
> +	u32	gpr2;
> +	u32	omux0;
> +	u32	omux1;
> +	u32	omux2;
> +	u32	omux3;
> +	u32	omux4;
> +};

It seems to me that the MX51 and the MX53 have a different layout, and
we cannot define the structure in this way. The MX51 have only two
General Purpose registers, and the address of IOMUX_OBSERVE_MUX_0
overlaps gpr2 on the MX53.

Best regards,
Stefano Babic

Patch

diff --git a/arch/arm/include/asm/arch-mx5/imx-regs.h b/arch/arm/include/asm/arch-mx5/imx-regs.h
index d80e0c0..eb690ec 100644
--- a/arch/arm/include/asm/arch-mx5/imx-regs.h
+++ b/arch/arm/include/asm/arch-mx5/imx-regs.h
@@ -273,6 +273,17 @@  struct weim {
 	u32	ear;
 };
 
+struct iomuxc {
+	u32	gpr0;
+	u32	gpr1;
+	u32	gpr2;
+	u32	omux0;
+	u32	omux1;
+	u32	omux2;
+	u32	omux3;
+	u32	omux4;
+};
+
 /* GPIO Registers */
 struct gpio_regs {
 	u32	gpio_dr;