drivers/firmware/xilinx/zynqmp.c
Source file repositories/reference/linux-study-clean/drivers/firmware/xilinx/zynqmp.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/firmware/xilinx/zynqmp.c- Extension
.c- Size
- 60177 bytes
- Lines
- 2215
- Domain
- Driver Families
- Bucket
- drivers/firmware
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/arm-smccc.hlinux/compiler.hlinux/device.hlinux/init.hlinux/mfd/core.hlinux/module.hlinux/of.hlinux/of_platform.hlinux/platform_device.hlinux/pm_domain.hlinux/slab.hlinux/uaccess.hlinux/hashtable.hlinux/firmware/xlnx-zynqmp.hlinux/firmware/xlnx-event-manager.hzynqmp-debug.h
Detected Declarations
struct zynqmp_devinfostruct pm_api_feature_datastruct platform_fw_datastruct zynqmp_pm_shutdown_scopefunction zynqmp_pm_ret_codefunction do_fw_call_failfunction do_fw_call_smcfunction do_fw_call_hvcfunction __do_feature_check_callfunction do_feature_check_callfunction zynqmp_pm_featurefunction zynqmp_pm_is_function_supportedfunction zynqmp_pm_invoke_fw_fnfunction zynqmp_pm_invoke_fnfunction zynqmp_pm_register_sgifunction zynqmp_pm_get_api_versionfunction zynqmp_pm_get_chipidfunction zynqmp_pm_get_family_infofunction zynqmp_pm_get_sip_svc_versionfunction zynqmp_pm_get_trustzone_versionfunction get_set_conduit_methodfunction zynqmp_pm_query_datafunction zynqmp_pm_clock_enablefunction zynqmp_pm_clock_disablefunction zynqmp_pm_clock_getstatefunction zynqmp_pm_clock_setdividerfunction zynqmp_pm_clock_getdividerfunction zynqmp_pm_clock_setparentfunction zynqmp_pm_clock_getparentfunction zynqmp_pm_set_pll_frac_modefunction zynqmp_pm_get_pll_frac_modefunction zynqmp_pm_set_pll_frac_datafunction zynqmp_pm_get_pll_frac_datafunction zynqmp_pm_set_sd_tapdelayfunction zynqmp_pm_sd_dll_resetfunction zynqmp_pm_ospi_mux_selectfunction zynqmp_pm_write_ggsfunction zynqmp_pm_read_ggsfunction zynqmp_pm_write_pggsfunction zynqmp_pm_read_pggsfunction zynqmp_pm_set_tapdelay_bypassfunction zynqmp_pm_set_boot_health_statusfunction releasedfunction zynqmp_pm_reset_get_statusfunction zynqmp_pm_fpga_loadfunction zynqmp_pm_fpga_get_statusfunction zynqmp_pm_fpga_get_config_statusfunction zynqmp_pm_pinctrl_request
Annotated Snippet
struct zynqmp_devinfo {
struct device *dev;
u32 feature_conf_id;
};
/**
* struct pm_api_feature_data - PM API Feature data
* @pm_api_id: PM API Id, used as key to index into hashmap
* @feature_status: status of PM API feature: valid, invalid
* @hentry: hlist_node that hooks this entry into hashtable
*/
struct pm_api_feature_data {
u32 pm_api_id;
int feature_status;
struct hlist_node hentry;
};
struct platform_fw_data {
/*
* Family code for platform.
*/
const u32 family_code;
};
static struct platform_fw_data *active_platform_fw_data;
static const struct mfd_cell firmware_devs[] = {
{
.name = "zynqmp_power_controller",
},
};
/**
* zynqmp_pm_ret_code() - Convert PMU-FW error codes to Linux error codes
* @ret_status: PMUFW return code
*
* Return: corresponding Linux error code
*/
static int zynqmp_pm_ret_code(u32 ret_status)
{
switch (ret_status) {
case XST_PM_SUCCESS:
case XST_PM_DOUBLE_REQ:
return 0;
case XST_PM_NO_FEATURE:
return -ENOTSUPP;
case XST_PM_INVALID_VERSION:
return -EOPNOTSUPP;
case XST_PM_NO_ACCESS:
return -EACCES;
case XST_PM_ABORT_SUSPEND:
return -ECANCELED;
case XST_PM_MULT_USER:
return -EUSERS;
case XST_PM_INTERNAL:
case XST_PM_CONFLICT:
case XST_PM_INVALID_NODE:
case XST_PM_INVALID_CRC:
default:
return -EINVAL;
}
}
static noinline int do_fw_call_fail(u32 *ret_payload, u32 num_args, ...)
{
return -ENODEV;
}
/*
* PM function call wrapper
* Invoke do_fw_call_smc or do_fw_call_hvc, depending on the configuration
*/
static int (*do_fw_call)(u32 *ret_payload, u32, ...) = do_fw_call_fail;
/**
* do_fw_call_smc() - Call system-level platform management layer (SMC)
* @num_args: Number of variable arguments should be <= 8
* @ret_payload: Returned value array
*
* Invoke platform management function via SMC call (no hypervisor present).
*
* Return: Returns status, either success or error+reason
*/
static noinline int do_fw_call_smc(u32 *ret_payload, u32 num_args, ...)
{
struct arm_smccc_res res;
u64 args[8] = {0};
va_list arg_list;
u8 i;
Annotation
- Immediate include surface: `linux/arm-smccc.h`, `linux/compiler.h`, `linux/device.h`, `linux/init.h`, `linux/mfd/core.h`, `linux/module.h`, `linux/of.h`, `linux/of_platform.h`.
- Detected declarations: `struct zynqmp_devinfo`, `struct pm_api_feature_data`, `struct platform_fw_data`, `struct zynqmp_pm_shutdown_scope`, `function zynqmp_pm_ret_code`, `function do_fw_call_fail`, `function do_fw_call_smc`, `function do_fw_call_hvc`, `function __do_feature_check_call`, `function do_feature_check_call`.
- Atlas domain: Driver Families / drivers/firmware.
- Implementation status: integration implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.