From patchwork Thu Mar 20 09:24:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sekhar Nori X-Patchwork-Id: 3864821 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 64269BF540 for ; Thu, 20 Mar 2014 10:04:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8C8E52021C for ; Thu, 20 Mar 2014 10:04:05 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 49368201E4 for ; Thu, 20 Mar 2014 10:04:02 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WQZLm-0006XL-0H; Thu, 20 Mar 2014 09:33:24 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WQZL0-0000PD-5v; Thu, 20 Mar 2014 09:32:34 +0000 Received: from bear.ext.ti.com ([192.94.94.41]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WQZDl-00082S-HB for linux-arm-kernel@lists.infradead.org; Thu, 20 Mar 2014 09:25:07 +0000 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id s2K9OZnE018923; Thu, 20 Mar 2014 04:24:35 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s2K9OYNB026434; Thu, 20 Mar 2014 04:24:34 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.174.1; Thu, 20 Mar 2014 04:24:34 -0500 Received: from [172.24.190.153] (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s2K9OVgQ027169; Thu, 20 Mar 2014 04:24:32 -0500 Message-ID: <532AB3CF.30806@ti.com> Date: Thu, 20 Mar 2014 14:54:31 +0530 From: Sekhar Nori User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: Arnd Bergmann , Sergei Shtylyov Subject: Re: [PATCH 06/62] ARM: davinci: export da8xx_syscfg0_base References: <1395257399-359545-1-git-send-email-arnd@arndb.de> <1395257399-359545-7-git-send-email-arnd@arndb.de> <532A03BE.3070003@cogentembedded.com> <4836281.0IgPinItBq@wuerfel> In-Reply-To: <4836281.0IgPinItBq@wuerfel> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140320_052505_705306_DE29B8DC X-CRM114-Status: GOOD ( 20.41 ) X-Spam-Score: -6.9 (------) Cc: Kevin Hilman , davinci-linux-open-source@linux.davincidsp.com, arm@kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi Arnd, On Thursday 20 March 2014 01:51 AM, Arnd Bergmann wrote: > On Wednesday 19 March 2014 23:53:18 Sergei Shtylyov wrote: >> On 03/19/2014 10:29 PM, Arnd Bergmann wrote: >> >>> The ohci-da8xx driver uses the DA8XX_SYSCFG0_VIRT macro to >>> access the CFGCHIP2 register for controlling its PHY. >> >>> The macro in turn relies on the da8xx_syscfg0_base global >>> variable. Since the OHCI driver can be a loadable module, >>> this requires the symbol to be exported from platform code. >> >>> Signed-off-by: Arnd Bergmann >>> Cc: Sekhar Nori >>> Cc: Kevin Hilman >>> Cc: davinci-linux-open-source@linux.davincidsp.com >>> --- >>> arch/arm/mach-davinci/devices-da8xx.c | 1 + >>> 1 file changed, 1 insertion(+) >> >>> diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c >>> index 0486cdf..4da868a 100644 >>> --- a/arch/arm/mach-davinci/devices-da8xx.c >>> +++ b/arch/arm/mach-davinci/devices-da8xx.c >>> @@ -66,6 +66,7 @@ >>> #define DA850_DMA_MMCSD1_TX EDMA_CTLR_CHAN(1, 29) >>> >>> void __iomem *da8xx_syscfg0_base; >>> +EXPORT_SYMBOL_GPL(da8xx_syscfg0_base); /* used by OHCI_HCD */ >> >> I have submitted such patch years ago and it was turned down. >> > > The question is whether there is anyone who would do this properly. > > Both the OHCI and MUSB drivers use exactly one register (CFGCHIP2) > to control the clock, phy and host/gadget mode switch. > > In the modern world, we'd probably want to have a clock driver and > a phy driver for these, based on a syscon driver. > > In all honesty I don't see that happening on davinci. > > A somewhat better approach would be to export a set of exported > functions to access the one register from the platform, e.g. > > u32 da8xx_cfgchip2_get(void); > void da8xx_cfgchip2_set(u32); > > That interface would still be a bit ugly, but much better than > what we have today, and easy to implement. There is another thing we can do albeit in the driver (see patch). Not sure how the USB maintainer will feel about it but I think this has the advantage of not creating any hacky interfaces. And it leaves me with the hope that someone will find the time to convert to phy driver based on syscon at some point. Thanks, Sekhar ---8<--- diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c index 3586460..c807d3f 100644 --- a/drivers/usb/host/ohci-hcd.c +++ b/drivers/usb/host/ohci-hcd.c @@ -1178,7 +1178,8 @@ MODULE_LICENSE ("GPL"); #define SA1111_DRIVER ohci_hcd_sa1111_driver #endif -#ifdef CONFIG_ARCH_DAVINCI_DA8XX +/* DA8XX uses platform internal symbols. Cannot be built as module. */ +#if defined(CONFIG_ARCH_DAVINCI_DA8XX) && !defined(CONFIG_USB_OHCI_HCD_MODULE) #include "ohci-da8xx.c" #define DAVINCI_PLATFORM_DRIVER ohci_hcd_da8xx_driver #endif