1
0
mirror of https://xff.cz/git/u-boot/ synced 2026-01-25 11:25:21 +01:00
Files
u-boot-megous/include/linux
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
..
2019-12-06 16:44:20 -05:00
2019-12-06 16:44:20 -05:00
2019-12-06 16:44:20 -05:00
2021-03-01 09:54:11 -05:00
2018-06-07 17:08:06 -04:00
2023-05-15 14:08:45 -04:00
2018-11-20 13:08:15 +01:00
2017-07-06 16:17:19 -04:00
2021-11-23 09:57:55 +02:00
2022-11-28 10:25:17 -05:00
2019-12-06 16:44:20 -05:00
2021-03-01 09:54:11 -05:00
2018-11-20 13:08:15 +01:00
2017-07-06 16:17:19 -04:00
2023-05-15 14:08:45 -04:00
2022-01-19 18:11:34 +01:00
2023-07-25 12:44:46 -04:00
2019-05-05 08:48:50 -04:00