lkml.org 
[lkml]   [2019]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [PATCH v2 07/15] spi: imx: remove ERR009165 workaround on i.mx6ul
From
Date
Am Freitag, den 26.04.2019, 08:05 +0000 schrieb Robin Gong:
>    ERR009165 fix on i.mx6ul and next chip, such as i.mx6ull/i.mx8mq/i.mx8mm.
> Remove workaround on those chips. Add new i.mx6ul type for that.
>
> Signed-off-by: Robin Gong <yibin.gong@nxp.com>
> ---
>  drivers/spi/spi-imx.c | 39 +++++++++++++++++++++++++++++++++++----
>  1 file changed, 35 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c
> index eb56eac..2e5e978 100644
> --- a/drivers/spi/spi-imx.c
> +++ b/drivers/spi/spi-imx.c
> @@ -57,6 +57,7 @@ enum spi_imx_devtype {
>   IMX35_CSPI, /* CSPI on all i.mx except above */
>   IMX51_ECSPI, /* ECSPI on i.mx51 */
>   IMX53_ECSPI, /* ECSPI on i.mx53 and later */
> + IMX6UL_ECSPI, /* ERR009165 fix from i.mx6ul */
>  };
>  
>  struct spi_imx_data;
> @@ -128,7 +129,8 @@ static inline int is_imx35_cspi(struct spi_imx_data *d)
>  
>  static inline int is_imx51_ecspi(struct spi_imx_data *d)
>  {
> - return d->devtype_data->devtype == IMX51_ECSPI;
> + return d->devtype_data->devtype == IMX51_ECSPI ||
> +        d->devtype_data->devtype == IMX6UL_ECSPI;
>  }
>  
>  static inline int is_imx53_ecspi(struct spi_imx_data *d)
> @@ -585,9 +587,16 @@ static int mx51_ecspi_prepare_transfer(struct spi_imx_data *spi_imx,
>   ctrl |= mx51_ecspi_clkdiv(spi_imx, t->speed_hz, &clk);
>   spi_imx->spi_bus_clk = clk;
>  
> - /* ERR009165: work in XHC mode as PIO */
> - if (spi_imx->usedma)
> - ctrl &= ~MX51_ECSPI_CTRL_SMC;
> + /*
> +  * ERR009165: work in XHC mode instead of SMC as PIO on the chips
> +  * before i.mx6ul.
> +  */
> + if (spi_imx->usedma) {
> + if (spi_imx->devtype_data->devtype == IMX6UL_ECSPI)

>=, otherwise the workaround might be applied to later generations of
the core if more are added later.

Regards,
Lucas

\
 
 \ /
  Last update: 2019-04-26 11:10    [W:0.128 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site