All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/3] arm: xea: Regression fixes for i.MX28 based XEA board
@ 2020-12-26  0:08 Lukasz Majewski
  2020-12-26  0:09 ` [PATCH v1 1/3] xea: spl: Disable pull UP for GPIO0_2{35} Lukasz Majewski
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Lukasz Majewski @ 2020-12-26  0:08 UTC (permalink / raw)
  To: u-boot

This patch set provides boot regression fix and some enhancements for
i.MX28 based XEA board.

The most notably one is the disablement of CONFIG_SPL_OF_PLATDATA_PARENT
which prevents from having the board bricked.


Lukasz Majewski (3):
  xea: spl: Disable pull UP for GPIO0_2{35}
  xea: config: Use CONFIG_PREBOOT from Kconfig
  xea: config: Disable CONFIG_SPL_OF_PLATDATA_PARENT on XEA (imx28)

 board/liebherr/xea/spl_xea.c | 2 +-
 configs/imx28_xea_defconfig  | 3 +++
 include/configs/xea.h        | 1 -
 3 files changed, 4 insertions(+), 2 deletions(-)

-- 
2.20.1

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

* [PATCH v1 1/3] xea: spl: Disable pull UP for GPIO0_2{35}
  2020-12-26  0:08 [PATCH v1 0/3] arm: xea: Regression fixes for i.MX28 based XEA board Lukasz Majewski
@ 2020-12-26  0:09 ` Lukasz Majewski
  2021-01-08 15:58   ` Tom Rini
  2020-12-26  0:09 ` [PATCH v1 2/3] xea: config: Use CONFIG_PREBOOT from Kconfig Lukasz Majewski
  2020-12-26  0:09 ` [PATCH v1 3/3] xea: config: Disable CONFIG_SPL_OF_PLATDATA_PARENT on XEA (imx28) Lukasz Majewski
  2 siblings, 1 reply; 9+ messages in thread
From: Lukasz Majewski @ 2020-12-26  0:09 UTC (permalink / raw)
  To: u-boot

On the imx287 pin GPMI_WRN (GPIO0_25) no PullUP is available that can be
enabled.

To get the same behavior for both boot select pins (i.e. GPIO0_2{35})
disable pull UPs on both.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
---

 board/liebherr/xea/spl_xea.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/board/liebherr/xea/spl_xea.c b/board/liebherr/xea/spl_xea.c
index d88b75bb3a..192f68fca5 100644
--- a/board/liebherr/xea/spl_xea.c
+++ b/board/liebherr/xea/spl_xea.c
@@ -20,7 +20,7 @@
 #include <asm/arch/sys_proto.h>
 
 #define	MUX_CONFIG_LCD	(MXS_PAD_3V3 | MXS_PAD_4MA | MXS_PAD_NOPULL)
-#define	MUX_CONFIG_BOOT	(MXS_PAD_3V3 | MXS_PAD_PULLUP)
+#define	MUX_CONFIG_BOOT	(MXS_PAD_3V3)
 #define	MUX_CONFIG_TSC	(MXS_PAD_3V3 | MXS_PAD_8MA | MXS_PAD_PULLUP)
 #define	MUX_CONFIG_SSP0	(MXS_PAD_3V3 | MXS_PAD_12MA | MXS_PAD_PULLUP)
 #define	MUX_CONFIG_SSP2	(MXS_PAD_3V3 | MXS_PAD_4MA | MXS_PAD_PULLUP)
-- 
2.20.1

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

* [PATCH v1 2/3] xea: config: Use CONFIG_PREBOOT from Kconfig
  2020-12-26  0:08 [PATCH v1 0/3] arm: xea: Regression fixes for i.MX28 based XEA board Lukasz Majewski
  2020-12-26  0:09 ` [PATCH v1 1/3] xea: spl: Disable pull UP for GPIO0_2{35} Lukasz Majewski
@ 2020-12-26  0:09 ` Lukasz Majewski
  2021-01-08 15:58   ` Tom Rini
  2021-01-08 15:58   ` Tom Rini
  2020-12-26  0:09 ` [PATCH v1 3/3] xea: config: Disable CONFIG_SPL_OF_PLATDATA_PARENT on XEA (imx28) Lukasz Majewski
  2 siblings, 2 replies; 9+ messages in thread
From: Lukasz Majewski @ 2020-12-26  0:09 UTC (permalink / raw)
  To: u-boot

The usage of the preboot feature is now controlled via a separate Kconfig
option - namely CONFIG_USE_PREBOOT.
It must be enabled for preboot code executing commands now defined in
CONFIG_PREBOOT (also moved to the Kconfig).

After defining both CONFIG_USE_PREBOOT and CONFIG_PREBOOT in
imx28_xea_defconfig the define of CONFIG_PREBOOT shall be removed from
xea.h as it is redundant.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
---

 configs/imx28_xea_defconfig | 2 ++
 include/configs/xea.h       | 1 -
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/configs/imx28_xea_defconfig b/configs/imx28_xea_defconfig
index dc42e30a1f..e418d8c9e9 100644
--- a/configs/imx28_xea_defconfig
+++ b/configs/imx28_xea_defconfig
@@ -25,6 +25,8 @@ CONFIG_FIT=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyAMA0,115200n8"
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="run prebootcmd"
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SPL_BOARD_INIT=y
 # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
diff --git a/include/configs/xea.h b/include/configs/xea.h
index df058193d6..1207f75017 100644
--- a/include/configs/xea.h
+++ b/include/configs/xea.h
@@ -47,7 +47,6 @@
 #define CONFIG_SYS_LOAD_ADDR	CONFIG_LOADADDR
 
 /* Extra Environment */
-#define CONFIG_PREBOOT		"run prebootcmd"
 #define CONFIG_HOSTNAME		"xea"
 
 #define CONFIG_EXTRA_ENV_SETTINGS					\
-- 
2.20.1

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

* [PATCH v1 3/3] xea: config: Disable CONFIG_SPL_OF_PLATDATA_PARENT on XEA (imx28)
  2020-12-26  0:08 [PATCH v1 0/3] arm: xea: Regression fixes for i.MX28 based XEA board Lukasz Majewski
  2020-12-26  0:09 ` [PATCH v1 1/3] xea: spl: Disable pull UP for GPIO0_2{35} Lukasz Majewski
  2020-12-26  0:09 ` [PATCH v1 2/3] xea: config: Use CONFIG_PREBOOT from Kconfig Lukasz Majewski
@ 2020-12-26  0:09 ` Lukasz Majewski
  2020-12-29  3:32   ` Simon Glass
  2021-01-08 15:58   ` Tom Rini
  2 siblings, 2 replies; 9+ messages in thread
From: Lukasz Majewski @ 2020-12-26  0:09 UTC (permalink / raw)
  To: u-boot

On the XEA board (imx28) one needs in the SPL support for GPIO, MMC and
SPI. Two last ones are necessary for booting the device. The GPIO support
allows deciding which medium will be used. For example the GPIO DTS node
(gpio at 0 at imx28.dtsi) has pinctrl parent (pinctrl at 80018000) for which we
don't need driver asigned for correct operation.
In the spl/dts/dt-platdata.c the gpio at 0 has index 4 and its parent -
pinctrl at 80018000 has index 5.

In the bind_drivers_pass() function (at drivers/core/lists.c) call to
device_bind_by_name() for `fsl_imx23_pinctrl` returns -2, which is
expected.

With current setup - when the SPL_OF_PLATDATA_PARENT=y
The gpio at 0 node with index 4 is skipped as its parent with 5 is not yet
bound. It cannot be as we don't need and provide the driver for it.
As a result the gpio at 0 is never bound and we end up with bricked board in
the SPL stage.

When CONFIG_SPL_OF_PLATDATA_PARENT is NOT set, all entries from
spl/dts/dt-platdata.c are scanned in ascending index order, so gpio at 0 is
properly initialized. For `fsl_imx_pinctrl` we simply check 10 times if
the driver for is available (which is not) and exit.

As a result the GPIOs are initialized and can be used in early SPL stage.
This commit fixes XEA regression introduced with e41651fffda7da55f6.

Signed-off-by: Lukasz Majewski <lukma@denx.de>

---

 configs/imx28_xea_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/imx28_xea_defconfig b/configs/imx28_xea_defconfig
index e418d8c9e9..2e1d060024 100644
--- a/configs/imx28_xea_defconfig
+++ b/configs/imx28_xea_defconfig
@@ -65,6 +65,7 @@ CONFIG_OF_CONTROL=y
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent interrupts"
 CONFIG_SPL_OF_PLATDATA=y
+# CONFIG_SPL_OF_PLATDATA_PARENT is not set
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_USE_ENV_SPI_BUS=y
-- 
2.20.1

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

* [PATCH v1 3/3] xea: config: Disable CONFIG_SPL_OF_PLATDATA_PARENT on XEA (imx28)
  2020-12-26  0:09 ` [PATCH v1 3/3] xea: config: Disable CONFIG_SPL_OF_PLATDATA_PARENT on XEA (imx28) Lukasz Majewski
@ 2020-12-29  3:32   ` Simon Glass
  2021-01-08 15:58   ` Tom Rini
  1 sibling, 0 replies; 9+ messages in thread
From: Simon Glass @ 2020-12-29  3:32 UTC (permalink / raw)
  To: u-boot

Hi Lukasz,

On Fri, 25 Dec 2020 at 17:09, Lukasz Majewski <lukma@denx.de> wrote:
>
> On the XEA board (imx28) one needs in the SPL support for GPIO, MMC and
> SPI. Two last ones are necessary for booting the device. The GPIO support
> allows deciding which medium will be used. For example the GPIO DTS node
> (gpio at 0 at imx28.dtsi) has pinctrl parent (pinctrl at 80018000) for which we
> don't need driver asigned for correct operation.
> In the spl/dts/dt-platdata.c the gpio at 0 has index 4 and its parent -
> pinctrl at 80018000 has index 5.
>
> In the bind_drivers_pass() function (at drivers/core/lists.c) call to
> device_bind_by_name() for `fsl_imx23_pinctrl` returns -2, which is
> expected.
>
> With current setup - when the SPL_OF_PLATDATA_PARENT=y
> The gpio at 0 node with index 4 is skipped as its parent with 5 is not yet
> bound. It cannot be as we don't need and provide the driver for it.
> As a result the gpio at 0 is never bound and we end up with bricked board in
> the SPL stage.
>
> When CONFIG_SPL_OF_PLATDATA_PARENT is NOT set, all entries from
> spl/dts/dt-platdata.c are scanned in ascending index order, so gpio at 0 is
> properly initialized. For `fsl_imx_pinctrl` we simply check 10 times if
> the driver for is available (which is not) and exit.
>
> As a result the GPIOs are initialized and can be used in early SPL stage.
> This commit fixes XEA regression introduced with e41651fffda7da55f6.
>
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
>
> ---
>
>  configs/imx28_xea_defconfig | 1 +
>  1 file changed, 1 insertion(+)

Would it not be better to provide the parent driver?

With the new of-platdata I don't think this is going to work.

Anyway, to fix for this release:

Reviewed-by: Simon Glass <sjg@chromium.org>

Regards,
Simon

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

* [PATCH v1 1/3] xea: spl: Disable pull UP for GPIO0_2{35}
  2020-12-26  0:09 ` [PATCH v1 1/3] xea: spl: Disable pull UP for GPIO0_2{35} Lukasz Majewski
@ 2021-01-08 15:58   ` Tom Rini
  0 siblings, 0 replies; 9+ messages in thread
From: Tom Rini @ 2021-01-08 15:58 UTC (permalink / raw)
  To: u-boot

On Sat, Dec 26, 2020 at 01:09:00AM +0100, Lukasz Majewski wrote:

> On the imx287 pin GPMI_WRN (GPIO0_25) no PullUP is available that can be
> enabled.
> 
> To get the same behavior for both boot select pins (i.e. GPIO0_2{35})
> disable pull UPs on both.
> 
> Signed-off-by: Lukasz Majewski <lukma@denx.de>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210108/fa6068f7/attachment.sig>

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

* [PATCH v1 2/3] xea: config: Use CONFIG_PREBOOT from Kconfig
  2020-12-26  0:09 ` [PATCH v1 2/3] xea: config: Use CONFIG_PREBOOT from Kconfig Lukasz Majewski
@ 2021-01-08 15:58   ` Tom Rini
  2021-01-08 15:58   ` Tom Rini
  1 sibling, 0 replies; 9+ messages in thread
From: Tom Rini @ 2021-01-08 15:58 UTC (permalink / raw)
  To: u-boot

On Sat, Dec 26, 2020 at 01:09:01AM +0100, Lukasz Majewski wrote:

> The usage of the preboot feature is now controlled via a separate Kconfig
> option - namely CONFIG_USE_PREBOOT.
> It must be enabled for preboot code executing commands now defined in
> CONFIG_PREBOOT (also moved to the Kconfig).
> 
> After defining both CONFIG_USE_PREBOOT and CONFIG_PREBOOT in
> imx28_xea_defconfig the define of CONFIG_PREBOOT shall be removed from
> xea.h as it is redundant.
> 
> Signed-off-by: Lukasz Majewski <lukma@denx.de>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210108/cad5b4c4/attachment.sig>

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

* [PATCH v1 2/3] xea: config: Use CONFIG_PREBOOT from Kconfig
  2020-12-26  0:09 ` [PATCH v1 2/3] xea: config: Use CONFIG_PREBOOT from Kconfig Lukasz Majewski
  2021-01-08 15:58   ` Tom Rini
@ 2021-01-08 15:58   ` Tom Rini
  1 sibling, 0 replies; 9+ messages in thread
From: Tom Rini @ 2021-01-08 15:58 UTC (permalink / raw)
  To: u-boot

On Sat, Dec 26, 2020 at 01:09:01AM +0100, Lukasz Majewski wrote:

> The usage of the preboot feature is now controlled via a separate Kconfig
> option - namely CONFIG_USE_PREBOOT.
> It must be enabled for preboot code executing commands now defined in
> CONFIG_PREBOOT (also moved to the Kconfig).
> 
> After defining both CONFIG_USE_PREBOOT and CONFIG_PREBOOT in
> imx28_xea_defconfig the define of CONFIG_PREBOOT shall be removed from
> xea.h as it is redundant.
> 
> Signed-off-by: Lukasz Majewski <lukma@denx.de>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210108/70f6a684/attachment.sig>

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

* [PATCH v1 3/3] xea: config: Disable CONFIG_SPL_OF_PLATDATA_PARENT on XEA (imx28)
  2020-12-26  0:09 ` [PATCH v1 3/3] xea: config: Disable CONFIG_SPL_OF_PLATDATA_PARENT on XEA (imx28) Lukasz Majewski
  2020-12-29  3:32   ` Simon Glass
@ 2021-01-08 15:58   ` Tom Rini
  1 sibling, 0 replies; 9+ messages in thread
From: Tom Rini @ 2021-01-08 15:58 UTC (permalink / raw)
  To: u-boot

On Sat, Dec 26, 2020 at 01:09:02AM +0100, Lukasz Majewski wrote:

> On the XEA board (imx28) one needs in the SPL support for GPIO, MMC and
> SPI. Two last ones are necessary for booting the device. The GPIO support
> allows deciding which medium will be used. For example the GPIO DTS node
> (gpio at 0 at imx28.dtsi) has pinctrl parent (pinctrl at 80018000) for which we
> don't need driver asigned for correct operation.
> In the spl/dts/dt-platdata.c the gpio at 0 has index 4 and its parent -
> pinctrl at 80018000 has index 5.
> 
> In the bind_drivers_pass() function (at drivers/core/lists.c) call to
> device_bind_by_name() for `fsl_imx23_pinctrl` returns -2, which is
> expected.
> 
> With current setup - when the SPL_OF_PLATDATA_PARENT=y
> The gpio at 0 node with index 4 is skipped as its parent with 5 is not yet
> bound. It cannot be as we don't need and provide the driver for it.
> As a result the gpio at 0 is never bound and we end up with bricked board in
> the SPL stage.
> 
> When CONFIG_SPL_OF_PLATDATA_PARENT is NOT set, all entries from
> spl/dts/dt-platdata.c are scanned in ascending index order, so gpio at 0 is
> properly initialized. For `fsl_imx_pinctrl` we simply check 10 times if
> the driver for is available (which is not) and exit.
> 
> As a result the GPIOs are initialized and can be used in early SPL stage.
> This commit fixes XEA regression introduced with e41651fffda7da55f6.
> 
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
> 

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210108/4cbfd48f/attachment.sig>

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

end of thread, other threads:[~2021-01-08 15:58 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-26  0:08 [PATCH v1 0/3] arm: xea: Regression fixes for i.MX28 based XEA board Lukasz Majewski
2020-12-26  0:09 ` [PATCH v1 1/3] xea: spl: Disable pull UP for GPIO0_2{35} Lukasz Majewski
2021-01-08 15:58   ` Tom Rini
2020-12-26  0:09 ` [PATCH v1 2/3] xea: config: Use CONFIG_PREBOOT from Kconfig Lukasz Majewski
2021-01-08 15:58   ` Tom Rini
2021-01-08 15:58   ` Tom Rini
2020-12-26  0:09 ` [PATCH v1 3/3] xea: config: Disable CONFIG_SPL_OF_PLATDATA_PARENT on XEA (imx28) Lukasz Majewski
2020-12-29  3:32   ` Simon Glass
2021-01-08 15:58   ` Tom Rini

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.