Repository navigation
hi3516cv6xx: bsp-sfc: do not use quad - #171
Conversation
A Hi3516CV610 with a KH25L12833FM2I-10GY (ID c2 20 18) panics at boot: bsp-sfc bsp_spi_nor.0: spi nor register fail! bsp-sfc: probe of bsp_spi_nor.0 failed with error -5 VFS: Cannot open root device "mtdblock3" or unknown-block(0,0): error -6 The ID already matches mx25l12835f, whose SPI_NOR_QUAD_READ makes spi_nor_init() set QE through spi_nor_sr1_bit6_quad_enable(). OpenIPC U-Boot before u-boot#105 hands over a Macronix part with WEL set, the SR value read back after the write has WEL clear, and the comparison fails with -EIO. A K662C6S shows the same failure (defib#148). Quad gives more problems than benefits on these cameras, and the other OpenIPC kernels already run without it. Take the quad modes out of bsp-sfc, at probe and at resume. spi_nor_quad_enable() then returns early, SR is not written, and the probe no longer depends on the state U-Boot left, so cameras with the old U-Boot boot too. Reads drop to 1-2-2 on this part, at the same 84 MHz. CLOSE_SPI_8PIN_4IO no longer has any effect here: the OpenIPC config leaves it unset, so that alone could not turn quad off from this tree. With no quad in hwcaps, spi_nor_dtrclear_pinreset() now reaches spi_nor_sr3_to_reset() on Winbond and GigaDevice parts. That writes SR3 with no WREN before it, so it should do nothing with WEL clear. Build-tested only: drivers/mtd/spi-nor with the hi3516cv6xx config from OpenIPC/firmware.
PR Summary by Qodohi3516cv6xx: Disable quad SPI in bsp-sfc
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo
1. Flash reset pins stay disabled
|
Refs OpenIPC/defib#148 and OpenIPC/u-boot#105.
Problem
A Hi3516CV610 with a KH25L12833FM2I-10GY (ID
c2 20 18) panics at boot, and a K662C6S shows the same failure:The ID already matches
mx25l12835f, so this is not a missing table entry.Cause
SPI_NOR_QUAD_READon that entry makesspi_nor_init()set QE throughspi_nor_sr1_bit6_quad_enable(). OpenIPC U-Boot before u-boot#105 hands over a Macronix part with WEL set. Linux reads SR0x02and writes0x42; WRSR clears WEL, the read-back gives0x40, and the comparison fails with-EIO.Change
Quad gives more problems than benefits on these cameras, so
bsp-sfcno longer offers it, at probe or at resume.spi_nor_quad_enable()then returns early and SR is not written, so cameras that still have the old U-Boot boot too.Reads on this part drop to 1-2-2 (
0xBB) at 84 MHz, which matches the datasheet's default dummy cycles.Testing
Build-tested only:
drivers/mtd/spi-norwith thehi3516cv6xxconfig from OpenIPC/firmware. Please check on hardware:md5sumin dual mode.spi_nor_dtrclear_pinreset()now reachesspi_nor_sr3_to_reset()there. It writes SR3 with no WREN first, so it should do nothing with WEL clear.CLOSE_SPI_8PIN_4IOno longer has any effect on this branch.