This shows you the differences between two versions of the page.
Previous revisionNext revision | |||
— | resources:tools-software:linux-drivers:platforms:zynq [04 Aug 2016 17:17] – [Build and install the kernel image] Lars-Peter Clausen | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Linux with HDMI video output on the ZED, ZC702 and ZC706 boards ====== | ||
+ | ===== Supported devices ===== | ||
+ | |||
+ | * [[adi> | ||
+ | * [[adi> | ||
+ | * [[adi> | ||
+ | * [[adi> | ||
+ | * [[adi> | ||
+ | * [[adi> | ||
+ | * [[adi> | ||
+ | * [[adi> | ||
+ | * [[adi> | ||
+ | ===== Supported carriers ===== | ||
+ | |||
+ | * [[xilinx> | ||
+ | * [[xilinx> | ||
+ | * [[http:// | ||
+ | ===== Overview ===== | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | ===== Preparing the SD-card ===== | ||
+ | |||
+ | To boot the system on the ZED, ZC702 or ZC706 board you'll need a SD memory card. The SD card should have at least 4 GB of storage and it is recommended to use a card with speed-grade 6 or higher to achieve optimal file transfer performance. | ||
+ | |||
+ | The SD card needs to be partitioned with two partitions. The first one should be about 40MB in size and the second one should take up the remaining space. For optimal performance make sure that the partitions are 4MB aligned. | ||
+ | The first partition needs to be formatted with a FAT filesystem. It will hold the bootloader, devicetree and kernel images. | ||
+ | The second partition needs to be formatted with a ext4 filesystem. It will store the systems root filesystem. | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | ===== Obtain the HDL reference design ===== | ||
+ | |||
+ | The ZYNQ does not have a on-chip graphics or audio core, instead the FPGA is used to generate the necessary signals to deliver the video and audio streams to the ADV7511. Analog Devices provides a reference HDL design which contain support for generating the necessary video and audio as well as support for interfacing with the AD-FMCOMMS1-EBZ. | ||
+ | |||
+ | The HDL reference designs can be downloaded from their respective wiki page: | ||
+ | * [[: | ||
+ | * [[: | ||
+ | * [[: | ||
+ | |||
+ | <WRAP round help>The AD-FMCOMMS1-EBZ reference designs for the ZED, ZC702 and ZC706 include support for the ADV7511. So you only need one of the reference designs depending on whether you want support for the AD-FMCOMMS1-EBZ or not.</ | ||
+ | |||
+ | You can either use the provided reference designs to build your own system.bit or use a pre-build system.bit file. The system.bit will be required in the next step. | ||
+ | ===== Build the boot image ===== | ||
+ | |||
+ | To complete this step you need to have a u-boot image for the Zynq platform. Please refer to the [[http:// | ||
+ | |||
+ | The bootloader can be build with Xilinx SDK. In order to do so it is necessary to first export the HDL design from the Xilinx Platform Studio to the SDK, this is done by clicking the " | ||
+ | |||
+ | Export project to SDK: | ||
+ | {{ : | ||
+ | |||
+ | Once the project has been exported create a new FSBL project in the SDK. To do this right-click on the newly exported hardware platform specification in left " | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | The project should build automatically. If not a manual build can be started by right clicking the newly created project in the left " | ||
+ | |||
+ | * The freshly build zynq_fsbl.elf binary | ||
+ | * The system.bit bitstream | ||
+ | * The u-boot.elf binary | ||
+ | |||
+ | Add these files to partitions list in the dialog, then select an output folder. | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | Clicking " | ||
+ | |||
+ | ===== Build and install the kernel image ===== | ||
+ | |||
+ | <WRAP round info>The prerequistes for following these instructions are to have: | ||
+ | * mkimage from your distribution (normally '' | ||
+ | * C compiler from the Xilinx SDK | ||
+ | </ | ||
+ | <WRAP round download> | ||
+ | The most stable kernel source tree containing support for the ZED, ZC702 and ZC706 plus **AD-FMCOMMS1-EBZ** can be found at [[https:// | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | <WRAP box bggreen>< | ||
+ | < | ||
+ | > **git clone https: | ||
+ | Cloning into ' | ||
+ | remote: Counting objects: 2550298, done. | ||
+ | remote: Compressing objects: 100% (466978/ | ||
+ | remote: Total 2550298 (delta 2118600), reused 2483072 (delta 2058083) | ||
+ | Receiving objects: 100% (2550298/ | ||
+ | Resolving deltas: 100% (2118600/ | ||
+ | Checking out files: 100% (38170/ | ||
+ | > **cd linux** | ||
+ | > **git checkout xcomm_zynq** | ||
+ | > # For AD-FMCOMMS2-EBZ use | ||
+ | > # **git checkout xcomm_zynq ** | ||
+ | > **export ARCH=arm** | ||
+ | > **export CROSS_COMPILE=/ | ||
+ | > # e.g. export CROSS_COMPILE=/ | ||
+ | > **make zynq_xcomm_adv7511_defconfig** | ||
+ | # | ||
+ | # configuration written to .config | ||
+ | # | ||
+ | > **make uImage LOADADDR=0x00008000** | ||
+ | ... | ||
+ | OBJCOPY arch/ | ||
+ | Kernel: arch/ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | <WRAP round info>The same kernel image is used for all HDL reference design. | ||
+ | </ | ||
+ | |||
+ | The next step is to build the devicetree for your target platform. While the kernel is the same for all target boards the devicetree file differs as it describes the board specifics. | ||
+ | |||
+ | The following devicetree files are available: | ||
+ | |||
+ | | zynq-zc702-adv7511.dts | [[xilinx> | ||
+ | | zynq-zc702-adv7511-ad9361-fmcomms2-3.dts | [[xilinx> | ||
+ | | zynq-zc702-adv7511-ad9361-fmcomms5.dts | [[xilinx> | ||
+ | | zynq-zc702-adv7511-ad9364-fmcomms4.dts | [[xilinx> | ||
+ | | zynq-zc702-adv7511-fmcomms1.dts | [[xilinx> | ||
+ | | zynq-zc706-adv7511.dts | [[xilinx> | ||
+ | | zynq-zc706-adv7511-ad6676-fmc.dts | [[xilinx> | ||
+ | | zynq-zc706-adv7511-ad9265-fmc-125ebz.dts | [[xilinx> | ||
+ | | zynq-zc706-adv7511-ad9361-fmcomms2-3.dts | [[xilinx> | ||
+ | | zynq-zc706-adv7511-ad9361-fmcomms2-3-pr.dts | [[xilinx> | ||
+ | | zynq-zc706-adv7511-ad9361-fmcomms5.dts | [[xilinx> | ||
+ | | zynq-zc706-adv7511-ad9364-fmcomms4.dts | [[xilinx> | ||
+ | | zynq-zc706-adv7511-ad9434-fmc-500ebz.dts | [[xilinx> | ||
+ | | zynq-zc706-adv7511-ad9625-fmcadc2.dts | [[xilinx> | ||
+ | | zynq-zc706-adv7511-fmcadc4.dts | [[xilinx> | ||
+ | | zynq-zc706-adv7511-fmcdaq1.dts | [[xilinx> | ||
+ | | zynq-zc706-adv7511-fmcdaq2.dts | [[xilinx> | ||
+ | | zynq-zc706-adv7511-fmcjesdadc1.dts | [[xilinx> | ||
+ | | zynq-zc706-adv7511-fmcomms1.dts | [[xilinx> | ||
+ | | zynq-zc706-adv7511-fmcomms6.dts | [[xilinx> | ||
+ | | zynq-zed-adv7511.dts | [[http:// | ||
+ | | zynq-zed-adv7511-ad9361-fmcomms2-3.dts | [[http:// | ||
+ | | zynq-zed-adv7511-ad9364-fmcomms4.dts | [[http:// | ||
+ | | zynq-zed-adv7511-ad9467-fmc-250ebz.dts | [[http:// | ||
+ | | zynq-zed-adv7511-fmcmotcon1.dts | [[http:// | ||
+ | | zynq-zed-adv7511-fmcmotcon2.dts | [[http:// | ||
+ | | zynq-zed-adv7511-fmcomms1.dts | [[http:// | ||
+ | | zynq-mini-itx-adv7511.dts | [[http:// | ||
+ | | zynq-mini-itx-adv7511-ad9361-fmcomms2-3.dts | [[http:// | ||
+ | | zynq-mini-itx-adv7511-ad9361-fmcomms2-3-pr.dts | [[http:// | ||
+ | | zynq-mini-itx-adv7511-ad9364-fmcomms4.dts | [[http:// | ||
+ | |||
+ | |||
+ | |||
+ | <WRAP round important> | ||
+ | |||
+ | To build the devicetree from the devicetree file run `make name-dts-replaced-by-dtb` | ||
+ | |||
+ | <WRAP box bggreen>< | ||
+ | < | ||
+ | > **make zynq-zed-adv7511-xcomm.dtb** | ||
+ | DTC | ||
+ | DTC: dts-> | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | The last step is to copy both the kernel and the devicetree files to the first partition of the SD card. It is important to rename the devicetree file to devicetree.dtb | ||
+ | |||
+ | <WRAP box bggreen>< | ||
+ | < | ||
+ | > **cp arch/ | ||
+ | > **cp arch/ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ===== uEnv.txt ===== | ||
+ | |||
+ | The default environment that is used by the u-boot bootloader instructions the kernel to use a ramfs disk for its root filesystem. In order to boot from the SD card it is necessary to overwrite the default environment. This can be done by placing a file called uEnv.txt in the BOOT partition of the SD card. This file will be read by u-boot and is used to replace the default environment. | ||
+ | |||
+ | **uEnv.txt for using SD card rootfs** | ||
+ | < | ||
+ | uenvcmd=run adi_sdboot | ||
+ | adi_sdboot=echo Copying Linux from SD to RAM... && fatload mmc 0 0x3000000 ${kernel_image} && fatload mmc 0 0x2A00000 ${devicetree_image} && if fatload mmc 0 0x2000000 ${ramdisk_image}; | ||
+ | bootargs=console=ttyPS0, | ||
+ | </ | ||
+ | ===== Install the root file system ===== | ||
+ | |||
+ | In this example we will use a [[http:// | ||
+ | |||
+ | The first step is to download the [[http:// | ||
+ | |||
+ | <WRAP box bggreen>< | ||
+ | < | ||
+ | > **wget http: | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | The next step is to extract the root filesystem from the archive to the SD card. It is important to preserve the file permission and owner settings, otherwise the system will be unable to boot. Since some of the files have root permissions it is necessary to run the extraction process as root. | ||
+ | |||
+ | <WRAP box bggreen>< | ||
+ | < | ||
+ | > **sudo tar --strip-components=3 -C / | ||
+ | > **ls / | ||
+ | bin/ boot/ dev/ etc/ home/ lib/ lost+found/ | ||
+ | proc/ root/ run/ sbin/ selinux/ | ||
+ | </ | ||
+ | </ | ||
+ | ===== Testing the system ===== | ||
+ | |||
+ | Once all of the previous tasks have been completed it is time to test the system. To do this insert the SD-card into the board and power-up the board. After a few seconds the blue " | ||
+ | |||
+ | After another few seconds the monitor connected to the system will turn on and display the [[http:// | ||
+ | |||
+ | ===== Post-installation tweaks ===== | ||
+ | |||
+ | After the system has been installed it is time to do some post-installation tweaks to the system. None of them is required to get a basic working system, but they improve the overall video and audio experience quite a bit. | ||
+ | |||
+ | ==== Enable xf86-video-modesetting Xorg driver ==== | ||
+ | |||
+ | The xf86-video-modesetting driver is a driver which has been written to take advantage of the new Kernel Mode Setting (KMS) API of the DRM layer. This allows to switch between different screen resolutions at runtime (using the Xservers xrandr interface) and adds plug-and-play support for monitors. | ||
+ | |||
+ | Unfortunately the current Linaro Ubuntu distribution does not contain a package for xf86-video-modesetting driver. So it becomes necessary to manually download and build it. Open up a terminal on the target system and run the following commands. | ||
+ | |||
+ | <WRAP box bggreen>< | ||
+ | < | ||
+ | > **sudo apt-get install xserver-xorg-dev libdrm-dev xutils-dev** | ||
+ | > **wget http: | ||
+ | > **tar -xjf xf86-video-modesetting-0.9.0.tar.bz2** | ||
+ | > **cd xf86-video-modesetting-0.9.0** | ||
+ | > **./ | ||
+ | > **make** | ||
+ | > **sudo make install** | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | To enable the modesetting driver the create / | ||
+ | |||
+ | Enable the modesetting driver: | ||
+ | < | ||
+ | Section " | ||
+ | Identifier " | ||
+ | Driver " | ||
+ | EndSection | ||
+ | </ | ||
+ | |||
+ | ==== Fixing issues with pulse audio ==== | ||
+ | |||
+ | PulseAudio is the audio daemon used by default on the Linaro Ubuntu installation. Unfortunately PulseAudio' | ||
+ | |||
+ | <WRAP box bggreen>< | ||
+ | < | ||
+ | > **sed -i ' | ||
+ | </ | ||
+ | </ | ||
+ | ===== More information ===== | ||
+ | |||
+ | * [[resources/ | ||
+ | * [[resources: | ||
+ | * [[resources: | ||
+ | * [[resources: | ||
+ | * [[resources: | ||
+ | * [[resources: | ||
+ | * [[resources: | ||
+ | * [[../ | ||
+ | * [[../ | ||
+ | * [[../ | ||
+ | * [[../ | ||
+ | * [[../ | ||
+ | * [[../ | ||
+ | * [[../ | ||
+ | * [[../ | ||
+ | * [[../ | ||
+ | * [[../ | ||
+ | * [[resources: | ||
+ | |||
+ | {{page> |