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
Explorer
Explorer
1,204 Views
Registered: ‎09-15-2011

Qspiflash Update in linux os

Hello, everybody

in my project, i use the zynq 7020 to design the system, when I download the .bin file to qspiflash used JTAG port, the board can work. 

we have new requirements,  we want to update  the QSpiFlash  in linux through ethernet, how can do it ?

 

i have no idea for it, can help ?

0 Kudos
2 Replies
Scholar hbucher
Scholar
1,195 Views
Registered: ‎03-22-2016

Re: Qspiflash Update in linux os

Hi @phdwong

Check this thread and see if it applies to your case

http://zedboard.org/content/customer-zedboard-firmware-updates-without-xilinx-tools

 

vitorian.com --- We do this for fun. Always give kudos. Accept as solution if your question was answered.
I will not answer to personal messages - use the forums instead.
0 Kudos
Voyager
Voyager
1,189 Views
Registered: ‎06-24-2013

Re: Qspiflash Update in linux os

Hey @phdwong,

 

We want to update  the QSpiFlash in linux through ethernet, how can do it?

This is actually quite easy, as the drivers for this are already available and the QSPI can be mapped via MTD.

 

You need to specify the structure and partitioning in the devicetree with a node entry like this:

        ps7_qspi: spi@e000d000 {
            compatible = "xlnx,zynq-qspi-1.0";
            ...
            flash@0 {
                compatible = "jedec,spi-nor";
                #address-cells = <0x1>;
                #size-cells = <0x1>;
                spi-tx-bus-width = <0x1>;
                spi-rx-bus-width = <0x4>;
                reg = <0x0>;

                partition@qspi-fsbl-uboot {
                    label = "qspi-fsbl-uboot";
                    reg = <0x0 0x100000>;
                };
                ...
                partition@qspi-bitstream {
                    label = "qspi-bitstream";
                    reg = <0xc00000 0x400000>;
                };
            };
        };

Under Linux, it will then be detected and mapped to MTD like this:

[    6.752683] m25p80 spi32766.0: s25fl128s (16384 Kbytes)
[    6.797212] 5 ofpart partitions found on MTD device spi32766.0
[    6.807345] Creating 5 MTD partitions on "spi32766.0":
[    6.812432] 0x000000000000-0x000000100000 : "qspi-fsbl-uboot"
[    6.818466] 0x000000100000-0x000000600000 : "qspi-linux"
[    6.824710] 0x000000600000-0x000000620000 : "qspi-device-tree"
[    6.833388] 0x000000620000-0x000000c00000 : "qspi-rootfs"
[    6.840620] 0x000000c00000-0x000001000000 : "qspi-bitstream"

And with the help of the mtdblock driver, you will get access to the partitions like normal block devices

$  cat /proc/partitions 
major minor  #blocks  name

  31        0      16384 mtdblock0
  31        1       1024 mtdblock1
  31        2       5120 mtdblock2
  31        3        128 mtdblock3
  31        4       6016 mtdblock4
  31        5       4096 mtdblock5

So you can simply update the QSPI flash by writing to /dev/mtdblock* devices and you can also verify the result by reading back from the device.

 

Hope this helps,

Herbert

-------------- Yes, I do this for fun!
0 Kudos