From patchwork Mon Jan 21 15:06:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Santosh Shilimkar X-Patchwork-Id: 2012921 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 6ECAF3FDD2 for ; Mon, 21 Jan 2013 15:11:07 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TxIwu-0002pr-MU; Mon, 21 Jan 2013 15:06:12 +0000 Received: from bear.ext.ti.com ([192.94.94.41]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TxIwi-0002ot-Mc for linux-arm-kernel@lists.infradead.org; Mon, 21 Jan 2013 15:06:01 +0000 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id r0LF5uEb026757; Mon, 21 Jan 2013 09:05:57 -0600 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 r0LF5sTL021430; Mon, 21 Jan 2013 20:35:54 +0530 (IST) Received: from dbdp33.itg.ti.com (172.24.170.252) by DBDE71.ent.ti.com (172.24.170.149) with Microsoft SMTP Server id 14.1.323.3; Mon, 21 Jan 2013 20:35:53 +0530 Received: from [172.24.136.207] (smtpvbd.itg.ti.com [172.24.170.250]) by dbdp33.itg.ti.com (8.13.8/8.13.8) with ESMTP id r0LF5pQU018206; Mon, 21 Jan 2013 20:35:52 +0530 Message-ID: <50FD5993.5010008@ti.com> Date: Mon, 21 Jan 2013 20:36:59 +0530 From: Santosh Shilimkar User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Tony Lindgren Subject: Re: [PATCH 08/10] ARM: OMAP5: hwmod data: Create initial OMAP5 SOC hwmod data References: <1358522856-12180-1-git-send-email-santosh.shilimkar@ti.com> <1358522856-12180-9-git-send-email-santosh.shilimkar@ti.com> <20130118171500.GC15361@atomide.com> <50FCF838.6000105@ti.com> In-Reply-To: <50FCF838.6000105@ti.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130121_100600_834599_11C1970B X-CRM114-Status: GOOD ( 24.27 ) 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.41 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: Paul Walmsley , mturquette@linaro.org, b-cousson@ti.com, rnayak@ti.com, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org 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 On Monday 21 January 2013 01:41 PM, Santosh Shilimkar wrote: > On Friday 18 January 2013 10:45 PM, Tony Lindgren wrote: >> Hi, >> >> * Santosh Shilimkar [130118 07:30]: >>> From: Benoit Cousson >>> >>> Adding the hwmod data for OMAP54xx platforms. >>> --- /dev/null >>> +++ b/arch/arm/mach-omap2/omap_hwmod_54xx_data.c >>> +/* bb2d */ >>> +static struct omap_hwmod_irq_info omap54xx_bb2d_irqs[] = { >>> + { .irq = 125 + OMAP54XX_IRQ_GIC_START }, >>> + { .irq = -1 } >>> +}; >> ... >> >>> +/* c2c */ >>> +static struct omap_hwmod_irq_info omap54xx_c2c_irqs[] = { >>> + { .irq = 88 + OMAP54XX_IRQ_GIC_START }, >>> + { .irq = -1 } >>> +}; >> ... >> >> >>> +static struct omap_hwmod_dma_info omap54xx_c2c_sdma_reqs[] = { >>> + { .dma_req = 68 + OMAP54XX_DMA_REQ_START }, >>> + { .dma_req = -1 } >>> +}; >> >> >> >>> +static struct omap_hwmod_addr_space omap54xx_elm_addrs[] = { >>> + { >>> + .pa_start = 0x48078000, >>> + .pa_end = 0x48078fff, >>> + .flags = ADDR_TYPE_RT >>> + }, >>> + { } >>> +}; >> ... >> >>> +static struct omap_hwmod_addr_space omap54xx_emif1_addrs[] = { >>> + { >>> + .pa_start = 0x4c000000, >>> + .pa_end = 0x4c0003ff, >>> + .flags = ADDR_TYPE_RT >>> + }, >>> + { } >>> +}; >> >> As discussed earlier on this list, let's not duplicate the standard >> resources here as they already are supposed to come from device tree. >> >> Whatever issues prevent us from dropping the duplicate data here need >> to be fixed. I believe Benoit already had some scripts/patches for >> that and was just waiting for the DMA binding to get merged? >> > Will have a loot at it. DMA binding pull request narrowly missed > 3.8 but should get into 3.9. > So I looked at this one with help of Rajendra. We can get rid of the IRQ and DMA data(needs DMA biding updates) easily. The address space though is needed since hwmod code uses it to setup the sysconfig registers. Extracting that from DT code seems to be really expensive and ugly [1]. I am yet to try out DMA lines removal but that seems to be doable by pulling Vinod'd DMA engine branch and updating DT file. Whats your suggestion on address space part ? Regards, Santosh [1] HACK address extraction with DT. --- arch/arm/mach-omap2/omap_hwmod.c | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index 4653efb..f54b9d4 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c @@ -138,6 +138,7 @@ #include #include #include +#include #include "clock.h" #include "omap_hwmod.h" @@ -2335,7 +2336,12 @@ static int _shutdown(struct omap_hwmod *oh) static void __init _init_mpu_rt_base(struct omap_hwmod *oh, void *data) { struct omap_hwmod_addr_space *mem; - void __iomem *va_start; + void __iomem *va_start = NULL; + struct device_node *np; + unsigned long start = 0, size = 0; + const void *reg_prop; + const char *p; + if (!oh) return; @@ -2349,15 +2355,32 @@ static void __init _init_mpu_rt_base(struct omap_hwmod *oh, void *data) if (!mem) { pr_debug("omap_hwmod: %s: no MPU register target found\n", oh->name); - return; + /*Check in Device Tree blob*/ + for_each_child_of_node(of_find_node_by_name(NULL, "ocp"), np) { + printk("np-name=%s\n", np->name); + if(of_find_property(np, "ti,hwmods", NULL)) { + p = of_get_property(np, "ti,hwmods", NULL); + if (!strcmp(p, oh->name)) { + reg_prop = of_get_property(np, "reg", NULL); + start = of_read_number(reg_prop, 1); + size = of_read_number(reg_prop + 4, 1); + } + } + } + } else { + start = mem->pa_start; + size = mem->pa_end - mem->pa_start; } - va_start = ioremap(mem->pa_start, mem->pa_end - mem->pa_start); + if (!start) + return; + + va_start = ioremap(start, size); if (!va_start) { pr_err("omap_hwmod: %s: Could not ioremap\n", oh->name); return; } - + pr_debug("omap_hwmod: %s: MPU register target at va %p\n", oh->name, va_start);