1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Xilinx Zynq MPSoC Firmware driver
5 * Copyright (C) 2018-2019 Xilinx, Inc.
8 #ifndef _ZYNQMP_FIRMWARE_H_
9 #define _ZYNQMP_FIRMWARE_H_
12 PM_GET_API_VERSION = 1,
15 PM_GET_OPERATING_CHARACTERISTIC,
40 PM_PINCTRL_GET_FUNCTION,
41 PM_PINCTRL_SET_FUNCTION,
42 PM_PINCTRL_CONFIG_PARAM_GET,
43 PM_PINCTRL_CONFIG_PARAM_SET,
58 PM_CLOCK_PLL_GETPARAM = 49,
59 PM_REGISTER_ACCESS = 52,
61 PM_FEATURE_CHECK = 63,
67 PM_QID_CLOCK_GET_NAME = 1,
68 PM_QID_CLOCK_GET_TOPOLOGY = 2,
69 PM_QID_CLOCK_GET_FIXEDFACTOR_PARAMS = 3,
70 PM_QID_CLOCK_GET_PARENTS = 4,
71 PM_QID_CLOCK_GET_ATTRIBUTES = 5,
72 PM_QID_PINCTRL_GET_NUM_PINS = 6,
73 PM_QID_PINCTRL_GET_NUM_FUNCTIONS = 7,
74 PM_QID_PINCTRL_GET_NUM_FUNCTION_GROUPS = 8,
75 PM_QID_PINCTRL_GET_FUNCTION_NAME = 9,
76 PM_QID_PINCTRL_GET_FUNCTION_GROUPS = 10,
77 PM_QID_PINCTRL_GET_PIN_GROUPS = 11,
78 PM_QID_CLOCK_GET_NUM_CLOCKS = 12,
79 PM_QID_CLOCK_GET_MAX_DIVISOR = 13,
82 #define PM_SIP_SVC 0xc2000000
84 #define ZYNQMP_PM_VERSION_MAJOR 1
85 #define ZYNQMP_PM_VERSION_MINOR 0
86 #define ZYNQMP_PM_VERSION_MAJOR_SHIFT 16
87 #define ZYNQMP_PM_VERSION_MINOR_MASK 0xFFFF
89 #define ZYNQMP_PM_VERSION \
90 ((ZYNQMP_PM_VERSION_MAJOR << ZYNQMP_PM_VERSION_MAJOR_SHIFT) | \
91 ZYNQMP_PM_VERSION_MINOR)
93 #define ZYNQMP_PM_VERSION_INVALID ~0
95 #define PMUFW_V1_0 ((1 << ZYNQMP_PM_VERSION_MAJOR_SHIFT) | 0)
99 * Not every firmware call expects the same amount of return bytes, however the
100 * firmware driver always copies 5 bytes from RX buffer to the ret_payload
101 * buffer. Therefore allocating with this defined value is recommended to avoid
104 #define PAYLOAD_ARG_CNT 5U
106 unsigned int zynqmp_firmware_version(void);
107 void zynqmp_pmufw_load_config_object(const void *cfg_obj, size_t size);
108 int xilinx_pm_request(u32 api_id, u32 arg0, u32 arg1, u32 arg2,
109 u32 arg3, u32 *ret_payload);
111 #endif /* _ZYNQMP_FIRMWARE_H_ */