Showing results for 
Show  only  | Search instead for 
Did you mean: 
Registered: ‎01-05-2015

Petalinux 2014.4 u-boot XILSPI error: spi_xfer: Xfer timeout



I have some troubles loading the flash idcode from an spi-flash in u-boot.

 Setup: fpga is on a custom pcb.  hw system with microblaze 100MHz, axi qspi module running standard mode, transaction-width 8, ratio 16x1, and with fifo with 16 depth.


When booting (with petalinux-boot --jtag --u-boot) I first get a XILSPI error: XILSPI error: spi_xfer: Xfer timeout when trying to fetch the id-code. This is probably from the following lines in the xilinx_spi.c driver:  spi_xfer () function 


while (timeout && readl(&xilspi->regs->spisr)
						& SPISR_RX_EMPTY) {

		if (!timeout) {
			printf("XILSPI error: %s: Xfer timeout\n", __func__);
			return -1;



Later after "Hit any key to stop autoboot", the flash ID is successfully read. Here is the output: 


U-Boot 2014.07 (Apr 29 2015 - 08:22:41)

        U-Boot Start:0xfff00000
XILSPI error: spi_xfer: Xfer timeout
SF: Failed to get idcodes
*** Warning - spi_flash_probe() failed, using default environment

In:    ttyUL0
Out:   ttyUL0
Err:   serial
Net:   aximac.40c00000
MAC:   00:0a:35:00:22:01
Warning: Your board does not use generic board. Please read
doc/README.generic-board and take action. Boards not
upgraded by the late 2014 may break or be removed.
U-BOOT for 2petalinuxtest

BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3
BOOTP broadcast 4
BOOTP broadcast 5

Retry count exceeded
Hit any key to stop autoboot:  0
SF: Detected MX25L25635F with page size 256 Bytes, erase size 64 KiB, total 32 MiB
SF: 6291456 bytes @ 0x460000 Read: OK
Wrong Image Format for bootm command
ERROR: can't get kernel image!

I had to add #define CONFIG_SPI_FLASH_MACRONIX in /subsystems/linux/configs/u-boot/platform-top.h to support the macronix flash.



Also I have a warning that my board does not use a generic board and refers me to README.generic-board that tells me to


arch/<arch>/ file to include:


and test it with a suitable board, as follows.

Adding Support for your Board

To enable generic board for your board, define CONFIG_SYS_GENERIC_BOARD in
your board config header file.

Where is the board config header located, and is this something that is needed to be changed or a warning due to not getting read from the flash?


In advance, thanks for all the help!



0 Kudos
0 Replies