Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Bjorn Andersson | bde440e | 2017-01-27 02:28:32 -0800 | [diff] [blame] | 2 | #ifndef __RPROC_QCOM_COMMON_H__ |
| 3 | #define __RPROC_QCOM_COMMON_H__ |
| 4 | |
Bjorn Andersson | b90fcfc | 2017-01-27 07:04:54 -0800 | [diff] [blame] | 5 | #include <linux/remoteproc.h> |
| 6 | #include "remoteproc_internal.h" |
Bjorn Andersson | 1fb82ee | 2017-08-27 21:51:38 -0700 | [diff] [blame] | 7 | #include <linux/soc/qcom/qmi.h> |
| 8 | |
| 9 | struct qcom_sysmon; |
Bjorn Andersson | b90fcfc | 2017-01-27 07:04:54 -0800 | [diff] [blame] | 10 | |
Bjorn Andersson | eea0702 | 2017-08-29 16:13:35 -0700 | [diff] [blame] | 11 | struct qcom_rproc_glink { |
| 12 | struct rproc_subdev subdev; |
| 13 | |
Bjorn Andersson | cd9fc8f | 2020-04-22 17:37:33 -0700 | [diff] [blame] | 14 | const char *ssr_name; |
| 15 | |
Bjorn Andersson | eea0702 | 2017-08-29 16:13:35 -0700 | [diff] [blame] | 16 | struct device *dev; |
| 17 | struct device_node *node; |
| 18 | struct qcom_glink *edge; |
| 19 | }; |
| 20 | |
Bjorn Andersson | b90fcfc | 2017-01-27 07:04:54 -0800 | [diff] [blame] | 21 | struct qcom_rproc_subdev { |
| 22 | struct rproc_subdev subdev; |
| 23 | |
| 24 | struct device *dev; |
| 25 | struct device_node *node; |
| 26 | struct qcom_smd_edge *edge; |
| 27 | }; |
Bjorn Andersson | bde440e | 2017-01-27 02:28:32 -0800 | [diff] [blame] | 28 | |
Rishabh Bhatnagar | 5abfe5c | 2020-06-23 19:23:27 -0700 | [diff] [blame] | 29 | struct qcom_ssr_subsystem; |
| 30 | |
Bjorn Andersson | 1e140df | 2017-07-24 22:56:43 -0700 | [diff] [blame] | 31 | struct qcom_rproc_ssr { |
| 32 | struct rproc_subdev subdev; |
Rishabh Bhatnagar | 5abfe5c | 2020-06-23 19:23:27 -0700 | [diff] [blame] | 33 | struct qcom_ssr_subsystem *info; |
Bjorn Andersson | 1e140df | 2017-07-24 22:56:43 -0700 | [diff] [blame] | 34 | }; |
| 35 | |
Siddharth Gupta | 8ed8485 | 2020-11-19 13:05:34 -0800 | [diff] [blame] | 36 | void qcom_minidump(struct rproc *rproc, unsigned int minidump_id); |
| 37 | |
Bjorn Andersson | cd9fc8f | 2020-04-22 17:37:33 -0700 | [diff] [blame] | 38 | void qcom_add_glink_subdev(struct rproc *rproc, struct qcom_rproc_glink *glink, |
| 39 | const char *ssr_name); |
Bjorn Andersson | eea0702 | 2017-08-29 16:13:35 -0700 | [diff] [blame] | 40 | void qcom_remove_glink_subdev(struct rproc *rproc, struct qcom_rproc_glink *glink); |
| 41 | |
Sarangdhar Joshi | dcb57ed | 2018-01-05 16:04:20 -0800 | [diff] [blame] | 42 | int qcom_register_dump_segments(struct rproc *rproc, const struct firmware *fw); |
| 43 | |
Bjorn Andersson | b90fcfc | 2017-01-27 07:04:54 -0800 | [diff] [blame] | 44 | void qcom_add_smd_subdev(struct rproc *rproc, struct qcom_rproc_subdev *smd); |
| 45 | void qcom_remove_smd_subdev(struct rproc *rproc, struct qcom_rproc_subdev *smd); |
| 46 | |
Bjorn Andersson | 1e140df | 2017-07-24 22:56:43 -0700 | [diff] [blame] | 47 | void qcom_add_ssr_subdev(struct rproc *rproc, struct qcom_rproc_ssr *ssr, |
| 48 | const char *ssr_name); |
| 49 | void qcom_remove_ssr_subdev(struct rproc *rproc, struct qcom_rproc_ssr *ssr); |
| 50 | |
Bjorn Andersson | 1fb82ee | 2017-08-27 21:51:38 -0700 | [diff] [blame] | 51 | #if IS_ENABLED(CONFIG_QCOM_SYSMON) |
| 52 | struct qcom_sysmon *qcom_add_sysmon_subdev(struct rproc *rproc, |
| 53 | const char *name, |
| 54 | int ssctl_instance); |
| 55 | void qcom_remove_sysmon_subdev(struct qcom_sysmon *sysmon); |
Bjorn Andersson | 5c212aa | 2020-11-21 21:41:33 -0800 | [diff] [blame] | 56 | bool qcom_sysmon_shutdown_acked(struct qcom_sysmon *sysmon); |
Bjorn Andersson | 1fb82ee | 2017-08-27 21:51:38 -0700 | [diff] [blame] | 57 | #else |
| 58 | static inline struct qcom_sysmon *qcom_add_sysmon_subdev(struct rproc *rproc, |
| 59 | const char *name, |
| 60 | int ssctl_instance) |
| 61 | { |
| 62 | return NULL; |
| 63 | } |
| 64 | |
| 65 | static inline void qcom_remove_sysmon_subdev(struct qcom_sysmon *sysmon) |
| 66 | { |
| 67 | } |
Bjorn Andersson | 5c212aa | 2020-11-21 21:41:33 -0800 | [diff] [blame] | 68 | |
| 69 | static inline bool qcom_sysmon_shutdown_acked(struct qcom_sysmon *sysmon) |
| 70 | { |
| 71 | return false; |
| 72 | } |
Bjorn Andersson | 1fb82ee | 2017-08-27 21:51:38 -0700 | [diff] [blame] | 73 | #endif |
| 74 | |
Bjorn Andersson | bde440e | 2017-01-27 02:28:32 -0800 | [diff] [blame] | 75 | #endif |