11
One Technology Way · P.O. Box 9106 · Norwood, MA 02062-9106 · Tel: 781.329.4700 · Fax: 781.461.3113 · www.analog.com Rev 10 Feb 2014 15:53 | Page 1 Linux with HDMI video output on the ZED and ZC702, ZC706 boards Supported devices ADV7511 FMCOMMS-1 FMCOMMS-2 ZC702 ZC706 Zed Board Overview Preparing the SD-card To boot the system on the ZED or ZC702 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

Zedboard Ubuntu

Embed Size (px)

DESCRIPTION

zedboard for ubuntu

Citation preview

  • One Technology Way P.O. Box 9106 Norwood, MA 02062-9106 Tel: 781.329.4700 Fax: 781.461.3113 www.analog.com

    Rev 10 Feb 2014 15:53 | Page 1

    Linux with HDMI video output on the ZEDand ZC702, ZC706 boards

    Supported devicesADV7511lFMCOMMS-1lFMCOMMS-2l

    ZC702lZC706l

    Zed Boardl

    Overview

    Preparing the SD-card

    To boot the system on the ZED or ZC702 board you'll need a SD memory card. The SD card shouldhave at least 4 GB of storage and it is recommended to use a card with speed-grade 6 or higher toachieve optimal file transfer performance.

    The SD card needs to be partitioned with two partitions. The first one should be about 40MB in sizeand the second one should take up the remaining space. For optimal performance make sure that thepartitions are 4MB aligned. The first partition needs to be formatted with a FAT filesystem. It will hold

  • Rev 10 Feb 2014 15:53 | Page 2

    the bootloader, devicetree and kernel images. The second partition needs to be formatted with a ext4filesystem. 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 thenecessary signals to deliver the video and audio streams to the ADV7511. Analog Devices provides areference HDL design which contain support for generating the necessary video and audio as well assupport for interfacing with the AD-FMCOMMS1-EBZ.

    The HDL reference designs can be downloaded from their respective wiki page:

    ADV7511 XILINX KC705, VC707, ZC702 AND ZED REFERENCE DESIGNlAD-FMCOMMS1-EBZ REFERENCE DESIGNlAD-FMCOMMS2-EBZ DESIGNl

    The AD-FMCOMMS1-EBZ reference designs for the ZED and ZC702 include support for theADV7511. So you only need one of the reference designs depending on whether you wantsupport 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-buildsystem.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 theXilinx wiki on how to build such an image.

  • Rev 10 Feb 2014 15:53 | Page 3

    The bootloader can be build with Xilinx SDK. In order to do so it is necessary to first export the HDLdesign from the Xilinx Platform Studio to the SDK, this is done by clicking the Export to SDK buttonin the Platform Studio GUI.

    Export project to SDK:

    Once the project has been exported create a new FSBL project in the SDK. To do this right-click on thenewly exported hardware platform specification in left Project Explorer panel and select New >Project from the popup menu. Select Xilinx - Application Project on first dialog page. On the seconddialog page choose a name for the project (zynq_fsbl for example) and on the third page select ZynqFSBL template.

  • Rev 10 Feb 2014 15:53 | Page 4

  • Rev 10 Feb 2014 15:53 | Page 5

    The project should build automatically. If not a manuall build can be started by right clicking thenewly created project in the left Project Explorer pane and selecting Build Project from the popupmenu. After the project has been build it is time to generate the boot image. This is done by rightclicking on the project in the left Project Explorer pane and selecting Create Boot Image. This willopen up the bootgen wizard. The bootgen wizard needs three files:

    The freshly build zynq_fsbl.elf binarylThe system.bit bitstreamlThe u-boot.elf binaryl

    Add these files to partitions list in the dialog, then select an output folder.

  • Rev 10 Feb 2014 15:53 | Page 6

    Clicking Create Image will now generate in the chosen location a new boot image for the targetplatform. The output *.bin file should be named BOOT.BIN and needs to be saved on the firstpartition of the SD-card.

    Build and install the kernel image

    The prerequistes for following these instructions are to have:

    mkimage from your distribution (normally apt-get install u-boot-tools)lC compiler from the Xilinx SDKl

    The kernel source tree containing support for the ZED and ZC702 plus AD-FMCOMMS1-EBZ can befound at xcomm_zynq. For the AD-FMCOMMS2-EBZ use the xcomm_zynq branch.

    root Download and build the kernel image

    > git clone https://github.com/analogdevicesinc/linux.gitCloning into 'linux'...remote: Counting objects: 2550298, done.remote: Compressing objects: 100% (466978/466978), done.remote: Total 2550298 (delta 2118600), reused 2483072 (delta 2058083)Receiving objects: 100% (2550298/2550298), 727.70 MiB | 353 KiB/s, done.Resolving deltas: 100% (2118600/2118600), done.Checking out files: 100% (38170/38170), done.> cd linux> git checkout xcomm_zynq> # For AD-FMCOMMS2-EBZ use

  • Rev 10 Feb 2014 15:53 | Page 7

    > # git checkout xcomm_zynq> export ARCH=arm> export CROSS_COMPILE=/path/to/your/arm/cross-compiler> # e.g. exportCROSS_COMPILE=/opt/CodeSourcery/Sourcery_G++_Lite/bin/arm-xilinxa9-linux-gnueabi-> make zynq_xcomm_adv7511_defconfig## configuration written to .config#> make uImage LOADADDR=0x00008000 ... OBJCOPY arch/arm/boot/uImage Kernel: arch/arm/boot/uImage is ready

    The same kernel image is used for all HDL reference design. Design specific options are

    The next step is to build the devicetree for your target platform. While the kernel is the same for alltarget boards the devicetree file differs as it describes the board specifics.

    The following devicetree files are available:

    zynq-zc702-adv7511.dts: ZC702 board with HDMI video outlzynq-zc702-adv7511-xcomm.dts: ZC702 board with HDMI video out and AD-FMCOMMS1-EBZlcard attachedzynq-zc702-adv7511-ad9361.dts: ZC702 board with HDMI video out and AD-FMCOMMS2-EBZlcard attachedzynq-zc706-adv7511.dts: ZC706 board with HDMI video outlzynq-zc706-adv7511-xcomm.dts: ZC706 board with HDMI video out and AD-FMCOMMS1-EBZlcard attachedzynq-zc706-adv7511-ad9361.dts: ZC706 board with HDMI video out and AD-FMCOMMS2-EBZlcard attachedzynq-zed-adv7511.dts: ZED board with HDMI video out and ADAU1761 audio supportlzynq-zed-adv7511-xcomm.dts: ZED board with HDMI video out, ADAU1761 audio support andlAD-FMCOMMS1-EBZ card attachedzynq-zed-adv7511-ad9361.dts: ZED board with HDMI video out, ADAU1761 audio support andlAD-FMCOMMS2-EBZ card attached

    The devicetree must match the HDL reference design that is used. It is not possible to use aadv7511 only devicetree for a AD-FMCOMMS1-EBZ reference HDL design, even if theAD-FMCOMMS1-EBZ is not connected to the FMC slot.

  • Rev 10 Feb 2014 15:53 | Page 8

    To build the devicetree from the devicetree file run `make name-dts-replaced-by-dtb`

    Build the devicetree for ZED with HDMI video out and XCOMM

    > make zynq-zed-adv7511-xcomm.dtb DTC arch/arm/boot/zynq-zed-adv7511-xcomm.dtbDTC: dts->dtb on file "arch/arm/boot/dts/zynq-zed-adv7511-xcomm.dts"

    The last step is to copy both the kernel and the devicetree files to the first partition of the SD card. Itis important to rename the devicetree file to devicetree.dtb

    Copy kernel and device tree to SD card

    > cp arch/arm/boot/uImage /media/BOOT/uImage> cp arch/arm/boot/zynq-zed-adv7511-xcomm.dtb /media/BOOT/devicetree.dtb

    Install the root file system

    In this example we will use a Linaro Ubuntu ARM rootfs as it provides a good out of the boxexperience. The latest version can be found on the Linaro Download page. In this example we will usethe 12.11 release.

    The first step is to download the archive containing the root filesystem.

    Download Linaro Ubtunu ARM rootfs

    > wgethttp://releases.linaro.org/12.11/ubuntu/precise-images/ubuntu-desktop/linaro-precise-ubuntu-desktop-20121124-560.tar.gz

  • Rev 10 Feb 2014 15:53 | Page 9

    The next step is to extract the root filesystem from the archive to the SD card. It is important topreserve the file permission and owner settings, otherwise the system will be unable to boot. Sincesome of the files have root permissions it is necessary to run the extraction process as root.

    Extract the root filesystem onto the SD card

    > sudo tar --strip-components=3 -C /media/rootfs -xzpflinaro-precise-ubuntu-desktop-20121124-560.tar.gzbinary/boot/filesystem.dir> ls /media/rootfs/bin/ boot/ dev/ etc/ home/ lib/ lost+found/ media/ mnt/ opt/proc/ root/ run/ sbin/ selinux/ srv/ sys/ tmp/ usr/ var/

    Testing the system

    Once all of the previous tasks have been completed it is time to test the system. To do this insertedthe SD-card into the board and power-up the board. After a few seconds the blue DONE LED shouldlight up. This means that the bitstream has been successfully loaded and the system will now start toboot. It is also possible to connect to the serial console by using the on-board UART-to-USB bridge,this allows to monitor the boot process and view debug messages.

    After another few seconds the monitor connected to the system will turn on and display the Linuxmascot in the top left corner, after that the Ubuntu Desktop system will appear on the screen. Thesystem is now ready to be used.

    Post-installation tweaks

    After the system has been installed it is time to do some post-installation tweaks to the system. Noneof them is required to get a basic working system, but they improve the overall video and audioexperience 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

  • Rev 10 Feb 2014 15:53 | Page 10

    Kernel Mode Setting (KMS) API of the DRM layer. This allows to switch between different screenresolutions at runtime (using the Xservers xrandr interface) and adds plug-and-play support formonitors.

    Unfortunately the current Linaro Ubuntu distribution does not contain a package forxf86-video-modesetting driver. So it becomes necessary to manually download and build it. Open up aterminal on the target system and run the following commands.

    Download and install xf86-video-modesetting

    > sudo apt-get install xserver-xorg-dev libdrm-dev xutils-dev> wgethttp://xorg.freedesktop.org/archive/individual/driver/xf86-video-modesetting-0.5.0.tar.bz2> tar -xjf xf86-video-modesetting-0.5.0.tar.bz2> cd xf86-video-modesetting-0.5.0> ./configure --prefix=/usr> make> sudo make install

    To enable the modesetting driver the create /etc/X11/xorg.conf and add following lines:

    Enable the modesetting driver:

    Section "Device" Identifier "ADV7511 HDMI" Driver "modesetting" EndSection

    Fixing issues with pulse audio

    PulseAudio is the audio daemon used by default on the Linaro Ubuntu installation. UnfortunatelyPulseAudio's 'glitch-free' algorithm seems to cause audio glitches on this particular platform. To getseamless audio experience it is necessary to disable the glitch-free feature. To disable the 'glitch-free'feature of pulse audio open up a terminal on the target system an run the following commands.

    Disable pulse audio 'glitch-free' feature

    > sudo sed -i 's,load-module module-udev-detect,load-module

  • Rev 10 Feb 2014 15:53 | Page 11

    module-udev-detect tsched=0,' /etc/pulse/default.pa

    More informationAD-FMCOMMS1-EBZ Reference DesignlAD-FMCOMMS2-EBZ User GuidelADI IIO OscilloscopelAD7511 HDMI transmitter Linux DriverlAXI HDMI HDL Linux DriverlHDL AXI SPIDF Linux DriverlHDL AXI I2S Linux DriverlAD9523-1: Low Jitter Clock Generator with 14 LVPECL/LVDS/HSTL/29 LVCMOS OutputslADF4351: Wideband Synthesizer with Integrated VCOlAD8366: DC to 600 MHz, Dual-Digital Variable Gain AmplifierslAD9643: 14-Bit, 170/210/250 MSPS, 1.8 V Dual Analog-to-Digital Converter (ADC)lAD9122: Dual, 16-Bit, 1200 MSPS, TxDAC+ Digital-to-Analog ConverterlAD9361 high performance, highly integrated RF Agile Transceiver Linux device driverl

    Need Help?

    Analog Devices Linux Device Drivers Help ForumlAsk a Questionl

    31 Jul 2012 16:53 Lars-Peter Clausen

    Analog Devices, Inc. All rights reserved. Trademarks andregistered trademarks are the property of their respective owners. www.analog.com

    Linux with HDMI video output on the ZED and ZC702, ZC706 boardsSupported devicesOverviewPreparing the SD-cardObtain the HDL reference designBuild the boot imageBuild and install the kernel imageInstall the root file systemTesting the systemPost-installation tweaksEnable xf86-video-modesetting Xorg driverFixing issues with pulse audio

    More information