From patchwork Thu Jun 27 11:02:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Jacques Hiblot X-Patchwork-Id: 1123299 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=fail (p=quarantine dis=none) header.from=ti.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="NN22tePx"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45ZHkV3WCFz9sCJ for ; Thu, 27 Jun 2019 21:30:10 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 1C7EBC21D65; Thu, 27 Jun 2019 11:30:06 +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=KHOP_BIG_TO_CC, 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 CD552C21C2F; Thu, 27 Jun 2019 11:30:03 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 4AC2FC21D8A; Thu, 27 Jun 2019 11:03:23 +0000 (UTC) Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) by lists.denx.de (Postfix) with ESMTPS id 35213C21E30 for ; Thu, 27 Jun 2019 11:03:20 +0000 (UTC) Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id x5RB2vnB011210; Thu, 27 Jun 2019 06:02:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1561633377; bh=5cdeqQD7HuACDqjNpv5rnxDCJ6dItc9AHa+xfUY5Z2o=; h=From:To:CC:Subject:Date; b=NN22tePxabbUw95gs8EeGCdiV3SHw8FaCdVaDeyLHBbBjsKTZeel5+JHlLX2Bi0tU nIyYixFI+JKPSVxGtNdnTviCQ+zT1svyo2AczZxU+H2ozJAh03ZPnNes7tElzsRAff z+GL7R9ROHl8FhL/d+idbRUbtnHj1xxDVTkZOd1Y= Received: from DFLE115.ent.ti.com (dfle115.ent.ti.com [10.64.6.36]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x5RB2ukh086513 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 27 Jun 2019 06:02:57 -0500 Received: from DFLE113.ent.ti.com (10.64.6.34) by DFLE115.ent.ti.com (10.64.6.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Thu, 27 Jun 2019 06:02:56 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Thu, 27 Jun 2019 06:02:56 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id x5RB2tHR104170; Thu, 27 Jun 2019 06:02:56 -0500 From: Jean-Jacques Hiblot To: , Date: Thu, 27 Jun 2019 13:02:33 +0200 Message-ID: <20190627110251.2591-1-jjhiblot@ti.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Mailman-Approved-At: Thu, 27 Jun 2019 11:30:02 +0000 Cc: Marcel Ziswiler , u-boot@lists.denx.de, Stefan Roese , Tom Rini , Ryder Lee , Heinrich Schuchardt , Michal Simek , Krzysztof Kozlowski , Maxime Ripard , Sven Schwermer , York Sun , Ramon Fried , Vitaly Andrianov , Igor Opaniuk , Joe Hershberger Subject: [U-Boot] [PATCH v3 00/18] Fixes for the DWC3 USB generic driver 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The original title was "Improvement for the DWC3 USB generic driver and fixes for the K2 platforms" but has been changed because using UCLASS_MISC actually breaks the driver The K2 platforms have shown boot issues after switching to the DWC3 generic driver. Those are due to the fact that the USB domains are not turned off before booting linux and the phy were not properly initialized. Fixing it by improving the DWC3-generic driver and handling the USB power domain in the PHY driver. At the same time this series introduce a new uclass (UCLASS_NOP) to replace usage of UCLASS_MISC in the USB wrapper because the MISC class now automatically binds all the child devices and that breaks the DWC3-generic driver. Improvements to the DWC3 generic driver are: - Fix it by switching to UCLASS_NOP - core: read quirks properties from DT and apply the fixes. - add a new host driver that uses the DWC3 core (more generic than xhci-dwc3). This should enable most platforms to drop their own version of the xhci-driver to use the generic one instead. This series also removes the now unused xhci-zynqmp driver and tries to better manage the Kconfig options related to DWC3 gadget/host mode selection. This has been tested with K2 and DRA7 platforms (host and device modes). Travis build: https://travis-ci.org/jjhiblot/u-boot/builds/515282720 v2 of this series has been tested by Siva Durga Prasad Paladugu Changes in v3: - updated log message when defaulting to super speed Changes in v2: Add a test for the NOP uclass Update commit log Select USB_GADGET_DUALSPEED if USB_DWC3_GADGET is selected Jean-Jacques Hiblot (18): usb: dwc3-generic: remove dm_scan_fdt_dev() from the remove() callback usb: host: remove the xhci-zynqmp driver dm: Add a No-op uclass usb: dwc3: Use UCLASS_NOP instead of UCLASS_MISC for the DWC3 generic glue usb: dwc3: switch to peripheral mode when exiting usb: xhci: move xhci.h to include usb usb: dwc3: always use the inlined version of dwc3_host_init/dwc3_host_exit usb: dwc3-generic: use platdata usb: dwc3-generic: factorize code usb: dwc3-generic: add a new host driver that uses the dwc3 core usb: dwc3-generic: if no max speed is specified in DT, assume super speed usb: dwc3: Add dwc3_of_parse() to get quirks information from DT usb: dwc3: Kconfig: get rid of obsolete mode selection ARM: keystone: increase PSC timeout ARM: keystone: Do not enable the USB power domains at the board level phy: keystone-usb: handle the transition of the USB power domain configs: k2g_evm_defconfig: disable XHCI_DWC3 and enable KEYSTONE_USB_PHY ARM: DTS: keystone: complete the description of the USB PHY devices MAINTAINERS | 1 + arch/arm/dts/keystone-k2e-evm-u-boot.dtsi | 32 ++++ arch/arm/dts/keystone-k2g-evm-u-boot.dtsi | 28 ++++ arch/arm/dts/keystone-k2hk-evm-u-boot.dtsi | 14 ++ arch/arm/dts/keystone-k2l-evm-u-boot.dtsi | 18 +++ .../arm/mach-keystone/include/mach/psc_defs.h | 2 +- arch/sandbox/dts/test.dts | 12 ++ board/ti/ks2_evm/board.c | 13 -- configs/avnet_ultra96_rev1_defconfig | 1 - configs/evb-rk3328_defconfig | 1 + configs/k2g_evm_defconfig | 3 +- .../xilinx_zynqmp_zc1751_xm015_dc1_defconfig | 1 - .../xilinx_zynqmp_zc1751_xm016_dc2_defconfig | 1 - .../xilinx_zynqmp_zc1751_xm017_dc3_defconfig | 1 - configs/xilinx_zynqmp_zcu100_revC_defconfig | 1 - configs/xilinx_zynqmp_zcu102_rev1_0_defconfig | 1 - configs/xilinx_zynqmp_zcu102_revA_defconfig | 1 - configs/xilinx_zynqmp_zcu102_revB_defconfig | 1 - configs/xilinx_zynqmp_zcu104_revA_defconfig | 1 - configs/xilinx_zynqmp_zcu104_revC_defconfig | 1 - configs/xilinx_zynqmp_zcu106_revA_defconfig | 1 - configs/xilinx_zynqmp_zcu111_revA_defconfig | 1 - drivers/core/uclass.c | 5 + drivers/phy/keystone-usb-phy.c | 22 +++ drivers/usb/dwc3/Kconfig | 18 +-- drivers/usb/dwc3/core.c | 84 +++++++++- drivers/usb/dwc3/core.h | 6 +- drivers/usb/dwc3/dwc3-generic.c | 150 ++++++++++++++---- drivers/usb/host/Kconfig | 7 - drivers/usb/host/Makefile | 1 - drivers/usb/host/xhci-dwc3.c | 2 +- drivers/usb/host/xhci-exynos5.c | 2 +- drivers/usb/host/xhci-fsl.c | 2 +- drivers/usb/host/xhci-mem.c | 2 +- drivers/usb/host/xhci-mvebu.c | 2 +- drivers/usb/host/xhci-omap.c | 2 +- drivers/usb/host/xhci-pci.c | 2 +- drivers/usb/host/xhci-rcar.c | 2 +- drivers/usb/host/xhci-ring.c | 2 +- drivers/usb/host/xhci-rockchip.c | 2 +- drivers/usb/host/xhci-zynqmp.c | 146 ----------------- drivers/usb/host/xhci.c | 2 +- drivers/usb/phy/omap_usb_phy.c | 2 +- include/dm/uclass-id.h | 1 + {drivers/usb/host => include/usb}/xhci.h | 0 test/dm/Makefile | 1 + test/dm/nop.c | 73 +++++++++ 47 files changed, 421 insertions(+), 253 deletions(-) create mode 100644 arch/arm/dts/keystone-k2l-evm-u-boot.dtsi delete mode 100644 drivers/usb/host/xhci-zynqmp.c rename {drivers/usb/host => include/usb}/xhci.h (100%) create mode 100644 test/dm/nop.c