Trenz Electronic GmbH Support Forum

Trenz Electronic Products => UltraScale => Topic started by: r.brue on March 23, 2021, 05:29:21 PM

Title: Boot from QSPI + eMMC (TE0820)
Post by: r.brue on March 23, 2021, 05:29:21 PM
Hi, I'm pretty new to this and I can't figure out a specific flow to do this. I have always worked with a SD card on a custom board which uses the TE0820. The SD card is so formed:
The board then works well. Now our customer has required us to move everything to the internal eMMC flash and he doesn't want to use (and to have any access) to the SD card slot. So we have removed the SD slot. Now I am not understanding how can I write the required partitions within the eMMC flash through the JTAG cable. Does anyone have any guide? So far I've understood the following statements, can you please verify these points?
The questions are:
1. How can I then write the rootfs, and maybe move inside the eMMC also the kernel image (image.ub) using the JTAG cable?
2. Can I pure on the QSPI only the u-boot related files?
3. How can I specify to the u-boot parameters to load the image.ub from a eMMC partition? how then can specify to the image.ub to load the rootfs from the ext4 partiotion inside the eMMC?

Thank you.
Title: Re: Boot from QSPI + eMMC (TE0820)
Post by: r.brue on March 23, 2021, 06:01:40 PM
In order to clarify what I am trying to obtain, I've created this table.
Title: Re: Boot from QSPI + eMMC (TE0820)
Post by: JH on March 24, 2021, 03:08:51 PM
Hi,
you can't use JTAG to formate emmc.

Use running linux or uboot to format eMMC like you need.
1. Start for example your SD design with Linux and formate eMMC and copy all files to eMMC like you need.
2. Change Uboot configuration to search files on eMMC instead of SD
3. create new Boot.bin with your new uboot
4. Programm QSPI with your new Boot.bin

Instead of loading image.ub from SD to prepare emmc, also TFTP can be used in uboot to load image.ub from tftp server for first emmc preparing.

Note: you customer should always try to unmount emmc before he hard restart the module (power reset). It's like on your PC in worst case hard power reset without unmount can damage storage device.

br
John
Title: Re: Boot from QSPI + eMMC (TE0820)
Post by: r.brue on March 25, 2021, 10:11:55 AM
Ok thank you, as I was suspecting, the easiest way to do this is to start the SOM on an evaluation board, partition the eMMC and store there the rootfs via an ad-hoc Linux image starting from an SD card, meanwhile I am able to flash the QSPI with the BOOT.BIN file through JTAG with "program_flash". Now the system is working well and it loads from the QSPI + eMMC correctly. Now I have a further question slightly different:
I am packaging the BOOT.BIN with the following command:
petalinux-package --boot --format BIN --force --fsbl images/linux/zynqmp_fsbl.elf --fpga ./hw/bitstream.bit --u-boot --kernel
Finally I can observe that my BOOT.BIN will contain the following files:
I am flashing the QSPI with this other command:
program_flash -f images/linux/BOOT.BIN -fsbl images/linux/zynqmp_fsbl.elf -flash_type qspi-x8-dual_parallel
Now I can see my "mtd" device (QSPI) from the running Linux with the following partitions (the same that I've set on petalinux-config):
cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00500000 00002000 "boot"
mtd1: 00900000 00002000 "bootenv"
mtd2: 018cba80 00002000 "kernel"

Now I have to perform an update of the bitstream, how can I do that in a running system on field in a easy way?
I was looking for the command "flashcp" but I don't understand where to place the bitstream.bin file in such mtd partitions. Any suggestion?
Title: Re: Boot from QSPI + eMMC (TE0820)
Post by: JH on April 01, 2021, 06:27:08 AM
Hi,
I'm sorry I can't give tutorial how you use Xilinx tools, please check Xilinx documentation.

--> flash partitions will be set and changed via petalinux-config menu (this must be done manually). Easiest way is simple that copy simple Boot.bin(include FSBL, bistream, application(uboot.elf)) in the first partition. --> Zynq Bootrom will search there for FSBL and FSBL for bitstream and application.

--> you can also put more things(like image.ub or other files) into Boot.bin if you want, in this case you please read also Xilinx documentation about this topics.

br
John
Title: Re: Boot from QSPI + eMMC (TE0820)
Post by: jhane on May 20, 2021, 09:34:11 AM
 You may have figured this out already but you can't update just the bitstream you have to update the BOOT.BIN using flashcp.  It is possible to reload the bitstream after boot.  You must store the file on a filesystem on the eMMC and then use fpgautil to load it.   You do have to be careful that you are not accessing the PL when reloading.

jeff