From patchwork Fri Jan 25 10:39:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 10781069 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4B90E13B5 for ; Fri, 25 Jan 2019 10:39:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 382F02F57F for ; Fri, 25 Jan 2019 10:39:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 285BC2F585; Fri, 25 Jan 2019 10:39:41 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 725912F57F for ; Fri, 25 Jan 2019 10:39:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727803AbfAYKjj (ORCPT ); Fri, 25 Jan 2019 05:39:39 -0500 Received: from mail.bootlin.com ([62.4.15.54]:44765 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726111AbfAYKji (ORCPT ); Fri, 25 Jan 2019 05:39:38 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id 0095D20A2E; Fri, 25 Jan 2019 11:39:35 +0100 (CET) Received: from localhost.localdomain (aaubervilliers-681-1-87-206.w90-88.abo.wanadoo.fr [90.88.29.206]) by mail.bootlin.com (Postfix) with ESMTPSA id 8258E20798; Fri, 25 Jan 2019 11:39:25 +0100 (CET) From: Miquel Raynal To: Gregory Clement , Jason Cooper , Andrew Lunn , Sebastian Hesselbarth , Kishon Vijay Abraham I , Rob Herring , Mark Rutland , Greg Kroah-Hartman , Mathias Nyman , Alan Stern Cc: , , linux-usb@vger.kernel.org, Thomas Petazzoni , Antoine Tenart , Maxime Chevallier , Nadav Haklai , Miquel Raynal Subject: [PATCH v4 00/10] A3700 USB S2RAM support Date: Fri, 25 Jan 2019 11:39:14 +0100 Message-Id: <20190125103925.15753-1-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hello, As part of an effort to bring suspend to RAM support to Armada 3700 SoCs (main target: ESPRESSObin), this series handles the work around the USB2 and USB32 IPs. First, a change in the core adds support for the new PHY framework by following the phy_set_mode()/phy_power_on() sequence (patch 1). The second change needed is to update the xHCI MVEBU driver (patch 2) with the XHCI_RESET_ON_RESUME quirk that will do most of the reconfiguration work when resuming. Then, because of the asynchronous suspend feature implemented lately, the xHCI driver was blocking during the S2RAM operation, probably due to a register access while the clock was not enabled. A first patch has been written for that, adding a new quirk to ignore the asynchronous setting [1] which has become useless once clock links with consumer have been contributed [2] (series not merged yet). Then, the OHCI Orion (USB2 host controller) driver is updated to avoid doing twice the PHY management (patch 3) and upgraded with traditional S2RAM callbacks (patch 4). The last missing peace is a UTMI PHY driver for the USB2 part of each controller, which is added in patch 5 (see patch 6 for the bindings). Finally, the A3700 device tree is updated (patch 7, 8, 9) to reference the PHYs. xHCI bindings already document the PHY so no update is needed on this regard. [1] http://code.bulix.org/s2ccd4-511198 [2] http://lists.infradead.org/pipermail/linux-arm-kernel/2019-January/623885.html Thanks, Miquèl Changes since v3: ================= * Bindings: as suggested by Gregory and Rob, used the "-misc" suffix instead of "-miscellaneous" and prefixed the compatible with "armada-3700" to follow what has been used for the other IPs of the same SoC (and added Rob's ack). * Orion driver: added Alan's ack on the removal of the double PHY initialization. * Orion driver: removed the superfluous calls to ehci_prepare_ports_for_controller_suspend() (reported by Alan). Changes since v2: ================= * Typos * UTMI PHY bindings: > New name for the USB2 host/PHY syscons (+ changes in the DT). > Clearly state that the PHYs are different between OTG and host-only controllers. * UTMI PHY driver: > Use GENMASK macro. > Removed useless checks on driver data retrieval. > Dropped the empty ->remove() hook. > Updated the licence macro to match the SPDX tag. > Used the of_device_get_match_data() helper. > Removed the use of a local variable in the ->probe() for the driver's operations. > Fixed the driver co-author: Igal, not Evan. * xHCI mvebu driver: > Used Armada 38x naming convention: s/Armada 3700 SoC/Armada 37xx SoC/ > Added Gregory's Reviewed-by tag. Changes since v1: ================= * Add UTMI PHY driver/bindings/DT changes to bring S2RAM support to both USB ports available on the A3700 SoC. * Updates to the OHCI Orion driver to avoid doing the PHY initialization twice. * Upgrade of the OHCI Orion driver with S2RAM callbacks. * Added a reference to the A3700 SoC in the USB Host Kconfig prompt (not only in the help section). * Rebased on top of v5.0-rc1. Miquel Raynal (9): usb: core: comply to PHY framework usb: ehci-orion: avoid double PHY initialization usb: ehci-orion: add S2RAM support phy: add A3700 UTMI PHY driver dt-bindings: phy: mvebu-utmi: add UTMI PHY bindings MAINTAINERS: phy: fill Armada 3700 PHY drivers entry ARM64: dts: marvell: armada-37xx: fix USB2 memory region ARM64: dts: marvell: armada-37xx: declare USB2 UTMI PHYs ARM64: dts: marvell: armada-37xx: link USB hosts with their PHYs Ofer Heifetz (1): usb: host: xhci: mvebu: add reset on resume quirk .../bindings/phy/phy-mvebu-utmi.txt | 38 +++ MAINTAINERS | 4 +- arch/arm64/boot/dts/marvell/armada-37xx.dtsi | 34 ++- drivers/phy/marvell/Kconfig | 9 + drivers/phy/marvell/Makefile | 1 + drivers/phy/marvell/phy-mvebu-a3700-utmi.c | 278 ++++++++++++++++++ drivers/usb/core/hcd.c | 5 + drivers/usb/core/phy.c | 28 ++ drivers/usb/core/phy.h | 2 + drivers/usb/host/Kconfig | 4 +- drivers/usb/host/ehci-orion.c | 44 ++- drivers/usb/host/xhci-mvebu.c | 11 + drivers/usb/host/xhci-mvebu.h | 6 + drivers/usb/host/xhci-plat.c | 7 + 14 files changed, 444 insertions(+), 27 deletions(-) create mode 100644 Documentation/devicetree/bindings/phy/phy-mvebu-utmi.txt create mode 100644 drivers/phy/marvell/phy-mvebu-a3700-utmi.c