From: Kuwano Takahiro <tkuw584924@gmail.com>
To: u-boot@lists.denx.de
Subject: [PATCH] mtd: spi-nor: Add support for Cypress s25hl-t/s25hs-t
Date: Mon, 28 Sep 2020 16:22:33 +0900 [thread overview]
Message-ID: <5d2be5c6-ee6a-67f4-e1ba-94be3cca5417@gmail.com> (raw)
In-Reply-To: <20200925101114.fcgq6btoxi3gqw5p@ti.com>
On 9/25/2020 7:11 PM, Pratyush Yadav wrote:
> On 25/09/20 03:13PM, Pratyush Yadav wrote:
>>> + if (instr->addr < erasesize) {
>>> + instr_4k.addr = 0;
>>> + ret = spi_nor_erase(mtd, &instr_4k);
>>> + }
>>> + if (!ret && instr->addr + instr->len >= mtd->size - erasesize) {
>>> + instr_4k.addr = mtd->size - instr_4k.len;
>>> + ret = spi_nor_erase(mtd, &instr_4k);
>
> I missed this before, but say I want to erase all but the last sector on
> a 64Mb flash. So I would issue an erase from 0x0 with length 0x3fc0000.
> So instr->addr + instr->len == 0x3fc0000. And mtd->size == 0x4000000 and
> erasesize == 0x40000. So, mtd->size - erasesize == 0x3fc0000, making
> this condition true. This means that even if I want to erase all but the
> last sector I will end up erasing the last 128k as well.
>
> The '=' needs to be dropped from the comparison.
>
Thanks for pointing out this. Will fix.
--
Best Regards,
Takahiro Kuwano
next prev parent reply other threads:[~2020-09-28 7:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-24 7:43 [PATCH] mtd: spi-nor: Add support for Cypress s25hl-t/s25hs-t tkuw584924 at gmail.com
2020-09-25 9:43 ` Pratyush Yadav
2020-09-25 10:11 ` Pratyush Yadav
2020-09-28 7:22 ` Kuwano Takahiro [this message]
2020-09-28 7:19 ` Kuwano Takahiro
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=5d2be5c6-ee6a-67f4-e1ba-94be3cca5417@gmail.com \
--to=tkuw584924@gmail.com \
--cc=u-boot@lists.denx.de \
/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