All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][v2] mtd: nand: ifc: update bufnum mask for ver >= 2.0.0
@ 2017-11-23 11:34 Prabhakar Kushwaha
  2017-11-30 21:37 ` Boris Brezillon
  0 siblings, 1 reply; 2+ messages in thread
From: Prabhakar Kushwaha @ 2017-11-23 11:34 UTC (permalink / raw)
  To: linux-mtd
  Cc: dedekind1, oss, computersforpeace, Jagdish Gediya,
	Prabhakar Kushwaha

From: Jagdish Gediya <jagdish.gediya@nxp.com>

Bufnum mask is used to calculate page position in the internal SRAM.

As IFC version 2.0.0 has 16KB of internal SRAM as compared to older
versions which had 8KB. Hence bufnum mask needs to be updated.

Signed-off-by: Jagdish Gediya <jagdish.gediya@nxp.com>
Signed-off-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
---
Changes for v2: Incorporated review comments from Boris Brezillon
http://patchwork.ozlabs.org/patch/773799/

 drivers/mtd/nand/fsl_ifc_nand.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/mtd/nand/fsl_ifc_nand.c b/drivers/mtd/nand/fsl_ifc_nand.c
index 9e03bac..bbdd68a5 100644
--- a/drivers/mtd/nand/fsl_ifc_nand.c
+++ b/drivers/mtd/nand/fsl_ifc_nand.c
@@ -916,6 +916,13 @@ static int fsl_ifc_chip_init(struct fsl_ifc_mtd *priv)
 	if (ctrl->version >= FSL_IFC_VERSION_1_1_0)
 		fsl_ifc_sram_init(priv);
 
+	/*
+	 * As IFC version 2.0.0 has 16KB of internal SRAM as compared to older
+	 * versions which had 8KB. Hence bufnum mask needs to be updated.
+	 */
+	if (ctrl->version >= FSL_IFC_VERSION_2_0_0)
+		priv->bufnum_mask = (priv->bufnum_mask * 2) + 1;
+
 	return 0;
 }
 
-- 
1.9.1

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

* Re: [PATCH][v2] mtd: nand: ifc: update bufnum mask for ver >= 2.0.0
  2017-11-23 11:34 [PATCH][v2] mtd: nand: ifc: update bufnum mask for ver >= 2.0.0 Prabhakar Kushwaha
@ 2017-11-30 21:37 ` Boris Brezillon
  0 siblings, 0 replies; 2+ messages in thread
From: Boris Brezillon @ 2017-11-30 21:37 UTC (permalink / raw)
  To: Prabhakar Kushwaha
  Cc: linux-mtd, oss, computersforpeace, Jagdish Gediya, dedekind1

On Thu, 23 Nov 2017 17:04:31 +0530
Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com> wrote:

> From: Jagdish Gediya <jagdish.gediya@nxp.com>
> 
> Bufnum mask is used to calculate page position in the internal SRAM.
> 
> As IFC version 2.0.0 has 16KB of internal SRAM as compared to older
> versions which had 8KB. Hence bufnum mask needs to be updated.

Applied.

Thanks,

Boris

> 
> Signed-off-by: Jagdish Gediya <jagdish.gediya@nxp.com>
> Signed-off-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
> ---
> Changes for v2: Incorporated review comments from Boris Brezillon
> http://patchwork.ozlabs.org/patch/773799/
> 
>  drivers/mtd/nand/fsl_ifc_nand.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/mtd/nand/fsl_ifc_nand.c b/drivers/mtd/nand/fsl_ifc_nand.c
> index 9e03bac..bbdd68a5 100644
> --- a/drivers/mtd/nand/fsl_ifc_nand.c
> +++ b/drivers/mtd/nand/fsl_ifc_nand.c
> @@ -916,6 +916,13 @@ static int fsl_ifc_chip_init(struct fsl_ifc_mtd *priv)
>  	if (ctrl->version >= FSL_IFC_VERSION_1_1_0)
>  		fsl_ifc_sram_init(priv);
>  
> +	/*
> +	 * As IFC version 2.0.0 has 16KB of internal SRAM as compared to older
> +	 * versions which had 8KB. Hence bufnum mask needs to be updated.
> +	 */
> +	if (ctrl->version >= FSL_IFC_VERSION_2_0_0)
> +		priv->bufnum_mask = (priv->bufnum_mask * 2) + 1;
> +
>  	return 0;
>  }
>  

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

end of thread, other threads:[~2017-11-30 21:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-23 11:34 [PATCH][v2] mtd: nand: ifc: update bufnum mask for ver >= 2.0.0 Prabhakar Kushwaha
2017-11-30 21:37 ` Boris Brezillon

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.