u-boot/include/linux/mtd
Mikhail Kshevetskiy b20913e3cb mtd/spinand: rework detect procedure for different READ_ID operation
Currently there are 3 different variants of read_id implementation:
1. opcode only. Found in GD5FxGQ4xF.
2. opcode + 1 addr byte. Found in GD5GxGQ4xA/E
3. opcode + 1 dummy byte. Found in other currently supported chips.

Original implementation was for variant 1 and let detect function
of chips with variant 2 and 3 to ignore the first byte. This isn't
robust:

1. For chips of variant 2, if SPI master doesn't keep MOSI low
during read, chip will get a random id offset, and the entire id
buffer will shift by that offset, causing detect failure.

2. For chips of variant 1, if it happens to get a devid that equals
to manufacture id of variant 2 or 3 chips, it'll get incorrectly
detected.

This patch reworks detect procedure to address problems above. New
logic do detection for all variants separatedly, in 1-2-3 order.
Since all current detect methods do exactly the same id matching
procedure, unify them into core.c and remove detect method from
manufacture_ops.

This is a rework of Chuanhong Guo <gch981213@gmail.com> patch
submitted to linux kernel

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Link: https://lore.kernel.org/all/20230110115843.391630-1-frieder@fris.de
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
2023-10-13 10:49:07 +02:00
..
bbm.h Convert CONFIG_SYS_NAND_MAX_CHIPS to Kconfig 2021-10-06 09:16:24 -04:00
cfi.h mtd: spi: Port SPI NOR framework from Linux 2019-02-07 15:33:21 +05:30
concat.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
flashchip.h WS cleanup: remove excessive empty lines 2021-09-30 08:08:56 -04:00
mtd.h mtd: Update the function name to 'rfree' 2022-10-09 10:42:26 +02:00
nand.h mtd: nand: drop EXPORT_SYMBOL_GPL for nanddev_erase() 2022-12-10 14:35:55 +01:00
nand_bch.h mtd: nand: Sync with Linux v4.6 2016-06-03 20:27:48 -05:00
nand_ecc.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
omap_gpmc.h memory: Add TI GPMC driver 2022-10-26 15:21:12 -04:00
onenand.h linux/compat.h: rename from linux/mtd/compat.h 2012-04-30 16:54:51 +02:00
onenand_regs.h Flex-OneNAND driver support 2009-11-13 16:56:18 -06:00
partitions.h WS cleanup: remove SPACE(s) followed by TAB 2021-09-30 09:08:16 -04:00
rawnand.h mtd: nand: Rename nand_get_flash_type() into nand_detect() 2022-08-22 11:15:15 +02:00
samsung_onenand.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
spi-nor.h mtd: spi-nor: Add support for Infineon s25fs256t 2023-01-26 21:07:45 +05:30
spinand.h mtd/spinand: rework detect procedure for different READ_ID operation 2023-10-13 10:49:07 +02:00
ubi.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00