From patchwork Fri Nov 11 20:59:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Lamparter X-Patchwork-Id: 693960 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3tFsjw4Pdhz9ssP for ; Sat, 12 Nov 2016 07:59:48 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=googlemail.com header.i=@googlemail.com header.b="xffnV21W"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938383AbcKKU7V (ORCPT ); Fri, 11 Nov 2016 15:59:21 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:36810 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934770AbcKKU7S (ORCPT ); Fri, 11 Nov 2016 15:59:18 -0500 Received: by mail-wm0-f65.google.com with SMTP id m203so10259462wma.3; Fri, 11 Nov 2016 12:59:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=klasSrzeo+Aro4KtRKTbyG5NSVeF8P8a1yTfarocmWU=; b=xffnV21WSp2J4QWjF7Nu489zfKd49tL/eTlK3x9Az4ohrCMI/EjY47u2TbbCF7AGQJ BCF6yPWBfGS9LCP9LQNFSFHXdHEJLEfZrDd8pH1wlms+Tw4SM3OAcHt9Oqh2uPiSvMRV 7uU/H54boTW9vlEP9O8kA4vLlGgrSUkp7SYaHlhikSJnpbHvo89zeq1wzuRA8PH3Zu70 ICeGrrGmM9eiuq1MjAr+195D2JK4KsXmL2fT/GX27P4NY+Ski2/jspk5W13hXSlwG/7o fpWtbTCDHkrlaBqeKGcOl9SOVuZ4MWmikuJSInejmFFNXC1obbD18mCT4ujAgwLAj2aH DjJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=klasSrzeo+Aro4KtRKTbyG5NSVeF8P8a1yTfarocmWU=; b=mEzkq9zB8jWo/8h3andWW+cXZwOefBNq+1/JA/pmcFxA+0lCnMEK4+QB6SH5MVzGJ7 jgI3GHwPml2E0tPcEozINciS7y3XJoq0JvsnG8fi5Z+d1enMkqcXkgAnxq0Ko36ysuD6 nof8B0Zy72F8yB8W4sLEG897mwWZzBB5VhQTq8V6/5/emT0DdIylYtlA1THGtSiA/2LQ HTBF5AG6pX/5LHTGYhfiFjCIs3jI7umCVBkD/mghTsitIIUVWXIsymfkMpM1e7ZG+gk1 wb4lc+C7v4chVzkdVL2FLQi0s6VQmwcIGOK3u2UlyFqX/K7h0GxzmcHu3NM9JP4e6GbT G9CA== X-Gm-Message-State: ABUngvcMazAs3jOnvxttIwiToUKRxeHqJOUF1lwsTZcFdN7R88WRlSwWWDKv65yl97jbew== X-Received: by 10.194.62.178 with SMTP id z18mr12131785wjr.20.1478897956533; Fri, 11 Nov 2016 12:59:16 -0800 (PST) Received: from debian64.daheim (pD9F881AE.dip0.t-ipconnect.de. [217.248.129.174]) by smtp.gmail.com with ESMTPSA id c187sm14092562wmd.13.2016.11.11.12.59.14 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 11 Nov 2016 12:59:14 -0800 (PST) From: Christian Lamparter X-Google-Original-From: Christian Lamparter Received: from chuck by debian64.daheim with local (Exim 4.87) (envelope-from ) id 1c5Iuo-0007Qc-8r; Fri, 11 Nov 2016 21:59:14 +0100 To: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-usb@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Cc: John Youn , Mark Rutland , Rob Herring , Greg Kroah-Hartman , Felipe Balbi Subject: [PATCH 1/2] usb: dwc2: add amcc,dwc-otg support Date: Fri, 11 Nov 2016 21:59:13 +0100 Message-Id: X-Mailer: git-send-email 2.10.2 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org This patch adds support for the "amcc,usb-otg" device which is found in the PowerPC Canyonlands' dts. The device definition was added by: commit c89b3458d8cc ("powerpc/44x: Add USB DWC DTS entry to Canyonlands board")' but without any driver support as the dwc2 driver wasn't available at that time. Note: The system can't use the generic "snps,dwc2" compatible because of the special ahbcfg configuration. The default GAHBCFG_HBSTLEN_INCR4 of snps,dwc2 can cause a system hang when the USB and SATA is used concurrently. Cc: Felipe Balbi Cc: John Youn Signed-off-by: Christian Lamparter Acked-by: John Youn --- v1->v2 - moved definitons to params.c - removed dma_enable / host_dma parameter - added dma_desc_fs_enable parameter --- Documentation/devicetree/bindings/usb/dwc2.txt | 1 + drivers/usb/dwc2/params.c | 33 ++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/Documentation/devicetree/bindings/usb/dwc2.txt b/Documentation/devicetree/bindings/usb/dwc2.txt index 10a2a4b..6ccfe85 100644 --- a/Documentation/devicetree/bindings/usb/dwc2.txt +++ b/Documentation/devicetree/bindings/usb/dwc2.txt @@ -12,6 +12,7 @@ Required properties: - "lantiq,xrx200-usb": The DWC2 USB controller instance in Lantiq XRX SoCs; - "amlogic,meson8b-usb": The DWC2 USB controller instance in Amlogic Meson8b SoCs; - "amlogic,meson-gxbb-usb": The DWC2 USB controller instance in Amlogic S905 SoCs; + - "amcc,dwc-otg": The DWC2 USB controller instance in AMCC Canyonlands 460EX SoCs; - snps,dwc2: A generic DWC2 USB controller with default parameters. - reg : Should contain 1 register range (address and length) - interrupts : Should contain 1 interrupt diff --git a/drivers/usb/dwc2/params.c b/drivers/usb/dwc2/params.c index 64d5c66..5d822c5 100644 --- a/drivers/usb/dwc2/params.c +++ b/drivers/usb/dwc2/params.c @@ -192,6 +192,38 @@ static const struct dwc2_core_params params_amlogic = { .hibernation = -1, }; +static const struct dwc2_core_params params_amcc_dwc_otg = { + .otg_cap = DWC2_CAP_PARAM_HNP_SRP_CAPABLE, + .otg_ver = -1, + .dma_desc_enable = -1, + .dma_desc_fs_enable = -1, + .speed = -1, + .enable_dynamic_fifo = -1, + .en_multiple_tx_fifo = -1, + .host_rx_fifo_size = -1, + .host_nperio_tx_fifo_size = -1, + .host_perio_tx_fifo_size = -1, + .max_transfer_size = -1, + .max_packet_count = -1, + .host_channels = -1, + .phy_type = -1, + .phy_utmi_width = -1, + .phy_ulpi_ddr = -1, + .phy_ulpi_ext_vbus = -1, + .i2c_enable = -1, + .ulpi_fs_ls = -1, + .host_support_fs_ls_low_power = -1, + .host_ls_low_power_phy_clk = -1, + .ts_dline = -1, + .reload_ctl = -1, + /* Avoid system hang during concurrently using USB and SATA */ + .ahbcfg = GAHBCFG_HBSTLEN_INCR16 << + GAHBCFG_HBSTLEN_SHIFT, + .uframe_sched = -1, + .external_id_pin_ctl = -1, + .hibernation = -1, +}; + static const struct dwc2_core_params params_default = { .otg_cap = -1, .otg_ver = -1, @@ -239,6 +271,7 @@ const struct of_device_id dwc2_of_match_table[] = { { .compatible = "samsung,s3c6400-hsotg", .data = NULL}, { .compatible = "amlogic,meson8b-usb", .data = ¶ms_amlogic }, { .compatible = "amlogic,meson-gxbb-usb", .data = ¶ms_amlogic }, + { .compatible = "amcc,dwc-otg", .data = ¶ms_amcc_dwc_otg }, {}, }; MODULE_DEVICE_TABLE(of, dwc2_of_match_table);