From patchwork Fri Nov 2 12:32:33 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vaibhav Bedia X-Patchwork-Id: 1688411 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 2C96DDF2A2 for ; Fri, 2 Nov 2012 12:36:50 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TUGSq-0007ej-AY; Fri, 02 Nov 2012 12:35:08 +0000 Received: from arroyo.ext.ti.com ([192.94.94.40]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TUGS2-0007Ud-1T for linux-arm-kernel@lists.infradead.org; Fri, 02 Nov 2012 12:34:23 +0000 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id qA2CYDsM021958; Fri, 2 Nov 2012 07:34:14 -0500 Received: from DBDE71.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id qA2CYAsA022142; Fri, 2 Nov 2012 18:04:13 +0530 (IST) Received: from dbdp32.itg.ti.com (172.24.170.251) by DBDE71.ent.ti.com (172.24.170.149) with Microsoft SMTP Server id 14.1.323.3; Fri, 2 Nov 2012 18:04:10 +0530 Received: from localhost.localdomain (dbdp20.itg.ti.com [172.24.170.38]) by dbdp32.itg.ti.com (8.13.8/8.13.8) with ESMTP id qA2CY79C022950; Fri, 2 Nov 2012 18:04:10 +0530 From: Vaibhav Bedia To: , Subject: [PATCH 02/15] ARM: OMAP2+: mailbox: Add support for AM33XX Date: Fri, 2 Nov 2012 18:02:33 +0530 Message-ID: <1351859566-24818-3-git-send-email-vaibhav.bedia@ti.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1351859566-24818-1-git-send-email-vaibhav.bedia@ti.com> References: <1351859566-24818-1-git-send-email-vaibhav.bedia@ti.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121102_083418_355080_100A3844 X-CRM114-Status: GOOD ( 13.99 ) X-Spam-Score: -7.6 (-------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-7.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [192.94.94.40 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: khilman@ti.com, tony@atomide.com, paul@pwsan.com, b-cousson@ti.com, Vaibhav Bedia X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Mailbox IP on AM33XX, is the same as that present in OMAP4. The single instance of Mailbox module contains 8 sub-modules and facilitates communication between MPU, PRUs and WKUP_M3. The first mailbox sub-module is assigned for communication between MPU and WKUP-M3. Signed-off-by: Vaibhav Bedia --- arch/arm/mach-omap2/mailbox.c | 35 ++++++++++++++++++++++++++++++++++- 1 files changed, 34 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c index f38b4fa..7a343aa 100644 --- a/arch/arm/mach-omap2/mailbox.c +++ b/arch/arm/mach-omap2/mailbox.c @@ -155,7 +155,7 @@ static void omap2_mbox_disable_irq(struct omap_mbox *mbox, struct omap_mbox2_priv *p = mbox->priv; u32 bit = (irq == IRQ_TX) ? p->notfull_bit : p->newmsg_bit; - if (!cpu_is_omap44xx()) + if (!cpu_is_omap44xx() || !soc_is_am33xx()) bit = mbox_read_reg(p->irqdisable) & ~bit; mbox_write_reg(bit, p->irqdisable); @@ -358,6 +358,32 @@ struct omap_mbox mbox_2_info = { struct omap_mbox *omap4_mboxes[] = { &mbox_1_info, &mbox_2_info, NULL }; #endif +#if defined(CONFIG_SOC_AM33XX) +static struct omap_mbox2_priv omap2_mbox_wkup_m3_priv = { + .tx_fifo = { + .msg = MAILBOX_MESSAGE(0), + .fifo_stat = MAILBOX_FIFOSTATUS(0), + .msg_stat = MAILBOX_MSGSTATUS(0), + }, + .rx_fifo = { + .msg = MAILBOX_MESSAGE(1), + .msg_stat = MAILBOX_MSGSTATUS(1), + }, + .irqenable = OMAP4_MAILBOX_IRQENABLE(3), + .irqstatus = OMAP4_MAILBOX_IRQSTATUS(3), + .irqdisable = OMAP4_MAILBOX_IRQENABLE_CLR(3), + .notfull_bit = MAILBOX_IRQ_NOTFULL(0), + .newmsg_bit = MAILBOX_IRQ_NEWMSG(0), +}; + +struct omap_mbox mbox_wkup_m3_info = { + .name = "wkup_m3", + .ops = &omap2_mbox_ops, + .priv = &omap2_mbox_wkup_m3_priv, +}; +struct omap_mbox *am33xx_mboxes[] = { &mbox_wkup_m3_info, NULL }; +#endif + static int __devinit omap2_mbox_probe(struct platform_device *pdev) { struct resource *mem; @@ -392,6 +418,13 @@ static int __devinit omap2_mbox_probe(struct platform_device *pdev) list[0]->irq = list[1]->irq = platform_get_irq(pdev, 0); } #endif +#if defined(CONFIG_SOC_AM33XX) + else if (soc_is_am33xx()) { + list = am33xx_mboxes; + + list[0]->irq = platform_get_irq(pdev, 0); + } +#endif else { pr_err("%s: platform not supported\n", __func__); return -ENODEV;