[PATCH v4 6/6] mtd: spi-nor: manuf-id-collisions: Add support for xt25f128b

Tudor.Ambarus at microchip.com Tudor.Ambarus at microchip.com
Thu Mar 3 15:50:34 PST 2022


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 at 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 at 0/30800000.bus/30bb0000.spi/spi_master/spi0/spi0.0/spi-nor/jedec_id
c22018
# cat /sys/devices/platform/soc at 0/30800000.bus/30bb0000.spi/spi_master/spi0/spi0.0/spi-nor/manufacturer
macronix
# cat /sys/devices/platform/soc at 0/30800000.bus/30bb0000.spi/spi_master/spi0/spi0.0/spi-nor/partname
mx25l12835f
# xxd -p /sys/devices/platform/soc at 0/30800000.bus/30bb0000.spi/spi_master/spi0/spi0.0/spi-nor/sfdp
53464450000101ff00000109300000ffc2000104600000ffffffffffffff
ffffffffffffffffffffffffffffffffffffe520f1ffffffff0744eb086b
083b04bbfeffffffffff00ffffff44eb0c200f5210d800ffffffffffffff
ffffffffffff003600279df9c06485cbffffffffffff
# sha1sum  /sys/devices/platform/soc at 0/30800000.bus/30bb0000.spi/spi_master/spi0/spi0.0/spi-nor/sfdp
c5e5abe6c5650a9d9c448690b1eeebdf5bfe57d4
/sys/devices/platform/soc at 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


More information about the linux-mtd mailing list