Skip to contentSkip to conversation

k210 spi flash regression

DISCUSSION Niklas Cassel 2 participants 2 messages Feb 7, 2022 – Feb 8, 2022

lore
Share & tools
lore
#0 lore raw

Hello Pratyush,

I upgraded u-boot on my k210 maix bit board, and the SPI flash is no longer detected.

I bisected the problem to commit:
d15de623013c ("spi: spi-mem: allow specifying a command's extension")

Before the commit in question, the following was printed:
Loading Environment from SPIFlash... SF: Detected gd25lq128 with page size 256 Bytes, erase size 4 KiB, total 16 MiB
*** Warning - bad CRC, using default environment

After the commit in question, the following is printed:
Loading Environment from SPIFlash... jedec_spi_nor spi-flash@0: unrecognized JEDEC id
bytes: 60, 18, c8
*** Warning - spi_flash_probe_bus_cs() failed, using default environment

Looking at spi-nor-ids.c, the flash is defined like this:
INFO("gd25lq128", 0xc86018, 0, 64 * 1024, 256,
SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB)

So it appears that after your patch, the bytes are coming in the wrong order.

Any suggestions?

Kind regards,
Niklas

#1 lore raw
Quoted 8 lines · Niklas Cassel

Hello Pratyush,

I upgraded u-boot on my k210 maix bit board, and the SPI flash is no longer detected.

I bisected the problem to commit:
d15de623013c ("spi: spi-mem: allow specifying a command's extension")

Hm, this commit is not supposed to make any changes to how things work. It should just add a new field to struct spi_mem_op.cmd.

Can you dump the spi_mem_op passed to spi_mem_exec_op() for reading the ID? Let's see what changed before and after that commit.

Quoted 28 lines

Before the commit in question, the following was printed:
Loading Environment from SPIFlash... SF: Detected gd25lq128 with page size 256 Bytes, erase size 4 KiB, total 16 MiB
*** Warning - bad CRC, using default environment

After the commit in question, the following is printed:
Loading Environment from SPIFlash... jedec_spi_nor spi-flash@0: unrecognized JEDEC id
bytes: 60, 18, c8
*** Warning - spi_flash_probe_bus_cs() failed, using default environment

Looking at spi-nor-ids.c, the flash is defined like this:
INFO("gd25lq128", 0xc86018, 0, 64 * 1024, 256,
SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB)

So it appears that after your patch, the bytes are coming in the wrong order.

Any suggestions?

Kind regards,
Niklas

Signature · 3 lines
Regards,
Pratyush Yadav
Texas Instruments Inc.