From: "Erim, Salih" <salih.erim@amd.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: andy@kernel.org, dlechner@baylibre.com, nuno.sa@analog.com,
robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
conall.ogriofa@amd.com, michal.simek@amd.com, linux@roeck-us.net,
erimsalih@gmail.com, linux-iio@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6 2/5] iio: adc: add Versal SysMon driver
Date: Fri, 12 Jun 2026 13:40:54 +0100 [thread overview]
Message-ID: <b7941c7e-b944-4782-a55c-d28dfa644d02@amd.com> (raw)
In-Reply-To: <20260612131009.1be11ff2@jic23-huawei>
Hi Jonathan,
On 12/06/2026 13:10, Jonathan Cameron wrote:
> On Thu, 11 Jun 2026 23:27:35 +0100
> Salih Erim <salih.erim@amd.com> wrote:
>
>> Add the core driver and MMIO platform driver for the AMD/Xilinx Versal
>> System Monitor (SysMon) block.
>>
>> The SysMon block resides in the platform management controller (PMC) and
>> provides on-chip voltage and temperature monitoring through a 10-bit,
>> 200 kSPS ADC. It can monitor up to 160 voltage channels and 64
>> temperature satellites distributed across the SoC, with a consistent
>> sample rate of 8 kSPS per channel regardless of how many channels are
>> enabled.
>>
>> The driver is split into two compilation units:
>> - versal-sysmon-core: Channel parsing, IIO registration, read_raw
>> - versal-sysmon: MMIO platform driver with custom regmap accessors
>>
>> Voltage results are stored in a 19-bit modified floating-point format
>> and converted to millivolts. Temperature results are stored in Q8.7
>> signed fixed-point Celsius format and converted to millicelsius.
>>
>> The MMIO regmap backend uses a custom reg_write accessor that
>> automatically unlocks the NPI (NoC programming interface) lock
>> register before each write, as required by the hardware. The regmap
>> is configured with fast_io since the underlying MMIO accessors are
>> safe to call from atomic context.
>>
>> Co-developed-by: Michal Simek <michal.simek@amd.com>
>> Signed-off-by: Michal Simek <michal.simek@amd.com>
>> Signed-off-by: Salih Erim <salih.erim@amd.com>
>
> One question on the static temp channels. I may have forgotten
> some earlier discussion!
>
>> diff --git a/drivers/iio/adc/versal-sysmon-core.c b/drivers/iio/adc/versal-sysmon-core.c
>> new file mode 100644
>> index 00000000000..c875d156dbe
>> --- /dev/null
>> +++ b/drivers/iio/adc/versal-sysmon-core.c
>> @@ -0,0 +1,281 @@
>
>> +
>> +#define SYSMON_CHAN_TEMP(_chan, _address, _name) \
>> +{ \
>> + .type = IIO_TEMP, \
>> + .indexed = 1, \
>> + .address = _address, \
>> + .channel = _chan, \
>> + .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \
>> + .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \
>> + .datasheet_name = _name, \
>> +}
>> +
>> +/* Static temperature channels (always present) */
>> +static const struct iio_chan_spec temp_channels[] = {
>> + SYSMON_CHAN_TEMP(0, SYSMON_TEMP_MAX, "temp"),
>> + SYSMON_CHAN_TEMP(1, SYSMON_TEMP_MIN, "min"),
>> + SYSMON_CHAN_TEMP(2, SYSMON_TEMP_MAX_MAX, "max_max"),
>> + SYSMON_CHAN_TEMP(3, SYSMON_TEMP_MIN_MIN, "min_min"),
>
> Sorry, I missed this in previous reviews, but what are these channels?
> The labels are rather unusual.
>
> My guess is they are gathering up values from across a bunch of sensors
> but I'm not certain. They are unusual enough we probably need some documentation.
>
Your guess is correct. These are hardware-computed aggregate
registers across all active temperature satellites:
- temp (0x1030): current max across all active satellites
- min (0x1034): current min across all active satellites
- max_max (0x1F90): highest peak since last hardware reset
- min_min (0x1F8C): lowest trough since last hardware reset
The cover letter mentions this but the commit message and code
don't. Will add a comment block above the channel definitions
and expand the commit description in v7.
Thanks,
Salih
next prev parent reply other threads:[~2026-06-12 12:41 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-11 22:27 [PATCH v6 0/5] iio: adc: add AMD/Xilinx Versal SysMon driver Salih Erim
2026-06-11 22:27 ` [PATCH v6 1/5] dt-bindings: iio: adc: add xlnx,versal-sysmon binding Salih Erim
2026-06-11 22:27 ` [PATCH v6 2/5] iio: adc: add Versal SysMon driver Salih Erim
2026-06-12 12:10 ` Jonathan Cameron
2026-06-12 12:40 ` Erim, Salih [this message]
2026-06-11 22:27 ` [PATCH v6 3/5] iio: adc: versal-sysmon: add I2C driver Salih Erim
2026-06-11 22:37 ` sashiko-bot
2026-06-11 22:27 ` [PATCH v6 4/5] iio: adc: versal-sysmon: add threshold event support Salih Erim
2026-06-11 22:40 ` sashiko-bot
2026-06-12 12:52 ` Jonathan Cameron
2026-06-12 13:39 ` Erim, Salih
2026-06-12 13:43 ` Jonathan Cameron
2026-06-11 22:27 ` [PATCH v6 5/5] iio: adc: versal-sysmon: add oversampling support Salih Erim
2026-06-11 22:40 ` sashiko-bot
2026-06-12 12:58 ` Jonathan Cameron
2026-06-12 13:45 ` Erim, Salih
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b7941c7e-b944-4782-a55c-d28dfa644d02@amd.com \
--to=salih.erim@amd.com \
--cc=andy@kernel.org \
--cc=conall.ogriofa@amd.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=erimsalih@gmail.com \
--cc=jic23@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=michal.simek@amd.com \
--cc=nuno.sa@analog.com \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox