Sudeep Holla | 95a15d8 | 2019-07-08 09:41:06 +0100 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | /* |
| 3 | * System Control and Management Interface (SCMI) Reset Protocol |
| 4 | * |
Cristian Marussi | 48dc16e | 2021-03-16 12:48:26 +0000 | [diff] [blame] | 5 | * Copyright (C) 2019-2021 ARM Ltd. |
Sudeep Holla | 95a15d8 | 2019-07-08 09:41:06 +0100 | [diff] [blame] | 6 | */ |
| 7 | |
Cristian Marussi | 469ca18 | 2020-07-01 16:53:47 +0100 | [diff] [blame] | 8 | #define pr_fmt(fmt) "SCMI Notifications RESET - " fmt |
| 9 | |
Cristian Marussi | f5800e0 | 2021-03-16 12:49:02 +0000 | [diff] [blame] | 10 | #include <linux/module.h> |
Cristian Marussi | 469ca18 | 2020-07-01 16:53:47 +0100 | [diff] [blame] | 11 | #include <linux/scmi_protocol.h> |
| 12 | |
Sudeep Holla | 95a15d8 | 2019-07-08 09:41:06 +0100 | [diff] [blame] | 13 | #include "common.h" |
Cristian Marussi | 469ca18 | 2020-07-01 16:53:47 +0100 | [diff] [blame] | 14 | #include "notify.h" |
Sudeep Holla | 95a15d8 | 2019-07-08 09:41:06 +0100 | [diff] [blame] | 15 | |
| 16 | enum scmi_reset_protocol_cmd { |
| 17 | RESET_DOMAIN_ATTRIBUTES = 0x3, |
| 18 | RESET = 0x4, |
| 19 | RESET_NOTIFY = 0x5, |
| 20 | }; |
| 21 | |
Sudeep Holla | 95a15d8 | 2019-07-08 09:41:06 +0100 | [diff] [blame] | 22 | #define NUM_RESET_DOMAIN_MASK 0xffff |
| 23 | #define RESET_NOTIFY_ENABLE BIT(0) |
| 24 | |
| 25 | struct scmi_msg_resp_reset_domain_attributes { |
| 26 | __le32 attributes; |
| 27 | #define SUPPORTS_ASYNC_RESET(x) ((x) & BIT(31)) |
| 28 | #define SUPPORTS_NOTIFY_RESET(x) ((x) & BIT(30)) |
| 29 | __le32 latency; |
| 30 | u8 name[SCMI_MAX_STR_SIZE]; |
| 31 | }; |
| 32 | |
| 33 | struct scmi_msg_reset_domain_reset { |
| 34 | __le32 domain_id; |
| 35 | __le32 flags; |
| 36 | #define AUTONOMOUS_RESET BIT(0) |
| 37 | #define EXPLICIT_RESET_ASSERT BIT(1) |
| 38 | #define ASYNCHRONOUS_RESET BIT(2) |
| 39 | __le32 reset_state; |
Etienne Carriere | 45b9e04 | 2020-10-08 16:37:22 +0200 | [diff] [blame] | 40 | #define ARCH_COLD_RESET 0 |
Sudeep Holla | 95a15d8 | 2019-07-08 09:41:06 +0100 | [diff] [blame] | 41 | }; |
| 42 | |
Cristian Marussi | 469ca18 | 2020-07-01 16:53:47 +0100 | [diff] [blame] | 43 | struct scmi_msg_reset_notify { |
| 44 | __le32 id; |
| 45 | __le32 event_control; |
| 46 | #define RESET_TP_NOTIFY_ALL BIT(0) |
| 47 | }; |
| 48 | |
| 49 | struct scmi_reset_issued_notify_payld { |
| 50 | __le32 agent_id; |
| 51 | __le32 domain_id; |
| 52 | __le32 reset_state; |
| 53 | }; |
| 54 | |
Sudeep Holla | 95a15d8 | 2019-07-08 09:41:06 +0100 | [diff] [blame] | 55 | struct reset_dom_info { |
| 56 | bool async_reset; |
| 57 | bool reset_notify; |
| 58 | u32 latency_us; |
| 59 | char name[SCMI_MAX_STR_SIZE]; |
| 60 | }; |
| 61 | |
| 62 | struct scmi_reset_info { |
Sudeep Holla | b55b06b | 2019-11-22 14:48:40 +0000 | [diff] [blame] | 63 | u32 version; |
Sudeep Holla | 95a15d8 | 2019-07-08 09:41:06 +0100 | [diff] [blame] | 64 | int num_domains; |
| 65 | struct reset_dom_info *dom_info; |
| 66 | }; |
| 67 | |
Cristian Marussi | 7e02934 | 2021-03-16 12:48:45 +0000 | [diff] [blame] | 68 | static int scmi_reset_attributes_get(const struct scmi_protocol_handle *ph, |
Sudeep Holla | 95a15d8 | 2019-07-08 09:41:06 +0100 | [diff] [blame] | 69 | struct scmi_reset_info *pi) |
| 70 | { |
| 71 | int ret; |
| 72 | struct scmi_xfer *t; |
| 73 | u32 attr; |
| 74 | |
Cristian Marussi | 7e02934 | 2021-03-16 12:48:45 +0000 | [diff] [blame] | 75 | ret = ph->xops->xfer_get_init(ph, PROTOCOL_ATTRIBUTES, |
| 76 | 0, sizeof(attr), &t); |
Sudeep Holla | 95a15d8 | 2019-07-08 09:41:06 +0100 | [diff] [blame] | 77 | if (ret) |
| 78 | return ret; |
| 79 | |
Cristian Marussi | 7e02934 | 2021-03-16 12:48:45 +0000 | [diff] [blame] | 80 | ret = ph->xops->do_xfer(ph, t); |
Sudeep Holla | 95a15d8 | 2019-07-08 09:41:06 +0100 | [diff] [blame] | 81 | if (!ret) { |
| 82 | attr = get_unaligned_le32(t->rx.buf); |
| 83 | pi->num_domains = attr & NUM_RESET_DOMAIN_MASK; |
| 84 | } |
| 85 | |
Cristian Marussi | 7e02934 | 2021-03-16 12:48:45 +0000 | [diff] [blame] | 86 | ph->xops->xfer_put(ph, t); |
Sudeep Holla | 95a15d8 | 2019-07-08 09:41:06 +0100 | [diff] [blame] | 87 | return ret; |
| 88 | } |
| 89 | |
| 90 | static int |
Cristian Marussi | 7e02934 | 2021-03-16 12:48:45 +0000 | [diff] [blame] | 91 | scmi_reset_domain_attributes_get(const struct scmi_protocol_handle *ph, |
| 92 | u32 domain, struct reset_dom_info *dom_info) |
Sudeep Holla | 95a15d8 | 2019-07-08 09:41:06 +0100 | [diff] [blame] | 93 | { |
| 94 | int ret; |
| 95 | struct scmi_xfer *t; |
| 96 | struct scmi_msg_resp_reset_domain_attributes *attr; |
| 97 | |
Cristian Marussi | 7e02934 | 2021-03-16 12:48:45 +0000 | [diff] [blame] | 98 | ret = ph->xops->xfer_get_init(ph, RESET_DOMAIN_ATTRIBUTES, |
| 99 | sizeof(domain), sizeof(*attr), &t); |
Sudeep Holla | 95a15d8 | 2019-07-08 09:41:06 +0100 | [diff] [blame] | 100 | if (ret) |
| 101 | return ret; |
| 102 | |
| 103 | put_unaligned_le32(domain, t->tx.buf); |
| 104 | attr = t->rx.buf; |
| 105 | |
Cristian Marussi | 7e02934 | 2021-03-16 12:48:45 +0000 | [diff] [blame] | 106 | ret = ph->xops->do_xfer(ph, t); |
Sudeep Holla | 95a15d8 | 2019-07-08 09:41:06 +0100 | [diff] [blame] | 107 | if (!ret) { |
| 108 | u32 attributes = le32_to_cpu(attr->attributes); |
| 109 | |
| 110 | dom_info->async_reset = SUPPORTS_ASYNC_RESET(attributes); |
| 111 | dom_info->reset_notify = SUPPORTS_NOTIFY_RESET(attributes); |
| 112 | dom_info->latency_us = le32_to_cpu(attr->latency); |
| 113 | if (dom_info->latency_us == U32_MAX) |
| 114 | dom_info->latency_us = 0; |
| 115 | strlcpy(dom_info->name, attr->name, SCMI_MAX_STR_SIZE); |
| 116 | } |
| 117 | |
Cristian Marussi | 7e02934 | 2021-03-16 12:48:45 +0000 | [diff] [blame] | 118 | ph->xops->xfer_put(ph, t); |
Sudeep Holla | 95a15d8 | 2019-07-08 09:41:06 +0100 | [diff] [blame] | 119 | return ret; |
| 120 | } |
| 121 | |
Cristian Marussi | 7e02934 | 2021-03-16 12:48:45 +0000 | [diff] [blame] | 122 | static int scmi_reset_num_domains_get(const struct scmi_protocol_handle *ph) |
Sudeep Holla | 95a15d8 | 2019-07-08 09:41:06 +0100 | [diff] [blame] | 123 | { |
Cristian Marussi | 7e02934 | 2021-03-16 12:48:45 +0000 | [diff] [blame] | 124 | struct scmi_reset_info *pi = ph->get_priv(ph); |
Sudeep Holla | 95a15d8 | 2019-07-08 09:41:06 +0100 | [diff] [blame] | 125 | |
| 126 | return pi->num_domains; |
| 127 | } |
| 128 | |
Cristian Marussi | 7e02934 | 2021-03-16 12:48:45 +0000 | [diff] [blame] | 129 | static char *scmi_reset_name_get(const struct scmi_protocol_handle *ph, |
| 130 | u32 domain) |
| 131 | { |
| 132 | struct scmi_reset_info *pi = ph->get_priv(ph); |
| 133 | |
Sudeep Holla | 95a15d8 | 2019-07-08 09:41:06 +0100 | [diff] [blame] | 134 | struct reset_dom_info *dom = pi->dom_info + domain; |
| 135 | |
| 136 | return dom->name; |
| 137 | } |
| 138 | |
Cristian Marussi | 7e02934 | 2021-03-16 12:48:45 +0000 | [diff] [blame] | 139 | static int scmi_reset_latency_get(const struct scmi_protocol_handle *ph, |
| 140 | u32 domain) |
| 141 | { |
| 142 | struct scmi_reset_info *pi = ph->get_priv(ph); |
Sudeep Holla | 95a15d8 | 2019-07-08 09:41:06 +0100 | [diff] [blame] | 143 | struct reset_dom_info *dom = pi->dom_info + domain; |
| 144 | |
| 145 | return dom->latency_us; |
| 146 | } |
| 147 | |
Cristian Marussi | 7e02934 | 2021-03-16 12:48:45 +0000 | [diff] [blame] | 148 | static int scmi_domain_reset(const struct scmi_protocol_handle *ph, u32 domain, |
Sudeep Holla | 95a15d8 | 2019-07-08 09:41:06 +0100 | [diff] [blame] | 149 | u32 flags, u32 state) |
| 150 | { |
| 151 | int ret; |
| 152 | struct scmi_xfer *t; |
| 153 | struct scmi_msg_reset_domain_reset *dom; |
Cristian Marussi | 7e02934 | 2021-03-16 12:48:45 +0000 | [diff] [blame] | 154 | struct scmi_reset_info *pi = ph->get_priv(ph); |
Sudeep Holla | 95a15d8 | 2019-07-08 09:41:06 +0100 | [diff] [blame] | 155 | struct reset_dom_info *rdom = pi->dom_info + domain; |
| 156 | |
| 157 | if (rdom->async_reset) |
| 158 | flags |= ASYNCHRONOUS_RESET; |
| 159 | |
Cristian Marussi | 7e02934 | 2021-03-16 12:48:45 +0000 | [diff] [blame] | 160 | ret = ph->xops->xfer_get_init(ph, RESET, sizeof(*dom), 0, &t); |
Sudeep Holla | 95a15d8 | 2019-07-08 09:41:06 +0100 | [diff] [blame] | 161 | if (ret) |
| 162 | return ret; |
| 163 | |
| 164 | dom = t->tx.buf; |
| 165 | dom->domain_id = cpu_to_le32(domain); |
| 166 | dom->flags = cpu_to_le32(flags); |
Sudeep Holla | 11ed5cf | 2019-09-09 16:21:30 +0100 | [diff] [blame] | 167 | dom->reset_state = cpu_to_le32(state); |
Sudeep Holla | 95a15d8 | 2019-07-08 09:41:06 +0100 | [diff] [blame] | 168 | |
| 169 | if (rdom->async_reset) |
Cristian Marussi | 7e02934 | 2021-03-16 12:48:45 +0000 | [diff] [blame] | 170 | ret = ph->xops->do_xfer_with_response(ph, t); |
Sudeep Holla | 95a15d8 | 2019-07-08 09:41:06 +0100 | [diff] [blame] | 171 | else |
Cristian Marussi | 7e02934 | 2021-03-16 12:48:45 +0000 | [diff] [blame] | 172 | ret = ph->xops->do_xfer(ph, t); |
Sudeep Holla | 95a15d8 | 2019-07-08 09:41:06 +0100 | [diff] [blame] | 173 | |
Cristian Marussi | 7e02934 | 2021-03-16 12:48:45 +0000 | [diff] [blame] | 174 | ph->xops->xfer_put(ph, t); |
Sudeep Holla | 95a15d8 | 2019-07-08 09:41:06 +0100 | [diff] [blame] | 175 | return ret; |
| 176 | } |
| 177 | |
Cristian Marussi | 7e02934 | 2021-03-16 12:48:45 +0000 | [diff] [blame] | 178 | static int scmi_reset_domain_reset(const struct scmi_protocol_handle *ph, |
| 179 | u32 domain) |
Sudeep Holla | 95a15d8 | 2019-07-08 09:41:06 +0100 | [diff] [blame] | 180 | { |
Cristian Marussi | 7e02934 | 2021-03-16 12:48:45 +0000 | [diff] [blame] | 181 | return scmi_domain_reset(ph, domain, AUTONOMOUS_RESET, |
| 182 | ARCH_COLD_RESET); |
| 183 | } |
| 184 | |
Cristian Marussi | 7e02934 | 2021-03-16 12:48:45 +0000 | [diff] [blame] | 185 | static int |
| 186 | scmi_reset_domain_assert(const struct scmi_protocol_handle *ph, u32 domain) |
| 187 | { |
| 188 | return scmi_domain_reset(ph, domain, EXPLICIT_RESET_ASSERT, |
Sudeep Holla | 95a15d8 | 2019-07-08 09:41:06 +0100 | [diff] [blame] | 189 | ARCH_COLD_RESET); |
| 190 | } |
| 191 | |
| 192 | static int |
Cristian Marussi | 7e02934 | 2021-03-16 12:48:45 +0000 | [diff] [blame] | 193 | scmi_reset_domain_deassert(const struct scmi_protocol_handle *ph, u32 domain) |
Sudeep Holla | 95a15d8 | 2019-07-08 09:41:06 +0100 | [diff] [blame] | 194 | { |
Cristian Marussi | 7e02934 | 2021-03-16 12:48:45 +0000 | [diff] [blame] | 195 | return scmi_domain_reset(ph, domain, 0, ARCH_COLD_RESET); |
| 196 | } |
| 197 | |
Cristian Marussi | 7e02934 | 2021-03-16 12:48:45 +0000 | [diff] [blame] | 198 | static const struct scmi_reset_proto_ops reset_proto_ops = { |
Sudeep Holla | 95a15d8 | 2019-07-08 09:41:06 +0100 | [diff] [blame] | 199 | .num_domains_get = scmi_reset_num_domains_get, |
| 200 | .name_get = scmi_reset_name_get, |
| 201 | .latency_get = scmi_reset_latency_get, |
| 202 | .reset = scmi_reset_domain_reset, |
| 203 | .assert = scmi_reset_domain_assert, |
| 204 | .deassert = scmi_reset_domain_deassert, |
| 205 | }; |
| 206 | |
Cristian Marussi | 7e02934 | 2021-03-16 12:48:45 +0000 | [diff] [blame] | 207 | static int scmi_reset_notify(const struct scmi_protocol_handle *ph, |
| 208 | u32 domain_id, bool enable) |
Cristian Marussi | 469ca18 | 2020-07-01 16:53:47 +0100 | [diff] [blame] | 209 | { |
| 210 | int ret; |
| 211 | u32 evt_cntl = enable ? RESET_TP_NOTIFY_ALL : 0; |
| 212 | struct scmi_xfer *t; |
| 213 | struct scmi_msg_reset_notify *cfg; |
| 214 | |
Cristian Marussi | 7e02934 | 2021-03-16 12:48:45 +0000 | [diff] [blame] | 215 | ret = ph->xops->xfer_get_init(ph, RESET_NOTIFY, sizeof(*cfg), 0, &t); |
Cristian Marussi | 469ca18 | 2020-07-01 16:53:47 +0100 | [diff] [blame] | 216 | if (ret) |
| 217 | return ret; |
| 218 | |
| 219 | cfg = t->tx.buf; |
| 220 | cfg->id = cpu_to_le32(domain_id); |
| 221 | cfg->event_control = cpu_to_le32(evt_cntl); |
| 222 | |
Cristian Marussi | 7e02934 | 2021-03-16 12:48:45 +0000 | [diff] [blame] | 223 | ret = ph->xops->do_xfer(ph, t); |
Cristian Marussi | 469ca18 | 2020-07-01 16:53:47 +0100 | [diff] [blame] | 224 | |
Cristian Marussi | 7e02934 | 2021-03-16 12:48:45 +0000 | [diff] [blame] | 225 | ph->xops->xfer_put(ph, t); |
Cristian Marussi | 469ca18 | 2020-07-01 16:53:47 +0100 | [diff] [blame] | 226 | return ret; |
| 227 | } |
| 228 | |
Cristian Marussi | 3cb8c95 | 2021-03-16 12:48:59 +0000 | [diff] [blame] | 229 | static int scmi_reset_set_notify_enabled(const struct scmi_protocol_handle *ph, |
Cristian Marussi | 469ca18 | 2020-07-01 16:53:47 +0100 | [diff] [blame] | 230 | u8 evt_id, u32 src_id, bool enable) |
| 231 | { |
| 232 | int ret; |
| 233 | |
Cristian Marussi | 7e02934 | 2021-03-16 12:48:45 +0000 | [diff] [blame] | 234 | ret = scmi_reset_notify(ph, src_id, enable); |
Cristian Marussi | 469ca18 | 2020-07-01 16:53:47 +0100 | [diff] [blame] | 235 | if (ret) |
| 236 | pr_debug("FAIL_ENABLED - evt[%X] dom[%d] - ret:%d\n", |
| 237 | evt_id, src_id, ret); |
| 238 | |
| 239 | return ret; |
| 240 | } |
| 241 | |
Cristian Marussi | 3cb8c95 | 2021-03-16 12:48:59 +0000 | [diff] [blame] | 242 | static void * |
| 243 | scmi_reset_fill_custom_report(const struct scmi_protocol_handle *ph, |
| 244 | u8 evt_id, ktime_t timestamp, |
| 245 | const void *payld, size_t payld_sz, |
| 246 | void *report, u32 *src_id) |
Cristian Marussi | 469ca18 | 2020-07-01 16:53:47 +0100 | [diff] [blame] | 247 | { |
| 248 | const struct scmi_reset_issued_notify_payld *p = payld; |
| 249 | struct scmi_reset_issued_report *r = report; |
| 250 | |
| 251 | if (evt_id != SCMI_EVENT_RESET_ISSUED || sizeof(*p) != payld_sz) |
| 252 | return NULL; |
| 253 | |
| 254 | r->timestamp = timestamp; |
| 255 | r->agent_id = le32_to_cpu(p->agent_id); |
| 256 | r->domain_id = le32_to_cpu(p->domain_id); |
| 257 | r->reset_state = le32_to_cpu(p->reset_state); |
| 258 | *src_id = r->domain_id; |
| 259 | |
| 260 | return r; |
| 261 | } |
| 262 | |
Cristian Marussi | 3cb8c95 | 2021-03-16 12:48:59 +0000 | [diff] [blame] | 263 | static int scmi_reset_get_num_sources(const struct scmi_protocol_handle *ph) |
Cristian Marussi | 533c709 | 2021-03-16 12:48:31 +0000 | [diff] [blame] | 264 | { |
Cristian Marussi | 3cb8c95 | 2021-03-16 12:48:59 +0000 | [diff] [blame] | 265 | struct scmi_reset_info *pinfo = ph->get_priv(ph); |
Cristian Marussi | 533c709 | 2021-03-16 12:48:31 +0000 | [diff] [blame] | 266 | |
| 267 | if (!pinfo) |
| 268 | return -EINVAL; |
| 269 | |
| 270 | return pinfo->num_domains; |
| 271 | } |
| 272 | |
Cristian Marussi | 469ca18 | 2020-07-01 16:53:47 +0100 | [diff] [blame] | 273 | static const struct scmi_event reset_events[] = { |
| 274 | { |
| 275 | .id = SCMI_EVENT_RESET_ISSUED, |
| 276 | .max_payld_sz = sizeof(struct scmi_reset_issued_notify_payld), |
| 277 | .max_report_sz = sizeof(struct scmi_reset_issued_report), |
| 278 | }, |
| 279 | }; |
| 280 | |
| 281 | static const struct scmi_event_ops reset_event_ops = { |
Cristian Marussi | 533c709 | 2021-03-16 12:48:31 +0000 | [diff] [blame] | 282 | .get_num_sources = scmi_reset_get_num_sources, |
Cristian Marussi | 469ca18 | 2020-07-01 16:53:47 +0100 | [diff] [blame] | 283 | .set_notify_enabled = scmi_reset_set_notify_enabled, |
| 284 | .fill_custom_report = scmi_reset_fill_custom_report, |
| 285 | }; |
| 286 | |
Cristian Marussi | 533c709 | 2021-03-16 12:48:31 +0000 | [diff] [blame] | 287 | static const struct scmi_protocol_events reset_protocol_events = { |
| 288 | .queue_sz = SCMI_PROTO_QUEUE_SZ, |
| 289 | .ops = &reset_event_ops, |
| 290 | .evts = reset_events, |
| 291 | .num_events = ARRAY_SIZE(reset_events), |
| 292 | }; |
| 293 | |
Cristian Marussi | 7e02934 | 2021-03-16 12:48:45 +0000 | [diff] [blame] | 294 | static int scmi_reset_protocol_init(const struct scmi_protocol_handle *ph) |
Sudeep Holla | 95a15d8 | 2019-07-08 09:41:06 +0100 | [diff] [blame] | 295 | { |
| 296 | int domain; |
| 297 | u32 version; |
| 298 | struct scmi_reset_info *pinfo; |
| 299 | |
Cristian Marussi | 7e02934 | 2021-03-16 12:48:45 +0000 | [diff] [blame] | 300 | ph->xops->version_get(ph, &version); |
Sudeep Holla | 95a15d8 | 2019-07-08 09:41:06 +0100 | [diff] [blame] | 301 | |
Cristian Marussi | 7e02934 | 2021-03-16 12:48:45 +0000 | [diff] [blame] | 302 | dev_dbg(ph->dev, "Reset Version %d.%d\n", |
Sudeep Holla | 95a15d8 | 2019-07-08 09:41:06 +0100 | [diff] [blame] | 303 | PROTOCOL_REV_MAJOR(version), PROTOCOL_REV_MINOR(version)); |
| 304 | |
Cristian Marussi | 7e02934 | 2021-03-16 12:48:45 +0000 | [diff] [blame] | 305 | pinfo = devm_kzalloc(ph->dev, sizeof(*pinfo), GFP_KERNEL); |
Sudeep Holla | 95a15d8 | 2019-07-08 09:41:06 +0100 | [diff] [blame] | 306 | if (!pinfo) |
| 307 | return -ENOMEM; |
| 308 | |
Cristian Marussi | 7e02934 | 2021-03-16 12:48:45 +0000 | [diff] [blame] | 309 | scmi_reset_attributes_get(ph, pinfo); |
Sudeep Holla | 95a15d8 | 2019-07-08 09:41:06 +0100 | [diff] [blame] | 310 | |
Cristian Marussi | 7e02934 | 2021-03-16 12:48:45 +0000 | [diff] [blame] | 311 | pinfo->dom_info = devm_kcalloc(ph->dev, pinfo->num_domains, |
Sudeep Holla | 95a15d8 | 2019-07-08 09:41:06 +0100 | [diff] [blame] | 312 | sizeof(*pinfo->dom_info), GFP_KERNEL); |
| 313 | if (!pinfo->dom_info) |
| 314 | return -ENOMEM; |
| 315 | |
| 316 | for (domain = 0; domain < pinfo->num_domains; domain++) { |
| 317 | struct reset_dom_info *dom = pinfo->dom_info + domain; |
| 318 | |
Cristian Marussi | 7e02934 | 2021-03-16 12:48:45 +0000 | [diff] [blame] | 319 | scmi_reset_domain_attributes_get(ph, domain, dom); |
Sudeep Holla | 95a15d8 | 2019-07-08 09:41:06 +0100 | [diff] [blame] | 320 | } |
| 321 | |
Sudeep Holla | b55b06b | 2019-11-22 14:48:40 +0000 | [diff] [blame] | 322 | pinfo->version = version; |
Cristian Marussi | 7e02934 | 2021-03-16 12:48:45 +0000 | [diff] [blame] | 323 | return ph->set_priv(ph, pinfo); |
Sudeep Holla | 95a15d8 | 2019-07-08 09:41:06 +0100 | [diff] [blame] | 324 | } |
| 325 | |
Cristian Marussi | 48dc16e | 2021-03-16 12:48:26 +0000 | [diff] [blame] | 326 | static const struct scmi_protocol scmi_reset = { |
| 327 | .id = SCMI_PROTOCOL_RESET, |
Cristian Marussi | f5800e0 | 2021-03-16 12:49:02 +0000 | [diff] [blame] | 328 | .owner = THIS_MODULE, |
Cristian Marussi | 7e02934 | 2021-03-16 12:48:45 +0000 | [diff] [blame] | 329 | .instance_init = &scmi_reset_protocol_init, |
| 330 | .ops = &reset_proto_ops, |
Cristian Marussi | 533c709 | 2021-03-16 12:48:31 +0000 | [diff] [blame] | 331 | .events = &reset_protocol_events, |
Cristian Marussi | 48dc16e | 2021-03-16 12:48:26 +0000 | [diff] [blame] | 332 | }; |
| 333 | |
| 334 | DEFINE_SCMI_PROTOCOL_REGISTER_UNREGISTER(reset, scmi_reset) |