Improvement for the DWC3 USB generic driver and fixes for the K2 platforms
Subsystems (12)
v2 cover Improvement for the DWC3 USB generic driver and fixes for the K2 platforms
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.
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
Changes in v2:
- Add a test for the NOP uclass
- Update commit logs
- 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.cSignature · 1 line
2.17.1
PATCH v2 1/18 usb: dwc3-generic: remove dm_scan_fdt_dev() from the remove() callback
There is simply no reason to do that here.
---
Changes in v2: None
drivers/usb/dwc3/dwc3-generic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/dwc3/dwc3-generic.c +1 -1
@@ -337,7 +337,7 @@ static int dwc3_glue_remove(struct udevice *dev)clk_release_bulk (&glue->clks); -return dm_scan_fdt_dev (dev); +return 0 ; }static const struct udevice_id dwc3_glue_ids[] = {
Signature · 1 line
2.17.1
PATCH v2 2/18 usb: host: remove the xhci-zynqmp driver
In reply to Jean-Jacques HiblotThis driver is not used anymore.
---
Changes in v2: None
configs/avnet_ultra96_rev1_defconfig | 1 - .../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/usb/host/Kconfig | 7 - drivers/usb/host/Makefile | 1 - drivers/usb/host/xhci-zynqmp.c | 146 ------------------ 15 files changed, 166 deletions(-) delete mode 100644 drivers/usb/host/xhci-zynqmp.c
configs/avnet_ultra96_rev1_defconfig +0 -1
@@ -75,7 +75,6 @@ CONFIG_ZYNQ_SPI=y CONFIG_USB=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y -CONFIG_USB_XHCI_ZYNQMP=y CONFIG_USB_DWC3=y CONFIG_USB_DWC3_GADGET=y CONFIG_USB_DWC3_GENERIC=y
configs/xilinx_zynqmp_zc1751_xm015_dc1_defconfig +0 -1
@@ -86,7 +86,6 @@ CONFIG_ZYNQMP_GQSPI=y CONFIG_USB=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y -CONFIG_USB_XHCI_ZYNQMP=y CONFIG_USB_DWC3=y CONFIG_USB_DWC3_GADGET=y CONFIG_USB_DWC3_GENERIC=y
configs/xilinx_zynqmp_zc1751_xm016_dc2_defconfig +0 -1
@@ -77,7 +77,6 @@ CONFIG_SPI=y CONFIG_USB=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y -CONFIG_USB_XHCI_ZYNQMP=y CONFIG_USB_DWC3=y CONFIG_USB_DWC3_GADGET=y CONFIG_USB_DWC3_GENERIC=y
configs/xilinx_zynqmp_zc1751_xm017_dc3_defconfig +0 -1
@@ -74,7 +74,6 @@ CONFIG_SPI=y CONFIG_USB=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y -CONFIG_USB_XHCI_ZYNQMP=y CONFIG_USB_DWC3=y CONFIG_USB_DWC3_GADGET=y CONFIG_USB_DWC3_GENERIC=y
configs/xilinx_zynqmp_zcu100_revC_defconfig +0 -1
@@ -74,7 +74,6 @@ CONFIG_ZYNQ_SPI=y CONFIG_USB=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y -CONFIG_USB_XHCI_ZYNQMP=y CONFIG_USB_DWC3=y CONFIG_USB_DWC3_GADGET=y CONFIG_USB_DWC3_GENERIC=y
configs/xilinx_zynqmp_zcu102_rev1_0_defconfig +0 -1
@@ -101,7 +101,6 @@ CONFIG_ZYNQMP_GQSPI=y CONFIG_USB=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y -CONFIG_USB_XHCI_ZYNQMP=y CONFIG_USB_DWC3=y CONFIG_USB_DWC3_GADGET=y CONFIG_USB_DWC3_GENERIC=y
configs/xilinx_zynqmp_zcu102_revA_defconfig +0 -1
@@ -100,7 +100,6 @@ CONFIG_ZYNQMP_GQSPI=y CONFIG_USB=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y -CONFIG_USB_XHCI_ZYNQMP=y CONFIG_USB_DWC3=y CONFIG_USB_DWC3_GADGET=y CONFIG_USB_DWC3_GENERIC=y
configs/xilinx_zynqmp_zcu102_revB_defconfig +0 -1
@@ -100,7 +100,6 @@ CONFIG_ZYNQMP_GQSPI=y CONFIG_USB=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y -CONFIG_USB_XHCI_ZYNQMP=y CONFIG_USB_DWC3=y CONFIG_USB_DWC3_GADGET=y CONFIG_USB_DWC3_GENERIC=y
configs/xilinx_zynqmp_zcu104_revA_defconfig +0 -1
@@ -85,7 +85,6 @@ CONFIG_ZYNQMP_GQSPI=y CONFIG_USB=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y -CONFIG_USB_XHCI_ZYNQMP=y CONFIG_USB_DWC3=y CONFIG_USB_DWC3_GADGET=y CONFIG_USB_DWC3_GENERIC=y
configs/xilinx_zynqmp_zcu104_revC_defconfig +0 -1
@@ -86,7 +86,6 @@ CONFIG_ZYNQMP_GQSPI=y CONFIG_USB=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y -CONFIG_USB_XHCI_ZYNQMP=y CONFIG_USB_DWC3=y CONFIG_USB_DWC3_GADGET=y CONFIG_USB_DWC3_GENERIC=y
configs/xilinx_zynqmp_zcu106_revA_defconfig +0 -1
@@ -95,7 +95,6 @@ CONFIG_ZYNQMP_GQSPI=y CONFIG_USB=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y -CONFIG_USB_XHCI_ZYNQMP=y CONFIG_USB_DWC3=y CONFIG_USB_DWC3_GADGET=y CONFIG_USB_DWC3_GENERIC=y
configs/xilinx_zynqmp_zcu111_revA_defconfig +0 -1
@@ -87,7 +87,6 @@ CONFIG_ZYNQMP_GQSPI=y CONFIG_USB=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y -CONFIG_USB_XHCI_ZYNQMP=y CONFIG_USB_DWC3=y CONFIG_USB_DWC3_GADGET=y CONFIG_USB_DWC3_GENERIC=y
drivers/usb/host/Kconfig +0 -7
@@ -72,13 +72,6 @@ config USB_XHCI_STI STiH407 family SoCs. This is a driver for the dwc3 to provide the glue logic to configure the controller. -config USB_XHCI_ZYNQMP - bool "Support for Xilinx ZynqMP on-chip xHCI USB controller" - depends on ARCH_ZYNQMP - depends on DM_USB - help - Enables support for the on-chip xHCI controller on Xilinx ZynqMP SoCs. - config USB_XHCI_DRA7XX_INDEX int "DRA7XX xHCI USB index" range 0 1
drivers/usb/host/Makefile +0 -1
@@ -47,7 +47,6 @@ obj-$(CONFIG_USB_XHCI_HCD) += xhci.o xhci-mem.o xhci-ring.o obj-$(CONFIG_USB_XHCI_DWC3) += xhci-dwc3.o obj-$(CONFIG_USB_XHCI_DWC3_OF_SIMPLE) += dwc3-of-simple.o obj-$(CONFIG_USB_XHCI_ROCKCHIP) += xhci-rockchip.o -obj-$(CONFIG_USB_XHCI_ZYNQMP) += xhci-zynqmp.o obj-$(CONFIG_USB_XHCI_EXYNOS) += xhci-exynos5.o obj-$(CONFIG_USB_XHCI_FSL) += xhci-fsl.o obj-$(CONFIG_USB_XHCI_MVEBU) += xhci-mvebu.o
drivers/usb/host/xhci-zynqmp.c deleted +0 -146
146 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH v2 3/18 dm: Add a No-op uclass
In reply to Jean-Jacques HiblotThis uclass is intended for devices that do not need any features from the uclass, including binding children.
This will typically be used by devices that are used to bind child devices but do not use dm_scan_fdt_dev() to do it. That is for example the case of several USB wrappers that have 2 child devices (1 for device and 1 for host) but bind only one at a any given time.
---
Changes in v2:
Add a test for the NOP uclass
arch/sandbox/dts/test.dts | 12 +++++++ drivers/core/uclass.c | 5 +++ include/dm/uclass-id.h | 1 + test/dm/Makefile | 1 + test/dm/nop.c | 73 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 92 insertions(+) create mode 100644 test/dm/nop.c
arch/sandbox/dts/test.dts +12 -0
@@ -400,6 +400,18 @@ sandbox,silent; /* Don't emit sounds while testing */ }; + nop-test_0 { + compatible = "sandbox,nop_sandbox1"; + nop-test_1 { + compatible = "sandbox,nop_sandbox2"; + bind = "True"; + }; + nop-test_2 { + compatible = "sandbox,nop_sandbox2"; + bind = "False"; + }; + }; + misc-test { compatible = "sandbox,misc_sandbox"; };
drivers/core/uclass.c +5 -0
@@ -757,3 +757,8 @@ int uclass_pre_remove_device(struct udevice *dev) return 0; }#endif + +UCLASS_DRIVER (nop) = { + .id =UCLASS_NOP , + .name ="nop" , +};
include/dm/uclass-id.h +1 -0
@@ -62,6 +62,7 @@ enum uclass_id {UCLASS_MMC ,/* SD / MMC card or chip */ UCLASS_MOD_EXP ,/* RSA Mod Exp device */ UCLASS_MTD ,/* Memory Technology Device (MTD) device */ +UCLASS_NOP ,/* No-op devices */ UCLASS_NORTHBRIDGE ,/* Intel Northbridge / SDRAM controller */ UCLASS_NVME ,/* NVM Express device */ UCLASS_PANEL, /* Display panel, such as an LCD */
test/dm/Makefile +1 -0
@@ -3,6 +3,7 @@ # Copyright (c) 2013 Google, Inc obj-$(CONFIG_UT_DM) += bus.o +obj-$(CONFIG_UT_DM) += nop.o obj-$(CONFIG_UT_DM) += test-driver.o obj-$(CONFIG_UT_DM) += test-fdt.o obj-$(CONFIG_UT_DM) += test-main.o
test/dm/nop.c new file +73 -0
73 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH v2 3/18 dm: Add a No-op uclass
Quoted 15 lines · Jean-Jacques Hiblot
This uclass is intended for devices that do not need any features from the uclass, including binding children.
This will typically be used by devices that are used to bind child devices but do not usedm_scan_fdt_dev()to do it. That is for example the case of several USB wrappers that have 2 child devices (1 for device and 1 for host) but bind only one at a any given time.Signed-off-by Jean-Jacques Hiblot <[email protected]>---
Changes in v2:
Add a test for the NOP uclass
Quoted 7 lines
arch/sandbox/dts/test.dts | 12 +++++++ drivers/core/uclass.c | 5 +++ include/dm/uclass-id.h | 1 + test/dm/Makefile | 1 + test/dm/nop.c | 73 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 92 insertions(+) create mode 100644 test/dm/nop.c
PATCH v2 4/18 usb: dwc3: Use UCLASS_NOP instead of UCLASS_MISC for the DWC3 generic glue
In reply to Jean-Jacques Hiblotdwc3-generic has been broken since MISC uclass has been modified to scan DT sub-nodes after bind.
Fixing it by a using the no-op uclass.
---
Changes in v2: None
drivers/usb/dwc3/dwc3-generic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/dwc3/dwc3-generic.c +1 -1
@@ -350,7 +350,7 @@ static const struct udevice_id dwc3_glue_ids[] = {U_BOOT_DRIVER (dwc3_generic_wrapper) = { .name ="dwc3-generic-wrapper" , - .id =UCLASS_MISC , + .id =UCLASS_NOP , .of_match = dwc3_glue_ids, .bind = dwc3_glue_bind, .probe = dwc3_glue_probe,
Signature · 1 line
2.17.1
PATCH v2 4/18 usb: dwc3: Use UCLASS_NOP instead of UCLASS_MISC for the DWC3 generic glue
Quoted 5 lines · Jean-Jacques Hiblot
dwc3-generic has been broken since MISC uclass has been modified to scan DT sub-nodes after bind.
Fixing it by a using the no-op uclass.
Quoted 7 lines
Signed-off-by Jean-Jacques Hiblot <[email protected]>---
Changes in v2: None
drivers/usb/dwc3/dwc3-generic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
PATCH v2 5/18 usb: dwc3: switch to peripheral mode when exiting
In reply to Jean-Jacques HiblotThis allow the phy to enter idle and then suspend.
the K2 platforms require the PHY to be suspended before the USB domain clock can be turned off.
---
Changes in v2: None
drivers/usb/dwc3/core.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
drivers/usb/dwc3/core.c +13 -0
@@ -581,6 +581,12 @@ static int dwc3_core_init_mode(struct dwc3 *dwc)return 0 ; } +static void dwc3_gadget_run (struct dwc3 *dwc) +{ +dwc3_writel (dwc->regs,DWC3_DCTL ,DWC3_DCTL_RUN_STOP ); +mdelay (100 ); +} +static void dwc3_core_exit_mode (struct dwc3 *dwc) {switch (dwc->dr_mode) {
@@ -598,6 +604,13 @@ static void dwc3_core_exit_mode(struct dwc3 *dwc)/* do nothing */ break ; } + +/* +* switch back to peripheral mode +* This enables the phy to enter idle and then, if enabled, suspend. +*/ +dwc3_set_mode (dwc,DWC3_GCTL_PRTCAP_DEVICE ); +dwc3_gadget_run (dwc); }#define DWC3_ALIGN_MASK (16 - 1)
Signature · 1 line
2.17.1
PATCH v2 6/18 usb: xhci: move xhci.h to include usb
In reply to Jean-Jacques HiblotThe xhci.h header file is currently located under drivers/usb/xhci Move it to the include/usb folder to make it available to drivers that are not under drivers/usb/xhci
---
Changes in v2: None
MAINTAINERS | 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.c | 2 +-
drivers/usb/phy/omap_usb_phy.c | 2 +-
{drivers/usb/host => include/usb}/xhci.h | 0
14 files changed, 13 insertions(+), 12 deletions(-)
rename {drivers/usb/host => include/usb}/xhci.h (100%)MAINTAINERS +1 -0
@@ -781,6 +781,7 @@ M: Bin Meng <[email protected]> S: Maintained T: git git://git.denx.de/u-boot-usb.git topic-xhci F: drivers/usb/host/xhci* +F: include/usb/xhci.h VIDEO M: Anatolij Gustschin <[email protected]>
drivers/usb/host/xhci-dwc3.c +1 -1
@@ -14,7 +14,7 @@#include <usb.h> #include <dwc3-uboot.h> -#include "xhci.h" +#include <usb/xhci.h> #include <asm/io.h> #include <linux/usb/dwc3.h> #include <linux/usb/otg.h>
drivers/usb/host/xhci-exynos5.c +1 -1
@@ -27,7 +27,7 @@#include <linux/compat.h> #include <linux/usb/dwc3.h> -#include "xhci.h" +#include <usb/xhci.h> /* Declare global data pointer */ DECLARE_GLOBAL_DATA_PTR ;
drivers/usb/host/xhci-fsl.c +1 -1
@@ -13,7 +13,7 @@#include <linux/compat.h> #include <linux/usb/xhci-fsl.h> #include <linux/usb/dwc3.h> -#include "xhci.h" +#include <usb/xhci.h> #include <fsl_errata.h> #include <fsl_usb.h> #include <dm.h>
drivers/usb/host/xhci-mem.c +1 -1
@@ -21,7 +21,7 @@#include <asm/cache.h> #include <linux/errno.h> -#include "xhci.h" +#include <usb/xhci.h> #define CACHELINE_SIZE CONFIG_SYS_CACHELINE_SIZE/**
drivers/usb/host/xhci-mvebu.c +1 -1
@@ -12,7 +12,7 @@#include <power/regulator.h> #include <asm/gpio.h> -#include "xhci.h" +#include <usb/xhci.h> struct mvebu_xhci_platdata {fdt_addr_t hcd_base;
drivers/usb/host/xhci-omap.c +1 -1
@@ -19,7 +19,7 @@#include <linux/usb/dwc3.h> #include <linux/usb/xhci-omap.h> -#include "xhci.h" +#include <usb/xhci.h> /* Declare global data pointer */ static struct omap_xhci omap;
drivers/usb/host/xhci-pci.c +1 -1
@@ -9,7 +9,7 @@#include <dm.h> #include <pci.h> #include <usb.h> -#include "xhci.h" +#include <usb/xhci.h> static void xhci_pci_init (struct udevice *dev,struct xhci_hccr **ret_hccr,struct xhci_hcor **ret_hcor)
drivers/usb/host/xhci-rcar.c +1 -1
@@ -12,7 +12,7 @@#include <usb.h> #include <wait_bit.h> -#include "xhci.h" +#include <usb/xhci.h> #include "xhci-rcar-r8a779x_usb3_v3.h" /* Register Offset */
drivers/usb/host/xhci-ring.c +1 -1
@@ -19,7 +19,7 @@#include <asm/unaligned.h> #include <linux/errno.h> -#include "xhci.h" +#include <usb/xhci.h> /** * Is this TRB a link TRB or was the last TRB the last TRB in this event ring
drivers/usb/host/xhci-rockchip.c +1 -1
@@ -13,7 +13,7 @@#include <linux/usb/dwc3.h> #include <power/regulator.h> -#include "xhci.h" +#include <usb/xhci.h> struct rockchip_xhci_platdata {fdt_addr_t hcd_base;
drivers/usb/host/xhci.c +1 -1
@@ -28,7 +28,7 @@#include <asm/cache.h> #include <asm/unaligned.h> #include <linux/errno.h> -#include "xhci.h" +#include <usb/xhci.h> #ifndef CONFIG_USB_MAX_CONTROLLER_COUNT #define CONFIG_USB_MAX_CONTROLLER_COUNT 1
drivers/usb/phy/omap_usb_phy.c +1 -1
@@ -19,7 +19,7 @@#include <linux/usb/dwc3.h> #include <linux/usb/xhci-omap.h> -#include "../host/xhci.h" +#include <usb/xhci.h> #ifdef CONFIG_OMAP_USB3PHY1_HOST struct usb3_dpll_params {
include/usb/xhci.h renamed from drivers/usb/host/xhci.h +0 -0
Signature · 1 line
2.17.1
PATCH v2 7/18 usb: dwc3: always use the inlined version of dwc3_host_init/dwc3_host_exit
In reply to Jean-Jacques HiblotNo one is actually implementing those functions.
We could remove calls to these altogether, but it does not really hurt to keep the empty inlined version at the moment and it satisfies a symmetry with the gadget mode.
---
Changes in v2: None
drivers/usb/dwc3/core.h | 5 ----- 1 file changed, 5 deletions(-)
drivers/usb/dwc3/core.h +0 -5
@@ -994,15 +994,10 @@ int dwc3_gadget_resize_tx_fifos(struct dwc3 *dwc);int dwc3_init (struct dwc3 *dwc);void dwc3_remove (struct dwc3 *dwc); -#ifdef CONFIG_USB_DWC3_HOST -int dwc3_host_init (struct dwc3 *dwc); -void dwc3_host_exit (struct dwc3 *dwc); -#else static inline int dwc3_host_init (struct dwc3 *dwc) {return 0 ; }static inline void dwc3_host_exit (struct dwc3 *dwc) { } -#endif #ifdef CONFIG_USB_DWC3_GADGET int dwc3_gadget_init (struct dwc3 *dwc);
Signature · 1 line
2.17.1
PATCH v2 8/18 usb: dwc3-generic: use platdata
In reply to Jean-Jacques HiblotSeparate platform data from the private data.
This is one step toward adding host support.
---
Changes in v2: None
drivers/usb/dwc3/dwc3-generic.c | 37 ++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 14 deletions(-)
drivers/usb/dwc3/dwc3-generic.c +23 -14
@@ -22,17 +22,22 @@#include <reset.h> #include <clk.h> +struct dwc3_generic_plat { +fdt_addr_t base; +u32 maximum_speed; +enum usb_dr_mode dr_mode; +}; +#if CONFIG_IS_ENABLED (DM_USB_GADGET ) -struct dwc3_generic_peripheral { +struct dwc3_generic_priv {struct dwc3 dwc3;struct phy *phys;int num_phys; -fdt_addr_t base; };int dm_usb_gadget_handle_interrupts (struct udevice *dev) { -struct dwc3_generic_peripheral *priv =dev_get_priv (dev); +struct dwc3_generic_priv *priv =dev_get_priv (dev);struct dwc3 *dwc3 = &priv->dwc3;dwc3_gadget_uboot_handle_interrupt (dwc3);
@@ -43,14 +48,18 @@ int dm_usb_gadget_handle_interrupts(struct udevice *dev)static int dwc3_generic_peripheral_probe (struct udevice *dev) {int rc; -struct dwc3_generic_peripheral *priv =dev_get_priv (dev); +struct dwc3_generic_priv *priv =dev_get_priv (dev); +struct dwc3_generic_plat *plat =dev_get_platdata (dev);struct dwc3 *dwc3 = &priv->dwc3; + dwc3->maximum_speed = plat->maximum_speed; + dwc3->dr_mode = plat->dr_mode; + rc =dwc3_setup_phy (dev, &priv->phys, &priv->num_phys);if (rc)return rc; - dwc3->regs =map_physmem (priv->base,DWC3_OTG_REGS_END ,MAP_NOCACHE ); + dwc3->regs =map_physmem (plat->base,DWC3_OTG_REGS_END ,MAP_NOCACHE ); dwc3->regs +=DWC3_GLOBALS_REGS_START ; dwc3->dev = dev;
@@ -65,7 +74,7 @@ static int dwc3_generic_peripheral_probe(struct udevice *dev)static int dwc3_generic_peripheral_remove (struct udevice *dev) { -struct dwc3_generic_peripheral *priv =dev_get_priv (dev); +struct dwc3_generic_priv *priv =dev_get_priv (dev);struct dwc3 *dwc3 = &priv->dwc3;dwc3_remove (dwc3);
@@ -77,20 +86,19 @@ static int dwc3_generic_peripheral_remove(struct udevice *dev)static int dwc3_generic_peripheral_ofdata_to_platdata (struct udevice *dev) { -struct dwc3_generic_peripheral *priv =dev_get_priv (dev); -struct dwc3 *dwc3 = &priv->dwc3; +struct dwc3_generic_plat *plat =dev_get_platdata (dev);int node =dev_of_offset (dev); - priv->base =devfdt_get_addr (dev); + plat->base =devfdt_get_addr (dev); - dwc3->maximum_speed =usb_get_maximum_speed (node); -if (dwc3->maximum_speed ==USB_SPEED_UNKNOWN ) { + plat->maximum_speed =usb_get_maximum_speed (node); +if (plat->maximum_speed ==USB_SPEED_UNKNOWN ) {pr_err ("Invalid usb maximum speed\n" );return -ENODEV ; } - dwc3->dr_mode =usb_get_dr_mode (node); -if (dwc3->dr_mode ==USB_DR_MODE_UNKNOWN ) { + plat->dr_mode =usb_get_dr_mode (node); +if (plat->dr_mode ==USB_DR_MODE_UNKNOWN ) {pr_err ("Invalid usb mode setup\n" );return -ENODEV ; }
@@ -104,7 +112,8 @@ U_BOOT_DRIVER(dwc3_generic_peripheral) = { .ofdata_to_platdata = dwc3_generic_peripheral_ofdata_to_platdata, .probe = dwc3_generic_peripheral_probe, .remove = dwc3_generic_peripheral_remove, - .priv_auto_alloc_size = sizeof(struct dwc3_generic_peripheral), + .priv_auto_alloc_size = sizeof(struct dwc3_generic_priv), + .platdata_auto_alloc_size = sizeof(struct dwc3_generic_plat), };#endif
Signature · 1 line
2.17.1
PATCH v2 9/18 usb: dwc3-generic: factorize code
In reply to Jean-Jacques HiblotFactor code for re-usability.
This is another step toward adding host support.
---
Changes in v2: None
drivers/usb/dwc3/dwc3-generic.c | 55 +++++++++++++++++++++------------ 1 file changed, 35 insertions(+), 20 deletions(-)
drivers/usb/dwc3/dwc3-generic.c +35 -20
@@ -28,27 +28,17 @@ struct dwc3_generic_plat {enum usb_dr_mode dr_mode; }; -#if CONFIG_IS_ENABLED (DM_USB_GADGET )struct dwc3_generic_priv { +void *base;struct dwc3 dwc3;struct phy *phys;int num_phys; }; -int dm_usb_gadget_handle_interrupts (struct udevice *dev) -{ -struct dwc3_generic_priv *priv =dev_get_priv (dev); -struct dwc3 *dwc3 = &priv->dwc3; - -dwc3_gadget_uboot_handle_interrupt (dwc3); - -return 0 ; -} - -static int dwc3_generic_peripheral_probe (struct udevice *dev) +static int dwc3_generic_probe (struct udevice *dev, +struct dwc3_generic_priv *priv) {int rc; -struct dwc3_generic_priv *priv =dev_get_priv (dev);struct dwc3_generic_plat *plat =dev_get_platdata (dev);struct dwc3 *dwc3 = &priv->dwc3;
@@ -59,22 +49,22 @@ static int dwc3_generic_peripheral_probe(struct udevice *dev)if (rc)return rc; - dwc3->regs =map_physmem (plat->base,DWC3_OTG_REGS_END ,MAP_NOCACHE ); - dwc3->regs +=DWC3_GLOBALS_REGS_START ; + priv->base =map_physmem (plat->base,DWC3_OTG_REGS_END ,MAP_NOCACHE ); + dwc3->regs = priv->base +DWC3_GLOBALS_REGS_START ; dwc3->dev = dev; rc =dwc3_init (dwc3);if (rc) { -unmap_physmem (dwc3->regs,MAP_NOCACHE ); +unmap_physmem (priv->base,MAP_NOCACHE );return rc; }return 0 ; } -static int dwc3_generic_peripheral_remove (struct udevice *dev) +static int dwc3_generic_remove (struct udevice *dev, +struct dwc3_generic_priv *priv) { -struct dwc3_generic_priv *priv =dev_get_priv (dev);struct dwc3 *dwc3 = &priv->dwc3;dwc3_remove (dwc3);
@@ -84,7 +74,7 @@ static int dwc3_generic_peripheral_remove(struct udevice *dev)return 0 ; } -static int dwc3_generic_peripheral_ofdata_to_platdata (struct udevice *dev) +static int dwc3_generic_ofdata_to_platdata (struct udevice *dev) {struct dwc3_generic_plat *plat =dev_get_platdata (dev);int node =dev_of_offset (dev);
@@ -106,10 +96,35 @@ static int dwc3_generic_peripheral_ofdata_to_platdata(struct udevice *dev)return 0 ; } +#if CONFIG_IS_ENABLED (DM_USB_GADGET ) +int dm_usb_gadget_handle_interrupts (struct udevice *dev) +{ +struct dwc3_generic_priv *priv =dev_get_priv (dev); +struct dwc3 *dwc3 = &priv->dwc3; + +dwc3_gadget_uboot_handle_interrupt (dwc3); + +return 0 ; +} + +static int dwc3_generic_peripheral_probe (struct udevice *dev) +{ +struct dwc3_generic_priv *priv =dev_get_priv (dev); + +return dwc3_generic_probe (dev, priv); +} + +static int dwc3_generic_peripheral_remove (struct udevice *dev) +{ +struct dwc3_generic_priv *priv =dev_get_priv (dev); + +return dwc3_generic_remove (dev, priv); +} +U_BOOT_DRIVER (dwc3_generic_peripheral) = { .name ="dwc3-generic-peripheral" , .id =UCLASS_USB_GADGET_GENERIC , - .ofdata_to_platdata = dwc3_generic_peripheral_ofdata_to_platdata, + .ofdata_to_platdata = dwc3_generic_ofdata_to_platdata, .probe = dwc3_generic_peripheral_probe, .remove = dwc3_generic_peripheral_remove, .priv_auto_alloc_size = sizeof(struct dwc3_generic_priv),
Signature · 1 line
2.17.1
PATCH v2 10/18 usb: dwc3-generic: add a new host driver that uses the dwc3 core
In reply to Jean-Jacques HiblotCurrently the host driver used by dwc3-generic is "xhci-dwc3". This is a functional driver but it doesn't use the dwc3 core and, in particular, it lacks some bits that may be important.
For example on the k2 platforms, it is important that the phy are properly suspended when the USB is not used anymore. The dwc3 core also has a partial support for quirks.
The new driver can be used as a drop-in replacement for "xhci-dwc3".
In terms of implementation, it may seem strange that 2 private structures dwc3_generic_host_priv and dwc3_generic_priv) are used. The reason for this is simply that the xhci layer expects a struct xhci_ctrl at the beginning of the private data and it seemed wasteful to include it also for the peripheral case.
---
Changes in v2: None
drivers/usb/dwc3/core.c | 2 +- drivers/usb/dwc3/dwc3-generic.c | 54 ++++++++++++++++++++++++++++++++- 2 files changed, 54 insertions(+), 2 deletions(-)
drivers/usb/dwc3/core.c +1 -1
@@ -887,7 +887,7 @@ int dwc3_shutdown_phy(struct udevice *dev, struct phy *usb_phys, int num_phys) }#endif -#if CONFIG_IS_ENABLED (DM_USB_GADGET ) +#if CONFIG_IS_ENABLED (DM_USB )int dwc3_init (struct dwc3 *dwc) {int ret;
drivers/usb/dwc3/dwc3-generic.c +53 -1
81 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH v2 11/18 usb: dwc3-generic: if no max speed is specified in DT, assume super speed
In reply to Jean-Jacques HiblotThere is no need to fail if the maximum speed is not specified. If the speed is not specified, do the same as linux and assume super speed.
---
Changes in v2: None
drivers/usb/dwc3/dwc3-generic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/dwc3/dwc3-generic.c +2 -2
@@ -89,8 +89,8 @@ static int dwc3_generic_ofdata_to_platdata(struct udevice *dev) plat->maximum_speed =usb_get_maximum_speed (node);if (plat->maximum_speed ==USB_SPEED_UNKNOWN ) { -pr_err ("Invalid usb maximum speed\n" ); -return -ENODEV ; +pr_info ("no usb maximum speed specified. use super speed\n" ); + plat->maximum_speed =USB_SPEED_SUPER ; } plat->dr_mode =usb_get_dr_mode (node);
Signature · 1 line
2.17.1
PATCH v2 11/18 usb: dwc3-generic: if no max speed is specified in DT, assume super speed
Quoted 16 lines · Jean-Jacques Hiblot
There is no need to fail if the maximum speed is not specified. If the speed is not specified, do the same as linux and assume super speed.
Signed-off-by Jean-Jacques Hiblot <[email protected]>---
Changes in v2: None
drivers/usb/dwc3/dwc3-generic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/usb/dwc3/dwc3-generic.c +0
-0
drivers/usb/dwc3/dwc3-generic.c static int dwc3_generic_ofdata_to_platdata(struct udevice *dev) · line 92
Quoted 6 lines
drivers/usb/dwc3/dwc3-generic.c +1
-2@@ -89,8 +89,8 @@ static int dwc3_generic_ofdata_to_platdata(struct udevice *dev) plat->maximum_speed =usb_get_maximum_speed (node);if (plat->maximum_speed ==USB_SPEED_UNKNOWN ) { -pr_err ("Invalid usb maximum speed\n" ); -return -ENODEV ; +pr_info ("no usb maximum speed specified. use super speed\n" );
Nit: s/no usb/No USB/;s/use/Using/
Quoted 5 lines
drivers/usb/dwc3/dwc3-generic.c +1
-0+ plat->maximum_speed =USB_SPEED_SUPER ; } plat->dr_mode =usb_get_dr_mode (node);
Signature · 2 lines
Best regards, Marek Vasut
PATCH v2 12/18 usb: dwc3: Add dwc3_of_parse() to get quirks information from DT
In reply to Jean-Jacques HiblotAdd a new function that read quirk and configuration information from the DT. The goal is to allow platforms using their own version of DWC3 driver to migrate to the generic DWC3 driver.
The function is adapted from the function dwc3_get_properties() in the linux dwc3 driver introduced in commit c5ac6116db35d.
---
Changes in v2:
- Update commit log
drivers/usb/dwc3/core.c | 65 +++++++++++++++++++++++++++++++++ drivers/usb/dwc3/core.h | 1 + drivers/usb/dwc3/dwc3-generic.c | 6 ++- 3 files changed, 71 insertions(+), 1 deletion(-)
drivers/usb/dwc3/core.c +65 -0
@@ -888,6 +888,71 @@ int dwc3_shutdown_phy(struct udevice *dev, struct phy *usb_phys, int num_phys)#endif #if CONFIG_IS_ENABLED (DM_USB ) +void dwc3_of_parse (struct dwc3 *dwc) +{ +const u8 *tmp; +struct udevice *dev = dwc->dev; +u8 lpm_nyet_threshold; +u8 tx_de_emphasis; +u8 hird_threshold; + +/* default to highest possible threshold */ + lpm_nyet_threshold =0xff ; + +/* default to -3.5dB de-emphasis */ + tx_de_emphasis =1 ; + +/* +* default to assert utmi_sleep_n and use maximum allowed HIRD +* threshold value of 0b1100 +*/ + hird_threshold =12 ; + + dwc->has_lpm_erratum =dev_read_bool (dev, +"snps,has-lpm-erratum" ); + tmp =dev_read_u8_array_ptr (dev,"snps,lpm-nyet-threshold" ,1 ); +if (tmp) + lpm_nyet_threshold = *tmp; + + dwc->is_utmi_l1_suspend =dev_read_bool (dev, +"snps,is-utmi-l1-suspend" ); + tmp =dev_read_u8_array_ptr (dev,"snps,hird-threshold" ,1 ); +if (tmp) + hird_threshold = *tmp; + + dwc->disable_scramble_quirk =dev_read_bool (dev, +"snps,disable_scramble_quirk" ); + dwc->u2exit_lfps_quirk =dev_read_bool (dev, +"snps,u2exit_lfps_quirk" ); + dwc->u2ss_inp3_quirk =dev_read_bool (dev, +"snps,u2ss_inp3_quirk" ); + dwc->req_p1p2p3_quirk =dev_read_bool (dev, +"snps,req_p1p2p3_quirk" ); + dwc->del_p1p2p3_quirk =dev_read_bool (dev, +"snps,del_p1p2p3_quirk" ); + dwc->del_phy_power_chg_quirk =dev_read_bool (dev, +"snps,del_phy_power_chg_quirk" ); + dwc->lfps_filter_quirk =dev_read_bool (dev, +"snps,lfps_filter_quirk" ); + dwc->rx_detect_poll_quirk =dev_read_bool (dev, +"snps,rx_detect_poll_quirk" ); + dwc->dis_u3_susphy_quirk =dev_read_bool (dev, +"snps,dis_u3_susphy_quirk" ); + dwc->dis_u2_susphy_quirk =dev_read_bool (dev, +"snps,dis_u2_susphy_quirk" ); + dwc->tx_de_emphasis_quirk =dev_read_bool (dev, +"snps,tx_de_emphasis_quirk" ); + tmp =dev_read_u8_array_ptr (dev,"snps,tx_de_emphasis" ,1 ); +if (tmp) + tx_de_emphasis = *tmp; + + dwc->lpm_nyet_threshold = lpm_nyet_threshold; + dwc->tx_de_emphasis = tx_de_emphasis; + + dwc->hird_threshold = hird_threshold + | (dwc->is_utmi_l1_suspend <<4 ); +} +int dwc3_init (struct dwc3 *dwc) {int ret;
drivers/usb/dwc3/core.h +1 -0
@@ -991,6 +991,7 @@ struct dwc3_gadget_ep_cmd_params {/* prototypes */ int dwc3_gadget_resize_tx_fifos (struct dwc3 *dwc); +void dwc3_of_parse (struct dwc3 *dwc);int dwc3_init (struct dwc3 *dwc);void dwc3_remove (struct dwc3 *dwc);
drivers/usb/dwc3/dwc3-generic.c +5 -1
@@ -48,8 +48,12 @@ static int dwc3_generic_probe(struct udevice *dev,struct dwc3_generic_plat *plat =dev_get_platdata (dev);struct dwc3 *dwc3 = &priv->dwc3; + dwc3->dev = dev; dwc3->maximum_speed = plat->maximum_speed; dwc3->dr_mode = plat->dr_mode; +#if CONFIG_IS_ENABLED (OF_CONTROL ) +dwc3_of_parse (dwc3); +#endif rc =dwc3_setup_phy (dev, &priv->phys, &priv->num_phys);if (rc)
@@ -57,7 +61,7 @@ static int dwc3_generic_probe(struct udevice *dev, priv->base =map_physmem (plat->base,DWC3_OTG_REGS_END ,MAP_NOCACHE ); dwc3->regs = priv->base +DWC3_GLOBALS_REGS_START ; - dwc3->dev = dev; + rc =dwc3_init (dwc3);if (rc) {
Signature · 1 line
2.17.1
PATCH v2 13/18 usb: dwc3: Kconfig: get rid of obsolete mode selection
In reply to Jean-Jacques HiblotThe mode selection for the DWC3 is kind of obsolete. The driver does not have to be host only or gadget only. This choice is confusing. All the remaining callers of dwc3_uboot_init() explicitly set dr_mode before calling the function, so none rely on a default behavior.
Remove the choice menu and keep only the USB_DWC3_GADGET option. Enable it by default if USB_GADGET and USB_DWC3 are enabled.
It must be disabled for the evb-rk3328 as it uses DWC2 for the gadget and DWC3 for the host.
---
Changes in v2:
Select USB_GADGET_DUALSPEED if USB_DWC3_GADGET is selected
configs/evb-rk3328_defconfig | 1 + drivers/usb/dwc3/Kconfig | 18 ++---------------- drivers/usb/dwc3/core.c | 4 ++-- 3 files changed, 5 insertions(+), 18 deletions(-)
configs/evb-rk3328_defconfig +1 -0
@@ -58,6 +58,7 @@ CONFIG_USB_OHCI_HCD=y CONFIG_USB_OHCI_GENERIC=y CONFIG_USB_DWC2=y CONFIG_USB_DWC3=y +# CONFIG_USB_DWC3_GADGET is not set CONFIG_USB_GADGET=y CONFIG_USB_GADGET_MANUFACTURER="Rockchip" CONFIG_USB_GADGET_VENDOR_NUM=0x2207
drivers/usb/dwc3/Kconfig +2 -16
@@ -7,25 +7,11 @@ config USB_DWC3 if USB_DWC3 -choice - bool "DWC3 Mode Selection" - -config USB_DWC3_HOST - bool "Host only mode" - depends on USB - help - Select this when you want to use DWC3 in host mode only, - thereby the gadget feature will be regressed. - config USB_DWC3_GADGET - bool "Gadget only mode" + bool "USB Gadget support for DWC3" + default y depends on USB_GADGET select USB_GADGET_DUALSPEED - help - Select this when you want to use DWC3 in gadget mode only, - thereby the host feature will be regressed. - -endchoice comment "Platform Glue Driver Support"
drivers/usb/dwc3/core.c +2 -2
@@ -707,9 +707,9 @@ int dwc3_uboot_init(struct dwc3_device *dwc3_dev)return -ENOMEM ; } -if (IS_ENABLED (CONFIG_USB_DWC3_HOST )) +if (!IS_ENABLED (USB_DWC3_GADGET )) dwc->dr_mode =USB_DR_MODE_HOST ; -else if (IS_ENABLED (CONFIG_USB_DWC3_GADGET )) +else if (!IS_ENABLED (CONFIG_USB_HOST )) dwc->dr_mode =USB_DR_MODE_PERIPHERAL ;if (dwc->dr_mode ==USB_DR_MODE_UNKNOWN )
Signature · 1 line
2.17.1
PATCH v2 14/18 ARM: keystone: increase PSC timeout
In reply to Jean-Jacques HiblotTurning off the USB clocks may take longer than 100us. Increase the timeout to 100ms.
---
Changes in v2: None
arch/arm/mach-keystone/include/mach/psc_defs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-keystone/include/mach/psc_defs.h +1 -1
@@ -94,7 +94,7 @@ static inline u32 boot_set_bitfield(u32 z, u32 f, u32 x, u32 y)* Timeout limit on checking PTSTAT. This is the number of times the * wait function will be called before giving up. */ -#define PSC_PTSTAT_TIMEOUT_LIMIT 100 +#define PSC_PTSTAT_TIMEOUT_LIMIT 100000u32 psc_get_domain_num (u32 mod_num);int psc_enable_module (u32 mod_num);
Signature · 1 line
2.17.1
PATCH v2 15/18 ARM: keystone: Do not enable the USB power domains at the board level
In reply to Jean-Jacques HiblotThis breaks linux boot sequence.
Observed on k2e and k2l platforms.
---
Changes in v2: None
board/ti/ks2_evm/board.c | 13 ------------- 1 file changed, 13 deletions(-)
board/ti/ks2_evm/board.c +0 -13
@@ -66,20 +66,7 @@ struct image_header *spl_get_load_buffer(ssize_t offset, size_t size)int board_init (void ) { -#if CONFIG_IS_ENABLED (DM_USB ) -int rc =psc_enable_module (KS2_LPSC_USB ); - -if (rc) -puts ("Cannot enable USB0 module" ); -#ifdef KS2_LPSC_USB_1 - rc =psc_enable_module (KS2_LPSC_USB_1 ); -if (rc) -puts ("Cannot enable USB1 module" ); -#endif -#endif - gd->bd->bi_boot_params =CONFIG_SYS_SDRAM_BASE +0x100 ; -return 0 ; }
Signature · 1 line
2.17.1
PATCH v2 16/18 phy: keystone-usb: handle the transition of the USB power domain
In reply to Jean-Jacques HiblotThere is no proper power domain support for the keystone platforms. However we need to turn off the USB domains before jumping to linux or it fail to boot (observed with k2e and k2l platforms).
This can be done in the PHY driver as it is dedicated only to the keystone platforms and matches the required on/off sequence.
---
Changes in v2: None
drivers/phy/keystone-usb-phy.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
drivers/phy/keystone-usb-phy.c +22 -0
@@ -9,6 +9,7 @@#include <dm/device.h> #include <generic-phy.h> #include <asm/io.h> +#include <asm/arch/psc_defs.h> /* USB PHY control register offsets */ #define USB_PHY_CTL_UTMI 0x0000
@@ -22,15 +23,25 @@#define PHY_REF_SSP_EN BIT(29)struct keystone_usb_phy { +u32 psc_domain;void __iomem *reg; };static int keystone_usb_init (struct phy *phy) {u32 val; +int rc;struct udevice *dev = phy->dev;struct keystone_usb_phy *keystone =dev_get_priv (dev); +/* Release USB from reset */ + rc =psc_enable_module (keystone->psc_domain); +if (rc) { +debug ("Cannot enable USB module" ); +return -rc; + } +mdelay (10 ); +/* * VBUSVLDEXTSEL has a default value of 1 in BootCfg but shouldn't. * It should always be cleared because our USB PHY has an onchip VBUS
@@ -72,13 +83,24 @@ static int keystone_usb_power_off(struct phy *phy)static int keystone_usb_exit (struct phy *phy) { +struct udevice *dev = phy->dev; +struct keystone_usb_phy *keystone =dev_get_priv (dev); + +if (psc_disable_module (keystone->psc_domain)) +debug ("failed to disable USB module!\n" ); +return 0 ; }static int keystone_usb_phy_probe (struct udevice *dev) { +int rc;struct keystone_usb_phy *keystone =dev_get_priv (dev); + rc =dev_read_u32 (dev,"psc-domain" , &keystone->psc_domain); +if (rc) +return rc; + keystone->reg =dev_remap_addr_index (dev,0 );if (!keystone->reg) {pr_err ("unable to remap usb phy\n" );
Signature · 1 line
2.17.1
PATCH v2 17/18 configs: k2g_evm_defconfig: disable XHCI_DWC3 and enable KEYSTONE_USB_PHY
In reply to Jean-Jacques HiblotKEYSTONE_USB_PHY is now required for proper USB operations. XHCI_DWC3 can be disabled as the xhci-dwc3 is not used anymore USB_DWC3_GADGET can also be removed, it is now selected automatically.
---
Changes in v2: None
configs/k2g_evm_defconfig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
configs/k2g_evm_defconfig +1 -2
@@ -57,6 +57,7 @@ CONFIG_MII=y CONFIG_DRIVER_TI_KEYSTONE_NET=y CONFIG_PHY=y CONFIG_NOP_PHY=y +CONFIG_KEYSTONE_USB_PHY=y CONFIG_REMOTEPROC_TI_POWER=y CONFIG_DM_SERIAL=y CONFIG_SYS_NS16550=y
@@ -67,9 +68,7 @@ CONFIG_USB=y CONFIG_DM_USB=y CONFIG_DM_USB_GADGET=y CONFIG_USB_XHCI_HCD=y -CONFIG_USB_XHCI_DWC3=y CONFIG_USB_DWC3=y -CONFIG_USB_DWC3_GADGET=y CONFIG_USB_DWC3_GENERIC=y CONFIG_USB_GADGET=y CONFIG_USB_GADGET_DOWNLOAD=y
Signature · 1 line
2.17.1
PATCH v2 18/18 ARM: DTS: keystone: complete the description of the USB PHY devices
In reply to Jean-Jacques HiblotAs the PHY driver now handles the transitions of USB power domain, we must add this information in the node of each PHY.
Also, the phy are expected in the "phys" property, not "usb-phys". Also add the aliases for the USB ports on boards with more than a single port.
---
Changes in v2: None
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 ++++++++++++ 4 files changed, 92 insertions(+) create mode 100644 arch/arm/dts/keystone-k2l-evm-u-boot.dtsi
arch/arm/dts/keystone-k2e-evm-u-boot.dtsi +32 -0
@@ -7,8 +7,40 @@ soc { u-boot,dm-pre-reloc; }; + aliases { + usb0 = &usb; + usb1 = &usb1; + }; }; &i2c1 { u-boot,dm-pre-reloc; }; + +&usb_phy { + #phy-cells = <0>; + psc-domain = <2>; +}; + +&usb { + dwc3 at 2690000 { + phys = <&usb_phy>; + dr_mode = "host"; + snps,u2ss_inp3_quirk; + status = "okay"; + }; +}; + +&usb1_phy { + #phy-cells = <0>; + psc-domain = <1>; +}; + +&usb1 { + dwc3 at 25010000 { + phys = <&usb1_phy>; + dr_mode = "peripheral"; + snps,u2ss_inp3_quirk; + status = "okay"; + }; +};
arch/arm/dts/keystone-k2g-evm-u-boot.dtsi +28 -0
@@ -7,6 +7,10 @@ soc { u-boot,dm-pre-reloc; }; + aliases { + usb0 = &usb0; + usb1 = &usb1; + }; }; &i2c0 {
@@ -16,3 +20,27 @@ &i2c1 { u-boot,dm-pre-reloc; }; + +&usb0_phy { + compatible = "ti,keystone-usbphy"; + #phy-cells = <0>; + reg = <0x2620738 24>; + psc-domain = <25>; +}; + +&usb0 { + phys = <&usb0_phy>; + snps,u2ss_inp3_quirk; +}; + +&usb1_phy { + compatible = "ti,keystone-usbphy"; + #phy-cells = <0>; + reg = <0x2620750 24>; + psc-domain = <26>; +}; + +&usb1 { + phys = <&usb1_phy>; + snps,u2ss_inp3_quirk; +};
arch/arm/dts/keystone-k2hk-evm-u-boot.dtsi +14 -0
@@ -12,3 +12,17 @@ &i2c1 { u-boot,dm-pre-reloc; }; + +&usb_phy { + #phy-cells = <0>; + psc-domain = <2>; +}; + +&usb { + dwc3 at 2690000 { + phys = <&usb_phy>; + dr_mode = "host"; + snps,u2ss_inp3_quirk; + status = "okay"; + }; +};
arch/arm/dts/keystone-k2l-evm-u-boot.dtsi new file +18 -0
@@ -0,0 +1,18 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2019 Texas Instruments Incorporated - http://www.ti.com/ + */ + +&usb_phy { + #phy-cells = <0>; + psc-domain = <2>; +}; + +&usb { + dwc3 at 2690000 { + phys = <&usb_phy>; + dr_mode = "host"; + snps,u2ss_inp3_quirk; + status = "okay"; + }; +};
Signature · 1 line
2.17.1
v2 cover Improvement for the DWC3 USB generic driver and fixes for the K2 platforms
In reply to Jean-Jacques HiblotHi,
Tested the series with one out of tree patch(https://marc.info/?l=u-boot&m=155409909828219 ) on Xilinx ZynqMP and it looks fine. We may need to finalize on https://marc.info/?l=u-boot&m=155409909828219 as well.
U-Boot 2019.04-rc4-00065-g5063fa3-dirty (May 21 2019 - 16:58:34 +0530)
Model: ZynqMP ZCU102 Rev1.0 Board: Xilinx ZynqMP DRAM: 4 GiB EL Level: EL2 Chip ID: zu9eg MMC: mmc at ff170000: 0
Loading Environment from FAT... *** Warning - bad CRC, using default environment
In: serial at ff000000 Out: serial at ff000000 Err: serial at ff000000 Bootmode: JTAG_MODE Reset reason: EXTERNAL Net: ZYNQ GEM: ff0e0000, phyaddr c, interface rgmii-id
Warning: ethernet at ff0e0000 (eth0) using random MAC address - 32:98:cb:f1:92:33
eth0: ethernet at ff0e0000
Hit any key to stop autoboot: 0
ZynqMP> usb start
starting USB...
USB0: Register 2000440 NbrPorts 2
Starting the controller
USB XHCI 1.00
scanning bus 0 for devices... 2 USB Device(s) found
scanning usb for storage devices... 1 Storage Device(s) found
ZynqMP> ls usb 0
5242880 dummy.bin
133849600 Image
2 file(s), 0 dir(s)
ZynqMP> load usb 0 100000 Image
133849600 bytes read in 1056 ms (120.9 MiB/s)
ZynqMP>
Thanks,
Siva
-----Original Message-----
From: U-Boot [mailto:u-boot-bounces at lists.denx.de] On Behalf Of Jean-Jacques Hiblot
Sent: Monday, May 13, 2019 8:00 PM
To: lukma at denx.de; marex at denx.de
Cc: Marcel Ziswiler <[email protected]>; u-boot at lists.denx.de; Miquel Raynal <[email protected]>; Stefan Roese <[email protected]>; Tom Rini <[email protected]>; Ryder Lee <[email protected]>; Heinrich Schuchardt <[email protected]>; Michal Simek <[email protected]>; Krzysztof Kozlowski <[email protected]>; Maxime Ripard <[email protected]>; Sven Schwermer <[email protected]>; Ramon Fried <[email protected]>; Eugeniu Rosca <[email protected]>; Vitaly Andrianov <[email protected]>; Joe Hershberger <[email protected]>; Tom Warren <[email protected]>
Subject: [U-Boot] [PATCH v2 00/18] Improvement for the DWC3 USB generic driver and fixes for the K2 platforms
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.
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
Changes in v2:
- Add a test for the NOP uclass
- Update commit logs
- 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--
2.17.1
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot
v2 cover Improvement for the DWC3 USB generic driver and fixes for the K2 platforms
Quoted 6 lines · On Tue, 21 May 2019 11:36:57 +0000 Siva Durga Prasad Paladugu…
Hi,
Tested the series with one out of tree patch(https://marc.info/?l=u-boot&m=155409909828219 ) on Xilinx ZynqMP and it looks fine. We may need to finalize on
https://marc.info/?l=u-boot&m=155409909828219 as well.
Could you also provide proper Tested-by tag to this patch set? In that way it would automatically be added to patchwork, and your tag would be applied to the patches.
Thanks in advance.
Quoted 164 lines
U-Boot 2019.04-rc4-00065-g5063fa3-dirty (May 21 2019 - 16:58:34 +0530)
Model: ZynqMP ZCU102 Rev1.0 Board: Xilinx ZynqMP DRAM: 4 GiB EL Level: EL2 Chip ID: zu9eg MMC: mmc at ff170000: 0Loading Environment from FAT... *** Warning - bad CRC, using default environment
In: serial at ff000000 Out: serial at ff000000 Err: serial at ff000000 Bootmode: JTAG_MODE Reset reason: EXTERNAL Net: ZYNQ GEM: ff0e0000, phyaddr c, interface rgmii-idWarning: ethernet at
ff0e0000(eth0) using random MAC address - 32:98:cb:f1:92:33 eth0: ethernet atff0e0000
Hit any key to stop autoboot: 0
ZynqMP> usb start
starting USB...
USB0: Register 2000440 NbrPorts 2
Starting the controller
USB XHCI 1.00
scanning bus 0 for devices... 2 USB Device(s) found
scanning usb for storage devices... 1 Storage Device(s) found
ZynqMP> ls usb 0
5242880 dummy.bin
133849600 Image2 file(s), 0 dir(s)
ZynqMP> load usb 0 100000 Image
133849600 bytes read in 1056 ms (120.9 MiB/s)
ZynqMP>Thanks,
Siva-----Original Message-----
From: U-Boot [mailto:u-boot-bounces at lists.denx.de] On Behalf Of Jean-Jacques Hiblot Sent: Monday, May 13, 2019 8:00 PM
To: lukma at denx.de; marex at denx.de
Cc: Marcel Ziswiler <[email protected]>;
u-boot at lists.denx.de; Miquel Raynal <[email protected]>; Stefan Roese <[email protected]>; Tom Rini <[email protected]>; Ryder Lee <[email protected]>; Heinrich Schuchardt <[email protected]>; Michal Simek <[email protected]>; Krzysztof Kozlowski <[email protected]>; Maxime Ripard <[email protected]>; Sven Schwermer <[email protected]>; Ramon Fried <[email protected]>; Eugeniu Rosca <[email protected]>; Vitaly Andrianov <[email protected]>; Joe Hershberger <[email protected]>; Tom Warren <[email protected]> Subject:
[U-Boot] [PATCH v2 00/18] Improvement for the DWC3 USB generic driver and fixes for the K2 platformsThe 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 ofUCLASS_MISCin the USB wrapper because the MISC class now automatically binds all the child devices.Improvements to the DWC3 generic driver are:
- Fix it by switching toUCLASS_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
Kconfigoptions 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/515282720Changes in v2:
- Add a test for the NOP uclass
- Update commit logs
- SelectUSB_GADGET_DUALSPEEDifUSB_DWC3_GADGETis selectedJean-Jacques Hiblot (18):
usb: dwc3-generic: removedm_scan_fdt_dev()from theremove()
callback usb: host: remove the xhci-zynqmp driver
dm: Add a No-op uclass
usb: dwc3: UseUCLASS_NOPinstead ofUCLASS_MISCfor the DWC3
generic glue
usb: dwc3: switch to peripheral mode when exiting
usb: xhci: movexhci.hto 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: Adddwc3_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: disableXHCI_DWC3and enable
KEYSTONE_USB_PHY
ARM: DTS: keystone: complete the description of the USB PHY devicesMAINTAINERS | 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 mode100644
arch/arm/dts/keystone-k2l-evm-u-boot.dtsidelete mode 100644drivers/usb/host/xhci-zynqmp.crename {drivers/usb/host=>include/usb}/xhci.h(100%) create mode 100644test/dm/nop.c
Quoted 7 lines
--
2.17.1_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot
Best regards,
Lukasz Majewski
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de -------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190521/e89fa8f7/attachment.sig>
v2 cover Improvement for the DWC3 USB generic driver and fixes for the K2 platforms
Hi Lukasz,
Quoted 27 lines
-----Original Message-----
From: Lukasz Majewski [mailto:lukma at denx.de]
Sent: Tuesday, May 21, 2019 5:52 PM
To: Siva Durga Prasad Paladugu <[email protected]>
Cc: Jean-Jacques Hiblot <[email protected]>; marex at denx.de; Marcel Ziswiler <[email protected]>; u-boot at lists.denx.de; Miquel Raynal <[email protected]>; Stefan Roese <[email protected]>; Tom Rini <[email protected]>; Ryder Lee <[email protected]>; Heinrich Schuchardt <[email protected]>; Michal Simek <[email protected]>; Krzysztof Kozlowski <[email protected]>; Maxime Ripard <[email protected]>; Sven Schwermer <[email protected]>; Ramon Fried <[email protected]>; Eugeniu Rosca <[email protected]>; Vitaly Andrianov <[email protected]>; Joe Hershberger <[email protected]>; Tom Warren <[email protected]>
Subject: Re: [U-Boot] [PATCH v2 00/18] Improvement for the DWC3 USB generic driver and fixes for the K2 platformsQuoted 6 lines · On Tue, 21 May 2019 11:36:57 +0000 Siva Durga Prasad Paladugu…
Hi,
Tested the series with one out of tree patch(https://marc.info/?l=u-boot&m=155409909828219 ) on Xilinx ZynqMP and it looks fine. We may need to finalize on
https://marc.info/?l=u-boot&m=155409909828219 as well.
Quoted 5 lines
Could you also provide proper Tested-by tag to this patch set? In that way it would automatically be added to patchwork, and your tag would be applied to the patches.
Thanks in advance.
I cant provide Tested-by as I tested this with one out of tree patch(https://marc.info/?l=u-boot&m=155409909828219). If it goes in, then I can provide Tested-by.
Thanks,
Siva
Quoted 185 lines
Quoted 165 lines
U-Boot 2019.04-rc4-00065-g5063fa3-dirty (May 21 2019 - 16:58:34 +0530)
Model: ZynqMP ZCU102 Rev1.0 Board: Xilinx ZynqMP DRAM: 4 GiB EL Level: EL2 Chip ID: zu9eg MMC: mmc at ff170000: 0Loading Environment from FAT... *** Warning - bad CRC, using default environment
In: serial at ff000000 Out: serial at ff000000 Err: serial at ff000000 Bootmode: JTAG_MODE Reset reason: EXTERNAL Net: ZYNQ GEM: ff0e0000, phyaddr c, interface rgmii-idWarning: ethernet at
ff0e0000(eth0) using random MAC address - 32:98:cb:f1:92:33 eth0: ethernet atff0e0000Hit any key to stop
autoboot: 0
ZynqMP> usb start
starting USB...
USB0: Register 2000440 NbrPorts 2
Starting the controller
USB XHCI 1.00
scanning bus 0 for devices... 2 USB Device(s) found
scanning usb for storage devices... 1 Storage Device(s) found
ZynqMP> ls usb 0
5242880 dummy.bin
133849600 Image2 file(s), 0 dir(s)
ZynqMP> load usb 0 100000 Image
133849600 bytes read in 1056 ms (120.9 MiB/s)
ZynqMP>Thanks,
Siva-----Original Message-----
From: U-Boot [mailto:u-boot-bounces at lists.denx.de] On Behalf Of Jean-Jacques Hiblot Sent: Monday, May 13, 2019 8:00 PM
To: lukma at denx.de; marex at denx.de
Cc: Marcel Ziswiler <[email protected]>;
u-boot at lists.denx.de; Miquel Raynal <[email protected]>; Stefan Roese <[email protected]>; Tom Rini <[email protected]>; Ryder Lee <[email protected]>; Heinrich Schuchardt <[email protected]>; Michal Simek <[email protected]>; Krzysztof Kozlowski <[email protected]>; Maxime Ripard <[email protected]>; Sven Schwermer <[email protected]>; Ramon Fried <[email protected]>; Eugeniu Rosca <[email protected]>; Vitaly Andrianov <[email protected]>; Joe Hershberger <[email protected]>; Tom Warren <[email protected]> Subject:
[U-Boot] [PATCH v2 00/18] Improvement for the DWC3 USB generic driver and fixes for the K2 platformsThe 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 ofUCLASS_MISCin the USB wrapper because the MISC class now automatically binds all the child devices.Improvements to the DWC3 generic driver are:
- Fix it by switching toUCLASS_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
Kconfigoptions 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/515282720Changes in v2:
- Add a test for the NOP uclass
- Update commit logs
- SelectUSB_GADGET_DUALSPEEDifUSB_DWC3_GADGETis selectedJean-Jacques Hiblot (18):
usb: dwc3-generic: removedm_scan_fdt_dev()from theremove()
callback usb: host: remove the xhci-zynqmp driver
dm: Add a No-op uclass
usb: dwc3: UseUCLASS_NOPinstead ofUCLASS_MISCfor the DWC3
generic glue
usb: dwc3: switch to peripheral mode when exiting
usb: xhci: movexhci.hto 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: Adddwc3_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: disableXHCI_DWC3and enable
KEYSTONE_USB_PHY
ARM: DTS: keystone: complete the description of the USB PHY devicesMAINTAINERS | 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 mode100644
arch/arm/dts/keystone-k2l-evm-u-boot.dtsidelete mode 100644drivers/usb/host/xhci-zynqmp.crename {drivers/usb/host=>include/usb}/xhci.h(100%) create mode 100644test/dm/nop.cQuoted 7 lines
--
2.17.1_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-bootBest regards,
Lukasz Majewski
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
v2 cover Improvement for the DWC3 USB generic driver and fixes for the K2 platforms
In reply to Siva Durga Prasad PaladuguQuoted 1 line · Siva Durga Prasad Paladugu
Hi,
Hi,
Quoted 4 lines
Tested the series with one out of tree patch(https://marc.info/?l=u-boot&m=155409909828219 ) on Xilinx ZynqMP and it looks fine. We may need to finalize on https://marc.info/?l=u-boot&m=155409909828219 as well.
U-Boot 2019.04-rc4-00065-g5063fa3-dirty (May 21 2019 - 16:58:34 +0530)
Does it still work on current master (2019.07-rc) ? Testing a patch on top of rc version of previous release is not really helpful.
[...]
Signature · 2 lines
Best regards, Marek Vasut
v2 cover Improvement for the DWC3 USB generic driver and fixes for the K2 platforms
Hi,
-----Original Message-----
From: Marek Vasut [mailto:marex at denx.de]
Sent: Tuesday, May 21, 2019 6:14 PM
To: Siva Durga Prasad Paladugu <[email protected]>; Jean-Jacques Hiblot <[email protected]>; lukma at denx.de
Cc: Marcel Ziswiler <[email protected]>; u-boot at lists.denx.de; Miquel Raynal <[email protected]>; Stefan Roese <[email protected]>; Tom Rini <[email protected]>; Ryder Lee <[email protected]>; Heinrich Schuchardt <[email protected]>; Michal Simek <[email protected]>; Krzysztof Kozlowski <[email protected]>; Maxime Ripard <[email protected]>; Sven Schwermer <[email protected]>; Ramon Fried <[email protected]>; Eugeniu Rosca <[email protected]>; Vitaly Andrianov <[email protected]>; Joe Hershberger <[email protected]>; Tom Warren <[email protected]>
Subject: Re: [U-Boot] [PATCH v2 00/18] Improvement for the DWC3 USB generic driver and fixes for the K2 platforms
Quoted 1 line · Siva Durga Prasad Paladugu
Hi,
Hi,
Quoted 4 lines
Tested the series with one out of tree patch(https://marc.info/?l=u-boot&m=155409909828219 ) on Xilinx ZynqMP and it looks fine. We may need to finalize on https://marc.info/?l=u-boot&m=155409909828219 as well.
U-Boot 2019.04-rc4-00065-g5063fa3-dirty (May 21 2019 - 16:58:34 +0530)
Does it still work on current master (2019.07-rc) ? Testing a patch on top of rc version of previous release is not really helpful.
[...]
Its same with latest too.
U-Boot 2019.07-rc2-00182-g29792e4-dirty (May 22 2019 - 11:21:25 +0530)
Model: ZynqMP ZCU102 Rev1.0 Board: Xilinx ZynqMP DRAM: 4 GiB EL Level: EL2 Chip ID: zu9eg MMC: mmc at ff170000: 0
Loading Environment from FAT... *** Warning - bad CRC, using default environment
In: serial at ff000000 Out: serial at ff000000 Err: serial at ff000000 Bootmode: JTAG_MODE Reset reason: EXTERNAL Net: ZYNQ GEM: ff0e0000, phyaddr c, interface rgmii-id
Warning: ethernet at ff0e0000 (eth0) using random MAC address - ca:f4:c2:4a:b8:df
eth0: ethernet at ff0e0000
Hit any key to stop autoboot: 0
ZynqMP> usb start
starting USB...
Bus dwc3 at fe200000: Register 2000440 NbrPorts 2
Starting the controller
USB XHCI 1.00
scanning bus dwc3 at fe200000 for devices... 2 USB Device(s) found
scanning usb for storage devices... 1 Storage Device(s) found
ZynqMP> ls ubs 0
ZynqMP> ls usb 0
5242880 dummy.bin
133849600 Image
2 file(s), 0 dir(s)
ZynqMP> load usb 0 100000 dummy.bin
5242880 bytes read in 55 ms (90.9 MiB/s)
ZynqMP>
Thanks,
Siva
--
Best regards,
Marek Vasut