diff mbox series

[v1,3/3] xea: config: Disable CONFIG_SPL_OF_PLATDATA_PARENT on XEA (imx28)

Message ID 20201226000902.23020-4-lukma@denx.de
State Accepted
Delegated to: Tom Rini
Headers show
Series arm: xea: Regression fixes for i.MX28 based XEA board | expand

Commit Message

Lukasz Majewski Dec. 26, 2020, 12:09 a.m. UTC
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@0 at imx28.dtsi) has pinctrl parent (pinctrl@80018000) for which we
don't need driver asigned for correct operation.
In the spl/dts/dt-platdata.c the gpio@0 has index 4 and its parent -
pinctrl@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@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@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@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(+)

Comments

Simon Glass Dec. 29, 2020, 3:32 a.m. UTC | #1
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@0 at imx28.dtsi) has pinctrl parent (pinctrl@80018000) for which we
> don't need driver asigned for correct operation.
> In the spl/dts/dt-platdata.c the gpio@0 has index 4 and its parent -
> pinctrl@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@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@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@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
Tom Rini Jan. 8, 2021, 3:58 p.m. UTC | #2
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@0 at imx28.dtsi) has pinctrl parent (pinctrl@80018000) for which we
> don't need driver asigned for correct operation.
> In the spl/dts/dt-platdata.c the gpio@0 has index 4 and its parent -
> pinctrl@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@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@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@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!
diff mbox series

Patch

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