From: Michael Walle <michael@walle.cc>
To: Tudor Ambarus <tudor.ambarus@linaro.org>
Cc: Jaime Liao <jaimeliao.tw@gmail.com>,
linux-mtd@lists.infradead.org, pratyush@kernel.org,
miquel.raynal@bootlin.com, leoyu@mxic.com.tw,
JaimeLiao <jaimeliao@mxic.com.tw>
Subject: Re: [PATCH v2 1/2] mtd: spi-nor: add Octal DTR support for Macronix flash
Date: Thu, 27 Jul 2023 12:11:19 +0200 [thread overview]
Message-ID: <4ffbc99f5174fe48182211d489efa115@walle.cc> (raw)
In-Reply-To: <ae53bde4-33d0-861d-b7f4-b86114cd6f58@linaro.org>
Hi,
>> + /* Macronix SPI-NOR flash 8D-8D-8D read ID would get 6 bytes data
>> A-A-B-B-C-C */
>> + for (i = 0; i < nor->info->id_len; i++)
>> + if (buf[i * 2] != nor->info->id[i])
>> + return -EINVAL;
We need some kind of per flash rdid override. I guess rdid won't work
in octal mode then. Are any other commands also affected?
I had something like a per flash .rdid op in mind where for this flash
you do like
rdid() {
if (octal mode) {
buf = spi_xfer(2 * SPI_NOR_MAX_ID_LEN);
strip_every_other_byte(buf);
return buf;
} else {
spi_nor_default_read_id();
}
}
rename spi_nor_read_id() to spi_nor_default_read_id()
spi_nor_read_id() {
if (nor->info->rdid)
return nor->info->rdid();
return spi_nor_default_read_id();
}
And also move the readid and compare code to a common helper, as
discussed.
-michael
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2023-07-27 10:11 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-27 9:16 [PATCH v2 0/2] Add octal DTR support for Macronix flash Jaime Liao
2023-07-27 9:16 ` [PATCH v2 1/2] mtd: spi-nor: add Octal " Jaime Liao
2023-07-27 10:00 ` Tudor Ambarus
2023-07-27 10:04 ` Tudor Ambarus
2023-07-27 10:11 ` Michael Walle [this message]
2023-07-28 9:46 ` Michael Walle
2023-07-28 11:01 ` Tudor Ambarus
2023-08-01 7:24 ` liao jaime
2023-08-01 8:16 ` Tudor Ambarus
2023-08-01 9:33 ` liao jaime
2023-07-27 9:16 ` [PATCH v2 2/2] mtd: spi-nor: add support for Macronix Octal flash Jaime Liao
2023-07-27 9:54 ` Tudor Ambarus
2023-07-27 10:04 ` Michael Walle
2023-07-27 10:10 ` Tudor Ambarus
2023-07-27 10:12 ` Michael Walle
2023-07-27 10:14 ` Tudor Ambarus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4ffbc99f5174fe48182211d489efa115@walle.cc \
--to=michael@walle.cc \
--cc=jaimeliao.tw@gmail.com \
--cc=jaimeliao@mxic.com.tw \
--cc=leoyu@mxic.com.tw \
--cc=linux-mtd@lists.infradead.org \
--cc=miquel.raynal@bootlin.com \
--cc=pratyush@kernel.org \
--cc=tudor.ambarus@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox