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:
XilinxSysFPGA- Manages FPGA device operationsXilinxSysOverlayHandler- Manages overlay operations
§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§
- Xilinx
SysPlatform - XilinxSys platform implementation for generic FPGA management.
Enums§
- Read
SubCommand - Identifies which read operation to perform via the xilinx_sys DBus interface.
- Write
SubCommand - 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_pathwhich 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.