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
Contributor
Contributor
621 Views
Registered: ‎03-03-2017

Moving boot from SD to eMMC in a TE0720

Jump to solution

Hello,

 

I've been working with Linux in a TE0720 via SD, where I had two partitions, one with the files image.ub, BOOT.BIN and system.dtb, and another partition with the root file system.

 

Now I would like to use the eMMC instead of the SD card. The thing is that I've managed to make it work, although it only loads Linux correctly if BOOT.BIN and system.dtb are kept in the SD card. However, I would like to have system.dtb in the eMMC as well.

 

These are the steps I've followed:

 

1) Configure eMMC with two partitions and format partition 1 as FAT32 and partion 2 as ext4 (as I did with the SD). eMMC is in /dev/mmcblk1, and SD in /dev/mmcblk0.

2) In petalinux:  petalinux-config

    Then:

             Subsystem AUTO Hardware Settings ---> SD/SDIO Settings ---> Primary SD/SDIO (psu_sd_1)

             Image Packaging Configuration ---> Device node of SD device ---> /dev/mmcblk1p2

3) Copy the U-boot environment variable in platform-top.h as described here.

4) Finally, after building it, I copy the system.dtb and image.ub in partition 1, and the root file system in partition 2. BOOT.BIN remains in the SD.

 

I was expecting this would load Linux correctly, and after that, my next step was going to replace the QSPI boot by the one of the SD in order to avoid the use of the SD. However, it only works if system.dtb is in the SD as well, since it is there where it is looked for. I've been looking for in all options of the petalinux-config, but I've not found anything relevant to force the use of the system.dtb placed in the eMMC instead of the SD one.

 

Can you tell me which is the step I'm missing?

 

 

Tags (4)
0 Kudos
1 Solution

Accepted Solutions
586 Views
Registered: ‎04-20-2017

Re: Moving boot from SD to eMMC in a TE0720

Jump to solution
Only ultrascale devices can boot Fsbl Bitstream and uboot directly from emmc. Zynq only can do it from qspi or SD card.

So you have to place boot.bin in qspi (make setting according in petalinux config) and image.ub on emmc.
. DTB is not necessary as it's by default packaged in image.ub in case you did not activate it.

Fürther it seems, and it costed us days to find that, that there is a bug in the petalinux config if the emmc is on sd1 like on the te0720. Even you change the settings in petalinux config that image.ub is on emmc, the generated uboot code still try to look first at sd0, where on the te0720 the card slot is connected, which will fail as there is no SD card or image.
So you have to look in meta-plx-generated/u-boot folder where the automatically generated recipe for uboot lies, look at environment variables or so section, it's one huge define you can't miss you have to copy that section to the file where you put your uboot overrides, and remive all the references and commands that try to do smt with sd0.

Then it works like a charm. Die side is you have to repeat if you make any changes in ort Linux config that changes smt on uboot generation. I bet there is a more elegant way l, but that works
1 Reply
587 Views
Registered: ‎04-20-2017

Re: Moving boot from SD to eMMC in a TE0720

Jump to solution
Only ultrascale devices can boot Fsbl Bitstream and uboot directly from emmc. Zynq only can do it from qspi or SD card.

So you have to place boot.bin in qspi (make setting according in petalinux config) and image.ub on emmc.
. DTB is not necessary as it's by default packaged in image.ub in case you did not activate it.

Fürther it seems, and it costed us days to find that, that there is a bug in the petalinux config if the emmc is on sd1 like on the te0720. Even you change the settings in petalinux config that image.ub is on emmc, the generated uboot code still try to look first at sd0, where on the te0720 the card slot is connected, which will fail as there is no SD card or image.
So you have to look in meta-plx-generated/u-boot folder where the automatically generated recipe for uboot lies, look at environment variables or so section, it's one huge define you can't miss you have to copy that section to the file where you put your uboot overrides, and remive all the references and commands that try to do smt with sd0.

Then it works like a charm. Die side is you have to repeat if you make any changes in ort Linux config that changes smt on uboot generation. I bet there is a more elegant way l, but that works