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!

AR# 55979

PetaLinux - How do I add device firmware to my Linux root file system?

Description

I have pre-compiled device firmware binaries that I would like to include in my Linux root file system.

How do I have the PetaLinux build process incorporate this code?

Solution

To have the PetaLinux build tools incorporate pre-built device firmware, follow this general flow:

For 2013.10 and later:-

  1. Ensure that the firmware code has been compiled for your PetaLinux target architecture (for example, MicroBlaze, ARM, etc.).
     
  2. Select Device Drivers ---> Generic Driver Options ---> <*> Userspace firmware loading support from the kernel menuconfig.
     
  3. Enable Include in-kernel firmware blobs in kernel binary from menuconfig (optional).
    If selected, place the device firmware binaries into ${PETALINUX}/build/linux/kernel/xlnx-3.xx/firmware/ before compiling the kernel.
     
  4. Use  petalinux-create -t apps -n myapp to create an application.
    The new application will be located in ${PETALINUX}/components/apps/<APP>/.
    The -enable option for petalinux-create -t apps -n myapp will automatically select the application from menuconfig and will allow the application to be automatically built when the PetaLinux system is built.
     
  5. Place the pre-built firmware binaries into ${PETALINUX}/components/apps/<APP>/
     
  6. Modify the makefile located inside ${PETALINUX}/components/apps/<APP>/
    • Ensure that the all: and clean: sections of the makefile are empty.
    • Update the install: section to copy the pre-built binaries into ${PETALINUX}/build/linux/rootfs/.

An example of the modifications is as follows:

{{{
APP=myapp
all:
clean:
install: $(APP) $(TARGETINST) -d $(APP) /firmware/$(APP)
}}}


For older flows:-

  1. Ensure that the firmware code has been compiled for your PetaLinux target architecture (for example, MicroBlaze, ARM, etc.).
     
  2. Select Generic Driver Options ---> <*> Userspace firmware loading support from the kernel menuconfig.
     
  3. Enable Include in-kernel firmware blobs in kernel binary from menuconfig (optional).
    If selected, place the device firmware binaries into ${PETALINUX}/software/linux-2.6.x/firmware/ before compiling the kernel.
     
  4. Use the petalinux-new-app to create an application.
    The new application will be located in ${PETALINUX}/software/user-apps/<APP>/.
    The -e option for petlinux-new-app will automatically select the application from menuconfig and will allow the application to be automatically built when the PetaLinux system is built.
     
  5. Place the pre-built firmware binaries into ${PETALINUX}/software/user-apps/<APP>/
     
  6. Modify the makefile located inside ${PETALINUX}/software/user-apps/<APP>/.
    • Ensure that the all: and clean: sections of the makefile are empty.
    • Update the romfs: section to copy the pre-built binaries into ${PETALINUX}/software/petalinux-dist/rootfs/.

An example of the modifications is as follows:

{{{
APP=myapp
all:
clean:
romfs:
$(ROMFSINST) -d $(APP) /firmware/$(APP)
}}}

AR# 55979
Date Created 05/13/2013
Last Updated 11/25/2014
Status Active
Type General Article
Devices
  • SoC
  • XA Zynq-7000
  • Zynq-7000
  • More
  • Zynq-7000Q
  • FPGA Device Families
  • Artix-7
  • Kintex-7
  • Spartan-6
  • Virtex-4
  • Virtex-5
  • Virtex-6
  • Virtex-7
  • Less
Tools
  • PetaLinux
  • PetaLinux - 2012.12
  • PetaLinux - 2013.04