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: 
Highlighted
500 Views
Registered: ‎09-30-2011

Linux Access upper addresses of Dual Stacked 4 bit configuration QSPI doesn't work

Jump to solution

Colleagues,

I have a dual stacked 4 bit conifguration of 2 n25q512a devices. So that gives me addresses of bytes running from 0 to 0x3FFFFFF on one device and 0x4000000 to 0x7FFFFFF on the second. The problem is that I cannot access the upper addresses (i.e., the second device) mount times out of anything in that space and even uboot access is impossible.

My device tree looks like this:

&qspi {
/* added */
u-boot,dm-pre-reloc;

/*
* For zynq-qspi you do not need to mention the property “is-stacked” instead you need
* to enable CONFIG_SPI_ZYNQ_QSPI_DUAL_STACKED
* in the kernel, also stacked mode is the controller feature so “num-cs = <1>;“ is all that is needed
*/

compatible = "xlnx,zynq-qspi-1.0";
is-dual = <0>;

num-cs = <1>;
/* the documentation says this is unused */
xlnx,qspi-mode = <0x2>;
status = "okay";
clock-names = "ref_clk", "pclk";
clocks = <&clkc 10>, <&clkc 43>;
interrupt-parent = <&intc>;
interrupts = <0 19 4>;
reg = <0xe000d000 0x1000>;
#address-cells = <1>;
#size-cells = <0>;
/*
* the stacked configuration appears as a single memory
* specification here and is not divided into upper
* and lower flash blocks
*/
spi_flash@0 {
compatible = "n25q512a", "jedec,spi-nor";
reg = <0x0>;
spi-tx-bus-width = <4>;
spi-rx-bus-width = <4>;

spi-max-frequency = <50000000>;
#address-cells = <1>;
#size-cells = <1>;

/****
* partitions lifted from OPAT device tree
****/
partition@uboot_spl {
label = "uboot_spl 0x00000000";
reg = <0x00000000 0x000E0000>;
};
partition@uboot_env {
label = "uboot_env 0x000E0000";
reg = <0x000E0000 0x00020000>;
};
partition@uboot {
label = "uboot 0x00100000";
reg = <0x00100000 0x00100000>;
};
partition@os {
label = "os 0x00200000";
reg = <0x00200000 0x03D00000>;
};
partition@second_device {
label = "second_device 0x04000000";
reg = <0x04000000 0x04000000>;
};

};

};

In uboot sf probe 0:0 0 0 and sf probe 0:1 0 0 both seem to access the lower device. There is no obvious way to access the upper addresses. Direct access of the upper addresses times out.

After boot, in linux a mount of the mtdblock associated with second_device also times out.

Any help here would be greatly appreciated

0 Kudos
1 Solution

Accepted Solutions
426 Views
Registered: ‎09-30-2011

Re: Linux Access upper addresses of Dual Stacked 4 bit configuration QSPI doesn't work

Jump to solution

To close the loop, in the end we had two issues. Once hardware issue in which the enable signal was incorrectly wired to both QSPI devices. The other was an error in the device tree specification that worked OK  from Linux but failed in uboot. 

It turns out  that for uboot to work in dual stacked 4 bit mode (at least for this specific device) the line

    " spi-tx-bus-width = <4>;"

should, in fact be,

    "spi-tx-bus-width = <1>;"

Absent that, the uboot will not be able to access the second device (again for this specific device). I would also note that in dual stacked 4 bit mode withe device tree corrected, the sf probe command only sees one device (albeit twice as large) and the ":cs" option is inoperative (that is the "sf probe bus:cs" instruction basically ignores the cs specification for the active bus)

The confusing part is that the device tree with the <4> indicated in the bus width works without issue from the linux kernel where the QSPI is identified and fully accessible as a standard MTD device. The issue is ONLY at uboot time where the upper addresses (the secodn device) are inaccessible with that device tree specification.

View solution in original post

0 Kudos
1 Reply
427 Views
Registered: ‎09-30-2011

Re: Linux Access upper addresses of Dual Stacked 4 bit configuration QSPI doesn't work

Jump to solution

To close the loop, in the end we had two issues. Once hardware issue in which the enable signal was incorrectly wired to both QSPI devices. The other was an error in the device tree specification that worked OK  from Linux but failed in uboot. 

It turns out  that for uboot to work in dual stacked 4 bit mode (at least for this specific device) the line

    " spi-tx-bus-width = <4>;"

should, in fact be,

    "spi-tx-bus-width = <1>;"

Absent that, the uboot will not be able to access the second device (again for this specific device). I would also note that in dual stacked 4 bit mode withe device tree corrected, the sf probe command only sees one device (albeit twice as large) and the ":cs" option is inoperative (that is the "sf probe bus:cs" instruction basically ignores the cs specification for the active bus)

The confusing part is that the device tree with the <4> indicated in the bus width works without issue from the linux kernel where the QSPI is identified and fully accessible as a standard MTD device. The issue is ONLY at uboot time where the upper addresses (the secodn device) are inaccessible with that device tree specification.

View solution in original post

0 Kudos