Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a8459f21 authored by Roman Schneider's avatar Roman Schneider Committed by Artem Bityutskiy
Browse files

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: default avatarRoman Schneider <schneider@at.festo.com>
Signed-off-by: default avatarArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
parent 972e1b7b
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -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. */