UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

取消
显示结果 
搜索替代 
您的意思是: 
Highlighted
Observer yehaiyang
Observer
700 次查看
注册日期: ‎09-29-2018

zynq amp模式下cpu1无法使用xadc进行外部采样

转到解答

硬件平台:zynq-7020

vivado版本:2017.04

AMP模式:参考1078,cpu0跑linux系统,cpu1跑裸机程序;

1.工程配置:需要对外部模拟信号进行采样,没有使用专用的ADC差分引脚,而是使用 fpga中的XADC IP核,然后使用EMIO定义的VP、VN引脚,如下:

B1TQ2~QU[[Z_SQ`O{1B`S56.png

2.通过petalinux软件生成对应的烧写文件,其中设备树dts中配置如下:

......

/*ps侧的设备节点*/

amba {
u-boot,dm-pre-reloc;
compatible = "simple-bus";
#address-cells = <0x1>;
#size-cells = <0x1>;
interrupt-parent = <0x4>;
ranges;


    adc@f8007100 {
          compatible = "xlnx,zynq-xadc-1.00.a";
         reg = <0xf8007100 0x20>;
        interrupts = <0x0 0x7 0x4>;
       interrupt-parent = <0x4>;
       clocks = <0x1 0xc>;
      };

/*其他设备节点*、

}

....

/*pl侧的设备节点*/

amba_pl {
#address-cells = <0x1>;
#size-cells = <0x1>;
compatible = "simple-bus";
ranges;

xadc_wiz@43c10000 {
clock-names = "ref_clk";
clocks = <0x1 0x0>;
compatible = "xlnx,axi-xadc-1.00.a";
reg = <0x43c10000 0x10000>;
xlnx,alarm-limit-r0 = <0xb5ed>;
xlnx,alarm-limit-r1 = <0x57e4>;
xlnx,alarm-limit-r10 = <0x5555>;
xlnx,alarm-limit-r11 = <0x5111>;
xlnx,alarm-limit-r12 = <0x9999>;
xlnx,alarm-limit-r13 = <0x91eb>;
xlnx,alarm-limit-r14 = <0x6aaa>;
xlnx,alarm-limit-r15 = <0x6666>;
xlnx,alarm-limit-r2 = <0xa147>;
xlnx,alarm-limit-r3 = <0xca33>;
xlnx,alarm-limit-r4 = <0xa93a>;
xlnx,alarm-limit-r5 = <0x52c6>;
xlnx,alarm-limit-r6 = <0x9555>;
xlnx,alarm-limit-r7 = <0xae4e>;
xlnx,alarm-limit-r8 = <0x5999>;
xlnx,alarm-limit-r9 = <0x5111>;
xlnx,configuration-r0 = <0x2003>;
xlnx,configuration-r1 = <0x31a0>;
xlnx,configuration-r2 = <0x400>;
xlnx,dclk-frequency = <0x64>;
xlnx,external-mux = "none";
xlnx,external-mux-channel = "VP_VN";
xlnx,external-muxaddr-enable = <0x0>;
xlnx,fifo-depth = <0x7>;
xlnx,has-axi = <0x1>;
xlnx,has-axi4stream = <0x0>;
xlnx,has-busy = <0x1>;
xlnx,has-channel = <0x1>;
xlnx,has-convst = <0x0>;
xlnx,has-convstclk = <0x0>;
xlnx,has-dclk = <0x1>;
xlnx,has-drp = <0x0>;
xlnx,has-eoc = <0x1>;
xlnx,has-eos = <0x1>;
xlnx,has-external-mux = <0x0>;
xlnx,has-jtagbusy = <0x0>;
xlnx,has-jtaglocked = <0x0>;
xlnx,has-jtagmodified = <0x0>;
xlnx,has-ot-alarm = <0x1>;
xlnx,has-reset = <0x0>;
xlnx,has-temp-bus = <0x0>;
xlnx,has-user-temp-alarm = <0x1>;
xlnx,has-vbram-alarm = <0x0>;
xlnx,has-vccaux-alarm = <0x1>;
xlnx,has-vccddro-alarm = <0x1>;
xlnx,has-vccint-alarm = <0x1>;
xlnx,has-vccpaux-alarm = <0x1>;
xlnx,has-vccpint-alarm = <0x1>;
xlnx,has-vn = <0x1>;
xlnx,has-vp = <0x1>;
xlnx,include-intr = <0x1>;
xlnx,sampling-rate = "961538.4615384615";
xlnx,sequence-r0 = <0x100>;
xlnx,sequence-r1 = <0x0>;
xlnx,sequence-r2 = <0x0>;
xlnx,sequence-r3 = <0x0>;
xlnx,sequence-r4 = <0x0>;
xlnx,sequence-r5 = <0x0>;
xlnx,sequence-r6 = <0x0>;
xlnx,sequence-r7 = <0x0>;
xlnx,sim-file-name = "design";
xlnx,sim-file-rel-path = "./";
xlnx,sim-file-sel = "Default";
xlnx,vaux0 = <0x0>;
xlnx,vaux1 = <0x0>;
xlnx,vaux10 = <0x0>;
xlnx,vaux11 = <0x0>;
xlnx,vaux12 = <0x0>;
xlnx,vaux13 = <0x0>;
xlnx,vaux14 = <0x0>;
xlnx,vaux15 = <0x0>;
xlnx,vaux2 = <0x0>;
xlnx,vaux3 = <0x0>;
xlnx,vaux4 = <0x0>;
xlnx,vaux5 = <0x0>;
xlnx,vaux6 = <0x0>;
xlnx,vaux7 = <0x0>;
xlnx,vaux8 = <0x0>;
xlnx,vaux9 = <0x0>;
};

3.个人测试:

参考官方的一些回复,当使用AMP模式,cpu1需要使用ps侧的外设时,需要准守一下原则:

第一:bootargs中需要包含 clk_ignore_unused 参数

第二:当设备只给cpu1使用时,需要在设备树dts中将对应的设备节点删除或是注释掉,避免cpu0的linux系统对其占用;

进行如下测试:

cpu1的裸机程序中有对xadc的初始化和使用

(1)当使用sdk进行在线调试时,xadc完成初始化并能对外部模拟信号采样处理,验证硬件电路与fpga.bit配置文件无误;

以下进行双核运行,cpu0的linux启动后,在启动cpu1的裸机程序

(2)dts中保留上述的adc@f8007100和xadc_wiz@43c10000节点,生成dtb并完成烧写启动,结果:

           cpu1中的xadc能完成初始化,但是采集的外部模拟信号一直是空值;

(3)dts中注释上述的adc@f8007100,保留xadc_wiz@43c10000节点,生成dtb并完成烧写启动,结果:

           cpu1程序卡在xadc的初始化过程中,具体函数是:XAdcPs_SelfTest(),即xadc自检

 

请问:这种情况有仁兄遇到过吗?

 

 

1 个已接受解答

已接受的解答
Xilinx Employee
Xilinx Employee
652 次查看
注册日期: ‎05-11-2010

回复: zynq amp模式下cpu1无法使用xadc进行外部采样

转到解答

如果cpu1 standalone application可以正常使用XADC,我认为你可以在cpu0 linux device tree里去掉xadc所有node。另外,你需要按照AMP的要求设计系统,比如,cpu0和cpu1使用的DDR范围要分开,cpu1 application要增加duse_amp flag,cpu1 application里要把可访问DDR范围设为Lv2 uncacheable, cpu1 application的中断要设置目标cpu为cpu1. 

在原帖中查看解决方案

3 条回复3
Xilinx Employee
Xilinx Employee
653 次查看
注册日期: ‎05-11-2010

回复: zynq amp模式下cpu1无法使用xadc进行外部采样

转到解答

如果cpu1 standalone application可以正常使用XADC,我认为你可以在cpu0 linux device tree里去掉xadc所有node。另外,你需要按照AMP的要求设计系统,比如,cpu0和cpu1使用的DDR范围要分开,cpu1 application要增加duse_amp flag,cpu1 application里要把可访问DDR范围设为Lv2 uncacheable, cpu1 application的中断要设置目标cpu为cpu1. 

在原帖中查看解决方案

Observer yehaiyang
Observer
626 次查看
注册日期: ‎09-29-2018

回复: zynq amp模式下cpu1无法使用xadc进行外部采样

转到解答
 
0 项奖励
Visitor markyang70
Visitor
465 次查看
注册日期: ‎06-15-2018

回复: zynq amp模式下cpu1无法使用xadc进行外部采样

转到解答

Hi yzhang

   您好,關於"cpu1 application的中断要设置目标cpu为cpu1." 這段話,

   要在哪裡設置,是否有詳細的說明,謝謝。

0 项奖励