cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jack-xu
Visitor
Visitor
430 Views
Registered: ‎07-21-2020

Question about XADC Devicetree Register

Jump to solution

Hello, I use petalinux to build a linux-system in zynq-Borad, and i also want to add a xadc to read external channel,but I have a problem.

When i'm using XADC in ZYNQ-Board. The Sequence-Register value in pl.dtsi are not same as in Board.

The  value in devicetree:

xadc_wiz_0: xadc_wiz@43c00000 {
clock-names = "s_axis_aclk", "s_axi_aclk";
clocks = <&clkc 15>, <&clkc 15>;
compatible = "xlnx,xadc-wiz-3.3", "xlnx,axi-xadc-1.00.a";
interrupt-names = "ip2intc_irpt";
interrupt-parent = <&intc>;
interrupts = <0 32 4>;
reg = <0x43c00000 0x10000>;
xlnx,sequence-r0 = <0x0>;
};

I use devmem2 to read value in sequence register 0 and the value in Board:

root@dma-alt:~# ./devmem2 0x43c00320
/dev/mem opened.
Memory mapped at address 0xb6f72000.
Value at address 0x43C00320 (0xb6f72320): 0x77E1

I dont know what wrong with the devicetree.

Can anyone help me?

Thx

0 Kudos
Reply
1 Solution

Accepted Solutions
stephenm
Moderator
Moderator
353 Views
Registered: ‎09-12-2007
0 Kudos
Reply
3 Replies
stephenm
Moderator
Moderator
421 Views
Registered: ‎09-12-2007

What do you see if you do a dmesg | grep xadc?

Based on the driver compatibility:

https://github.com/Xilinx/linux-xlnx/blob/master/drivers/iio/adc/xilinx-xadc-core.c

Can you you try add this to the system-user.dtsi:

&xadc_wiz_0 {                                                                    
     compatible = "xlnx,axi-xadc-1.00.a";                                         
     clocks = <&clkc 15>;                                                         
  }; 

 Once this is done can you try a dmesg | grep xadc

 

 

0 Kudos
Reply
jack-xu
Visitor
Visitor
373 Views
Registered: ‎07-21-2020
Hello,
dmesg cannot find xadc :
root@dma-alt:~# dmesg | grep adc
can: broadcast manager protocol (rev 20170425 t)

but i can read xadc-datei in iio.
0 Kudos
Reply
stephenm
Moderator
Moderator
354 Views
Registered: ‎09-12-2007
0 Kudos
Reply