[PATCH 4.14 052/109] mtd: nand: ifc: update bufnum mask for ver >= 2.0.0

2018-03-16 Thread Greg Kroah-Hartman
4.14-stable review patch.  If anyone has any objections, please let me know.

--

From: Jagdish Gediya 


[ Upstream commit bccb06c353af3764ca86d9da47652458e6c2eb41 ]

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 
Signed-off-by: Prabhakar Kushwaha 
Signed-off-by: Boris Brezillon 
Signed-off-by: Sasha Levin 
Signed-off-by: Greg Kroah-Hartman 
---
 drivers/mtd/nand/fsl_ifc_nand.c |7 +++
 1 file changed, 7 insertions(+)

--- 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_
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;
 }
 




[PATCH 4.14 052/109] mtd: nand: ifc: update bufnum mask for ver >= 2.0.0

2018-03-16 Thread Greg Kroah-Hartman
4.14-stable review patch.  If anyone has any objections, please let me know.

--

From: Jagdish Gediya 


[ Upstream commit bccb06c353af3764ca86d9da47652458e6c2eb41 ]

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 
Signed-off-by: Prabhakar Kushwaha 
Signed-off-by: Boris Brezillon 
Signed-off-by: Sasha Levin 
Signed-off-by: Greg Kroah-Hartman 
---
 drivers/mtd/nand/fsl_ifc_nand.c |7 +++
 1 file changed, 7 insertions(+)

--- 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_
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;
 }