All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Morgan <macromorgan@hotmail.com>
To: Tudor.Ambarus@microchip.com
Cc: vigneshr@ti.com, jaimeliao@mxic.com.tw, richard@nod.at,
	esben@geanix.com, linux@rasmusvillemoes.dk, knaerzche@gmail.com,
	Nicolas.Ferre@microchip.com, michael@walle.cc,
	linux-mtd@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org, code@reto-schneider.ch,
	miquel.raynal@bootlin.com, heiko.thiery@gmail.com, sr@denx.de,
	p.yadav@ti.com, mail@david-bauer.net, zhengxunli@mxic.com.tw
Subject: Re: [PATCH v4 6/6] mtd: spi-nor: manuf-id-collisions: Add support for xt25f128b
Date: Thu, 3 Mar 2022 20:23:26 -0600	[thread overview]
Message-ID: <SN6PR06MB53420A7847CD3D45A31D84ECA5059@SN6PR06MB5342.namprd06.prod.outlook.com> (raw)
In-Reply-To: <1e78a5bf-8948-c998-8275-87bbf841c304@microchip.com>

On Thu, Mar 03, 2022 at 11:50:34PM +0000, Tudor.Ambarus@microchip.com wrote:
> On 3/3/22 23:04, Chris Morgan wrote:
> > EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> > 
> > On Tue, Mar 01, 2022 at 11:23:24PM +0100, Michael Walle wrote:
> >> Am 2022-02-28 14:45, schrieb Tudor Ambarus:
> >>> Flash does not support continuation codes and may collide with a flash
> >>> of other manufacturer, Intersil being an example. Add support for
> >>> xt25f128b.
> >>>
> >>> Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
> >>> ---
> >>> 0000000 4653 5044 0100 ff01 0000 0901 0030 ff00
> >>> 0000010 000b 0301 0060 ff00 ffff ffff ffff ffff
> >>> 0000020 ffff ffff ffff ffff ffff ffff ffff ffff
> >>> 0000030 20e5 fff1 ffff 07ff eb44 6b08 3b08 bb42
> >>> 0000040 ffee ffff ffff ff00 ffff ff00 200c 520f
> >>> 0000050 d810 ff00 ffff ffff ffff ffff ffff ffff
> >>> 0000060 3600 2700 f99f 6477 e8d9 ffff
> >>
> >> You don't have this flash no? because the md5sum is
> >> missing.
> > 
> > I have this flash, what do you need from me?
> 
> Hi, Chris,
> 
> Thanks for getting back!
> 
> I would need you to dump all the SPI NOR sysfs entries and then do a little
> test. Here's an example:
> # cat /sys/devices/platform/soc@0/30800000.bus/30bb0000.spi/spi_master/spi0/spi0.0/spi-nor/jedec_id
> c22018
> # cat /sys/devices/platform/soc@0/30800000.bus/30bb0000.spi/spi_master/spi0/spi0.0/spi-nor/manufacturer
> macronix
> # cat /sys/devices/platform/soc@0/30800000.bus/30bb0000.spi/spi_master/spi0/spi0.0/spi-nor/partname
> mx25l12835f
> # xxd -p /sys/devices/platform/soc@0/30800000.bus/30bb0000.spi/spi_master/spi0/spi0.0/spi-nor/sfdp
> 53464450000101ff00000109300000ffc2000104600000ffffffffffffff
> ffffffffffffffffffffffffffffffffffffe520f1ffffffff0744eb086b
> 083b04bbfeffffffffff00ffffff44eb0c200f5210d800ffffffffffffff
> ffffffffffff003600279df9c06485cbffffffffffff
> # sha1sum  /sys/devices/platform/soc@0/30800000.bus/30bb0000.spi/spi_master/spi0/spi0.0/spi-nor/sfdp
> c5e5abe6c5650a9d9c448690b1eeebdf5bfe57d4
> /sys/devices/platform/soc@0/30800000.bus/30bb0000.spi/spi_master/spi0/spi0.0/spi-nor/sfdp
> 
> And then an erase, write, read back and compare test.
> 1/ generate a 6M file:
> dd if=/dev/urandom of=./nor_test bs=1M count=6
> 2/ read first 6MB from flash and check if is already erased:
> time mtd_debug read /dev/mtd5 0 6291456 nor_read
> hexdump nor_read
> 	If at the hexdump you'll see anything that just 0xff, the flash has
> something written to it and you can go to step 3. If you'll see just 0xff
> data, then jump at 4/
> 
> 3/ verify if the erase is successful, then do a write, read-back and compare test.
> time mtd_debug erase /dev/mtd5 0 6291456
> time mtd_debug read /dev/mtd5 0 6291456 nor_read
> hexdump nor_read
> time mtd_debug write /dev/mtd5 0 6291456 nor_test
> time mtd_debug read /dev/mtd5 0 6291456 nor_read
> sha1sum nor_test nor_read
> 
> If you reached here the test ends, you can ignore 4/.
> 
> 4/ if you reached here the first 6MB of the flash is already erased. Do a write
> read back and compare test, followed by an erase test:
> time mtd_debug write /dev/mtd5 0 6291456 nor_test
> time mtd_debug read /dev/mtd5 0 6291456 nor_read
> sha1sum nor_test nor_read
> time mtd_debug erase /dev/mtd5 0 6291456
> time mtd_debug read /dev/mtd5 0 6291456 nor_read
> hexdump nor_read

Looks good to me. See below for test outputs. Thank you for all your hard work
on this.

Tested-by: Chris Morgan <macromorgan@hotmail.com>

# cat /sys/bus/spi/devices/spi2.0/spi-nor/jedec_id
0b4018

# cat /sys/bus/spi/devices/spi2.0/spi-nor/manufacturer
xtx

# cat /sys/bus/spi/devices/spi2.0/spi-nor/partname
xt25f128b

# xxd -p /sys/bus/spi/devices/spi2.0/spi-nor/sfdp
53464450000101ff00000109300000ff0b000103600000ffffffffffffff
ffffffffffffffffffffffffffffffffffffe520f1ffffffff0744eb086b
083b42bbeeffffffffff00ffffff00ff0c200f5210d800ffffffffffffff
ffffffffffff003600279ff97764d9e8ffff

# sha1sum /sys/bus/spi/devices/spi2.0/spi-nor/sfdp
191346c29bddd9ea16bc59727c390df50687313f  /sys/bus/spi/devices/spi2.0/spi-nor/sfdp

# time mtd_debug erase /dev/mtd0 0 6291456
Erased 6291456 bytes from address 0x00000000 in flash

real    2m7.957s
user    0m0.001s
sys     2m7.868s

# time mtd_debug read /dev/mtd0 0 6291456 nor_read
Copied 6291456 bytes from address 0x00000000 in flash to nor_read

real    0m0.785s
user    0m0.000s
sys     0m0.259s

# hexdump nor_read
0000000 ffff ffff ffff ffff ffff ffff ffff ffff
*
0600000

# time mtd_debug write /dev/mtd0 0 6291456 nor_test
Copied 6291456 bytes from nor_test to address 0x00000000 in flash

real    0m8.851s
user    0m0.000s
sys     0m6.020s

# time mtd_debug read /dev/mtd0 0 6291456 nor_read
Copied 6291456 bytes from address 0x00000000 in flash to nor_read

real    0m0.811s
user    0m0.000s
sys     0m0.285s

# sha1sum nor_test nor_read
1404362fff3b2f8a79f8090901a5276e66598b72  nor_test
1404362fff3b2f8a79f8090901a5276e66598b72  nor_read

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

WARNING: multiple messages have this Message-ID (diff)
From: Chris Morgan <macromorgan@hotmail.com>
To: Tudor.Ambarus@microchip.com
Cc: vigneshr@ti.com, jaimeliao@mxic.com.tw, richard@nod.at,
	esben@geanix.com, linux@rasmusvillemoes.dk, knaerzche@gmail.com,
	michael@walle.cc, linux-mtd@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org, code@reto-schneider.ch,
	miquel.raynal@bootlin.com, heiko.thiery@gmail.com, sr@denx.de,
	figgyc@figgyc.uk, p.yadav@ti.com, mail@david-bauer.net,
	zhengxunli@mxic.com.tw
Subject: Re: [PATCH v4 6/6] mtd: spi-nor: manuf-id-collisions: Add support for xt25f128b
Date: Thu, 3 Mar 2022 20:23:26 -0600	[thread overview]
Message-ID: <SN6PR06MB53420A7847CD3D45A31D84ECA5059@SN6PR06MB5342.namprd06.prod.outlook.com> (raw)
In-Reply-To: <1e78a5bf-8948-c998-8275-87bbf841c304@microchip.com>

On Thu, Mar 03, 2022 at 11:50:34PM +0000, Tudor.Ambarus@microchip.com wrote:
> On 3/3/22 23:04, Chris Morgan wrote:
> > EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> > 
> > On Tue, Mar 01, 2022 at 11:23:24PM +0100, Michael Walle wrote:
> >> Am 2022-02-28 14:45, schrieb Tudor Ambarus:
> >>> Flash does not support continuation codes and may collide with a flash
> >>> of other manufacturer, Intersil being an example. Add support for
> >>> xt25f128b.
> >>>
> >>> Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
> >>> ---
> >>> 0000000 4653 5044 0100 ff01 0000 0901 0030 ff00
> >>> 0000010 000b 0301 0060 ff00 ffff ffff ffff ffff
> >>> 0000020 ffff ffff ffff ffff ffff ffff ffff ffff
> >>> 0000030 20e5 fff1 ffff 07ff eb44 6b08 3b08 bb42
> >>> 0000040 ffee ffff ffff ff00 ffff ff00 200c 520f
> >>> 0000050 d810 ff00 ffff ffff ffff ffff ffff ffff
> >>> 0000060 3600 2700 f99f 6477 e8d9 ffff
> >>
> >> You don't have this flash no? because the md5sum is
> >> missing.
> > 
> > I have this flash, what do you need from me?
> 
> Hi, Chris,
> 
> Thanks for getting back!
> 
> I would need you to dump all the SPI NOR sysfs entries and then do a little
> test. Here's an example:
> # cat /sys/devices/platform/soc@0/30800000.bus/30bb0000.spi/spi_master/spi0/spi0.0/spi-nor/jedec_id
> c22018
> # cat /sys/devices/platform/soc@0/30800000.bus/30bb0000.spi/spi_master/spi0/spi0.0/spi-nor/manufacturer
> macronix
> # cat /sys/devices/platform/soc@0/30800000.bus/30bb0000.spi/spi_master/spi0/spi0.0/spi-nor/partname
> mx25l12835f
> # xxd -p /sys/devices/platform/soc@0/30800000.bus/30bb0000.spi/spi_master/spi0/spi0.0/spi-nor/sfdp
> 53464450000101ff00000109300000ffc2000104600000ffffffffffffff
> ffffffffffffffffffffffffffffffffffffe520f1ffffffff0744eb086b
> 083b04bbfeffffffffff00ffffff44eb0c200f5210d800ffffffffffffff
> ffffffffffff003600279df9c06485cbffffffffffff
> # sha1sum  /sys/devices/platform/soc@0/30800000.bus/30bb0000.spi/spi_master/spi0/spi0.0/spi-nor/sfdp
> c5e5abe6c5650a9d9c448690b1eeebdf5bfe57d4
> /sys/devices/platform/soc@0/30800000.bus/30bb0000.spi/spi_master/spi0/spi0.0/spi-nor/sfdp
> 
> And then an erase, write, read back and compare test.
> 1/ generate a 6M file:
> dd if=/dev/urandom of=./nor_test bs=1M count=6
> 2/ read first 6MB from flash and check if is already erased:
> time mtd_debug read /dev/mtd5 0 6291456 nor_read
> hexdump nor_read
> 	If at the hexdump you'll see anything that just 0xff, the flash has
> something written to it and you can go to step 3. If you'll see just 0xff
> data, then jump at 4/
> 
> 3/ verify if the erase is successful, then do a write, read-back and compare test.
> time mtd_debug erase /dev/mtd5 0 6291456
> time mtd_debug read /dev/mtd5 0 6291456 nor_read
> hexdump nor_read
> time mtd_debug write /dev/mtd5 0 6291456 nor_test
> time mtd_debug read /dev/mtd5 0 6291456 nor_read
> sha1sum nor_test nor_read
> 
> If you reached here the test ends, you can ignore 4/.
> 
> 4/ if you reached here the first 6MB of the flash is already erased. Do a write
> read back and compare test, followed by an erase test:
> time mtd_debug write /dev/mtd5 0 6291456 nor_test
> time mtd_debug read /dev/mtd5 0 6291456 nor_read
> sha1sum nor_test nor_read
> time mtd_debug erase /dev/mtd5 0 6291456
> time mtd_debug read /dev/mtd5 0 6291456 nor_read
> hexdump nor_read

Looks good to me. See below for test outputs. Thank you for all your hard work
on this.

Tested-by: Chris Morgan <macromorgan@hotmail.com>

# cat /sys/bus/spi/devices/spi2.0/spi-nor/jedec_id
0b4018

# cat /sys/bus/spi/devices/spi2.0/spi-nor/manufacturer
xtx

# cat /sys/bus/spi/devices/spi2.0/spi-nor/partname
xt25f128b

# xxd -p /sys/bus/spi/devices/spi2.0/spi-nor/sfdp
53464450000101ff00000109300000ff0b000103600000ffffffffffffff
ffffffffffffffffffffffffffffffffffffe520f1ffffffff0744eb086b
083b42bbeeffffffffff00ffffff00ff0c200f5210d800ffffffffffffff
ffffffffffff003600279ff97764d9e8ffff

# sha1sum /sys/bus/spi/devices/spi2.0/spi-nor/sfdp
191346c29bddd9ea16bc59727c390df50687313f  /sys/bus/spi/devices/spi2.0/spi-nor/sfdp

# time mtd_debug erase /dev/mtd0 0 6291456
Erased 6291456 bytes from address 0x00000000 in flash

real    2m7.957s
user    0m0.001s
sys     2m7.868s

# time mtd_debug read /dev/mtd0 0 6291456 nor_read
Copied 6291456 bytes from address 0x00000000 in flash to nor_read

real    0m0.785s
user    0m0.000s
sys     0m0.259s

# hexdump nor_read
0000000 ffff ffff ffff ffff ffff ffff ffff ffff
*
0600000

# time mtd_debug write /dev/mtd0 0 6291456 nor_test
Copied 6291456 bytes from nor_test to address 0x00000000 in flash

real    0m8.851s
user    0m0.000s
sys     0m6.020s

# time mtd_debug read /dev/mtd0 0 6291456 nor_read
Copied 6291456 bytes from address 0x00000000 in flash to nor_read

real    0m0.811s
user    0m0.000s
sys     0m0.285s

# sha1sum nor_test nor_read
1404362fff3b2f8a79f8090901a5276e66598b72  nor_test
1404362fff3b2f8a79f8090901a5276e66598b72  nor_read

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2022-03-04  2:38 UTC|newest]

Thread overview: 80+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-28 13:44 [PATCH v4 0/6] mtd: spi-nor: Handle ID collisions Tudor Ambarus
2022-02-28 13:44 ` Tudor Ambarus
2022-02-28 13:45 ` [PATCH v4 1/6] mtd: spi-nor: core: Report correct name in case of " Tudor Ambarus
2022-02-28 13:45   ` Tudor Ambarus
2022-03-01 21:38   ` Michael Walle
2022-03-01 21:38     ` Michael Walle
2022-04-05 19:41   ` Pratyush Yadav
2022-04-05 19:41     ` Pratyush Yadav
2022-02-28 13:45 ` [PATCH v4 2/6] mtd: spi-nor: core: Handle ID collisions between SFDP & non-SFDP flashes Tudor Ambarus
2022-02-28 13:45   ` Tudor Ambarus
2022-03-01 21:52   ` Michael Walle
2022-03-01 21:52     ` Michael Walle
2022-03-03 14:41     ` Tudor.Ambarus
2022-03-03 14:41       ` Tudor.Ambarus
2022-03-03 14:51       ` Michael Walle
2022-03-03 14:51         ` Michael Walle
2022-03-03 15:25         ` Tudor.Ambarus
2022-03-03 15:25           ` Tudor.Ambarus
2022-03-03 15:42           ` Michael Walle
2022-03-03 15:42             ` Michael Walle
2022-03-03 16:03             ` Tudor.Ambarus
2022-03-03 16:03               ` Tudor.Ambarus
2022-03-03 16:39               ` Michael Walle
2022-03-03 16:39                 ` Michael Walle
2022-02-28 13:45 ` [PATCH v4 3/6] mtd: spi-nor: macronix: Handle ID collision b/w MX25L3233F and MX25L3205D Tudor Ambarus
2022-02-28 13:45   ` Tudor Ambarus
2022-03-01 21:57   ` Michael Walle
2022-03-01 21:57     ` Michael Walle
2022-03-03 15:28     ` Tudor.Ambarus
2022-03-03 15:28       ` Tudor.Ambarus
2022-03-03 15:33       ` Michael Walle
2022-03-03 15:33         ` Michael Walle
     [not found]         ` <CAEyMn7aN+wJnYkTJU_nWA9bPzF1sezA9_=E5YG5rnPBLMAmabA@mail.gmail.com>
2022-03-03 16:45           ` Michael Walle
2022-03-03 16:45             ` Michael Walle
2022-03-04  0:36             ` Tudor.Ambarus
2022-03-04  0:36               ` Tudor.Ambarus
2022-03-04 14:36               ` Michael Walle
2022-03-04 14:36                 ` Michael Walle
2022-04-05 19:50                 ` Pratyush Yadav
2022-04-05 19:50                   ` Pratyush Yadav
2022-02-28 13:45 ` [PATCH v4 4/6] mtd: spi-nor: macronix: Handle ID collision b/w MX25L12805D and MX25L12835F Tudor Ambarus
2022-02-28 13:45   ` Tudor Ambarus
2022-03-01  7:55   ` Heiko Thiery
2022-03-01  7:55     ` Heiko Thiery
2022-03-01  8:52     ` Tudor.Ambarus
2022-03-01  8:52       ` Tudor.Ambarus
2022-03-01  9:31       ` Heiko Thiery
2022-03-01  9:31         ` Heiko Thiery
2022-02-28 13:45 ` [PATCH v4 5/6] mtd: spi-nor: Introduce Manufacturer ID collisions driver Tudor Ambarus
2022-02-28 13:45   ` Tudor Ambarus
2022-03-01 22:19   ` Michael Walle
2022-03-01 22:19     ` Michael Walle
2022-03-03 16:12     ` Tudor.Ambarus
2022-03-03 16:12       ` Tudor.Ambarus
2022-03-03 21:38       ` Michael Walle
2022-03-03 21:38         ` Michael Walle
2022-03-04  7:07         ` Tudor.Ambarus
2022-03-04  7:07           ` Tudor.Ambarus
2022-03-04 14:10           ` Michael Walle
2022-03-04 14:10             ` Michael Walle
2022-03-04 21:20   ` George Brooke
2022-03-04 21:20     ` George Brooke
2022-03-07  7:07     ` Tudor.Ambarus
2022-03-07  7:07       ` Tudor.Ambarus
2022-02-28 13:45 ` [PATCH v4 6/6] mtd: spi-nor: manuf-id-collisions: Add support for xt25f128b Tudor Ambarus
2022-02-28 13:45   ` Tudor Ambarus
2022-03-01 22:23   ` Michael Walle
2022-03-01 22:23     ` Michael Walle
2022-03-03 21:04     ` Chris Morgan
2022-03-03 21:04       ` Chris Morgan
2022-03-03 23:50       ` Tudor.Ambarus
2022-03-03 23:50         ` Tudor.Ambarus
2022-03-04  2:23         ` Chris Morgan [this message]
2022-03-04  2:23           ` Chris Morgan
2022-02-28 13:55 ` [PATCH v4 0/6] mtd: spi-nor: Handle ID collisions Michael Walle
2022-02-28 13:55   ` Michael Walle
2022-02-28 15:39   ` [PATCH] mtd: spi-nor: Move XMC to manufacturer ID collisions driver Tudor Ambarus
2022-02-28 15:39     ` Tudor Ambarus
2022-03-01  6:47   ` [PATCH v2] " Tudor Ambarus
2022-03-01  6:47     ` Tudor Ambarus

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=SN6PR06MB53420A7847CD3D45A31D84ECA5059@SN6PR06MB5342.namprd06.prod.outlook.com \
    --to=macromorgan@hotmail.com \
    --cc=Nicolas.Ferre@microchip.com \
    --cc=Tudor.Ambarus@microchip.com \
    --cc=code@reto-schneider.ch \
    --cc=esben@geanix.com \
    --cc=heiko.thiery@gmail.com \
    --cc=jaimeliao@mxic.com.tw \
    --cc=knaerzche@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=mail@david-bauer.net \
    --cc=michael@walle.cc \
    --cc=miquel.raynal@bootlin.com \
    --cc=p.yadav@ti.com \
    --cc=richard@nod.at \
    --cc=sr@denx.de \
    --cc=vigneshr@ti.com \
    --cc=zhengxunli@mxic.com.tw \
    /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.