summaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorRoman Schneider2013-01-15 16:56:24 +0100
committerArtem Bityutskiy2013-02-04 08:26:29 +0100
commita8459f21ed48fc366ad49ce9828f6bbb1cfac9a9 (patch)
treec9a2314335fb6468cdd559a8641bc4767a9cb76d /drivers/mtd
parentmtd: m25p80: Flash protection support for STmicro chips (diff)
downloadkernel-qcow2-linux-a8459f21ed48fc366ad49ce9828f6bbb1cfac9a9.tar.gz
kernel-qcow2-linux-a8459f21ed48fc366ad49ce9828f6bbb1cfac9a9.tar.xz
kernel-qcow2-linux-a8459f21ed48fc366ad49ce9828f6bbb1cfac9a9.zip
mtd: mxc_nand: compress ID info for send_read_id_v3
Also compress the id in case of a v3 NAND flash controller (i.mx51, i.mx53) and 16Bit buswidth. Signed-off-by: Roman Schneider <schneider@at.festo.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/nand/mxc_nand.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
index 45204e41a028..20e1241bd099 100644
--- a/drivers/mtd/nand/mxc_nand.c
+++ b/drivers/mtd/nand/mxc_nand.c
@@ -530,12 +530,23 @@ static void send_page_v1(struct mtd_info *mtd, unsigned int ops)
static void send_read_id_v3(struct mxc_nand_host *host)
{
+ struct nand_chip *this = &host->nand;
+
/* Read ID into main buffer */
writel(NFC_ID, NFC_V3_LAUNCH);
wait_op_done(host, true);
memcpy32_fromio(host->data_buf, host->main_area0, 16);
+
+ if (this->options & NAND_BUSWIDTH_16) {
+ /* compress the ID info */
+ host->data_buf[1] = host->data_buf[2];
+ host->data_buf[2] = host->data_buf[4];
+ host->data_buf[3] = host->data_buf[6];
+ host->data_buf[4] = host->data_buf[8];
+ host->data_buf[5] = host->data_buf[10];
+ }
}
/* Request the NANDFC to perform a read of the NAND device ID. */