cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
damon
Adventurer
Adventurer
2,575 Views
Registered: ‎01-01-2019

qspi flash problem in u-boot

Jump to solution

Hi,

I am trying to use sf command to load kernel image from qspi flash to memory.

But when I enter sf probe 0 0 0 , I get the following error:

ZynqMP> sf probe 0 0 0
Invalid bus 0 (err=-19)
Failed to initialize SPI flash at 0:0 (error -19)

I tried to find the root cause of the problem, it seems that zynqmp_qspi_probe (zynqmp_qspi.c) is not executed.

The content of device tree about qspi as follows:

spi@ff0f0000 {
	u-boot,dm-pre-reloc;
	compatible = "xlnx,zynqmp-qspi-1.0";
	status = "okay";
	clock-names = "ref_clk", "pclk";
	interrupts = <0x0 0xf 0x4>;
	interrupt-parent = <0x4>;
	num-cs = <0x1>;
	reg = <0x0 0xff0f0000 0x0 0x1000 0x0 0xc0000000 0x0 0x8000000>;
	#address-cells = <0x1>;
	#size-cells = <0x0>;
	#stream-id-cells = <0x1>;
	iommus = <0xe 0x873>;
	power-domains = <0x1d>;
	clocks = <0x3 0x35 0x3 0x1f>;
	is-dual = <0x0>;
	spi-rx-bus-width = <0x1>;
	spi-tx-bus-width = <0x1>;
};

Does any one have any idea to fix this?

Thanks.

0 Kudos
1 Solution

Accepted Solutions
abommera
Xilinx Employee
Xilinx Employee
2,514 Views
Registered: ‎10-12-2018

Hi @damon ,

Good to hear that it works!

The spi flash might be defined as spi2 in your device tree alias section and hence it should be probed with 2 as device as shown below.

sf probe 2:0 0 0

sf probe [[bus:]cs] [hz] [mode] - init flash device on given SPI bus and chip select

Thanks & Regards

Anil B

--------------------------
Don't forget to reply, kudo, and accept as solution.

Thanks & Regards
Anil B
-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------

View solution in original post

4 Replies
abommera
Xilinx Employee
Xilinx Employee
2,550 Views
Registered: ‎10-12-2018

Hi @damon ,

Please check this AR, if you haven't referred already. Hope, it helps you.

https://www.xilinx.com/support/answers/71863.html

Thanks & Regards

Anil B

Thanks & Regards
Anil B
-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
damon
Adventurer
Adventurer
2,522 Views
Registered: ‎01-01-2019

Hi @abommera,

I change sf probe 0 0 0 to sf probe 2:0 0 0, and it works.

I am curious why my first parameter is 2:0 instead of 0?

Thanks.

0 Kudos
abommera
Xilinx Employee
Xilinx Employee
2,515 Views
Registered: ‎10-12-2018

Hi @damon ,

Good to hear that it works!

The spi flash might be defined as spi2 in your device tree alias section and hence it should be probed with 2 as device as shown below.

sf probe 2:0 0 0

sf probe [[bus:]cs] [hz] [mode] - init flash device on given SPI bus and chip select

Thanks & Regards

Anil B

--------------------------
Don't forget to reply, kudo, and accept as solution.

Thanks & Regards
Anil B
-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------

View solution in original post

damon
Adventurer
Adventurer
2,505 Views
Registered: ‎01-01-2019
Thank you, very useful!
0 Kudos