drivers/firmware/xilinx/zynqmp-crypto.c
Source file repositories/reference/linux-study-clean/drivers/firmware/xilinx/zynqmp-crypto.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/firmware/xilinx/zynqmp-crypto.c- Extension
.c- Size
- 6790 bytes
- Lines
- 239
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/firmware/xlnx-zynqmp.hlinux/module.h
Detected Declarations
function Copyrightfunction BITfunction xlnx_get_crypto_dev_datafunction versal_pm_aes_key_writefunction versal_pm_aes_key_zerofunction versal_pm_aes_op_initfunction versal_pm_aes_update_aadfunction versal_pm_aes_enc_updatefunction versal_pm_aes_enc_finalfunction versal_pm_aes_dec_updatefunction versal_pm_aes_dec_finalfunction versal_pm_aes_initexport zynqmp_pm_aes_engineexport zynqmp_pm_sha_hashexport xlnx_get_crypto_dev_dataexport versal_pm_aes_key_writeexport versal_pm_aes_key_zeroexport versal_pm_aes_op_initexport versal_pm_aes_update_aadexport versal_pm_aes_enc_updateexport versal_pm_aes_enc_finalexport versal_pm_aes_dec_updateexport versal_pm_aes_dec_finalexport versal_pm_aes_init
Annotated Snippet
if (feature->family == pm_family_code) {
ret = zynqmp_pm_feature(feature->feature_id);
if (ret < 0)
return ERR_PTR(ret);
return feature->data;
}
}
return ERR_PTR(-ENODEV);
}
EXPORT_SYMBOL_GPL(xlnx_get_crypto_dev_data);
/**
* versal_pm_aes_key_write - Write AES key registers
* @keylen: Size of the input key to be written
* @keysrc: Key Source to be selected to which provided
* key should be updated
* @keyaddr: Address of a buffer which should contain the key
* to be written
*
* This function provides support to write AES volatile user keys.
*
* Return: Returns status, either success or error+reason
*/
int versal_pm_aes_key_write(const u32 keylen,
const u32 keysrc, const u64 keyaddr)
{
return zynqmp_pm_invoke_fn(XSECURE_API_AES_WRITE_KEY, NULL, 4,
keylen, keysrc,
lower_32_bits(keyaddr),
upper_32_bits(keyaddr));
}
EXPORT_SYMBOL_GPL(versal_pm_aes_key_write);
/**
* versal_pm_aes_key_zero - Zeroise AES User key registers
* @keysrc: Key Source to be selected to which provided
* key should be updated
*
* This function provides support to zeroise AES volatile user keys.
*
* Return: Returns status, either success or error+reason
*/
int versal_pm_aes_key_zero(const u32 keysrc)
{
return zynqmp_pm_invoke_fn(XSECURE_API_AES_KEY_ZERO, NULL, 1, keysrc);
}
EXPORT_SYMBOL_GPL(versal_pm_aes_key_zero);
/**
* versal_pm_aes_op_init - Init AES operation
* @hw_req: AES op init structure address
*
* This function provides support to init AES operation.
*
* Return: Returns status, either success or error+reason
*/
int versal_pm_aes_op_init(const u64 hw_req)
{
return zynqmp_pm_invoke_fn(XSECURE_API_AES_OP_INIT, NULL, 2,
lower_32_bits(hw_req),
upper_32_bits(hw_req));
}
EXPORT_SYMBOL_GPL(versal_pm_aes_op_init);
/**
* versal_pm_aes_update_aad - AES update aad
* @aad_addr: AES aad address
* @aad_len: AES aad data length
*
* This function provides support to update AAD data.
*
* Return: Returns status, either success or error+reason
*/
int versal_pm_aes_update_aad(const u64 aad_addr, const u32 aad_len)
{
return zynqmp_pm_invoke_fn(XSECURE_API_AES_UPDATE_AAD, NULL, 3,
lower_32_bits(aad_addr),
upper_32_bits(aad_addr),
aad_len);
}
EXPORT_SYMBOL_GPL(versal_pm_aes_update_aad);
/**
* versal_pm_aes_enc_update - Access AES hardware to encrypt the data using
* AES-GCM core.
* @in_params: Address of the AesParams structure
* @in_addr: Address of input buffer
*
* Return: Returns status, either success or error code.
Annotation
- Immediate include surface: `linux/firmware/xlnx-zynqmp.h`, `linux/module.h`.
- Detected declarations: `function Copyright`, `function BIT`, `function xlnx_get_crypto_dev_data`, `function versal_pm_aes_key_write`, `function versal_pm_aes_key_zero`, `function versal_pm_aes_op_init`, `function versal_pm_aes_update_aad`, `function versal_pm_aes_enc_update`, `function versal_pm_aes_enc_final`, `function versal_pm_aes_dec_update`.
- 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.