TI DVSDK on OMAP3530 use Devkit8000 (1)

来源:互联网 发布:淘宝完整类目数据 编辑:程序博客网 时间:2024/06/01 08:52

从这章起,我要换个题目了。

当然,还是接着以前的写。

 

上回说到LCD等加载成功,其中提到rootfs没有挂起来。打印信息如下:

 

===================================================================================

Looking up port of RPC 100003/2 on 192.168.16.137
Looking up port of RPC 100005/1 on 192.168.16.137
VFS: Mounted root (nfs filesystem) on device 0:12.
Freeing init memory: 140K

INIT: version 2.86 booting

Please wait: booting...
Starting udev
Rings wpl debug: udev flag 1,exec to here.
Rings wpl debug: udev flag 2,exeudev: starting version 141
c to here.
udevd[449]: inotify_add_watch(3, (null), 10) failed: Bad address         // 注:此错误时udev加载时引起,先忽略。
………………
udevd[449]: inotify_add_watch(3, (null), 10) failed: Bad address

 

Rings wpl debug: udev flag 3,exec to here.
Remounting root file system...
root: mount: mounting rootfs on / failed: No such file or directory
Wed Dec  2 19:30:00 UTC 2009

INIT: Entering runlevel: 5

Starting telnet daemon.
Starting syslogd/klogd: done
Starting thttpd.
cmemk: disagrees about version of symbol find_vma
cmemk: Unknown symbol find_vma
cmemk: disagrees about version of symbol __register_chrdev
cmemk: Unknown symbol __register_chrdevdsplinkk: disagrees about version of symbol set_user_nice
dsplinkk: Unknown symbol set_user_nice
dsplinkk: disagrees about version of symbol wake_up_process
dsplinkk: Unknown symbol wake_up_process
dsplinkk: disagrees about version of symbol clk_get_rate
dsplinkk: Unknown symbol clk_get_rate
dsplinkk: disagrees about version of symbol filp_close
dsplinkk: Unknown symbol filp_close
dsplinkk: disagrees about version of symbol __register_chrdev
dsplinkk: Unknown symbol __register_chrdev
insmod: error inserting 'dsplinkk.ko': -1 Unknown symbol in module
BusyBox v1.13.2 (2009-12-02 19:10:22 EST) multi-call binary

Usage: mknod [OPTIONS] NAME TYPE MAJOR MINOR

Create a special file (block, character, or pipe)

Options:
 -m Create the special file using the specified mode (default a=rw)
TYPEs include:
 b: Make a block device
 c or u: Make a character device
 p: Make a named pipe (MAJOR and MINOR are ignored)

lpm_omap3530: Unknown symbol IPS_notify
lpm_omap3530: Unknown symbol IPS_register
lpm_omap3530: Unknown symbol IPS_unregister
lpm_omap3530: disagrees about version of symbol cdev_add
lpm_omap3530: Unknown symbol cdev_add
lpm_omap3530: Unknown symbol LDRV_PROC_setState
lpm_omap3530: Unknown symbol LDRV_PROC_getState
lpm_omap3530: Unknown symbol PMGR_PROC_getSymbolAddress
lpm_omap3530: disagrees about version of symbol cdev_init
lpm_omap3530: Unknown symbol cdev_init
lpm_omap3530: disagrees about version of symbol cdev_del
lpm_omap3530: Unknown symbol cdev_del
insmod: error inserting 'lpm_omap3530.ko': -1 Unknown symbol in module
sdmak: disagrees about version of symbol put_page
sdmak: Unknown symbol put_page
sdmak: disagrees about version of symbol __register_chrdev
sdmak: Unknown symbol __register_chrdev
insmod: error inserting 'sdmak.ko': -1 Unknown symbol in module
Demo interface started at level 0.
CMEM Error: init: Failed to open /dev/cmem: 'No such file or directory'
Error: Failed to create display device instance
sh: can't create /sys/devices/platform/omapdss/overlay0/global_alpha: nonexistent directory
Error: Failed to execute: echo 0 > /sys/devices/platform/omapdss/overlay0/global_alpha

 

===================================================================================

 

看了这个东西,显示udev的加载中的提示警告信息,不管。

系统启动到这种地步,telnet,httpd都已经起来,LCD上显示小企鹅和登陆提示,其实已经可以用了,但console上由于这些信息,阻塞不能使用了。

 

一条一条看吧。

 

首先是定位和思路:linux启动,控制权已经交到rootfs了,rootfs是我从ti下载的dvsdk对应的nfs系统的压缩包解压后折腾出来的,应该是没问题。但,这个nfs,肯定是针对evm的板子配置和相关内核编译出来的,也就是前面提到的在TI DVSDK中编译make everythings编译出来的一堆东西对应的。错误来源,应该是几个:1是内核和驱动不配套,这个就和应用程序使用库的时候不配套一般,要针对新内核重新编译,2,内核配置问题,可能内核中就没有像evm一样做配置,那样肯定是有些不同。

 

先看第一个错误:

cmemk: disagrees about version of symbol find_vma
cmemk: Unknown symbol find_vma
cmemk: disagrees about version of symbol __register_chrdev
cmemk: Unknown symbol __register_chrdev

 

先找到哪里加载驱动,在rootfs下find ./ -name cmemk.ko ,看是在opt/dvsdk/omap3530下,有一个loadmodules.sh,其中存在加载的脚本。通过信息,一看就知道是,驱动要重新编译,好,找到DVSDK目录,取个巧,将其中指定的PSP kernel的路径不修改,而是将原来的内核mv为其它名字,做个同名软链,链到现在使用的基于修改版beagle的内核,然后看看make help中:

 

有 make cmem

     make cmem_clean

那就先执行 make cmem_clean; 再执行 make,可以,make install,提示所有文件拷贝到了 $HOME/workdir/filesys/opt/dvsdk/omap3530

 

从中将 cmemk.ko 替换rootfs中的同名文件(其实相对位置也一样),再次启动:

 

CMEMK module: built on Jul  7 2010 at 14:14:53
  Reference Linux version 2.6.32
  File /home/wpl/dvsdk/dvsdk_3_01_00_10/linuxutils_2_25_02_08/packages/ti/sdo/linuxutils/cmem/src/module/cmemk.c
CMEM Range Overlaps Kernel Physical - allowing overlap
CMEM phys_start (0x86300000) overlaps kernel (0x80000000 -> 0x88000000)
CMEMK Error: Failed to request_mem_region(0x86300000, 15728640)
insmod: error inserting 'cmemk.ko': -1 Bad address

 

嗯? 没有先前的链接符号之类的错误了。却出现了初始化内存的覆盖错误。看信息到意思,cmem分配到内存,在linux内核到势力范围中阿。

 

怎么办?google先,找到这个:

http://www.linuxforum.net/forum/showflat.php?Cat=&Board=TI&Number=746894&page=14&view=expanded&sb=6&o=0

看了看,说是在uboot中修改bootargs中mem的大小,也不明白啥意思,想来是内核不知道自己使用128的内存?

 

然后稀里糊涂加上: mem=128M

 

启动以后,发现还是这样。

 

然后,打开一些网页看cmem是干啥的,

 

在DVEVM上,内存是256M,所以Codec中的例程都是按照256M内存进行配置的。而在,其他一些具体应用中,目标板的内存不一定为256M。所以,内存配置是Davinci开发板上一项重要的技术。
笔者公司的开发板是128M,根据相关的文档,重新配置,编译了程序。在128M开发板上成功运行了Video_copy例程。具体步骤如下:
DDR内存是ARM和DSP共享的,从Ox80000000到0x90000000。内存分为了如下几部分:
1:Linux Partition:在ARM linux是按照4KB进行分页。这部分内存由linux独自使用,由于有虚拟内存,所以开发者不能直接操作内存。
2:CMEM: Contiguous Memory Allocator。用于ARM和DSP之间共享内存。由于linux上内存采用了虚拟机制,分配的内存可能不是连续的;而DSP端内存没有虚拟内存机制一块内存在物理上是连续的。因此,如果直接将一块内存作为参数传递给DSP端进行处理,就得不到正确的结果。因此CMEM就是解决这个问题而出现的。通过 CMEM可以开辟连续的内存,用于ARM和DSP端共享内存。
3:The DDRALGHEAP and DDR Sections:用于CODEC动态开辟内存
4: DDR(DDR2在codec engine1.2):用于存放DSP端代码端和静态数据。
5:The DSPLINKMEM Section:用于DSPlink,
6:RESET_VECTOR:用于DSP RESET vector.必须128直接,起始地址必须是整数M.
因此:总内存=DSP server内存+CMEM+linux内存。后面,是笔者内存的具体配置:


…………

 

我看完以后没感觉,不过知道了cmem就是共享内存,ARM和DSP之间到,还是看加载配置。

 

#
# Default Memory Map
#
# Start Addr    Size    Description
# -------------------------------------------
# 0x80000000     99 MB  Linux
# 0x86300000     15 MB  CMEM
# 0x87200000     13 MB  CODEC SERVER


# Allocate 15MB for CMEM
insmod cmemk.ko phys_start=0x86300000 phys_end=0x87200000 pools=1x3000000,1x1429440,6x1048576,4x829440,1x327680,1x256000,7x131072,20x4096 allowOverlap=1

主要看注释中的内存分配表,知道CMEM需要占有15M内存,linux占99M,忽然想起来,是不是应该初始化linux的men=99M?

 

在uboot中试了试,确实可以了,打印如下:

 

 CMEMK module: built on Jul  7 2010 at 14:14:53
  Reference Linux version 2.6.32
  File /home/wpl/dvsdk/dvsdk_3_01_00_10/linuxutils_2_25_02_08/packages/ti/sdo/linuxutils/cmem/src/module/cmemk.c
allocated heap buffer 0xc7000000 of size 0x17000
cmemk initialized

 

原创粉丝点击