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: 
Adventurer
Adventurer
1,644 Views
Registered: ‎06-30-2016

Copy files from SD card to QSPI in order to boot Linux

Jump to solution

Hi all,

 

I've designed a custom board with a XC7Z020-1CLG400I and I'm trying to copy files from SD card to the QSPI in order to boot Linux.

After SSH'ing into the board, if I type cat /proc/mtd I get the following:

qspi1.png

 

I can also see the files in the SD card:

qspi2.png

 

Then I successfully copied the files from the SD card to the QSPI:

qspi3.png

 

Now what's happening is: the PL is being programmed OK but Linux isn't booting. What am I missing? I've read somewhere that we also need the file ramdisk8M.image.gz. Is that true? If so, where can I find it? And would I put it in mtd3 ("spare")?

 

Thank you in advance!

0 Kudos
1 Solution

Accepted Solutions
Adventurer
Adventurer
1,539 Views
Registered: ‎06-30-2016

Re: Copy files from SD card to QSPI in order to boot Linux

Jump to solution

I have just managed to get it working. Basically what I had to do was:

 

On petalinux-config:

Subsystem AUTO Hardware Settings ->  Advanced bootable images storage Settings ->  

-> boot image settings (changed to primary flash)

-> u-boot env partition settings (changed to primary flash)

-> kernel image settings (changed to primary flash)

-> dtb image settings (changed to from boot image)

 

Then I booted via QSPI with the SD card inserted, used flashcp to copy the BOOT.BIN into mtd0 and image.ub into mtd2. Then removed the SD card, power cycled the board, and it's now booting via QSPI.

Thank you for your pointers @trigger

View solution in original post

0 Kudos
8 Replies
Adventurer
Adventurer
1,609 Views
Registered: ‎06-30-2016

Re: Copy files from SD card to QSPI in order to boot Linux

Jump to solution

These are the files I have in MyProjectName/images/linux :

 

qspi4.png

 

Can someone advise where each file should go?

0 Kudos
Voyager
Voyager
1,601 Views
Registered: ‎09-14-2016

Re: Copy files from SD card to QSPI in order to boot Linux

Jump to solution

Hi @alex83uk,

 

According to your question i think something is not clear:

file ramdisk8M.image.gz. Is that true? If so, where can I find it? And would I put it in mtd3 ("spare")?

Ok so some questions:

 

1. Do you have only QSPI on your board ? or eMMC also ?

 

If the answer is "yes I have only QSPI" -> You have also to flash the root file-system in the QSPI to get init.

If the answer is "No I have also eMMC" -> You should copy/paste the rootf inside the eMMC.

 

2. In both previous cases, you have to edit ( or at least take a look) to u-boot command in order to get more information on the boot process.

 

3. We need also more info about the successful boot: it's also from QSPI or SD ?

 

Cheers,

Trigger

0 Kudos
Adventurer
Adventurer
1,593 Views
Registered: ‎06-30-2016

Re: Copy files from SD card to QSPI in order to boot Linux

Jump to solution

Hi @trigger thank you for replying.

 

1) I have only QSPI. Which one is the root file-system?

 

2) I've had a look on some u-boot documentation but it's unclear what I should edit.

 

3) I can successfully boot Linux using SD card. Then when I copy the files from the SD card to the QSPI as shown on my first post, the FPGA is programmed but Linux doesn't boot.

0 Kudos
Voyager
Voyager
1,588 Views
Registered: ‎09-14-2016

Re: Copy files from SD card to QSPI in order to boot Linux

Jump to solution

Hi @alex83uk,

 

 

1. The first question is : What do you want to do with this board ?

  - You can download a minimal root filesystem

  - You can build your own one with Yocto/Petalinux/Buildroot ...

 

-> where does the sd card frootfs come from ?

 

2. So as you seems not really friendly with u-boot you should read doc a little bit to understand what the boot-loader can do for you:

 

https://www.xilinx.com/support/documentation/sw_manuals/ug1046-ultrafast-design-methodology-guide.pdf#nameddest=BootLoaders

 

http://www.wiki.xilinx.com/Prepare+Boot+Medium

 

http://www.wiki.xilinx.com/Build%20and%20Modify%20a%20Rootfs

 

I know it's not really funny but  that is the price to pay...

 

3. If your bitstream is inside the BOOT.bin file it's normal. You should take a look to u-boot console in order to give us more information about the boot trouble ;)

 

Cheers,

Trigger

0 Kudos
Adventurer
Adventurer
1,574 Views
Registered: ‎06-30-2016

Re: Copy files from SD card to QSPI in order to boot Linux

Jump to solution

Hi @trigger

1) This board is a PoE+ switch. I need Linux to load some drivers.

     The SD card rootfs comes from the Petalinux project I built using our *.bit and *.hdf file from our Vivado project.

 

2) Thank you for the links. I'll spend some time reading.

 

3) This is what I get on the u-boot console:

U-Boot 2017.01 (Sep 14 2018 - 14:49:07 +0100)
Board: Xilinx Zynq
I2C:   ready
DRAM:  ECC disabled 1 GiB
MMC:   Card did not respond to voltage select!
sdhci@e0100000 - probe failed: -95
Card did not respond to voltage select!
SF: Detected n25q512a with page size 256 Bytes, erase size 4 KiB, total 64 MiB
*** Warning - bad CRC, using default environment
In:    serial
Out:   serial
Err:   serial
Net:   ZYNQ GEM: e000b000, phyaddr ffffffff, interface gmii
PHY is not detected
GEM PHY init failed
No ethernet found.
U-BOOT for digb
Hit any key to stop autoboot:  2                                    
1                                                                                                                               
0 
Card did not respond to voltage select!
**Bad device mmc 0**
Card did not respond to voltage select!
MMC Device 0 not found
no mmc device at slot 0
Zynq>                                                                                                                               

I believe it's complaining about the SD card not being present, even though I have changed my switches to boot from QSPI.

0 Kudos
Voyager
Voyager
1,543 Views
Registered: ‎09-14-2016

Re: Copy files from SD card to QSPI in order to boot Linux

Jump to solution

Hi @alex83uk,

 

Some good news or are you still stuck ?

 

take a look here -> http://www.wiki.xilinx.com/U-Boot+MMC+Driver

 

Now I think you have understand how sd card /eMMC work with u-boot and you should be able to get the correct command :)

 

Good luck.

Cheers,

Trigger

0 Kudos
Adventurer
Adventurer
1,540 Views
Registered: ‎06-30-2016

Re: Copy files from SD card to QSPI in order to boot Linux

Jump to solution

I have just managed to get it working. Basically what I had to do was:

 

On petalinux-config:

Subsystem AUTO Hardware Settings ->  Advanced bootable images storage Settings ->  

-> boot image settings (changed to primary flash)

-> u-boot env partition settings (changed to primary flash)

-> kernel image settings (changed to primary flash)

-> dtb image settings (changed to from boot image)

 

Then I booted via QSPI with the SD card inserted, used flashcp to copy the BOOT.BIN into mtd0 and image.ub into mtd2. Then removed the SD card, power cycled the board, and it's now booting via QSPI.

Thank you for your pointers @trigger

View solution in original post

0 Kudos
Highlighted
Voyager
Voyager
1,528 Views
Registered: ‎09-14-2016

Re: Copy files from SD card to QSPI in order to boot Linux

Jump to solution
Nice job @alex83uk
0 Kudos