1 // SPDX-License-Identifier: GPL-2.0
3 * Xilinx Zynq MPSoC Firmware layer
5 * Copyright (C) 2014-2018 Xilinx, Inc.
7 * Michal Simek <michal.simek@xilinx.com>
8 * Davorin Mista <davorin.mista@aggios.com>
9 * Jolly Shah <jollys@xilinx.com>
10 * Rajan Vaja <rajanv@xilinx.com>
13 #include <linux/arm-smccc.h>
14 #include <linux/compiler.h>
15 #include <linux/device.h>
16 #include <linux/init.h>
17 #include <linux/mfd/core.h>
18 #include <linux/module.h>
20 #include <linux/of_platform.h>
21 #include <linux/slab.h>
22 #include <linux/uaccess.h>
24 #include <linux/firmware/xlnx-zynqmp.h>
25 #include "zynqmp-debug.h"
27 static unsigned long register_address;
29 static const struct zynqmp_eemi_ops *eemi_ops_tbl;
31 static bool feature_check_enabled;
32 static u32 zynqmp_pm_features[PM_API_MAX];
34 static const struct mfd_cell firmware_devs[] = {
36 .name = "zynqmp_power_controller",
41 * zynqmp_pm_ret_code() - Convert PMU-FW error codes to Linux error codes
42 * @ret_status: PMUFW return code
44 * Return: corresponding Linux error code
46 static int zynqmp_pm_ret_code(u32 ret_status)
50 case XST_PM_DOUBLE_REQ:
52 case XST_PM_NO_FEATURE:
54 case XST_PM_NO_ACCESS:
56 case XST_PM_ABORT_SUSPEND:
60 case XST_PM_INVALID_NODE:
66 static noinline int do_fw_call_fail(u64 arg0, u64 arg1, u64 arg2,
73 * PM function call wrapper
74 * Invoke do_fw_call_smc or do_fw_call_hvc, depending on the configuration
76 static int (*do_fw_call)(u64, u64, u64, u32 *ret_payload) = do_fw_call_fail;
79 * do_fw_call_smc() - Call system-level platform management layer (SMC)
80 * @arg0: Argument 0 to SMC call
81 * @arg1: Argument 1 to SMC call
82 * @arg2: Argument 2 to SMC call
83 * @ret_payload: Returned value array
85 * Invoke platform management function via SMC call (no hypervisor present).
87 * Return: Returns status, either success or error+reason
89 static noinline int do_fw_call_smc(u64 arg0, u64 arg1, u64 arg2,
92 struct arm_smccc_res res;
94 arm_smccc_smc(arg0, arg1, arg2, 0, 0, 0, 0, 0, &res);
97 ret_payload[0] = lower_32_bits(res.a0);
98 ret_payload[1] = upper_32_bits(res.a0);
99 ret_payload[2] = lower_32_bits(res.a1);
100 ret_payload[3] = upper_32_bits(res.a1);
103 return zynqmp_pm_ret_code((enum pm_ret_status)res.a0);
107 * do_fw_call_hvc() - Call system-level platform management layer (HVC)
108 * @arg0: Argument 0 to HVC call
109 * @arg1: Argument 1 to HVC call
110 * @arg2: Argument 2 to HVC call
111 * @ret_payload: Returned value array
113 * Invoke platform management function via HVC
114 * HVC-based for communication through hypervisor
115 * (no direct communication with ATF).
117 * Return: Returns status, either success or error+reason
119 static noinline int do_fw_call_hvc(u64 arg0, u64 arg1, u64 arg2,
122 struct arm_smccc_res res;
124 arm_smccc_hvc(arg0, arg1, arg2, 0, 0, 0, 0, 0, &res);
127 ret_payload[0] = lower_32_bits(res.a0);
128 ret_payload[1] = upper_32_bits(res.a0);
129 ret_payload[2] = lower_32_bits(res.a1);
130 ret_payload[3] = upper_32_bits(res.a1);
133 return zynqmp_pm_ret_code((enum pm_ret_status)res.a0);
137 * zynqmp_pm_feature() - Check weather given feature is supported or not
138 * @api_id: API ID to check
140 * Return: Returns status, either success or error+reason
142 static int zynqmp_pm_feature(u32 api_id)
145 u32 ret_payload[PAYLOAD_ARG_CNT];
148 if (!feature_check_enabled)
151 /* Return value if feature is already checked */
152 if (zynqmp_pm_features[api_id] != PM_FEATURE_UNCHECKED)
153 return zynqmp_pm_features[api_id];
155 smc_arg[0] = PM_SIP_SVC | PM_FEATURE_CHECK;
158 ret = do_fw_call(smc_arg[0], smc_arg[1], 0, ret_payload);
160 zynqmp_pm_features[api_id] = PM_FEATURE_INVALID;
161 return PM_FEATURE_INVALID;
164 zynqmp_pm_features[api_id] = ret_payload[1];
166 return zynqmp_pm_features[api_id];
170 * zynqmp_pm_invoke_fn() - Invoke the system-level platform management layer
171 * caller function depending on the configuration
172 * @pm_api_id: Requested PM-API call
173 * @arg0: Argument 0 to requested PM-API call
174 * @arg1: Argument 1 to requested PM-API call
175 * @arg2: Argument 2 to requested PM-API call
176 * @arg3: Argument 3 to requested PM-API call
177 * @ret_payload: Returned value array
179 * Invoke platform management function for SMC or HVC call, depending on
181 * Following SMC Calling Convention (SMCCC) for SMC64:
182 * Pm Function Identifier,
183 * PM_SIP_SVC + PM_API_ID =
184 * ((SMC_TYPE_FAST << FUNCID_TYPE_SHIFT)
185 * ((SMC_64) << FUNCID_CC_SHIFT)
186 * ((SIP_START) << FUNCID_OEN_SHIFT)
187 * ((PM_API_ID) & FUNCID_NUM_MASK))
189 * PM_SIP_SVC - Registered ZynqMP SIP Service Call.
190 * PM_API_ID - Platform Management API ID.
192 * Return: Returns status, either success or error+reason
194 int zynqmp_pm_invoke_fn(u32 pm_api_id, u32 arg0, u32 arg1,
195 u32 arg2, u32 arg3, u32 *ret_payload)
198 * Added SIP service call Function Identifier
199 * Make sure to stay in x0 register
203 if (zynqmp_pm_feature(pm_api_id) == PM_FEATURE_INVALID)
206 smc_arg[0] = PM_SIP_SVC | pm_api_id;
207 smc_arg[1] = ((u64)arg1 << 32) | arg0;
208 smc_arg[2] = ((u64)arg3 << 32) | arg2;
210 return do_fw_call(smc_arg[0], smc_arg[1], smc_arg[2], ret_payload);
213 static u32 pm_api_version;
214 static u32 pm_tz_version;
217 * zynqmp_pm_get_api_version() - Get version number of PMU PM firmware
218 * @version: Returned version value
220 * Return: Returns status, either success or error+reason
222 static int zynqmp_pm_get_api_version(u32 *version)
224 u32 ret_payload[PAYLOAD_ARG_CNT];
230 /* Check is PM API version already verified */
231 if (pm_api_version > 0) {
232 *version = pm_api_version;
235 ret = zynqmp_pm_invoke_fn(PM_GET_API_VERSION, 0, 0, 0, 0, ret_payload);
236 *version = ret_payload[1];
242 * zynqmp_pm_get_chipid - Get silicon ID registers
243 * @idcode: IDCODE register
244 * @version: version register
246 * Return: Returns the status of the operation and the idcode and version
247 * registers in @idcode and @version.
249 static int zynqmp_pm_get_chipid(u32 *idcode, u32 *version)
251 u32 ret_payload[PAYLOAD_ARG_CNT];
254 if (!idcode || !version)
257 ret = zynqmp_pm_invoke_fn(PM_GET_CHIPID, 0, 0, 0, 0, ret_payload);
258 *idcode = ret_payload[1];
259 *version = ret_payload[2];
265 * zynqmp_pm_get_trustzone_version() - Get secure trustzone firmware version
266 * @version: Returned version value
268 * Return: Returns status, either success or error+reason
270 static int zynqmp_pm_get_trustzone_version(u32 *version)
272 u32 ret_payload[PAYLOAD_ARG_CNT];
278 /* Check is PM trustzone version already verified */
279 if (pm_tz_version > 0) {
280 *version = pm_tz_version;
283 ret = zynqmp_pm_invoke_fn(PM_GET_TRUSTZONE_VERSION, 0, 0,
285 *version = ret_payload[1];
291 * get_set_conduit_method() - Choose SMC or HVC based communication
292 * @np: Pointer to the device_node structure
294 * Use SMC or HVC-based functions to communicate with EL2/EL3.
296 * Return: Returns 0 on success or error code
298 static int get_set_conduit_method(struct device_node *np)
302 if (of_property_read_string(np, "method", &method)) {
303 pr_warn("%s missing \"method\" property\n", __func__);
307 if (!strcmp("hvc", method)) {
308 do_fw_call = do_fw_call_hvc;
309 } else if (!strcmp("smc", method)) {
310 do_fw_call = do_fw_call_smc;
312 pr_warn("%s Invalid \"method\" property: %s\n",
321 * zynqmp_pm_query_data() - Get query data from firmware
322 * @qdata: Variable to the zynqmp_pm_query_data structure
323 * @out: Returned output value
325 * Return: Returns status, either success or error+reason
327 static int zynqmp_pm_query_data(struct zynqmp_pm_query_data qdata, u32 *out)
331 ret = zynqmp_pm_invoke_fn(PM_QUERY_DATA, qdata.qid, qdata.arg1,
332 qdata.arg2, qdata.arg3, out);
335 * For clock name query, all bytes in SMC response are clock name
336 * characters and return code is always success. For invalid clocks,
337 * clock name bytes would be zeros.
339 return qdata.qid == PM_QID_CLOCK_GET_NAME ? 0 : ret;
343 * zynqmp_pm_clock_enable() - Enable the clock for given id
344 * @clock_id: ID of the clock to be enabled
346 * This function is used by master to enable the clock
347 * including peripherals and PLL clocks.
349 * Return: Returns status, either success or error+reason
351 static int zynqmp_pm_clock_enable(u32 clock_id)
353 return zynqmp_pm_invoke_fn(PM_CLOCK_ENABLE, clock_id, 0, 0, 0, NULL);
357 * zynqmp_pm_clock_disable() - Disable the clock for given id
358 * @clock_id: ID of the clock to be disable
360 * This function is used by master to disable the clock
361 * including peripherals and PLL clocks.
363 * Return: Returns status, either success or error+reason
365 static int zynqmp_pm_clock_disable(u32 clock_id)
367 return zynqmp_pm_invoke_fn(PM_CLOCK_DISABLE, clock_id, 0, 0, 0, NULL);
371 * zynqmp_pm_clock_getstate() - Get the clock state for given id
372 * @clock_id: ID of the clock to be queried
373 * @state: 1/0 (Enabled/Disabled)
375 * This function is used by master to get the state of clock
376 * including peripherals and PLL clocks.
378 * Return: Returns status, either success or error+reason
380 static int zynqmp_pm_clock_getstate(u32 clock_id, u32 *state)
382 u32 ret_payload[PAYLOAD_ARG_CNT];
385 ret = zynqmp_pm_invoke_fn(PM_CLOCK_GETSTATE, clock_id, 0,
387 *state = ret_payload[1];
393 * zynqmp_pm_clock_setdivider() - Set the clock divider for given id
394 * @clock_id: ID of the clock
395 * @divider: divider value
397 * This function is used by master to set divider for any clock
398 * to achieve desired rate.
400 * Return: Returns status, either success or error+reason
402 static int zynqmp_pm_clock_setdivider(u32 clock_id, u32 divider)
404 return zynqmp_pm_invoke_fn(PM_CLOCK_SETDIVIDER, clock_id, divider,
409 * zynqmp_pm_clock_getdivider() - Get the clock divider for given id
410 * @clock_id: ID of the clock
411 * @divider: divider value
413 * This function is used by master to get divider values
416 * Return: Returns status, either success or error+reason
418 static int zynqmp_pm_clock_getdivider(u32 clock_id, u32 *divider)
420 u32 ret_payload[PAYLOAD_ARG_CNT];
423 ret = zynqmp_pm_invoke_fn(PM_CLOCK_GETDIVIDER, clock_id, 0,
425 *divider = ret_payload[1];
431 * zynqmp_pm_clock_setrate() - Set the clock rate for given id
432 * @clock_id: ID of the clock
433 * @rate: rate value in hz
435 * This function is used by master to set rate for any clock.
437 * Return: Returns status, either success or error+reason
439 static int zynqmp_pm_clock_setrate(u32 clock_id, u64 rate)
441 return zynqmp_pm_invoke_fn(PM_CLOCK_SETRATE, clock_id,
448 * zynqmp_pm_clock_getrate() - Get the clock rate for given id
449 * @clock_id: ID of the clock
450 * @rate: rate value in hz
452 * This function is used by master to get rate
455 * Return: Returns status, either success or error+reason
457 static int zynqmp_pm_clock_getrate(u32 clock_id, u64 *rate)
459 u32 ret_payload[PAYLOAD_ARG_CNT];
462 ret = zynqmp_pm_invoke_fn(PM_CLOCK_GETRATE, clock_id, 0,
464 *rate = ((u64)ret_payload[2] << 32) | ret_payload[1];
470 * zynqmp_pm_clock_setparent() - Set the clock parent for given id
471 * @clock_id: ID of the clock
472 * @parent_id: parent id
474 * This function is used by master to set parent for any clock.
476 * Return: Returns status, either success or error+reason
478 static int zynqmp_pm_clock_setparent(u32 clock_id, u32 parent_id)
480 return zynqmp_pm_invoke_fn(PM_CLOCK_SETPARENT, clock_id,
481 parent_id, 0, 0, NULL);
485 * zynqmp_pm_clock_getparent() - Get the clock parent for given id
486 * @clock_id: ID of the clock
487 * @parent_id: parent id
489 * This function is used by master to get parent index
492 * Return: Returns status, either success or error+reason
494 static int zynqmp_pm_clock_getparent(u32 clock_id, u32 *parent_id)
496 u32 ret_payload[PAYLOAD_ARG_CNT];
499 ret = zynqmp_pm_invoke_fn(PM_CLOCK_GETPARENT, clock_id, 0,
501 *parent_id = ret_payload[1];
507 * zynqmp_is_valid_ioctl() - Check whether IOCTL ID is valid or not
508 * @ioctl_id: IOCTL ID
510 * Return: 1 if IOCTL is valid else 0
512 static inline int zynqmp_is_valid_ioctl(u32 ioctl_id)
515 case IOCTL_SET_PLL_FRAC_MODE:
516 case IOCTL_GET_PLL_FRAC_MODE:
517 case IOCTL_SET_PLL_FRAC_DATA:
518 case IOCTL_GET_PLL_FRAC_DATA:
519 case IOCTL_GET_RPU_OPER_MODE:
520 case IOCTL_SET_RPU_OPER_MODE:
521 case IOCTL_RPU_BOOT_ADDR_CONFIG:
522 case IOCTL_TCM_COMB_CONFIG:
523 case IOCTL_SET_TAPDELAY_BYPASS:
524 case IOCTL_SET_SGMII_MODE:
525 case IOCTL_SD_DLL_RESET:
526 case IOCTL_SET_SD_TAPDELAY:
527 case IOCTL_WRITE_GGS:
529 case IOCTL_WRITE_PGGS:
530 case IOCTL_READ_PGGS:
531 case IOCTL_ULPI_RESET:
532 case IOCTL_SET_BOOT_HEALTH_STATUS:
541 * zynqmp_pm_ioctl() - PM IOCTL API for device control and configs
542 * @node_id: Node ID of the device
543 * @ioctl_id: ID of the requested IOCTL
544 * @arg1: Argument 1 to requested IOCTL call
545 * @arg2: Argument 2 to requested IOCTL call
546 * @out: Returned output value
548 * This function calls IOCTL to firmware for device control and configuration.
550 * Return: Returns status, either success or error+reason
552 static int zynqmp_pm_ioctl(u32 node_id, u32 ioctl_id, u32 arg1, u32 arg2,
555 if (!zynqmp_is_valid_ioctl(ioctl_id))
558 return zynqmp_pm_invoke_fn(PM_IOCTL, node_id, ioctl_id,
563 * zynqmp_pm_reset_assert - Request setting of reset (1 - assert, 0 - release)
564 * @reset: Reset to be configured
565 * @assert_flag: Flag stating should reset be asserted (1) or
568 * Return: Returns status, either success or error+reason
570 static int zynqmp_pm_reset_assert(const enum zynqmp_pm_reset reset,
571 const enum zynqmp_pm_reset_action assert_flag)
573 return zynqmp_pm_invoke_fn(PM_RESET_ASSERT, reset, assert_flag,
578 * zynqmp_pm_reset_get_status - Get status of the reset
579 * @reset: Reset whose status should be returned
580 * @status: Returned status
582 * Return: Returns status, either success or error+reason
584 static int zynqmp_pm_reset_get_status(const enum zynqmp_pm_reset reset,
587 u32 ret_payload[PAYLOAD_ARG_CNT];
593 ret = zynqmp_pm_invoke_fn(PM_RESET_GET_STATUS, reset, 0,
595 *status = ret_payload[1];
601 * zynqmp_pm_init_finalize() - PM call to inform firmware that the caller
602 * master has initialized its own power management
604 * This API function is to be used for notify the power management controller
605 * about the completed power management initialization.
607 * Return: Returns status, either success or error+reason
609 static int zynqmp_pm_init_finalize(void)
611 return zynqmp_pm_invoke_fn(PM_PM_INIT_FINALIZE, 0, 0, 0, 0, NULL);
615 * zynqmp_pm_set_suspend_mode() - Set system suspend mode
616 * @mode: Mode to set for system suspend
618 * This API function is used to set mode of system suspend.
620 * Return: Returns status, either success or error+reason
622 static int zynqmp_pm_set_suspend_mode(u32 mode)
624 return zynqmp_pm_invoke_fn(PM_SET_SUSPEND_MODE, mode, 0, 0, 0, NULL);
628 * zynqmp_pm_request_node() - Request a node with specific capabilities
629 * @node: Node ID of the slave
630 * @capabilities: Requested capabilities of the slave
631 * @qos: Quality of service (not supported)
632 * @ack: Flag to specify whether acknowledge is requested
634 * This function is used by master to request particular node from firmware.
635 * Every master must request node before using it.
637 * Return: Returns status, either success or error+reason
639 static int zynqmp_pm_request_node(const u32 node, const u32 capabilities,
641 const enum zynqmp_pm_request_ack ack)
643 return zynqmp_pm_invoke_fn(PM_REQUEST_NODE, node, capabilities,
648 * zynqmp_pm_release_node() - Release a node
649 * @node: Node ID of the slave
651 * This function is used by master to inform firmware that master
652 * has released node. Once released, master must not use that node
653 * without re-request.
655 * Return: Returns status, either success or error+reason
657 static int zynqmp_pm_release_node(const u32 node)
659 return zynqmp_pm_invoke_fn(PM_RELEASE_NODE, node, 0, 0, 0, NULL);
663 * zynqmp_pm_set_requirement() - PM call to set requirement for PM slaves
664 * @node: Node ID of the slave
665 * @capabilities: Requested capabilities of the slave
666 * @qos: Quality of service (not supported)
667 * @ack: Flag to specify whether acknowledge is requested
669 * This API function is to be used for slaves a PU already has requested
670 * to change its capabilities.
672 * Return: Returns status, either success or error+reason
674 static int zynqmp_pm_set_requirement(const u32 node, const u32 capabilities,
676 const enum zynqmp_pm_request_ack ack)
678 return zynqmp_pm_invoke_fn(PM_SET_REQUIREMENT, node, capabilities,
683 * zynqmp_pm_load_pdi - Load and process pdi
684 * @src: Source device where PDI is located
685 * @address: Pdi src address
687 * This function provides support to load pdi from linux
689 * Return: Returns status, either success or error+reason
691 static int zynqmp_pm_load_pdi(const u32 src, const u64 address)
693 return zynqmp_pm_invoke_fn(PM_LOAD_PDI, src,
694 lower_32_bits(address),
695 upper_32_bits(address), 0, NULL);
699 * zynqmp_pm_fpga_load - Perform the fpga load
700 * @address: Address to write to
701 * @size: pl bitstream size
703 * BIT(0) - Bitstream type.
704 * 0 - Full Bitstream.
705 * 1 - Partial Bitstream.
706 * BIT(1) - Authentication.
709 * BIT(2) - Encryption.
713 * The current implementation supports only Full Bit-stream.
715 * This function provides access to xilfpga library to transfer
716 * the required bitstream into PL.
718 * Return: Returns status, either success or error+reason
720 static int zynqmp_pm_fpga_load(const u64 address, const u32 size,
723 return zynqmp_pm_invoke_fn(PM_FPGA_LOAD, (u32)address,
724 ((u32)(address >> 32)), size, flags, NULL);
728 * zynqmp_pm_fpga_get_status - Read value from PCAP status register
729 * @value: Value to read
731 * This function provides access to the xilfpga library to get
734 * Return: Returns status, either success or error+reason
736 static int zynqmp_pm_fpga_get_status(u32 *value)
738 u32 ret_payload[PAYLOAD_ARG_CNT];
744 ret = zynqmp_pm_invoke_fn(PM_FPGA_GET_STATUS, 0, 0, 0, 0, ret_payload);
745 *value = ret_payload[1];
751 * zynqmp_pm_fpga_read - Perform the fpga configuration readback
752 * @reg_numframes: Configuration register offset (or) Number of frames to read
753 * @phys_address: Physical Address of the buffer
754 * @readback_type: Type of fpga readback operation
755 * @value: Value to read
757 * This function provides access to xilfpga library to perform
758 * fpga configuration readback.
760 * Return: Returns status, either success or error+reason
762 static int zynqmp_pm_fpga_read(const u32 reg_numframes, const u64 phys_address,
763 u32 readback_type, u32 *value)
765 u32 ret_payload[PAYLOAD_ARG_CNT];
771 ret = zynqmp_pm_invoke_fn(PM_FPGA_READ, reg_numframes,
772 lower_32_bits(phys_address),
773 upper_32_bits(phys_address), readback_type,
775 *value = ret_payload[1];
781 * zynqmp_pm_sha_hash - Access the SHA engine to calculate the hash
782 * @address: Address of the data/ Address of output buffer where
783 * hash should be stored.
784 * @size: Size of the data.
786 * BIT(0) - for initializing csudma driver and SHA3(Here address
787 * and size inputs can be NULL).
788 * BIT(1) - to call Sha3_Update API which can be called multiple
789 * times when data is not contiguous.
790 * BIT(2) - to get final hash of the whole updated data.
791 * Hash will be overwritten at provided address with
794 * Return: Returns status, either success or error code.
796 static int zynqmp_pm_sha_hash(const u64 address, const u32 size,
799 u32 lower_32_bits = (u32)address;
800 u32 upper_32_bits = (u32)(address >> 32);
802 return zynqmp_pm_invoke_fn(PM_SECURE_SHA, upper_32_bits, lower_32_bits,
807 * zynqmp_pm_rsa - Access RSA hardware to encrypt/decrypt the data with RSA.
808 * @address: Address of the data
809 * @size: Size of the data.
811 * BIT(0) - Encryption/Decryption
812 * 0 - RSA decryption with private key
813 * 1 - RSA encryption with public key.
815 * Return: Returns status, either success or error code.
817 static int zynqmp_pm_rsa(const u64 address, const u32 size, const u32 flags)
819 u32 lower_32_bits = (u32)address;
820 u32 upper_32_bits = (u32)(address >> 32);
822 return zynqmp_pm_invoke_fn(PM_SECURE_RSA, upper_32_bits, lower_32_bits,
827 * zynqmp_pm_aes - Access AES hardware to encrypt/decrypt the data using
829 * @address: Address of the AesParams structure.
830 * @out: Returned output value
832 * Return: Returns status, either success or error code.
834 static int zynqmp_pm_aes_engine(const u64 address, u32 *out)
836 u32 ret_payload[PAYLOAD_ARG_CNT];
842 ret = zynqmp_pm_invoke_fn(PM_SECURE_AES, upper_32_bits(address),
843 lower_32_bits(address),
845 *out = ret_payload[1];
850 * zynqmp_pm_request_suspend - PM call to request for another PU or subsystem to
851 * be suspended gracefully.
852 * @node: Node ID of the targeted PU or subsystem
853 * @ack: Flag to specify whether acknowledge is requested
854 * @latency: Requested wakeup latency (not supported)
855 * @state: Requested state (not supported)
857 * Return: Returns status, either success or error+reason
859 static int zynqmp_pm_request_suspend(const u32 node,
860 const enum zynqmp_pm_request_ack ack,
864 return zynqmp_pm_invoke_fn(PM_REQUEST_SUSPEND, node, ack,
865 latency, state, NULL);
869 * zynqmp_pm_force_powerdown - PM call to request for another PU or subsystem to
870 * be powered down forcefully
871 * @target: Node ID of the targeted PU or subsystem
872 * @ack: Flag to specify whether acknowledge is requested
874 * Return: Returns status, either success or error+reason
876 static int zynqmp_pm_force_powerdown(const u32 target,
877 const enum zynqmp_pm_request_ack ack)
879 return zynqmp_pm_invoke_fn(PM_FORCE_POWERDOWN, target, ack, 0, 0, NULL);
883 * zynqmp_pm_request_wakeup - PM call to wake up selected master or subsystem
884 * @node: Node ID of the master or subsystem
885 * @set_addr: Specifies whether the address argument is relevant
886 * @address: Address from which to resume when woken up
887 * @ack: Flag to specify whether acknowledge requested
889 * Return: Returns status, either success or error+reason
891 static int zynqmp_pm_request_wakeup(const u32 node,
894 const enum zynqmp_pm_request_ack ack)
896 /* set_addr flag is encoded into 1st bit of address */
897 return zynqmp_pm_invoke_fn(PM_REQUEST_WAKEUP, node, address | set_addr,
898 address >> 32, ack, NULL);
902 * zynqmp_pm_set_wakeup_source - PM call to specify the wakeup source
904 * @target: Node ID of the targeted PU or subsystem
905 * @wakeup_node:Node ID of the wakeup peripheral
906 * @enable: Enable or disable the specified peripheral as wake source
908 * Return: Returns status, either success or error+reason
910 static int zynqmp_pm_set_wakeup_source(const u32 target,
911 const u32 wakeup_node,
914 return zynqmp_pm_invoke_fn(PM_SET_WAKEUP_SOURCE, target,
915 wakeup_node, enable, 0, NULL);
919 * zynqmp_pm_system_shutdown - PM call to request a system shutdown or restart
920 * @type: Shutdown or restart? 0 for shutdown, 1 for restart
921 * @subtype: Specifies which system should be restarted or shut down
923 * Return: Returns status, either success or error+reason
925 static int zynqmp_pm_system_shutdown(const u32 type, const u32 subtype)
927 return zynqmp_pm_invoke_fn(PM_SYSTEM_SHUTDOWN, type, subtype,
932 * zynqmp_pm_set_max_latency - PM call to set wakeup latency requirements
933 * @node: Node ID of the slave
934 * @latency: Requested maximum wakeup latency
936 * Return: Returns status, either success or error+reason
938 static int zynqmp_pm_set_max_latency(const u32 node, const u32 latency)
940 return zynqmp_pm_invoke_fn(PM_SET_MAX_LATENCY, node, latency,
945 * zynqmp_pm_set_configuration - PM call to set system configuration
946 * @physical_addr: Physical 32-bit address of data structure in memory
948 * Return: Returns status, either success or error+reason
950 static int zynqmp_pm_set_configuration(const u32 physical_addr)
952 return zynqmp_pm_invoke_fn(PM_SET_CONFIGURATION, physical_addr, 0,
957 * zynqmp_pm_get_node_status - PM call to request a node's current power state
958 * @node: ID of the component or sub-system in question
959 * @status: Current operating state of the requested node
960 * @requirements: Current requirements asserted on the node,
961 * used for slave nodes only.
962 * @usage: Usage information, used for slave nodes only:
963 * PM_USAGE_NO_MASTER - No master is currently using
965 * PM_USAGE_CURRENT_MASTER - Only requesting master is
966 * currently using the node
967 * PM_USAGE_OTHER_MASTER - Only other masters are
968 * currently using the node
969 * PM_USAGE_BOTH_MASTERS - Both the current and at least
970 * one other master is currently
973 * Return: Returns status, either success or error+reason
975 static int zynqmp_pm_get_node_status(const u32 node, u32 *const status,
976 u32 *const requirements, u32 *const usage)
978 u32 ret_payload[PAYLOAD_ARG_CNT];
984 ret = zynqmp_pm_invoke_fn(PM_GET_NODE_STATUS, node, 0, 0,
986 if (ret_payload[0] == XST_PM_SUCCESS) {
987 *status = ret_payload[1];
989 *requirements = ret_payload[2];
991 *usage = ret_payload[3];
998 * zynqmp_pm_get_operating_characteristic - PM call to request operating
999 * characteristic information
1000 * @node: Node ID of the slave
1001 * @type: Type of the operating characteristic requested
1002 * @result: Used to return the requsted operating characteristic
1004 * Return: Returns status, either success or error+reason
1006 static int zynqmp_pm_get_operating_characteristic(const u32 node,
1007 const enum zynqmp_pm_opchar_type type,
1010 u32 ret_payload[PAYLOAD_ARG_CNT];
1016 ret = zynqmp_pm_invoke_fn(PM_GET_OPERATING_CHARACTERISTIC,
1017 node, type, 0, 0, ret_payload);
1018 if (ret_payload[0] == XST_PM_SUCCESS)
1019 *result = ret_payload[1];
1025 * zynqmp_pm_pinctrl_request - Request Pin from firmware
1026 * @pin: Pin number to request
1028 * This function requests pin from firmware.
1030 * Return: Returns status, either success or error+reason.
1032 static int zynqmp_pm_pinctrl_request(const u32 pin)
1034 return zynqmp_pm_invoke_fn(PM_PINCTRL_REQUEST, pin, 0, 0, 0, NULL);
1038 * zynqmp_pm_pinctrl_release - Inform firmware that Pin control is released
1039 * @pin: Pin number to release
1041 * This function release pin from firmware.
1043 * Return: Returns status, either success or error+reason.
1045 static int zynqmp_pm_pinctrl_release(const u32 pin)
1047 return zynqmp_pm_invoke_fn(PM_PINCTRL_RELEASE, pin, 0, 0, 0, NULL);
1051 * zynqmp_pm_pinctrl_get_function - Read function id set for the given pin
1053 * @id: Buffer to store function ID
1055 * This function provides the function currently set for the given pin.
1057 * Return: Returns status, either success or error+reason
1059 static int zynqmp_pm_pinctrl_get_function(const u32 pin, u32 *id)
1061 u32 ret_payload[PAYLOAD_ARG_CNT];
1067 ret = zynqmp_pm_invoke_fn(PM_PINCTRL_GET_FUNCTION, pin, 0,
1069 *id = ret_payload[1];
1075 * zynqmp_pm_pinctrl_set_function - Set requested function for the pin
1077 * @id: Function ID to set
1079 * This function sets requested function for the given pin.
1081 * Return: Returns status, either success or error+reason.
1083 static int zynqmp_pm_pinctrl_set_function(const u32 pin, const u32 id)
1085 return zynqmp_pm_invoke_fn(PM_PINCTRL_SET_FUNCTION, pin, id,
1090 * zynqmp_pm_pinctrl_get_config - Get configuration parameter for the pin
1092 * @param: Parameter to get
1093 * @value: Buffer to store parameter value
1095 * This function gets requested configuration parameter for the given pin.
1097 * Return: Returns status, either success or error+reason.
1099 static int zynqmp_pm_pinctrl_get_config(const u32 pin, const u32 param,
1102 u32 ret_payload[PAYLOAD_ARG_CNT];
1108 ret = zynqmp_pm_invoke_fn(PM_PINCTRL_CONFIG_PARAM_GET, pin, param,
1110 *value = ret_payload[1];
1116 * zynqmp_pm_pinctrl_set_config - Set configuration parameter for the pin
1118 * @param: Parameter to set
1119 * @value: Parameter value to set
1121 * This function sets requested configuration parameter for the given pin.
1123 * Return: Returns status, either success or error+reason.
1125 static int zynqmp_pm_pinctrl_set_config(const u32 pin, const u32 param,
1128 return zynqmp_pm_invoke_fn(PM_PINCTRL_CONFIG_PARAM_SET, pin,
1129 param, value, 0, NULL);
1133 * zynqmp_pm_config_reg_access - PM Config API for Config register access
1134 * @register_access_id: ID of the requested REGISTER_ACCESS
1135 * @address: Address of the register to be accessed
1136 * @mask: Mask to be written to the register
1137 * @value: Value to be written to the register
1138 * @out: Returned output value
1140 * This function calls REGISTER_ACCESS to configure CSU/PMU registers.
1142 * Return: Returns status, either success or error+reason
1145 static int zynqmp_pm_config_reg_access(u32 register_access_id, u32 address,
1146 u32 mask, u32 value, u32 *out)
1148 return zynqmp_pm_invoke_fn(PM_REGISTER_ACCESS, register_access_id,
1149 address, mask, value, out);
1153 * zynqmp_pm_efuse_access - Provides access to efuse memory.
1154 * @address: Address of the efuse params structure
1155 * @out: Returned output value
1157 * Return: Returns status, either success or error code.
1159 static int zynqmp_pm_efuse_access(const u64 address, u32 *out)
1161 u32 ret_payload[PAYLOAD_ARG_CNT];
1167 ret = zynqmp_pm_invoke_fn(PM_EFUSE_ACCESS, upper_32_bits(address),
1168 lower_32_bits(address), 0, 0, ret_payload);
1169 *out = ret_payload[1];
1174 static int zynqmp_pm_secure_load(const u64 src_addr, u64 key_addr, u64 *dst)
1176 u32 ret_payload[PAYLOAD_ARG_CNT];
1182 ret_value = zynqmp_pm_invoke_fn(PM_SECURE_IMAGE,
1183 lower_32_bits(src_addr),
1184 upper_32_bits(src_addr),
1185 lower_32_bits(key_addr),
1186 upper_32_bits(key_addr),
1188 *dst = ((u64)ret_payload[1] << 32) | ret_payload[2];
1193 static const struct zynqmp_eemi_ops eemi_ops = {
1194 .get_api_version = zynqmp_pm_get_api_version,
1195 .get_chipid = zynqmp_pm_get_chipid,
1196 .query_data = zynqmp_pm_query_data,
1197 .clock_enable = zynqmp_pm_clock_enable,
1198 .clock_disable = zynqmp_pm_clock_disable,
1199 .clock_getstate = zynqmp_pm_clock_getstate,
1200 .clock_setdivider = zynqmp_pm_clock_setdivider,
1201 .clock_getdivider = zynqmp_pm_clock_getdivider,
1202 .clock_setrate = zynqmp_pm_clock_setrate,
1203 .clock_getrate = zynqmp_pm_clock_getrate,
1204 .clock_setparent = zynqmp_pm_clock_setparent,
1205 .clock_getparent = zynqmp_pm_clock_getparent,
1206 .ioctl = zynqmp_pm_ioctl,
1207 .reset_assert = zynqmp_pm_reset_assert,
1208 .reset_get_status = zynqmp_pm_reset_get_status,
1209 .init_finalize = zynqmp_pm_init_finalize,
1210 .set_suspend_mode = zynqmp_pm_set_suspend_mode,
1211 .request_node = zynqmp_pm_request_node,
1212 .release_node = zynqmp_pm_release_node,
1213 .set_requirement = zynqmp_pm_set_requirement,
1214 .fpga_load = zynqmp_pm_fpga_load,
1215 .fpga_get_status = zynqmp_pm_fpga_get_status,
1216 .fpga_read = zynqmp_pm_fpga_read,
1217 .sha_hash = zynqmp_pm_sha_hash,
1218 .rsa = zynqmp_pm_rsa,
1219 .request_suspend = zynqmp_pm_request_suspend,
1220 .force_powerdown = zynqmp_pm_force_powerdown,
1221 .request_wakeup = zynqmp_pm_request_wakeup,
1222 .set_wakeup_source = zynqmp_pm_set_wakeup_source,
1223 .system_shutdown = zynqmp_pm_system_shutdown,
1224 .set_max_latency = zynqmp_pm_set_max_latency,
1225 .set_configuration = zynqmp_pm_set_configuration,
1226 .get_node_status = zynqmp_pm_get_node_status,
1227 .get_operating_characteristic = zynqmp_pm_get_operating_characteristic,
1228 .pinctrl_request = zynqmp_pm_pinctrl_request,
1229 .pinctrl_release = zynqmp_pm_pinctrl_release,
1230 .pinctrl_get_function = zynqmp_pm_pinctrl_get_function,
1231 .pinctrl_set_function = zynqmp_pm_pinctrl_set_function,
1232 .pinctrl_get_config = zynqmp_pm_pinctrl_get_config,
1233 .pinctrl_set_config = zynqmp_pm_pinctrl_set_config,
1234 .register_access = zynqmp_pm_config_reg_access,
1235 .aes = zynqmp_pm_aes_engine,
1236 .efuse_access = zynqmp_pm_efuse_access,
1237 .secure_image = zynqmp_pm_secure_load,
1238 .pdi_load = zynqmp_pm_load_pdi,
1242 * zynqmp_pm_get_eemi_ops - Get eemi ops functions
1244 * Return: Pointer of eemi_ops structure
1246 const struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void)
1249 return eemi_ops_tbl;
1251 return ERR_PTR(-EPROBE_DEFER);
1254 EXPORT_SYMBOL_GPL(zynqmp_pm_get_eemi_ops);
1257 * struct zynqmp_pm_shutdown_scope - Struct for shutdown scope
1258 * @subtype: Shutdown subtype
1259 * @name: Matching string for scope argument
1261 * This struct encapsulates mapping between shutdown scope ID and string.
1263 struct zynqmp_pm_shutdown_scope {
1264 const enum zynqmp_pm_shutdown_subtype subtype;
1268 static struct zynqmp_pm_shutdown_scope shutdown_scopes[] = {
1269 [ZYNQMP_PM_SHUTDOWN_SUBTYPE_SUBSYSTEM] = {
1270 .subtype = ZYNQMP_PM_SHUTDOWN_SUBTYPE_SUBSYSTEM,
1271 .name = "subsystem",
1273 [ZYNQMP_PM_SHUTDOWN_SUBTYPE_PS_ONLY] = {
1274 .subtype = ZYNQMP_PM_SHUTDOWN_SUBTYPE_PS_ONLY,
1277 [ZYNQMP_PM_SHUTDOWN_SUBTYPE_SYSTEM] = {
1278 .subtype = ZYNQMP_PM_SHUTDOWN_SUBTYPE_SYSTEM,
1283 static struct zynqmp_pm_shutdown_scope *selected_scope =
1284 &shutdown_scopes[ZYNQMP_PM_SHUTDOWN_SUBTYPE_SYSTEM];
1287 * zynqmp_pm_is_shutdown_scope_valid - Check if shutdown scope string is valid
1288 * @scope_string: Shutdown scope string
1290 * Return: Return pointer to matching shutdown scope struct from
1291 * array of available options in system if string is valid,
1292 * otherwise returns NULL.
1294 static struct zynqmp_pm_shutdown_scope*
1295 zynqmp_pm_is_shutdown_scope_valid(const char *scope_string)
1299 for (count = 0; count < ARRAY_SIZE(shutdown_scopes); count++)
1300 if (sysfs_streq(scope_string, shutdown_scopes[count].name))
1301 return &shutdown_scopes[count];
1307 * shutdown_scope_show - Show shutdown_scope sysfs attribute
1308 * @kobj: Kobject structure
1309 * @attr: Kobject attribute structure
1310 * @buf: Requested available shutdown_scope attributes string
1312 * User-space interface for viewing the available scope options for system
1313 * shutdown. Scope option for next shutdown call is marked with [].
1315 * Usage: cat /sys/firmware/zynqmp/shutdown_scope
1317 * Return: Number of bytes printed into the buffer.
1319 static ssize_t shutdown_scope_show(struct kobject *kobj,
1320 struct kobj_attribute *attr,
1325 for (i = 0; i < ARRAY_SIZE(shutdown_scopes); i++) {
1326 if (&shutdown_scopes[i] == selected_scope) {
1328 strcat(buf, shutdown_scopes[i].name);
1331 strcat(buf, shutdown_scopes[i].name);
1341 * shutdown_scope_store - Store shutdown_scope sysfs attribute
1342 * @kobj: Kobject structure
1343 * @attr: Kobject attribute structure
1344 * @buf: User entered shutdown_scope attribute string
1345 * @count: Buffer size
1347 * User-space interface for setting the scope for the next system shutdown.
1348 * Usage: echo <scope> > /sys/firmware/zynqmp/shutdown_scope
1350 * The Linux shutdown functionality implemented via PSCI system_off does not
1351 * include an option to set a scope, i.e. which parts of the system to shut
1354 * This API function allows to set the shutdown scope for the next shutdown
1355 * request by passing it to the ATF running in EL3. When the next shutdown
1356 * is performed, the platform specific portion of PSCI-system_off can use
1357 * the chosen shutdown scope.
1359 * subsystem: Only the APU along with all of its peripherals not used by other
1360 * processing units will be shut down. This may result in the FPD
1361 * power domain being shut down provided that no other processing
1362 * unit uses FPD peripherals or DRAM.
1363 * ps_only: The complete PS will be shut down, including the RPU, PMU, etc.
1364 * Only the PL domain (FPGA) remains untouched.
1365 * system: The complete system/device is shut down.
1367 * Return: count argument if request succeeds, the corresponding error
1370 static ssize_t shutdown_scope_store(struct kobject *kobj,
1371 struct kobj_attribute *attr,
1372 const char *buf, size_t count)
1375 struct zynqmp_pm_shutdown_scope *scope;
1377 scope = zynqmp_pm_is_shutdown_scope_valid(buf);
1381 ret = zynqmp_pm_system_shutdown(ZYNQMP_PM_SHUTDOWN_TYPE_SETSCOPE_ONLY,
1384 pr_err("unable to set shutdown scope %s\n", buf);
1388 selected_scope = scope;
1393 static struct kobj_attribute zynqmp_attr_shutdown_scope =
1394 __ATTR_RW(shutdown_scope);
1397 * health_status_store - Store health_status sysfs attribute
1398 * @kobj: Kobject structure
1399 * @attr: Kobject attribute structure
1400 * @buf: User entered health_status attribute string
1401 * @count: Buffer size
1403 * User-space interface for setting the boot health status.
1404 * Usage: echo <value> > /sys/firmware/zynqmp/health_status
1407 * 1 - Set healthy bit to 1
1408 * 0 - Unset healthy bit
1410 * Return: count argument if request succeeds, the corresponding error
1413 static ssize_t health_status_store(struct kobject *kobj,
1414 struct kobj_attribute *attr,
1415 const char *buf, size_t count)
1420 ret = kstrtouint(buf, 10, &value);
1424 ret = zynqmp_pm_ioctl(0, IOCTL_SET_BOOT_HEALTH_STATUS, value, 0, NULL);
1426 pr_err("unable to set healthy bit value to %u\n", value);
1433 static struct kobj_attribute zynqmp_attr_health_status =
1434 __ATTR_WO(health_status);
1437 * config_reg_store - Write config_reg sysfs attribute
1438 * @kobj: Kobject structure
1439 * @attr: Kobject attribute structure
1440 * @buf: User entered health_status attribute string
1441 * @count: Buffer size
1443 * User-space interface for setting the config register.
1445 * To write any CSU/PMU register
1446 * echo <address> <mask> <values> > /sys/firmware/zynqmp/config_reg
1448 * echo 0x345AB234 0xFFFFFFFF 0x1234ABCD > /sys/firmware/zynqmp/config_reg
1450 * To Read any CSU/PMU register, write address to the variable like below
1451 * echo <address> > /sys/firmware/zynqmp/config_reg
1453 * Return: count argument if request succeeds, the corresponding error
1456 static ssize_t config_reg_store(struct kobject *kobj,
1457 struct kobj_attribute *attr,
1458 const char *buf, size_t count)
1460 char *kern_buff, *inbuf, *tok;
1461 unsigned long address, value, mask;
1464 kern_buff = kzalloc(count, GFP_KERNEL);
1468 ret = strlcpy(kern_buff, buf, count);
1476 /* Read the addess */
1477 tok = strsep(&inbuf, " ");
1482 ret = kstrtol(tok, 16, &address);
1487 /* Read the write value */
1488 tok = strsep(&inbuf, " ");
1490 * If parameter provided is only address, then its a read operation.
1491 * Store the address in a global variable and retrieve whenever
1495 register_address = address;
1498 register_address = address;
1500 ret = kstrtol(tok, 16, &mask);
1505 tok = strsep(&inbuf, " ");
1510 ret = kstrtol(tok, 16, &value);
1515 ret = zynqmp_pm_config_reg_access(CONFIG_REG_WRITE, address,
1518 pr_err("unable to write value to %lx\n", value);
1527 * config_reg_show - Read config_reg sysfs attribute
1528 * @kobj: Kobject structure
1529 * @attr: Kobject attribute structure
1530 * @buf: User entered health_status attribute string
1532 * User-space interface for getting the config register.
1534 * To Read any CSU/PMU register, write address to the variable like below
1535 * echo <address> > /sys/firmware/zynqmp/config_reg
1537 * Then Read the address using below command
1538 * cat /sys/firmware/zynqmp/config_reg
1540 * Return: number of chars written to buf.
1542 static ssize_t config_reg_show(struct kobject *kobj,
1543 struct kobj_attribute *attr,
1547 u32 ret_payload[PAYLOAD_ARG_CNT];
1549 ret = zynqmp_pm_config_reg_access(CONFIG_REG_READ, register_address,
1554 return sprintf(buf, "0x%x\n", ret_payload[1]);
1557 static struct kobj_attribute zynqmp_attr_config_reg =
1558 __ATTR_RW(config_reg);
1560 static struct attribute *attrs[] = {
1561 &zynqmp_attr_shutdown_scope.attr,
1562 &zynqmp_attr_health_status.attr,
1563 &zynqmp_attr_config_reg.attr,
1567 static const struct attribute_group attr_group = {
1572 static int zynqmp_pm_sysfs_init(void)
1574 struct kobject *zynqmp_kobj;
1577 zynqmp_kobj = kobject_create_and_add("zynqmp", firmware_kobj);
1579 pr_err("zynqmp: Firmware kobj add failed.\n");
1583 ret = sysfs_create_group(zynqmp_kobj, &attr_group);
1585 pr_err("%s() sysfs creation fail with error %d\n",
1590 ret = zynqmp_pm_ggs_init(zynqmp_kobj);
1592 pr_err("%s() GGS init fail with error %d\n",
1600 static int zynqmp_firmware_probe(struct platform_device *pdev)
1602 struct device *dev = &pdev->dev;
1603 struct device_node *np;
1606 np = of_find_compatible_node(NULL, NULL, "xlnx,zynqmp");
1608 np = of_find_compatible_node(NULL, NULL, "xlnx,versal");
1612 feature_check_enabled = true;
1616 ret = get_set_conduit_method(dev->of_node);
1620 /* Check PM API version number */
1621 zynqmp_pm_get_api_version(&pm_api_version);
1622 if (pm_api_version < ZYNQMP_PM_VERSION) {
1623 panic("%s Platform Management API version error. Expected: v%d.%d - Found: v%d.%d\n",
1625 ZYNQMP_PM_VERSION_MAJOR, ZYNQMP_PM_VERSION_MINOR,
1626 pm_api_version >> 16, pm_api_version & 0xFFFF);
1629 pr_info("%s Platform Management API v%d.%d\n", __func__,
1630 pm_api_version >> 16, pm_api_version & 0xFFFF);
1632 /* Check trustzone version number */
1633 ret = zynqmp_pm_get_trustzone_version(&pm_tz_version);
1635 panic("Legacy trustzone found without version support\n");
1637 if (pm_tz_version < ZYNQMP_TZ_VERSION)
1638 panic("%s Trustzone version error. Expected: v%d.%d - Found: v%d.%d\n",
1640 ZYNQMP_TZ_VERSION_MAJOR, ZYNQMP_TZ_VERSION_MINOR,
1641 pm_tz_version >> 16, pm_tz_version & 0xFFFF);
1643 pr_info("%s Trustzone version v%d.%d\n", __func__,
1644 pm_tz_version >> 16, pm_tz_version & 0xFFFF);
1646 /* Assign eemi_ops_table */
1647 eemi_ops_tbl = &eemi_ops;
1649 ret = zynqmp_pm_sysfs_init();
1651 pr_err("%s() sysfs init fail with error %d\n", __func__, ret);
1655 zynqmp_pm_api_debugfs_init();
1657 ret = mfd_add_devices(&pdev->dev, PLATFORM_DEVID_NONE, firmware_devs,
1658 ARRAY_SIZE(firmware_devs), NULL, 0, NULL);
1660 dev_err(&pdev->dev, "failed to add MFD devices %d\n", ret);
1664 return of_platform_populate(dev->of_node, NULL, NULL, dev);
1667 static int zynqmp_firmware_remove(struct platform_device *pdev)
1669 mfd_remove_devices(&pdev->dev);
1670 zynqmp_pm_api_debugfs_exit();
1675 static const struct of_device_id zynqmp_firmware_of_match[] = {
1676 {.compatible = "xlnx,zynqmp-firmware"},
1677 {.compatible = "xlnx,versal-firmware-wip"},
1680 MODULE_DEVICE_TABLE(of, zynqmp_firmware_of_match);
1682 static struct platform_driver zynqmp_firmware_driver = {
1684 .name = "zynqmp_firmware",
1685 .of_match_table = zynqmp_firmware_of_match,
1687 .probe = zynqmp_firmware_probe,
1688 .remove = zynqmp_firmware_remove,
1690 module_platform_driver(zynqmp_firmware_driver);