Lines Matching +full:zynqmp +full:- +full:aes
1 // SPDX-License-Identifier: GPL-2.0
5 * Copyright (C) 2014-2022 Xilinx, Inc.
13 #include <linux/arm-smccc.h>
25 #include <linux/firmware/xlnx-zynqmp.h>
26 #include <linux/firmware/xlnx-event-manager.h>
27 #include "zynqmp-debug.h"
34 /* BOOT_PIN_CTRL- Used to control the mode pins after boot */
36 /* BOOT_PIN_CTRL_MASK- out_val[11:8], out_en[3:0] */
53 * struct zynqmp_devinfo - Structure for Zynqmp device instance
63 * struct pm_api_feature_data - PM API Feature data
81 * zynqmp_pm_ret_code() - Convert PMU-FW error codes to Linux error codes
93 return -ENOTSUPP; in zynqmp_pm_ret_code()
95 return -EACCES; in zynqmp_pm_ret_code()
97 return -ECANCELED; in zynqmp_pm_ret_code()
99 return -EUSERS; in zynqmp_pm_ret_code()
104 return -EINVAL; in zynqmp_pm_ret_code()
111 return -ENODEV; in do_fw_call_fail()
121 * do_fw_call_smc() - Call system-level platform management layer (SMC)
149 * do_fw_call_hvc() - Call system-level platform management layer (HVC)
156 * HVC-based for communication through hypervisor
188 ret = -EOPNOTSUPP; in __do_feature_check_call()
204 if (feature_data->pm_api_id == api_id) in do_feature_check_call()
205 return feature_data->feature_status; in do_feature_check_call()
211 return -ENOMEM; in do_feature_check_call()
213 feature_data->pm_api_id = api_id; in do_feature_check_call()
216 feature_data->feature_status = ret; in do_feature_check_call()
217 hash_add(pm_api_features_map, &feature_data->hentry, api_id); in do_feature_check_call()
231 * zynqmp_pm_feature() - Check whether given feature is supported or not and
250 * zynqmp_pm_is_function_supported() - Check whether given IOCTL/QUERY function
264 return -EINVAL; in zynqmp_pm_is_function_supported()
284 return -EOPNOTSUPP; in zynqmp_pm_is_function_supported()
286 return -ENODATA; in zynqmp_pm_is_function_supported()
294 * zynqmp_pm_invoke_fn() - Invoke the system-level platform management layer
296 * @pm_api_id: Requested PM-API call
297 * @arg0: Argument 0 to requested PM-API call
298 * @arg1: Argument 1 to requested PM-API call
299 * @arg2: Argument 2 to requested PM-API call
300 * @arg3: Argument 3 to requested PM-API call
313 * PM_SIP_SVC - Registered ZynqMP SIP Service Call.
314 * PM_API_ID - Platform Management API ID.
358 * zynqmp_pm_get_api_version() - Get version number of PMU PM firmware
369 return -EINVAL; in zynqmp_pm_get_api_version()
384 * zynqmp_pm_get_chipid - Get silicon ID registers
397 return -EINVAL; in zynqmp_pm_get_chipid()
408 * zynqmp_pm_get_trustzone_version() - Get secure trustzone firmware version
419 return -EINVAL; in zynqmp_pm_get_trustzone_version()
434 * get_set_conduit_method() - Choose SMC or HVC based communication
437 * Use SMC or HVC-based functions to communicate with EL2/EL3.
447 return -ENXIO; in get_set_conduit_method()
457 return -EINVAL; in get_set_conduit_method()
464 * zynqmp_pm_query_data() - Get query data from firmware
487 * zynqmp_pm_clock_enable() - Enable the clock for given id
502 * zynqmp_pm_clock_disable() - Disable the clock for given id
517 * zynqmp_pm_clock_getstate() - Get the clock state for given id
540 * zynqmp_pm_clock_setdivider() - Set the clock divider for given id
557 * zynqmp_pm_clock_getdivider() - Get the clock divider for given id
580 * zynqmp_pm_clock_setrate() - Set the clock rate for given id
598 * zynqmp_pm_clock_getrate() - Get the clock rate for given id
621 * zynqmp_pm_clock_setparent() - Set the clock parent for given id
637 * zynqmp_pm_clock_getparent() - Get the clock parent for given id
660 * zynqmp_pm_set_pll_frac_mode() - PM API for set PLL mode
677 * zynqmp_pm_get_pll_frac_mode() - PM API for get PLL mode
694 * zynqmp_pm_set_pll_frac_data() - PM API for setting pll fraction data
712 * zynqmp_pm_get_pll_frac_data() - PM API for getting pll fraction data
729 * zynqmp_pm_set_sd_tapdelay() - Set tap delay for the SD device
747 * zynqmp_pm_sd_dll_reset() - Reset DLL logic
764 * zynqmp_pm_ospi_mux_select() - OSPI Mux selection
781 * zynqmp_pm_write_ggs() - PM API for writing global general storage (ggs)
797 * zynqmp_pm_read_ggs() - PM API for reading global general storage (ggs)
813 * zynqmp_pm_write_pggs() - PM API for writing persistent global general
830 * zynqmp_pm_read_pggs() - PM API for reading persistent global general
847 * zynqmp_pm_set_boot_health_status() - PM API for setting healthy boot status
862 * zynqmp_pm_reset_assert - Request setting of reset (1 - assert, 0 - release)
878 * zynqmp_pm_reset_get_status - Get status of the reset
890 return -EINVAL; in zynqmp_pm_reset_get_status()
901 * zynqmp_pm_fpga_load - Perform the fpga load
905 * -XILINX_ZYNQMP_PM_FPGA_FULL: FPGA full reconfiguration
906 * -XILINX_ZYNQMP_PM_FPGA_PARTIAL: FPGA partial reconfiguration
921 * zynqmp_pm_fpga_get_status - Read value from PCAP status register
935 return -EINVAL; in zynqmp_pm_fpga_get_status()
945 * zynqmp_pm_pinctrl_request - Request Pin from firmware
959 * zynqmp_pm_pinctrl_release - Inform firmware that Pin control is released
973 * zynqmp_pm_pinctrl_get_function - Read function id set for the given pin
987 return -EINVAL; in zynqmp_pm_pinctrl_get_function()
998 * zynqmp_pm_pinctrl_set_function - Set requested function for the pin
1014 * zynqmp_pm_pinctrl_get_config - Get configuration parameter for the pin
1030 return -EINVAL; in zynqmp_pm_pinctrl_get_config()
1041 * zynqmp_pm_pinctrl_set_config - Set configuration parameter for the pin
1059 * zynqmp_pm_bootmode_read() - PM Config API for read bootpin status
1082 * zynqmp_pm_bootmode_write() - PM Config API for Configure bootpin
1098 * zynqmp_pm_init_finalize() - PM call to inform firmware that the caller
1113 * zynqmp_pm_set_suspend_mode() - Set system suspend mode
1127 * zynqmp_pm_request_node() - Request a node with specific capabilities
1147 * zynqmp_pm_release_node() - Release a node
1152 * without re-request.
1163 * zynqmp_pm_set_requirement() - PM call to set requirement for PM slaves
1184 * zynqmp_pm_load_pdi - Load and process PDI
1201 * zynqmp_pm_aes_engine - Access AES hardware to encrypt/decrypt the data using
1202 * AES-GCM core.
1214 return -EINVAL; in zynqmp_pm_aes_engine()
1226 * zynqmp_pm_sha_hash - Access the SHA engine to calculate the hash
1231 * BIT(0) - for initializing csudma driver and SHA3(Here address
1233 * BIT(1) - to call Sha3_Update API which can be called multiple
1235 * BIT(2) - to get final hash of the whole updated data.
1252 * zynqmp_pm_register_notifier() - PM API for register a subsystem
1260 * This function is used to register/un-register for particular node-event
1275 * zynqmp_pm_system_shutdown - PM call to request a system shutdown or restart
1288 * zynqmp_pm_set_feature_config - PM call to request IOCTL for feature config
1301 * zynqmp_pm_get_feature_config - PM call to get value of configured feature
1315 * zynqmp_pm_set_sd_config - PM call to set value of SD config registers
1330 * zynqmp_pm_set_gem_config - PM call to set value of GEM config registers
1346 * struct zynqmp_pm_shutdown_scope - Struct for shutdown scope
1376 * zynqmp_pm_is_shutdown_scope_valid - Check if shutdown scope string is valid
1425 return -EINVAL; in shutdown_scope_store()
1428 scope->subtype); in shutdown_scope_store()
1488 return -EINVAL; in ggs_store()
1492 count = -EFAULT; in ggs_store()
1498 count = -EFAULT; in ggs_store()
1556 return -EINVAL; in pggs_store()
1560 count = -EFAULT; in pggs_store()
1566 count = -EFAULT; in pggs_store()
1619 return sysfs_emit(buf, "%d\n", devinfo->feature_conf_id); in feature_config_id_show()
1631 return -EINVAL; in feature_config_id_store()
1637 devinfo->feature_conf_id = config_id; in feature_config_id_store()
1652 ret = zynqmp_pm_get_feature_config(devinfo->feature_conf_id, in feature_config_value_show()
1669 return -EINVAL; in feature_config_value_store()
1675 ret = zynqmp_pm_set_feature_config(devinfo->feature_conf_id, in feature_config_value_store()
1705 struct device *dev = &pdev->dev; in zynqmp_firmware_probe()
1710 ret = get_set_conduit_method(dev->of_node); in zynqmp_firmware_probe()
1714 np = of_find_compatible_node(NULL, NULL, "xlnx,zynqmp"); in zynqmp_firmware_probe()
1733 return -ENOMEM; in zynqmp_firmware_probe()
1735 devinfo->dev = dev; in zynqmp_firmware_probe()
1745 panic("%s Platform Management API version error. Expected: v%d.%d - Found: v%d.%d\n", in zynqmp_firmware_probe()
1760 panic("%s Trustzone version error. Expected: v%d.%d - Found: v%d.%d\n", in zynqmp_firmware_probe()
1768 ret = mfd_add_devices(&pdev->dev, PLATFORM_DEVID_NONE, firmware_devs, in zynqmp_firmware_probe()
1771 dev_err(&pdev->dev, "failed to add MFD devices %d\n", ret); in zynqmp_firmware_probe()
1779 em_dev = platform_device_register_data(&pdev->dev, "xlnx_event_manager", in zynqmp_firmware_probe()
1780 -1, NULL, 0); in zynqmp_firmware_probe()
1782 dev_err_probe(&pdev->dev, PTR_ERR(em_dev), "EM register fail with error\n"); in zynqmp_firmware_probe()
1786 return of_platform_populate(dev->of_node, NULL, NULL, dev); in zynqmp_firmware_probe()
1795 mfd_remove_devices(&pdev->dev); in zynqmp_firmware_remove()
1799 hash_del(&feature_data->hentry); in zynqmp_firmware_remove()
1809 {.compatible = "xlnx,zynqmp-firmware"},
1810 {.compatible = "xlnx,versal-firmware"},