mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tudor Ambarus <tudor.ambarus@linaro.org>
To: SHUKLA Mamta Ramendra <mamta.shukla@leica-geosystems.com>,
	"pratyush@kernel.org" <pratyush@kernel.org>,
	"michael@walle.cc" <michael@walle.cc>,
	"miquel.raynal@bootlin.com" <miquel.raynal@bootlin.com>,
	"richard@nod.at" <richard@nod.at>,
	"vigneshr@ti.com" <vigneshr@ti.com>,
	"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: GEO-CHHER-bsp-development  <bsp-development.geo@leica-geosystems.com>
Subject: Re: [PATCH v2] mtd: micron-st: enable lock/unlock for mt25qu512a
Date: Thu, 21 Sep 2023 15:31:43 +0100	[thread overview]
Message-ID: <17989610-d069-40e2-9b4d-7ca6bdf2497e@linaro.org> (raw)
In-Reply-To: <084ed945-7674-280f-5866-9238473a294d@leica-geosystems.com>

Hi, Shukla,

Sorry, this email somehow got off my radar.

On 8/22/23 13:16, SHUKLA Mamta Ramendra wrote:
> 
> On 14.07.23 10:15, SHUKLA Mamta Ramendra wrote:
>> Hello Tudor,
>>
>> On 13.07.23 05:43, Tudor Ambarus wrote:
>>> This email is not from Hexagon’s Office 365 instance. Please be careful while clicking links, opening attachments, or replying to this email.
>>>
>>>
>>> On 05.07.2023 18:49, Mamta Shukla wrote:
>>>> mt25qu512a[1] supports locking/unlocking through BP bits in SR.
>>>>
>>>> Tested using mtd-utils- flash_lock/flash_unlock for MT25QU512ABB8E12.
>>>>
>>>> Link: https://media-www.micron.com/-/media/client/global/documents/products/data-sheet/nor-flash/serial-nor/mt25q/die-rev-b/mt25q_qlkt_u_512_abb_0.pdf?rev=b259aadc3bea49ea8210a41c9ad58211
>>>> Signed-off-by: Mamta Shukla <mamta.shukla@leica-geosystems.com>
>>>> ---
>>>>    Changes in v2:
>>>>    - add Link tag
>>>>    - fix chip part number mt25ql512a->mt25qu512a
>>>>
>>>>    drivers/mtd/spi-nor/micron-st.c | 2 ++
>>>>    1 file changed, 2 insertions(+)
>>>>
>>>> diff --git a/drivers/mtd/spi-nor/micron-st.c b/drivers/mtd/spi-nor/micron-st.c
>>>> index 4b919756a205..08e94340ebaa 100644
>>>> --- a/drivers/mtd/spi-nor/micron-st.c
>>>> +++ b/drivers/mtd/spi-nor/micron-st.c
>>>> @@ -229,6 +229,8 @@ static const struct flash_info st_nor_parts[] = {
>>>>                 MFR_FLAGS(USE_FSR)
>>>>         },
>>>>         { "mt25qu512a",  INFO6(0x20bb20, 0x104400, 64 * 1024, 1024)
>>>> +             FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR_4BIT_BP |
>>>> +                   SPI_NOR_BP3_SR_BIT6)
>>>>                 NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ)
>>>>                 FIXUP_FLAGS(SPI_NOR_4B_OPCODES)
>>>>                 MFR_FLAGS(USE_FSR)
>>>
>>> Can you try the following instead? We try to use SFDP parsing whenever
>>> possible.
>>>           { "mt25qu512a",  INFO6(0x20bb20, 0x104400, 0, 0)
>>>                   FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR_4BIT_BP |
>>>                   SPI_NOR_BP3_SR_BIT6)
>>>                   PARSE_SFDP
>>>                   MFR_FLAGS(USE_FSR)
>>
>>
>> I tested with SFDP Parsing Flag. It works fine.
>>
>> ---------------------------------------------------------------------------------
>> [  214.726090] ACPI: Host-directed Dynamic ACPI Table Load:
>> [  214.731482] ACPI: SSDT 0xFFFF892882D89800 0000EC (v02 ALASKA MT25QU
>> 00001000 INTL 20190509)
>> [  214.766082] spi-nor spi-PRP0001:00: mt25qu512a (65536 Kbytes)
>>
>>
>> cat /sys/bus/spi/devices/spi-PRP0001:00/spi-nor/jedec_id
>> 20bb20104400
>>
>> cat /sys/bus/spi/devices/spi-PRP0001:00/spi-nor/manufacturer
>> st
>>
>> cat /sys/bus/spi/devices/spi-PRP0001:00/spi-nor/partname
>> mt25qu512a
>>
>> xxd -p  /sys/bus/spi/devices/spi-PRP0001:00/spi-nor/sfdp
>> 53464450060101ff00060110300000ff84000102800000ffffffffffffff
>> ffffffffffffffffffffffffffffffffffffe520fbffffffff1f29eb276b
>> 273b27bbffffffffffff27bbffff29eb0c2010d80f520000244a99008b8e
>> 03e1ac0127387a757a75fbbdd55c4a0f82ff81bd3d36ffffffffffffffff
>> ffffffffffffffffffe7ffff21dcffff
>>
>> md5sum  /sys/bus/spi/devices/spi-PRP0001:00/spi-nor/sfdp
>> 610efba1647e00ac6db18beb11e84c04
>> /sys/bus/spi/devices/spi-PRP0001:00/spi-nor/sfdp
>>
>> dd if=/dev/urandom of=/tmp/qspi_write  bs=1M count=1
>> 1+0 records in
>> 1+0 records out
>> 1048576 bytes (1.0 MB, 1.0 MiB) copied, 0.0221391 s, 47.4 MB/s
>>
>> mtd_debug write /dev/mtd0 0 1048576 /tmp/qspi_write
>> Copied 1048576 bytes from /tmp/qspi_write to address 0x00000000 in flash
>>
>> mtd_debug erase /dev/mtd0 0 1048576
>> Erased 1048576 bytes from address 0x00000000 in flash
>>
>> mtd_debug read /dev/mtd0 0 1048576 /tmp/qspi_read
>> Copied 1048576 bytes from address 0x00000000 in flash to /tmp/qspi_read
>>
>> hexdump /tmp/qspi_read
>> 0000000 ffff ffff ffff ffff ffff ffff ffff ffff
>> *
>> 0100000
>>
>> mtd_debug write /dev/mtd0 0 1048576 /tmp/qspi_write
>> Copied 1048576 bytes from /tmp/qspi_write to address 0x00000000 in flash
>>
>> mtd_debug read /dev/mtd0 0 1048576 /tmp/qspi_read
>> Copied 1048576 bytes from address 0x00000000 in flash to /tmp/qspi_read
>>
>> sha1sum /tmp/qspi_write  /tmp/qspi_read
>> 4fe4e71b11f44e9672bd49e2e32c0fd94da4feb6  /tmp/qspi_write
>> 4fe4e71b11f44e9672bd49e2e32c0fd94da4feb6  /tmp/qspi_read
>>
>> ----------------------------------------------------------------------------------
>>
>> Shall I write a new commit for PARSE_SFDP Flag or update this commit as-
>> "Modify mt25qu512a Flags" ?
> 
> 
> Ping! Just to follow up on this.
> 

Yeah, please make 2 commits so that we can cleanly revert the switching
to SFDP, if ever needed.

So the first commit will look like:
diff --git a/drivers/mtd/spi-nor/micron-st.c
b/drivers/mtd/spi-nor/micron-st.c
index 4afcfc57c896..a8da1f18e335 100644
--- a/drivers/mtd/spi-nor/micron-st.c
+++ b/drivers/mtd/spi-nor/micron-st.c
@@ -405,9 +405,6 @@ static const struct flash_info st_nor_parts[] = {
        }, {
                .id = SNOR_ID(0x20, 0xbb, 0x20, 0x10, 0x44, 0x00),
                .name = "mt25qu512a",
-               .size = SZ_64M,
-               .no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ |
SPI_NOR_QUAD_READ,
-               .fixup_flags = SPI_NOR_4B_OPCODES,
                .mfr_flags = USE_FSR,
        }, {
                .id = SNOR_ID(0x20, 0xbb, 0x20),

and the second one will add just the BP support, something like:
diff --git a/drivers/mtd/spi-nor/micron-st.c
b/drivers/mtd/spi-nor/micron-st.c
index a8da1f18e335..fdafbfa0f936 100644
--- a/drivers/mtd/spi-nor/micron-st.c
+++ b/drivers/mtd/spi-nor/micron-st.c
@@ -405,6 +405,8 @@ static const struct flash_info st_nor_parts[] = {
        }, {
                .id = SNOR_ID(0x20, 0xbb, 0x20, 0x10, 0x44, 0x00),
                .name = "mt25qu512a",
+               .flags = SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB |
SPI_NOR_4BIT_BP |
+                        SPI_NOR_BP3_SR_BIT6,
                .mfr_flags = USE_FSR,
        }, {
                .id = SNOR_ID(0x20, 0xbb, 0x20),

Of course, I expect you to run again the mtd_debug tests and also verify
the locking. Thanks!

Cheers,
ta


  reply	other threads:[~2023-09-21 20:21 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-05 15:49 Mamta Shukla
2023-07-06  6:42 ` Michael Walle
2023-07-13  3:43 ` Tudor Ambarus
2023-07-14  8:15   ` SHUKLA Mamta Ramendra
2023-08-22 12:16     ` SHUKLA Mamta Ramendra
2023-09-21 14:31       ` Tudor Ambarus [this message]
2023-09-21 14:35         ` Tudor Ambarus
2023-10-05  9:21         ` SHUKLA Mamta Ramendra
2023-10-05 13:51           ` Tudor Ambarus
2023-10-05 14:21             ` SHUKLA Mamta Ramendra
2023-10-05 14:59               ` Tudor Ambarus
2023-10-06 10:30                 ` SHUKLA Mamta Ramendra
2023-10-06 13:33                   ` Tudor Ambarus
2023-10-06 13:46                     ` Tudor Ambarus
2023-10-06 16:09                       ` SHUKLA Mamta Ramendra
2023-10-09  6:13                         ` Tudor Ambarus
2023-10-16  9:39                           ` SHUKLA Mamta Ramendra
2023-10-17  7:53                             ` Tudor Ambarus
2023-10-17 13:53                               ` SHUKLA Mamta Ramendra

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=17989610-d069-40e2-9b4d-7ca6bdf2497e@linaro.org \
    --to=tudor.ambarus@linaro.org \
    --cc=bsp-development.geo@leica-geosystems.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=mamta.shukla@leica-geosystems.com \
    --cc=michael@walle.cc \
    --cc=miquel.raynal@bootlin.com \
    --cc=pratyush@kernel.org \
    --cc=richard@nod.at \
    --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®