Lines Matching +full:zynqmp +full:- +full:gem

1 // SPDX-License-Identifier: GPL-2.0
5 * Copyright (C) 2014-2022 Xilinx, Inc.
6 * Copyright (C) 2022 - 2023, Advanced Micro Devices, Inc.
14 #include <linux/arm-smccc.h>
27 #include <linux/firmware/xlnx-zynqmp.h>
28 #include <linux/firmware/xlnx-event-manager.h>
29 #include "zynqmp-debug.h"
36 /* BOOT_PIN_CTRL- Used to control the mode pins after boot */
38 /* BOOT_PIN_CTRL_MASK- out_val[11:8], out_en[3:0] */
52 * struct zynqmp_devinfo - Structure for Zynqmp device instance
62 * struct pm_api_feature_data - PM API Feature data
80 * zynqmp_pm_ret_code() - Convert PMU-FW error codes to Linux error codes
92 return -ENOTSUPP; in zynqmp_pm_ret_code()
94 return -EOPNOTSUPP; in zynqmp_pm_ret_code()
96 return -EACCES; in zynqmp_pm_ret_code()
98 return -ECANCELED; in zynqmp_pm_ret_code()
100 return -EUSERS; in zynqmp_pm_ret_code()
106 return -EINVAL; in zynqmp_pm_ret_code()
112 return -ENODEV; in do_fw_call_fail()
122 * do_fw_call_smc() - Call system-level platform management layer (SMC)
138 return -EINVAL; in do_fw_call_smc()
160 * do_fw_call_hvc() - Call system-level platform management layer (HVC)
165 * HVC-based for communication through hypervisor
178 return -EINVAL; in do_fw_call_hvc()
209 * Feature check of APIs belonging to PM, XSEM, and TF-A are handled by calling in __do_feature_check_call()
218 * Feature check of TF-A APIs is done in the TF-A layer and it expects for in __do_feature_check_call()
229 ret = -EOPNOTSUPP; in __do_feature_check_call()
245 if (feature_data->pm_api_id == api_id) in do_feature_check_call()
246 return feature_data->feature_status; in do_feature_check_call()
252 return -ENOMEM; in do_feature_check_call()
254 feature_data->pm_api_id = api_id; in do_feature_check_call()
257 feature_data->feature_status = ret; in do_feature_check_call()
258 hash_add(pm_api_features_map, &feature_data->hentry, api_id); in do_feature_check_call()
271 * zynqmp_pm_feature() - Check whether given feature is supported or not and
291 * zynqmp_pm_is_function_supported() - Check whether given IOCTL/QUERY function
305 return -EINVAL; in zynqmp_pm_is_function_supported()
325 return -EOPNOTSUPP; in zynqmp_pm_is_function_supported()
327 return -ENODATA; in zynqmp_pm_is_function_supported()
335 * zynqmp_pm_invoke_fn() - Invoke the system-level platform management layer
337 * @pm_api_id: Requested PM-API call
339 * @num_args: Number of arguments to requested PM-API call
351 * PM_SIP_SVC - Registered ZynqMP SIP Service Call.
352 * PM_API_ID - Platform Management API ID.
368 return -EINVAL; in zynqmp_pm_invoke_fn()
400 if (ret != -EOPNOTSUPP && !ret) in zynqmp_pm_register_sgi()
408 * zynqmp_pm_get_api_version() - Get version number of PMU PM firmware
419 return -EINVAL; in zynqmp_pm_get_api_version()
434 * zynqmp_pm_get_chipid - Get silicon ID registers
447 return -EINVAL; in zynqmp_pm_get_chipid()
458 * zynqmp_pm_get_family_info() - Get family info of platform
460 * @subfamily: Returned sub-family code value
470 /* Check is family or sub-family code already received */ in zynqmp_pm_get_family_info()
492 * zynqmp_pm_get_trustzone_version() - Get secure trustzone firmware version
503 return -EINVAL; in zynqmp_pm_get_trustzone_version()
517 * get_set_conduit_method() - Choose SMC or HVC based communication
520 * Use SMC or HVC-based functions to communicate with EL2/EL3.
530 return -ENXIO; in get_set_conduit_method()
540 return -EINVAL; in get_set_conduit_method()
547 * zynqmp_pm_query_data() - Get query data from firmware
570 * zynqmp_pm_clock_enable() - Enable the clock for given id
585 * zynqmp_pm_clock_disable() - Disable the clock for given id
600 * zynqmp_pm_clock_getstate() - Get the clock state for given id
622 * zynqmp_pm_clock_setdivider() - Set the clock divider for given id
638 * zynqmp_pm_clock_getdivider() - Get the clock divider for given id
660 * zynqmp_pm_clock_setparent() - Set the clock parent for given id
675 * zynqmp_pm_clock_getparent() - Get the clock parent for given id
697 * zynqmp_pm_set_pll_frac_mode() - PM API for set PLL mode
713 * zynqmp_pm_get_pll_frac_mode() - PM API for get PLL mode
729 * zynqmp_pm_set_pll_frac_data() - PM API for setting pll fraction data
746 * zynqmp_pm_get_pll_frac_data() - PM API for getting pll fraction data
762 * zynqmp_pm_set_sd_tapdelay() - Set tap delay for the SD device
783 * Work around completely misdesigned firmware API on Xilinx ZynqMP. in zynqmp_pm_set_sd_tapdelay()
794 * Use PM_MMIO_READ/PM_MMIO_WRITE to re-implement the missing counter in zynqmp_pm_set_sd_tapdelay()
802 * zynqmp_pm_sd_dll_reset() - Reset DLL logic
818 * zynqmp_pm_ospi_mux_select() - OSPI Mux selection
834 * zynqmp_pm_write_ggs() - PM API for writing global general storage (ggs)
849 * zynqmp_pm_read_ggs() - PM API for reading global general storage (ggs)
864 * zynqmp_pm_write_pggs() - PM API for writing persistent global general
880 * zynqmp_pm_read_pggs() - PM API for reading persistent global general
902 * zynqmp_pm_set_boot_health_status() - PM API for setting healthy boot status
916 * zynqmp_pm_reset_assert - Request setting of reset (1 - assert, 0 - release)
931 * zynqmp_pm_reset_get_status - Get status of the reset
943 return -EINVAL; in zynqmp_pm_reset_get_status()
953 * zynqmp_pm_fpga_load - Perform the fpga load
957 * -XILINX_ZYNQMP_PM_FPGA_FULL: FPGA full reconfiguration
958 * -XILINX_ZYNQMP_PM_FPGA_PARTIAL: FPGA partial reconfiguration
973 return -ret_payload[0]; in zynqmp_pm_fpga_load()
980 * zynqmp_pm_fpga_get_status - Read value from PCAP status register
994 return -EINVAL; in zynqmp_pm_fpga_get_status()
1004 * zynqmp_pm_fpga_get_config_status - Get the FPGA configuration status.
1019 return -EINVAL; in zynqmp_pm_fpga_get_config_status()
1035 * zynqmp_pm_pinctrl_request - Request Pin from firmware
1049 * zynqmp_pm_pinctrl_release - Inform firmware that Pin control is released
1063 * zynqmp_pm_pinctrl_set_function - Set requested function for the pin
1078 * zynqmp_pm_pinctrl_get_config - Get configuration parameter for the pin
1094 return -EINVAL; in zynqmp_pm_pinctrl_get_config()
1104 * zynqmp_pm_pinctrl_set_config - Set configuration parameter for the pin
1122 return -EOPNOTSUPP; in zynqmp_pm_pinctrl_set_config()
1130 * zynqmp_pm_bootmode_read() - PM Config API for read bootpin status
1152 * zynqmp_pm_bootmode_write() - PM Config API for Configure bootpin
1168 * zynqmp_pm_init_finalize() - PM call to inform firmware that the caller
1183 * zynqmp_pm_set_suspend_mode() - Set system suspend mode
1197 * zynqmp_pm_request_node() - Request a node with specific capabilities
1216 * zynqmp_pm_release_node() - Release a node
1221 * without re-request.
1232 * zynqmp_pm_get_rpu_mode() - Get RPU mode
1257 * zynqmp_pm_set_rpu_mode() - Set RPU mode
1274 * zynqmp_pm_set_tcm_config - configure TCM
1291 * zynqmp_pm_force_pwrdwn - PM call to request for another PU or subsystem to
1306 * zynqmp_pm_request_wake - PM call to wake up selected master or subsystem
1326 * zynqmp_pm_set_requirement() - PM call to set requirement for PM slaves
1346 * zynqmp_pm_load_pdi - Load and process PDI
1362 * zynqmp_pm_aes_engine - Access AES hardware to encrypt/decrypt the data using
1363 * AES-GCM core.
1375 return -EINVAL; in zynqmp_pm_aes_engine()
1386 * zynqmp_pm_efuse_access - Provides access to efuse memory.
1398 return -EINVAL; in zynqmp_pm_efuse_access()
1410 * zynqmp_pm_sha_hash - Access the SHA engine to calculate the hash
1415 * BIT(0) - for initializing csudma driver and SHA3(Here address
1417 * BIT(1) - to call Sha3_Update API which can be called multiple
1419 * BIT(2) - to get final hash of the whole updated data.
1435 * zynqmp_pm_register_notifier() - PM API for register a subsystem
1443 * This function is used to register/un-register for particular node-event
1457 * zynqmp_pm_system_shutdown - PM call to request a system shutdown or restart
1469 * zynqmp_pm_set_feature_config - PM call to request IOCTL for feature config
1481 * zynqmp_pm_get_feature_config - PM call to get value of configured feature
1494 * zynqmp_pm_set_sd_config - PM call to set value of SD config registers
1508 * zynqmp_pm_set_gem_config - PM call to set value of GEM config registers
1509 * @node: GEM node ID
1510 * @config: The config type of GEM registers
1523 * struct zynqmp_pm_shutdown_scope - Struct for shutdown scope
1553 * zynqmp_pm_is_shutdown_scope_valid - Check if shutdown scope string is valid
1602 return -EINVAL; in shutdown_scope_store()
1605 scope->subtype); in shutdown_scope_store()
1665 return -EINVAL; in ggs_store()
1669 count = -EFAULT; in ggs_store()
1675 count = -EFAULT; in ggs_store()
1733 return -EINVAL; in pggs_store()
1737 count = -EFAULT; in pggs_store()
1743 count = -EFAULT; in pggs_store()
1796 return sysfs_emit(buf, "%d\n", devinfo->feature_conf_id); in feature_config_id_show()
1808 return -EINVAL; in feature_config_id_store()
1814 devinfo->feature_conf_id = config_id; in feature_config_id_store()
1829 ret = zynqmp_pm_get_feature_config(devinfo->feature_conf_id, in feature_config_value_show()
1846 return -EINVAL; in feature_config_value_store()
1852 ret = zynqmp_pm_set_feature_config(devinfo->feature_conf_id, in feature_config_value_store()
1882 struct device *dev = &pdev->dev; in zynqmp_firmware_probe()
1886 ret = get_set_conduit_method(dev->of_node); in zynqmp_firmware_probe()
1896 return -ENOMEM; in zynqmp_firmware_probe()
1898 devinfo->dev = dev; in zynqmp_firmware_probe()
1908 panic("%s Platform Management API version error. Expected: v%d.%d - Found: v%d.%d\n", in zynqmp_firmware_probe()
1928 panic("%s Trustzone version error. Expected: v%d.%d - Found: v%d.%d\n", in zynqmp_firmware_probe()
1936 ret = mfd_add_devices(&pdev->dev, PLATFORM_DEVID_NONE, firmware_devs, in zynqmp_firmware_probe()
1939 dev_err(&pdev->dev, "failed to add MFD devices %d\n", ret); in zynqmp_firmware_probe()
1946 em_dev = platform_device_register_data(&pdev->dev, "xlnx_event_manager", in zynqmp_firmware_probe()
1947 -1, NULL, 0); in zynqmp_firmware_probe()
1949 dev_err_probe(&pdev->dev, PTR_ERR(em_dev), "EM register fail with error\n"); in zynqmp_firmware_probe()
1952 return of_platform_populate(dev->of_node, NULL, NULL, dev); in zynqmp_firmware_probe()
1961 mfd_remove_devices(&pdev->dev); in zynqmp_firmware_remove()
1965 hash_del(&feature_data->hentry); in zynqmp_firmware_remove()
1973 {.compatible = "xlnx,zynqmp-firmware"},
1974 {.compatible = "xlnx,versal-firmware"},