This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SPI Flash recognition in U-Boot

Hello all,

We have a custom DM8168-based board with the SPI interface designed as in reference design. We are trying to get some SPI Flash parts working with this board, but funny things happen.

The parts are Numonyx M25P32 and Eon EN25F80.

Since the default U-Boot from the EZSDK supports Winbond SPI Flashes by default, I disabled it in include/configs/ti8168*, enabled CONFIG_SPI_FLASH_STMICRO and added stmicro.o into drivers/mtd/spi/Makefile. I also lowered the speed to 2 MHz since we are connecting the chip with wires for testing purposes. There are also two 100K pull up resistors for CS# and HOLD# lines, WP is connected directly to VCC and via 100 nF capacitor to ground. That is, the chip connectivity is pretty much default so I believe the hardware is fine.

I also defined DEBUG in main config file to see driver output in console.

So, when I boot the board via SD card and type "sf probe 0", I see that CMD_READ_ID in spi_flash.c returns the array of five zeroes instead of chip identifier. This happens with both chips but it shouldn't. Then, I replaced that call with manual filling of that array using the data from chips' datasheets, and now sf probe "recognizes" the chip and initializes it.

sf erase and sf write commands works without errors, but when I read the written content into RAM and see what has been read, I see all the zeroes. The most interesting thing is that driver outputs no errors in any step, so I believe that the low-level communication actually works, but reading from the SPI Flash, for some reason, doesn't.

Did anyone got into similar situation?

Thanks,
Ivan