Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3337504yba; Tue, 23 Apr 2019 01:53:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqwL0QqoyeT8etugQhCoCLHOWTAHvhUEWxKn7QU50ub2pDyqFtfy0WEXAp4GUHTJgllQX8cn X-Received: by 2002:a63:8c7:: with SMTP id 190mr17127723pgi.447.1556009628992; Tue, 23 Apr 2019 01:53:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556009628; cv=none; d=google.com; s=arc-20160816; b=scKnsWtJNr1Erjr6Y3y1yKC9S33HfwJ/rBSpXuXWvzeyIpr+W+C/r7UwJ6Z5lc8Wwa 4Vdxg8nVRn6UO/nALeygqpgLzD1U/pcBLdD7nAxMKOWBd89FTl8iORU8HDo6NqmaTYf2 UGPZ3zEohFGicASDBGFDB+Yykh3SCQ3+og7TJJCoqg5hjZV/Y/KtBPoGXu4KxfCCUcL8 +5tG6mvC3Ag8FoHkP3Fkq9paFnYHmG99Hlc8tPVC7uWSUJgLEKq/3N2BrkG4Fh3nr7fi 0k2RjqVtbFjKRn2kyzigKjXSloBRq5FVqrQ3fsOVMoCjHvIYg/cRUQX0ArZBXW9x3wIX 3dUA== 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=vxcOBoVoCEyqdET5OW32wKLb2a2q/DXbMFqOTJqKm+g=; b=fx0hPF3khSxtIebcEKmCRVNOPWB551hQcSDwj5uDAIZ7wiVCxBVo5dGOEoSoD5cQs5 xffh3iqYr+7/Bvh+02vdvR2zmNhwXohaUU47ibTARxmxvxbCCNjuHir+nVVusMr4LBce Wat/TCe6BAFtZHjGu2yAXhsHfU0W2k6sa/KrJUoIoTPuBVHfMU/d9AXsvEhJkZafe0Rf r8u0lR6POXN+wAwK3WCTvU0BFN/QErG9wFIFJx1Kg5xXmAt6+4vKY0e62T59MldrKYdq vMMDrgjw8KUsUjeMLPAKDxLWGm20cQHpD5bOdumR0r6dzRso2HyRHY/ynkvDXEbY9Uv5 O9lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=EHgRrK7f; 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 t9si14230978pgp.273.2019.04.23.01.53.33; Tue, 23 Apr 2019 01:53:48 -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=EHgRrK7f; 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 S1726911AbfDWIvd (ORCPT + 99 others); Tue, 23 Apr 2019 04:51:33 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:38961 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726502AbfDWIvc (ORCPT ); Tue, 23 Apr 2019 04:51:32 -0400 Received: by mail-wm1-f66.google.com with SMTP id n25so17717550wmk.4 for ; Tue, 23 Apr 2019 01:51:31 -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=vxcOBoVoCEyqdET5OW32wKLb2a2q/DXbMFqOTJqKm+g=; b=EHgRrK7f6Fkpzc7BY/skKQOuSMaCMXYDMM48lBKgDAEpc6OTz1+plpoQrMYKHvilm6 95ZqHWyUrsEhvhErNJ5Qo2Gt2ZIaK/UhD6T4TibH8JiXA90bg+VDub++TmjvxwR+77Qf 9oLJabIjIfUvGxLzG2EqglWiSQrRFKvnHJdVR1WEiBG8lyxp25lmxha4hZ1MXiuEPV0y fH7fg4pSmivG2gxBpSveAXzGNHp7Qs5JOkHvk1Bn+5Cay0I9lXBSBUJnFjpYItzkCft3 N2+xJPcRshMP+GhP2H4hjS//ZRZMJKa6FjpI1qDDJlrRtvLPsoRbaLlRq4Ewyvhj1q3w i0ig== 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=vxcOBoVoCEyqdET5OW32wKLb2a2q/DXbMFqOTJqKm+g=; b=a+6j8ytHkU8xMNBRrVcqYPhdYp/rORu1R9ohmNGTn6tgndzOKqG8zs1dR5PRJj3JzD 95doh9W+TNrs5yRNS6Eg7FkdHTJ+fA1C3OVR0KSbkc5X08/S2QcY0O8kYCr/+pC00qz8 J9RDjUkZrhQ4JiRDI6ghRJWKMKwEAz8Dl5CrJp+phBzyaUwXyNl/6H596u96Qrtbx88A iTFo7nUue94dLZ9ytbxnX7dK5A1grxP3s4A/AwpR26ii5UUjKY+TMe0zfxUOJrEMqcfL H8AosAB2sW/S480oRqiGyKlIarqoTZ38C9Sn0qY4cCj/0aNF2vQoZZyaNpASntYFWjCM VkWw== X-Gm-Message-State: APjAAAVBJG7wHBJmdyHKrX4SjKJ4+1Si2Xl3cmSfGhYIHdKzN8TgY/Ej 7iIdOt9pP345u2kgsQQYwflmQQ== X-Received: by 2002:a7b:c769:: with SMTP id x9mr1433791wmk.103.1556009490768; Tue, 23 Apr 2019 01:51:30 -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 b8sm12515566wrr.64.2019.04.23.01.51.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 23 Apr 2019 01:51:30 -0700 (PDT) From: Neil Armstrong To: gregkh@linuxfoundation.org, hminas@synopsys.com, balbi@kernel.org, kishon@ti.com, chunfeng.yun@mediatek.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 v6 0/4] arm64: meson: Add support for USB on Amlogic G12A Date: Tue, 23 Apr 2019 10:51:23 +0200 Message-Id: <20190423085127.3863-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 v5 at [4]: - Dropped already applied PHY patches - Added patch 3 ack by Minas 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 [0] https://lkml.kernel.org/r/20190212151413.24632-1-narmstrong@baylibre.com [1] https://lkml.kernel.org/r/20190304103846.2060-1-narmstrong@baylibre.com [2] https://lkml.kernel.org/r/20190318101153.7531-1-narmstrong@baylibre.com [3] https://lkml.kernel.org/r/20190318132655.30040-1-narmstrong@baylibre.com [4] https://lkml.kernel.org/r/20190325093943.29138-1-narmstrong@baylibre.com Neil Armstrong (4): dt-bindings: usb: dwc2: Add Amlogic G12A DWC2 Compatible dt-bindings: usb: dwc3: Add Amlogic G12A DWC3 Glue Bindings usb: dwc2: Add Amlogic G12A DWC2 Params usb: dwc3: Add Amlogic G12A DWC3 glue .../devicetree/bindings/usb/amlogic,dwc3.txt | 88 +++ .../devicetree/bindings/usb/dwc2.txt | 1 + drivers/usb/dwc2/params.c | 12 + drivers/usb/dwc3/Kconfig | 10 + drivers/usb/dwc3/Makefile | 1 + drivers/usb/dwc3/dwc3-meson-g12a.c | 604 ++++++++++++++++++ 6 files changed, 716 insertions(+) create mode 100644 drivers/usb/dwc3/dwc3-meson-g12a.c -- 2.21.0