aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-05-21 13:32:48 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-05-21 13:32:48 -0400
commit10cd7158042bf9c949c19dbf0c7ee600d198ed39 (patch)
tree46309a82e4bf43d74c2092d9292987ad84d85418
parent51e68d055cbabfd36cba3903fd2a223bc98514b1 (diff)
parentc430cf376fee0b03d9c9293615f9737649de1b12 (diff)
Merge branch 'mailbox-for-next' of git://git.linaro.org/landing-teams/working/fujitsu/integration
Pull mailbox updates from Jassi Brar: "OMAP: - Remove non-DT support from mailbox driver - Move PM from client calls to native driver suspend/resume - Trivial cleanups to make checkpatch happy STI: - Check return from devm_ioremap_resource as ERR_PTR, not NULL" * 'mailbox-for-next' of git://git.linaro.org/landing-teams/working/fujitsu/integration: mailbox: Fix devm_ioremap_resource error detection code mailbox/omap: kill omap_mbox_{save/restore}_ctx() functions mailbox/omap: check for any unread messages during suspend mailbox/omap: add support for suspend/resume mailbox/omap: store mailbox interrupt type in omap_mbox_device mailbox/omap: add blank lines after declarations mailbox/omap: remove FSF mailing address paragraph mailbox/omap: use variable name for sizeof() operator mailbox/omap: drop legacy platform device support
-rw-r--r--drivers/mailbox/mailbox-sti.c4
-rw-r--r--drivers/mailbox/omap-mailbox.c220
-rw-r--r--include/linux/omap-mailbox.h2
-rw-r--r--include/linux/platform_data/mailbox-omap.h58
4 files changed, 104 insertions, 180 deletions
diff --git a/drivers/mailbox/mailbox-sti.c b/drivers/mailbox/mailbox-sti.c
index 2394cfe892b6..a334db5c9f1c 100644
--- a/drivers/mailbox/mailbox-sti.c
+++ b/drivers/mailbox/mailbox-sti.c
@@ -430,8 +430,8 @@ static int sti_mbox_probe(struct platform_device *pdev)
430 430
431 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 431 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
432 mdev->base = devm_ioremap_resource(&pdev->dev, res); 432 mdev->base = devm_ioremap_resource(&pdev->dev, res);
433 if (!mdev->base) 433 if (IS_ERR(mdev->base))
434 return -ENOMEM; 434 return PTR_ERR(mdev->base);
435 435
436 ret = of_property_read_string(np, "mbox-name", &mdev->name); 436 ret = of_property_read_string(np, "mbox-name", &mdev->name);
437 if (ret) 437 if (ret)
diff --git a/drivers/mailbox/omap-mailbox.c b/drivers/mailbox/omap-mailbox.c
index b7f636f15cac..c5e8b9cb170d 100644
--- a/drivers/mailbox/omap-mailbox.c
+++ b/drivers/mailbox/omap-mailbox.c
@@ -2,7 +2,7 @@
2 * OMAP mailbox driver 2 * OMAP mailbox driver
3 * 3 *
4 * Copyright (C) 2006-2009 Nokia Corporation. All rights reserved. 4 * Copyright (C) 2006-2009 Nokia Corporation. All rights reserved.
5 * Copyright (C) 2013-2014 Texas Instruments Inc. 5 * Copyright (C) 2013-2016 Texas Instruments Incorporated - http://www.ti.com
6 * 6 *
7 * Contact: Hiroshi DOYU <Hiroshi.DOYU@nokia.com> 7 * Contact: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
8 * Suman Anna <s-anna@ti.com> 8 * Suman Anna <s-anna@ti.com>
@@ -15,12 +15,6 @@
15 * WITHOUT ANY WARRANTY; without even the implied warranty of 15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details. 17 * General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
22 * 02110-1301 USA
23 *
24 */ 18 */
25 19
26#include <linux/interrupt.h> 20#include <linux/interrupt.h>
@@ -33,7 +27,6 @@
33#include <linux/of_device.h> 27#include <linux/of_device.h>
34#include <linux/platform_device.h> 28#include <linux/platform_device.h>
35#include <linux/pm_runtime.h> 29#include <linux/pm_runtime.h>
36#include <linux/platform_data/mailbox-omap.h>
37#include <linux/omap-mailbox.h> 30#include <linux/omap-mailbox.h>
38#include <linux/mailbox_controller.h> 31#include <linux/mailbox_controller.h>
39#include <linux/mailbox_client.h> 32#include <linux/mailbox_client.h>
@@ -62,12 +55,9 @@
62#define MAILBOX_IRQ_NEWMSG(m) (1 << (2 * (m))) 55#define MAILBOX_IRQ_NEWMSG(m) (1 << (2 * (m)))
63#define MAILBOX_IRQ_NOTFULL(m) (1 << (2 * (m) + 1)) 56#define MAILBOX_IRQ_NOTFULL(m) (1 << (2 * (m) + 1))
64 57
65#define MBOX_REG_SIZE 0x120 58/* Interrupt register configuration types */
66 59#define MBOX_INTR_CFG_TYPE1 0
67#define OMAP4_MBOX_REG_SIZE 0x130 60#define MBOX_INTR_CFG_TYPE2 1
68
69#define MBOX_NR_REGS (MBOX_REG_SIZE / sizeof(u32))
70#define OMAP4_MBOX_NR_REGS (OMAP4_MBOX_REG_SIZE / sizeof(u32))
71 61
72struct omap_mbox_fifo { 62struct omap_mbox_fifo {
73 unsigned long msg; 63 unsigned long msg;
@@ -91,8 +81,10 @@ struct omap_mbox_device {
91 struct device *dev; 81 struct device *dev;
92 struct mutex cfg_lock; 82 struct mutex cfg_lock;
93 void __iomem *mbox_base; 83 void __iomem *mbox_base;
84 u32 *irq_ctx;
94 u32 num_users; 85 u32 num_users;
95 u32 num_fifos; 86 u32 num_fifos;
87 u32 intr_type;
96 struct omap_mbox **mboxes; 88 struct omap_mbox **mboxes;
97 struct mbox_controller controller; 89 struct mbox_controller controller;
98 struct list_head elem; 90 struct list_head elem;
@@ -119,7 +111,6 @@ struct omap_mbox {
119 struct omap_mbox_device *parent; 111 struct omap_mbox_device *parent;
120 struct omap_mbox_fifo tx_fifo; 112 struct omap_mbox_fifo tx_fifo;
121 struct omap_mbox_fifo rx_fifo; 113 struct omap_mbox_fifo rx_fifo;
122 u32 ctx[OMAP4_MBOX_NR_REGS];
123 u32 intr_type; 114 u32 intr_type;
124 struct mbox_chan *chan; 115 struct mbox_chan *chan;
125 bool send_no_irq; 116 bool send_no_irq;
@@ -157,24 +148,28 @@ void mbox_write_reg(struct omap_mbox_device *mdev, u32 val, size_t ofs)
157static mbox_msg_t mbox_fifo_read(struct omap_mbox *mbox) 148static mbox_msg_t mbox_fifo_read(struct omap_mbox *mbox)
158{ 149{
159 struct omap_mbox_fifo *fifo = &mbox->rx_fifo; 150 struct omap_mbox_fifo *fifo = &mbox->rx_fifo;
160 return (mbox_msg_t) mbox_read_reg(mbox->parent, fifo->msg); 151
152 return (mbox_msg_t)mbox_read_reg(mbox->parent, fifo->msg);
161} 153}
162 154
163static void mbox_fifo_write(struct omap_mbox *mbox, mbox_msg_t msg) 155static void mbox_fifo_write(struct omap_mbox *mbox, mbox_msg_t msg)
164{ 156{
165 struct omap_mbox_fifo *fifo = &mbox->tx_fifo; 157 struct omap_mbox_fifo *fifo = &mbox->tx_fifo;
158
166 mbox_write_reg(mbox->parent, msg, fifo->msg); 159 mbox_write_reg(mbox->parent, msg, fifo->msg);
167} 160}
168 161
169static int mbox_fifo_empty(struct omap_mbox *mbox) 162static int mbox_fifo_empty(struct omap_mbox *mbox)
170{ 163{
171 struct omap_mbox_fifo *fifo = &mbox->rx_fifo; 164 struct omap_mbox_fifo *fifo = &mbox->rx_fifo;
165
172 return (mbox_read_reg(mbox->parent, fifo->msg_stat) == 0); 166 return (mbox_read_reg(mbox->parent, fifo->msg_stat) == 0);
173} 167}
174 168
175static int mbox_fifo_full(struct omap_mbox *mbox) 169static int mbox_fifo_full(struct omap_mbox *mbox)
176{ 170{
177 struct omap_mbox_fifo *fifo = &mbox->tx_fifo; 171 struct omap_mbox_fifo *fifo = &mbox->tx_fifo;
172
178 return mbox_read_reg(mbox->parent, fifo->fifo_stat); 173 return mbox_read_reg(mbox->parent, fifo->fifo_stat);
179} 174}
180 175
@@ -206,49 +201,6 @@ static int is_mbox_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq)
206 return (int)(enable & status & bit); 201 return (int)(enable & status & bit);
207} 202}
208 203
209void omap_mbox_save_ctx(struct mbox_chan *chan)
210{
211 int i;
212 int nr_regs;
213 struct omap_mbox *mbox = mbox_chan_to_omap_mbox(chan);
214
215 if (WARN_ON(!mbox))
216 return;
217
218 if (mbox->intr_type)
219 nr_regs = OMAP4_MBOX_NR_REGS;
220 else
221 nr_regs = MBOX_NR_REGS;
222 for (i = 0; i < nr_regs; i++) {
223 mbox->ctx[i] = mbox_read_reg(mbox->parent, i * sizeof(u32));
224
225 dev_dbg(mbox->dev, "%s: [%02x] %08x\n", __func__,
226 i, mbox->ctx[i]);
227 }
228}
229EXPORT_SYMBOL(omap_mbox_save_ctx);
230
231void omap_mbox_restore_ctx(struct mbox_chan *chan)
232{
233 int i;
234 int nr_regs;
235 struct omap_mbox *mbox = mbox_chan_to_omap_mbox(chan);
236
237 if (WARN_ON(!mbox))
238 return;
239
240 if (mbox->intr_type)
241 nr_regs = OMAP4_MBOX_NR_REGS;
242 else
243 nr_regs = MBOX_NR_REGS;
244 for (i = 0; i < nr_regs; i++) {
245 mbox_write_reg(mbox->parent, mbox->ctx[i], i * sizeof(u32));
246 dev_dbg(mbox->dev, "%s: [%02x] %08x\n", __func__,
247 i, mbox->ctx[i]);
248 }
249}
250EXPORT_SYMBOL(omap_mbox_restore_ctx);
251
252static void _omap_mbox_enable_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq) 204static void _omap_mbox_enable_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq)
253{ 205{
254 u32 l; 206 u32 l;
@@ -381,7 +333,7 @@ static struct omap_mbox_queue *mbox_queue_alloc(struct omap_mbox *mbox,
381 if (!work) 333 if (!work)
382 return NULL; 334 return NULL;
383 335
384 mq = kzalloc(sizeof(struct omap_mbox_queue), GFP_KERNEL); 336 mq = kzalloc(sizeof(*mq), GFP_KERNEL);
385 if (!mq) 337 if (!mq)
386 return NULL; 338 return NULL;
387 339
@@ -525,6 +477,7 @@ static int omap_mbox_register(struct omap_mbox_device *mdev)
525 mboxes = mdev->mboxes; 477 mboxes = mdev->mboxes;
526 for (i = 0; mboxes[i]; i++) { 478 for (i = 0; mboxes[i]; i++) {
527 struct omap_mbox *mbox = mboxes[i]; 479 struct omap_mbox *mbox = mboxes[i];
480
528 mbox->dev = device_create(&omap_mbox_class, mdev->dev, 481 mbox->dev = device_create(&omap_mbox_class, mdev->dev,
529 0, mbox, "%s", mbox->name); 482 0, mbox, "%s", mbox->name);
530 if (IS_ERR(mbox->dev)) { 483 if (IS_ERR(mbox->dev)) {
@@ -647,6 +600,52 @@ static const struct mbox_chan_ops omap_mbox_chan_ops = {
647 .shutdown = omap_mbox_chan_shutdown, 600 .shutdown = omap_mbox_chan_shutdown,
648}; 601};
649 602
603#ifdef CONFIG_PM_SLEEP
604static int omap_mbox_suspend(struct device *dev)
605{
606 struct omap_mbox_device *mdev = dev_get_drvdata(dev);
607 u32 usr, fifo, reg;
608
609 if (pm_runtime_status_suspended(dev))
610 return 0;
611
612 for (fifo = 0; fifo < mdev->num_fifos; fifo++) {
613 if (mbox_read_reg(mdev, MAILBOX_MSGSTATUS(fifo))) {
614 dev_err(mdev->dev, "fifo %d has unexpected unread messages\n",
615 fifo);
616 return -EBUSY;
617 }
618 }
619
620 for (usr = 0; usr < mdev->num_users; usr++) {
621 reg = MAILBOX_IRQENABLE(mdev->intr_type, usr);
622 mdev->irq_ctx[usr] = mbox_read_reg(mdev, reg);
623 }
624
625 return 0;
626}
627
628static int omap_mbox_resume(struct device *dev)
629{
630 struct omap_mbox_device *mdev = dev_get_drvdata(dev);
631 u32 usr, reg;
632
633 if (pm_runtime_status_suspended(dev))
634 return 0;
635
636 for (usr = 0; usr < mdev->num_users; usr++) {
637 reg = MAILBOX_IRQENABLE(mdev->intr_type, usr);
638 mbox_write_reg(mdev, mdev->irq_ctx[usr], reg);
639 }
640
641 return 0;
642}
643#endif
644
645static const struct dev_pm_ops omap_mbox_pm_ops = {
646 SET_SYSTEM_SLEEP_PM_OPS(omap_mbox_suspend, omap_mbox_resume)
647};
648
650static const struct of_device_id omap_mailbox_of_match[] = { 649static const struct of_device_id omap_mailbox_of_match[] = {
651 { 650 {
652 .compatible = "ti,omap2-mailbox", 651 .compatible = "ti,omap2-mailbox",
@@ -696,8 +695,6 @@ static int omap_mbox_probe(struct platform_device *pdev)
696 int ret; 695 int ret;
697 struct mbox_chan *chnls; 696 struct mbox_chan *chnls;
698 struct omap_mbox **list, *mbox, *mboxblk; 697 struct omap_mbox **list, *mbox, *mboxblk;
699 struct omap_mbox_pdata *pdata = pdev->dev.platform_data;
700 struct omap_mbox_dev_info *info = NULL;
701 struct omap_mbox_fifo_info *finfo, *finfoblk; 698 struct omap_mbox_fifo_info *finfo, *finfoblk;
702 struct omap_mbox_device *mdev; 699 struct omap_mbox_device *mdev;
703 struct omap_mbox_fifo *fifo; 700 struct omap_mbox_fifo *fifo;
@@ -710,36 +707,26 @@ static int omap_mbox_probe(struct platform_device *pdev)
710 u32 l; 707 u32 l;
711 int i; 708 int i;
712 709
713 if (!node && (!pdata || !pdata->info_cnt || !pdata->info)) { 710 if (!node) {
714 pr_err("%s: platform not supported\n", __func__); 711 pr_err("%s: only DT-based devices are supported\n", __func__);
715 return -ENODEV; 712 return -ENODEV;
716 } 713 }
717 714
718 if (node) { 715 match = of_match_device(omap_mailbox_of_match, &pdev->dev);
719 match = of_match_device(omap_mailbox_of_match, &pdev->dev); 716 if (!match)
720 if (!match) 717 return -ENODEV;
721 return -ENODEV; 718 intr_type = (u32)match->data;
722 intr_type = (u32)match->data;
723 719
724 if (of_property_read_u32(node, "ti,mbox-num-users", 720 if (of_property_read_u32(node, "ti,mbox-num-users", &num_users))
725 &num_users)) 721 return -ENODEV;
726 return -ENODEV;
727 722
728 if (of_property_read_u32(node, "ti,mbox-num-fifos", 723 if (of_property_read_u32(node, "ti,mbox-num-fifos", &num_fifos))
729 &num_fifos)) 724 return -ENODEV;
730 return -ENODEV;
731 725
732 info_count = of_get_available_child_count(node); 726 info_count = of_get_available_child_count(node);
733 if (!info_count) { 727 if (!info_count) {
734 dev_err(&pdev->dev, "no available mbox devices found\n"); 728 dev_err(&pdev->dev, "no available mbox devices found\n");
735 return -ENODEV; 729 return -ENODEV;
736 }
737 } else { /* non-DT device creation */
738 info_count = pdata->info_cnt;
739 info = pdata->info;
740 intr_type = pdata->intr_type;
741 num_users = pdata->num_users;
742 num_fifos = pdata->num_fifos;
743 } 730 }
744 731
745 finfoblk = devm_kzalloc(&pdev->dev, info_count * sizeof(*finfoblk), 732 finfoblk = devm_kzalloc(&pdev->dev, info_count * sizeof(*finfoblk),
@@ -750,38 +737,28 @@ static int omap_mbox_probe(struct platform_device *pdev)
750 finfo = finfoblk; 737 finfo = finfoblk;
751 child = NULL; 738 child = NULL;
752 for (i = 0; i < info_count; i++, finfo++) { 739 for (i = 0; i < info_count; i++, finfo++) {
753 if (node) { 740 child = of_get_next_available_child(node, child);
754 child = of_get_next_available_child(node, child); 741 ret = of_property_read_u32_array(child, "ti,mbox-tx", tmp,
755 ret = of_property_read_u32_array(child, "ti,mbox-tx", 742 ARRAY_SIZE(tmp));
756 tmp, ARRAY_SIZE(tmp)); 743 if (ret)
757 if (ret) 744 return ret;
758 return ret; 745 finfo->tx_id = tmp[0];
759 finfo->tx_id = tmp[0]; 746 finfo->tx_irq = tmp[1];
760 finfo->tx_irq = tmp[1]; 747 finfo->tx_usr = tmp[2];
761 finfo->tx_usr = tmp[2]; 748
762 749 ret = of_property_read_u32_array(child, "ti,mbox-rx", tmp,
763 ret = of_property_read_u32_array(child, "ti,mbox-rx", 750 ARRAY_SIZE(tmp));
764 tmp, ARRAY_SIZE(tmp)); 751 if (ret)
765 if (ret) 752 return ret;
766 return ret; 753 finfo->rx_id = tmp[0];
767 finfo->rx_id = tmp[0]; 754 finfo->rx_irq = tmp[1];
768 finfo->rx_irq = tmp[1]; 755 finfo->rx_usr = tmp[2];
769 finfo->rx_usr = tmp[2]; 756
770 757 finfo->name = child->name;
771 finfo->name = child->name; 758
772 759 if (of_find_property(child, "ti,mbox-send-noirq", NULL))
773 if (of_find_property(child, "ti,mbox-send-noirq", NULL)) 760 finfo->send_no_irq = true;
774 finfo->send_no_irq = true; 761
775 } else {
776 finfo->tx_id = info->tx_id;
777 finfo->rx_id = info->rx_id;
778 finfo->tx_usr = info->usr_id;
779 finfo->tx_irq = info->irq_id;
780 finfo->rx_usr = info->usr_id;
781 finfo->rx_irq = info->irq_id;
782 finfo->name = info->name;
783 info++;
784 }
785 if (finfo->tx_id >= num_fifos || finfo->rx_id >= num_fifos || 762 if (finfo->tx_id >= num_fifos || finfo->rx_id >= num_fifos ||
786 finfo->tx_usr >= num_users || finfo->rx_usr >= num_users) 763 finfo->tx_usr >= num_users || finfo->rx_usr >= num_users)
787 return -EINVAL; 764 return -EINVAL;
@@ -796,6 +773,11 @@ static int omap_mbox_probe(struct platform_device *pdev)
796 if (IS_ERR(mdev->mbox_base)) 773 if (IS_ERR(mdev->mbox_base))
797 return PTR_ERR(mdev->mbox_base); 774 return PTR_ERR(mdev->mbox_base);
798 775
776 mdev->irq_ctx = devm_kzalloc(&pdev->dev, num_users * sizeof(u32),
777 GFP_KERNEL);
778 if (!mdev->irq_ctx)
779 return -ENOMEM;
780
799 /* allocate one extra for marking end of list */ 781 /* allocate one extra for marking end of list */
800 list = devm_kzalloc(&pdev->dev, (info_count + 1) * sizeof(*list), 782 list = devm_kzalloc(&pdev->dev, (info_count + 1) * sizeof(*list),
801 GFP_KERNEL); 783 GFP_KERNEL);
@@ -848,6 +830,7 @@ static int omap_mbox_probe(struct platform_device *pdev)
848 mdev->dev = &pdev->dev; 830 mdev->dev = &pdev->dev;
849 mdev->num_users = num_users; 831 mdev->num_users = num_users;
850 mdev->num_fifos = num_fifos; 832 mdev->num_fifos = num_fifos;
833 mdev->intr_type = intr_type;
851 mdev->mboxes = list; 834 mdev->mboxes = list;
852 835
853 /* OMAP does not have a Tx-Done IRQ, but rather a Tx-Ready IRQ */ 836 /* OMAP does not have a Tx-Done IRQ, but rather a Tx-Ready IRQ */
@@ -905,6 +888,7 @@ static struct platform_driver omap_mbox_driver = {
905 .remove = omap_mbox_remove, 888 .remove = omap_mbox_remove,
906 .driver = { 889 .driver = {
907 .name = "omap-mailbox", 890 .name = "omap-mailbox",
891 .pm = &omap_mbox_pm_ops,
908 .of_match_table = of_match_ptr(omap_mailbox_of_match), 892 .of_match_table = of_match_ptr(omap_mailbox_of_match),
909 }, 893 },
910}; 894};
diff --git a/include/linux/omap-mailbox.h b/include/linux/omap-mailbox.h
index 587bbdd31f5a..c726bd833761 100644
--- a/include/linux/omap-mailbox.h
+++ b/include/linux/omap-mailbox.h
@@ -21,8 +21,6 @@ struct mbox_client;
21struct mbox_chan *omap_mbox_request_channel(struct mbox_client *cl, 21struct mbox_chan *omap_mbox_request_channel(struct mbox_client *cl,
22 const char *chan_name); 22 const char *chan_name);
23 23
24void omap_mbox_save_ctx(struct mbox_chan *chan);
25void omap_mbox_restore_ctx(struct mbox_chan *chan);
26void omap_mbox_enable_irq(struct mbox_chan *chan, omap_mbox_irq_t irq); 24void omap_mbox_enable_irq(struct mbox_chan *chan, omap_mbox_irq_t irq);
27void omap_mbox_disable_irq(struct mbox_chan *chan, omap_mbox_irq_t irq); 25void omap_mbox_disable_irq(struct mbox_chan *chan, omap_mbox_irq_t irq);
28 26
diff --git a/include/linux/platform_data/mailbox-omap.h b/include/linux/platform_data/mailbox-omap.h
deleted file mode 100644
index 4631dbb4255e..000000000000
--- a/include/linux/platform_data/mailbox-omap.h
+++ /dev/null
@@ -1,58 +0,0 @@
1/*
2 * mailbox-omap.h
3 *
4 * Copyright (C) 2013 Texas Instruments, Inc.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * version 2 as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16#ifndef _PLAT_MAILBOX_H
17#define _PLAT_MAILBOX_H
18
19/* Interrupt register configuration types */
20#define MBOX_INTR_CFG_TYPE1 (0)
21#define MBOX_INTR_CFG_TYPE2 (1)
22
23/**
24 * struct omap_mbox_dev_info - OMAP mailbox device attribute info
25 * @name: name of the mailbox device
26 * @tx_id: mailbox queue id used for transmitting messages
27 * @rx_id: mailbox queue id on which messages are received
28 * @irq_id: irq identifier number to use from the hwmod data
29 * @usr_id: mailbox user id for identifying the interrupt into
30 * the MPU interrupt controller.
31 */
32struct omap_mbox_dev_info {
33 const char *name;
34 u32 tx_id;
35 u32 rx_id;
36 u32 irq_id;
37 u32 usr_id;
38};
39
40/**
41 * struct omap_mbox_pdata - OMAP mailbox platform data
42 * @intr_type: type of interrupt configuration registers used
43 while programming mailbox queue interrupts
44 * @num_users: number of users (processor devices) that the mailbox
45 * h/w block can interrupt
46 * @num_fifos: number of h/w fifos within the mailbox h/w block
47 * @info_cnt: number of mailbox devices for the platform
48 * @info: array of mailbox device attributes
49 */
50struct omap_mbox_pdata {
51 u32 intr_type;
52 u32 num_users;
53 u32 num_fifos;
54 u32 info_cnt;
55 struct omap_mbox_dev_info *info;
56};
57
58#endif /* _PLAT_MAILBOX_H */