From: Pavel Machek <pavel@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] Between 2015.10 and 2016.01, SPI flash changed erase size, and saveenv stopped working
Date: Mon, 30 May 2016 22:25:13 +0200 [thread overview]
Message-ID: <20160530202513.GB25685@amd> (raw)
In-Reply-To: <CAOMZO5CN0FhJYdJ7SJDAaEkVvifA_ve9SSpVSqBhc6Yhn89VHg@mail.gmail.com>
On Mon 2016-05-30 10:43:39, Fabio Estevam wrote:
> On Mon, May 30, 2016 at 5:33 AM, Pavel Machek <pavel@denx.de> wrote:
>
> > Commit c3c016cf75360c2a0d0a065b64b438aaf7720576 is a part of the problem:
> >
> > offset 0x40000 is protected and cannot be erased
> > => sf help
> > No SPI flash selected. Please run `sf probe'
> > => sf probe
> > ...
> > SF: Detected N25Q512 with page size 256 Bytes, erase size 4 KiB, total
> > 64 MiB
> > cadence_spi_set_speed: speed=1000000
> > => sf protect unlock 0x40000 0x20000
> > cadence_spi_xfer: len=1 [bytes]
> > cadence_spi_xfer: len=1 [bytes]
> > => saveenv
> > Saving Environment to SPI Flash...
>
> Does this quick hack help? I am wondering if yous SPI flash power up
> with the SR field protected:
Yes, it helps. Thanks! I can now write to the enviornment.
But it still does not look like locking is working quite correctly:
Best regards,
Pavel
=> sf protect lock 0xe0000 0x10000
=> saveenv
Saving Environment to SPI Flash...
read_ops: at e1000, len f000
read: 61440 remains
read: 28672 remains
Erasing SPI flash...SF: erase 20 e 0 0 (e0000)
SF: erase 20 e 10 0 (e1000)
SF: erase 20 e 20 0 (e2000)
SF: erase 20 e 30 0 (e3000)
SF: erase 20 e 40 0 (e4000)
SF: erase 20 e 50 0 (e5000)
SF: erase 20 e 60 0 (e6000)
SF: erase 20 e 70 0 (e7000)
SF: erase 20 e 80 0 (e8000)
SF: erase 20 e 90 0 (e9000)
SF: erase 20 e a0 0 (ea000)
SF: erase 20 e b0 0 (eb000)
SF: erase 20 e c0 0 (ec000)
SF: erase 20 e d0 0 (ed000)
SF: erase 20 e e0 0 (ee000)
SF: erase 20 e f0 0 (ef000)
Writing to SPI flash...SF: 0x0bf4dd50 => cmd = { 0x02 0x0e0000 }
chunk_len = 256
SF: 0x0bf4de50 => cmd = { 0x02 0x0e0100 } chunk_len = 256
SF: 0x0bf4df50 => cmd = { 0x02 0x0e0200 } chunk_len = 256
SF: 0x0bf4e050 => cmd = { 0x02 0x0e0300 } chunk_len = 256
SF: 0x0bf4e150 => cmd = { 0x02 0x0e0400 } chunk_len = 256
SF: 0x0bf4e250 => cmd = { 0x02 0x0e0500 } chunk_len = 256
> --- a/drivers/mtd/spi/spi_flash.c
> +++ b/drivers/mtd/spi/spi_flash.c
> @@ -1021,11 +1021,7 @@ int spi_flash_scan(struct spi_flash *flash)
> return -EPROTONOSUPPORT;
> }
>
> - /* Flash powers up read-only, so clear BP# bits */
> - if (idcode[0] == SPI_FLASH_CFI_MFR_ATMEL ||
> - idcode[0] == SPI_FLASH_CFI_MFR_MACRONIX ||
> - idcode[0] == SPI_FLASH_CFI_MFR_SST)
> - write_sr(flash, 0);
> + write_sr(flash, 0);
>
> /* Assign spi data */
> flash->name = params->name;
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
next prev parent reply other threads:[~2016-05-30 20:25 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-29 20:40 [U-Boot] Between 2015.10 and 2016.01, SPI flash changed erase size, and saveenv stopped working Pavel Machek
2016-05-30 3:21 ` Stefan Roese
2016-05-30 7:04 ` Pavel Machek
2016-05-30 8:33 ` Pavel Machek
2016-05-30 8:52 ` Pavel Machek
2016-05-30 13:43 ` Fabio Estevam
2016-05-30 20:25 ` Pavel Machek [this message]
2016-05-30 21:23 ` Fabio Estevam
2016-06-01 21:24 ` [U-Boot] socfpga 2016.07-rc0: have to disable parts of flash probing and limit read size to get SPL to work Pavel Machek
2016-06-02 13:41 ` [U-Boot] Between 2015.10 and 2016.01, SPI flash changed erase size, and saveenv stopped working Pavel Machek
2016-06-04 20:38 ` Fabio Estevam
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=20160530202513.GB25685@amd \
--to=pavel@denx.de \
--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