Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drivers: firmware: Add PDI load API support

This patch adds load PDI API support to enable full/partial PDI loading
from linux. Programmable Device Image (PDI) is combination of headers,
images and bitstream files to be loaded.

Reviewed-by: Moritz Fischer <mdf@kernel.org>
Signed-off-by: Nava kishore Manne <nava.manne@xilinx.com>
Link: https://lore.kernel.org/r/20210626155248.5004-2-nava.manne@xilinx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Nava kishore Manne and committed by
Greg Kroah-Hartman
2b9fc773 2734d6c1

+27
+17
drivers/firmware/xilinx/zynqmp.c
··· 1012 1012 EXPORT_SYMBOL_GPL(zynqmp_pm_set_requirement); 1013 1013 1014 1014 /** 1015 + * zynqmp_pm_load_pdi - Load and process PDI 1016 + * @src: Source device where PDI is located 1017 + * @address: PDI src address 1018 + * 1019 + * This function provides support to load PDI from linux 1020 + * 1021 + * Return: Returns status, either success or error+reason 1022 + */ 1023 + int zynqmp_pm_load_pdi(const u32 src, const u64 address) 1024 + { 1025 + return zynqmp_pm_invoke_fn(PM_LOAD_PDI, src, 1026 + lower_32_bits(address), 1027 + upper_32_bits(address), 0, NULL); 1028 + } 1029 + EXPORT_SYMBOL_GPL(zynqmp_pm_load_pdi); 1030 + 1031 + /** 1015 1032 * zynqmp_pm_aes - Access AES hardware to encrypt/decrypt the data using 1016 1033 * AES-GCM core. 1017 1034 * @address: Address of the AesParams structure.
+10
include/linux/firmware/xlnx-zynqmp.h
··· 52 52 #define ZYNQMP_PM_CAPABILITY_WAKEUP 0x4U 53 53 #define ZYNQMP_PM_CAPABILITY_UNUSABLE 0x8U 54 54 55 + /* Loader commands */ 56 + #define PM_LOAD_PDI 0x701 57 + #define PDI_SRC_DDR 0xF 58 + 55 59 /* 56 60 * Firmware FPGA Manager flags 57 61 * XILINX_ZYNQMP_PM_FPGA_FULL: FPGA full reconfiguration ··· 415 411 u32 *value); 416 412 int zynqmp_pm_pinctrl_set_config(const u32 pin, const u32 param, 417 413 u32 value); 414 + int zynqmp_pm_load_pdi(const u32 src, const u64 address); 418 415 #else 419 416 static inline int zynqmp_pm_get_api_version(u32 *version) 420 417 { ··· 624 619 625 620 static inline int zynqmp_pm_pinctrl_set_config(const u32 pin, const u32 param, 626 621 u32 value) 622 + { 623 + return -ENODEV; 624 + } 625 + 626 + static inline int zynqmp_pm_load_pdi(const u32 src, const u64 address) 627 627 { 628 628 return -ENODEV; 629 629 }