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: 3864141 Return-Path: X-Original-To: patchwork-davinci@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 4BEB5BF540 for ; Thu, 20 Mar 2014 09:25:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 65340201F4 for ; Thu, 20 Mar 2014 09:25:28 +0000 (UTC) Received: from bear.ext.ti.com (bear.ext.ti.com [192.94.94.41]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4FCD4201ED for ; Thu, 20 Mar 2014 09:25:27 +0000 (UTC) Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id s2K9PQTV019464 for ; Thu, 20 Mar 2014 04:25:26 -0500 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s2K9PQdC027721 for ; Thu, 20 Mar 2014 04:25:26 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.174.1; Thu, 20 Mar 2014 04:25:26 -0500 Received: from linux.omap.com (dlelxs01.itg.ti.com [157.170.227.31]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s2K9PQWX012849 for ; Thu, 20 Mar 2014 04:25:26 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id F164680628 for ; Thu, 20 Mar 2014 03:25:25 -0600 (CST) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dlelxv90.itg.ti.com (dlelxv90.itg.ti.com [172.17.2.17]) by linux.omap.com (Postfix) with ESMTP id 02FE180626 for ; Thu, 20 Mar 2014 03:24:35 -0600 (CST) 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> CC: Kevin Hilman , , , X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: Errors-To: davinci-linux-open-source-bounces+patchwork-davinci=patchwork.kernel.org@linux.davincidsp.com X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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