KRIA K26 production SOM is equipped with eMMC non-volatile memory and differs in that from starter kits SOMs. the project addresses programming the eMMC memory using KV260 video starter kit petalinux BSP with modifications enabling eMMC flash memory recognition.
Attached binary files allow to flash eMMC memory skipping code/projects modification stages.
Hardware setupDisconnect red fan power cable from connector on the KV260 kit Carrier Card (CC). Unscrew and remove SOM with red fan from from the CC.
Mount production K26 SOM to the CC, please notice the SOM orientation: white markers on the SOM have to be aligned with the same markers on the CC on both sides of the 240 way connector.
We are going to flash eMMC memory from linux which has to be loaded by Second Stage Boot Loader (SSBL) u-boot, which will be loaded by First Stage Boot Loader (FSBL).
One of the ways to organize the process is to follow KV260 starter kit boot process flashing bootloaders file (BOOT.BIN) into QSPI memory and leveraging QSPI boot mode hardwired in the KV260 CC.
K26 SOM comes with empty QSPI memory. We can load prebuilt BOOT.BIN from the SOM or starter kit petalinux BSP but the former one doesn't recognize SD card while the latest disables eMMC memory. Therefor we have to modify bootloaders to enable both SD card to load linux and eMMC to flash the memory.
PS configurationMPSoC Processing System (PS) includes controllers for the peripherals of interest: eMMC card, SD card and USB. Xilinx distributes petalinux BSP with vivado project and we are going to modify the project to enable eMMC card in the KV260 starter kit petalinux.
Download the Kria K26 Starter Kit 2021.1 Update 1 BSP from the PetaLinux Download link.
2022.1 starter kit BSP requires additional adaptation, I guess it's because there is a mechanism to identify starter kit variant (KV260, KR260...) while 2021.1 is simpler assuming that it runs on KV260 even if it's loaded to production K26 SOM.
Initialize toolchain, create petalinux project from the BSP and enter the created project directory:
source /tools/Xilinx/Vitis/2021.1/settings64.sh
source /tools/Xilinx/petalinux/2021.1/settings.sh
petalinux-create -t project -n plnx2021_1_kv260 -s ./xilinx-k26-starterkit-v2021.1-final.bsp
cd plnx2021_1_kv260
Open
vivado project (in 'hardware' directory) with the tool
vivado xilinx-k26-starterkit-2021.1/xilinx-k26-starterkit-2021.1.xpr &
'Open Block Design' and double-click PS IP "ZYNQ UltraSCALE+" to modify its configuration
Enable 'SD 0 / eMMC' and configure the peripheral controller to eMMC on pins 'MIO 13.. 22' (as it's configured in the production SOM petalinux BSP)
'Generate Bitstream' and File->Export Hardware to XSA file 'including bitstream'
Petalinux adaptationWe update the petalinux/yocto project with modified XSA file by means of
petalinux-config --get-hw-description=<path to the modified XSA file containing directory>
Overall the commands are
petalinux-config --get-hw-description=./hardware/xilinx-k26-starterkit-2021.1
petalinux-build
petalinux-package --boot --u-boot --dtb images/linux/u-boot.dtb –force
petalinux-package --wic --bootfiles "ramdisk.cpio.gz.u-boot boot.scr Image system.dtb"
see notes for 2021.1 BSP on KRIA wiki page
The petalinux-package commands generate BOOT.BINand petalinux-sdimage.wic (SD card linux image) files in images/linux directory. Compression of the image files reduces its size from 6GB to less than 300MB
gzip images/linux/petalinux-sdimage.wic
Built files reviewNow we have 3 following files in images/linux directory and we are ready to program production SOM non-volatile memory.
- BOOT.BIN (bootloaders file)
- petalinux-sdimage.wic.gz (compressed linux image)
- zynqmp_fsbl.elf (First Stage Boot Loader, the same as in the BOOT.BIN)
open vivado (any version and OS, I used 2022.1 in Win10 64 bit) and Flow->Open Hardware Manager
Power up KV260 CC with K26 SOM connected to the PC with uUSB cable (JTAG and UART).
Open Target -> Auto connect in the Hardware Manager
Add Configuration Memory Device to the xck26_0
Choosemt25ql512-qspi-x4-single for "configuration memory part" which is equivalent to the QSPI memory on the SOM
and proceed to (re)program the QSPI flash memory
Point next dialog window to the modified BOOT.BIN (bootloaders file) and FSBL that was created by petalinux tool and flash the QSPI memory
SD card can be prepared with Balena Etcher (Win10 or Linux) and image file (it compressed with gzip)
Image file petalinux-sdimage.wic.gz for flashing to eMMC memory can be copied to the SD card 1st partition (FAT32)
K26 SOM eMMC memory programmingPlug in SD card into KV260 CC and power it up, login into linux and flash eMMC with the commands like
sudo su
mount /media /dev/mmcblk1p01
gunzip -c /media/petalinux-sdimage.wic.gz | dd of=/dev/mmcblk0
Alternatively eMMC memory image can be loaded from USB memory with
mount /dev/sda /media
NotesI didn't try to load BOOT.BIN over JTAG with petalinux-boot, it requires linux machine to be connected to the KV260 CC, but it can be alternative method avoiding QSPI memory flashing with SD card aware bootloaders file.
Comments
Please log in or sign up to comment.