望高手帮忙解决:编译uclinux遇到的dma

[复制链接]
查看11 | 回复2 | 2021-1-27 06:27:39 | 显示全部楼层 |阅读模式
在arm7交叉编译uclinux的过程中,使用默认设置编译,正常通过,但是增加SupportforHost-sideUSB,ISP116XHCDsupport以及对应usb网卡驱动之后,编译会出现
drivers/built-in.o:Infunction`usb_buffer_map_sg'
rtc-xxx.c:(.text+0x16f24):undefinedreferenceto`dma_cache_maint'
drivers/built-in.o:Infunction`usb_hcd_submit_urb':
rtc-xxx.c:(.text+0x1cbdc):undefinedreferenceto`dma_cache_maint'
rtc-xxx.c:(.text+0x1cbdc):undefinedreferenceto`dma_cache_maint'
其中rtc-xxx是开发板自带的厂家rtc文件。里面不存在dma_cache_maint的调用。
取消usb网卡驱动,依然同样错误。
经查找
dma_cache_maint的定义存在于arch/arm/mm/Consistent.c中,而arch/arm/mm/consistent-nommu.c中不存在该函数,所用的函数是consistent_sync。
修改consistent-nommu.c文件,增加函数voiddma_cache_maint(constvoid*start,size_tsize,intdirection),该函数直接调用voidconsistent_sync(constvoid*start,size_tsize,intdirection),并导出符号,此时编译可以通过,程序正常运行,但是插上相应的usb设备后,设备使用不了,原因未知。
求高手帮忙解决,感激不尽。
分 -->
回复

使用道具 举报

千问 | 2021-1-27 06:27:39 | 显示全部楼层
刚搜到的,不知道有没有帮助。
http://forum.sparkfun.com/viewtopic.php?p=71635&sid=d13835c0d0783397e8bc5abaf9e69a0a
Withinthefile/include/asm/dma-mapping.h:
Onrule20:
//externvoiddma_cache_maint(constvoid*kaddr,size_tsize,intrw);
externvoidconsistent_sync(constvoid*start,size_tsize,intdirection);
Furtheronwithinthesamefile,everywheredma_cache_maintiscalled,Icallthemethodconsistent_sync.
Forexample:
consistent_sync(cpu_addr,size,dir);
//dma_cache_maint(cpu_addr,size,dir);

回复

使用道具 举报

千问 | 2021-1-27 06:27:39 | 显示全部楼层
谢谢brookmill的回复,这种方法和我的方法是效果是一致的,只是函数替换的方式不一致。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行