Skip to main content

Module xilinx_sys

Module xilinx_sys 

Source
Expand description

XilinxSys platform implementation for standard Linux FPGA subsystem.

This module provides the XilinxSys platform, which is a generic implementation that works with tested FPGA devices using one of the common Linux FPGA subsystems, without requiring vendor-specific extensions. It serves as the fallback platform when no more specific platform matches a device’s compatibility string.

§Features

  • Generic FPGA Support - Works with any FPGA manager driver in the Linux kernel
  • Device Tree Overlays - Full support for overlay application and removal via configfs
  • No Vendor Dependencies - Pure Linux kernel API usage without vendor SDKs
  • Automatic Fallback - Used when device compatibility string doesn’t match registered platforms, or no softeners are included.

§Architecture

The XilinxSys platform uses lazy initialization via OnceLock to create component instances on first access:

§Registration

The platform automatically registers itself with the compatibility string “xlnx-sys” via the #[platform] procedural macro. This ensures it’s always available as a fallback.

§Examples

let platform = platform_for_known_platform("xlnx-sys")?;
let fpga = platform.fpga("fpga0")?;
let state = fpga.state()?;

Structs§

XilinxSysPlatform
XilinxSys platform implementation for generic FPGA management.

Enums§

ReadSubCommand
Identifies which read operation to perform via the xilinx_sys DBus interface.
WriteSubCommand
Identifies which write operation to perform via the xilinx_sys DBus interface.

Functions§

flags 🔒
Read the current programming flags from sysfs.
fs_read_property
Read the current contents of an FPGA device property, e.g. “name”. The property path must be a subdirectory of the fpga manager directory (typically, /sys/class/fpga_manager/)
get_handle_from_path_or_handle 🔒
Extracts a device handle from either a plain handle (e.g. fpga0) or the exact sysfs path to the flags property (e.g. /sys/class/fpga_manager/fpga0/flags).
hex_from_string 🔒
Parse a hexadecimal string into raw bytes.
read_property
Read an arbitrary FPGA device property from /sys/class/fpga_manager/<device>/.
set_flags 🔒
Set the programming flags in sysfs.
validate_property_path 🔒
Validates that a property path is constrained under the fpga manager directory and does not contain explicit parent traversal segments. This is used to validate paths for all read/write property access methods in the control and status interfaces.
validate_property_path_with_base 🔒
Validates that a property path is constrained under a specified base path and does not contain explicit parent traversal segments. This is a more general version of validate_property_path which can be used to validate paths under different base directories, such as the firmware lookup control path.
write_property
Write a string value to an arbitrary FPGA device property.
write_property_bytes 🔒
Write raw bytes to an arbitrary FPGA device property.
xilinx_sys_read_handler
Dispatches read subcommands for the xilinx_sys DBus status API.
xilinx_sys_write_handler
Dispatches write subcommands for the xilinx_sys DBus control API.