diff options
| author | Mikhail Kshevetskiy <[email protected]> | 2023-01-10 12:58:38 +0100 |
|---|---|---|
| committer | Dario Binacchi <[email protected]> | 2023-10-13 10:49:07 +0200 |
| commit | b20913e3cbc81daa2463c1bd812e568181f6a60a (patch) | |
| tree | 65dd41093a7be392e9acb071b49c58889caca9b7 /include/linux/linux_string.h | |
| parent | 86700279645921fb2c28c41711deb7d7ed75bc29 (diff) | |
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 <[email protected]> patch
submitted to linux kernel
Signed-off-by: Mikhail Kshevetskiy <[email protected]>
Signed-off-by: Frieder Schrempf <[email protected]>
Link: https://lore.kernel.org/all/[email protected]
Signed-off-by: Dario Binacchi <[email protected]>
Diffstat (limited to 'include/linux/linux_string.h')
0 files changed, 0 insertions, 0 deletions
