AnsweredAssumed Answered

U-boot IMX6SoloX Flashing M4 Image onto QSPI Nor Flash MT25Q02G

Question asked by niranjanbc on Feb 16, 2017
Latest reply on Feb 23, 2017 by prasanthr

Hi I am flashing M4 image from SD card onto QSPI Flash using "update_m4_from_sdcard", when read the Flash back i see all Ulong are swapped and they are stored in little enddian format. below is the U-boot console

 

run update_m4_from_sd
SF: Detected MT25Q2048 with page size 256 Bytes, erase size 4 KiB, total 256 MiB
reading m4_qspi.bin
47606 bytes read in 19 ms (2.4 MiB/s)
SF: 65536 bytes @ 0x0 Erased: OK
SF: 47606 bytes @ 0x0 Written: OK
=> sf probe 1:0
SF: Detected MT25Q2048 with page size 256 Bytes, erase size 4 KiB, total 256 MiB
=> md 0x70000000
70000000: 01040070 00800020 712b0070 712b0070    p... ...p.+qp.+q
70000010: 712b0070 712b0070 00000000 712b0070    p.+qp.+q....p.+q
70000020: 00000000 00000000 3f2a0070 00000000    ........p.*?....
70000030: 00000000 712b0070 712b0070 b52a0070    ....p.+qp.+qp.*.
70000040: 712b0070 712b0070 712b0070 712b0070    p.+qp.+qp.+qp.+q
70000050: 712b0070 712b0070 712b0070 712b0070    p.+qp.+qp.+qp.+q
70000060: 712b0070 712b0070 712b0070 712b0070    p.+qp.+qp.+qp.+q
70000070: 712b0070 712b0070 712b0070 712b0070    p.+qp.+qp.+qp.+q
70000080: 712b0070 712b0070 712b0070 712b0070    p.+qp.+qp.+qp.+q
70000090: 712b0070 712b0070 712b0070 712b0070    p.+qp.+qp.+qp.+q
700000a0: 712b0070 712b0070 712b0070 712b0070    p.+qp.+qp.+qp.+q
700000b0: 712b0070 712b0070 712b0070 712b0070    p.+qp.+qp.+qp.+q
700000c0: 712b0070 712b0070 712b0070 712b0070    p.+qp.+qp.+qp.+q
700000d0: 712b0070 712b0070 712b0070 712b0070    p.+qp.+qp.+qp.+q
700000e0: 712b0070 712b0070 712b0070 712b0070    p.+qp.+qp.+qp.+q
700000f0: 712b0070 712b0070 712b0070 712b0070    p.+qp.+qp.+qp.+q
=>

 

 

in the above memory read 0x01040070 and 0x00800020 are swapped and endian is little.

actually it should be this way 0x20008000 0x70000410.

 

 

 

 

if store the image to DDR or OCRAM and read it back it read fine like below.

 

=> fatload mmc 1:1 0x00901000 m4_qspi.bin
reading m4_qspi.bin
47606 bytes read in 18 ms (2.5 MiB/s)
=> md 0x00901000
00901000: 20008000 70000401 70002b71 70002b71    ... ...pq+.pq+.p
00901010: 70002b71 70002b71 70002b71 00000000    q+.pq+.pq+.p....
00901020: 00000000 00000000 00000000 70002a3f    ............?*.p
00901030: 70002b71 00000000 70002ab5 70002b71    q+.p.....*.pq+.p
00901040: 70002b71 70002b71 70002b71 70002b71    q+.pq+.pq+.pq+.p
00901050: 70002b71 70002b71 70002b71 70002b71    q+.pq+.pq+.pq+.p
00901060: 70002b71 70002b71 70002b71 70002b71    q+.pq+.pq+.pq+.p
00901070: 70002b71 70002b71 70002b71 70002b71    q+.pq+.pq+.pq+.p
00901080: 70002b71 70002b71 70002b71 70002b71    q+.pq+.pq+.pq+.p
00901090: 70002b71 70002b71 70002b71 70002b71    q+.pq+.pq+.pq+.p
009010a0: 70002b71 70002b71 70002b71 70002b71    q+.pq+.pq+.pq+.p
009010b0: 70002b71 70002b71 70002b71 70002b71    q+.pq+.pq+.pq+.p
009010c0: 70002b71 70002b71 70002b71 70002b71    q+.pq+.pq+.pq+.p
009010d0: 70002b71 70002b71 70002b71 70002b71    q+.pq+.pq+.pq+.p
009010e0: 70002b71 70002b71 70002b71 70002b71    q+.pq+.pq+.pq+.p
009010f0: 70002b71 70002b71 70002b71 70002b71    q+.pq+.pq+.pq+.p
=>

 

is there anything i am missing with QSPI NOR flash configuration.

 

i have updated sf_param.c file to support MT25Q02G has below.

  {"MT25Q2048",       0x20ba22, 0x0,       64 * 1024,  4096, RD_FULL,         WR_QPP | SECT_4K},

Outcomes