1 // SPDX-License-Identifier: GPL-2.0
3 * System Control and Management Interface (SCMI) Message Protocol driver
5 * SCMI Message Protocol is used between the System Control Processor(SCP)
6 * and the Application Processors(AP). The Message Handling Unit(MHU)
7 * provides a mechanism for inter-processor communication between SCP's
10 * SCP offers control and management of the core/cluster power states,
11 * various power domain DVFS including the core/cluster, certain system
12 * clocks configuration, thermal sensors and many others.
14 * Copyright (C) 2018 ARM Ltd.
17 #include <linux/bitmap.h>
18 #include <linux/export.h>
20 #include <linux/kernel.h>
21 #include <linux/ktime.h>
22 #include <linux/module.h>
23 #include <linux/of_address.h>
24 #include <linux/of_device.h>
25 #include <linux/processor.h>
26 #include <linux/slab.h>
30 #define CREATE_TRACE_POINTS
31 #include <trace/events/scmi.h>
33 enum scmi_error_codes {
34 SCMI_SUCCESS = 0, /* Success */
35 SCMI_ERR_SUPPORT = -1, /* Not supported */
36 SCMI_ERR_PARAMS = -2, /* Invalid Parameters */
37 SCMI_ERR_ACCESS = -3, /* Invalid access/permission denied */
38 SCMI_ERR_ENTRY = -4, /* Not found */
39 SCMI_ERR_RANGE = -5, /* Value out of range */
40 SCMI_ERR_BUSY = -6, /* Device busy */
41 SCMI_ERR_COMMS = -7, /* Communication Error */
42 SCMI_ERR_GENERIC = -8, /* Generic Error */
43 SCMI_ERR_HARDWARE = -9, /* Hardware Error */
44 SCMI_ERR_PROTOCOL = -10,/* Protocol Error */
48 /* List of all SCMI devices active in system */
49 static LIST_HEAD(scmi_list);
50 /* Protection for the entire list */
51 static DEFINE_MUTEX(scmi_list_mutex);
52 /* Track the unique id for the transfers for debug & profiling purpose */
53 static atomic_t transfer_last_id;
56 * struct scmi_xfers_info - Structure to manage transfer information
58 * @xfer_block: Preallocated Message array
59 * @xfer_alloc_table: Bitmap table for allocated messages.
60 * Index of this bitmap table is also used for message
61 * sequence identifier.
62 * @xfer_lock: Protection for message allocation
64 struct scmi_xfers_info {
65 struct scmi_xfer *xfer_block;
66 unsigned long *xfer_alloc_table;
71 * struct scmi_info - Structure representing a SCMI instance
73 * @dev: Device pointer
74 * @desc: SoC description for this instance
75 * @version: SCMI revision information containing protocol version,
76 * implementation version and (sub-)vendor identification.
77 * @handle: Instance of SCMI handle to send to clients
78 * @tx_minfo: Universal Transmit Message management info
79 * @tx_idr: IDR object to map protocol id to Tx channel info pointer
80 * @rx_idr: IDR object to map protocol id to Rx channel info pointer
81 * @protocols_imp: List of protocols implemented, currently maximum of
82 * MAX_PROTOCOLS_IMP elements allocated by the base protocol
84 * @users: Number of users of this instance
88 const struct scmi_desc *desc;
89 struct scmi_revision_info version;
90 struct scmi_handle handle;
91 struct scmi_xfers_info tx_minfo;
95 struct list_head node;
99 #define handle_to_scmi_info(h) container_of(h, struct scmi_info, handle)
101 static const int scmi_linux_errmap[] = {
102 /* better than switch case as long as return value is continuous */
103 0, /* SCMI_SUCCESS */
104 -EOPNOTSUPP, /* SCMI_ERR_SUPPORT */
105 -EINVAL, /* SCMI_ERR_PARAM */
106 -EACCES, /* SCMI_ERR_ACCESS */
107 -ENOENT, /* SCMI_ERR_ENTRY */
108 -ERANGE, /* SCMI_ERR_RANGE */
109 -EBUSY, /* SCMI_ERR_BUSY */
110 -ECOMM, /* SCMI_ERR_COMMS */
111 -EIO, /* SCMI_ERR_GENERIC */
112 -EREMOTEIO, /* SCMI_ERR_HARDWARE */
113 -EPROTO, /* SCMI_ERR_PROTOCOL */
116 static inline int scmi_to_linux_errno(int errno)
118 if (errno < SCMI_SUCCESS && errno > SCMI_ERR_MAX)
119 return scmi_linux_errmap[-errno];
124 * scmi_dump_header_dbg() - Helper to dump a message header.
126 * @dev: Device pointer corresponding to the SCMI entity
127 * @hdr: pointer to header.
129 static inline void scmi_dump_header_dbg(struct device *dev,
130 struct scmi_msg_hdr *hdr)
132 dev_dbg(dev, "Message ID: %x Sequence ID: %x Protocol: %x\n",
133 hdr->id, hdr->seq, hdr->protocol_id);
137 * scmi_xfer_get() - Allocate one message
139 * @handle: Pointer to SCMI entity handle
140 * @minfo: Pointer to Tx/Rx Message management info based on channel type
142 * Helper function which is used by various message functions that are
143 * exposed to clients of this driver for allocating a message traffic event.
145 * This function can sleep depending on pending requests already in the system
146 * for the SCMI entity. Further, this also holds a spinlock to maintain
147 * integrity of internal data structures.
149 * Return: 0 if all went fine, else corresponding error.
151 static struct scmi_xfer *scmi_xfer_get(const struct scmi_handle *handle,
152 struct scmi_xfers_info *minfo)
155 struct scmi_xfer *xfer;
156 unsigned long flags, bit_pos;
157 struct scmi_info *info = handle_to_scmi_info(handle);
159 /* Keep the locked section as small as possible */
160 spin_lock_irqsave(&minfo->xfer_lock, flags);
161 bit_pos = find_first_zero_bit(minfo->xfer_alloc_table,
162 info->desc->max_msg);
163 if (bit_pos == info->desc->max_msg) {
164 spin_unlock_irqrestore(&minfo->xfer_lock, flags);
165 return ERR_PTR(-ENOMEM);
167 set_bit(bit_pos, minfo->xfer_alloc_table);
168 spin_unlock_irqrestore(&minfo->xfer_lock, flags);
172 xfer = &minfo->xfer_block[xfer_id];
173 xfer->hdr.seq = xfer_id;
174 reinit_completion(&xfer->done);
175 xfer->transfer_id = atomic_inc_return(&transfer_last_id);
181 * __scmi_xfer_put() - Release a message
183 * @minfo: Pointer to Tx/Rx Message management info based on channel type
184 * @xfer: message that was reserved by scmi_xfer_get
186 * This holds a spinlock to maintain integrity of internal data structures.
189 __scmi_xfer_put(struct scmi_xfers_info *minfo, struct scmi_xfer *xfer)
194 * Keep the locked section as small as possible
195 * NOTE: we might escape with smp_mb and no lock here..
196 * but just be conservative and symmetric.
198 spin_lock_irqsave(&minfo->xfer_lock, flags);
199 clear_bit(xfer->hdr.seq, minfo->xfer_alloc_table);
200 spin_unlock_irqrestore(&minfo->xfer_lock, flags);
204 * scmi_rx_callback() - callback for receiving messages
206 * @cinfo: SCMI channel info
207 * @msg_hdr: Message header
209 * Processes one received message to appropriate transfer information and
210 * signals completion of the transfer.
212 * NOTE: This function will be invoked in IRQ context, hence should be
213 * as optimal as possible.
215 void scmi_rx_callback(struct scmi_chan_info *cinfo, u32 msg_hdr)
217 struct scmi_info *info = handle_to_scmi_info(cinfo->handle);
218 struct scmi_xfers_info *minfo = &info->tx_minfo;
219 u16 xfer_id = MSG_XTRACT_TOKEN(msg_hdr);
220 u8 msg_type = MSG_XTRACT_TYPE(msg_hdr);
221 struct device *dev = cinfo->dev;
222 struct scmi_xfer *xfer;
224 if (msg_type == MSG_TYPE_NOTIFICATION)
225 return; /* Notifications not yet supported */
227 /* Are we even expecting this? */
228 if (!test_bit(xfer_id, minfo->xfer_alloc_table)) {
229 dev_err(dev, "message for %d is not expected!\n", xfer_id);
233 xfer = &minfo->xfer_block[xfer_id];
235 scmi_dump_header_dbg(dev, &xfer->hdr);
237 info->desc->ops->fetch_response(cinfo, xfer);
239 trace_scmi_rx_done(xfer->transfer_id, xfer->hdr.id,
240 xfer->hdr.protocol_id, xfer->hdr.seq,
243 if (msg_type == MSG_TYPE_DELAYED_RESP)
244 complete(xfer->async_done);
246 complete(&xfer->done);
250 * scmi_xfer_put() - Release a transmit message
252 * @handle: Pointer to SCMI entity handle
253 * @xfer: message that was reserved by scmi_xfer_get
255 void scmi_xfer_put(const struct scmi_handle *handle, struct scmi_xfer *xfer)
257 struct scmi_info *info = handle_to_scmi_info(handle);
259 __scmi_xfer_put(&info->tx_minfo, xfer);
262 #define SCMI_MAX_POLL_TO_NS (100 * NSEC_PER_USEC)
264 static bool scmi_xfer_done_no_timeout(struct scmi_chan_info *cinfo,
265 struct scmi_xfer *xfer, ktime_t stop)
267 struct scmi_info *info = handle_to_scmi_info(cinfo->handle);
269 return info->desc->ops->poll_done(cinfo, xfer) ||
270 ktime_after(ktime_get(), stop);
274 * scmi_do_xfer() - Do one transfer
276 * @handle: Pointer to SCMI entity handle
277 * @xfer: Transfer to initiate and wait for response
279 * Return: -ETIMEDOUT in case of no response, if transmit error,
280 * return corresponding error, else if all goes well,
283 int scmi_do_xfer(const struct scmi_handle *handle, struct scmi_xfer *xfer)
287 struct scmi_info *info = handle_to_scmi_info(handle);
288 struct device *dev = info->dev;
289 struct scmi_chan_info *cinfo;
291 cinfo = idr_find(&info->tx_idr, xfer->hdr.protocol_id);
292 if (unlikely(!cinfo))
295 trace_scmi_xfer_begin(xfer->transfer_id, xfer->hdr.id,
296 xfer->hdr.protocol_id, xfer->hdr.seq,
297 xfer->hdr.poll_completion);
299 ret = info->desc->ops->send_message(cinfo, xfer);
301 dev_dbg(dev, "Failed to send message %d\n", ret);
305 if (xfer->hdr.poll_completion) {
306 ktime_t stop = ktime_add_ns(ktime_get(), SCMI_MAX_POLL_TO_NS);
308 spin_until_cond(scmi_xfer_done_no_timeout(cinfo, xfer, stop));
310 if (ktime_before(ktime_get(), stop))
311 info->desc->ops->fetch_response(cinfo, xfer);
315 /* And we wait for the response. */
316 timeout = msecs_to_jiffies(info->desc->max_rx_timeout_ms);
317 if (!wait_for_completion_timeout(&xfer->done, timeout)) {
318 dev_err(dev, "timed out in resp(caller: %pS)\n",
324 if (!ret && xfer->hdr.status)
325 ret = scmi_to_linux_errno(xfer->hdr.status);
327 if (info->desc->ops->mark_txdone)
328 info->desc->ops->mark_txdone(cinfo, ret);
330 trace_scmi_xfer_end(xfer->transfer_id, xfer->hdr.id,
331 xfer->hdr.protocol_id, xfer->hdr.seq,
337 #define SCMI_MAX_RESPONSE_TIMEOUT (2 * MSEC_PER_SEC)
340 * scmi_do_xfer_with_response() - Do one transfer and wait until the delayed
341 * response is received
343 * @handle: Pointer to SCMI entity handle
344 * @xfer: Transfer to initiate and wait for response
346 * Return: -ETIMEDOUT in case of no delayed response, if transmit error,
347 * return corresponding error, else if all goes well, return 0.
349 int scmi_do_xfer_with_response(const struct scmi_handle *handle,
350 struct scmi_xfer *xfer)
352 int ret, timeout = msecs_to_jiffies(SCMI_MAX_RESPONSE_TIMEOUT);
353 DECLARE_COMPLETION_ONSTACK(async_response);
355 xfer->async_done = &async_response;
357 ret = scmi_do_xfer(handle, xfer);
358 if (!ret && !wait_for_completion_timeout(xfer->async_done, timeout))
361 xfer->async_done = NULL;
366 * scmi_xfer_get_init() - Allocate and initialise one message for transmit
368 * @handle: Pointer to SCMI entity handle
369 * @msg_id: Message identifier
370 * @prot_id: Protocol identifier for the message
371 * @tx_size: transmit message size
372 * @rx_size: receive message size
373 * @p: pointer to the allocated and initialised message
375 * This function allocates the message using @scmi_xfer_get and
376 * initialise the header.
378 * Return: 0 if all went fine with @p pointing to message, else
379 * corresponding error.
381 int scmi_xfer_get_init(const struct scmi_handle *handle, u8 msg_id, u8 prot_id,
382 size_t tx_size, size_t rx_size, struct scmi_xfer **p)
385 struct scmi_xfer *xfer;
386 struct scmi_info *info = handle_to_scmi_info(handle);
387 struct scmi_xfers_info *minfo = &info->tx_minfo;
388 struct device *dev = info->dev;
390 /* Ensure we have sane transfer sizes */
391 if (rx_size > info->desc->max_msg_size ||
392 tx_size > info->desc->max_msg_size)
395 xfer = scmi_xfer_get(handle, minfo);
398 dev_err(dev, "failed to get free message slot(%d)\n", ret);
402 xfer->tx.len = tx_size;
403 xfer->rx.len = rx_size ? : info->desc->max_msg_size;
404 xfer->hdr.id = msg_id;
405 xfer->hdr.protocol_id = prot_id;
406 xfer->hdr.poll_completion = false;
414 * scmi_version_get() - command to get the revision of the SCMI entity
416 * @handle: Pointer to SCMI entity handle
417 * @protocol: Protocol identifier for the message
418 * @version: Holds returned version of protocol.
420 * Updates the SCMI information in the internal data structure.
422 * Return: 0 if all went fine, else return appropriate error.
424 int scmi_version_get(const struct scmi_handle *handle, u8 protocol,
431 ret = scmi_xfer_get_init(handle, PROTOCOL_VERSION, protocol, 0,
432 sizeof(*version), &t);
436 ret = scmi_do_xfer(handle, t);
438 rev_info = t->rx.buf;
439 *version = le32_to_cpu(*rev_info);
442 scmi_xfer_put(handle, t);
446 void scmi_setup_protocol_implemented(const struct scmi_handle *handle,
449 struct scmi_info *info = handle_to_scmi_info(handle);
451 info->protocols_imp = prot_imp;
455 scmi_is_protocol_implemented(const struct scmi_handle *handle, u8 prot_id)
458 struct scmi_info *info = handle_to_scmi_info(handle);
460 if (!info->protocols_imp)
463 for (i = 0; i < MAX_PROTOCOLS_IMP; i++)
464 if (info->protocols_imp[i] == prot_id)
470 * scmi_handle_get() - Get the SCMI handle for a device
472 * @dev: pointer to device for which we want SCMI handle
474 * NOTE: The function does not track individual clients of the framework
475 * and is expected to be maintained by caller of SCMI protocol library.
476 * scmi_handle_put must be balanced with successful scmi_handle_get
478 * Return: pointer to handle if successful, NULL on error
480 struct scmi_handle *scmi_handle_get(struct device *dev)
483 struct scmi_info *info;
484 struct scmi_handle *handle = NULL;
486 mutex_lock(&scmi_list_mutex);
487 list_for_each(p, &scmi_list) {
488 info = list_entry(p, struct scmi_info, node);
489 if (dev->parent == info->dev) {
490 handle = &info->handle;
495 mutex_unlock(&scmi_list_mutex);
501 * scmi_handle_put() - Release the handle acquired by scmi_handle_get
503 * @handle: handle acquired by scmi_handle_get
505 * NOTE: The function does not track individual clients of the framework
506 * and is expected to be maintained by caller of SCMI protocol library.
507 * scmi_handle_put must be balanced with successful scmi_handle_get
509 * Return: 0 is successfully released
510 * if null was passed, it returns -EINVAL;
512 int scmi_handle_put(const struct scmi_handle *handle)
514 struct scmi_info *info;
519 info = handle_to_scmi_info(handle);
520 mutex_lock(&scmi_list_mutex);
521 if (!WARN_ON(!info->users))
523 mutex_unlock(&scmi_list_mutex);
528 static int scmi_xfer_info_init(struct scmi_info *sinfo)
531 struct scmi_xfer *xfer;
532 struct device *dev = sinfo->dev;
533 const struct scmi_desc *desc = sinfo->desc;
534 struct scmi_xfers_info *info = &sinfo->tx_minfo;
536 /* Pre-allocated messages, no more than what hdr.seq can support */
537 if (WARN_ON(desc->max_msg >= MSG_TOKEN_MAX)) {
538 dev_err(dev, "Maximum message of %d exceeds supported %ld\n",
539 desc->max_msg, MSG_TOKEN_MAX);
543 info->xfer_block = devm_kcalloc(dev, desc->max_msg,
544 sizeof(*info->xfer_block), GFP_KERNEL);
545 if (!info->xfer_block)
548 info->xfer_alloc_table = devm_kcalloc(dev, BITS_TO_LONGS(desc->max_msg),
549 sizeof(long), GFP_KERNEL);
550 if (!info->xfer_alloc_table)
553 /* Pre-initialize the buffer pointer to pre-allocated buffers */
554 for (i = 0, xfer = info->xfer_block; i < desc->max_msg; i++, xfer++) {
555 xfer->rx.buf = devm_kcalloc(dev, sizeof(u8), desc->max_msg_size,
560 xfer->tx.buf = xfer->rx.buf;
561 init_completion(&xfer->done);
564 spin_lock_init(&info->xfer_lock);
569 static int scmi_chan_setup(struct scmi_info *info, struct device *dev,
570 int prot_id, bool tx)
573 struct scmi_chan_info *cinfo;
576 /* Transmit channel is first entry i.e. index 0 */
578 idr = tx ? &info->tx_idr : &info->rx_idr;
580 /* check if already allocated, used for multiple device per protocol */
581 cinfo = idr_find(idr, prot_id);
585 if (!info->desc->ops->chan_available(dev, idx)) {
586 cinfo = idr_find(idr, SCMI_PROTOCOL_BASE);
587 if (unlikely(!cinfo)) /* Possible only if platform has no Rx */
592 cinfo = devm_kzalloc(info->dev, sizeof(*cinfo), GFP_KERNEL);
598 ret = info->desc->ops->chan_setup(cinfo, info->dev, tx);
603 ret = idr_alloc(idr, cinfo, prot_id, prot_id + 1, GFP_KERNEL);
604 if (ret != prot_id) {
605 dev_err(dev, "unable to allocate SCMI idr slot err %d\n", ret);
609 cinfo->handle = &info->handle;
614 scmi_txrx_setup(struct scmi_info *info, struct device *dev, int prot_id)
616 int ret = scmi_chan_setup(info, dev, prot_id, true);
618 if (!ret) /* Rx is optional, hence no error check */
619 scmi_chan_setup(info, dev, prot_id, false);
625 scmi_create_protocol_device(struct device_node *np, struct scmi_info *info,
626 int prot_id, const char *name)
628 struct scmi_device *sdev;
630 sdev = scmi_device_create(np, info->dev, prot_id, name);
632 dev_err(info->dev, "failed to create %d protocol device\n",
637 if (scmi_txrx_setup(info, &sdev->dev, prot_id)) {
638 dev_err(&sdev->dev, "failed to setup transport\n");
639 scmi_device_destroy(sdev);
643 /* setup handle now as the transport is ready */
644 scmi_set_handle(sdev);
647 #define MAX_SCMI_DEV_PER_PROTOCOL 2
648 struct scmi_prot_devnames {
650 char *names[MAX_SCMI_DEV_PER_PROTOCOL];
653 static struct scmi_prot_devnames devnames[] = {
654 { SCMI_PROTOCOL_POWER, { "genpd" },},
655 { SCMI_PROTOCOL_PERF, { "cpufreq" },},
656 { SCMI_PROTOCOL_CLOCK, { "clocks" },},
657 { SCMI_PROTOCOL_SENSOR, { "hwmon" },},
658 { SCMI_PROTOCOL_RESET, { "reset" },},
662 scmi_create_protocol_devices(struct device_node *np, struct scmi_info *info,
667 for (loop = 0; loop < ARRAY_SIZE(devnames); loop++) {
668 if (devnames[loop].protocol_id != prot_id)
671 for (cnt = 0; cnt < ARRAY_SIZE(devnames[loop].names); cnt++) {
672 const char *name = devnames[loop].names[cnt];
675 scmi_create_protocol_device(np, info, prot_id,
681 static int scmi_probe(struct platform_device *pdev)
684 struct scmi_handle *handle;
685 const struct scmi_desc *desc;
686 struct scmi_info *info;
687 struct device *dev = &pdev->dev;
688 struct device_node *child, *np = dev->of_node;
690 desc = of_device_get_match_data(dev);
694 info = devm_kzalloc(dev, sizeof(*info), GFP_KERNEL);
700 INIT_LIST_HEAD(&info->node);
702 ret = scmi_xfer_info_init(info);
706 platform_set_drvdata(pdev, info);
707 idr_init(&info->tx_idr);
708 idr_init(&info->rx_idr);
710 handle = &info->handle;
711 handle->dev = info->dev;
712 handle->version = &info->version;
714 ret = scmi_txrx_setup(info, dev, SCMI_PROTOCOL_BASE);
718 ret = scmi_base_protocol_init(handle);
720 dev_err(dev, "unable to communicate with SCMI(%d)\n", ret);
724 mutex_lock(&scmi_list_mutex);
725 list_add_tail(&info->node, &scmi_list);
726 mutex_unlock(&scmi_list_mutex);
728 for_each_available_child_of_node(np, child) {
731 if (of_property_read_u32(child, "reg", &prot_id))
734 if (!FIELD_FIT(MSG_PROTOCOL_ID_MASK, prot_id))
735 dev_err(dev, "Out of range protocol %d\n", prot_id);
737 if (!scmi_is_protocol_implemented(handle, prot_id)) {
738 dev_err(dev, "SCMI protocol %d not implemented\n",
743 scmi_create_protocol_devices(child, info, prot_id);
749 void scmi_free_channel(struct scmi_chan_info *cinfo, struct idr *idr, int id)
754 static int scmi_remove(struct platform_device *pdev)
757 struct scmi_info *info = platform_get_drvdata(pdev);
758 struct idr *idr = &info->tx_idr;
760 mutex_lock(&scmi_list_mutex);
764 list_del(&info->node);
765 mutex_unlock(&scmi_list_mutex);
770 /* Safe to free channels since no more users */
771 ret = idr_for_each(idr, info->desc->ops->chan_free, idr);
772 idr_destroy(&info->tx_idr);
775 ret = idr_for_each(idr, info->desc->ops->chan_free, idr);
776 idr_destroy(&info->rx_idr);
781 static ssize_t protocol_version_show(struct device *dev,
782 struct device_attribute *attr, char *buf)
784 struct scmi_info *info = dev_get_drvdata(dev);
786 return sprintf(buf, "%u.%u\n", info->version.major_ver,
787 info->version.minor_ver);
789 static DEVICE_ATTR_RO(protocol_version);
791 static ssize_t firmware_version_show(struct device *dev,
792 struct device_attribute *attr, char *buf)
794 struct scmi_info *info = dev_get_drvdata(dev);
796 return sprintf(buf, "0x%x\n", info->version.impl_ver);
798 static DEVICE_ATTR_RO(firmware_version);
800 static ssize_t vendor_id_show(struct device *dev,
801 struct device_attribute *attr, char *buf)
803 struct scmi_info *info = dev_get_drvdata(dev);
805 return sprintf(buf, "%s\n", info->version.vendor_id);
807 static DEVICE_ATTR_RO(vendor_id);
809 static ssize_t sub_vendor_id_show(struct device *dev,
810 struct device_attribute *attr, char *buf)
812 struct scmi_info *info = dev_get_drvdata(dev);
814 return sprintf(buf, "%s\n", info->version.sub_vendor_id);
816 static DEVICE_ATTR_RO(sub_vendor_id);
818 static struct attribute *versions_attrs[] = {
819 &dev_attr_firmware_version.attr,
820 &dev_attr_protocol_version.attr,
821 &dev_attr_vendor_id.attr,
822 &dev_attr_sub_vendor_id.attr,
825 ATTRIBUTE_GROUPS(versions);
827 /* Each compatible listed below must have descriptor associated with it */
828 static const struct of_device_id scmi_of_match[] = {
829 { .compatible = "arm,scmi", .data = &scmi_mailbox_desc },
833 MODULE_DEVICE_TABLE(of, scmi_of_match);
835 static struct platform_driver scmi_driver = {
838 .of_match_table = scmi_of_match,
839 .dev_groups = versions_groups,
842 .remove = scmi_remove,
845 module_platform_driver(scmi_driver);
847 MODULE_ALIAS("platform: arm-scmi");
848 MODULE_AUTHOR("Sudeep Holla <sudeep.holla@arm.com>");
849 MODULE_DESCRIPTION("ARM SCMI protocol driver");
850 MODULE_LICENSE("GPL v2");