Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp2344168imb; Mon, 4 Mar 2019 02:42:05 -0800 (PST) X-Google-Smtp-Source: APXvYqyMwB5ekLu/MGYx8Ci0tdS0JLXU3pfkzKcBlYHTVUe5o+5sS2kz+VmgW0MR5WLemg48Y7nG X-Received: by 2002:a17:902:9a04:: with SMTP id v4mr19995181plp.34.1551696125633; Mon, 04 Mar 2019 02:42:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551696125; cv=none; d=google.com; s=arc-20160816; b=boqYSqEFSb0rtHWqyGp40CS1AlrISf/eeWyL4ZjcDyKiXdednFj7xvgzgGJrCTBUvQ eYAPBi+jbhzSi+NHf5uaBqcEa4L8Ztq9vs3wsrrP9NUQe5brLQssqr1qAcWJikSw2wvu XKEScdOx9qORQ1GhmJa9U5Wq3CUYMs9lO0vxSqnLmuHBfcoeHvp8UWMP8N0mYO3DwE6/ OrHZicaRIZvE9l35M2Xym/omLBVBaS4uupgsHCoyQrt86wIrvBZEsX16xdk8D77QUTC0 HLwdkELOj1P239hIUapH65b1nkMscKYZx/+v878ETCnqzW1Nrs/J6lykTP2qIxbN5/PR L6Jw== 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=iqnLDh/3gLgzm3EIH21yBdzEwG5/GlGIoE3ShsGuFac=; b=AkKG5/FHE/+r/X9qOie9Jh6/o50r1A0ep+IgMAwzVL7Qyfhk28Wwn1csnErW3NfZki r9hpOGKl/3e4u/M8pvWENQoe3NNHiN9JDkrdmvGChAwGMkEorlKa3F3wiI2Pyq94jDdt hdU7ZsgQ07lukbhUmxF8+2pvN/WPoMGokloa+6RjqPENk7rhWIkXabHQLg4hqBt1cB72 OAqjBALd/oEF/XbmZHGCM+PyhvNlDMYQ7bpohUgHcKY7r4ZeU18z3zW7SjkIAfaOdj6b fEjOXrsu3QDAVMTugBI/CmdVrQZo5lhHadZjpx9eGtiQ2CM0IEYxSkb0CP786TYfSEq/ zpIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=YtIG9XTP; 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 f11si5048803plt.133.2019.03.04.02.41.50; Mon, 04 Mar 2019 02:42:05 -0800 (PST) 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=YtIG9XTP; 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 S1726236AbfCDKiv (ORCPT + 99 others); Mon, 4 Mar 2019 05:38:51 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:40569 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726087AbfCDKiv (ORCPT ); Mon, 4 Mar 2019 05:38:51 -0500 Received: by mail-wm1-f66.google.com with SMTP id g20so4136328wmh.5 for ; Mon, 04 Mar 2019 02:38:49 -0800 (PST) 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=iqnLDh/3gLgzm3EIH21yBdzEwG5/GlGIoE3ShsGuFac=; b=YtIG9XTPn1uaQa/M7AQRGKz4zhlKj7GrtQH+ixTBgonNRZEtzjSVpz8kgODOYuWkkc yHUY0TwV2h5o1kw0B5wahRpDgt5cWubbqaXq6jkmpC//79KsG28oFDoaL22BkocaKW+p OjD8AB4ZHkAkcAbQIRRw6QagjTlBVmI2mP4k2cQgPcV60Jei80bXcwb4Zfa2Vj5R2QK0 JsPcAZvBnL5yHRYekfd91CVPBtsUIccCCWoRbQFukcwYyOlP8K81ndPkCEdH8Y3WOrOI OAI+dT9qjZoqlP/1fdd849qfFWibFU5XIduM4z+5BJkkZh1TA0ZmaujPFTE9NnBM6H9H WT2g== 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=iqnLDh/3gLgzm3EIH21yBdzEwG5/GlGIoE3ShsGuFac=; b=JWlBf6F232SfXK1S/L8Jdxq/ioHwTx6zMv79UhWhbbt+QvlzxHDFgn/QeRCa1hfZHJ kjv7miFNa81COjZFC4CTniV+I/r/Gdo84wHUOwWZwEsKz7sAMdeDRkmy46Si7oh/PIS2 JWCzoyeuD8ONNO7sWyaXvlIu5LIHByU143IAsDGRJBEZYolmzBs6OeC092wAHhlI63ft luM6kYVYhL+tLcYTfW+BP6Vo6T+G1iQJtdRRAQHPfCeHLkwEzaRiQfLssrsu/3n9x3hE zDGbh1JQHv1xvSz46s9c3UThkXGISOON0AmpQ1kCFqvVlMXHaKd1Qs5535NRuezjHGis XJdQ== X-Gm-Message-State: APjAAAVbrzQvopPNroMmKSMLR2YxCye1119E0RTTV3gp763zriPFHSO2 LLBZOzIxZPt3wo/0QZ0xBtY0NKt40qzXCg== X-Received: by 2002:a7b:c413:: with SMTP id k19mr11128597wmi.75.1551695928981; Mon, 04 Mar 2019 02:38:48 -0800 (PST) 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 g24sm5505676wmh.45.2019.03.04.02.38.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 04 Mar 2019 02:38:48 -0800 (PST) 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 v2 0/8] arm64: meson: Add support for USB on Amlogic G12A Date: Mon, 4 Mar 2019 11:38:38 +0100 Message-Id: <20190304103846.2060-1-narmstrong@baylibre.com> X-Mailer: git-send-email 2.20.1 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 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 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 | 190 ++++++ .../phy/amlogic/phy-meson-g12a-usb3-pcie.c | 411 ++++++++++++ drivers/usb/dwc2/params.c | 12 + drivers/usb/dwc3/Kconfig | 10 + drivers/usb/dwc3/Makefile | 1 + drivers/usb/dwc3/dwc3-meson-g12a.c | 601 ++++++++++++++++++ 12 files changed, 1382 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.20.1