blob: c35adf730be05f446b20d4f86c1f1a9678ce3ab6 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Bjorn Anderssonbde440e2017-01-27 02:28:32 -08002#ifndef __RPROC_QCOM_COMMON_H__
3#define __RPROC_QCOM_COMMON_H__
4
Bjorn Anderssonb90fcfc2017-01-27 07:04:54 -08005#include <linux/remoteproc.h>
6#include "remoteproc_internal.h"
Bjorn Andersson1fb82ee2017-08-27 21:51:38 -07007#include <linux/soc/qcom/qmi.h>
8
9struct qcom_sysmon;
Bjorn Anderssonb90fcfc2017-01-27 07:04:54 -080010
Bjorn Anderssoneea07022017-08-29 16:13:35 -070011struct qcom_rproc_glink {
12 struct rproc_subdev subdev;
13
Bjorn Anderssoncd9fc8f2020-04-22 17:37:33 -070014 const char *ssr_name;
15
Bjorn Anderssoneea07022017-08-29 16:13:35 -070016 struct device *dev;
17 struct device_node *node;
18 struct qcom_glink *edge;
19};
20
Bjorn Anderssonb90fcfc2017-01-27 07:04:54 -080021struct 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 Anderssonbde440e2017-01-27 02:28:32 -080028
Rishabh Bhatnagar5abfe5c2020-06-23 19:23:27 -070029struct qcom_ssr_subsystem;
30
Bjorn Andersson1e140df2017-07-24 22:56:43 -070031struct qcom_rproc_ssr {
32 struct rproc_subdev subdev;
Rishabh Bhatnagar5abfe5c2020-06-23 19:23:27 -070033 struct qcom_ssr_subsystem *info;
Bjorn Andersson1e140df2017-07-24 22:56:43 -070034};
35
Siddharth Gupta8ed84852020-11-19 13:05:34 -080036void qcom_minidump(struct rproc *rproc, unsigned int minidump_id);
37
Bjorn Anderssoncd9fc8f2020-04-22 17:37:33 -070038void qcom_add_glink_subdev(struct rproc *rproc, struct qcom_rproc_glink *glink,
39 const char *ssr_name);
Bjorn Anderssoneea07022017-08-29 16:13:35 -070040void qcom_remove_glink_subdev(struct rproc *rproc, struct qcom_rproc_glink *glink);
41
Sarangdhar Joshidcb57ed2018-01-05 16:04:20 -080042int qcom_register_dump_segments(struct rproc *rproc, const struct firmware *fw);
43
Bjorn Anderssonb90fcfc2017-01-27 07:04:54 -080044void qcom_add_smd_subdev(struct rproc *rproc, struct qcom_rproc_subdev *smd);
45void qcom_remove_smd_subdev(struct rproc *rproc, struct qcom_rproc_subdev *smd);
46
Bjorn Andersson1e140df2017-07-24 22:56:43 -070047void qcom_add_ssr_subdev(struct rproc *rproc, struct qcom_rproc_ssr *ssr,
48 const char *ssr_name);
49void qcom_remove_ssr_subdev(struct rproc *rproc, struct qcom_rproc_ssr *ssr);
50
Bjorn Andersson1fb82ee2017-08-27 21:51:38 -070051#if IS_ENABLED(CONFIG_QCOM_SYSMON)
52struct qcom_sysmon *qcom_add_sysmon_subdev(struct rproc *rproc,
53 const char *name,
54 int ssctl_instance);
55void qcom_remove_sysmon_subdev(struct qcom_sysmon *sysmon);
Bjorn Andersson5c212aa2020-11-21 21:41:33 -080056bool qcom_sysmon_shutdown_acked(struct qcom_sysmon *sysmon);
Bjorn Andersson1fb82ee2017-08-27 21:51:38 -070057#else
58static 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
65static inline void qcom_remove_sysmon_subdev(struct qcom_sysmon *sysmon)
66{
67}
Bjorn Andersson5c212aa2020-11-21 21:41:33 -080068
69static inline bool qcom_sysmon_shutdown_acked(struct qcom_sysmon *sysmon)
70{
71 return false;
72}
Bjorn Andersson1fb82ee2017-08-27 21:51:38 -070073#endif
74
Bjorn Anderssonbde440e2017-01-27 02:28:32 -080075#endif