Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp3049541img; Mon, 25 Mar 2019 02:42:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqyhiTefaNpb0uzI9Sc4qFIC8vc5CHKEooTusKqJdTuEIU7fpfqm0KgaLLCqhGir6he9Zdzk X-Received: by 2002:a63:114d:: with SMTP id 13mr1406524pgr.216.1553506929116; Mon, 25 Mar 2019 02:42:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553506929; cv=none; d=google.com; s=arc-20160816; b=NekSKWYQGRwL2jrDbpF3LK/IVZ/81RUkJ5WHGgjF70MK4Do2diLGI3Mb3A/yfDdFN0 diptn68EdbFD24U5JWAWqmiURmN3l+0iHc+oxp7jqMRzcez91uyPZTta3vx1m0Ow7L0t XHMYk4rF87N9L1fIUzxsRZRej2liwZXdyG8vvaRMF/BwmniOTaMYkyFsjIfFyvZRu+u5 53tJ3wAs826XIhYEPhCovLtI+V7aIVGxllCsYuLGMsaWBDlXIieDlM2m5Y8lPemfqMxx cYVsARKVhVjCBnd8EcfBQFnn+1+QQhugMEWBGADZyy5bnaAnEtoNgfPWSWZ3BOFDgNe5 2NwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=ORCiJAmS97AoCQGrgPOozB0oRxyyWrYFL8cx5AfBk5A=; b=SL8IZmHM4H05d7dbLo/qSoFgK6NIJvWKXe5YDRKf3kaATLyl42ymZRuIniq0TpcVp5 gvb4/jNfVndDd2eko1qWXFDAt7AhzdggMONCQSHbClLeHJcAPrOgPqxcmS8LU0OTPshF dr4j0v0Y8Lcbclk5ely3bqdRecHg1O6FC4UF6jP25wdfuH3KxF0rtq/sz+hKu+DllXiZ aJjBRORT1Y31u/+ehM4rT06w6bov08PYLsR77ynpRoCHklQR/Ckx55sao7+QYoyCOYxN 0yiAG3IBcSSB6r+P8z2EyDl/EVgHDJvjrF52ZXpkvEaJ8JWuBPZe7KZwUrpdPKBsgibz 8pKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=awdUeNEU; 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 o12si436907pgp.94.2019.03.25.02.41.54; Mon, 25 Mar 2019 02:42:09 -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; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=awdUeNEU; 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 S1730363AbfCYJjs (ORCPT + 99 others); Mon, 25 Mar 2019 05:39:48 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:39565 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730227AbfCYJjs (ORCPT ); Mon, 25 Mar 2019 05:39:48 -0400 Received: by mail-wr1-f66.google.com with SMTP id j9so9247684wrn.6 for ; Mon, 25 Mar 2019 02:39:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ORCiJAmS97AoCQGrgPOozB0oRxyyWrYFL8cx5AfBk5A=; b=awdUeNEU8cryfhz+GdmkPQ2Q1cT0croQcU1fcAKn/PAbwpr7kbhEtxWRgWjbEYd32K MHEohU8OPpf0Gf9dTHJWwLgy4bXeTeVAo3np2khc6cdjBtHKYRwyXlfkBxnxNp8tFo9A ZsLlU0debRHpmfbUx4A/i6rTnQhYCAfTteExnPO5R3YY6XdSDZ7oDvqIxpQpRRZwj6CX m3vi+j6AIkxMDqKGvq4uCPma3BXL3S9L0jTnhzGPzO6qW0GTz4kt0WMHsVe4S3RxosCc 7sDPppSIlxeq7hdeuGsTNyMmIBYLjUWMMU5rof2jn5UVE34hUKBe6AYRBMP69YEAmMfp WZqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ORCiJAmS97AoCQGrgPOozB0oRxyyWrYFL8cx5AfBk5A=; b=jfzXnlrtcaBKMPRD0EGNP0or8O8nB71WtV5LALrA8scRxOCwcAMkNhzye37vpycuot ce3O+CcVw7Hgm5Oi3mahOxquRym/bbxHbCGZGUEe8pDfwFy17Bkl4oNtEVu3r+1wx8EL kkoIx/LDwCqGkmfvLRCCtJIYTg+zlmQHBQHZiayY2VMePwRVOtlzdWd1gRlqnZ6Mnmss UPmOnmPEMOeH1kUv24OOwiDEu4aR5L8cuckkLyvFXzs42bqXbCFw9pilQ3ULv0T+yuiH xhKe8V14y5ojeviWotUaupLB+U7LbfgjVxsJrs1F2E8Ugg1aMsDOM8GOwFWnOHYX496v FTQA== X-Gm-Message-State: APjAAAWb2Jd63Cz9u4K+9udZRpSlqd1lpcR47buAgubAMia6j396udBq u/xiBszV266R0h6SCQIFbwZC6w== X-Received: by 2002:a5d:6b0d:: with SMTP id v13mr16335308wrw.284.1553506785670; Mon, 25 Mar 2019 02:39:45 -0700 (PDT) Received: from bender.baylibre.local (lmontsouris-657-1-212-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.gmail.com with ESMTPSA id k14sm13044652wmj.26.2019.03.25.02.39.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 25 Mar 2019 02:39:45 -0700 (PDT) From: Neil Armstrong To: gregkh@linuxfoundation.org, hminas@synopsys.com, balbi@kernel.org, kishon@ti.com Cc: Neil Armstrong , linux-amlogic@lists.infradead.org, linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 0/8] arm64: meson: Add support for USB on Amlogic G12A Date: Mon, 25 Mar 2019 10:39:35 +0100 Message-Id: <20190325093943.29138-1-narmstrong@baylibre.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patchset adds support for USB on Amlogic G12A SoCs. This patchset is composed with : - bindings of the PHYs - bindings of the USB Control Glue - PHY Drivers - USB Control Glue driver Device Tree nodes will be added in a separate patchset. The Amlogic G12A USB Complex is composed of : - 2 USB Controllers : * DWC3 for USB2 and USB3 Host functionality * DWC2 for USB2 Peripheral functionality - 2 USB2 OTG PHYs, only a single one will be routed to either DWC2 to DWC3 - 1 USB3 PHY shared with PCIE funcionnality - A Glue to control PHY routing, setup and OTG detection The Glue configures the UTMI 8bit interfaces for the USB2 PHYs, including routing of the OTG PHY between the DWC3 and DWC2 controllers, and setups the on-chip OTG mode selection for this PHY. This drivers supports the on-probe setup of the OTG mode, and manually via the USB Role interface. The IRQ mode change detect is yet to be added in a future patchset, mainly due to lack of hardware to validate on. Changes since v4 at [3]: - remove remaining phy_put/clk_put() of patch 8 - handled phy_power_off/on() in suspend/resume - Collected review tag on patch 8 Changes since v3 at [2]: - Documented and replaced magic values in USB2 PHY driver Changes since v2 at [1]: - Collected review tags - Removed syscon.h in usb2 phy driver - Added comment on the USB3/PCIe switch - Renamed dwc3_meson_g12a_usb_init_mode in glue driver - Changed indentation in dwc3_meson_g12a_role_set - Switched to of_get_compatible_child in glue code - Added devm_add_action_or_reset() to disable clock in case of probe failure - Checks priv->vbus before enabling regulator - Switched phy_init/phy_power_on - Removed priv->phys[i] NULL checks in suspend code - Removed clk_disable_unprepare/clk_put in remove code Changes since v1 at [0]: - USB2 PHY Bindings: collected tags and updated commit log - USB3/PCIE PHY Bindings: collected tag and updated reset list - DWC2 Compatible: collected tags - DWC3 Glue Bindings: - removed clock-names and reset-names for single entries - removed ports graph for PHYs and replaced by phys list with phy-names - added dr_mode and optional vbus-supply - fixed example - USB2 PHY Driver: removed USB_SUPPORT and otg.h include - USB3/PCIE PHY Driver: removed USB_SUPPORT, fixed comment and unused reg variable - USB Glue Driver: - Moved debugfs I/F to USB_ROLE_SWITCH framework - Integrated USB Glue Control Registers offset - Removed of graph parsing to use devm_phy_optional_get() - Fixed PHY mode handling and OTG switching - Simplified PHY calls by removing the NULL test - Added optional vbus regulator handling [1] https://lkml.kernel.org/r/20190212151413.24632-1-narmstrong@baylibre.com [2] https://lkml.kernel.org/r/20190304103846.2060-1-narmstrong@baylibre.com [3] https://lkml.kernel.org/r/20190318101153.7531-1-narmstrong@baylibre.com [4] https://lkml.kernel.org/r/20190318132655.30040-1-narmstrong@baylibre.com Neil Armstrong (8): dt-bindings: phy: Add Amlogic G12A USB2 PHY Bindings dt-bindings: phy: Add Amlogic G12A USB3+PCIE Combo PHY Bindings dt-bindings: usb: dwc2: Add Amlogic G12A DWC2 Compatible dt-bindings: usb: dwc3: Add Amlogic G12A DWC3 Glue Bindings phy: amlogic: add Amlogic G12A USB2 PHY Driver phy: amlogic: Add Amlogic G12A USB3 + PCIE Combo PHY Driver usb: dwc2: Add Amlogic G12A DWC2 Params usb: dwc3: Add Amlogic G12A DWC3 glue .../bindings/phy/meson-g12a-usb2-phy.txt | 22 + .../bindings/phy/meson-g12a-usb3-pcie-phy.txt | 22 + .../devicetree/bindings/usb/amlogic,dwc3.txt | 88 +++ .../devicetree/bindings/usb/dwc2.txt | 1 + drivers/phy/amlogic/Kconfig | 22 + drivers/phy/amlogic/Makefile | 2 + drivers/phy/amlogic/phy-meson-g12a-usb2.c | 341 ++++++++++ .../phy/amlogic/phy-meson-g12a-usb3-pcie.c | 413 ++++++++++++ drivers/usb/dwc2/params.c | 12 + drivers/usb/dwc3/Kconfig | 10 + drivers/usb/dwc3/Makefile | 1 + drivers/usb/dwc3/dwc3-meson-g12a.c | 604 ++++++++++++++++++ 12 files changed, 1538 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/meson-g12a-usb2-phy.txt create mode 100644 Documentation/devicetree/bindings/phy/meson-g12a-usb3-pcie-phy.txt create mode 100644 drivers/phy/amlogic/phy-meson-g12a-usb2.c create mode 100644 drivers/phy/amlogic/phy-meson-g12a-usb3-pcie.c create mode 100644 drivers/usb/dwc3/dwc3-meson-g12a.c -- 2.21.0