DSP

omap3530支持gpu模块

2019-07-13 20:37发布

在操作过程中如果遇到什么问题,可以直接1157207468@qq.com 或者 留言 进行沟通,如果有什么错误,也请大家进行指出。环境: ubuntu 10.04  linux-2.6.32 omap3530芯片一共含有三个核: arm核, dsp核, gpu核。arm核是最常用的,这不是我们今天说的主题,我们现在主要是说一下gpu核,将gpu的驱动添加到arm平台上,就可在omap3530上跑opengles,3D。gpu的驱动不在内核里面,而是由TI单独提供,或者在TI发布的sdk包里包含。由于omap3530属于比较早的,所以,官方支持的opengles1.1 和 opengles2.0.。1. 工作准备    准备一个ubuntu 10.04的镜像,可以到ubuntu网站下载。
    下载TI提供的sdk集成开发环境,dvsdk_omap3530-evm_4_01_00_09_setuplinux。
    下载交叉编译工具链,arm-2009q1-203-arm-none-linux-gnueabi.bin。
    由于这三个文件都是大文件,无法上传,自行搜索就可以,网上就有,后两个可能需要一点点时间查找。
    注:dvsdk使用手册提前下载一份,下面的操作步骤也都是按照这份手册进行操作的(很重要)2. 搭建开发环境    由于ubuntu 10.04的系统离我们现在太远了,就只能是安装虚拟机了,分配40G左右的空间最好,我当时    分了20G,太小了,就导致,我当时又重复操作了所有的步骤,切不可安装实体的ubuntu10.04,即使安    装物理机也是无法使用的因为现在ubuntu 10.04的软件源已经都没有了,系统是无法更新的,    并且,ubuntu的软件也是由于系统。    版本过旧,无法支持。    安装虚拟机后,先安装arm-2009q1-203-arm-none-linux-gnueabi.bin,不管你的交叉编译工具链是不是这一个,    这个工具链都是需要安装的,因为dvsdk_omap3530-evm_4_01_00_09_setlinux的安装依赖于它。在安装的过程    中,会有让你作其他的操作,按照软件安装的提示去操作就好,如果需要安装库或者软件的话,就搜索.deb的软件    和库,安装就可以。$ chmod +x arm-2009q1-203-arm-none-linux-gnueabi.bin $ ./arm-2009q1-203-arm-none-linux-gnueabi.bin    注意:安装路径使用默认的路径一直next下去。    安装 也是安装到默认路径即可,什么都不许要修改
$ chmod +x dvsdk_omap3530-evm_4_01_00_09_setlinux $ ./dvsdk_omap3530-evm_4_01_00_09_setlinux $ 一直next下去    两个软件安装完成之后,执行以下操作,就可以看到/home/目录下多了两个文件夹    $ cd $ ls $ ... 注:如果能看到下面两个文件夹,表示两个软件都已经安装成功 CodeSourcery ti-dvsdk_omap3530-evm_4_01_00_092. 编译前准备$ cd ti-dvsdk_omap3530-evm_4_01_00_09/omap35x_graphics_sdk_4.00.00.01说明:omap35x_graphics_sdk_4.00.00.01就是omap3530的gpu驱动模块,里面还有opengles的库    修改编译规则,按照你的交叉编译工具链,和安装目录进行配置$ vi Rules.make这是我的目录,可以参考 #Rules.make ################# FIELDS MODIFIABLE BY THE USER ############################### ############### All the fields below are mandatory ############################ # Set home area (ex /home/user123/) HOME=/home/ws # 主目录 # Set installation folder (typically, OMAP35x_Graphics_***) GRAPHICS_INSTALL_DIR=$(HOME)/ti-dvsdk_omap3530-evm_4_01_00_09/omap35x_graphics_sdk_4.00.00.01 # 这个很重要一定是你omap3530的gpu模块驱动的位置 # Location of demo executables and install information GFX_DEMOS_EXECPATH=$(GRAPHICS_INSTALL_DIR)/gfxsdkdemos # Toolchain path # 修改为你自己的交叉编译工具链 CSTOOL_DIR=/stuff/bitbake/bin/tmp/sysroots/i686-linux/usr/armv7a/ CSTOOL_PREFIX=arm-angstrom-linux-gnueabi- CSTOOL_PATH=$(CSTOOL_DIR)/bin CSTOOL_LIBSTDC++_PATH=pwd/stuff/bitbake/bin/tmp/sysroots/armv7a-angstrom-linux-gnueabi/usr/lib #C++库,也要指定 # Set the kernel installation path KERNEL_INSTALL_DIR=/home/ws/project/phascan/linux #依赖的内核,编译linux驱动模块都必须依赖于它进行编译,你自己使用的linux # Target NFS root file system location #TARGETFS_INSTALL_DIR=/avme_nfs_root/users/mahesh/targetfs TARGETFS_INSTALL_DIR=/home/ws/project/phascan/release/rootfs #gpu编译完后,需要安装的位置 # 剩下的就不用配置了 ######################### PRE-DEFINED VARIABLES ############################### ######################## NOT MODIFIABLE BY USER ############################### PLATFORM=LinuxOMAP3 GFX_OGLES_SDKPATH=$(GRAPHICS_INSTALL_DIR)/GFX_Linux_SDK/OGLES/SDKPackage GFX_OGLES2_SDKPATH=$(GRAPHICS_INSTALL_DIR)/GFX_Linux_SDK/OGLES2/SDKPackage GFX_OVG_SDKPATH=$(GRAPHICS_INSTALL_DIR)/GFX_Linux_SDK/OVG/SDKPackage GFX_REL_ES2_LIB_SRCPATH=$(GRAPHICS_INSTALL_DIR)/gfx_rel_es2.x GFX_DBG_ES2_LIB_SRCPATH=$(GRAPHICS_INSTALL_DIR)/gfx_dbg_es2.x GFX_REL_ES3_LIB_SRCPATH=$(GRAPHICS_INSTALL_DIR)/gfx_rel_es3.x GFX_DBG_ES3_LIB_SRCPATH=$(GRAPHICS_INSTALL_DIR)/gfx_dbg_es3.x GFX_REL_ES5_LIB_SRCPATH=$(GRAPHICS_INSTALL_DIR)/gfx_rel_es5.x GFX_DBG_ES5_LIB_SRCPATH=$(GRAPHICS_INSTALL_DIR)/gfx_dbg_es5.x GFX_REL_ES6_LIB_SRCPATH=$(GRAPHICS_INSTALL_DIR)/gfx_rel_es6.x GFX_DBG_ES6_LIB_SRCPATH=$(GRAPHICS_INSTALL_DIR)/gfx_dbg_es6.x GFX_OGLES_REL_LIB_DESTPATH=$(GFX_OGLES_SDKPATH)/Builds/OGLES/LinuxOMAP3 GFX_OGLES2_REL_LIB_DESTPATH=$(GFX_OGLES2_SDKPATH)/Builds/OGLES2/LinuxOMAP3 GFX_OVG_REL_LIB_DESTPATH=$(GFX_OVG_SDKPATH)/Builds/OVG/LinuxOMAP3 GFX_KERNMOD_SRCPATH=$(GRAPHICS_INSTALL_DIR)/GFX_Linux_KM GFX_PKG_TARGETFS_PATH = $(GRAPHICS_INSTALL_DIR)/targetfs GFX_LIBRARY_TARGET_PATH = $(TARGETFS_INSTALL_DIR)/opt/gfxlibraries GFX_DEVMEM2_SRCPATH = $(GRAPHICS_INSTALL_DIR)/tools/devmem2 # Where to copy the resulting executables and data to (when executing 'make # install') in a proper file structure. This EXEC_DIR should either be visible # from the target, or you will have to copy this (whole) directory onto the # target filesystem. EXEC_DIR=$(TARGETFS_INSTALL_DIR)/opt/gfxsdkdemos ################################################################################ 3. 编译:    

Non-Xorg build

  • make BUILD=release OMAPES=8.x all_km - This command will build only Graphics kernel modules(pvrsrvkm.ko, omaplfb.ko) for AM335x.
  • make BUILD=release OMAPES=8.x all - This command will build the complete graphics SDK for AM335x.
  • make BUILD=release OMAPES=8.x install_km - This command will install only the graphics kernel modules(pvrsrvkm.ko, omaplfb.ko)to target file system as mentioned in Rules.make.
  • make BUILD=release OMAPES=8.x install - This command will install the complete graphics SDK to target file system as mentioned in Rules.make.
In the above set of commands,one can replace OMAPES values with values based on TI device in use(OMAPES to TI device mapping information can be obtained by issuing make help command).

Xorg build

  • make BUILD=release OMAPES=6.x SUPPORT_XORG=1 all_km - This command will build only Graphics kernel modules(pvrsrvkm.ko, drm.ko) for 387x/389x, TI816x/TI814x devices.
  • make BUILD=release OMAPES=6.x SUPPORT_XORG=1 all - This command will build the complete graphics SDK for 387x/389x, TI816x/TI814x devices.
  • make BUILD=release OMAPES=6.x SUPPORT_XORG=1 install_km - This command will install only the graphics kernel modules(pvrsrvkm.ko, drm.ko) to target file system as mentioned in Rules.make
  • make BUILD=release OMAPES=6.x SUPPORT_XORG=1 install - This command will install the complete graphics SDK to target file system as mentioned in Rules.make
In the above set of commands,one can replace OMAPES values with values based on TI device in use(OMAPES to TI device mapping information can be obtained by issuing make help command). 具体可以参考:http://processors.wiki.ti.com/index.php/Graphics_SDK_Quick_installation_and_user_guide#OMAP35x.2FAM35x.2F37xx.2FAM335x4. 安装运行    编译安装完成之后,可以在设定的目录下,找到pvrsrvkm.ko omaplfb.ko驱动    将编译安装好的库与gpu的驱动模块添加到你板子的文件系统中
    进入到你板子的终端中
root@beagleboard: # cd /etc/init.d root@beagleboard:/etc/init.d # ./omap-demo root@beagleboard:/etc/init.d # cd /opt/gfxsdkdemos/ogles root@beagleboard:/opt/gfxsdkdemos/ogles # ./OGLESMouse    如果你每一步都操作正确,那么就可以在屏幕看到3D图像,一个小老鼠在跳舞5. 祝你好运