Message ID | 20211122095020.393346-13-tudor.ambarus@microchip.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | mtd: spi-nor: Clean params init | expand |
Am 2021-11-22 10:50, schrieb Tudor Ambarus: > xxd -p sfdp-gd25q256 > 53464450060102ff00060110300000ffc8000103900000ff84000102c000 > 00ffffffffffffffffffffffffffffffffffe520f3ffffffff0f44eb086b > 083b42bbeeffffffffff00ffffff00ff0c200f5210d800ff4262c9fe82e9 > 1458ec6006337a757a7504bdd55c0006440008500001ffffffffffffffff > ffffffffffffffffffffffffffffffffffffffffffffffff003600279cf9 > 7764fccb58e3ffffffffffffffffffffffffffffffffffffffffffffffff > > sha1sum sfdp-gd25q256 > 9f25eb3b17832b26dbba288f1b07de1f8a42e446 sfdp-gd25q256 something is wrong here: $ cat gigadevice/gd25q256.txt 53464450060102ff00060110300000ffc8000103900000ff84000102c000 00ffffffffffffffffffffffffffffffffffe520f3ffffffff0f44eb086b 083b42bbeeffffffffff00ffffff00ff0c200f5210d800ff4262c9fe82e9 1458ec6006337a757a7504bdd55c0006440008500001ffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffff003600279cf9 7764fccb58e3ffffffffffffffffffffffffffffffffffffffffffffffff $ xxd -r -p gigadevice/gd25q256.txt > gigadevice/gd25q256 $ sha1sum gigadevice/gd25q256 ca4625e284d7cf35fe6b6afe9c7f780b35a5fce7 gigadevice/gd25q256 -michael
diff --git a/drivers/mtd/spi-nor/gigadevice.c b/drivers/mtd/spi-nor/gigadevice.c index 94634797fdd6..e9817233c51f 100644 --- a/drivers/mtd/spi-nor/gigadevice.c +++ b/drivers/mtd/spi-nor/gigadevice.c @@ -53,9 +53,8 @@ static const struct flash_info gigadevice_parts[] = { NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, { "gd25q256", INFO(0xc84019, 0, 64 * 1024, 512) - FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | - SPI_NOR_TB_SR_BIT6) - NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) + PARSE_SFDP + FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR_TB_SR_BIT6) FIXUP_FLAGS(SPI_NOR_4B_OPCODES) .fixups = &gd25q256_fixups }, };
Get rid of the static initialization of the flash parameters and init them when parsing SFDP. Generated a 256 Kbyte random data and did an erase, write, read back and compare test. The flash uses for reads SPINOR_OP_READ_1_4_4_4B 0xec, for erases SPINOR_OP_BE_4K_4B 0x21, and for writes SPINOR_OP_PP_1_1_4_4B 0x34. Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com> --- v4: use new flag macros root@sama5d2-xplained:~# cat /sys/devices/platform/ahb/ahb:apb/f0020000.spi/spi_master/spi1/spi1.0/spi-nor/jedec_id c84019 root@sama5d2-xplained:~# cat /sys/devices/platform/ahb/ahb:apb/f0020000.spi/spi_master/spi1/spi1.0/spi-nor/manufacturer gigadevice root@sama5d2-xplained:~# cat /sys/devices/platform/ahb/ahb:apb/f0020000.spi/spi_master/spi1/spi1.0/spi-nor/partname gd25q256 root@sama5d2-xplained:~# cat /sys/devices/platform/ahb/ahb:apb/f0020000.spi/spi_master/spi1/spi1.0/spi-nor/sfdp > gd25q256-sfdp xxd -p sfdp-gd25q256 53464450060102ff00060110300000ffc8000103900000ff84000102c000 00ffffffffffffffffffffffffffffffffffe520f3ffffffff0f44eb086b 083b42bbeeffffffffff00ffffff00ff0c200f5210d800ff4262c9fe82e9 1458ec6006337a757a7504bdd55c0006440008500001ffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffff003600279cf9 7764fccb58e3ffffffffffffffffffffffffffffffffffffffffffffffff sha1sum sfdp-gd25q256 9f25eb3b17832b26dbba288f1b07de1f8a42e446 sfdp-gd25q256 drivers/mtd/spi-nor/gigadevice.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)