[OpenWrt-Devel] Issues backporting 4-byte opcode support for w25q256 fix to 4.14 kernel and Lima board

Aleksander Morgado aleksander at aleksander.es
Fri May 1 09:47:47 EDT 2020

Hey Mantas,

I'm working on porting your 4-byte opcode support fix for the w25q256
(in openwrt git master, 4745969ad7c0cb65f55c8de1f05eba786ca27f71) to
the 4.14 kernel used in 19.07 for the Lima board.

The port is relatively easy just adding the post-bfpt parsing hook,
but I'm stuck much earlier than that. In the Lima board I'm testing
with (with a w25q256jv), the BFPT parsing is not even done. I've added
several logs along the spi-nor codebase to see why that happened, and
surprisingly the SFDP header version check done in
spi_nor_parse_sfdp() is failing; the header version read is 0xff000010

[    0.862552] m25p80 spi0.0: found w25q256, expected m25p80
[    0.868205] m25p80 spi0.0: running spi_nor_init_params...
[    0.873799] m25p80 spi0.0: info->flags SPI_NOR_DUAL_READ |
[    0.881522] m25p80 spi0.0: info->flags !SPI_NOR_SKIP_SFDP: yes
[    0.887553] m25p80 spi0.0: will parse SFDP
[    0.891780] m25p80 spi0.0: parsing SFDP...
[    0.896047] m25p80 spi0.0: SFDP header version check failed...
signature 0xff000010 (!= 0x50444653), major 0 (!= 1)
[    0.916268] m25p80 spi0.0: running spi_nor_setup...
[    0.921319] m25p80 spi0.0: enabling 4 byte addressing mode...
[    0.927294] m25p80 spi0.0: w25q256 (32768 Kbytes)

The outcome is that the 4-byte opcode is not enabled and the spi-nor
ends up running in 4-byte addressing mode instead. Any idea or hint
why this could be happening? Does the 0xff000010 header version value
ring any bell?

If I use the 8devices openwrt git master (v2.10) instead of the
upstream one, which has the original fix you implemented for the
w25q256 support a while ago (commit
02c8ce11bf86dd4a99614ffa0b21f2dadb08b012) I can confirm that the fix
is being applied for the w25q256jv (that implementation dumps a "Using
4B command set" message when opcodes are used). And so, I'm also
assuming that the SFDP header version check is actually succeeding in
this build, as that version check is done before parsing the BFPT. Is
the SFDP header read failing in 19.07 for some reason I don't yet

I also tried to use openwrt git master with kernel 5.4 but that is not
available yet for the Lima board, only for the Carambola2. Is there
any plan to have the Lima board added to the ath79 target?



openwrt-devel mailing list
openwrt-devel at lists.openwrt.org

More information about the openwrt-devel mailing list