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: 26673 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f69.google.com (mail-yh0-f69.google.com [209.85.213.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EB42A20143 for ; Thu, 20 Mar 2014 11:10:20 +0000 (UTC) Received: by mail-yh0-f69.google.com with SMTP id b6sf1829753yha.8 for ; Thu, 20 Mar 2014 04:10:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:message-id:date:from:user-agent :mime-version:to:subject:references:in-reply-to:cc:precedence :list-id:list-unsubscribe:list-archive:list-post:list-help :list-subscribe:sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:content-type :content-transfer-encoding; bh=rnv/6IpOwlzwDSGaqH+eZ4S2uPF3j4AS9h275LmB41Q=; b=ejYaED2fR0kukvWcN7Bwc7r3hWcHovjrzPMNg+qaVb0EDn78B19LwtvWHE9BeRawGZ VDcCZzdyifjX0MWZckWVCeX8Wyy0jQDUVKalTaU28Fka8+bpazaOznPIEOoi6is2D1Mq 6Y+mGQfYtp/9Ier/lGlDtpsg44IQrY8RPs+q/IT760S+ZP6g3G1fQUBzq4sqnuJbnumX TapVm7OM8mWij8x9HzYCFtjwdZG/b6hIBFZs68pk4lJGjfvIC+N7sfuEH3E/xD86ei6W 4JgCUEnBABuy0Lz9BY+JlJNOUoxsfpNnrsorkb1kDM6GUKoj6u83FuyNDcIKbsXF5RzI BQlA== X-Gm-Message-State: ALoCoQlTtz/0k3eje/H2GrU+3kFwbHwT7NQ96bv83bn9jv2VWQDbB+2+87/rTZyDw6/5IM7xCP1d X-Received: by 10.236.134.98 with SMTP id r62mr8389279yhi.14.1395313820293; Thu, 20 Mar 2014 04:10:20 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.35.208 with SMTP id n74ls185363qgn.65.gmail; Thu, 20 Mar 2014 04:10:20 -0700 (PDT) X-Received: by 10.221.37.1 with SMTP id tc1mr3741667vcb.32.1395313820160; Thu, 20 Mar 2014 04:10:20 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id la9si340667veb.146.2014.03.20.04.10.20 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Mar 2014 04:10:20 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.174; Received: by mail-vc0-f174.google.com with SMTP id ld13so724257vcb.33 for ; Thu, 20 Mar 2014 04:10:20 -0700 (PDT) X-Received: by 10.52.108.164 with SMTP id hl4mr6002543vdb.25.1395313820017; Thu, 20 Mar 2014 04:10:20 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.78.9 with SMTP id i9csp378973vck; Thu, 20 Mar 2014 04:10:19 -0700 (PDT) X-Received: by 10.194.58.79 with SMTP id o15mr7039352wjq.62.1395313817844; Thu, 20 Mar 2014 04:10:17 -0700 (PDT) Received: from casper.infradead.org (casper.infradead.org. [2001:770:15f::2]) by mx.google.com with ESMTPS id ct2si12319270wib.70.2014.03.20.04.10.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Mar 2014 04:10:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:770:15f::2 as permitted sender) client-ip=2001:770:15f::2; Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WQZLu-0006XN-Kk; Thu, 20 Mar 2014 09:33:31 +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 (------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-6.9 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 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 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+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: nsekhar@ti.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 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<--- Acked-by: Sekhar Nori 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