Linux-mtd Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mtd: mxc_nand: compress ID info for send_read_id_v3
@ 2013-01-15 15:56 Roman Schneider
  2013-01-17 10:55 ` Artem Bityutskiy
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Roman Schneider @ 2013-01-15 15:56 UTC (permalink / raw)
  To: linux-mtd; +Cc: Roman Schneider, Artem Bityutskiy

---
 Also compress the id in case of a v3 NAND flash controller (i.mx51, i.mx53)
 and 16Bit buswidth.

 drivers/mtd/nand/mxc_nand.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
index 45204e4..20e1241 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. */
-- 
1.7.2.5

^ permalink raw reply related	[flat|nested] 7+ messages in thread
* [PATCH] mtd: mxc_nand: compress ID info for send_read_id_v3
@ 2012-12-12 18:49 Schneider, Roman
  2013-01-15  8:09 ` Artem Bityutskiy
  0 siblings, 1 reply; 7+ messages in thread
From: Schneider, Roman @ 2012-12-12 18:49 UTC (permalink / raw)
  To: linux-mtd@lists.infradead.org

       
       ---
       
       NFC v3 (e.g. mx53) does also require to compress the id in case of 16Bit busw.
       
        drivers/mtd/nand/mxc_nand.c |   11 +++++++++++
        1 files changed, 11 insertions(+), 0 deletions(-)
       
       diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
       index 72e31d8..7758897 100644
       --- a/drivers/mtd/nand/mxc_nand.c
       +++ b/drivers/mtd/nand/mxc_nand.c
       @@ -535,12 +535,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. */
       -- 
       1.7.2.5
       


Development Control Systems
Festo Gesellschaft m.b.H.
Linzer Strasse 227
Austria - 1140 Wien

Firmenbuch Wien
FN 38435y
UID: ATU14650108

Tel: +43(1)91075-372
Fax: +43(1)91075-282
www.festo.at

Der Inhalt dieses E-Mails ist ausschliesslich fuer den bezeichneten Adressaten bestimmt. Jede Form der Kenntnisnahme,
Veroeffentlichung, Vervielfaeltigung oder Weitergabe des Inhalts dieses E-Mails durch unberechtigte Dritte ist unzulaessig. Wir
bitten Sie, sich mit dem Absender des E-Mails in Verbindung zu setzen, falls Sie nicht der Adressat dieses E-Mails sind und das
Material von Ihrem Computer zu loeschen. 

This e-mail and any attachments are confidential and intended solely for the addressee. The perusal, publication, copying or
dissemination of the contents of this e-mail by unauthorised third parties is prohibited. If you are not the intended recipient of this
e-mail, please delete it and immediately notify the sender.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-01-17 11:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-15 15:56 [PATCH] mtd: mxc_nand: compress ID info for send_read_id_v3 Roman Schneider
2013-01-17 10:55 ` Artem Bityutskiy
2013-01-17 10:59   ` Shawn Guo
2013-01-17 11:16 ` Fabio Estevam
2013-01-17 11:53 ` Artem Bityutskiy
  -- strict thread matches above, loose matches on Subject: below --
2012-12-12 18:49 Schneider, Roman
2013-01-15  8:09 ` Artem Bityutskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox