From patchwork Wed Apr 11 15:07:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 897228 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="knmcnuMk"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 40LnWc7506z9s0n for ; Thu, 12 Apr 2018 01:09:32 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 824C4C21C51; Wed, 11 Apr 2018 15:08:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id A294DC21DED; Wed, 11 Apr 2018 15:08:29 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id D0946C21D9A; Wed, 11 Apr 2018 15:08:11 +0000 (UTC) Received: from mail-wr0-f196.google.com (mail-wr0-f196.google.com [209.85.128.196]) by lists.denx.de (Postfix) with ESMTPS id 36578C21C93 for ; Wed, 11 Apr 2018 15:08:07 +0000 (UTC) Received: by mail-wr0-f196.google.com with SMTP id l49so2132355wrl.4 for ; Wed, 11 Apr 2018 08:08:07 -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; bh=O7lwpxVb9RHJLm8qYnNvLUxLK406/gUcVXBTRaM+4z0=; b=knmcnuMkUvjiZY/LLI2PCtygtyt7likRHe5bSjNt3ghQmZFE/5M5bKCLLYAowRtqRm qmC0jVhHfD8KdkOpufsnbFBMlS00WyZ7f6fOQPPnEqB/Sv+lsk2sUkKSf3Sb//DxQ1Jb 2smiUWOsAM1bgev2eTshr1S7ccN40jFKF8SHm+BjvGTlMLFE4g+3kxrh3O/ZEiVIUL3o E3eyIdkF5Xzbw3OhxfzXZM2nfRu4t7+196P8cikBrO3Sh+dMQ7gUcY2ZWS1n3n2cx/bH MEDqPr4qUAbBHYYE9HJdzkGubIGh/QlmnVq7FZGmBr8/7jJSR4yJNlxMeeJX1VgvjEba ircg== 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; bh=O7lwpxVb9RHJLm8qYnNvLUxLK406/gUcVXBTRaM+4z0=; b=s4xcBfLYYjL8oTR8dD9XWDdqnkXLI2wwsAWn0m1gS9rvoclC75CJ7cCe/voRlPtPmz Q/v3DWl3H+pLY4xl46WzExiHQ+KCv4lXKS73ZNRlTRQoXk7ceGUvQeWGtvwIJozj9a4H qt12Ss8lcO+UTEXdD+acWwGrHfC+vFNxRjTCKkyc+n0WYixfCEaGePm+XM+R6/hYr1dO nzjO1SbtEw/KTpqqGz3TiB0X4oB0+jMbE9u3HKny0LFcz7ZNctmDf9txO++iD325QHvl nzfpUHDCJXfaWv9iE7oLm7QU69CGZlJ0CxkWJaBBy/1dQ1WS0FIf7yEE60wVKS40OG9P yVjQ== X-Gm-Message-State: ALQs6tBg4BGkYsy7xs7SrS4PD8NLiDTSYUmvwPrqd0oOI8fOc4RmnM3/ LP2FMcLs0c1uUxhHoa3ePwNW2papbro= X-Google-Smtp-Source: AIpwx4/Xh9A/guf9cabK1rGcn0Mwo3VI18G4gtm6C2D7Yg5cDPxmFqPMS/eXgL8llXIMRSGEhMpIkw== X-Received: by 10.223.151.1 with SMTP id r1mr3689194wrb.126.1523459286319; Wed, 11 Apr 2018 08:08:06 -0700 (PDT) Received: from bender.baylibre.local ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id e27sm2260382wre.86.2018.04.11.08.08.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 11 Apr 2018 08:08:05 -0700 (PDT) From: Neil Armstrong To: u-boot@lists.denx.de, marex@denx.de, bmeng.cn@gmail.com Date: Wed, 11 Apr 2018 17:07:59 +0200 Message-Id: <1523459282-12235-1-git-send-email-narmstrong@baylibre.com> X-Mailer: git-send-email 2.7.4 Cc: linux-amlogic@lists.infradead.org Subject: [U-Boot] [PATCH v3 u-boot 0/3] Add USB Support for Amlogic Meson GXL SoCs X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" This patchset adds support for USB for the Amlogic Meson GXL SoCs following the work done for Linux by Martin Blumenstingl at [1] [2] [3]. The support consist of : - A port of dwc3-of-simple from Linux to U-boot - A change to support more than 2 PHYs in the DWC3 DM driver - An USB2 PHY Driver and an USB3 PHY Driver The DWC3 Controller has up to 4 PHYs connected : - 2 USB2 PHYs and an USB3 PHY for GXL SoCs - 3 USB2 PHYs and an USB3 PHY for the GXM SoC Variant This is enabled by the "usb: host: dwc3: Add support for multiple PHYs" patch. This patch is based on the "xhci-dwc3: Couple of fixes for USB3 support" serie from Vignesh R, on the u-boot-usb tree. The DWC3 Controller glue is generic enough to use the dwc3-of-simple from Linux and can be easily ported to U-Boot as a Simple-Bus with Glue-Specific clocks and Reset lines setup. This depends on the recently applied : - clk: Add get/enable/disable/release for a bulk of clocks at [4] - reset: Add get/assert/deassert/release for bulk of reset signals at [5] in order to manage the clocks and resets of the Glue in a clean fashion. The USB PHY driver supports the standard generic PHY interface and supports the power-on/off calls and set the Host mode by default. They are based on the excellent work from Martin Blumenstingl merged in linux. Changes since v2: - Drop #if and use the empty stubs for clock & reset API Changes since v1: - switch to submitted clk/reset bulk API - splitted dwc3 multiple phy init error between poweroff & exit [1] https://lkml.kernel.org/r/20180303184700.21480-1-martin.blumenstingl@googlemail.com [2] https://lkml.kernel.org/r/20180128202245.25021-1-martin.blumenstingl@googlemail.com [3] https://lkml.kernel.org/r/20180303214309.25643-1-martin.blumenstingl@googlemail.com [4] http://lists.infradead.org/pipermail/linux-amlogic/2018-April/006952.html [5] http://lists.infradead.org/pipermail/linux-amlogic/2018-April/006949.html Neil Armstrong (3): usb: host: Add simple of glue driver for DWC3 USB Controllers integration usb: host: dwc3: Add support for multiple PHYs phy: Add Amlogic Meson USB2 & USB3 Generic PHY drivers drivers/phy/Kconfig | 8 ++ drivers/phy/Makefile | 1 + drivers/phy/meson-gxl-usb2.c | 238 ++++++++++++++++++++++++++++++++++++++ drivers/phy/meson-gxl-usb3.c | 201 ++++++++++++++++++++++++++++++++ drivers/usb/host/Kconfig | 7 ++ drivers/usb/host/Makefile | 1 + drivers/usb/host/dwc3-of-simple.c | 109 +++++++++++++++++ drivers/usb/host/xhci-dwc3.c | 113 ++++++++++-------- 8 files changed, 631 insertions(+), 47 deletions(-) create mode 100644 drivers/phy/meson-gxl-usb2.c create mode 100644 drivers/phy/meson-gxl-usb3.c create mode 100644 drivers/usb/host/dwc3-of-simple.c