UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor dmark
Visitor
8,132 Views
Registered: ‎10-08-2013

ZC706 QSPI Petalinux Device Tree Configuration

Hi 

 

I am using Petalinux 2015.2 and the ZC706 board using a RHEL machine.  I want to program the QSPI flash in dual parallel mode but I cannot find an example of what to change. I configured and built Linux but when i use the command  cat /proc/mtd, no partitions were shown and system-top.dts 

 

&qspi {
flash0: flash@0 {
compatible = "micron,n25q128a13";
};
};

 

I built vivado and exported the hdf file.  Maybe the exported project was not correct since the flash does not look configured properly?

 

 

Do I modify the system-top.dts?   Can you provide an example?

The Zynq-wiki-Qspi mentions a spi-zynq-qspi.c to be downloaded from git.  Is this file already included in Petalinux 2015.2? I could not find this file on git, can you provide the path?

 

Thank you

Dave

0 Kudos
2 Replies
Observer sylvainsgndt
Observer
7,896 Views
Registered: ‎05-26-2014

Re: ZC706 QSPI Petalinux Device Tree Configuration

I have a partial solution for you because I want to do the exact same on my custom board with QSPI dual parallel. 

here is my device tree section:

 

&qspi {
	#address-cells = <1>;
	#size-cells = <0>;
	flash0: flash@0 {
		compatible = "micron,n25q128a13";
		reg = <0x0>;
		#address-cells = <1>;
		#size-cells = <1>;
		spi-max-frequency = <50000000>;
		partition@0x00000000 {
			label = "boot";
			reg = <0x00000000 0x00500000>;
		};
		partition@0x00500000 {
			label = "bootenv";
			reg = <0x00500000 0x00020000>;
		};
		partition@0x00520000 {
			label = "kernel";
			reg = <0x00520000 0x00a80000>;
		};
		partition@0x00fa0000 {
			label = "spare";
			reg = <0x00fa0000 0x00000000>;
		};
	};
	flash1: flash@1 {
		compatible = "micron,n25q128a13";
		reg = <0x1>;
		#address-cells = <1>;
		#size-cells = <1>;
		spi-max-frequency = <50000000>;
		partition@0x00000000 {
			label = "data";
			reg = <0x00000000 0x01000000>;
		};
	};
};

the first section with "flash0" works fine and I can see and mount the four partitions in linux. I guessed the second section "flash1" but it doesn't show up in "mtdinfo" I suspect a bug in Vivado/Paetalinux. In Vivado, I configured dual parallel QSPI but after Vivado export, then petalinux-config --get-hw-description=... then the whole building process. I do a grep of the related configuration constant and I see:

subsystems/linux/configs/kernel/config:CONFIG_SPI_ZYNQ_QSPI=y
subsystems/linux/configs/kernel/config:CONFIG_SPI_ZYNQ_QSPI_DUAL_STACKED=y

As you see, it configured the STACKED instead of parallel. I looked everywhere I could and there are no constant loooking like CONFIG_SPI_ZYNQ_QSPI_PARALLEL so I believe, they never implmented/tested it. If I find anything, I'll keep you posted. If you find a solution please keep me posted too. 

Thanks,

Sylvain Huard

 

 

0 Kudos
Observer sylvainsgndt
Observer
7,890 Views
Registered: ‎05-26-2014

Re: ZC706 QSPI Petalinux Device Tree Configuration

I found the solution. If you want a dual parallel QSPI, it is seen from linux as only one device. The QSPI uses the two chip as one with interleaved bits. But for it to do so, your device tree should be like that:

 

&qspi {
	#address-cells = <1>;
	#size-cells = <0>;
	is-dual = <1>;
	num-cs = <2>;
	xlnx,fb-clk = <0x1>;
	flash0: flash@0 {
		compatible = "micron,n25q128a13";
		reg = <0x0>;
		#address-cells = <1>;
		#size-cells = <1>;
		spi-max-frequency = <50000000>;
		partition@0x00000000 {
			label = "boot";
			reg = <0x00000000 0x00500000>;
		};
		partition@0x00500000 {
			label = "bootenv";
			reg = <0x00500000 0x00020000>;
		};
		partition@0x00520000 {
			label = "kernel";
			reg = <0x00520000 0x00a80000>;
		};
		partition@0x00fa0000 {
			label = "spare";
			reg = <0x00fa0000 0x00000000>;
		};
	};
};

num-cs tells there are 2 chip select. is-dual says it's a dual bus (8 bits) and the fb-clk is to tell you will use the feedback pin for the clock since you want to go fast.Unfortunately, petalinux 2015.2.1 does not do it. you have to manually modify it. It does not set the device properly either (n25q128 instead of n25q128a13).

 

You have to use two identical memory chip.you partition the disk as if you have twice the memory capacity of on chip... make sense....

 

Hope it fixes your problem like it did for me. 

 

Sylvain Huard

 

0 Kudos