Skip to contentSkip to conversation

driver/nand: Add support of 16K SRAM for IFC 2.0

PATCH Superseded Prabhakar Kushwaha 2 participants 2 messages Jun 12, 2014 – Jun 13, 2014

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 driver/nand: Add support of 16K SRAM for IFC 2.0

Internal SRAM has been incresed from 8KB to 16KB for IFC cotroller ver 2.0.

Update the page offset calculation logic to support the same.

---
Changes for v2: rebased the patch

 drivers/mtd/nand/fsl_ifc_nand.c |   25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
drivers/mtd/nand/fsl_ifc_nand.c +25 -0
index 280e14e..fd5f536 100644
@@ -24,6 +24,7 @@
 #endif
 
 #define FSL_IFC_V1_1_0	0x01010000
+#define FSL_IFC_V2_0_0	0x02000000
 #define MAX_BANKS	CONFIG_SYS_FSL_IFC_BANK_COUNT
 #define ERR_BYTE	0xFF /* Value returned for read bytes
 				when read failed */
@@ -1040,6 +1041,30 @@ static int fsl_ifc_chip_init(int devnum, u8 *addr)
 	if (ret)
 		return ret;
 
+	if (ver >= FSL_IFC_V2_0_0) {
+		switch (csor & CSOR_NAND_PGS_MASK) {
+		case CSOR_NAND_PGS_512:
+			priv->bufnum_mask = 31;
+		break;
+
+		case CSOR_NAND_PGS_2K:
+		priv->bufnum_mask = 7;
+		break;
+
+		case CSOR_NAND_PGS_4K:
+		priv->bufnum_mask = 3;
+		break;
+
+		case CSOR_NAND_PGS_8K:
+		priv->bufnum_mask = 1;
+		break;
+
+		default:
+			printf("ifc nand: bad csor %#x: bad page size\n", csor);
+			return -ENODEV;
+		}
+	}
+
 	ret = nand_scan_ident(mtd, 1, NULL);
 	if (ret)
 		return ret;
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH v2 1/1 driver/nand: Add support of 16K SRAM for IFC 2.0

Quoted 34 lines · Prabhakar Kushwaha

Internal SRAM has been incresed from 8KB to 16KB for IFC cotroller ver 2.0.

Update the page offset calculation logic to support the same.

---
Changes for v2: rebased the patch

 drivers/mtd/nand/fsl_ifc_nand.c |   25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
drivers/mtd/nand/fsl_ifc_nand.c +8 -0
index 280e14e..fd5f536 100644
@@ -24,6 +24,7 @@
 #endif
 
 #define FSL_IFC_V1_1_0	0x01010000
+#define FSL_IFC_V2_0_0	0x02000000
 #define MAX_BANKS	CONFIG_SYS_FSL_IFC_BANK_COUNT
 #define ERR_BYTE	0xFF /* Value returned for read bytes
 				when read failed */
@@ -1040,6 +1041,30 @@ static int fsl_ifc_chip_init(int devnum, u8 *addr)
 	if (ret)
 		return ret;
 
+	if (ver >= FSL_IFC_V2_0_0) {
+		switch (csor & CSOR_NAND_PGS_MASK) {
+		case CSOR_NAND_PGS_512:
+			priv->bufnum_mask = 31;
+		break;
+
+		case CSOR_NAND_PGS_2K:

drivers/mtd/nand/fsl_ifc_nand.c static int fsl_ifc_chip_init(int devnum, u8 *addr) · line 1060

Quoted 10 lines
drivers/mtd/nand/fsl_ifc_nand.c +10 -0
+		priv->bufnum_mask = 7;
+		break;
+
+		case CSOR_NAND_PGS_4K:
+		priv->bufnum_mask = 3;
+		break;
+
+		case CSOR_NAND_PGS_8K:
+		priv->bufnum_mask = 1;
+		break;

Whitespace

Instead of this, how about:

	if (ver >= FSL_IFC_V2_0_0)
		priv->bufnum_mask = (priv->bufnum_mask * 2) + 1;

-Scott