Rajan Vaja | 8cc7bc8 | 2018-10-08 11:21:43 -0700 | [diff] [blame] | 1 | --------------------------------------------------------------------- |
| 2 | Xilinx Zynq MPSoC EEMI Documentation |
| 3 | --------------------------------------------------------------------- |
| 4 | |
| 5 | Xilinx Zynq MPSoC Firmware Interface |
| 6 | ------------------------------------- |
| 7 | The zynqmp-firmware node describes the interface to platform firmware. |
| 8 | ZynqMP has an interface to communicate with secure firmware. Firmware |
| 9 | driver provides an interface to firmware APIs. Interface APIs can be |
| 10 | used by any driver to communicate with PMC(Platform Management Controller). |
| 11 | |
| 12 | Embedded Energy Management Interface (EEMI) |
| 13 | ---------------------------------------------- |
| 14 | The embedded energy management interface is used to allow software |
| 15 | components running across different processing clusters on a chip or |
| 16 | device to communicate with a power management controller (PMC) on a |
| 17 | device to issue or respond to power management requests. |
| 18 | |
| 19 | EEMI ops is a structure containing all eemi APIs supported by Zynq MPSoC. |
| 20 | The zynqmp-firmware driver maintain all EEMI APIs in zynqmp_eemi_ops |
| 21 | structure. Any driver who want to communicate with PMC using EEMI APIs |
| 22 | can call zynqmp_pm_get_eemi_ops(). |
| 23 | |
| 24 | Example of EEMI ops: |
| 25 | |
| 26 | /* zynqmp-firmware driver maintain all EEMI APIs */ |
| 27 | struct zynqmp_eemi_ops { |
| 28 | int (*get_api_version)(u32 *version); |
| 29 | int (*query_data)(struct zynqmp_pm_query_data qdata, u32 *out); |
| 30 | }; |
| 31 | |
| 32 | static const struct zynqmp_eemi_ops eemi_ops = { |
| 33 | .get_api_version = zynqmp_pm_get_api_version, |
| 34 | .query_data = zynqmp_pm_query_data, |
| 35 | }; |
| 36 | |
| 37 | Example of EEMI ops usage: |
| 38 | |
| 39 | static const struct zynqmp_eemi_ops *eemi_ops; |
| 40 | u32 ret_payload[PAYLOAD_ARG_CNT]; |
| 41 | int ret; |
| 42 | |
| 43 | eemi_ops = zynqmp_pm_get_eemi_ops(); |
Rajan Vaja | 3d03137 | 2019-03-04 15:18:08 -0800 | [diff] [blame] | 44 | if (IS_ERR(eemi_ops)) |
| 45 | return PTR_ERR(eemi_ops); |
Rajan Vaja | 8cc7bc8 | 2018-10-08 11:21:43 -0700 | [diff] [blame] | 46 | |
| 47 | ret = eemi_ops->query_data(qdata, ret_payload); |
| 48 | |
| 49 | IOCTL |
| 50 | ------ |
| 51 | IOCTL API is for device control and configuration. It is not a system |
| 52 | IOCTL but it is an EEMI API. This API can be used by master to control |
| 53 | any device specific configuration. IOCTL definitions can be platform |
| 54 | specific. This API also manage shared device configuration. |
| 55 | |
| 56 | The following IOCTL IDs are valid for device control: |
| 57 | - IOCTL_SET_PLL_FRAC_MODE 8 |
| 58 | - IOCTL_GET_PLL_FRAC_MODE 9 |
| 59 | - IOCTL_SET_PLL_FRAC_DATA 10 |
| 60 | - IOCTL_GET_PLL_FRAC_DATA 11 |
| 61 | |
| 62 | Refer EEMI API guide [0] for IOCTL specific parameters and other EEMI APIs. |
| 63 | |
| 64 | References |
| 65 | ---------- |
| 66 | [0] Embedded Energy Management Interface (EEMI) API guide: |
| 67 | https://www.xilinx.com/support/documentation/user_guides/ug1200-eemi-api.pdf |