aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-07-02 17:33:21 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-02 17:33:21 -0400
commit0bf6a210a43f7118d858806200127e421649fc4e (patch)
tree9a17d88ebd1b9bc693fba7f39c12123dec96e930 /arch/arm/mach-omap2
parentee1a8d402e7e204d57fb108aa40003b6d1633036 (diff)
parent5c913a9a9772f4b434aaea7328836419287b5d1c (diff)
Merge tag 'drivers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC driver specific changes from Arnd Bergmann: "These changes are all driver specific and cross over between arm-soc contents and some other subsystem, in these cases cpufreq, crypto, dma, pinctrl, mailbox and usb, and the subsystem owners agreed to have these changes merged through arm-soc. As we proceed to untangle the dependencies between platform code and driver code, the amount of changes in this category is fortunately shrinking, for 3.11 we have 16 branches here and 101 non-merge changesets, the majority of which are for the stedma40 dma engine driver used in the ux500 platform. Cleaning up that code touches multiple subsystems, but gets rid of the dependency in the end. The mailbox code moved out from mach-omap2 to drivers/mailbox is an intermediate step and is still omap specific at the moment. Patches exist to generalize the subsystem and add other drivers with the same API, but those did not make it for 3.11." * tag 'drivers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (101 commits) crypto: ux500: use dmaengine_submit API crypto: ux500: use dmaengine_prep_slave_sg API crypto: ux500: use dmaengine_device_control API crypto: ux500/crypt: add missing __iomem qualifiers crypto: ux500/hash: add missing static qualifiers crypto: ux500/hash: use readl on iomem addresses dmaengine: ste_dma40: Declare memcpy config as static ARM: ux500: Remove mop500_snowball_ethernet_clock_enable() ARM: ux500: Correct the EN_3v3 regulator's on/off GPIO ARM: ux500: Provide a AB8500 GPIO Device Tree node gpio: rcar: fix gpio_rcar_of_table gpio-rcar: Remove #ifdef CONFIG_OF around OF-specific sections gpio-rcar: Reference core gpio documentation in the DT bindings clk: exynos5250: Add enum entries for divider clock of i2s1 and i2s2 ARM: dts: Update Samsung I2S documentation ARM: dts: add clock provider information for i2s controllers in Exynos5250 ARM: dts: add Exynos audio subsystem clock controller node clk: samsung: register audio subsystem clocks using common clock framework ARM: dts: use #include for all device trees for Samsung pinctrl: s3c24xx: use correct header for chained_irq functions ...
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r--arch/arm/mach-omap2/Makefile3
-rw-r--r--arch/arm/mach-omap2/board-flash.c3
-rw-r--r--arch/arm/mach-omap2/devices.c13
-rw-r--r--arch/arm/mach-omap2/gpmc-nand.c44
-rw-r--r--arch/arm/mach-omap2/gpmc.c82
-rw-r--r--arch/arm/mach-omap2/mailbox.c430
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2420_data.c14
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2430_data.c13
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_3xxx_data.c13
9 files changed, 124 insertions, 491 deletions
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 8e8c605ebefe..ea5a27ff9941 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -212,9 +212,6 @@ obj-$(CONFIG_SOC_OMAP5) += omap_hwmod_54xx_data.o
212obj-$(CONFIG_OMAP3_EMU) += emu.o 212obj-$(CONFIG_OMAP3_EMU) += emu.o
213obj-$(CONFIG_HW_PERF_EVENTS) += pmu.o 213obj-$(CONFIG_HW_PERF_EVENTS) += pmu.o
214 214
215obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox_mach.o
216mailbox_mach-objs := mailbox.o
217
218iommu-$(CONFIG_OMAP_IOMMU) := omap-iommu.o 215iommu-$(CONFIG_OMAP_IOMMU) := omap-iommu.o
219obj-y += $(iommu-m) $(iommu-y) 216obj-y += $(iommu-m) $(iommu-y)
220 217
diff --git a/arch/arm/mach-omap2/board-flash.c b/arch/arm/mach-omap2/board-flash.c
index c33adea0247c..fc20a61f6b2a 100644
--- a/arch/arm/mach-omap2/board-flash.c
+++ b/arch/arm/mach-omap2/board-flash.c
@@ -112,6 +112,9 @@ struct gpmc_timings nand_default_timings[1] = {
112 .cs_rd_off = 36, 112 .cs_rd_off = 36,
113 .cs_wr_off = 36, 113 .cs_wr_off = 36,
114 114
115 .we_on = 6,
116 .oe_on = 6,
117
115 .adv_on = 6, 118 .adv_on = 6,
116 .adv_rd_off = 24, 119 .adv_rd_off = 24,
117 .adv_wr_off = 36, 120 .adv_wr_off = 36,
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 403c211e35d0..aef96e45cb20 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -21,6 +21,7 @@
21#include <linux/pinctrl/machine.h> 21#include <linux/pinctrl/machine.h>
22#include <linux/platform_data/omap4-keypad.h> 22#include <linux/platform_data/omap4-keypad.h>
23#include <linux/wl12xx.h> 23#include <linux/wl12xx.h>
24#include <linux/platform_data/mailbox-omap.h>
24 25
25#include <asm/mach-types.h> 26#include <asm/mach-types.h>
26#include <asm/mach/map.h> 27#include <asm/mach/map.h>
@@ -283,25 +284,31 @@ int __init omap4_keyboard_init(struct omap4_keypad_platform_data
283 return 0; 284 return 0;
284} 285}
285 286
286#if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE) 287#if defined(CONFIG_OMAP2PLUS_MBOX) || defined(CONFIG_OMAP2PLUS_MBOX_MODULE)
287static inline void __init omap_init_mbox(void) 288static inline void __init omap_init_mbox(void)
288{ 289{
289 struct omap_hwmod *oh; 290 struct omap_hwmod *oh;
290 struct platform_device *pdev; 291 struct platform_device *pdev;
292 struct omap_mbox_pdata *pdata;
291 293
292 oh = omap_hwmod_lookup("mailbox"); 294 oh = omap_hwmod_lookup("mailbox");
293 if (!oh) { 295 if (!oh) {
294 pr_err("%s: unable to find hwmod\n", __func__); 296 pr_err("%s: unable to find hwmod\n", __func__);
295 return; 297 return;
296 } 298 }
299 if (!oh->dev_attr) {
300 pr_err("%s: hwmod doesn't have valid attrs\n", __func__);
301 return;
302 }
297 303
298 pdev = omap_device_build("omap-mailbox", -1, oh, NULL, 0); 304 pdata = (struct omap_mbox_pdata *)oh->dev_attr;
305 pdev = omap_device_build("omap-mailbox", -1, oh, pdata, sizeof(*pdata));
299 WARN(IS_ERR(pdev), "%s: could not build device, err %ld\n", 306 WARN(IS_ERR(pdev), "%s: could not build device, err %ld\n",
300 __func__, PTR_ERR(pdev)); 307 __func__, PTR_ERR(pdev));
301} 308}
302#else 309#else
303static inline void omap_init_mbox(void) { } 310static inline void omap_init_mbox(void) { }
304#endif /* CONFIG_OMAP_MBOX_FWK */ 311#endif /* CONFIG_OMAP2PLUS_MBOX */
305 312
306static inline void omap_init_sti(void) {} 313static inline void omap_init_sti(void) {}
307 314
diff --git a/arch/arm/mach-omap2/gpmc-nand.c b/arch/arm/mach-omap2/gpmc-nand.c
index d9c27195caf0..662c7fd633cc 100644
--- a/arch/arm/mach-omap2/gpmc-nand.c
+++ b/arch/arm/mach-omap2/gpmc-nand.c
@@ -43,44 +43,6 @@ static struct platform_device gpmc_nand_device = {
43 .resource = gpmc_nand_resource, 43 .resource = gpmc_nand_resource,
44}; 44};
45 45
46static int omap2_nand_gpmc_retime(
47 struct omap_nand_platform_data *gpmc_nand_data,
48 struct gpmc_timings *gpmc_t)
49{
50 struct gpmc_timings t;
51 int err;
52
53 memset(&t, 0, sizeof(t));
54 t.sync_clk = gpmc_t->sync_clk;
55 t.cs_on = gpmc_t->cs_on;
56 t.adv_on = gpmc_t->adv_on;
57
58 /* Read */
59 t.adv_rd_off = gpmc_t->adv_rd_off;
60 t.oe_on = t.adv_on;
61 t.access = gpmc_t->access;
62 t.oe_off = gpmc_t->oe_off;
63 t.cs_rd_off = gpmc_t->cs_rd_off;
64 t.rd_cycle = gpmc_t->rd_cycle;
65
66 /* Write */
67 t.adv_wr_off = gpmc_t->adv_wr_off;
68 t.we_on = t.oe_on;
69 if (cpu_is_omap34xx()) {
70 t.wr_data_mux_bus = gpmc_t->wr_data_mux_bus;
71 t.wr_access = gpmc_t->wr_access;
72 }
73 t.we_off = gpmc_t->we_off;
74 t.cs_wr_off = gpmc_t->cs_wr_off;
75 t.wr_cycle = gpmc_t->wr_cycle;
76
77 err = gpmc_cs_set_timings(gpmc_nand_data->cs, &t);
78 if (err)
79 return err;
80
81 return 0;
82}
83
84static bool gpmc_hwecc_bch_capable(enum omap_ecc ecc_opt) 46static bool gpmc_hwecc_bch_capable(enum omap_ecc ecc_opt)
85{ 47{
86 /* support only OMAP3 class */ 48 /* support only OMAP3 class */
@@ -131,7 +93,7 @@ int gpmc_nand_init(struct omap_nand_platform_data *gpmc_nand_data,
131 gpmc_get_client_irq(GPMC_IRQ_COUNT_EVENT); 93 gpmc_get_client_irq(GPMC_IRQ_COUNT_EVENT);
132 94
133 if (gpmc_t) { 95 if (gpmc_t) {
134 err = omap2_nand_gpmc_retime(gpmc_nand_data, gpmc_t); 96 err = gpmc_cs_set_timings(gpmc_nand_data->cs, gpmc_t);
135 if (err < 0) { 97 if (err < 0) {
136 dev_err(dev, "Unable to set gpmc timings: %d\n", err); 98 dev_err(dev, "Unable to set gpmc timings: %d\n", err);
137 return err; 99 return err;
@@ -140,8 +102,6 @@ int gpmc_nand_init(struct omap_nand_platform_data *gpmc_nand_data,
140 if (gpmc_nand_data->of_node) { 102 if (gpmc_nand_data->of_node) {
141 gpmc_read_settings_dt(gpmc_nand_data->of_node, &s); 103 gpmc_read_settings_dt(gpmc_nand_data->of_node, &s);
142 } else { 104 } else {
143 s.device_nand = true;
144
145 /* Enable RD PIN Monitoring Reg */ 105 /* Enable RD PIN Monitoring Reg */
146 if (gpmc_nand_data->dev_ready) { 106 if (gpmc_nand_data->dev_ready) {
147 s.wait_on_read = true; 107 s.wait_on_read = true;
@@ -149,6 +109,8 @@ int gpmc_nand_init(struct omap_nand_platform_data *gpmc_nand_data,
149 } 109 }
150 } 110 }
151 111
112 s.device_nand = true;
113
152 if (gpmc_nand_data->devsize == NAND_BUSWIDTH_16) 114 if (gpmc_nand_data->devsize == NAND_BUSWIDTH_16)
153 s.device_width = GPMC_DEVWIDTH_16BIT; 115 s.device_width = GPMC_DEVWIDTH_16BIT;
154 else 116 else
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index 6c4da1254f53..1c7969e965d7 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -30,6 +30,7 @@
30#include <linux/of_mtd.h> 30#include <linux/of_mtd.h>
31#include <linux/of_device.h> 31#include <linux/of_device.h>
32#include <linux/mtd/nand.h> 32#include <linux/mtd/nand.h>
33#include <linux/pm_runtime.h>
33 34
34#include <linux/platform_data/mtd-nand-omap2.h> 35#include <linux/platform_data/mtd-nand-omap2.h>
35 36
@@ -155,6 +156,7 @@ static struct resource gpmc_cs_mem[GPMC_CS_NUM];
155static DEFINE_SPINLOCK(gpmc_mem_lock); 156static DEFINE_SPINLOCK(gpmc_mem_lock);
156/* Define chip-selects as reserved by default until probe completes */ 157/* Define chip-selects as reserved by default until probe completes */
157static unsigned int gpmc_cs_map = ((1 << GPMC_CS_NUM) - 1); 158static unsigned int gpmc_cs_map = ((1 << GPMC_CS_NUM) - 1);
159static unsigned int gpmc_cs_num = GPMC_CS_NUM;
158static unsigned int gpmc_nr_waitpins; 160static unsigned int gpmc_nr_waitpins;
159static struct device *gpmc_dev; 161static struct device *gpmc_dev;
160static int gpmc_irq; 162static int gpmc_irq;
@@ -521,8 +523,10 @@ static int gpmc_cs_remap(int cs, u32 base)
521 int ret; 523 int ret;
522 u32 old_base, size; 524 u32 old_base, size;
523 525
524 if (cs > GPMC_CS_NUM) 526 if (cs > gpmc_cs_num) {
527 pr_err("%s: requested chip-select is disabled\n", __func__);
525 return -ENODEV; 528 return -ENODEV;
529 }
526 gpmc_cs_get_memconf(cs, &old_base, &size); 530 gpmc_cs_get_memconf(cs, &old_base, &size);
527 if (base == old_base) 531 if (base == old_base)
528 return 0; 532 return 0;
@@ -545,9 +549,10 @@ int gpmc_cs_request(int cs, unsigned long size, unsigned long *base)
545 struct resource *res = &gpmc_cs_mem[cs]; 549 struct resource *res = &gpmc_cs_mem[cs];
546 int r = -1; 550 int r = -1;
547 551
548 if (cs > GPMC_CS_NUM) 552 if (cs > gpmc_cs_num) {
553 pr_err("%s: requested chip-select is disabled\n", __func__);
549 return -ENODEV; 554 return -ENODEV;
550 555 }
551 size = gpmc_mem_align(size); 556 size = gpmc_mem_align(size);
552 if (size > (1 << GPMC_SECTION_SHIFT)) 557 if (size > (1 << GPMC_SECTION_SHIFT))
553 return -ENOMEM; 558 return -ENOMEM;
@@ -582,7 +587,7 @@ EXPORT_SYMBOL(gpmc_cs_request);
582void gpmc_cs_free(int cs) 587void gpmc_cs_free(int cs)
583{ 588{
584 spin_lock(&gpmc_mem_lock); 589 spin_lock(&gpmc_mem_lock);
585 if (cs >= GPMC_CS_NUM || cs < 0 || !gpmc_cs_reserved(cs)) { 590 if (cs >= gpmc_cs_num || cs < 0 || !gpmc_cs_reserved(cs)) {
586 printk(KERN_ERR "Trying to free non-reserved GPMC CS%d\n", cs); 591 printk(KERN_ERR "Trying to free non-reserved GPMC CS%d\n", cs);
587 BUG(); 592 BUG();
588 spin_unlock(&gpmc_mem_lock); 593 spin_unlock(&gpmc_mem_lock);
@@ -777,7 +782,7 @@ static void gpmc_mem_exit(void)
777{ 782{
778 int cs; 783 int cs;
779 784
780 for (cs = 0; cs < GPMC_CS_NUM; cs++) { 785 for (cs = 0; cs < gpmc_cs_num; cs++) {
781 if (!gpmc_cs_mem_enabled(cs)) 786 if (!gpmc_cs_mem_enabled(cs))
782 continue; 787 continue;
783 gpmc_cs_delete_mem(cs); 788 gpmc_cs_delete_mem(cs);
@@ -798,7 +803,7 @@ static void gpmc_mem_init(void)
798 gpmc_mem_root.end = GPMC_MEM_END; 803 gpmc_mem_root.end = GPMC_MEM_END;
799 804
800 /* Reserve all regions that has been set up by bootloader */ 805 /* Reserve all regions that has been set up by bootloader */
801 for (cs = 0; cs < GPMC_CS_NUM; cs++) { 806 for (cs = 0; cs < gpmc_cs_num; cs++) {
802 u32 base, size; 807 u32 base, size;
803 808
804 if (!gpmc_cs_mem_enabled(cs)) 809 if (!gpmc_cs_mem_enabled(cs))
@@ -1245,7 +1250,6 @@ void gpmc_read_settings_dt(struct device_node *np, struct gpmc_settings *p)
1245 1250
1246 p->sync_read = of_property_read_bool(np, "gpmc,sync-read"); 1251 p->sync_read = of_property_read_bool(np, "gpmc,sync-read");
1247 p->sync_write = of_property_read_bool(np, "gpmc,sync-write"); 1252 p->sync_write = of_property_read_bool(np, "gpmc,sync-write");
1248 p->device_nand = of_property_read_bool(np, "gpmc,device-nand");
1249 of_property_read_u32(np, "gpmc,device-width", &p->device_width); 1253 of_property_read_u32(np, "gpmc,device-width", &p->device_width);
1250 of_property_read_u32(np, "gpmc,mux-add-data", &p->mux_add_data); 1254 of_property_read_u32(np, "gpmc,mux-add-data", &p->mux_add_data);
1251 1255
@@ -1345,6 +1349,13 @@ static const char * const nand_ecc_opts[] = {
1345 [OMAP_ECC_BCH8_CODE_HW] = "bch8", 1349 [OMAP_ECC_BCH8_CODE_HW] = "bch8",
1346}; 1350};
1347 1351
1352static const char * const nand_xfer_types[] = {
1353 [NAND_OMAP_PREFETCH_POLLED] = "prefetch-polled",
1354 [NAND_OMAP_POLLED] = "polled",
1355 [NAND_OMAP_PREFETCH_DMA] = "prefetch-dma",
1356 [NAND_OMAP_PREFETCH_IRQ] = "prefetch-irq",
1357};
1358
1348static int gpmc_probe_nand_child(struct platform_device *pdev, 1359static int gpmc_probe_nand_child(struct platform_device *pdev,
1349 struct device_node *child) 1360 struct device_node *child)
1350{ 1361{
@@ -1374,6 +1385,13 @@ static int gpmc_probe_nand_child(struct platform_device *pdev,
1374 break; 1385 break;
1375 } 1386 }
1376 1387
1388 if (!of_property_read_string(child, "ti,nand-xfer-type", &s))
1389 for (val = 0; val < ARRAY_SIZE(nand_xfer_types); val++)
1390 if (!strcasecmp(s, nand_xfer_types[val])) {
1391 gpmc_nand_data->xfer_type = val;
1392 break;
1393 }
1394
1377 val = of_get_nand_bus_width(child); 1395 val = of_get_nand_bus_width(child);
1378 if (val == 16) 1396 if (val == 16)
1379 gpmc_nand_data->devsize = NAND_BUSWIDTH_16; 1397 gpmc_nand_data->devsize = NAND_BUSWIDTH_16;
@@ -1513,6 +1531,20 @@ static int gpmc_probe_dt(struct platform_device *pdev)
1513 if (!of_id) 1531 if (!of_id)
1514 return 0; 1532 return 0;
1515 1533
1534 ret = of_property_read_u32(pdev->dev.of_node, "gpmc,num-cs",
1535 &gpmc_cs_num);
1536 if (ret < 0) {
1537 pr_err("%s: number of chip-selects not defined\n", __func__);
1538 return ret;
1539 } else if (gpmc_cs_num < 1) {
1540 pr_err("%s: all chip-selects are disabled\n", __func__);
1541 return -EINVAL;
1542 } else if (gpmc_cs_num > GPMC_CS_NUM) {
1543 pr_err("%s: number of supported chip-selects cannot be > %d\n",
1544 __func__, GPMC_CS_NUM);
1545 return -EINVAL;
1546 }
1547
1516 ret = of_property_read_u32(pdev->dev.of_node, "gpmc,num-waitpins", 1548 ret = of_property_read_u32(pdev->dev.of_node, "gpmc,num-waitpins",
1517 &gpmc_nr_waitpins); 1549 &gpmc_nr_waitpins);
1518 if (ret < 0) { 1550 if (ret < 0) {
@@ -1577,7 +1609,8 @@ static int gpmc_probe(struct platform_device *pdev)
1577 return PTR_ERR(gpmc_l3_clk); 1609 return PTR_ERR(gpmc_l3_clk);
1578 } 1610 }
1579 1611
1580 clk_prepare_enable(gpmc_l3_clk); 1612 pm_runtime_enable(&pdev->dev);
1613 pm_runtime_get_sync(&pdev->dev);
1581 1614
1582 gpmc_dev = &pdev->dev; 1615 gpmc_dev = &pdev->dev;
1583 1616
@@ -1610,12 +1643,14 @@ static int gpmc_probe(struct platform_device *pdev)
1610 /* Now the GPMC is initialised, unreserve the chip-selects */ 1643 /* Now the GPMC is initialised, unreserve the chip-selects */
1611 gpmc_cs_map = 0; 1644 gpmc_cs_map = 0;
1612 1645
1613 if (!pdev->dev.of_node) 1646 if (!pdev->dev.of_node) {
1647 gpmc_cs_num = GPMC_CS_NUM;
1614 gpmc_nr_waitpins = GPMC_NR_WAITPINS; 1648 gpmc_nr_waitpins = GPMC_NR_WAITPINS;
1649 }
1615 1650
1616 rc = gpmc_probe_dt(pdev); 1651 rc = gpmc_probe_dt(pdev);
1617 if (rc < 0) { 1652 if (rc < 0) {
1618 clk_disable_unprepare(gpmc_l3_clk); 1653 pm_runtime_put_sync(&pdev->dev);
1619 clk_put(gpmc_l3_clk); 1654 clk_put(gpmc_l3_clk);
1620 dev_err(gpmc_dev, "failed to probe DT parameters\n"); 1655 dev_err(gpmc_dev, "failed to probe DT parameters\n");
1621 return rc; 1656 return rc;
@@ -1628,10 +1663,30 @@ static int gpmc_remove(struct platform_device *pdev)
1628{ 1663{
1629 gpmc_free_irq(); 1664 gpmc_free_irq();
1630 gpmc_mem_exit(); 1665 gpmc_mem_exit();
1666 pm_runtime_put_sync(&pdev->dev);
1667 pm_runtime_disable(&pdev->dev);
1631 gpmc_dev = NULL; 1668 gpmc_dev = NULL;
1632 return 0; 1669 return 0;
1633} 1670}
1634 1671
1672#ifdef CONFIG_PM_SLEEP
1673static int gpmc_suspend(struct device *dev)
1674{
1675 omap3_gpmc_save_context();
1676 pm_runtime_put_sync(dev);
1677 return 0;
1678}
1679
1680static int gpmc_resume(struct device *dev)
1681{
1682 pm_runtime_get_sync(dev);
1683 omap3_gpmc_restore_context();
1684 return 0;
1685}
1686#endif
1687
1688static SIMPLE_DEV_PM_OPS(gpmc_pm_ops, gpmc_suspend, gpmc_resume);
1689
1635static struct platform_driver gpmc_driver = { 1690static struct platform_driver gpmc_driver = {
1636 .probe = gpmc_probe, 1691 .probe = gpmc_probe,
1637 .remove = gpmc_remove, 1692 .remove = gpmc_remove,
@@ -1639,6 +1694,7 @@ static struct platform_driver gpmc_driver = {
1639 .name = DEVICE_NAME, 1694 .name = DEVICE_NAME,
1640 .owner = THIS_MODULE, 1695 .owner = THIS_MODULE,
1641 .of_match_table = of_match_ptr(gpmc_dt_ids), 1696 .of_match_table = of_match_ptr(gpmc_dt_ids),
1697 .pm = &gpmc_pm_ops,
1642 }, 1698 },
1643}; 1699};
1644 1700
@@ -1701,7 +1757,6 @@ static irqreturn_t gpmc_handle_irq(int irq, void *dev)
1701 return IRQ_HANDLED; 1757 return IRQ_HANDLED;
1702} 1758}
1703 1759
1704#ifdef CONFIG_ARCH_OMAP3
1705static struct omap3_gpmc_regs gpmc_context; 1760static struct omap3_gpmc_regs gpmc_context;
1706 1761
1707void omap3_gpmc_save_context(void) 1762void omap3_gpmc_save_context(void)
@@ -1715,7 +1770,7 @@ void omap3_gpmc_save_context(void)
1715 gpmc_context.prefetch_config1 = gpmc_read_reg(GPMC_PREFETCH_CONFIG1); 1770 gpmc_context.prefetch_config1 = gpmc_read_reg(GPMC_PREFETCH_CONFIG1);
1716 gpmc_context.prefetch_config2 = gpmc_read_reg(GPMC_PREFETCH_CONFIG2); 1771 gpmc_context.prefetch_config2 = gpmc_read_reg(GPMC_PREFETCH_CONFIG2);
1717 gpmc_context.prefetch_control = gpmc_read_reg(GPMC_PREFETCH_CONTROL); 1772 gpmc_context.prefetch_control = gpmc_read_reg(GPMC_PREFETCH_CONTROL);
1718 for (i = 0; i < GPMC_CS_NUM; i++) { 1773 for (i = 0; i < gpmc_cs_num; i++) {
1719 gpmc_context.cs_context[i].is_valid = gpmc_cs_mem_enabled(i); 1774 gpmc_context.cs_context[i].is_valid = gpmc_cs_mem_enabled(i);
1720 if (gpmc_context.cs_context[i].is_valid) { 1775 if (gpmc_context.cs_context[i].is_valid) {
1721 gpmc_context.cs_context[i].config1 = 1776 gpmc_context.cs_context[i].config1 =
@@ -1747,7 +1802,7 @@ void omap3_gpmc_restore_context(void)
1747 gpmc_write_reg(GPMC_PREFETCH_CONFIG1, gpmc_context.prefetch_config1); 1802 gpmc_write_reg(GPMC_PREFETCH_CONFIG1, gpmc_context.prefetch_config1);
1748 gpmc_write_reg(GPMC_PREFETCH_CONFIG2, gpmc_context.prefetch_config2); 1803 gpmc_write_reg(GPMC_PREFETCH_CONFIG2, gpmc_context.prefetch_config2);
1749 gpmc_write_reg(GPMC_PREFETCH_CONTROL, gpmc_context.prefetch_control); 1804 gpmc_write_reg(GPMC_PREFETCH_CONTROL, gpmc_context.prefetch_control);
1750 for (i = 0; i < GPMC_CS_NUM; i++) { 1805 for (i = 0; i < gpmc_cs_num; i++) {
1751 if (gpmc_context.cs_context[i].is_valid) { 1806 if (gpmc_context.cs_context[i].is_valid) {
1752 gpmc_cs_write_reg(i, GPMC_CS_CONFIG1, 1807 gpmc_cs_write_reg(i, GPMC_CS_CONFIG1,
1753 gpmc_context.cs_context[i].config1); 1808 gpmc_context.cs_context[i].config1);
@@ -1766,4 +1821,3 @@ void omap3_gpmc_restore_context(void)
1766 } 1821 }
1767 } 1822 }
1768} 1823}
1769#endif /* CONFIG_ARCH_OMAP3 */
diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c
deleted file mode 100644
index 0b080267b7f6..000000000000
--- a/arch/arm/mach-omap2/mailbox.c
+++ /dev/null
@@ -1,430 +0,0 @@
1/*
2 * Mailbox reservation modules for OMAP2/3
3 *
4 * Copyright (C) 2006-2009 Nokia Corporation
5 * Written by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
6 * and Paul Mundt
7 *
8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file "COPYING" in the main directory of this archive
10 * for more details.
11 */
12
13#include <linux/module.h>
14#include <linux/clk.h>
15#include <linux/err.h>
16#include <linux/platform_device.h>
17#include <linux/io.h>
18#include <linux/pm_runtime.h>
19
20#include <plat/mailbox.h>
21
22#include "soc.h"
23
24#define MAILBOX_REVISION 0x000
25#define MAILBOX_MESSAGE(m) (0x040 + 4 * (m))
26#define MAILBOX_FIFOSTATUS(m) (0x080 + 4 * (m))
27#define MAILBOX_MSGSTATUS(m) (0x0c0 + 4 * (m))
28#define MAILBOX_IRQSTATUS(u) (0x100 + 8 * (u))
29#define MAILBOX_IRQENABLE(u) (0x104 + 8 * (u))
30
31#define OMAP4_MAILBOX_IRQSTATUS(u) (0x104 + 0x10 * (u))
32#define OMAP4_MAILBOX_IRQENABLE(u) (0x108 + 0x10 * (u))
33#define OMAP4_MAILBOX_IRQENABLE_CLR(u) (0x10c + 0x10 * (u))
34
35#define MAILBOX_IRQ_NEWMSG(m) (1 << (2 * (m)))
36#define MAILBOX_IRQ_NOTFULL(m) (1 << (2 * (m) + 1))
37
38#define MBOX_REG_SIZE 0x120
39
40#define OMAP4_MBOX_REG_SIZE 0x130
41
42#define MBOX_NR_REGS (MBOX_REG_SIZE / sizeof(u32))
43#define OMAP4_MBOX_NR_REGS (OMAP4_MBOX_REG_SIZE / sizeof(u32))
44
45static void __iomem *mbox_base;
46
47struct omap_mbox2_fifo {
48 unsigned long msg;
49 unsigned long fifo_stat;
50 unsigned long msg_stat;
51};
52
53struct omap_mbox2_priv {
54 struct omap_mbox2_fifo tx_fifo;
55 struct omap_mbox2_fifo rx_fifo;
56 unsigned long irqenable;
57 unsigned long irqstatus;
58 u32 newmsg_bit;
59 u32 notfull_bit;
60 u32 ctx[OMAP4_MBOX_NR_REGS];
61 unsigned long irqdisable;
62};
63
64static void omap2_mbox_enable_irq(struct omap_mbox *mbox,
65 omap_mbox_type_t irq);
66
67static inline unsigned int mbox_read_reg(size_t ofs)
68{
69 return __raw_readl(mbox_base + ofs);
70}
71
72static inline void mbox_write_reg(u32 val, size_t ofs)
73{
74 __raw_writel(val, mbox_base + ofs);
75}
76
77/* Mailbox H/W preparations */
78static int omap2_mbox_startup(struct omap_mbox *mbox)
79{
80 u32 l;
81
82 pm_runtime_enable(mbox->dev->parent);
83 pm_runtime_get_sync(mbox->dev->parent);
84
85 l = mbox_read_reg(MAILBOX_REVISION);
86 pr_debug("omap mailbox rev %d.%d\n", (l & 0xf0) >> 4, (l & 0x0f));
87
88 return 0;
89}
90
91static void omap2_mbox_shutdown(struct omap_mbox *mbox)
92{
93 pm_runtime_put_sync(mbox->dev->parent);
94 pm_runtime_disable(mbox->dev->parent);
95}
96
97/* Mailbox FIFO handle functions */
98static mbox_msg_t omap2_mbox_fifo_read(struct omap_mbox *mbox)
99{
100 struct omap_mbox2_fifo *fifo =
101 &((struct omap_mbox2_priv *)mbox->priv)->rx_fifo;
102 return (mbox_msg_t) mbox_read_reg(fifo->msg);
103}
104
105static void omap2_mbox_fifo_write(struct omap_mbox *mbox, mbox_msg_t msg)
106{
107 struct omap_mbox2_fifo *fifo =
108 &((struct omap_mbox2_priv *)mbox->priv)->tx_fifo;
109 mbox_write_reg(msg, fifo->msg);
110}
111
112static int omap2_mbox_fifo_empty(struct omap_mbox *mbox)
113{
114 struct omap_mbox2_fifo *fifo =
115 &((struct omap_mbox2_priv *)mbox->priv)->rx_fifo;
116 return (mbox_read_reg(fifo->msg_stat) == 0);
117}
118
119static int omap2_mbox_fifo_full(struct omap_mbox *mbox)
120{
121 struct omap_mbox2_fifo *fifo =
122 &((struct omap_mbox2_priv *)mbox->priv)->tx_fifo;
123 return mbox_read_reg(fifo->fifo_stat);
124}
125
126/* Mailbox IRQ handle functions */
127static void omap2_mbox_enable_irq(struct omap_mbox *mbox,
128 omap_mbox_type_t irq)
129{
130 struct omap_mbox2_priv *p = mbox->priv;
131 u32 l, bit = (irq == IRQ_TX) ? p->notfull_bit : p->newmsg_bit;
132
133 l = mbox_read_reg(p->irqenable);
134 l |= bit;
135 mbox_write_reg(l, p->irqenable);
136}
137
138static void omap2_mbox_disable_irq(struct omap_mbox *mbox,
139 omap_mbox_type_t irq)
140{
141 struct omap_mbox2_priv *p = mbox->priv;
142 u32 bit = (irq == IRQ_TX) ? p->notfull_bit : p->newmsg_bit;
143
144 if (!cpu_is_omap44xx())
145 bit = mbox_read_reg(p->irqdisable) & ~bit;
146
147 mbox_write_reg(bit, p->irqdisable);
148}
149
150static void omap2_mbox_ack_irq(struct omap_mbox *mbox,
151 omap_mbox_type_t irq)
152{
153 struct omap_mbox2_priv *p = mbox->priv;
154 u32 bit = (irq == IRQ_TX) ? p->notfull_bit : p->newmsg_bit;
155
156 mbox_write_reg(bit, p->irqstatus);
157
158 /* Flush posted write for irq status to avoid spurious interrupts */
159 mbox_read_reg(p->irqstatus);
160}
161
162static int omap2_mbox_is_irq(struct omap_mbox *mbox,
163 omap_mbox_type_t irq)
164{
165 struct omap_mbox2_priv *p = mbox->priv;
166 u32 bit = (irq == IRQ_TX) ? p->notfull_bit : p->newmsg_bit;
167 u32 enable = mbox_read_reg(p->irqenable);
168 u32 status = mbox_read_reg(p->irqstatus);
169
170 return (int)(enable & status & bit);
171}
172
173static void omap2_mbox_save_ctx(struct omap_mbox *mbox)
174{
175 int i;
176 struct omap_mbox2_priv *p = mbox->priv;
177 int nr_regs;
178 if (cpu_is_omap44xx())
179 nr_regs = OMAP4_MBOX_NR_REGS;
180 else
181 nr_regs = MBOX_NR_REGS;
182 for (i = 0; i < nr_regs; i++) {
183 p->ctx[i] = mbox_read_reg(i * sizeof(u32));
184
185 dev_dbg(mbox->dev, "%s: [%02x] %08x\n", __func__,
186 i, p->ctx[i]);
187 }
188}
189
190static void omap2_mbox_restore_ctx(struct omap_mbox *mbox)
191{
192 int i;
193 struct omap_mbox2_priv *p = mbox->priv;
194 int nr_regs;
195 if (cpu_is_omap44xx())
196 nr_regs = OMAP4_MBOX_NR_REGS;
197 else
198 nr_regs = MBOX_NR_REGS;
199 for (i = 0; i < nr_regs; i++) {
200 mbox_write_reg(p->ctx[i], i * sizeof(u32));
201
202 dev_dbg(mbox->dev, "%s: [%02x] %08x\n", __func__,
203 i, p->ctx[i]);
204 }
205}
206
207static struct omap_mbox_ops omap2_mbox_ops = {
208 .type = OMAP_MBOX_TYPE2,
209 .startup = omap2_mbox_startup,
210 .shutdown = omap2_mbox_shutdown,
211 .fifo_read = omap2_mbox_fifo_read,
212 .fifo_write = omap2_mbox_fifo_write,
213 .fifo_empty = omap2_mbox_fifo_empty,
214 .fifo_full = omap2_mbox_fifo_full,
215 .enable_irq = omap2_mbox_enable_irq,
216 .disable_irq = omap2_mbox_disable_irq,
217 .ack_irq = omap2_mbox_ack_irq,
218 .is_irq = omap2_mbox_is_irq,
219 .save_ctx = omap2_mbox_save_ctx,
220 .restore_ctx = omap2_mbox_restore_ctx,
221};
222
223/*
224 * MAILBOX 0: ARM -> DSP,
225 * MAILBOX 1: ARM <- DSP.
226 * MAILBOX 2: ARM -> IVA,
227 * MAILBOX 3: ARM <- IVA.
228 */
229
230/* FIXME: the following structs should be filled automatically by the user id */
231
232#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP2)
233/* DSP */
234static struct omap_mbox2_priv omap2_mbox_dsp_priv = {
235 .tx_fifo = {
236 .msg = MAILBOX_MESSAGE(0),
237 .fifo_stat = MAILBOX_FIFOSTATUS(0),
238 },
239 .rx_fifo = {
240 .msg = MAILBOX_MESSAGE(1),
241 .msg_stat = MAILBOX_MSGSTATUS(1),
242 },
243 .irqenable = MAILBOX_IRQENABLE(0),
244 .irqstatus = MAILBOX_IRQSTATUS(0),
245 .notfull_bit = MAILBOX_IRQ_NOTFULL(0),
246 .newmsg_bit = MAILBOX_IRQ_NEWMSG(1),
247 .irqdisable = MAILBOX_IRQENABLE(0),
248};
249
250struct omap_mbox mbox_dsp_info = {
251 .name = "dsp",
252 .ops = &omap2_mbox_ops,
253 .priv = &omap2_mbox_dsp_priv,
254};
255#endif
256
257#if defined(CONFIG_ARCH_OMAP3)
258struct omap_mbox *omap3_mboxes[] = { &mbox_dsp_info, NULL };
259#endif
260
261#if defined(CONFIG_SOC_OMAP2420)
262/* IVA */
263static struct omap_mbox2_priv omap2_mbox_iva_priv = {
264 .tx_fifo = {
265 .msg = MAILBOX_MESSAGE(2),
266 .fifo_stat = MAILBOX_FIFOSTATUS(2),
267 },
268 .rx_fifo = {
269 .msg = MAILBOX_MESSAGE(3),
270 .msg_stat = MAILBOX_MSGSTATUS(3),
271 },
272 .irqenable = MAILBOX_IRQENABLE(3),
273 .irqstatus = MAILBOX_IRQSTATUS(3),
274 .notfull_bit = MAILBOX_IRQ_NOTFULL(2),
275 .newmsg_bit = MAILBOX_IRQ_NEWMSG(3),
276 .irqdisable = MAILBOX_IRQENABLE(3),
277};
278
279static struct omap_mbox mbox_iva_info = {
280 .name = "iva",
281 .ops = &omap2_mbox_ops,
282 .priv = &omap2_mbox_iva_priv,
283};
284#endif
285
286#ifdef CONFIG_ARCH_OMAP2
287struct omap_mbox *omap2_mboxes[] = {
288 &mbox_dsp_info,
289#ifdef CONFIG_SOC_OMAP2420
290 &mbox_iva_info,
291#endif
292 NULL
293};
294#endif
295
296#if defined(CONFIG_ARCH_OMAP4)
297/* OMAP4 */
298static struct omap_mbox2_priv omap2_mbox_1_priv = {
299 .tx_fifo = {
300 .msg = MAILBOX_MESSAGE(0),
301 .fifo_stat = MAILBOX_FIFOSTATUS(0),
302 },
303 .rx_fifo = {
304 .msg = MAILBOX_MESSAGE(1),
305 .msg_stat = MAILBOX_MSGSTATUS(1),
306 },
307 .irqenable = OMAP4_MAILBOX_IRQENABLE(0),
308 .irqstatus = OMAP4_MAILBOX_IRQSTATUS(0),
309 .notfull_bit = MAILBOX_IRQ_NOTFULL(0),
310 .newmsg_bit = MAILBOX_IRQ_NEWMSG(1),
311 .irqdisable = OMAP4_MAILBOX_IRQENABLE_CLR(0),
312};
313
314struct omap_mbox mbox_1_info = {
315 .name = "mailbox-1",
316 .ops = &omap2_mbox_ops,
317 .priv = &omap2_mbox_1_priv,
318};
319
320static struct omap_mbox2_priv omap2_mbox_2_priv = {
321 .tx_fifo = {
322 .msg = MAILBOX_MESSAGE(3),
323 .fifo_stat = MAILBOX_FIFOSTATUS(3),
324 },
325 .rx_fifo = {
326 .msg = MAILBOX_MESSAGE(2),
327 .msg_stat = MAILBOX_MSGSTATUS(2),
328 },
329 .irqenable = OMAP4_MAILBOX_IRQENABLE(0),
330 .irqstatus = OMAP4_MAILBOX_IRQSTATUS(0),
331 .notfull_bit = MAILBOX_IRQ_NOTFULL(3),
332 .newmsg_bit = MAILBOX_IRQ_NEWMSG(2),
333 .irqdisable = OMAP4_MAILBOX_IRQENABLE_CLR(0),
334};
335
336struct omap_mbox mbox_2_info = {
337 .name = "mailbox-2",
338 .ops = &omap2_mbox_ops,
339 .priv = &omap2_mbox_2_priv,
340};
341
342struct omap_mbox *omap4_mboxes[] = { &mbox_1_info, &mbox_2_info, NULL };
343#endif
344
345static int omap2_mbox_probe(struct platform_device *pdev)
346{
347 struct resource *mem;
348 int ret;
349 struct omap_mbox **list;
350
351 if (false)
352 ;
353#if defined(CONFIG_ARCH_OMAP3)
354 else if (cpu_is_omap34xx()) {
355 list = omap3_mboxes;
356
357 list[0]->irq = platform_get_irq(pdev, 0);
358 }
359#endif
360#if defined(CONFIG_ARCH_OMAP2)
361 else if (cpu_is_omap2430()) {
362 list = omap2_mboxes;
363
364 list[0]->irq = platform_get_irq(pdev, 0);
365 } else if (cpu_is_omap2420()) {
366 list = omap2_mboxes;
367
368 list[0]->irq = platform_get_irq_byname(pdev, "dsp");
369 list[1]->irq = platform_get_irq_byname(pdev, "iva");
370 }
371#endif
372#if defined(CONFIG_ARCH_OMAP4)
373 else if (cpu_is_omap44xx()) {
374 list = omap4_mboxes;
375
376 list[0]->irq = list[1]->irq = platform_get_irq(pdev, 0);
377 }
378#endif
379 else {
380 pr_err("%s: platform not supported\n", __func__);
381 return -ENODEV;
382 }
383
384 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
385 mbox_base = ioremap(mem->start, resource_size(mem));
386 if (!mbox_base)
387 return -ENOMEM;
388
389 ret = omap_mbox_register(&pdev->dev, list);
390 if (ret) {
391 iounmap(mbox_base);
392 return ret;
393 }
394
395 return 0;
396}
397
398static int omap2_mbox_remove(struct platform_device *pdev)
399{
400 omap_mbox_unregister();
401 iounmap(mbox_base);
402 return 0;
403}
404
405static struct platform_driver omap2_mbox_driver = {
406 .probe = omap2_mbox_probe,
407 .remove = omap2_mbox_remove,
408 .driver = {
409 .name = "omap-mailbox",
410 },
411};
412
413static int __init omap2_mbox_init(void)
414{
415 return platform_driver_register(&omap2_mbox_driver);
416}
417
418static void __exit omap2_mbox_exit(void)
419{
420 platform_driver_unregister(&omap2_mbox_driver);
421}
422
423module_init(omap2_mbox_init);
424module_exit(omap2_mbox_exit);
425
426MODULE_LICENSE("GPL v2");
427MODULE_DESCRIPTION("omap mailbox: omap2/3/4 architecture specific functions");
428MODULE_AUTHOR("Hiroshi DOYU <Hiroshi.DOYU@nokia.com>");
429MODULE_AUTHOR("Paul Mundt");
430MODULE_ALIAS("platform:omap2-mailbox");
diff --git a/arch/arm/mach-omap2/omap_hwmod_2420_data.c b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
index 5137cc84b504..d8b9d60f854f 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2420_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
@@ -16,6 +16,7 @@
16#include <linux/i2c-omap.h> 16#include <linux/i2c-omap.h>
17#include <linux/platform_data/spi-omap2-mcspi.h> 17#include <linux/platform_data/spi-omap2-mcspi.h>
18#include <linux/omap-dma.h> 18#include <linux/omap-dma.h>
19#include <linux/platform_data/mailbox-omap.h>
19#include <plat/dmtimer.h> 20#include <plat/dmtimer.h>
20 21
21#include "omap_hwmod.h" 22#include "omap_hwmod.h"
@@ -166,6 +167,18 @@ static struct omap_hwmod omap2420_dma_system_hwmod = {
166}; 167};
167 168
168/* mailbox */ 169/* mailbox */
170static struct omap_mbox_dev_info omap2420_mailbox_info[] = {
171 { .name = "dsp", .tx_id = 0, .rx_id = 1, .irq_id = 0, .usr_id = 0 },
172 { .name = "iva", .tx_id = 2, .rx_id = 3, .irq_id = 1, .usr_id = 3 },
173};
174
175static struct omap_mbox_pdata omap2420_mailbox_attrs = {
176 .num_users = 4,
177 .num_fifos = 6,
178 .info_cnt = ARRAY_SIZE(omap2420_mailbox_info),
179 .info = omap2420_mailbox_info,
180};
181
169static struct omap_hwmod_irq_info omap2420_mailbox_irqs[] = { 182static struct omap_hwmod_irq_info omap2420_mailbox_irqs[] = {
170 { .name = "dsp", .irq = 26 + OMAP_INTC_START, }, 183 { .name = "dsp", .irq = 26 + OMAP_INTC_START, },
171 { .name = "iva", .irq = 34 + OMAP_INTC_START, }, 184 { .name = "iva", .irq = 34 + OMAP_INTC_START, },
@@ -186,6 +199,7 @@ static struct omap_hwmod omap2420_mailbox_hwmod = {
186 .idlest_idle_bit = OMAP24XX_ST_MAILBOXES_SHIFT, 199 .idlest_idle_bit = OMAP24XX_ST_MAILBOXES_SHIFT,
187 }, 200 },
188 }, 201 },
202 .dev_attr = &omap2420_mailbox_attrs,
189}; 203};
190 204
191/* 205/*
diff --git a/arch/arm/mach-omap2/omap_hwmod_2430_data.c b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
index 4ce999ee3ee9..5b9083461dc5 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2430_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
@@ -17,6 +17,7 @@
17#include <linux/platform_data/asoc-ti-mcbsp.h> 17#include <linux/platform_data/asoc-ti-mcbsp.h>
18#include <linux/platform_data/spi-omap2-mcspi.h> 18#include <linux/platform_data/spi-omap2-mcspi.h>
19#include <linux/omap-dma.h> 19#include <linux/omap-dma.h>
20#include <linux/platform_data/mailbox-omap.h>
20#include <plat/dmtimer.h> 21#include <plat/dmtimer.h>
21 22
22#include "omap_hwmod.h" 23#include "omap_hwmod.h"
@@ -170,6 +171,17 @@ static struct omap_hwmod omap2430_dma_system_hwmod = {
170}; 171};
171 172
172/* mailbox */ 173/* mailbox */
174static struct omap_mbox_dev_info omap2430_mailbox_info[] = {
175 { .name = "dsp", .tx_id = 0, .rx_id = 1 },
176};
177
178static struct omap_mbox_pdata omap2430_mailbox_attrs = {
179 .num_users = 4,
180 .num_fifos = 6,
181 .info_cnt = ARRAY_SIZE(omap2430_mailbox_info),
182 .info = omap2430_mailbox_info,
183};
184
173static struct omap_hwmod_irq_info omap2430_mailbox_irqs[] = { 185static struct omap_hwmod_irq_info omap2430_mailbox_irqs[] = {
174 { .irq = 26 + OMAP_INTC_START, }, 186 { .irq = 26 + OMAP_INTC_START, },
175 { .irq = -1 }, 187 { .irq = -1 },
@@ -189,6 +201,7 @@ static struct omap_hwmod omap2430_mailbox_hwmod = {
189 .idlest_idle_bit = OMAP24XX_ST_MAILBOXES_SHIFT, 201 .idlest_idle_bit = OMAP24XX_ST_MAILBOXES_SHIFT,
190 }, 202 },
191 }, 203 },
204 .dev_attr = &omap2430_mailbox_attrs,
192}; 205};
193 206
194/* mcspi3 */ 207/* mcspi3 */
diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index fa9915411440..f7a3df2fb579 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -25,6 +25,7 @@
25#include <linux/platform_data/asoc-ti-mcbsp.h> 25#include <linux/platform_data/asoc-ti-mcbsp.h>
26#include <linux/platform_data/spi-omap2-mcspi.h> 26#include <linux/platform_data/spi-omap2-mcspi.h>
27#include <linux/platform_data/iommu-omap.h> 27#include <linux/platform_data/iommu-omap.h>
28#include <linux/platform_data/mailbox-omap.h>
28#include <plat/dmtimer.h> 29#include <plat/dmtimer.h>
29 30
30#include "am35xx.h" 31#include "am35xx.h"
@@ -1504,6 +1505,17 @@ static struct omap_hwmod_class omap3xxx_mailbox_hwmod_class = {
1504 .sysc = &omap3xxx_mailbox_sysc, 1505 .sysc = &omap3xxx_mailbox_sysc,
1505}; 1506};
1506 1507
1508static struct omap_mbox_dev_info omap3xxx_mailbox_info[] = {
1509 { .name = "dsp", .tx_id = 0, .rx_id = 1 },
1510};
1511
1512static struct omap_mbox_pdata omap3xxx_mailbox_attrs = {
1513 .num_users = 2,
1514 .num_fifos = 2,
1515 .info_cnt = ARRAY_SIZE(omap3xxx_mailbox_info),
1516 .info = omap3xxx_mailbox_info,
1517};
1518
1507static struct omap_hwmod_irq_info omap3xxx_mailbox_irqs[] = { 1519static struct omap_hwmod_irq_info omap3xxx_mailbox_irqs[] = {
1508 { .irq = 26 + OMAP_INTC_START, }, 1520 { .irq = 26 + OMAP_INTC_START, },
1509 { .irq = -1 }, 1521 { .irq = -1 },
@@ -1523,6 +1535,7 @@ static struct omap_hwmod omap3xxx_mailbox_hwmod = {
1523 .idlest_idle_bit = OMAP3430_ST_MAILBOXES_SHIFT, 1535 .idlest_idle_bit = OMAP3430_ST_MAILBOXES_SHIFT,
1524 }, 1536 },
1525 }, 1537 },
1538 .dev_attr = &omap3xxx_mailbox_attrs,
1526}; 1539};
1527 1540
1528/* 1541/*