Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3775097imm; Mon, 18 Jun 2018 03:59:40 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIwgASiaMjr0ryvsBBmXDXm3cPfP371J2kiryY6xc5q2r8xBqGKQdt0ZFis3+60ovFRr705 X-Received: by 2002:a62:ac14:: with SMTP id v20-v6mr12737760pfe.126.1529319580243; Mon, 18 Jun 2018 03:59:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529319580; cv=none; d=google.com; s=arc-20160816; b=IlkmMzptuwZGAiGXVvbSirQ6TRgVDH7NqNb/eKr07BMMe85UIo5jIw1Jee3tn+zyo4 WDvbTRM0BaxdI+PDYD/oYuj7ju5ecdOKb0WCH/FZEztcIsf1tXGUE1eROOyiYV2wi6HY TZ7sAascwyLRqMkyusfZHXV2rEFOHzx/+DxtWFhaC9D94k/ZtsDtuW1w36LI/PKQ+kdC 86ipKbG9AlNkJvi+RO4PR4BHlWcAl5lNQj4cAxuSzF65RFvonDl2X0bphiiqyHovjDIO yc1VzQ7ZwAwqZBg8y4bsom+qsluRzKVNr5EaCzAR1teSChvuS2WJIwYOR1Wp+7fNkEey fIQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=pZLQmHNXL407CH1zb9F3kGwbMGwURkvEUHZwi+H0B4Q=; b=Tb314/NKCKcUrgGt8hvTGstKJsMmI/AqBK/R9MowhX56y7eQ3QDqamfhKoaZPY9avE CRvex/HLHQvi47ltVA+P/gfR8ReSd2AnYI+NN0IRE0fQEJHD4KAj1EGICuQOcsEK9lto cr9CZSJri56kBEcsLZOIqkj0bvnMqAMM9vpLIiokEN/pMQ4g0aCF5Z/jn60ki00aHQc/ 0Hx+hvGjZTxTCi75XkA1X7hy2+svfw7Gm/1MHLv2OekZhtvh1VTMRSTv5HBTau7dcfM1 z9jO9E/wdl4+wu2sgX0gioe59PZITfgRnqhPHBqyvEPmxpT3bIR5+d/1RuzX3KAdqzVU wOcg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k185-v6si11540629pgc.468.2018.06.18.03.59.26; Mon, 18 Jun 2018 03:59:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935570AbeFRKNX (ORCPT + 99 others); Mon, 18 Jun 2018 06:13:23 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:53094 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934506AbeFRIQl (ORCPT ); Mon, 18 Jun 2018 04:16:41 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id C8634C7A; Mon, 18 Jun 2018 08:16:40 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Martin Blumenstingl , Kevin Hilman , Sasha Levin Subject: [PATCH 4.16 042/279] ARM64: dts: meson-gxl: add USB host support Date: Mon, 18 Jun 2018 10:10:27 +0200 Message-Id: <20180618080610.536015394@linuxfoundation.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180618080608.851973560@linuxfoundation.org> References: <20180618080608.851973560@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Martin Blumenstingl [ Upstream commit 8aec5fc1d4d881fe446addb94309efb39d4e5b23 ] This adds USB host support to the Meson GXL SoC. A dwc3 controller is used for host-mode, while a dwc2 controller (not added in this patch because I could not get it working) is used for device-mode only. The dwc3 controller's internal roothub has two USB2 ports enabled but no USB3 port. Each of the ports is supplied by a separate PHY. The USB pins are connected to the SoC's USBHOST_A and USBOTG_B pins. Due to the way the roothub works internally the USB PHYs are left enabled. When the dwc3 controller is disabled the PHY is never powered on so it does not draw any extra power. However, when the dwc3 host controller is enabled then all PHYs also have to be enabled, otherwise USB devices will not be detected (regardless of whether they are plugged into an enabled port or not). This means that only the dwc3 controller has to be enabled on boards with USB support (instead of requiring all boards to enable the PHYs additionally with the chance of forgetting to enable one and breaking all other ports with that as well). This also adds the USB3 PHY which currently only does some basic initialization. That however is required because without it high-speed devices (like USB thumb drives) do not work on some devices (probably because the bootloader does not configure the USB3 PHY registers). Signed-off-by: Martin Blumenstingl Signed-off-by: Kevin Hilman Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- arch/arm64/boot/dts/amlogic/meson-gxl.dtsi | 61 +++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) --- a/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi @@ -57,6 +57,67 @@ no-map; }; }; + + soc { + usb0: usb@c9000000 { + status = "disabled"; + compatible = "amlogic,meson-gxl-dwc3"; + #address-cells = <2>; + #size-cells = <2>; + ranges; + + clocks = <&clkc CLKID_USB>; + clock-names = "usb_general"; + resets = <&reset RESET_USB_OTG>; + reset-names = "usb_otg"; + + dwc3: dwc3@c9000000 { + compatible = "snps,dwc3"; + reg = <0x0 0xc9000000 0x0 0x100000>; + interrupts = ; + dr_mode = "host"; + maximum-speed = "high-speed"; + snps,dis_u2_susphy_quirk; + phys = <&usb3_phy>, <&usb2_phy0>, <&usb2_phy1>; + }; + }; + }; +}; + +&apb { + usb2_phy0: phy@78000 { + compatible = "amlogic,meson-gxl-usb2-phy"; + #phy-cells = <0>; + reg = <0x0 0x78000 0x0 0x20>; + clocks = <&clkc CLKID_USB>; + clock-names = "phy"; + resets = <&reset RESET_USB_OTG>; + reset-names = "phy"; + status = "okay"; + }; + + usb2_phy1: phy@78020 { + compatible = "amlogic,meson-gxl-usb2-phy"; + #phy-cells = <0>; + reg = <0x0 0x78020 0x0 0x20>; + clocks = <&clkc CLKID_USB>; + clock-names = "phy"; + resets = <&reset RESET_USB_OTG>; + reset-names = "phy"; + status = "okay"; + }; + + usb3_phy: phy@78080 { + compatible = "amlogic,meson-gxl-usb3-phy"; + #phy-cells = <0>; + reg = <0x0 0x78080 0x0 0x20>; + interrupts = ; + clocks = <&clkc CLKID_USB>, <&clkc_AO CLKID_AO_CEC_32K>; + clock-names = "phy", "peripheral"; + resets = <&reset RESET_USB_OTG>, <&reset RESET_USB_OTG>; + reset-names = "phy", "peripheral"; + status = "okay"; + }; }; ðmac {