This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
hw:zynq:linux:petalinux:boot_kernel [2019/03/21 16:03] jakub.moron |
hw:zynq:linux:petalinux:boot_kernel [2021/04/21 14:57] (current) jakub.moron |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Boot and Kernel configure & build with PetaLinux without BSP (board support package) ====== | + | ====== Boot and Kernel configure & build with PetaLinux 2018.3 without BSP (board support package) ====== |
- Create Vivado design and export the hardware with bitstream.\\ Default hdf (hardware description file) location is: <code> | - Create Vivado design and export the hardware with bitstream.\\ Default hdf (hardware description file) location is: <code> | ||
Line 10: | Line 10: | ||
petalinux-create --type project --template zynq --name <boot_project_name> | petalinux-create --type project --template zynq --name <boot_project_name> | ||
cd <boot_project_name> | cd <boot_project_name> | ||
+ | </code> For UltraScale+: <code> | ||
+ | petalinux-create -t project --template zynqMP --name <boot_project_name> | ||
</code> | </code> | ||
- Get hardware description from Vivado project: <code> | - Get hardware description from Vivado project: <code> | ||
- | petalinux-config --get-hw-description=<absolute_path_to_vivado_project_directory>/<project_name>.sdk/ | + | petalinux-config --get-hw-description <path_to_vivado_project_directory>/<project_name>.sdk/ |
</code> | </code> | ||
- Set booting from SD card by navigating through settings tree and choosing the proper options: <code> | - Set booting from SD card by navigating through settings tree and choosing the proper options: <code> | ||
Line 20: | Line 22: | ||
Image Packaging Configurations: set ‘Root filesystem type’ option to ‘SD card’ | Image Packaging Configurations: set ‘Root filesystem type’ option to ‘SD card’ | ||
: uncheck 'Copy final images to tfpboot' | : uncheck 'Copy final images to tfpboot' | ||
- | </code> Select ''Exit'' and write the configuration.\\ \\ In case you want to reconfigure boot settings, run: <code> | + | </code> Select ''Exit'' to write the configuration.\\ \\ In case you want to reconfigure boot settings, run: <code> |
petalinux-config | petalinux-config | ||
</code> | </code> | ||
- Check whether all required drivers/modules are enabled in kernel config: <code> | - Check whether all required drivers/modules are enabled in kernel config: <code> | ||
petalinux-config -c kernel | petalinux-config -c kernel | ||
- | </code> Hint: you can use vim-like search ''/<search_string>'' to list all enabled drivers/modules.\\ **Remember to Save changes before exit -- there is no autosave!** \\ \\ For example, for ''axi_gpio'' the following driver options should be enabled: <code> | + | </code> Hint: you can use vim-like search ''/<search_string>'' to list all enabled drivers/modules.\\ **Remember to __Save__ changes before exit -- it seems that there is no autosave!** \\ |
- | GPIO_SYSFS | + | - In order to use the generic UIO driver ''uio_pdrv_genirq'' enable kernel modules in kernel config: <code> |
- | SYSFS | + | petalinux-config -c kernel |
- | GPIO_XILINX | + | </code> by navigating through settings tree and enabling modules (there should be '<M>', not '<*>'): <code> |
- | </code> If search result list is empty, the selected driver/module is not enabled. | + | Device Drivers -> <*> Userspace I/O drivers -> <M> Userspace I/O platform driver with generic IRQ handling |
+ | <M> Userspace platform driver with generic irq and dynamic memory | ||
+ | </code> | ||
+ | - In order to use the generic UIO driver modify the device tree to assign the compatibility with this driver to your hardware: <code> | ||
+ | vim ./project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi | ||
+ | </code> and add the entry at the end of this file: <code> | ||
+ | &axi_gpio_0 { | ||
+ | compatible = "generic-uio"; | ||
+ | }; | ||
+ | </code> for every hardware module you have.\\ Please notice that ''axi_gpio_0'' __is only an example__ of module name! | ||
- Fix the u-boot bug -- a typo in default boot command.\\ The proper boot configure entry: <code> | - Fix the u-boot bug -- a typo in default boot command.\\ The proper boot configure entry: <code> | ||
default_bootcmd=run uenvboot; run cp_kernel2ram && bootm ${netstart} | default_bootcmd=run uenvboot; run cp_kernel2ram && bootm ${netstart} | ||
</code> is created by PetaLinux as <code> | </code> is created by PetaLinux as <code> | ||
default_bootcmd=run uenvboot; run cp_kernel2ram && run cp_dtb2ram && booti ${netstart} - ${dtbnetstart} | default_bootcmd=run uenvboot; run cp_kernel2ram && run cp_dtb2ram && booti ${netstart} - ${dtbnetstart} | ||
- | </code> with the typo in ''booti'' instead of ''bootm'' command.\\ \\ To fix this bug, edit the ''platform-top.h'' file (after all other configuration is done): <code> | + | </code> with the typo in ''booti'' instead of ''bootm'' command.\\ \\ To fix this bug, edit the ''platform-top.h'' file (it would not be overwrite if you reconfigure the boot or kernel): <code> |
vim ./project-spec/meta-user/recipes-bsp/u-boot/files/platform-top.h | vim ./project-spec/meta-user/recipes-bsp/u-boot/files/platform-top.h | ||
</code> and add the following entry at the end: <code> | </code> and add the following entry at the end: <code> | ||
Line 46: | Line 57: | ||
#endif | #endif | ||
</code> | </code> | ||
- | - Build the boot and kernel files: <code> | + | - Build the boot and kernel: <code> |
petalinux-build | petalinux-build | ||
</code> | </code> | ||
- Determinate the bit file name in PetaLinux project (it is copied automatically from Vivado design by ''--get-hw-description''): <code> | - Determinate the bit file name in PetaLinux project (it is copied automatically from Vivado design by ''--get-hw-description''): <code> | ||
- | ls ./images/linux/*.bin | + | ls ./images/linux/*.bit |
</code> | </code> | ||
- Create ''BOOT.BIN'' image: <code> | - Create ''BOOT.BIN'' image: <code> | ||
petalinux-package --boot --format BIN --fsbl ./images/linux/zynq_fsbl.elf --fpga ./images/linux/<bit_filename>.bit --u-boot | petalinux-package --boot --format BIN --fsbl ./images/linux/zynq_fsbl.elf --fpga ./images/linux/<bit_filename>.bit --u-boot | ||
</code> | </code> |