summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/nand_imx.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2011-10-13 15:38:08 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2011-10-13 17:27:19 +0200
commit64c1007a69511469ed58be2efa794009b426602f (patch)
tree223dddb0af38978bbdb83f60583bcfee53fdf29b /drivers/mtd/nand/nand_imx.c
parent7caed07217881f4c8d5f1e1cf9c866eef629a985 (diff)
downloadbarebox-64c1007a69511469ed58be2efa794009b426602f.tar.gz
barebox-64c1007a69511469ed58be2efa794009b426602f.tar.xz
mtd nand i.MX: Add i.MX53 support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/mtd/nand/nand_imx.c')
-rw-r--r--drivers/mtd/nand/nand_imx.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/mtd/nand/nand_imx.c b/drivers/mtd/nand/nand_imx.c
index 581136aed4..c8c69d602e 100644
--- a/drivers/mtd/nand/nand_imx.c
+++ b/drivers/mtd/nand/nand_imx.c
@@ -58,7 +58,8 @@
#define NFC_V3_CONFIG2_2CMD_PHASES (1 << 4)
#define NFC_V3_CONFIG2_NUM_ADDR_PHASE0 (1 << 5)
#define NFC_V3_CONFIG2_ECC_MODE_8 (1 << 6)
-#define NFC_V3_CONFIG2_PPB(x) (((x) & 0x3) << 7)
+#define NFC_V3_MX51_CONFIG2_PPB(x) (((x) & 0x3) << 7)
+#define NFC_V3_MX53_CONFIG2_PPB(x) (((x) & 0x3) << 8)
#define NFC_V3_CONFIG2_NUM_ADDR_PHASE1(x) (((x) & 0x3) << 12)
#define NFC_V3_CONFIG2_INT_MSK (1 << 15)
#define NFC_V3_CONFIG2_ST_CMD(x) (((x) & 0xff) << 24)
@@ -812,7 +813,12 @@ static void preset_v3(struct mtd_info *mtd)
}
if (mtd->writesize) {
- config2 |= NFC_V3_CONFIG2_PPB(ffs(mtd->erasesize / mtd->writesize) - 6);
+ if (cpu_is_mx51())
+ config2 |= NFC_V3_MX51_CONFIG2_PPB(
+ ffs(mtd->erasesize / mtd->writesize) - 6);
+ else
+ config2 |= NFC_V3_MX53_CONFIG2_PPB(
+ ffs(mtd->erasesize / mtd->writesize) - 6);
host->eccsize = get_eccsize(mtd);
if (host->eccsize == 8)
config2 |= NFC_V3_CONFIG2_ECC_MODE_8;