Commit 3f9c5d9
spi: spi-mem: Allow specifying the byte order in DTR mode
There are NOR flashes (Macronix) that swap the bytes on a 16-bit boundary
when configured in DTR mode. The byte order of 16-bit words is swapped
when read or written in Double Transfer Rate (DTR) mode compared to
Single Transfer Rate (STR) mode. If one writes D0 D1 D2 D3 bytes using
1-1-1 mode, and uses 8D-8D-8D SPI mode for reading, it will read back
D1 D0 D3 D2. Swapping the bytes is a bad design decision because this may
introduce some endianness problems. It can affect the boot sequence if the
entire boot sequence is not handled in either 8D-8D-8D mode or 1-1-1 mode.
Fortunately there are controllers that can swap back the bytes at runtime,
fixing the endiannesses. Provide a way for the upper layers to specify the
byte order in DTR mode.
Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
[durai.manickamkr@microchip.com: fixed conflicts while porting from 5.15 to 6.1.4]
Signed-off-by: Durai Manickam KR <durai.manickamkr@microchip.com>
[durai.manickamkr@microchip.com: fixed conflicts and ported to 6.6.9]
Signed-off-by: Durai Manickam KR <durai.manickamkr@microchip.com>1 parent e3c0f88 commit 3f9c5d9
1 file changed
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| 93 | + | |
| 94 | + | |
93 | 95 | | |
94 | 96 | | |
95 | 97 | | |
| |||
125 | 127 | | |
126 | 128 | | |
127 | 129 | | |
| 130 | + | |
128 | 131 | | |
129 | 132 | | |
130 | 133 | | |
| |||
0 commit comments