From patchwork Wed Apr 11 14:29:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 897208 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="pI1IbwuK"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 40LmdD04HCz9s3B for ; Thu, 12 Apr 2018 00:29:19 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 8956AC21C2C; Wed, 11 Apr 2018 14:29:16 +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_H3, RCVD_IN_MSPIKE_WL, 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 E9CE1C21C3F; Wed, 11 Apr 2018 14:29:13 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 00491C21C50; Wed, 11 Apr 2018 14:29:12 +0000 (UTC) Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by lists.denx.de (Postfix) with ESMTPS id BD2B2C21C2C for ; Wed, 11 Apr 2018 14:29:11 +0000 (UTC) Received: by mail-wm0-f67.google.com with SMTP id x4so4148138wmh.5 for ; Wed, 11 Apr 2018 07:29:11 -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=ElyQVZ2LF01bpzC9Gdsy/qMxJsXpWXTYVR1V8UQvEfY=; b=pI1IbwuKd16QRzWwUd7gZ6hxiEQhWNsF4JHKp4xQ9W/AZrtpNU324jrvrdT748X4R9 eVE40bw6ye+fSmdXR5+V3mN5WsDKNXs368L360WHTaPUpuqxHexEZWu8QJhVd4dh0GaE nnSkC/iNG3DAy3ipXaVj0vyDoJ0pYtmq1UD1gw0KO+Ob//vlEfnjhH6GuK8ZNUVg82X0 QYxr2U3XJSKQUrtj3tSrGUKNR/ZqSgHxLoKAMMaPoZIbtm+m3lp32oWoQhc5c4JvT53W ROJpDrHC+Y9PsEwd+l+dn8HdXDWbSOcOT+U7uRm3PCKjROBEUZXtehKxeylnr2WZ5Mka Fo7A== 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=ElyQVZ2LF01bpzC9Gdsy/qMxJsXpWXTYVR1V8UQvEfY=; b=Zk331DsaevQ4rQCPV58dG7W3vjFeTDS3Su5GHB7XYW6tJiA8VmGv9FpzuI4BoXO9YS jskycDzHB0yb5qJJL9xCniP865UlwwSt6akWp/3u66oOt48eN3MqxWiOdEeDSoG3Q8tP zxqkbbkGd9/k7DlNv9ls1p0HCeTOsBPT5YifGzoo/sVW0XY4V3pwjHJVnlu8YrB2jTmk /5bHV63IrGfY+h/eKjH6KiuIBhjPXP3UVQrlQ1qlZM3EQnbm+bc0txArapfTpF2skebO 2Jr/jRuENSeXxynw+zHGL1rTQheHtc4ZAKhawF3jCrpTtdBV+qnMZ67+6JclQ8E1gpqp L7yA== X-Gm-Message-State: ALQs6tAzV+J6UhirFIoVdkHi9awsjp9TybayQlsxeYDnggsHEYjBpHot 9prvuK1dO8KKNoXSekNtdfsJErpByjA= X-Google-Smtp-Source: AIpwx4/1obx8VIVCw5q1OAk73LHdVC02lERfO6XvYsY1VqebqxlOyaq7KYxmVq/k6NnRSGLVBzuuCw== X-Received: by 10.28.139.5 with SMTP id n5mr2738107wmd.85.1523456950710; Wed, 11 Apr 2018 07:29:10 -0700 (PDT) Received: from bender.baylibre.local ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id k35sm1132575wre.55.2018.04.11.07.29.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 11 Apr 2018 07:29:09 -0700 (PDT) From: Neil Armstrong To: u-boot@lists.denx.de, marex@denx.de, bmeng.cn@gmail.com Date: Wed, 11 Apr 2018 16:29:04 +0200 Message-Id: <1523456947-4242-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 v2 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 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 | 123 ++++++++++++++++++++ drivers/usb/host/xhci-dwc3.c | 113 ++++++++++-------- 8 files changed, 645 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