Zynq UltraScale+ MPSoC AMS

Table of Contents

Introduction

A Zynq® UltraScale+™ MPSoC has one system monitoring (SYSMON) block in both the PS and the PL. The SYSMON block has a register interface that can be used to configure the
block and provide the capability to monitor on and off-chip voltages as well as junction temperature. The SYSMON block also has built-in alarm generation logic that is used to
interrupt the processor based on certain alarm conditions. For example, it can shut down the system based on an over-temperature (OT) alarm generated from the SYSMON block.
The PL-SYSMON block has DRP, JTAG, and I2C interfaces to enable monitoring from the external master and the capability to interface with an external power management bus
(PMBus) device. The PS-SYSMON block is memory mapped to the PS. In comparison to JTAG and I2C transfers, this interface is more efficient at transferring data from software. The
PS-SYSMON block has an internal reference option.

HW/IP features

PL block

  • 10-bit resolution
  • 0.2 MSPS sample rate
  • Support external analog input
  • External mux supports
  • 16 auxiliary channels
  • 16 alarm output
  • Interface supported JTAG, DRP or dedicated PS DRP, I2C and PMBus
  • 2 temperature sensors
  • VCCINT, VCCAUX, VCCBRAM, VCC_PSINTLP, VCC_PSINTFP, VCC_PSAUX system supply sensors
  • 4 USER supply channels

PS block

  • 10-bit resolution
  • 1.0 MSPS sample rate
  • 16 alarm output
  • Interface supported JTAG or APB
  • 1 temperature sensors
  • VCCINT, VCCAUX, VCCBRAM, VCC_PSINTLP, VCC_PSINTFP, VCC_PSAUX system supply sensors

Missing features, known Issues, limitations

  • Single pass sequence mode
  • Bipolar channel modes
  • External mux mode
  • System Lockup can happen if the PL temperature is queried during PL Initialization

Kernel configurations

To compile a kernel with a driver for the AMS enable the following kernel config option:
CONFIG_XILINX_AMS

Device Tree Settings

Device Tree Bindings Doc: https://github.com/Xilinx/linux-xlnx/blob/master/Documentation/devicetree/bindings/iio/adc/xlnx%2Czynqmp-ams.yaml

The above doc will provide details into what full configuration will look like.

The following Device Tree shows minimal configuration.

xilinx_ams: ams@ffa50000 {
            compatible = "xlnx,zynqmp-ams";
            interrupt-parent = <&&gic>;
            interrupts = <0 56 4>;
            interrupt-names = "ams-irq";
            reg = <0x0 0xffa50000 0x0 0x800>;
            reg-names = "ams-base";
            #address-cells = <2>;
            #size-cells = <2>;
            ranges;
 
            ams_ps: ams_ps@ffa50800 {
                compatible = "xlnx,zynqmp-ams-ps";
                reg = <0x0 0xffa50800 0x0 0x400>;
            };
 
            ams_pl: ams_pl@ffa50c00 {
                compatible = "xlnx,zynqmp-ams-pl";
                reg = <0x0 0xffa50c00 0x0 0x400>;
            };
        };

Sysmon IIO Sysfs File Naming Changes

Sysfs File Naming Change

With 2023.1 release, Sysmon IIO Sysfs naming changed as below table.

Block NameChannel NumberChannel DetailsMeasurement TypeReleated IIO Sysfs File Names
2023.1 and After
under iio:device0/
Releated IIO Sysfs File Names
2022.2 and Before
under iio:device0/
files prefix"*_label" file outputfiles prefix"*_label" file output
AMS CTRL0System PLLs voltage measurement, VCC_PSPLLVoltagein_voltage0_*Not availablein_voltage0_vcc_pspll0_*vcc_pspll0
1Battery voltage measurement, VCC_PSBATTVoltagein_voltage1_*Not availablein_voltage1_vcc_psbatt_*vcc_psbatt
2PL Internal voltage measurement, VCCINTVoltagein_voltage2_*Not availablein_voltage2_vccint_*vccint
3Block RAM voltage measurement, VCCAUXVoltagein_voltage3_*Not availablein_voltage3_vccbram_*vccbram
4PL Aux voltage measurement, VCCAUXVoltagein_voltage4_*Not availablein_voltage4_vccaux_*vccaux
5Voltage measurement for six DDR I/O PLLs, VCC_PSDDR_PLLVoltagein_voltage5_*Not availablein_voltage5_vcc_psddrpll_*vcc_psddrpll
6VCC_PSINTFP_DDR voltage measurementVoltagein_voltage6_*Not availablein_voltage6_vccpsintfpddr_*vccpsintfpddr
AMS PS SYSMON7LPD temperature measurementTemperaturein_temp7_*Not availablein_temp0_ps_temp_*ps_temp
8FPD temperature measurement (REMOTE)Temperaturein_temp8_*Not availablein_temp1_remote_temp_*remote_temp
9VCC PS LPD voltage measurement (supply1)Voltagein_voltage9_*Not availablein_voltage7_vccpsintlp_*vccpsintlp
10VCC PS FPD voltage measurement (supply2)Voltagein_voltage10_*Not availablein_voltage8_vccpsintfp_*vccpsintfp
11PS Aux voltage reference (supply3)Voltagein_voltage11_*Not availablein_voltage9_vccpsaux_*vccpsaux
12DDR I/O VCC voltage measurementVoltagein_voltage12_*Not availablein_voltage10_vccpsddr_*vccpsddr
13PS IO Bank 503 voltage measurement (supply5)Voltagein_voltage13_*Not availablein_voltage11_vccpsio3_*vccpsio3
14PS IO Bank 500 voltage measurement (supply6)Voltagein_voltage14_*Not availablein_voltage12_vccpsio0_*vccpsio0
15VCCO_PSIO1 voltage measurementVoltagein_voltage15_*Not availablein_voltage13_vccpsio1_*vccpsio1
16VCCO_PSIO2 voltage measurementVoltagein_voltage16_*Not availablein_voltage14_vccpsio2_*vccpsio2
17VCC_PS_GTR voltage measurement, VPS_MGTRAVCCVoltagein_voltage17_*Not availablein_voltage15_psmgtravcc_*psmgtravcc
18VTT_PS_GTR voltage measurement, VPS_MGTRAVTTVoltagein_voltage18_*Not availablein_voltage16_psmgtravtt_*psmgtravtt
19VCC_PSADC voltage measurementVoltagein_voltage19_*Not availablein_voltage17_vccams_*vccams
AMS PL SYSMON20PL temperature measurementTemperaturein_temp20_*Not availablein_temp2_pl_temp_*pl_temp
21PL Internal voltage measurement, VCCINTVoltagein_voltage21_*Not availablein_voltage18_vccint_*vccint
22PL Auxiliary voltage measurement, VCCAUXVoltagein_voltage22_*Not availablein_voltage19_vccaux_*vccaux
23ADC Reference P+ voltage measurementVoltagein_voltage22_*Not availablein_voltage20_vccvrefp_*vccvrefp
24ADC Reference N- voltage measurementVoltagein_voltage24_*Not availablein_voltage21_vccvrefn_*vccvrefn
25PL Block RAM voltage measuremen, VCCBRAMVoltagein_voltage25_*Not availablein_voltage22_vccbram_*vccbram
26LPD Internal voltage measurement, VCC_PSINTLP (supply4)Voltagein_voltage26_*Not availablein_voltage23_vccplintlp_*vccplintlp
27FPD Internal voltage measurement, VCC_PSINTFP (supply5)Voltagein_voltage27_*Not availablein_voltage24_vccplintfp_*vccplintfp
28PS Auxiliary voltage measurement (supply6)Voltagein_voltage28_*Not availablein_voltage25_vccplaux_*vccplaux
29PL VCCADC voltage measurement (VCCAMS)Voltagein_voltage29_*Not availablein_voltage26_vccams_*vccams
30~50Diff. analog input signal voltage measurement
Vuser* voltage measurement
Auxiliary ch* voltage measurement
VoltageNot Enabled by default design
Not Enabled by default design

Test Procedure

Test Case 1: Read channel value via sysfs


The above example is calculating the temperature in millidegrees C the calculation as prescribed in sysfs-bus-iio.
the calcuation is as follows:
Temp (mdeg C) = (in_temp<n>_raw + in_temp<n>_offset) X in_temp<n>_scale
The processed temperature in millidegrees C can also be read directly from the in_temp<n>_input sysfs entry.

Test Case 2: Get rising event for channel using sample application

iio_event_monitor is a program that is located in tools/iio/iio_event_monitor.c inside the linux kernel source.
This application is being used here for monitoring sysmon events. 


Test Case 3: Rising event – negative test using sample application



Test Case 4: Get falling event for voltage channel using sample application



Test Case 5: Falling event for voltage channel – negative test using sample application


Change Log


2023.2

  • Add Over temperature interrupts

This new functionality allows the user to enable and set thresholds for OT interrupts. This new functionality will disable the OT interrupt and max out the the thresholds by default (as it does with other alarms). The user should manually set the enable and thresholds through sysfs.

Commit Id: f6e3323a5d71d1f893ed20fdecc6b21d784d6683

2023.1

  • Added MiliCelsius File 

Commit Id: b2c34939a13b135d088ec0bc15711c8db4a38a6d

2022.2

  • Various bug fixes and enhancements

Commit Ids: 40c0c1312c1b558463ddbf494d1f4569449cf11e, 3b4a1bd83908b05b8ddf5c0d73c11cd53d23a7b0, f8ef475aa069cd72e9e7bdb2d60dc6a89e2bafad

2022.1

  • New up-steamed driver

Commit Id: d5c70627a79455154f5f636096abe6fe57510605

  • Various bug fixes and enhancements

Commit Ids: 0bf126163c3e7e6d722622073046aed567a5551e, d5d786fb531697be74c567b3844c6897ddf1ffdd, 1f21a41578062d439cc485bce2d8b664f9a6170e,2c43265516b5a507a2bc646453aafea8aaa304e7


2017.1
  • Add Xilinx AMS driver
Commit Id: d6b16bbd7699f21ed583df8eaa9fb30f3ce1f0e8
  • Enable the clock through CCF
Commit Id: 05a452247ec248a0a6bd1679edd2fab7999adb11
  • fix temperature offset
Commit Id: c871c0555231c3478b161f299c6a18631ed893b7
  • fix false alarm event
Commit Id: 55157c770a0f6805f6e90e0b8e09f82d11c4abb9
  • Fix error handling
Commit Id: acdbfc2832f380d42b80f78ff7e45645cc23ccd8
  • Disable interrupts at boot up
Commit Id: c472eeb29c1a36c72f32d706ef6a342f6e20b2bd
  • fix module unload crash
Commit Id: 07149fcb0c986172d7f4267bdf5365d035ca1e3d
  • enable clock before device initialization
Commit Id: f840025e3b6b72166e79306081041c83ecb45e87

2017.2
  • None
2017.3
  • add missing break in AMS_SUPPLY[78] cases.
  • Add suspend resume support.
  • reset [ps|pl]-sysmon before channel config
2017.4
  • None
2018.1
  • Add support to read voltages from AMS control block
  • Modify driver to match AMS standard sequence
2018.2
  • None
2018.3
  • Resolved scale conflicts in AMS CTRL and PL blocks
2019.1
  • None

2019.2

  • None

2020.1

  • None


Mainline status

Driver is not in mainline kernel.

Related Links

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

© Copyright 2019 - 2022 Xilinx Inc. Privacy Policy