Patchwork [U-Boot,v3,1/7] mx23: Fix pad voltage selection bit

login
register
mail settings
Submitter Fabio Estevam
Date May 2, 2013, 10:44 p.m.
Message ID <1367534661-13502-2-git-send-email-festevam@gmail.com>
Download mbox | patch
Permalink /patch/241110/
State Superseded
Headers show

Comments

Fabio Estevam - May 2, 2013, 10:44 p.m.
From: Fabio Estevam <fabio.estevam@freescale.com>

On mx23 the pad voltage selection bit needs to be always '0', since '1' is a 
reserved value.

For example:

Pin 108, EMI_A06 pin voltage selection:
0= 1.8V (mDDR) or 2.5V (DDR1);
1= reserved.

Fix the pad voltage definitions for the mx23 case.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
Changes since v2:
- Only place PAD_3V3 inside the if/else block
Changes since v1:
- Newly introduced

 arch/arm/include/asm/arch-mxs/iomux.h |    4 ++++
 1 file changed, 4 insertions(+)
Marek Vasut - May 3, 2013, 2:24 a.m.
Dear Fabio Estevam,

> From: Fabio Estevam <fabio.estevam@freescale.com>
> 
> On mx23 the pad voltage selection bit needs to be always '0', since '1' is
> a reserved value.
> 
> For example:
> 
> Pin 108, EMI_A06 pin voltage selection:
> 0= 1.8V (mDDR) or 2.5V (DDR1);
> 1= reserved.
> 
> Fix the pad voltage definitions for the mx23 case.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>

Acked-by: Marek Vasut <marex@denx.de>

but then, should we not just undefine this PAD_3V3 for MX23 altogether so noone 
is tempted to use it?

> ---
> Changes since v2:
> - Only place PAD_3V3 inside the if/else block
> Changes since v1:
> - Newly introduced
> 
>  arch/arm/include/asm/arch-mxs/iomux.h |    4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/arm/include/asm/arch-mxs/iomux.h
> b/arch/arm/include/asm/arch-mxs/iomux.h index 4288715..f46895e 100644
> --- a/arch/arm/include/asm/arch-mxs/iomux.h
> +++ b/arch/arm/include/asm/arch-mxs/iomux.h
> @@ -71,7 +71,11 @@ typedef u32 iomux_cfg_t;
>  #define PAD_16MA		3
> 
>  #define PAD_1V8			0
> +#if defined CONFIG_MX28
>  #define PAD_3V3			1
> +#else
> +#define PAD_3V3			0
> +#endif
> 
>  #define PAD_NOPULL		0
>  #define PAD_PULLUP		1

Best regards,
Marek Vasut
Otavio Salvador - May 3, 2013, 2:33 a.m.
On Thu, May 2, 2013 at 11:24 PM, Marek Vasut <marex@denx.de> wrote:
> Dear Fabio Estevam,
>
>> From: Fabio Estevam <fabio.estevam@freescale.com>
>>
>> On mx23 the pad voltage selection bit needs to be always '0', since '1' is
>> a reserved value.
>>
>> For example:
>>
>> Pin 108, EMI_A06 pin voltage selection:
>> 0= 1.8V (mDDR) or 2.5V (DDR1);
>> 1= reserved.
>>
>> Fix the pad voltage definitions for the mx23 case.
>>
>> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
>
> Acked-by: Marek Vasut <marex@denx.de>
>
> but then, should we not just undefine this PAD_3V3 for MX23 altogether so noone
> is tempted to use it?

I think for code readability it'd be good to have it in place. It
makes it more obvious for people looking at code.

--
Otavio Salvador                             O.S. Systems
E-mail: otavio@ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br
Marek Vasut - May 3, 2013, 2:34 a.m.
Dear Otavio Salvador,

> On Thu, May 2, 2013 at 11:24 PM, Marek Vasut <marex@denx.de> wrote:
> > Dear Fabio Estevam,
> > 
> >> From: Fabio Estevam <fabio.estevam@freescale.com>
> >> 
> >> On mx23 the pad voltage selection bit needs to be always '0', since '1'
> >> is a reserved value.
> >> 
> >> For example:
> >> 
> >> Pin 108, EMI_A06 pin voltage selection:
> >> 0= 1.8V (mDDR) or 2.5V (DDR1);
> >> 1= reserved.
> >> 
> >> Fix the pad voltage definitions for the mx23 case.
> >> 
> >> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> > 
> > Acked-by: Marek Vasut <marex@denx.de>
> > 
> > but then, should we not just undefine this PAD_3V3 for MX23 altogether so
> > noone is tempted to use it?
> 
> I think for code readability it'd be good to have it in place. It
> makes it more obvious for people looking at code.

I can already see the people wondering why that piece has no effect ...

Best regards,
Marek Vasut
Fabio Estevam - May 3, 2013, 2:34 a.m.
On Thu, May 2, 2013 at 11:24 PM, Marek Vasut <marex@denx.de> wrote:

> Acked-by: Marek Vasut <marex@denx.de>
>
> but then, should we not just undefine this PAD_3V3 for MX23 altogether so noone
> is tempted to use it?

No, the EMI pins need to pass MXS_PAD_3V3 to tell the iomux driver
that the voltage select value is 0.

If we don't do that then it will remain on its reset value, which is
1, and marked as invalid in the reference manual.

Patch

diff --git a/arch/arm/include/asm/arch-mxs/iomux.h b/arch/arm/include/asm/arch-mxs/iomux.h
index 4288715..f46895e 100644
--- a/arch/arm/include/asm/arch-mxs/iomux.h
+++ b/arch/arm/include/asm/arch-mxs/iomux.h
@@ -71,7 +71,11 @@  typedef u32 iomux_cfg_t;
 #define PAD_16MA		3
 
 #define PAD_1V8			0
+#if defined CONFIG_MX28
 #define PAD_3V3			1
+#else
+#define PAD_3V3			0
+#endif
 
 #define PAD_NOPULL		0
 #define PAD_PULLUP		1