Zedboard Ubuntu

Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

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

com

Linux with HDMI video output on the ZED and ZC702, ZC706 boards
Supported devices
G G G G G G

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 Rev 10 Feb 2014 15:53 | Page 1

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:
G G G

ADV7511 XILINX KC705, VC707, ZC702 AND ZED REFERENCE DESIGN AD-FMCOMMS1-EBZ REFERENCE DESIGN AD-FMCOMMS2-EBZ DESIGN

The AD-FMCOMMS1-EBZ reference designs for the ZED and ZC702 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 Xilinx wiki on how to build such an image. Rev 10 Feb 2014 15:53 | Page 2

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 to SDK button in 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 the newly 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 second dialog page choose a name for the project (zynq_fsbl for example) and on the third page select Zynq FSBL template.

Rev 10 Feb 2014 15:53 | Page 3

Rev 10 Feb 2014 15:53 | Page 4

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

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.

Rev 10 Feb 2014 15:53 | Page 5

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

Build and install the kernel image


The prerequistes for following these instructions are to have:
G G

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

The kernel source tree containing support for the ZED and ZC702 plus AD-FMCOMMS1-EBZ can be found 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.git Cloning 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 6

> # git checkout xcomm_zynq > export ARCH=arm > export CROSS_COMPILE=/path/to/your/arm/cross-compiler > # e.g. export CROSS_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 all target boards the devicetree file differs as it describes the board specifics. The following devicetree files are available:
G G

G G

G G

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

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

Rev 10 Feb 2014 15:53 | Page 7

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.dtb DTC: 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. It is 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 box experience. The latest version can be found on the Linaro Download page. In this example we will use the 12.11 release. The first step is to download the archive containing the root filesystem.

Download Linaro Ubtunu ARM rootfs

> wget http://releases.linaro.org/12.11/ubuntu/precise-images/ubuntu-desktop/li naro-precise-ubuntu-desktop-20121124-560.tar.gz

Rev 10 Feb 2014 15:53 | Page 8

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.

Extract the root filesystem onto the SD card

> sudo tar --strip-components=3 -C /media/rootfs -xzpf linaro-precise-ubuntu-desktop-20121124-560.tar.gz binary/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 inserted the SD-card into the board and power-up the board. After a few seconds the blue DONE LED should light up. This means that the bitstream has been successfully loaded and the system will now start to boot. 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 Linux mascot in the top left corner, after that the Ubuntu Desktop system will appear on the screen. The system 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. 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 Rev 10 Feb 2014 15:53 | Page 9

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.

Download and install xf86-video-modesetting

> sudo apt-get install xserver-xorg-dev libdrm-dev xutils-dev > wget http://xorg.freedesktop.org/archive/individual/driver/xf86-video-modeset ting-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. Unfortunately PulseAudio's 'glitch-free' algorithm seems to cause audio glitches on this particular platform. To get seamless 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 10

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

More information
G G G G G G G G G G G G G

AD-FMCOMMS1-EBZ Reference Design AD-FMCOMMS2-EBZ User Guide ADI IIO Oscilloscope AD7511 HDMI transmitter Linux Driver AXI HDMI HDL Linux Driver HDL AXI SPIDF Linux Driver HDL AXI I2S Linux Driver AD9523-1: Low Jitter Clock Generator with 14 LVPECL/LVDS/HSTL/29 LVCMOS Outputs ADF4351: Wideband Synthesizer with Integrated VCO AD8366: DC to 600 MHz, Dual-Digital Variable Gain Amplifiers AD9643: 14-Bit, 170/210/250 MSPS, 1.8 V Dual Analog-to-Digital Converter (ADC) AD9122: Dual, 16-Bit, 1200 MSPS, TxDAC+ Digital-to-Analog Converter AD9361 high performance, highly integrated RF Agile Transceiver Linux device driver

Need Help?
G G

Analog Devices Linux Device Drivers Help Forum Ask a Question

31 Jul 2012 16:53 Lars-Peter Clausen


Analog Devices, Inc. All rights reserved. Trademarks and registered trademarks are the property of their respective owners.

www.analog.com

Rev 10 Feb 2014 15:53 | Page 11

You might also like