====== Boot and Kernel configure & build with PetaLinux 2020.2 without BSP (board support package) ======
- Create Vivado design and export the hardware with bitstream.\\ Default XSA (Xilinx Support Archive) location is:
/
In case you need it (but usually you shouldn't), default bitstream location is:
/.runs/impl_1/
- Setup PetaLinux enviroment (see [[hw:zynq:linux:petalinux:start|Install PetaLinux]])\\ \\
- Create PetaLinux project:
petalinux-create --type project --template zynq --name
cd
For UltraScale+:
petalinux-create -t project --template zynqMP --name
- Get hardware description from Vivado project:
petalinux-config --get-hw-description /
- Set booting from SD card by navigating through settings tree and choosing the proper options:
Subsystem AUTO Hardware Settings -> Advanced bootable images storage Settings -> boot image settings : set ‘image storage media’ option to ‘primary sd’
-> kernel image settings: set ‘image storage media’ option to ‘primary sd’
-> dtb image settings : set ‘image storage media’ option to ‘primary sd’
Image Packaging Configurations: set ‘Root filesystem type’ option to ‘EXT4 (SD/eMMC/SATA/USB)’
: uncheck 'Copy final images to tfpboot'
Select ''Exit'' to write the configuration.\\ \\ In case you want to reconfigure boot settings, run:
petalinux-config
- Check whether all required drivers/modules are enabled in kernel config:
petalinux-config -c kernel
Hint: you can use vim-like search ''/'' to list all enabled drivers/modules.\\ **Remember to __Save__ changes before exit -- it seems that there is no autosave!** \\
- In order to use the generic UIO driver ''uio_pdrv_genirq'' enable kernel modules in kernel config:
petalinux-config -c kernel
by navigating through settings tree and enabling modules (there should be '', not '<*>'):
Device Drivers -> <*> Userspace I/O drivers -> Userspace I/O platform driver with generic IRQ handling
Userspace platform driver with generic irq and dynamic memory
- In order to use the generic UIO driver modify the device tree to assign the compatibility with this driver to your hardware:
vim ./project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi
and add the entry at the end of this file:
&axi_gpio_0 {
compatible = "generic-uio";
};
for every hardware module you have.\\ Please notice that ''axi_gpio_0'' __is only an example__ of module name!
- Build the boot and kernel:
petalinux-build
- Determinate the bit file name in PetaLinux project (it is copied automatically from Vivado design by ''--get-hw-description''):
ls ./images/linux/*.bit
- Create ''BOOT.BIN'' image:
petalinux-package --boot --format BIN --fsbl ./images/linux/zynq_fsbl.elf --fpga ./images/linux/.bit --u-boot