From patchwork Sun Sep 4 21:31:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 9312847 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D2C22600CA for ; Sun, 4 Sep 2016 21:33:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C3F70286C7 for ; Sun, 4 Sep 2016 21:33:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B70B8286D3; Sun, 4 Sep 2016 21:33:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 47E38286C7 for ; Sun, 4 Sep 2016 21:33:38 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bgf2i-0001zj-Mg; Sun, 04 Sep 2016 21:33:32 +0000 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bgf1w-0001gf-2W; Sun, 04 Sep 2016 21:32:46 +0000 Received: by mail-wm0-x243.google.com with SMTP id l65so2834611wmf.3; Sun, 04 Sep 2016 14:32:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Lt3gmdOTl5LHWrOJDsENYLaUAVwUwJJ2lL25OYqB3d8=; b=Nu+cLYN515n4axIA37xZqjIJe3EZ0z2jNT0gTs6Gy7tP8eZKXEcC9YZC+HKIeSAYI3 HozLtcsgPh0B+0z3tNP7swcBS0cj1RtxoKISVjuzUVBeeoGZQygn4fOqXi/yN/0Ul3aI 006hyL9egh0ADKHxBecKdDsvKGU7TbnWl2I9cR0cd3jO9Y0uPfMFsseA5Em3unkYhFit 0yz9SbvR2lr8hzb0ruRqjCC7ONFKxtHEHLwZUTsPB9cNj2BVqEY/xMXYC27sZdyXf8uZ hrhrJVEmU7yao7rmIXvQskmFPvCOfcFP4Lr0pJBelzGT4R11jVbzTinVKzTliAFSeeGE Zpaw== 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:in-reply-to :references; bh=Lt3gmdOTl5LHWrOJDsENYLaUAVwUwJJ2lL25OYqB3d8=; b=HKw10tt1sv/60hO9SvePDHWY90PgH77xqV3Lq7QijaCG5Ff4i99yJ6wzhnuYUtN0IR Z8T6KnIDWS6C+bf9OrZs9uo1kMZl/tOfUOTlgUYXn5zXI12ywzI+c/LaGKTC+a6Keo5T iTFBsEOwD11cf0uetcZfeF3y+NeETiob0am79pwrhio0h4JFqHNpIpsC8ubwqHf0Jujj tkTwxv71lcyoJUkxGjPXmks0bmv5aMMQqcMKAUX/01gvFrr5RIxNaBflQFYVeEVFObHY 9YM2VJsStsRXTnR9DnCrO9dWaZWQtG40elImTHMZ55ryIJg0RvJUqDMr12I0hvCTXkd7 BHoA== X-Gm-Message-State: AE9vXwM6HqbVX8vyNhYvOjXwauJEinKqrR37pPLRE6BfM1gu9AlfckZRiMjdJqj++iveSQ== X-Received: by 10.194.66.3 with SMTP id b3mr30187902wjt.119.1473024742434; Sun, 04 Sep 2016 14:32:22 -0700 (PDT) Received: from blackbox.darklights.net (p200300DCD3CA8104A82AA8E503619161.dip0.t-ipconnect.de. [2003:dc:d3ca:8104:a82a:a8e5:361:9161]) by smtp.googlemail.com with ESMTPSA id e12sm16576059wmg.17.2016.09.04.14.32.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 04 Sep 2016 14:32:21 -0700 (PDT) From: Martin Blumenstingl To: linux-clk@vger.kernel.org, linux-usb@vger.kernel.org, linux-amlogic@lists.infradead.org, jbrunet@baylibre.com, johnyoun@synopsys.com, kishon@ti.com, khilman@baylibre.com, carlo@caione.org Subject: [PATCH 2/7] usb: dwc2: add support for Meson8b and GXBB SoCs Date: Sun, 4 Sep 2016 23:31:47 +0200 Message-Id: <20160904213152.25837-3-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20160904213152.25837-1-martin.blumenstingl@googlemail.com> References: <20160904213152.25837-1-martin.blumenstingl@googlemail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160904_143244_354486_84A672A6 X-CRM114-Status: GOOD ( 10.04 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, devicetree@vger.kernel.org, gregkh@linuxfoundation.org, Martin Blumenstingl , sboyd@codeaurora.org, mturquette@baylibre.com, will.deacon@arm.com, robh+dt@kernel.org, catalin.marinas@arm.com, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Jerome Brunet Add compatible strings for amlogic Meson8b and GXBB SoCs with the corresponding configuration parameters. Signed-off-by: Martin Blumenstingl Signed-off-by: Jerome Brunet --- Documentation/devicetree/bindings/usb/dwc2.txt | 2 ++ drivers/usb/dwc2/platform.c | 34 ++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/Documentation/devicetree/bindings/usb/dwc2.txt b/Documentation/devicetree/bindings/usb/dwc2.txt index 20a68bf..2c30a54 100644 --- a/Documentation/devicetree/bindings/usb/dwc2.txt +++ b/Documentation/devicetree/bindings/usb/dwc2.txt @@ -10,6 +10,8 @@ Required properties: - "rockchip,rk3288-usb", "rockchip,rk3066-usb", "snps,dwc2": for rk3288 Soc; - "lantiq,arx100-usb": The DWC2 USB controller instance in Lantiq ARX SoCs; - "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; - 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/platform.c b/drivers/usb/dwc2/platform.c index fc6f525..8f7b34c 100644 --- a/drivers/usb/dwc2/platform.c +++ b/drivers/usb/dwc2/platform.c @@ -181,6 +181,38 @@ static const struct dwc2_core_params params_ltq = { .hibernation = -1, }; +static const struct dwc2_core_params params_amlogic = { + .otg_cap = DWC2_CAP_PARAM_NO_HNP_SRP_CAPABLE, + .otg_ver = -1, + .dma_enable = 1, + .dma_desc_enable = 0, + .dma_desc_fs_enable = 0, + .speed = DWC2_SPEED_PARAM_HIGH, + .enable_dynamic_fifo = 1, + .en_multiple_tx_fifo = -1, + .host_rx_fifo_size = 512, + .host_nperio_tx_fifo_size = 500, + .host_perio_tx_fifo_size = 500, + .max_transfer_size = -1, + .max_packet_count = -1, + .host_channels = 16, + .phy_type = DWC2_PHY_TYPE_PARAM_UTMI, + .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, + .ahbcfg = GAHBCFG_HBSTLEN_INCR8 << + GAHBCFG_HBSTLEN_SHIFT, + .uframe_sched = 0, + .external_id_pin_ctl = -1, + .hibernation = -1, +}; + /* * Check the dr_mode against the module configuration and hardware * capabilities. @@ -464,6 +496,8 @@ static const struct of_device_id dwc2_of_match_table[] = { { .compatible = "lantiq,xrx200-usb", .data = ¶ms_ltq }, { .compatible = "snps,dwc2", .data = NULL }, { .compatible = "samsung,s3c6400-hsotg", .data = NULL}, + { .compatible = "amlogic,meson8b-usb", .data = ¶ms_amlogic }, + { .compatible = "amlogic,meson-gxbb-usb", .data = ¶ms_amlogic }, {}, }; MODULE_DEVICE_TABLE(of, dwc2_of_match_table);