News:

Attention: For security reasons,please choose a user name *different* from your login name.
Also make sure to choose a secure password and change it regularly.

Main Menu

TE0803 QSPI write fails at 64MB boundary

Started by simon.beaudoin, May 27, 2019, 06:33:03 PM

Previous topic - Next topic

simon.beaudoin

Hi!

I have a situation here where I can't seem to be able to flash images into the 128MB Flash of the TE0803 board past the 64MB boundary.

If my images are smaller than half of the size of the flash, everything works fine. When I begin to add some stuff to the rootfs and it's size goes above 64MB, then the next time I boot the board, u-boot complains about the ramfs contained in the FIT image having a bad checksum (flashed with program_flash executable in petalinux installation, which effectively loads the FSBL and talks to it to flash). The same happens when I try to write to the flash with the flashcp utility from linux : 


root@Carrier:~# flashcp -v image.ub /dev/mtd2
Erasing blocks: 10213/10213 (100%)
Writing data: 81703k/81703k (100%)
Verifying data: 56070k/81703k (68%)File does not seem to match flash data. First mismatch at 0x036bf000-0x036c1800
root@Carrier:~# flashcp -v image.ub /dev/mtd2
Erasing blocks: 10213/10213 (100%)
Writing data: 81703k/81703k (100%)
Verifying data: 56070k/81703k (68%)File does not seem to match flash data. First mismatch at 0x036bf000-0x036c1800


Taking into account that I don't write 'image.ub' at the begining of the flash, the 56MB number matches the 64MB boundary.

Now, the fact that this always happens at the same address, and at a particular one (middle boundary) leads me to think is has something to do with page / table boundary in the flash?

In the hope someone faced the same issue...

Thanks you!

JH

Hi,
maybe this is a problem of flashcp, it seems it has problems on different petalinux versions:
https://www.xilinx.com/support/answers/64357.html
https://forums.xilinx.com/t5/Embedded-Linux/Petalinux-2017-1-MTDUtils-flashcp-QSPI/td-p/775726


Which Vivado/SDK/Petalinux version did you use?

How is QSPI defined on your device tree?

Xilinx has some notes here (The last changes seems to be done with 16.3):
https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18841754/Zynqmp+QSPI+Driver

br
John

simon.beaudoin

Hi John!

QuoteWhich Vivado/SDK/Petalinux version did you use?

2018.2

QuoteHow is QSPI defined on your device tree?

I didn't touch the automatically generated stuff :

In system-conf.dtsi :

&qspi {
#address-cells = <1>;
#size-cells = <0>;
flash0: flash@0 {
compatible = "n25q512a","micron,m25p80";
spi-tx-bus-width=<1>;
spi-rx-bus-width=<4>;
reg = <0x0>;
#address-cells = <1>;
#size-cells = <1>;
spi-max-frequency = <108000000>;
partition@0x00000000 {
label = "boot";
reg = <0x00000000 0x00900000>;
};
partition@0x00900000 {
label = "bootenv";
reg = <0x00900000 0x00040000>;
};
partition@0x00940000 {
label = "kernel";
reg = <0x00940000 0x06000000>;
};
};
};


In zynqmp.dtsi:
qspi: spi@ff0f0000 {
u-boot,dm-pre-reloc;
compatible = "xlnx,zynqmp-qspi-1.0";
status = "disabled";
clock-names = "ref_clk", "pclk";
interrupts = <0 15 4>;
interrupt-parent = <&gic>;
num-cs = <1>;
reg = <0x0 0xff0f0000 0x0 0x1000>,
      <0x0 0xc0000000 0x0 0x8000000>;
#address-cells = <1>;
#size-cells = <0>;
#stream-id-cells = <1>;
iommus = <&smmu 0x873>;
power-domains = <&pd_qspi>;
};


In pcw.dtsi

&qspi {
is-dual = <1>;
num-cs = <1>;
spi-rx-bus-width = <4>;
spi-tx-bus-width = <4>;
status = "okay";
};

The thing that bugs me however, is that the behavior is the same is I use the command line tool 'program_flash' (which is, in the end, what XSDK uses behind the scene) and program the flash via JTAG..

Thank you John

JH

#3
Hi,
I will test next week., but  when your write
QuoteThe thing that bugs me however, is that the behavior is the same is I use the command line tool 'program_flash

check one time:
There was also trouble with the flash boundary, but I couldn't reproduce as long as I use multiple of 64?

br
John