[U-Boot] [PATCH v4 1/2] usb: dwc2_udc_otg: support 8-bit interface

Steve Rae srae at broadcom.com
Tue Jun 7 17:57:57 CEST 2016


Define CONFIG_USB_GADGET_DWC2_OTG_PHY_BUS_WIDTH_8 to allow the
physical interface to be 8-bit (rather than 16-bit).

Signed-off-by: Steve Rae <srae at broadcom.com>
---
from [1] (line ~124)

    /* The Kona PHY supports an 8-bit wide UTMI interface */
    [...snip...]

    module_platform_driver(bcm_kona_usb2_driver);

    MODULE_ALIAS("platform:bcm-kona-usb2");
    MODULE_AUTHOR("Matt Porter <mporter at linaro.org>");
    MODULE_DESCRIPTION("BCM Kona USB 2.0 PHY driver");
    MODULE_LICENSE("GPL v2");

[1] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/phy/phy-bcm-kona-usb2.c

Changes in v4:
- split defconfig's into separate patch (per Marek)

Changes in v3:
- implement Marek's suggestion

Changes in v2:
- implement as Kconfig

 drivers/usb/gadget/Kconfig        | 10 ++++++++++
 drivers/usb/gadget/dwc2_udc_otg.c |  4 ++++
 2 files changed, 14 insertions(+)

diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
index a35a1c7..ae62476 100644
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -52,6 +52,16 @@ config USB_GADGET_DWC2_OTG
 	  driver to operate in Peripheral mode. This option requires
 	  USB_GADGET to be enabled.
 
+if USB_GADGET_DWC2_OTG
+
+config USB_GADGET_DWC2_OTG_PHY_BUS_WIDTH_8
+	bool "DesignWare USB2.0 HS OTG controller 8-bit PHY bus width"
+	help
+	  Set the Designware USB2.0 high-speed OTG controller
+	  PHY interface width to 8 bits, rather than the default (16 bits).
+
+endif # USB_GADGET_DWC2_OTG
+
 config CI_UDC
 	bool "ChipIdea device controller"
 	select USB_GADGET_DUALSPEED
diff --git a/drivers/usb/gadget/dwc2_udc_otg.c b/drivers/usb/gadget/dwc2_udc_otg.c
index cb20b00..a23278d 100644
--- a/drivers/usb/gadget/dwc2_udc_otg.c
+++ b/drivers/usb/gadget/dwc2_udc_otg.c
@@ -415,7 +415,11 @@ static void reconfig_usbd(struct dwc2_udc *dev)
 		|0<<7		/* Ulpi DDR sel*/
 		|0<<6		/* 0: high speed utmi+, 1: full speed serial*/
 		|0<<4		/* 0: utmi+, 1:ulpi*/
+#ifdef CONFIG_USB_GADGET_DWC2_OTG_PHY_BUS_WIDTH_8
+		|0<<3		/* phy i/f  0:8bit, 1:16bit*/
+#else
 		|1<<3		/* phy i/f  0:8bit, 1:16bit*/
+#endif
 		|0x7<<0;	/* HS/FS Timeout**/
 
 	if (dev->pdata->usb_gusbcfg)
-- 
1.8.5



More information about the U-Boot mailing list