spi: airoha: en7523: workaround flash damaging if UART_TXD was short to GND
authorMikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Sun, 9 Nov 2025 07:06:58 +0000 (10:06 +0300)
committerMichael Trimarchi <michael@amarulasolutions.com>
Tue, 18 Nov 2025 19:07:41 +0000 (20:07 +0100)
commit19548adfe9ea1d12963b3959b8ad2c94a4647878
tree43b1240d5fe356ba9cb56943eed2c68a339aa44f
parentb49b859ecb76bbee8d1eb82f8a8909a5e72e1b50
spi: airoha: en7523: workaround flash damaging if UART_TXD was short to GND

We found that some serial console may pull TX line to GROUND during board
boot time. Airoha uses TX line as one of it's BOOT pins. This will lead
to booting in RESERVED boot mode.

It was found that some flashes operates incorrectly in RESERVED mode.
Micron and Skyhigh flashes are definitely affected by the issue,
Winbond flashes are NOT affected.

Details:
--------
DMA reading of odd pages on affected flashes operates incorrectly. Page
reading offset (start of the page) on hardware level is replaced by 0x10.
Thus results in incorrect data reading. Usage of UBI make things even
worse. Any attempt to access UBI leads to ubi damaging. As result OS loading
becomes impossible.

Non-DMA reading is OK.

This patch detects booting in reserved mode, turn off DMA and print big
fat warning.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
drivers/spi/airoha_snfi_spi.c