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


PS block


Missing features, known Issues, limitations


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>;
            };
        };

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

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

Commit Id: b2c34939a13b135d088ec0bc15711c8db4a38a6d

2022.2

Commit Ids: 40c0c1312c1b558463ddbf494d1f4569449cf11e, 3b4a1bd83908b05b8ddf5c0d73c11cd53d23a7b0, f8ef475aa069cd72e9e7bdb2d60dc6a89e2bafad

2022.1

Commit Id: d5c70627a79455154f5f636096abe6fe57510605

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


2017.1Commit Id: d6b16bbd7699f21ed583df8eaa9fb30f3ce1f0e8
Commit Id: 05a452247ec248a0a6bd1679edd2fab7999adb11
Commit Id: c871c0555231c3478b161f299c6a18631ed893b7
Commit Id: 55157c770a0f6805f6e90e0b8e09f82d11c4abb9
Commit Id: acdbfc2832f380d42b80f78ff7e45645cc23ccd8
Commit Id: c472eeb29c1a36c72f32d706ef6a342f6e20b2bd
Commit Id: 07149fcb0c986172d7f4267bdf5365d035ca1e3d
Commit Id: f840025e3b6b72166e79306081041c83ecb45e87

2017.22017.32017.42018.12018.22018.32019.1

2019.2

2020.1


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
https://www.xilinx.com/support/documentation/user_guides/ug580-ultrascale-sysmon.pdf