From: <Tudor.Ambarus@microchip.com>
To: <geert@linux-m68k.org>
Cc: linux-renesas-soc@vger.kernel.org, jonas@norrbonn.se,
linux-mtd@lists.infradead.org, marek.vasut+renesas@gmail.com
Subject: Re: [PATCH v4 2/3] spi-nor: s25fl512s supports region locking
Date: Thu, 9 May 2019 10:31:41 +0000 [thread overview]
Message-ID: <7649e84f-debb-cec8-d6d6-d33d9dce4259@microchip.com> (raw)
In-Reply-To: <CAMuHMdVBguF4ZQHTqwr6GAJKuUcvBGu-5p0GeYRmZ3dG8tXa2g@mail.gmail.com>
Hi, Geert,
On 05/09/2019 12:11 PM, Geert Uytterhoeven wrote:
> External E-Mail
>
>
> Hi Tudor,
>
> On Thu, May 9, 2019 at 8:56 AM <Tudor.Ambarus@microchip.com> wrote:
>> When the configuration register QUAD bit CR[1] is 1, only the WRR command format
>> with 16 data bits may be used, WRR with 8 bits is not recognized and hence the
>> FFs. You probably set quad bit in u-boot, while others don't. We can verify this
>> assumption with the patch form below. Can you try it?
>
> Thanks!
>
>> --- a/drivers/mtd/spi-nor/spi-nor.c
>> +++ b/drivers/mtd/spi-nor/spi-nor.c
>
>> +static int spi_nor_clear_block_protection(struct spi_nor *nor)
>> +{
>> + int ret;
>> + u8 sr, cr, sr_cr[2] = {0};
>> + u8 mask = SR_BP2 | SR_BP1 | SR_BP0;
>> +
>> + ret = read_cr(nor);
>> + dev_dbg(nor->dev, "CR = %08x\n", ret);
>> + if (ret < 0) {
>> + dev_err(nor->dev, "error while reading CR\n");
>> + return ret;
>> + }
>> + cr = ret;
>> +
>> + if (cr & CR_QUAD_EN_SPAN) {
>> + /* disable quad if already set, must do it with 16-bit WRR */
>> + ret = write_sr_cr(nor, sr_cr);
>> + if (ret) {
>> + dev_err(nor->dev, "error diasbling quad mode\n");
>
> disabling
>
>> + return ret;
>> + }
>
> renesas_spi e6b10000.spi: DMA available
> renesas_spi e6b10000.spi: registered master spi0
> spi spi0.0: setup mode 3, 8 bits/w, 30000000 Hz max --> 0
> m25p80 spi0.0: bfpt.dwords[1] = ffffffff
> m25p80 spi0.0: bfpt.dwords[2] = ffffffff
> m25p80 spi0.0: bfpt.dwords[3] = ffffffff
> m25p80 spi0.0: bfpt.dwords[4] = ffffffff
> m25p80 spi0.0: bfpt.dwords[5] = ffffffff
> m25p80 spi0.0: bfpt.dwords[6] = ffffffff
> m25p80 spi0.0: bfpt.dwords[7] = ffffffff
> m25p80 spi0.0: bfpt.dwords[8] = ffffffff
> m25p80 spi0.0: bfpt.dwords[9] = ffffffff
> m25p80 spi0.0: bfpt.dwords[10] = 00000000
> m25p80 spi0.0: bfpt.dwords[11] = 00000000
> m25p80 spi0.0: bfpt.dwords[12] = 00000000
> m25p80 spi0.0: bfpt.dwords[13] = 00000000
> m25p80 spi0.0: bfpt.dwords[14] = 00000000
> m25p80 spi0.0: bfpt.dwords[15] = 00000000
> m25p80 spi0.0: bfpt.dwords[16] = 00000000
> m25p80 spi0.0: failed to parse BFPT: err = -22
> m25p80 spi0.0: spi_nor_init_params sfdp parse failed, ret =-22
> m25p80 spi0.0: SR and CR before quad_enable:
> m25p80 spi0.0: SR = 00000000
> m25p80 spi0.0: CR = 00000002
> m25p80 spi0.0: SR and CR after quad_enable:
> m25p80 spi0.0: SR = 00000000
> m25p80 spi0.0: CR = 00000002
> m25p80 spi0.0: s25fl512s (65536 Kbytes)
> m25p80 spi0.0: mtd .name = spi0.0, .size = 0x4000000 (64MiB),
> .erasesize = 0x00040000 (256KiB) .numeraseregions = 0
> 3 fixed-partitions partitions found on MTD device spi0.0
> Creating 3 MTD partitions on "spi0.0":
> 0x000000000000-0x000000080000 : "loader"
> 0x000000080000-0x000000600000 : "user"
> 0x000000600000-0x000004000000 : "flash"
> renesas_spi e6b10000.spi: registered child spi0.0
> renesas_spi e6b10000.spi: probed
>
> And /dev/mtd0 reading works fine.
> Thanks!
>
I'm glad that it worked, thanks for the help. I'll do a patch to fix this case,
but probably it will qualify for -next. Is -next ok for you?
Cheers,
ta
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
WARNING: multiple messages have this Message-ID (diff)
From: <Tudor.Ambarus@microchip.com>
To: <geert@linux-m68k.org>
Cc: <linux-renesas-soc@vger.kernel.org>, <jonas@norrbonn.se>,
<linux-mtd@lists.infradead.org>, <marek.vasut+renesas@gmail.com>
Subject: Re: [PATCH v4 2/3] spi-nor: s25fl512s supports region locking
Date: Thu, 9 May 2019 10:31:41 +0000 [thread overview]
Message-ID: <7649e84f-debb-cec8-d6d6-d33d9dce4259@microchip.com> (raw)
In-Reply-To: <CAMuHMdVBguF4ZQHTqwr6GAJKuUcvBGu-5p0GeYRmZ3dG8tXa2g@mail.gmail.com>
Hi, Geert,
On 05/09/2019 12:11 PM, Geert Uytterhoeven wrote:
> External E-Mail
>
>
> Hi Tudor,
>
> On Thu, May 9, 2019 at 8:56 AM <Tudor.Ambarus@microchip.com> wrote:
>> When the configuration register QUAD bit CR[1] is 1, only the WRR command format
>> with 16 data bits may be used, WRR with 8 bits is not recognized and hence the
>> FFs. You probably set quad bit in u-boot, while others don't. We can verify this
>> assumption with the patch form below. Can you try it?
>
> Thanks!
>
>> --- a/drivers/mtd/spi-nor/spi-nor.c
>> +++ b/drivers/mtd/spi-nor/spi-nor.c
>
>> +static int spi_nor_clear_block_protection(struct spi_nor *nor)
>> +{
>> + int ret;
>> + u8 sr, cr, sr_cr[2] = {0};
>> + u8 mask = SR_BP2 | SR_BP1 | SR_BP0;
>> +
>> + ret = read_cr(nor);
>> + dev_dbg(nor->dev, "CR = %08x\n", ret);
>> + if (ret < 0) {
>> + dev_err(nor->dev, "error while reading CR\n");
>> + return ret;
>> + }
>> + cr = ret;
>> +
>> + if (cr & CR_QUAD_EN_SPAN) {
>> + /* disable quad if already set, must do it with 16-bit WRR */
>> + ret = write_sr_cr(nor, sr_cr);
>> + if (ret) {
>> + dev_err(nor->dev, "error diasbling quad mode\n");
>
> disabling
>
>> + return ret;
>> + }
>
> renesas_spi e6b10000.spi: DMA available
> renesas_spi e6b10000.spi: registered master spi0
> spi spi0.0: setup mode 3, 8 bits/w, 30000000 Hz max --> 0
> m25p80 spi0.0: bfpt.dwords[1] = ffffffff
> m25p80 spi0.0: bfpt.dwords[2] = ffffffff
> m25p80 spi0.0: bfpt.dwords[3] = ffffffff
> m25p80 spi0.0: bfpt.dwords[4] = ffffffff
> m25p80 spi0.0: bfpt.dwords[5] = ffffffff
> m25p80 spi0.0: bfpt.dwords[6] = ffffffff
> m25p80 spi0.0: bfpt.dwords[7] = ffffffff
> m25p80 spi0.0: bfpt.dwords[8] = ffffffff
> m25p80 spi0.0: bfpt.dwords[9] = ffffffff
> m25p80 spi0.0: bfpt.dwords[10] = 00000000
> m25p80 spi0.0: bfpt.dwords[11] = 00000000
> m25p80 spi0.0: bfpt.dwords[12] = 00000000
> m25p80 spi0.0: bfpt.dwords[13] = 00000000
> m25p80 spi0.0: bfpt.dwords[14] = 00000000
> m25p80 spi0.0: bfpt.dwords[15] = 00000000
> m25p80 spi0.0: bfpt.dwords[16] = 00000000
> m25p80 spi0.0: failed to parse BFPT: err = -22
> m25p80 spi0.0: spi_nor_init_params sfdp parse failed, ret =-22
> m25p80 spi0.0: SR and CR before quad_enable:
> m25p80 spi0.0: SR = 00000000
> m25p80 spi0.0: CR = 00000002
> m25p80 spi0.0: SR and CR after quad_enable:
> m25p80 spi0.0: SR = 00000000
> m25p80 spi0.0: CR = 00000002
> m25p80 spi0.0: s25fl512s (65536 Kbytes)
> m25p80 spi0.0: mtd .name = spi0.0, .size = 0x4000000 (64MiB),
> .erasesize = 0x00040000 (256KiB) .numeraseregions = 0
> 3 fixed-partitions partitions found on MTD device spi0.0
> Creating 3 MTD partitions on "spi0.0":
> 0x000000000000-0x000000080000 : "loader"
> 0x000000080000-0x000000600000 : "user"
> 0x000000600000-0x000004000000 : "flash"
> renesas_spi e6b10000.spi: registered child spi0.0
> renesas_spi e6b10000.spi: probed
>
> And /dev/mtd0 reading works fine.
> Thanks!
>
I'm glad that it worked, thanks for the help. I'll do a patch to fix this case,
but probably it will qualify for -next. Is -next ok for you?
Cheers,
ta
next prev parent reply other threads:[~2019-05-09 10:31 UTC|newest]
Thread overview: 62+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-20 7:16 [PATCH v4 0/3] spi-nor block protection Jonas Bonn
2019-03-20 7:16 ` [PATCH v4 1/3] spi-nor: always respect write-protect input Jonas Bonn
2019-03-20 7:16 ` [PATCH v4 2/3] spi-nor: s25fl512s supports region locking Jonas Bonn
2019-03-20 7:39 ` Tudor.Ambarus
2019-03-21 16:48 ` Tudor.Ambarus
2019-05-07 9:53 ` Geert Uytterhoeven
2019-05-07 9:53 ` Geert Uytterhoeven
2019-05-07 10:42 ` Tudor.Ambarus
2019-05-07 10:42 ` Tudor.Ambarus
2019-05-07 10:50 ` Geert Uytterhoeven
2019-05-07 10:50 ` Geert Uytterhoeven
2019-05-07 11:13 ` Jonas Bonn
2019-05-07 11:13 ` Jonas Bonn
2019-05-07 12:52 ` Geert Uytterhoeven
2019-05-07 12:52 ` Geert Uytterhoeven
2019-05-07 13:15 ` Tudor.Ambarus
2019-05-07 13:15 ` Tudor.Ambarus
2019-05-07 13:18 ` Tudor.Ambarus
2019-05-07 13:18 ` Tudor.Ambarus
2019-05-07 13:25 ` Tudor.Ambarus
2019-05-07 13:25 ` Tudor.Ambarus
2019-05-07 14:33 ` Geert Uytterhoeven
2019-05-07 14:33 ` Geert Uytterhoeven
2019-05-08 10:44 ` Tudor.Ambarus
2019-05-08 10:44 ` Tudor.Ambarus
2019-05-08 13:11 ` Geert Uytterhoeven
2019-05-08 13:11 ` Geert Uytterhoeven
2019-05-08 14:23 ` Tudor.Ambarus
2019-05-08 14:23 ` Tudor.Ambarus
2019-05-08 17:00 ` Geert Uytterhoeven
2019-05-08 17:00 ` Geert Uytterhoeven
2019-05-09 6:55 ` Tudor.Ambarus
2019-05-09 6:55 ` Tudor.Ambarus
2019-05-09 9:11 ` Geert Uytterhoeven
2019-05-09 9:11 ` Geert Uytterhoeven
2019-05-09 10:31 ` Tudor.Ambarus [this message]
2019-05-09 10:31 ` Tudor.Ambarus
2019-05-09 11:12 ` Geert Uytterhoeven
2019-05-09 11:12 ` Geert Uytterhoeven
2019-05-22 15:49 ` Tudor.Ambarus
2019-05-22 15:49 ` Tudor.Ambarus
2019-06-10 6:24 ` [PATCH] mtd: spi-nor: use 16-bit WRR command when QE is set on spansion flashes Tudor.Ambarus
2019-06-10 6:24 ` Tudor.Ambarus
2019-06-10 9:28 ` Jonas Bonn
2019-06-10 9:28 ` Jonas Bonn
2019-06-11 8:35 ` Geert Uytterhoeven
2019-06-11 8:35 ` Geert Uytterhoeven
2019-06-19 15:47 ` Tudor.Ambarus
2019-06-19 15:47 ` Tudor.Ambarus
2019-06-19 17:26 ` [PATCH v2 1/2] " Tudor.Ambarus
2019-06-19 17:26 ` Tudor.Ambarus
2019-06-19 17:26 ` [PATCH v2 2/2] mtd: spi-nor: fix description for int (*flash_is_locked)() Tudor.Ambarus
2019-06-19 17:26 ` Tudor.Ambarus
2019-06-19 18:51 ` [PATCH] mtd: spi-nor: use 16-bit WRR command when QE is set on spansion flashes Geert Uytterhoeven
2019-06-19 18:51 ` Geert Uytterhoeven
2019-06-12 16:46 ` Vignesh Raghavendra
2019-06-12 16:46 ` Vignesh Raghavendra
2019-05-09 15:57 ` [PATCH v4 2/3] spi-nor: s25fl512s supports region locking Vignesh Raghavendra
2019-05-09 15:57 ` Vignesh Raghavendra
2019-03-20 7:16 ` [PATCH v4 3/3] spi-nor: allow setting the BPNV (default locked) bit Jonas Bonn
2019-04-02 5:27 ` Vignesh Raghavendra
2019-05-01 4:42 ` [PATCH v5 1/1] spi-nor: allow setting the BPNV (powerup lock) bit Jonas Bonn
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=7649e84f-debb-cec8-d6d6-d33d9dce4259@microchip.com \
--to=tudor.ambarus@microchip.com \
--cc=geert@linux-m68k.org \
--cc=jonas@norrbonn.se \
--cc=linux-mtd@lists.infradead.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=marek.vasut+renesas@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.