From: Michal Simek <michal.simek@amd.com>
To: Ronak Jain <ronak.jain@amd.com>, senthilnathan.thangaraj@amd.com
Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 0/2] Add dynamic CSU register sysfs interface
Date: Mon, 25 May 2026 16:09:40 +0200 [thread overview]
Message-ID: <13ee424b-60f2-4180-8964-b467794a4772@amd.com> (raw)
In-Reply-To: <20260520093654.3303917-1-ronak.jain@amd.com>
On 5/20/26 11:36, Ronak Jain wrote:
> This patch series adds support for exposing CSU registers through a
> sysfs interface. The implementation uses dynamic discovery via the
> PM_QUERY_DATA firmware API to determine available registers at
> runtime, making the interface flexible and maintainable without
> requiring kernel changes when firmware capabilities evolve.
>
> Background:
>
> The ZynqMP platform has several CSU registers that are useful for
> system configuration and debugging. Previously, accessing these
> registers required direct memory access or custom tools. This series
> provides a standardized sysfs interface that leverages existing
> firmware APIs for secure access.
>
> Key Features:
>
> - Dynamic register discovery using PM_QUERY_DATA API
> * PM_QID_GET_NODE_COUNT: Query number of available registers
> * PM_QID_GET_NODE_NAME: Query register names by index
> - Automatic sysfs attribute creation under csu_registers/ group
> - Read operations via existing IOCTL_READ_REG firmware API
> - Write operations via existing IOCTL_MASK_WRITE_REG firmware API
> - Firmware-enforced access control for read-only registers
>
> Currently Supported Registers:
>
> - multiboot (CSU_MULTI_BOOT): Boot mode configuration
> - idcode (CSU_IDCODE): Device identification (read-only)
> - pcap-status (CSU_PCAP_STATUS): PCAP status (read-only)
>
> The sysfs interface is available at:
> /sys/devices/platform/firmware:zynqmp-firmware/csu_registers/
>
> Usage Examples:
>
> Reading a register:
> # cat /sys/devices/platform/firmware:zynqmp-firmware/csu_registers/idcode
>
> Writing a register (mask and value in hex):
> # echo "0xFFFFFFFF 0x0" > /sys/devices/platform/firmware:zynqmp-firmware/csu_registers/multiboot
>
>
> Testing:
>
> - Verified register read operations return correct values
> - Verified write operations update registers correctly
> - Verified read-only registers reject write attempts
> - Verified dynamic discovery works with different firmware versions
>
> Changes in v2:
> Patch #1
> - Update date
>
> Patch #2:
> - Removed unused csu_reg_count field from struct zynqmp_csu_data and
> its kernel-doc entry.
> - Added explicit devm_kfree() on the csu_regs and attrs allocation
> failure paths, plus on devm_device_add_group() failure — keeps the
> footprint minimal when CSU is optional.
> - Expanded the 0644 sysfs-mode inline comment into a block comment
> explaining the firmware-enforced access-control limitation.Also,
> update the commit message accordingly.
> - Added zynqmp_pm_is_function_supported check for PM_QID_GET_NODE_NAME
> ID to mirror the PM_QID_GET_NODE_COUNT verification.
>
> Ronak Jain (2):
> Documentation: ABI: add sysfs interface for ZynqMP CSU registers
> firmware: zynqmp: Add dynamic CSU register discovery and sysfs
> interface
>
> .../ABI/stable/sysfs-driver-firmware-zynqmp | 33 +++
> MAINTAINERS | 10 +
> drivers/firmware/xilinx/Makefile | 2 +-
> drivers/firmware/xilinx/zynqmp-csu-reg.c | 258 ++++++++++++++++++
> drivers/firmware/xilinx/zynqmp-csu-reg.h | 18 ++
> drivers/firmware/xilinx/zynqmp.c | 6 +
> include/linux/firmware/xlnx-zynqmp.h | 4 +-
> 7 files changed, 329 insertions(+), 2 deletions(-)
> create mode 100644 drivers/firmware/xilinx/zynqmp-csu-reg.c
> create mode 100644 drivers/firmware/xilinx/zynqmp-csu-reg.h
>
Applied with kernel version changed to 7.2.
Thanks,
Michal
prev parent reply other threads:[~2026-05-25 14:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-20 9:36 [PATCH v2 0/2] Add dynamic CSU register sysfs interface Ronak Jain
2026-05-20 9:36 ` [PATCH v2 1/2] Documentation: ABI: add sysfs interface for ZynqMP CSU registers Ronak Jain
2026-05-20 9:36 ` [PATCH v2 2/2] firmware: zynqmp: Add dynamic CSU register discovery and sysfs interface Ronak Jain
2026-05-25 14:09 ` Michal Simek [this message]
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=13ee424b-60f2-4180-8964-b467794a4772@amd.com \
--to=michal.simek@amd.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ronak.jain@amd.com \
--cc=senthilnathan.thangaraj@amd.com \
/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