mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] i.MX: iomuxv3: restore NO_PAD_CTRL semantic
@ 2018-06-10  7:04 Alexander Kurz
  2018-06-11  6:48 ` Sascha Hauer
  0 siblings, 1 reply; 4+ messages in thread
From: Alexander Kurz @ 2018-06-10  7:04 UTC (permalink / raw)
  To: barebox, Sascha Hauer; +Cc: Andrey Smirnov, Alexander Kurz

A NO_PAD_CTRL flag used to keep a pad configuration untouched.
With commit 094820a63bfd ("i.MX: iomuxv3: Use helper functions in iomux-v3.h")
the NO_PAD_CTRL semantic changed to set a pad configurations to zero, which
breaks non-DT boards, where NO_PAD_CTRL is freqently used to keep a boot-up
default pad configuration, which often is non zero.

Restore the old semantic, dont write PAD_CTRL when NO_PAD_CTRL is set.

Signed-off-by: Alexander Kurz <akurz@blala.de>
---
 arch/arm/mach-imx/include/mach/iomux-v3.h | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-imx/include/mach/iomux-v3.h b/arch/arm/mach-imx/include/mach/iomux-v3.h
index 994c15c04..d1a72a2cf 100644
--- a/arch/arm/mach-imx/include/mach/iomux-v3.h
+++ b/arch/arm/mach-imx/include/mach/iomux-v3.h
@@ -159,14 +159,16 @@ static inline void iomux_v3_setup_pad(void __iomem *iomux, unsigned int flags,
 
 static inline void imx_setup_pad(void __iomem *iomux, iomux_v3_cfg_t pad)
 {
-	uint32_t pad_ctrl;
+	uint32_t conf_reg, pad_ctrl;
 
+	/* dont write PAD_CTRL when NO_PAD_CTRL is set */
 	pad_ctrl = IOMUX_PAD_CTRL(pad);
-	pad_ctrl = (pad_ctrl & NO_PAD_CTRL) ? 0 : pad_ctrl,
+	conf_reg = IOMUX_PAD_CTRL_OFS(pad);
+	conf_reg = (pad_ctrl & NO_PAD_CTRL) ? 0 : conf_reg,
 
 	iomux_v3_setup_pad(iomux, 0,
 			   IOMUX_CTRL_OFS(pad),
-			   IOMUX_PAD_CTRL_OFS(pad),
+			   conf_reg,
 			   IOMUX_SEL_INPUT_OFS(pad),
 			   IOMUX_MODE(pad),
 			   pad_ctrl,
-- 
2.11.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] i.MX: iomuxv3: restore NO_PAD_CTRL semantic
  2018-06-10  7:04 [PATCH] i.MX: iomuxv3: restore NO_PAD_CTRL semantic Alexander Kurz
@ 2018-06-11  6:48 ` Sascha Hauer
  2018-07-11  4:48   ` Alexander Kurz
  0 siblings, 1 reply; 4+ messages in thread
From: Sascha Hauer @ 2018-06-11  6:48 UTC (permalink / raw)
  To: Alexander Kurz; +Cc: Andrey Smirnov, barebox

On Sun, Jun 10, 2018 at 07:04:08AM +0000, Alexander Kurz wrote:
> A NO_PAD_CTRL flag used to keep a pad configuration untouched.
> With commit 094820a63bfd ("i.MX: iomuxv3: Use helper functions in iomux-v3.h")
> the NO_PAD_CTRL semantic changed to set a pad configurations to zero, which
> breaks non-DT boards, where NO_PAD_CTRL is freqently used to keep a boot-up
> default pad configuration, which often is non zero.
> 
> Restore the old semantic, dont write PAD_CTRL when NO_PAD_CTRL is set.
> 
> Signed-off-by: Alexander Kurz <akurz@blala.de>
> ---
>  arch/arm/mach-imx/include/mach/iomux-v3.h | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)

Applied, thanks

Sascha

> 
> diff --git a/arch/arm/mach-imx/include/mach/iomux-v3.h b/arch/arm/mach-imx/include/mach/iomux-v3.h
> index 994c15c04..d1a72a2cf 100644
> --- a/arch/arm/mach-imx/include/mach/iomux-v3.h
> +++ b/arch/arm/mach-imx/include/mach/iomux-v3.h
> @@ -159,14 +159,16 @@ static inline void iomux_v3_setup_pad(void __iomem *iomux, unsigned int flags,
>  
>  static inline void imx_setup_pad(void __iomem *iomux, iomux_v3_cfg_t pad)
>  {
> -	uint32_t pad_ctrl;
> +	uint32_t conf_reg, pad_ctrl;
>  
> +	/* dont write PAD_CTRL when NO_PAD_CTRL is set */
>  	pad_ctrl = IOMUX_PAD_CTRL(pad);
> -	pad_ctrl = (pad_ctrl & NO_PAD_CTRL) ? 0 : pad_ctrl,
> +	conf_reg = IOMUX_PAD_CTRL_OFS(pad);
> +	conf_reg = (pad_ctrl & NO_PAD_CTRL) ? 0 : conf_reg,
>  
>  	iomux_v3_setup_pad(iomux, 0,
>  			   IOMUX_CTRL_OFS(pad),
> -			   IOMUX_PAD_CTRL_OFS(pad),
> +			   conf_reg,
>  			   IOMUX_SEL_INPUT_OFS(pad),
>  			   IOMUX_MODE(pad),
>  			   pad_ctrl,
> -- 
> 2.11.0
> 
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] i.MX: iomuxv3: restore NO_PAD_CTRL semantic
  2018-06-11  6:48 ` Sascha Hauer
@ 2018-07-11  4:48   ` Alexander Kurz
  2018-07-13  6:23     ` Sascha Hauer
  0 siblings, 1 reply; 4+ messages in thread
From: Alexander Kurz @ 2018-07-11  4:48 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

Hi Sascha,
I have sent this fix last month, but the problem is still present in
v2018.07 and next. Did this patch get lost somehow, should I re-send it?
There is also a patch "DTS ARM: i.MX50: resolve warning" that I also miss 
in next.
Thanks, Alexander

> On Sun, Jun 10, 2018 at 07:04:08AM +0000, Alexander Kurz wrote:
> > A NO_PAD_CTRL flag used to keep a pad configuration untouched.
> > With commit 094820a63bfd ("i.MX: iomuxv3: Use helper functions in iomux-v3.h")
> > the NO_PAD_CTRL semantic changed to set a pad configurations to zero, which
> > breaks non-DT boards, where NO_PAD_CTRL is freqently used to keep a boot-up
> > default pad configuration, which often is non zero.
> > 
> > Restore the old semantic, dont write PAD_CTRL when NO_PAD_CTRL is set.
> > 
> > Signed-off-by: Alexander Kurz <akurz@blala.de>
> > ---
> >  arch/arm/mach-imx/include/mach/iomux-v3.h | 8 +++++---
> >  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> Applied, thanks
> 
> Sascha
> 
> > 
> > diff --git a/arch/arm/mach-imx/include/mach/iomux-v3.h b/arch/arm/mach-imx/include/mach/iomux-v3.h
> > index 994c15c04..d1a72a2cf 100644
> > --- a/arch/arm/mach-imx/include/mach/iomux-v3.h
> > +++ b/arch/arm/mach-imx/include/mach/iomux-v3.h
> > @@ -159,14 +159,16 @@ static inline void iomux_v3_setup_pad(void __iomem *iomux, unsigned int flags,
> >  
> >  static inline void imx_setup_pad(void __iomem *iomux, iomux_v3_cfg_t pad)
> >  {
> > -	uint32_t pad_ctrl;
> > +	uint32_t conf_reg, pad_ctrl;
> >  
> > +	/* dont write PAD_CTRL when NO_PAD_CTRL is set */
> >  	pad_ctrl = IOMUX_PAD_CTRL(pad);
> > -	pad_ctrl = (pad_ctrl & NO_PAD_CTRL) ? 0 : pad_ctrl,
> > +	conf_reg = IOMUX_PAD_CTRL_OFS(pad);
> > +	conf_reg = (pad_ctrl & NO_PAD_CTRL) ? 0 : conf_reg,
> >  
> >  	iomux_v3_setup_pad(iomux, 0,
> >  			   IOMUX_CTRL_OFS(pad),
> > -			   IOMUX_PAD_CTRL_OFS(pad),
> > +			   conf_reg,
> >  			   IOMUX_SEL_INPUT_OFS(pad),
> >  			   IOMUX_MODE(pad),
> >  			   pad_ctrl,
> > -- 
> > 2.11.0
> > 
> > 
> 
> -- 
> Pengutronix e.K.                           |                             |
> Industrial Linux Solutions                 | http://www.pengutronix.de/  |
> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
> 

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] i.MX: iomuxv3: restore NO_PAD_CTRL semantic
  2018-07-11  4:48   ` Alexander Kurz
@ 2018-07-13  6:23     ` Sascha Hauer
  0 siblings, 0 replies; 4+ messages in thread
From: Sascha Hauer @ 2018-07-13  6:23 UTC (permalink / raw)
  To: Alexander Kurz; +Cc: barebox

On Wed, Jul 11, 2018 at 04:48:28AM +0000, Alexander Kurz wrote:
> Hi Sascha,
> I have sent this fix last month, but the problem is still present in
> v2018.07 and next. Did this patch get lost somehow, should I re-send it?
> There is also a patch "DTS ARM: i.MX50: resolve warning" that I also miss 
> in next.
> Thanks, Alexander

You're the second one to say that I have lost a patch, and you are also
right. Something must have gone wrong. Applied now.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-07-13  6:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-10  7:04 [PATCH] i.MX: iomuxv3: restore NO_PAD_CTRL semantic Alexander Kurz
2018-06-11  6:48 ` Sascha Hauer
2018-07-11  4:48   ` Alexander Kurz
2018-07-13  6:23     ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox