Introduction

The Xilinx analog mixed signal module, referred to as the XADC, is a hard macro. It has JTAG and DRP interfaces for accessing the XADC’s status and control registers in the 7-series FPGAs.
Zynq-7000 AP SoC devices add a third interface, the PS-XADC interface for the PS software to control the XADC. The Zynq-7000 AP SoC devices combine a flexible analog-to-digital converter with programmable logic to address a broad range of analog data acquisition and monitoring requirements. The XADC is part of a larger analog mixed signal (AMS) topic that is a combination of analog and digital circuits.

HW/IP features

Analog-to-Digital Converters

  • Dual 12-bit 1 MSPS analog-to-digital converters (ADCs)
  • Up to 17 flexible and user-configurable analog inputs
  • On-chip or external reference option
  • On-chip temperature and power supply sensors
  • JTAG access to ADC measurements

PS-XADC Interface

  • Read and write XADC registers
  • Serial data transfers to/from XADC
  • Buffered read-write data operations
  • 15-word by 32-bit command FIFO
  • 15-word by 32-bit
  • Read Data FIFO
  • Programmable FIFO-level interrupts
  • Programmable alarm interrupts
  • Configured interface operations (using devcfg registers)
  • DRP Parallel Interface
  • Highest interface bandwidth
  • 6-bit sample data

PL-JTAG Interface

  • Access the XADC when the PL is not programmed but is powered-up
  • Uses the JTAG TAP controller to access the XADC registers

Missing features, Known Issues, limitations

  • System Monitor/ADC device can be accessed through the JTAG port and AXI interface. The driver implementation does not support the simultaneous access of the device by both these interfaces. The user has to care of this situation in the user application code.

Kernel configurations

To compile a kernel with a driver for the XADC enable the following kernel config option:
CONFIG_XILINX_XADC

Device Tree Settings

xadc@f8007100 {
        compatible = "xlnx,zynq-xadc-1.00.a";
        reg = <0xf8007100 0x20>;
        interrupts = <0 7 4>;
        interrupt-parent = <&gic>;
        clocks = <&pcap_clk>;
 
        xlnx,channels {
            #address-cells = <1>;
            #size-cells = <0>;
            channel@0 {
                reg = <0>;
            };
            channel@1 {
                reg = <1>;
            };
            channel@8 {
                reg = <8>;
            };
        };
    };
 
    xadc@43200000 {
        compatible = "xlnx,axi-xadc-1.00.a";
        reg = <0x43200000 0x1000>;
        interrupts = <0 53 4>;
        interrupt-parent = <&gic>;
        clocks = <&fpga1_clk>;
 
        xlnx,channels {
            #address-cells = <1>;
            #size-cells = <0>;
            channel@0 {
                reg = <0>;
                xlnx,bipolar;
            };
        };
    };

Test Procedure



contains an user app called "xadc_app" for doing some sanity checks on sysmon driver.

Expected Output

[    4.128615] mmc0: SDHCI controller on ff170000.sdhci [ff170000.sdhci] using ADMA 64-bit
[    4.136711] usbcore: registered new interface driver usbhid
[    4.142197] usbhid: USB HID core driver
[    4.146108] [xadc_probe]: Initializing locks ....
[    4.150556] Done
[    4.152545] [xadc_probe]: Getting platform resources .....
[    4.157851] Done
[    4.159836] [xadc_probe]: Initializing indio_dev .....
[    4.164789] Done
[    4.166780] [xadc_probe]: Parsing device-tree .....
[    4.171477] Done
[    4.173469] [xadc_probe]: Initializing triggered buffers .....
[    4.179239] Done
[    4.181162] [xadc_probe]: preparing clock .....
[    4.185516] Done
[    4.187491] [xadc_probe]: setting up operations structure .....
[    4.193227] Done
[    4.195216] [xadc_probe]: Requesting an IRQ .....
[    4.199752] Done
[    4.201732] [xadc_probe]: Initiating threshold registers .....
[    4.207380] Done
[    4.209370] [xadc_probe]: Updating bipolar mask to each channel .....
[    4.215619] Done
[    4.217616] [xadc_probe]: Disabling all alarms .....
[    4.222390] Done
[    4.224381] [xadc_probe]: Setting all thresholds .....
[    4.229341] Done
[    4.231327] [xadc_probe]: Registering device driver .....
[    4.237144] Done
[    4.239059] [xadc_probe]: XADC driver probing done
[    4.244068] Initializing XFRM netlink socket
[    4.248316] NET: Registered protocol family 10
[    4.253073] sit: IPv6 over IPv4 tunneling driver
 
root@Xilinx-ZCU102-2016_1:~#
root@Xilinx-ZCU102-2016_1:~# cd /bin/
root@Xilinx-ZCU102-2016_1:/bin#
root@Xilinx-ZCU102-2016_1:/bin# xadc_app
This Program can not be used directly
Please rename (file) it to the commands needed
Following is the list of commands Available:
xadc_get_value_vccint
xadc_get_value_vccaux
xadc_get_value_vccbram
xadc_get_value_temp
xadc_get_value_ext_ch
root@Xilinx-ZCU102-2016_1:/bin#
root@Xilinx-ZCU102-2016_1:/bin# cp xadc_app xadc_get_value_vccint
root@Xilinx-ZCU102-2016_1:/bin# xadc_get_value_vccint
843.75 mV
root@Xilinx-ZCU102-2016_1:/bin#
root@Xilinx-ZCU102-2016_1:/bin# cp xadc_app xadc_get_value_temp
root@Xilinx-ZCU102-2016_1:/bin# xadc_get_value_temp
67.06 Degree Celsius
root@Xilinx-ZCU102-2016_1:/bin#
root@Xilinx-ZCU102-2016_1:/bin#
root@Xilinx-ZCU102-2016_1:/bin#
root@Xilinx-ZCU102-2016_1:/bin# logout
 
root@Xilinx-ZCU102-2016_1:~#root@Xilinx-ZCU102-2016_1:~# cd /bin/
root@Xilinx-ZCU102-2016_1:/bin#
root@Xilinx-ZCU102-2016_1:/bin#
root@Xilinx-ZCU102-2016_1:/bin# xadc_app
This Program can not be used directly
Please rename (file) it to the commands needed
Following is the list of commands Available:
xadc_get_value_vccint
xadc_get_value_vccaux
xadc_get_value_vccbram
xadc_get_value_temp
xadc_get_value_ext_ch
root@Xilinx-ZCU102-2016_1:/bin#
root@Xilinx-ZCU102-2016_1:/bin# cp xadc_app xadc_get_value_temp
root@Xilinx-ZCU102-2016_1:/bin#
root@Xilinx-ZCU102-2016_1:/bin# xadc_get_value_temp
46.44 Degree Celsius
root@Xilinx-ZCU102-2016_1:/bin#
root@Xilinx-ZCU102-2016_1:/bin#
root@Xilinx-ZCU102-2016_1:/bin# cp xadc_app xadc_get_value_vccint
root@Xilinx-ZCU102-2016_1:/bin#
root@Xilinx-ZCU102-2016_1:/bin# xadc_get_value_vccint
845.21 mV
root@Xilinx-ZCU102-2016_1:/bin#
root@Xilinx-ZCU102-2016_1:/bin#
root@Xilinx-ZCU102-2016_1:/bin# cp xadc_app xadc_get_value_vccaux
root@Xilinx-ZCU102-2016_1:/bin#
root@Xilinx-ZCU102-2016_1:/bin# xadc_get_value_vccaux
838.62 mV
root@Xilinx-ZCU102-2016_1:/bin#
root@Xilinx-ZCU102-2016_1:/bin# cp xadc_app xadc_get_value_vccbram
root@Xilinx-ZCU102-2016_1:/bin#
root@Xilinx-ZCU102-2016_1:/bin# xadc_get_value_vccbram
850.34 mV
root@Xilinx-ZCU102-2016_1:/bin#

Change Log

2016.3

  • None

2016.4

  • None

2017.1

  • Fix external channel read issue
Commit Id: cefc6386c7cfc686681942be395b0cf3de6d88a3
  • Fix error handling
Commit Id: acdbfc2832f380d42b80f78ff7e45645cc23ccd8

2017.2

  • None

2017.3

  • None

2017.4

  • None

2018.1

  • None

2018.2

  • None

Mainline status

XADC driver is in sync with the mainline kernel 4.9 except for the following
-> Reading the external auxiliary channels.
-> Support for ultrascale sysmon.
-> Limiting xadc pcap clock frequency value to be less than 200MHz.
-> Default values of extend_name in iio_chan_spec
->Reordering Error handling.

Related Links