cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
7,265 Views
Registered: ‎01-28-2015

Linux reboot hangs after flashcp with qspi

Hi all 

I have succeed in  booting linux-3.17 from 32M-qspi flash on Zedboard . I got a qspi partition in devicetree like this:

 

/dev/mtd0:0x0- 0x100000  qspi-fsbl-uboot

/dev/mtd1:0x100000- 0x600000 qspi-linux-kernel

/dev/mtd2:0x600000- 0x620000 qspi-devicetree

/dev/mtd3:0x620000- 0x1000000 qspi-rootfs-jffs2

 

Now I'm trying to upgrade uboot/ kernel /devicetree in-the -field in linux by command:

zynq > flashcp <upgrade_file> /dev/mtdX

and then

zynq > reboot

 

But sometimes(not all the time)  system hangs at "Restarting system..."  I have to restart the system by asserting an external reset signal like PS_RST.

 

  I tried to use printk in kernel source to find out where linux ends. I found that linux ends at 

zynq_slcr_write(1, SLCR_PS_RST_CTRL_OFFSET); in Linux/arch/arm/mach-zynq/slcr.c

 

I also tried to use xmd to read REBOOT_STATUS( mrd_phys 0xF8000258) and got an error code 0x00000002 which means "successful jtag handoff" (UG585 table6-12)

 

I have no ideas about this issue as it occurs randomly. Someone point  that bugs exists in Bootrom when accessing 32MB QSPI. But all my booting images are placed in low-16MB address. 

 

Does anyone know why?

Thanks in advance for any ideas.

 

Allan 

0 Kudos
6 Replies
Highlighted
Scholar
Scholar
7,254 Views
Registered: ‎10-26-2012

Re: Linux reboot hangs after flashcp with qspi

With the 3.17 kernel the kernel crashes (the QSPI driver causes invalid access) when I use flashcp to flash a large rootfs. It always happens around the 16M crossing spot. It then also destroys the lower regions, so the board won't boot after that.

 

Strangely, if I use flash_erase to wipe the flash and then write it with "dd", the crash doesn't occur, it only happens with flashcp.

 

So I can confirm there's something funky with the QSPI flash driver in 3.17 and up, but I haven't been able to pinpoint it. I already forwarded the logs to the engineers.

 

Maybe you're seeing a different effect of the same bug.

0 Kudos
Highlighted
Scholar
Scholar
7,245 Views
Registered: ‎05-28-2013

Re: Linux reboot hangs after flashcp with qspi

Might this be the dualstack U_PAGE bug? https://github.com/Xilinx/linux-xlnx/issues/8

 

It seems it was fixed, then some other changes reverted the fix, and it was fixed again:

https://github.com/Xilinx/linux-xlnx/commit/7ee1a97beb2a93426fff1a76f42ad7b096422720

 

It's a mis-placed closing "}", the write() call should be outside of the conditional, otherwise it only writes the page register in one direction and not the other.

0 Kudos
Highlighted
Scholar
Scholar
7,199 Views
Registered: ‎10-26-2012

Re: Linux reboot hangs after flashcp with qspi

But the zedboard doesn't have a dual-stacked QSPI, so that shouldn't have any effect.

0 Kudos
Highlighted
Visitor
Visitor
7,177 Views
Registered: ‎01-28-2015

Re: Linux reboot hangs after flashcp with qspi

I tried "flash_eraseall" then "dd" but it doesn't seem to work.

 

 

0 Kudos
Highlighted
Visitor
Visitor
6,779 Views
Registered: ‎12-05-2013

Re: Linux reboot hangs after flashcp with qspi

Any progress on this bug? I am seeing the same behaviour.

 

/Roger

0 Kudos
Highlighted
Visitor
Visitor
6,774 Views
Registered: ‎12-05-2013

Re: Linux reboot hangs after flashcp with qspi

I can add that flash_erase and dd worked for me where flashcp failed.

 

/Roger

0 Kudos