[转载]HDMI on ZedBoard with Petalinux.

This is step-by-step tutorial on how to build reference design for Analog Devices ADV7511 HDMI encoder used on ZedBoard with PetaLinux 2013.10. It will be mostly based on AD HDL reference design http://wiki.analog.com/resources/fpga/xilinx/kc705/adv7511 and AD Linux drivers wiki page http://wiki.analog.com/resources/tools-software/linux-drivers/platforms/zynq and Xilinx PetaLinux documentation http://www.wiki.xilinx.com/PetaLinux .

As of today, 25 May 2014, to create HDL design for ADV7511 from scratch, we have to use Vivado 2013.4, even though Vivado 2014.1 is already available. The reason is some changes in a Xilinx IP's (which I didn't had a chance to figure out yet) prevent HDL design from build/work properly.

    1. First step is to download HDL libraries and projects from AnalogDevices repositories on a github: https://github.com/analogdevicesinc/hdl . You can clone it or download a ZIP. I will download a ZIP and extract 'hdl-master' in my Projects/FPGA/ folder on Windows7 machine.
    2. Second step is to build a few Analog Devices IP required to create ZedBoard HDMI design. Run Xilinx Vivado 2013.4, open a TCL console, change directories and 'source' a .tcl scripts. For example, to build AXI_CLKGEN IP:

       

      cd c:/Projects/FPGA/hdl-master/library/axi_clkgen
      source ./axi_clkgen_ip.tcl

      After script finish, close created project and build the next. For ZedBoard we have build the next IP's:

      • hdl-master/library/axi_clkgen
      • hdl-master/library/axi_hdmi_tx
      • hdl-master/library/axi_i2s_adi
      • hdl-master/library/axi_spdif_tx
      • hdl-master/library/util_i2c_mixer
    3. After we done with all required IP's, we can build ADV7511 reference design for ZedBoard. In a Tcl Console change directory to ADV7511 and run 'system_project' script.

       

      cd c:/Projects/FPGA/hdl-master/projects/adv7511/zed/
      source ./system_project.tcl

      Script will create block design, run synthesis and implementation, generate bitstream and even export software to SDK(without opening it). This was the case on my system - everything went smoothly. We are done with Vivado and can close it.

      We have to create HDL in Vivado 2013.4, but later we can import created project into Vivado 2014.1 and update it to use latest Xilinx IP's.

    4. Let's build a FSBL. We need very typical Zynq first stage boot loader and I covered creation of it before, so now just a short description:
      • Run XSDK.
      • Create new 'Hardware Platform Specification' project (I named it 'ZedBoard-HDMI-HW') and specify HW created in a previous step.
      • Create Application project (named 'ZedBoard-HDMI-FSBL') using our new 'Hardware Platform' and select to create new BSP for it. Don't forget to use 'Zynq FSBL' template. Build it if this not done automatically.
    5. Next step is to create PetaLinux BSP. This is also very typical PetaLinux BSP, just don't forget to change 'Configuration' to reflect ZedBoard configuration and name it 'ZedBoard-HDMI-petalinux_bsp'.

      zynq15_002

      We are done with Xilinx SDK. You can close it.

    6. Next step is to create PetaLinux project and set 'hardware description'. I will call it 'ZedBoard-HDMI' Petalinux project:

       

      petalinux-create -t project -n ZedBoard-HDMI
      cd ~/Projects/ZedBoard-HDMI-petalinux_bsp/
      petalinux-config --get-hw-description -p ../ZedBoard-HDMI/
      cd ~/Projects/ZedBoard-HDMI/
      rm -r hw-description

    7. Now, as of today, ADV7511 Linux driver not in a mainstream kernel. So, we need to get Kernel from Analog Devices repository with appropriate patches. Current version is 3.14.0. Let's clone it, and checkout 'xcomm_zynq' branch.

       

      cd ~/Projects/
      git clone https://github.com/analogdevicesinc/linux.git analogdevices-kernel
      cd analogdevices-kernel/
      git checkout xcomm_zynq

    8. Create necessary directories and copy 'xcomm_zynq' branch to our PetaLinux project directory.

       

      cd ~/Projects/
      mkdir ~/Projects/ZedBoard-HDMI/components
      mkdir ~/Projects/ZedBoard-HDMI/components/linux-kernel
      cp -a analogdevices-kernel ~/Projects/ZedBoard-HDMI/components/linux-kernel/

    9. Run 'petalinux-config' and change kernel to 'analogdevices-kernel' and system boot device to 'SD card'.

 

cd ZedBoard-HDMI
petalinux-config

    1. Next we need to configure Linux kernel for PetaLinux and we need to enable all options required by ADV7511. AnalogDevices kernel support special configuration option 'zynq_xcomm_adv7511_defconfig', but we cannot run it with PetaLinux. So, we have to pre-configure kernel separately ('make ARCH=arm zynq_xcomm_adv7511_defconfig') and just copy resulted config into 'ZedBoard-HDMI/subsystems/linux/configs/kernel'. So, I did it and also copied it into PetaLinux Kernel configs directory '/opt/petalinux-v2013.10-final/etc/template/project/template-zynq/subsystems/linux/configs/kernel'. So, I can later reuse it. Also notice that kernel default config file have dot in the front and PetaLinux files don't.
      Anyway, here is link to my resulted kernel config file: http://blog.idv-tech.com/wp-content/uploads/2014/05/config_hdmi_3_14.config
    2. We also, have to modify 'devices tree' generated by PetaLinux for our project. AnalogDecices Linux kernel have template for ZedBoard which you can find in 'arch/arm/boot/dts/zynq-zed-adv7511.dts', so we basically have to copy missing devices from AD into our tree.
      Link to my resulted DTS file for ZedBoard: http://blog.idv-tech.com/wp-content/uploads/2014/05/adv7511_dts.config .
    3. We are basically done. At this point you my want to modify PetaLinux project, for example, include Qt5 library and test app to check frame buffer device later. I covered this topics in my previous post, so I wont repeat it here.

      Build Petalinux project, create BOOT.BIN and copy it together with Linux image file 'image.ub' on SD card:

       

      petalinux-build
      petalinux-package --boot --fsbl ../ZedBoard-HDMI-FSBL/Release/ZedBoard-HDMI-FSBL.elf --fpga ../ZedBoard-HDMI-HW/system_top.bit --uboot --force -o images/linux/BOOT.BIN

    4. Insert SD card into slot of ZedBoard and turn it on. During boot kernel should detect ADV7511(hdmi) and ADAU1761(sound) devices and create '/dev/fb0' device.So, below partial bootlog from my ZedBoard:
...
[drm] Initialized drm 1.1.0 20060810
/analogdevices-kernel/drivers/gpu/drm/adi_axi_hdmi/axi_hdmi_drv.c:axi_hdmi_platform_probe[176]
platform 70e00000.axi_hdmi: Driver axi-hdmi requests probe deferral
...
adv7511-hdmi-snd adv7511_hdmi_snd.2: adv7511 <-> 75c00000.axi-spdif-tx mapping ok
...
zed-adau1761-snd zed_sound.3: adau-hifi <-> 77600000.axi-i2s mapping ok
...
Console: switching to colour frame buffer device 180x56
axi-hdmi 70e00000.axi_hdmi: fb0:  frame buffer device
axi-hdmi 70e00000.axi_hdmi: registered panic notifier
[drm] Initialized axi_hdmi_drm 1.0.0 20120930 on minor 0
/analogdevices-kernel/drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
ALSA device list:
  #0: HDMI monitor
  #1: ZED ADAU1761
Freeing unused kernel memory: 23356K (c062b000 - c1cfa000)
INIT: version 2.88 booting
Starting Bootlog daemon: bootlogd.
...

 _____       _           _      _
| ___ \     | |         | |    (_)
| |_/ / ___ | |_   __ _ | |     _  _ __   _   _ __  __
|  __/ / _ \| __| / _` || |    | || '_ \ | | | |\ \/ /
| |   |  __/| |_ | (_| || |____| || | | || |_| | >  < \_| \___| \__| \__,_|\_____/|_||_| |_| \__,_|/_/\_\ PetaLinux v2013.10 (Yocto 1.4) ZedBoard ttyPS0 ZedBoard login: root Password: login[923]: root login on `ttyPS0' root@ZedBoard:~# ls /dev/fb0 /dev/fb0 root@ZedBoard:~# uname -a Linux ZedBoard 3.14.0-g681a2d8-dirty #2 SMP PREEMPT Sun May 25 22:46:28 EDT 2014 armv7l GNU/Linux root@ZedBoard:~#
  1. This is basically it - once you have a framebuffer device you can start using it. So I ran my Qt5 test app and it worked. We obviously don't have any hardware acceleration with this HDL design, but we got basic FB device and HDMI output. Congratulations!

转载于:https://www.cnblogs.com/blinkingstar/p/4337535.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: PetaLinux是一款基于开源Linux发行版的嵌入式开发工具,用于构建、定制和部署嵌入式Linux系统。2018.3是PetaLinux的版本号,代表其发布的时间和更新内容。 PetaLinux2018.3在之前版本的基础上进行了一些改进和优化。首先,该版本加入了对新的硬件平台的支持,包括新的处理器架构和外设。这意味着开发者可以在更多的硬件平台上使用PetaLinux进行嵌入式系统开发,提高了平台的可扩展性和灵活性。 其次,PetaLinux2018.3在功能上也有所增强。它提供了更多的开发工具和工程模板,使开发者在构建嵌入式系统时更加方便和高效。此外,该版本还改进了系统的性能和稳定性,增加了对多线程和多核处理的支持,提升了系统的并行处理能力。 此外,PetaLinux2018.3还新增了一些软件包和驱动程序,使开发者能够更好地支持各种外设和功能。它还引入了更多的编译器和调试工具,方便开发者进行代码编译和调试,并提供了更多的文档和示例代码,帮助开发者更好地了解和使用PetaLinux。 总之,PetaLinux2018.3是一个经过改进和优化的嵌入式开发工具,提供了更多的硬件支持和功能增强。它可以帮助开发者更方便、高效地构建和定制嵌入式Linux系统,为嵌入式开发提供了更多的选择和可能性。 ### 回答2: PetaLinux是Xilinx公司推出的一款基于Yocto Project构建的嵌入式Linux开发工具。旨在为Xilinx的Zynq和UltraScale系列FPGA提供一个高度优化的Linux发行版。PetaLinux 2018.3是PetaLinux的一个版本,它包含了一些新的功能和改进。 PetaLinux 2018.3版本主要的更新包括对Yocto Project 2.6和Linux内核4.14的支持。这意味着开发人员可以使用最新版本的软件和驱动程序来构建他们的嵌入式Linux系统。该版本还提供了对新硬件平台的支持,包括Zynq UltraScale+ MPSoC ZCU102和ZCU104评估板。 PetaLinux 2018.3还加强了与Xilinx Vivado工具的集成,简化了从硬件设计到软件开发的流程。开发人员可以使用Vivado工具生成硬件设计文件,并直接从PetaLinux中进行导入和配置。这样可以提高整体开发效率,减少开发时间和风险。 此外,PetaLinux 2018.3还增强了对容器化应用程序的支持。开发人员可以使用Docker等容器技术在嵌入式Linux系统中运行和管理应用程序。这为开发人员提供了更大的灵活性和便利性,可以轻松构建和管理复杂的嵌入式应用。 总体而言,PetaLinux 2018.3为开发人员提供了更多的选择和工具来构建高度定制的嵌入式Linux系统。通过与Xilinx Vivado工具集成,支持最新版本的软件和驱动程序,以及对容器化应用程序的增强支持,开发人员可以更加轻松地进行嵌入式系统开发,并在不同的硬件平台上实现高性能和可靠性。 ### 回答3: Petalinux 2018.3是Xilinx公司开发的嵌入式Linux解决方案的一个版本。它是基于开源项目Yocto Project的,旨在帮助开发者构建用于Xilinx器件的定制化Linux操作系统。 Petalinux 2018.3提供了一套完整的工具链,使开发者可以轻松地构建、配置和定制嵌入式Linux系统。它支持多种开发板和处理器架构,包括Zynq-7000和Zynq UltraScale+等。通过使用Petalinux,开发者可以轻松地将Linux操作系统和Xilinx硬件平台结合起来,提供强大的嵌入式计算和图像处理能力。 Petalinux 2018.3具有许多强大的功能。首先,它提供了一个易于使用的界面,使开发者可以快速设置和配置嵌入式Linux系统。其次,它支持全面的嵌入式硬件和软件开发,包括设备驱动程序、文件系统、应用程序等。此外,Petalinux 2018.3还提供了丰富的软件开发工具,如交叉编译器、调试器和性能分析工具,以帮助开发者更好地进行嵌入式软件开发。 总的来说,Petalinux 2018.3是一个强大而灵活的嵌入式Linux解决方案,使开发者能够快速构建和定制嵌入式系统。无论是在工业自动化、智能交通、网络通信等领域,Petalinux 2018.3都能为开发者提供强大的工具和支持,并为他们带来更高效的开发体验。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值