From patchwork Sun Feb 15 13:50:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangfei Gao X-Patchwork-Id: 44688 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f70.google.com (mail-ee0-f70.google.com [74.125.83.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C45FA21544 for ; Sun, 15 Feb 2015 13:50:30 +0000 (UTC) Received: by mail-ee0-f70.google.com with SMTP id c41sf8662522eek.1 for ; Sun, 15 Feb 2015 05:50:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=vDwzHVyksxcK4TXMfagnEr2ps/bWYvgcBmxylp7Pa8o=; b=OCD5tPKBhFW1Y1bmEyMtkJlcbSaRB3zhQ8cpBMpSRwo4JJO4csQ08vBlnkBIL/jgCS JkwsSuM9Me8C7KIMAC29LHinwI9OStOjbqI+6fqhLRYirABSaNUYsHn7T7CL0Gcl14cH 787NMN/1jRLItTlvFcYEpY2/yl/vTUn3jfh585k8zURRRZREuFTIWy2eW0KVcWPyXZuc 3dcjh1jSV3m9XjNIDAufO9sScBJs8kIb6iIlcB5WoqaisavFLwnbOZUlqk97iKRj8v7R JUt2JihmlPHXrPErVTnR6SUzD5NY5DS8M/E5F0lSenR/jDPjlmj6PQ1qH8CBzEVlmAFv ewLA== X-Gm-Message-State: ALoCoQkgLUpIgGO7t5hsC9tdy1b6n+KZmCk6fM1LId0FSz2mj4bkX/XnFNvreBishlqvYkBhUAB2 X-Received: by 10.152.26.74 with SMTP id j10mr2355362lag.10.1424008229354; Sun, 15 Feb 2015 05:50:29 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.45.68 with SMTP id k4ls431889lam.85.gmail; Sun, 15 Feb 2015 05:50:29 -0800 (PST) X-Received: by 10.112.54.228 with SMTP id m4mr17498584lbp.20.1424008229141; Sun, 15 Feb 2015 05:50:29 -0800 (PST) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com. [209.85.217.176]) by mx.google.com with ESMTPS id c6si4481619lbn.158.2015.02.15.05.50.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 15 Feb 2015 05:50:28 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) client-ip=209.85.217.176; Received: by mail-lb0-f176.google.com with SMTP id u10so22984243lbd.7 for ; Sun, 15 Feb 2015 05:50:28 -0800 (PST) X-Received: by 10.152.26.199 with SMTP id n7mr17091842lag.29.1424008228589; Sun, 15 Feb 2015 05:50:28 -0800 (PST) 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.112.35.133 with SMTP id h5csp1054350lbj; Sun, 15 Feb 2015 05:50:27 -0800 (PST) X-Received: by 10.68.136.7 with SMTP id pw7mr30943314pbb.168.1424008226578; Sun, 15 Feb 2015 05:50:26 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fe2si10910902pab.97.2015.02.15.05.50.25; Sun, 15 Feb 2015 05:50:26 -0800 (PST) Received-SPF: none (google.com: linux-usb-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754889AbbBONuV (ORCPT + 4 others); Sun, 15 Feb 2015 08:50:21 -0500 Received: from mail-pd0-f171.google.com ([209.85.192.171]:37766 "EHLO mail-pd0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754822AbbBONuU (ORCPT ); Sun, 15 Feb 2015 08:50:20 -0500 Received: by pdbfl12 with SMTP id fl12so29455486pdb.4 for ; Sun, 15 Feb 2015 05:50:20 -0800 (PST) X-Received: by 10.66.149.98 with SMTP id tz2mr31029102pab.63.1424008220162; Sun, 15 Feb 2015 05:50:20 -0800 (PST) Received: from localhost.localdomain ([180.150.148.224]) by mx.google.com with ESMTPSA id bx13sm11961132pdb.19.2015.02.15.05.50.13 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 15 Feb 2015 05:50:18 -0800 (PST) From: Zhangfei Gao To: balbi@ti.com, john.youn@synopsys.com, Mian Yousaf Kaukab Cc: linux-usb@vger.kernel.org, Zhangfei Gao Subject: [PATCH v3] usb: dwc2: gadget reuse ahbcfg assigned from platform Date: Sun, 15 Feb 2015 21:50:01 +0800 Message-Id: <1424008201-32416-1-git-send-email-zhangfei.gao@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1423036870-31392-3-git-send-email-zhangfei.gao@linaro.org> References: <1423036870-31392-3-git-send-email-zhangfei.gao@linaro.org> Sender: linux-usb-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: zhangfei.gao@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) 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 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Reuse ahbcfg if assigned from platform Input from John: AHB_SINGLE, NOTI_ALL_DMA_WRIT, REM_MEM_SUPP, HBSTLEN, and INV_DESC_ENDIANNESS only apply in DMA mode and are ignored in slave mode operation. Signed-off-by: Zhangfei Gao --- drivers/usb/dwc2/gadget.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index 15aa578..5726fbe 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c @@ -2314,14 +2314,19 @@ void s3c_hsotg_core_init_disconnected(struct dwc2_hsotg *hsotg, GINTSTS_USBSUSP | GINTSTS_WKUPINT, hsotg->regs + GINTMSK); + if (hsotg->core_params && hsotg->core_params->ahbcfg != -1) + val = hsotg->core_params->ahbcfg & ~GAHBCFG_CTRL_MASK; + else + val = 0; + if (using_dma(hsotg)) writel(GAHBCFG_GLBL_INTR_EN | GAHBCFG_DMA_EN | - (GAHBCFG_HBSTLEN_INCR4 << GAHBCFG_HBSTLEN_SHIFT), - hsotg->regs + GAHBCFG); + (val ? val : GAHBCFG_HBSTLEN_INCR4 << + GAHBCFG_HBSTLEN_SHIFT), hsotg->regs + GAHBCFG); else writel(((hsotg->dedicated_fifos) ? (GAHBCFG_NP_TXF_EMP_LVL | GAHBCFG_P_TXF_EMP_LVL) : 0) | - GAHBCFG_GLBL_INTR_EN, + GAHBCFG_GLBL_INTR_EN | val, hsotg->regs + GAHBCFG); /*