diff mbox series

[U-Boot,v2,4/9] spi: fix: Call mxs_reset_block() during DM/DTS probe

Message ID 20190818213603.28171-5-lukma@denx.de
State Superseded
Delegated to: Stefano Babic
Headers show
Series imx: mxs: Fixes and DM/DTS conversion code for several i.MX28 drivers | expand

Commit Message

Lukasz Majewski Aug. 18, 2019, 9:35 p.m. UTC
Without this change the DM/DTS version of mxs_spi driver doesn't reset the
SPI IP block in probe.
As a result this driver (when used solely on U-Boot proper) relies on reset
performed by mxs spi driver in SPL.

In the use case where eMMC is used in SPL as a boot primary device, the
mxs_reset_block() is not called at all and DM/DTS aware SPI driver in
U-Boot proper is malfunctioning.

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

Changes in v2: None

 drivers/spi/mxs_spi.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Peng Fan Aug. 19, 2019, 1:26 a.m. UTC | #1
> Subject: [PATCH v2 4/9] spi: fix: Call mxs_reset_block() during DM/DTS probe
> 
> Without this change the DM/DTS version of mxs_spi driver doesn't reset the
> SPI IP block in probe.
> As a result this driver (when used solely on U-Boot proper) relies on reset
> performed by mxs spi driver in SPL.
> 
> In the use case where eMMC is used in SPL as a boot primary device, the
> mxs_reset_block() is not called at all and DM/DTS aware SPI driver in U-Boot
> proper is malfunctioning.
> 
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
> ---
> 
> Changes in v2: None
> 
>  drivers/spi/mxs_spi.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/spi/mxs_spi.c b/drivers/spi/mxs_spi.c index
> b1cc83aab1..d475830f17 100644
> --- a/drivers/spi/mxs_spi.c
> +++ b/drivers/spi/mxs_spi.c
> @@ -436,6 +436,8 @@ static int mxs_spi_probe(struct udevice *bus)
>  	priv->dma_channel = plat->dma_id;
>  	priv->clk_id = plat->clk_id;
> 
> +	mxs_reset_block(&priv->regs->hw_ssp_ctrl0_reg);
> +
>  	ret = mxs_dma_init_channel(priv->dma_channel);
>  	if (ret) {
>  		printf("%s: DMA init channel error %d\n", __func__, ret);

Acked-by: Peng Fan <peng.fan@nxp.com>

> --
> 2.11.0
diff mbox series

Patch

diff --git a/drivers/spi/mxs_spi.c b/drivers/spi/mxs_spi.c
index b1cc83aab1..d475830f17 100644
--- a/drivers/spi/mxs_spi.c
+++ b/drivers/spi/mxs_spi.c
@@ -436,6 +436,8 @@  static int mxs_spi_probe(struct udevice *bus)
 	priv->dma_channel = plat->dma_id;
 	priv->clk_id = plat->clk_id;
 
+	mxs_reset_block(&priv->regs->hw_ssp_ctrl0_reg);
+
 	ret = mxs_dma_init_channel(priv->dma_channel);
 	if (ret) {
 		printf("%s: DMA init channel error %d\n", __func__, ret);