完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
各位ti的高手好,
我最近在做一个项目用到了C6678的PCIE,通过PCIe连接6678和一个PC主机(win7),我已经成功跑起来了pdk中PCIe的例程,在PC上用WinDriver也能发现设备。现在有几个问题想要搞明白: 1.pdk的PCIE例程中配置了bar1基地址为0x70000000,我通过WinDriver查看bar1基地址也是0x70000000,然后用WinDriver在bar1中写数据,那么该数据写在6678的DDR中的物理地址是多少? 2.我把bar1的基地址改为0x90000000后,发现数据写在了6678的DDR中0x60000000的物理地址上,这个映射可以在哪里找到?我应该怎么配置Bar1才可以让它映射在想要的物理地址上? 3.这个映射和Inbound和Outbound的配置有无关系?我改了inbound的addr_Lo后发现bar1为0x90000000使数据还是写在了DDR的0x60000000上。 |
|
相关推荐
2个回答
|
|
通过BAR和inbound region配置,
大致流程是:PCIE inbound端会对接收到的PCIE packet的PCIE BUS address和 BAR进行匹配,如果发现和其中某一个BAR一致,那么就按照该BAR对应的inbound region进行映射。具体流程你可以参考userguide,下面是2个例子,帮助理解: Example 1: Inbound write, destination buffer 32KB in L2, 32-bit addressing CMD_STATUS[IB_XLT_EN] = 1 (Inbound address translation enabled) The target packets with PCIe address 0x9001_5678~0x9001_D677 (32KB) (Based on the previous Outbound Address Translation Example 1). BAR1 = 0x9000_0000 (bits [3:0]=0000b, means 32-bit, non-prefetchable, memory BAR). BAR1 Mask register is 0x00FF_FFFF. So BAR1 window size is 16MB. BAR1 accepts this inbound write request since the window includes the PCIe address of the target packets. IB_BAR0 = 1 (BAR1 is selected for IB Region 0) IB_START0_HI = 0x0 (upper 32 bits are zero for 32-bit addressing) IB_START0_LO= 0x9000_0000 IB_OFFSET0 = 0x1086_0000 Then the starting internal device address = PCIe address – (IB_START0_HI:IB_START0_LO) + IB_OFFSET = (0x9001_5678) – (0x9000_0000) + (0x1086_0000) = 0x1087_5678 Example 2: Inbound read, destination buffer 12MB in DDR, 64-bit addressing CMD_STATUS[IB_XLT_EN] = 1 (Inbound address translation enabled) The target packets with PCIe address 0x12345678_70000000~0x12345678_70BFFFFF (12MB) (Based on the previous Outbound Address Translation Example 2). BAR2 = 0x7000000C (bits [3:0]=1100b, means 64-bit, prefetchable, memory BAR). BAR3 = 0x12345678 (BAR3 Mask register is 0x0, non-masked) BAR2 Mask register is 0x0FFF_FFFF. So BAR2&3 window size is 256MB. BAR2&3 accept this inbound read request since the window includes the PCIe address of the target packets. IB_BAR1 = 2 (BAR2&3 are selected for IB Region 1 for 64-bit addressing) IB_START1_HI = 0x12345678 (upper 32 bits are zero for 32-bit addressing) IB_START1_LO= 0x7000_0000 IB_OFFSET1 = 0x8700_0000 Then the starting internal device address = PCIe address – (IB_START0_HI:IB_START0_LO) + IB_OFFSET = (0x12345678_70000000) – (0x12345678_70000000) + (0x8700_0000) = 0x8700_0000 So the data located in the buffer as 0x8700_0000~0x87BF_FFFF are fetched by the PCIe master port with PCIe address 0x12345678_70000000~0x12345678_70BFFFFF (no EDMA or CPU is involved in local device for the inbound transfer). So the data packets with PCIe address 0x9001_5678~0x9001_D677 are transferred to the destination buffer as 0x1087_5678~0x1087_D677 by the PCIe master port (no EDMA or CPU is involved in local device for the inbound transfer). |
|
|
|
liuqin123 发表于 2018-6-19 04:45 谢谢,很详细,我在Windriver上看到的的BAR1的地址和我在6678配置的一样的原因也找到了,是因为上电顺序问题,应该6678先上电,Windows才会给它分配资源 |
|
|
|
只有小组成员才能发言,加入小组>>
514 浏览 1 评论
386 浏览 1 评论
583 浏览 2 评论
NA555DR VCC最低电压需要在5V供电,为什么用3.3V供电搭了个单稳态触发器也使用正常?
831 浏览 3 评论
MSP430F249TPMR出现高温存储后失效了的情况,怎么解决?
688 浏览 1 评论
AT32F407在USART2 DMA发送数据时,接包接到了要发送的数据,程序还是处于等待传输完成的标识判断中,为什么?
130浏览 29评论
708浏览 23评论
请问下tpa3220实际测试引脚功能和官方资料不符,哪位大佬可以帮忙解答下
294浏览 20评论
请教下关于TAS5825PEVM评估模块原理图中不太明白的地方,寻求答疑
248浏览 14评论
两个TMP117传感器一个可以正常读取温度值,一个读取的值一直是0,为什么?
100浏览 13评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-1-11 15:43 , Processed in 0.698393 second(s), Total 50, Slave 44 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号