From: "Csókás Bence" <csokas.bence@prolan.hu>
To: Pratyush Yadav <pratyush@kernel.org>
Cc: <linux-mtd@lists.infradead.org>, <linux-kernel@vger.kernel.org>,
"Tudor Ambarus" <tudor.ambarus@linaro.org>,
Michael Walle <mwalle@kernel.org>,
"Miquel Raynal" <miquel.raynal@bootlin.com>,
Richard Weinberger <richard@nod.at>,
Vignesh Raghavendra <vigneshr@ti.com>
Subject: Re: [PATCH] mtd: spi-nor: sst: Factor out common write operation to `sst_nor_write_data()`
Date: Wed, 10 Jul 2024 15:35:38 +0200 [thread overview]
Message-ID: <5fe0e312-0844-4de7-8096-eae24361c0a4@prolan.hu> (raw)
In-Reply-To: <mafs07cdto0t9.fsf@kernel.org>
Hi!
On 7/10/24 15:04, Pratyush Yadav wrote:
>> Notes:
>> RFC: I'm thinking of removing SPINOR_OP_BP in favor of
>> SPINOR_OP_PP (they have the same value). SPINOR_OP_PP
>> is the "standard" name for the elementary unit-sized
>> (1 byte, in the case of NOR) write operation. I find it
>> confusing to have two names for the same operation,
>> so in a followup I plan to remove the vendor-specific
>> name in favor of the standard one.
>
> Even though the operations have the same opcode, I see them as different
> operations. One is a byte program: it can only write one byte at a time.
> The other is a page program: it can write up to one page (256 bytes
> usually) at a time.
>
> So I would actually find it more confusing if you use page program in a
> situation where the operation is actually a byte program, and attempting
> to program the whole page will fail.
Yes, SST engineers took some _unconventional_ steps when designing this
family... However, there are no 256 byte pages in these chips. You
either program it one byte at a time, or as a sequence of two byte
values. So, in my eyes, that makes it a Flash where the page size is 1
byte, and the vendor-specific write is something extra added on (and
mind you, that's not a page program either, you just feed it an
*arbitrary* even number of bytes, there really are no pages here at all,
only erase sectors).
> Not directly related to this patch, but when reviewing this patch I
> noticed another small improvement you can make. [...]
> Here, we do a write disable. Then if a one-byte write is needed, do a
> write enable again, write the data and write disable.
>
> Do we really need to toggle write enable between these? If not, it can
> be simplified to only do the write disable after all bytes have been
> written.
Honestly, I'm not sure, I was too afraid to touch that part. However,
from the datasheet of SST25VF040B I presume that if we did not toggle
it, then the Flash chip would interpret the 0x02 opcode and its argument
as another 2 bytes of data to write at the end. Byte Program takes
exactly 1 argument, so it can be followed by another command, but AAI WP
goes on until ~CS goes high.
> Reviewed-by: Pratyush Yadav <pratyush@kernel.org>
Thanks!
Bence
next prev parent reply other threads:[~2024-07-10 13:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-10 9:14 Csókás, Bence
2024-07-10 13:04 ` Pratyush Yadav
2024-07-10 13:35 ` Csókás Bence [this message]
2024-07-10 14:58 ` Pratyush Yadav
2024-07-29 14:55 ` Pratyush Yadav
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=5fe0e312-0844-4de7-8096-eae24361c0a4@prolan.hu \
--to=csokas.bence@prolan.hu \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=miquel.raynal@bootlin.com \
--cc=mwalle@kernel.org \
--cc=pratyush@kernel.org \
--cc=richard@nod.at \
--cc=tudor.ambarus@linaro.org \
--cc=vigneshr@ti.com \
/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
all inboxes | Powered by JetHome®