Use direct function calls instead of using eemi ops. So remove eemi ops for get_api_version and use direct function call.
Unified · Split
| @@ -92,7 +92,7 @@ static int process_api_request(u32 pm_id, u64 *pm_api_arg, u32 *pm_api_ret) · 91 unmodified lines | |||
| 92 | 92 | ||
| 93 | switch (pm_id) { | 93 | switch (pm_id) { |
| 94 | case PM_GET_API_VERSION: | 94 | case PM_GET_API_VERSION: |
| 95 | ret = eemi_ops->get_api_version(&pm_api_version); | 95 | ret = zynqmp_pm_get_api_version(&pm_api_version); |
| 96 | sprintf(debugfs_buf, "PM-API Version = %d.%d\n", | 96 | sprintf(debugfs_buf, "PM-API Version = %d.%d\n", |
| 97 | pm_api_version >> 16, pm_api_version & 0xffff); | 97 | pm_api_version >> 16, pm_api_version & 0xffff); |
| 98 | break; | 98 | break; |
| @@ -219,7 +219,7 @@ static u32 pm_tz_version; · 218 unmodified lines | |||
| 219 | * | 219 | * |
| 220 | * Return: Returns status, either success or error+reason | 220 | * Return: Returns status, either success or error+reason |
| 221 | */ | 221 | */ |
| 222 | static int zynqmp_pm_get_api_version(u32 *version) | 222 | int zynqmp_pm_get_api_version(u32 *version) |
| 223 | { | 223 | { |
| 224 | u32 ret_payload[PAYLOAD_ARG_CNT]; | 224 | u32 ret_payload[PAYLOAD_ARG_CNT]; |
| 225 | int ret; | 225 | int ret; |
| @@ -237,6 +237,7 @@ static int zynqmp_pm_get_api_version(u32 *version) · 11 unmodified lines | |||
| 237 | 237 | ||
| 238 | return ret; | 238 | return ret; |
| 239 | } | 239 | } |
| 240 | EXPORT_SYMBOL_GPL(zynqmp_pm_get_api_version); | ||
| 240 | 241 | ||
| 241 | /** | 242 | /** |
| 242 | * zynqmp_pm_get_chipid - Get silicon ID registers | 243 | * zynqmp_pm_get_chipid - Get silicon ID registers |
| @@ -734,7 +735,6 @@ static int zynqmp_pm_aes_engine(const u64 address, u32 *out) · 491 unmodified lines | |||
| 734 | } | 735 | } |
| 735 | 736 | ||
| 736 | static const struct zynqmp_eemi_ops eemi_ops = { | 737 | static const struct zynqmp_eemi_ops eemi_ops = { |
| 737 | .get_api_version = zynqmp_pm_get_api_version, | ||
| 738 | .get_chipid = zynqmp_pm_get_chipid, | 738 | .get_chipid = zynqmp_pm_get_chipid, |
| 739 | .query_data = zynqmp_pm_query_data, | 739 | .query_data = zynqmp_pm_query_data, |
| 740 | .clock_enable = zynqmp_pm_clock_enable, | 740 | .clock_enable = zynqmp_pm_clock_enable, |
| @@ -186,11 +186,11 @@ static int zynqmp_pm_probe(struct platform_device *pdev) · 185 unmodified lines | |||
| 186 | if (IS_ERR(eemi_ops)) | 186 | if (IS_ERR(eemi_ops)) |
| 187 | return PTR_ERR(eemi_ops); | 187 | return PTR_ERR(eemi_ops); |
| 188 | 188 | ||
| 189 | if (!eemi_ops->get_api_version || !eemi_ops->init_finalize) | 189 | if (!eemi_ops->init_finalize) |
| 190 | return -ENXIO; | 190 | return -ENXIO; |
| 191 | 191 | ||
| 192 | eemi_ops->init_finalize(); | 192 | eemi_ops->init_finalize(); |
| 193 | eemi_ops->get_api_version(&pm_api_version); | 193 | zynqmp_pm_get_api_version(&pm_api_version); |
| 194 | 194 | ||
| 195 | /* Check PM API version number */ | 195 | /* Check PM API version number */ |
| 196 | if (pm_api_version < ZYNQMP_PM_VERSION) | 196 | if (pm_api_version < ZYNQMP_PM_VERSION) |
| @@ -294,7 +294,6 @@ struct zynqmp_pm_query_data { · 293 unmodified lines | |||
| 294 | }; | 294 | }; |
| 295 | 295 | ||
| 296 | struct zynqmp_eemi_ops { | 296 | struct zynqmp_eemi_ops { |
| 297 | int (*get_api_version)(u32 *version); | ||
| 298 | int (*get_chipid)(u32 *idcode, u32 *version); | 297 | int (*get_chipid)(u32 *idcode, u32 *version); |
| 299 | int (*fpga_load)(const u64 address, const u32 size, const u32 flags); | 298 | int (*fpga_load)(const u64 address, const u32 size, const u32 flags); |
| 300 | int (*fpga_get_status)(u32 *value); | 299 | int (*fpga_get_status)(u32 *value); |
| @@ -331,11 +330,16 @@ int zynqmp_pm_invoke_fn(u32 pm_api_id, u32 arg0, u32 arg1, · 30 unmodified lines | |||
| 331 | 330 | ||
| 332 | #if IS_REACHABLE(CONFIG_ZYNQMP_FIRMWARE) | 331 | #if IS_REACHABLE(CONFIG_ZYNQMP_FIRMWARE) |
| 333 | const struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void); | 332 | const struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void); |
| 333 | int zynqmp_pm_get_api_version(u32 *version); | ||
| 334 | #else | 334 | #else |
| 335 | static inline struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void) | 335 | static inline struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void) |
| 336 | { | 336 | { |
| 337 | return ERR_PTR(-ENODEV); | 337 | return ERR_PTR(-ENODEV); |
| 338 | } | 338 | } |
| 339 | static inline int zynqmp_pm_get_api_version(u32 *version) | ||
| 340 | { | ||
| 341 | return -ENODEV; | ||
| 342 | } | ||
| 339 | #endif | 343 | #endif |
| 340 | 344 | ||
| 341 | #endif /* __FIRMWARE_ZYNQMP_H__ */ | 345 | #endif /* __FIRMWARE_ZYNQMP_H__ */ |