public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH 1/2] spi: nxp_fspi: Fix error reporting
@ 2021-01-18 21:32 Adam Ford
  2021-01-18 21:32 ` [PATCH 2/2] spi: nxp_fspi: Enable support for nxp,imx8mm-fspi Adam Ford
  2021-01-19 12:12 ` [PATCH 1/2] spi: nxp_fspi: Fix error reporting Pratyush Yadav
  0 siblings, 2 replies; 6+ messages in thread
From: Adam Ford @ 2021-01-18 21:32 UTC (permalink / raw)
  To: u-boot

On the i.MX8M Mini, ret = clk_set_rate() sets ret to the value of the
rate the clock was able to set.  When checking for errors, it only
checks that it is not NULL.  Since positive numbers are not errors,
only check for negative numbers when handling errors.

Fixes: 383fded70c4f ("spi: nxp_fspi: new driver for the FlexSPI controller")
Signed-off-by: Adam Ford <aford173@gmail.com>

diff --git a/drivers/spi/nxp_fspi.c b/drivers/spi/nxp_fspi.c
index 006dd04b9e..d74561578a 100644
--- a/drivers/spi/nxp_fspi.c
+++ b/drivers/spi/nxp_fspi.c
@@ -815,7 +815,7 @@ static int nxp_fspi_default_setup(struct nxp_fspi *f)
 
 	/* the default frequency, we will change it later if necessary. */
 	ret = clk_set_rate(&f->clk, 20000000);
-	if (ret)
+	if (ret < 0)
 		return ret;
 
 	ret = nxp_fspi_clk_prep_enable(f);
@@ -906,7 +906,7 @@ static int nxp_fspi_set_speed(struct udevice *bus, uint speed)
 	nxp_fspi_clk_disable_unprep(f);
 
 	ret = clk_set_rate(&f->clk, speed);
-	if (ret)
+	if (ret < 0)
 		return ret;
 
 	ret = nxp_fspi_clk_prep_enable(f);
-- 
2.25.1

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

* [PATCH 2/2] spi: nxp_fspi: Enable support for nxp,imx8mm-fspi
  2021-01-18 21:32 [PATCH 1/2] spi: nxp_fspi: Fix error reporting Adam Ford
@ 2021-01-18 21:32 ` Adam Ford
  2021-01-23 15:50   ` sbabic at denx.de
  2021-01-19 12:12 ` [PATCH 1/2] spi: nxp_fspi: Fix error reporting Pratyush Yadav
  1 sibling, 1 reply; 6+ messages in thread
From: Adam Ford @ 2021-01-18 21:32 UTC (permalink / raw)
  To: u-boot

The i.MX8M Mini can use the FlexSPI driver.  Add support
for it to the driver.

Signed-off-by: Adam Ford <aford173@gmail.com>

diff --git a/drivers/spi/nxp_fspi.c b/drivers/spi/nxp_fspi.c
index d74561578a..6c5bad4c2c 100644
--- a/drivers/spi/nxp_fspi.c
+++ b/drivers/spi/nxp_fspi.c
@@ -320,6 +320,14 @@ static const struct nxp_fspi_devtype_data lx2160a_data = {
 	.little_endian = true,  /* little-endian    */
 };
 
+static const struct nxp_fspi_devtype_data imx8mm_data = {
+	.rxfifo = SZ_512,       /* (64  * 64 bits)  */
+	.txfifo = SZ_1K,        /* (128 * 64 bits)  */
+	.ahb_buf_size = SZ_2K,  /* (256 * 64 bits)  */
+	.quirks = 0,
+	.little_endian = true,  /* little-endian    */
+};
+
 struct nxp_fspi {
 	struct udevice *dev;
 	void __iomem *iobase;
@@ -985,6 +993,7 @@ static const struct dm_spi_ops nxp_fspi_ops = {
 
 static const struct udevice_id nxp_fspi_ids[] = {
 	{ .compatible = "nxp,lx2160a-fspi", .data = (ulong)&lx2160a_data, },
+	{ .compatible = "nxp,imx8mm-fspi", .data = (ulong)&imx8mm_data, },
 	{ }
 };
 
-- 
2.25.1

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

* [PATCH 1/2] spi: nxp_fspi: Fix error reporting
  2021-01-18 21:32 [PATCH 1/2] spi: nxp_fspi: Fix error reporting Adam Ford
  2021-01-18 21:32 ` [PATCH 2/2] spi: nxp_fspi: Enable support for nxp,imx8mm-fspi Adam Ford
@ 2021-01-19 12:12 ` Pratyush Yadav
  2021-02-23 12:59   ` Adam Ford
  1 sibling, 1 reply; 6+ messages in thread
From: Pratyush Yadav @ 2021-01-19 12:12 UTC (permalink / raw)
  To: u-boot

On 18/01/21 03:32PM, Adam Ford wrote:
> On the i.MX8M Mini, ret = clk_set_rate() sets ret to the value of the
> rate the clock was able to set.  When checking for errors, it only
> checks that it is not NULL.  Since positive numbers are not errors,
> only check for negative numbers when handling errors.
> 
> Fixes: 383fded70c4f ("spi: nxp_fspi: new driver for the FlexSPI controller")
> Signed-off-by: Adam Ford <aford173@gmail.com>

Reviewed-by: Pratyush Yadav <p.yadav@ti.com>

-- 
Regards,
Pratyush Yadav
Texas Instruments India

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

* [PATCH 2/2] spi: nxp_fspi: Enable support for nxp,imx8mm-fspi
  2021-01-18 21:32 ` [PATCH 2/2] spi: nxp_fspi: Enable support for nxp,imx8mm-fspi Adam Ford
@ 2021-01-23 15:50   ` sbabic at denx.de
  0 siblings, 0 replies; 6+ messages in thread
From: sbabic at denx.de @ 2021-01-23 15:50 UTC (permalink / raw)
  To: u-boot

> The i.MX8M Mini can use the FlexSPI driver.  Add support
> for it to the driver.
> Signed-off-by: Adam Ford <aford173@gmail.com>
> diff --git a/drivers/spi/nxp_fspi.c b/drivers/spi/nxp_fspi.c
> index d74561578a..6c5bad4c2c 100644
> --- a/drivers/spi/nxp_fspi.c
> +++ b/drivers/spi/nxp_fspi.c
> @@ -320,6 +320,14 @@ static const struct nxp_fspi_devtype_data lx2160a_data = {
>  	.little_endian = true,  /* little-endian    */
>  };
>  
> +static const struct nxp_fspi_devtype_data imx8mm_data = {
> +	.rxfifo = SZ_512,       /* (64  * 64 bits)  */
> +	.txfifo = SZ_1K,        /* (128 * 64 bits)  */
> +	.ahb_buf_size = SZ_2K,  /* (256 * 64 bits)  */
> +	.quirks = 0,
> +	.little_endian = true,  /* little-endian    */
> +};
> +
>  struct nxp_fspi {
>  	struct udevice *dev;
>  	void __iomem *iobase;
> @@ -985,6 +993,7 @@ static const struct dm_spi_ops nxp_fspi_ops = {
>  
>  static const struct udevice_id nxp_fspi_ids[] = {
>  	{ .compatible = "nxp,lx2160a-fspi", .data = (ulong)&lx2160a_data, },
> +	{ .compatible = "nxp,imx8mm-fspi", .data = (ulong)&imx8mm_data, },
>  	{ }
>  };
>  
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

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

* [PATCH 1/2] spi: nxp_fspi: Fix error reporting
  2021-01-19 12:12 ` [PATCH 1/2] spi: nxp_fspi: Fix error reporting Pratyush Yadav
@ 2021-02-23 12:59   ` Adam Ford
  2021-02-26  9:41     ` Jagan Teki
  0 siblings, 1 reply; 6+ messages in thread
From: Adam Ford @ 2021-02-23 12:59 UTC (permalink / raw)
  To: u-boot

On Tue, Jan 19, 2021 at 6:12 AM Pratyush Yadav <p.yadav@ti.com> wrote:
>
> On 18/01/21 03:32PM, Adam Ford wrote:
> > On the i.MX8M Mini, ret = clk_set_rate() sets ret to the value of the
> > rate the clock was able to set.  When checking for errors, it only
> > checks that it is not NULL.  Since positive numbers are not errors,
> > only check for negative numbers when handling errors.
> >
> > Fixes: 383fded70c4f ("spi: nxp_fspi: new driver for the FlexSPI controller")
> > Signed-off-by: Adam Ford <aford173@gmail.com>
>
> Reviewed-by: Pratyush Yadav <p.yadav@ti.com>
>
Jagan,

Is this something you can take, or do I need to add someone to the CC
list?  It's been nearly a month, and it's holding up the ability for a
QSPI driver on two boards.

thanks,

adam


> --
> Regards,
> Pratyush Yadav
> Texas Instruments India

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

* [PATCH 1/2] spi: nxp_fspi: Fix error reporting
  2021-02-23 12:59   ` Adam Ford
@ 2021-02-26  9:41     ` Jagan Teki
  0 siblings, 0 replies; 6+ messages in thread
From: Jagan Teki @ 2021-02-26  9:41 UTC (permalink / raw)
  To: u-boot

On Tue, Feb 23, 2021 at 6:29 PM Adam Ford <aford173@gmail.com> wrote:
>
> On Tue, Jan 19, 2021 at 6:12 AM Pratyush Yadav <p.yadav@ti.com> wrote:
> >
> > On 18/01/21 03:32PM, Adam Ford wrote:
> > > On the i.MX8M Mini, ret = clk_set_rate() sets ret to the value of the
> > > rate the clock was able to set.  When checking for errors, it only
> > > checks that it is not NULL.  Since positive numbers are not errors,
> > > only check for negative numbers when handling errors.
> > >
> > > Fixes: 383fded70c4f ("spi: nxp_fspi: new driver for the FlexSPI controller")
> > > Signed-off-by: Adam Ford <aford173@gmail.com>
> >
> > Reviewed-by: Pratyush Yadav <p.yadav@ti.com>
> >
> Jagan,
>
> Is this something you can take, or do I need to add someone to the CC
> list?  It's been nearly a month, and it's holding up the ability for a
> QSPI driver on two boards.

Didn't find it via patchwork before, thanks for notifying me.

Applied to u-boot-spi/master

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

end of thread, other threads:[~2021-02-26  9:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-18 21:32 [PATCH 1/2] spi: nxp_fspi: Fix error reporting Adam Ford
2021-01-18 21:32 ` [PATCH 2/2] spi: nxp_fspi: Enable support for nxp,imx8mm-fspi Adam Ford
2021-01-23 15:50   ` sbabic at denx.de
2021-01-19 12:12 ` [PATCH 1/2] spi: nxp_fspi: Fix error reporting Pratyush Yadav
2021-02-23 12:59   ` Adam Ford
2021-02-26  9:41     ` Jagan Teki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox