All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v1 0/2] imx6ull: Fix missing initial output from UART
@ 2019-07-15 14:19 Igor Opaniuk
  2019-07-15 14:19 ` [U-Boot] [PATCH v1 1/2] pinctrl: nxp: mx6: DM_FLAG_PRE_RELOC by default Igor Opaniuk
  2019-07-15 14:19 ` [U-Boot] [PATCH v1 2/2] ARM: dts: imx6ull-colibri: pre-reloc for uart pinmux modes Igor Opaniuk
  0 siblings, 2 replies; 9+ messages in thread
From: Igor Opaniuk @ 2019-07-15 14:19 UTC (permalink / raw)
  To: u-boot

For Colibri iMX6ULL we have to set pinmux for uart configuration ASAP
(ideally before relocation) to get serial console working. Without this
we miss almost the half of output (U-boot version, CPU defails,
Reset cause, DRAM details etc.).

To achieve this we need to force pinctrl-mx6 to get probed before
relocation and add u-boot,dm-pre-reloc properties to uart pinmux
configuration nodes. Setting pinmux configuration for UART before was done
in board_early_init_f().

Fixes: cd69e8ef9b ("colibri-imx6ull: migrate pinctrl and regulators to dtb/dm")

Igor Opaniuk (2):
  pinctrl: nxp: mx6: DM_FLAG_PRE_RELOC by default
  ARM: dts: imx6ull-colibri: pre-reloc for uart pinmux modes

 arch/arm/dts/imx6ull-colibri.dts   | 2 ++
 drivers/pinctrl/nxp/pinctrl-imx6.c | 2 --
 2 files changed, 2 insertions(+), 2 deletions(-)

-- 
2.17.1

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

* [U-Boot] [PATCH v1 1/2] pinctrl: nxp: mx6: DM_FLAG_PRE_RELOC by default
  2019-07-15 14:19 [U-Boot] [PATCH v1 0/2] imx6ull: Fix missing initial output from UART Igor Opaniuk
@ 2019-07-15 14:19 ` Igor Opaniuk
  2019-07-15 19:10   ` Fabio Estevam
  2019-07-15 14:19 ` [U-Boot] [PATCH v1 2/2] ARM: dts: imx6ull-colibri: pre-reloc for uart pinmux modes Igor Opaniuk
  1 sibling, 1 reply; 9+ messages in thread
From: Igor Opaniuk @ 2019-07-15 14:19 UTC (permalink / raw)
  To: u-boot

From: Igor Opaniuk <igor.opaniuk@toradex.com>

For Colibri iMX6ULL we have to set pinmux configuration ASAP (ideally
before relocation) to get serial console working. Without this we miss
almost the half of output (U-boot version, CPU defails, Reset cause,
DRAM details etc.).

To achieve this we need to force pinctrl-mx6 to get probed before
relocation. Setting pinmux configuration for UART before was done
in board_early_init_f().

Fixes: cd69e8ef9b ("colibri-imx6ull: migrate pinctrl and regulators to dtb/dm")
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
---

 drivers/pinctrl/nxp/pinctrl-imx6.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/pinctrl/nxp/pinctrl-imx6.c b/drivers/pinctrl/nxp/pinctrl-imx6.c
index 0c1e7a9c05..aafa3057ad 100644
--- a/drivers/pinctrl/nxp/pinctrl-imx6.c
+++ b/drivers/pinctrl/nxp/pinctrl-imx6.c
@@ -49,7 +49,5 @@ U_BOOT_DRIVER(imx6_pinctrl) = {
 	.remove = imx_pinctrl_remove,
 	.priv_auto_alloc_size = sizeof(struct imx_pinctrl_priv),
 	.ops = &imx_pinctrl_ops,
-#if !CONFIG_IS_ENABLED(OF_CONTROL)
 	.flags = DM_FLAG_PRE_RELOC,
-#endif
 };
-- 
2.17.1

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

* [U-Boot] [PATCH v1 2/2] ARM: dts: imx6ull-colibri: pre-reloc for uart pinmux modes
  2019-07-15 14:19 [U-Boot] [PATCH v1 0/2] imx6ull: Fix missing initial output from UART Igor Opaniuk
  2019-07-15 14:19 ` [U-Boot] [PATCH v1 1/2] pinctrl: nxp: mx6: DM_FLAG_PRE_RELOC by default Igor Opaniuk
@ 2019-07-15 14:19 ` Igor Opaniuk
  2019-07-15 21:31   ` Fabio Estevam
  1 sibling, 1 reply; 9+ messages in thread
From: Igor Opaniuk @ 2019-07-15 14:19 UTC (permalink / raw)
  To: u-boot

From: Igor Opaniuk <igor.opaniuk@toradex.com>

Add u-boot,dm-pre-reloc property for uart pinmux configuration
nodes, which enables UART as early as possible (before relocation).

Without this we miss almost the half of output (U-boot version,
CPU defails, Reset cause, DRAM details etc.).

Fixes: cd69e8ef9b ("colibri-imx6ull: migrate pinctrl and regulators to dtb/dm")
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
---

 arch/arm/dts/imx6ull-colibri.dts | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/dts/imx6ull-colibri.dts b/arch/arm/dts/imx6ull-colibri.dts
index 6c847ab792..8cc67a1fa7 100644
--- a/arch/arm/dts/imx6ull-colibri.dts
+++ b/arch/arm/dts/imx6ull-colibri.dts
@@ -458,6 +458,7 @@
 	};
 
 	pinctrl_uart1: uart1-grp {
+		u-boot,dm-pre-reloc;
 		fsl,pins = <
 			MX6UL_PAD_UART1_TX_DATA__UART1_DTE_RX	0x1b0b1
 			MX6UL_PAD_UART1_RX_DATA__UART1_DTE_TX	0x1b0b1
@@ -467,6 +468,7 @@
 	};
 
 	pinctrl_uart1_ctrl1: uart1-ctrl1-grp { /* Additional DTR, DCD */
+		u-boot,dm-pre-reloc;
 		fsl,pins = <
 			MX6UL_PAD_JTAG_TDI__GPIO1_IO13		0x1b0b1 /* DCD */
 			MX6UL_PAD_LCD_DATA18__GPIO3_IO23	0x1b0b1 /* DSR */
-- 
2.17.1

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

* [U-Boot] [PATCH v1 1/2] pinctrl: nxp: mx6: DM_FLAG_PRE_RELOC by default
  2019-07-15 14:19 ` [U-Boot] [PATCH v1 1/2] pinctrl: nxp: mx6: DM_FLAG_PRE_RELOC by default Igor Opaniuk
@ 2019-07-15 19:10   ` Fabio Estevam
  2019-07-16 12:44     ` Igor Opaniuk
  0 siblings, 1 reply; 9+ messages in thread
From: Fabio Estevam @ 2019-07-15 19:10 UTC (permalink / raw)
  To: u-boot

Hi Igor,

On Mon, Jul 15, 2019 at 11:20 AM Igor Opaniuk <igor.opaniuk@gmail.com> wrote:
>
> From: Igor Opaniuk <igor.opaniuk@toradex.com>
>
> For Colibri iMX6ULL we have to set pinmux configuration ASAP (ideally
> before relocation) to get serial console working. Without this we miss
> almost the half of output (U-boot version, CPU defails, Reset cause,
> DRAM details etc.).
>
> To achieve this we need to force pinctrl-mx6 to get probed before
> relocation. Setting pinmux configuration for UART before was done
> in board_early_init_f().
>
> Fixes: cd69e8ef9b ("colibri-imx6ull: migrate pinctrl and regulators to dtb/dm")
> Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
> ---
>
>  drivers/pinctrl/nxp/pinctrl-imx6.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/drivers/pinctrl/nxp/pinctrl-imx6.c b/drivers/pinctrl/nxp/pinctrl-imx6.c
> index 0c1e7a9c05..aafa3057ad 100644
> --- a/drivers/pinctrl/nxp/pinctrl-imx6.c
> +++ b/drivers/pinctrl/nxp/pinctrl-imx6.c
> @@ -49,7 +49,5 @@ U_BOOT_DRIVER(imx6_pinctrl) = {
>         .remove = imx_pinctrl_remove,
>         .priv_auto_alloc_size = sizeof(struct imx_pinctrl_priv),
>         .ops = &imx_pinctrl_ops,
> -#if !CONFIG_IS_ENABLED(OF_CONTROL)
>         .flags = DM_FLAG_PRE_RELOC,
> -#endif

It seems that this is not i.MX6 specific (maybe not even i.MX
specific. I noticed this issue on i.MX7 too).

Could this be handled in the drivers/pinctrl core instead?

Just wanted to see if we can get a more generic solution for this issue.

Thanks

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

* [U-Boot] [PATCH v1 2/2] ARM: dts: imx6ull-colibri: pre-reloc for uart pinmux modes
  2019-07-15 14:19 ` [U-Boot] [PATCH v1 2/2] ARM: dts: imx6ull-colibri: pre-reloc for uart pinmux modes Igor Opaniuk
@ 2019-07-15 21:31   ` Fabio Estevam
  2019-07-16 10:10     ` Igor Opaniuk
  0 siblings, 1 reply; 9+ messages in thread
From: Fabio Estevam @ 2019-07-15 21:31 UTC (permalink / raw)
  To: u-boot

Hi Igor,

On Mon, Jul 15, 2019 at 11:19 AM Igor Opaniuk <igor.opaniuk@gmail.com> wrote:

> diff --git a/arch/arm/dts/imx6ull-colibri.dts b/arch/arm/dts/imx6ull-colibri.dts
> index 6c847ab792..8cc67a1fa7 100644
> --- a/arch/arm/dts/imx6ull-colibri.dts
> +++ b/arch/arm/dts/imx6ull-colibri.dts
> @@ -458,6 +458,7 @@
>         };
>
>         pinctrl_uart1: uart1-grp {
> +               u-boot,dm-pre-reloc;

Shouldn't this U-Boot specific property go to
arch/arm/dts/imx6ull-colibri-uboot.dtsi instead?

This way you could keep arch/arm/dts/imx6ull-colibri.dts in sync with Linux.

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

* [U-Boot] [PATCH v1 2/2] ARM: dts: imx6ull-colibri: pre-reloc for uart pinmux modes
  2019-07-15 21:31   ` Fabio Estevam
@ 2019-07-16 10:10     ` Igor Opaniuk
  0 siblings, 0 replies; 9+ messages in thread
From: Igor Opaniuk @ 2019-07-16 10:10 UTC (permalink / raw)
  To: u-boot

Hi Fabio,

On Tue, Jul 16, 2019 at 12:31 AM Fabio Estevam <festevam@gmail.com> wrote:
>
> Hi Igor,
>
> On Mon, Jul 15, 2019 at 11:19 AM Igor Opaniuk <igor.opaniuk@gmail.com> wrote:
>
> > diff --git a/arch/arm/dts/imx6ull-colibri.dts b/arch/arm/dts/imx6ull-colibri.dts
> > index 6c847ab792..8cc67a1fa7 100644
> > --- a/arch/arm/dts/imx6ull-colibri.dts
> > +++ b/arch/arm/dts/imx6ull-colibri.dts
> > @@ -458,6 +458,7 @@
> >         };
> >
> >         pinctrl_uart1: uart1-grp {
> > +               u-boot,dm-pre-reloc;
>
> Shouldn't this U-Boot specific property go to
> arch/arm/dts/imx6ull-colibri-uboot.dtsi instead?
>
> This way you could keep arch/arm/dts/imx6ull-colibri.dts in sync with Linux.

Thanks for the suggestion, will do in v2.

-- 
Best regards - Freundliche Grüsse - Meilleures salutations

Igor Opaniuk

mailto: igor.opaniuk at gmail.com
skype: igor.opanyuk
+380 (93) 836 40 67
http://ua.linkedin.com/in/iopaniuk

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

* [U-Boot] [PATCH v1 1/2] pinctrl: nxp: mx6: DM_FLAG_PRE_RELOC by default
  2019-07-15 19:10   ` Fabio Estevam
@ 2019-07-16 12:44     ` Igor Opaniuk
  2019-07-24 13:58       ` Igor Opaniuk
  0 siblings, 1 reply; 9+ messages in thread
From: Igor Opaniuk @ 2019-07-16 12:44 UTC (permalink / raw)
  To: u-boot

Hi Fabio,

On Mon, Jul 15, 2019 at 10:10 PM Fabio Estevam <festevam@gmail.com> wrote:
>
> Hi Igor,
>
> On Mon, Jul 15, 2019 at 11:20 AM Igor Opaniuk <igor.opaniuk@gmail.com> wrote:
> >
> > From: Igor Opaniuk <igor.opaniuk@toradex.com>
> >
> > For Colibri iMX6ULL we have to set pinmux configuration ASAP (ideally
> > before relocation) to get serial console working. Without this we miss
> > almost the half of output (U-boot version, CPU defails, Reset cause,
> > DRAM details etc.).
> >
> > To achieve this we need to force pinctrl-mx6 to get probed before
> > relocation. Setting pinmux configuration for UART before was done
> > in board_early_init_f().
> >
> > Fixes: cd69e8ef9b ("colibri-imx6ull: migrate pinctrl and regulators to dtb/dm")
> > Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
> > ---
> >
> >  drivers/pinctrl/nxp/pinctrl-imx6.c | 2 --
> >  1 file changed, 2 deletions(-)
> >
> > diff --git a/drivers/pinctrl/nxp/pinctrl-imx6.c b/drivers/pinctrl/nxp/pinctrl-imx6.c
> > index 0c1e7a9c05..aafa3057ad 100644
> > --- a/drivers/pinctrl/nxp/pinctrl-imx6.c
> > +++ b/drivers/pinctrl/nxp/pinctrl-imx6.c
> > @@ -49,7 +49,5 @@ U_BOOT_DRIVER(imx6_pinctrl) = {
> >         .remove = imx_pinctrl_remove,
> >         .priv_auto_alloc_size = sizeof(struct imx_pinctrl_priv),
> >         .ops = &imx_pinctrl_ops,
> > -#if !CONFIG_IS_ENABLED(OF_CONTROL)
> >         .flags = DM_FLAG_PRE_RELOC,
> > -#endif
>
> It seems that this is not i.MX6 specific (maybe not even i.MX
> specific. I noticed this issue on i.MX7 too).

Right. Currently there are no any output issues on
Colibri iMX7 because board_early_init_f() does apply initial
pinmux configuration for uart [1].

>
> Could this be handled in the drivers/pinctrl core instead?
>
> Just wanted to see if we can get a more generic solution for this issue.
>
> Thanks

AFAIK, DM_FLAG_PRE_RELOC flag can be set for a driver,
not for the whole uclass (but I might be mistaken). Also taking
into account memory limitations (small malloc pool etc) before
U-boot is relocated, I would force driver to be bounded only
in the cases when it's really vital (like this particular case
with serial console issue).

Thanks!

[1] board/toradex/colibri_imx7/colibri_imx7.c

--
Best regards - Freundliche Grüsse - Meilleures salutations

Igor Opaniuk

mailto: igor.opaniuk at gmail.com
skype: igor.opanyuk
+380 (93) 836 40 67
http://ua.linkedin.com/in/iopaniuk

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

* [U-Boot] [PATCH v1 1/2] pinctrl: nxp: mx6: DM_FLAG_PRE_RELOC by default
  2019-07-16 12:44     ` Igor Opaniuk
@ 2019-07-24 13:58       ` Igor Opaniuk
  2019-07-24 14:06         ` Fabio Estevam
  0 siblings, 1 reply; 9+ messages in thread
From: Igor Opaniuk @ 2019-07-24 13:58 UTC (permalink / raw)
  To: u-boot

Hi Fabio,

On Tue, Jul 16, 2019 at 3:44 PM Igor Opaniuk <igor.opaniuk@gmail.com> wrote:
>
> Hi Fabio,
>
> On Mon, Jul 15, 2019 at 10:10 PM Fabio Estevam <festevam@gmail.com> wrote:
> >
> > Hi Igor,
> >
> > On Mon, Jul 15, 2019 at 11:20 AM Igor Opaniuk <igor.opaniuk@gmail.com> wrote:
> > >
> > > From: Igor Opaniuk <igor.opaniuk@toradex.com>
> > >
> > > For Colibri iMX6ULL we have to set pinmux configuration ASAP (ideally
> > > before relocation) to get serial console working. Without this we miss
> > > almost the half of output (U-boot version, CPU defails, Reset cause,
> > > DRAM details etc.).
> > >
> > > To achieve this we need to force pinctrl-mx6 to get probed before
> > > relocation. Setting pinmux configuration for UART before was done
> > > in board_early_init_f().
> > >
> > > Fixes: cd69e8ef9b ("colibri-imx6ull: migrate pinctrl and regulators to dtb/dm")
> > > Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
> > > ---
> > >
> > >  drivers/pinctrl/nxp/pinctrl-imx6.c | 2 --
> > >  1 file changed, 2 deletions(-)
> > >
> > > diff --git a/drivers/pinctrl/nxp/pinctrl-imx6.c b/drivers/pinctrl/nxp/pinctrl-imx6.c
> > > index 0c1e7a9c05..aafa3057ad 100644
> > > --- a/drivers/pinctrl/nxp/pinctrl-imx6.c
> > > +++ b/drivers/pinctrl/nxp/pinctrl-imx6.c
> > > @@ -49,7 +49,5 @@ U_BOOT_DRIVER(imx6_pinctrl) = {
> > >         .remove = imx_pinctrl_remove,
> > >         .priv_auto_alloc_size = sizeof(struct imx_pinctrl_priv),
> > >         .ops = &imx_pinctrl_ops,
> > > -#if !CONFIG_IS_ENABLED(OF_CONTROL)
> > >         .flags = DM_FLAG_PRE_RELOC,
> > > -#endif
> >
> > It seems that this is not i.MX6 specific (maybe not even i.MX
> > specific. I noticed this issue on i.MX7 too).
>
> Right. Currently there are no any output issues on
> Colibri iMX7 because board_early_init_f() does apply initial
> pinmux configuration for uart [1].
>
> >
> > Could this be handled in the drivers/pinctrl core instead?
> >
> > Just wanted to see if we can get a more generic solution for this issue.
> >
> > Thanks
>
> AFAIK, DM_FLAG_PRE_RELOC flag can be set for a driver,
> not for the whole uclass (but I might be mistaken). Also taking
> into account memory limitations (small malloc pool etc) before
> U-boot is relocated, I would force driver to be bounded only
> in the cases when it's really vital (like this particular case
> with serial console issue).
I'm currently in the middle of preparing v2, just wanted to know if you do agree
with this point and in general have any additional suggestions regarding this?

>
> Thanks!
>
> [1] board/toradex/colibri_imx7/colibri_imx7.c
>
> --
> Best regards - Freundliche Grüsse - Meilleures salutations
>
> Igor Opaniuk
>
> mailto: igor.opaniuk at gmail.com
> skype: igor.opanyuk
> +380 (93) 836 40 67
> http://ua.linkedin.com/in/iopaniuk

Thanks

-- 
Best regards - Freundliche Grüsse - Meilleures salutations

Senior Development Engineer,
Igor Opaniuk

Toradex AG
Altsagenstrasse 5 | 6048 Horw/Luzern | Switzerland | T: +41 41 500 48
00 (main line)

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

* [U-Boot] [PATCH v1 1/2] pinctrl: nxp: mx6: DM_FLAG_PRE_RELOC by default
  2019-07-24 13:58       ` Igor Opaniuk
@ 2019-07-24 14:06         ` Fabio Estevam
  0 siblings, 0 replies; 9+ messages in thread
From: Fabio Estevam @ 2019-07-24 14:06 UTC (permalink / raw)
  To: u-boot

Hi Igor,

On Wed, Jul 24, 2019 at 10:58 AM Igor Opaniuk <igor.opaniuk@toradex.com> wrote:

> I'm currently in the middle of preparing v2, just wanted to know if you do agree
> with this point and in general have any additional suggestions regarding this?

My only suggestion is to do a single patch that touches all the
drivers/pinctrl/nxp/ drivers, not ony the mx6 one.

Thanks

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

end of thread, other threads:[~2019-07-24 14:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-15 14:19 [U-Boot] [PATCH v1 0/2] imx6ull: Fix missing initial output from UART Igor Opaniuk
2019-07-15 14:19 ` [U-Boot] [PATCH v1 1/2] pinctrl: nxp: mx6: DM_FLAG_PRE_RELOC by default Igor Opaniuk
2019-07-15 19:10   ` Fabio Estevam
2019-07-16 12:44     ` Igor Opaniuk
2019-07-24 13:58       ` Igor Opaniuk
2019-07-24 14:06         ` Fabio Estevam
2019-07-15 14:19 ` [U-Boot] [PATCH v1 2/2] ARM: dts: imx6ull-colibri: pre-reloc for uart pinmux modes Igor Opaniuk
2019-07-15 21:31   ` Fabio Estevam
2019-07-16 10:10     ` Igor Opaniuk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.