summaryrefslogtreecommitdiff
path: root/drivers/usb
AgeCommit message (Collapse)Author
2015-12-31usb: musb: Fix hub port setting for SPLIT transactionsStefan Brüns
The ifdef'ed Linux kernel code uses the 1 based port number, whereas U-Boot puts a 0 based port number into the register. The reason the 0 based port number apparently works can probably be taken from the USB 2.0 spec: 8.4.2.2 Start-Split Transaction Token ... The host must correctly set the port field for single and multiple TT hub implementations. A single TT hub implementation *may ignore* the port field. Actually, as far as I understand, a multi TT hub defaults to single TT (bAlternateSetting: 0) until switched via SetInterface, so even "port 42" would work. The change was verified by hardcoding the port number to a wrong value, SPLIT transactions kept working (although using a DWC2 instead of MUSB). Tested hubs are the RPi onboard SMC9514 and an external "05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB". The former is a multi TT hub, the latter single TT only. Addendum: Tested on sunxi/MUSB by Hans de Goede Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Tested-by: Hans de Goede <hdegoede@redhat.com>
2015-12-31usb: Move determination of TT hub address/port into separate functionStefan Brüns
Start split and complete split tokens need the hub address and the downstream port of the first HS hub (device view). The core of the function was duplicated in both host/ehci_hcd and musb-new/usb-compat.h. Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de> Reviewed-by: Marek Vasut <marex@denx.de> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Tested-by: Hans de Goede <hdegoede@redhat.com>
2015-12-31usb: dwc2: avoid out of bounds accessStefan Brüns
flush_dcache_range may access data after priv->aligned_buffer end if len > DWC2_DATA_BUF_SIZE. memcpy may access data after buffer end if done > 0 Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de> Acked-by: Marek Vasut <marex@denx.de> Acked-by: Stephen Warren <swarren@wwwdotorg.org>
2015-12-17usb: add support of generic OHCI devicesAlexey Brodkin
This driver is meant to be used with any OHCI-compatible host controller in case if there's no need for platform-specific glue such as setup of controller or PHY's power mode via GPIOs etc. Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> Cc: Simon Glass <sjg@chromium.org> Cc: Marek Vasut <marex@denx.de>
2015-12-17usb: host: ehci: samsung: Move hcor initialization after usb phy setupLukasz Majewski
With the old order of initialization the hcor pointer has been setup to the same address as Exynos EHCI base address (0x12110000 instead of 0x12110010). Such behaviour was caused by reading value of 0 instead of 0x10 from EHCI HCCPBASE register without doing proper clock initialization before. To fix this problem hcor initialization has been moved after USB PHY setup. Now ehci_readl(&ctx->hcd->cr_capbase) returns correct value. Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
2015-12-17usb: s3c-otg: Rename usb/s3c_udc.h to usb/dwc2_udc.hMarek Vasut
The driver is actually for the Designware DWC2 controller. This patch renames the global s3c_udc.h header to dwc2_udc.h. The rename is done automatically: $ sed -i "s/s3c_udc\.h/dwc2_udc.h/g" \ `git grep "s3c_udc\.h" | cut -d : -f 1` Signed-off-by: Marek Vasut <marex@denx.de>
2015-12-17usb: s3c-otg: Rename s3c_udc_probe() functionMarek Vasut
The driver is actually for the Designware DWC2 controller. This patch is the second and final to rename global symbol, the s3c_udc_probe() function. The rename is done automatically: $ sed -i "s/s3c_udc_probe/dwc2_udc_probe/g" \ `git grep s3c_udc_probe | cut -d : -f 1` Signed-off-by: Marek Vasut <marex@denx.de>
2015-12-17usb: s3c-otg: Rename struct s3c_plat_otg_dataMarek Vasut
The driver is actually for the Designware DWC2 controller. This patch is the first to rename global symbol, the struct s3c_plat_otg_data. The rename is done automatically: $ sed -i "s/s3c_plat_otg_data/dwc2_plat_otg_data/g" \ `git grep s3c_plat_otg_data | cut -d : -f 1` Signed-off-by: Marek Vasut <marex@denx.de>
2015-12-17usb: s3c-otg: Rename USB_GADGET_S3C_UDC_OTG* to USB_GADGET_DWC2_OTG*Marek Vasut
The s3c-otg IP block is in fact a DWC2 OTG one, so finally rename the config option to make it less misleading. No functional change, just a mechanical change done using the following script: git grep USB_GADGET_S3C_UDC_OTG | cut -d : -f 1 | sort -u | \ while read line ; do sed -i "s/USB_GADGET_S3C_UDC_OTG/USB_GADGET_DWC2_OTG/g" $line ; done Signed-off-by: Marek Vasut <marex@denx.de>
2015-12-17usb: s3c-otg: Tweak the commentsMarek Vasut
The driver is actually for the Designware DWC2 controller. Tweak the comments in the driver to reflect this fact. Signed-off-by: Marek Vasut <marex@denx.de>
2015-12-17usb: s3c-otg: Rename remaining macrosMarek Vasut
The driver is actually for the Designware DWC2 controller. This patch renames the remaining S3C_* macros to match the DWC2 naming. Signed-off-by: Marek Vasut <marex@denx.de>
2015-12-17usb: s3c-otg: Rename sources to dwc2_*cMarek Vasut
The driver is actually for the Designware DWC2 controller. This patch renames the local source files to dwc2_*c and adjusts the Makefile to use the new names. Signed-off-by: Marek Vasut <marex@denx.de>
2015-12-17usb: s3c-otg: Rename local headers to dwc2_*hMarek Vasut
The driver is actually for the Designware DWC2 controller. This patch renames the local header files to dwc2_*h and adjusts the sources to use the new names. Signed-off-by: Marek Vasut <marex@denx.de>
2015-12-17usb: s3c-otg: Change the driver name to dwc2-udcMarek Vasut
Just change the driver name. Signed-off-by: Marek Vasut <marex@denx.de>
2015-12-17usb: s3c-otg: Zap useless externsMarek Vasut
The extern statements are useless, remove them. Also remove the extern ... controller, which is completely useless. Signed-off-by: Marek Vasut <marex@denx.de>
2015-12-17usb: s3c-otg: Rename remaining local s3c_*() functionsMarek Vasut
The driver is actually for the Designware DWC2 controller. This patch renames the remaining local s3c_*() functions to reflect this. Signed-off-by: Marek Vasut <marex@denx.de>
2015-12-17usb: s3c-otg: Rename s3c_udc_*() functionsMarek Vasut
The driver is actually for the Designware DWC2 controller. This patch renames the s3c_ep_*() functions to reflect this. The function s3c_udc_probe() is a special case and is not renamed by this patch yet. Signed-off-by: Marek Vasut <marex@denx.de>
2015-12-17usb: s3c-otg: Rename s3c_ep_*() functionsMarek Vasut
The driver is actually for the Designware DWC2 controller. This patch renames the s3c_ep_*() functions to reflect this. Signed-off-by: Marek Vasut <marex@denx.de>
2015-12-17usb: s3c-otg: Rename s3c_ep0_*() functionsMarek Vasut
The driver is actually for the Designware DWC2 controller. This patch renames the s3c_ep0_*() functions to reflect this. Signed-off-by: Marek Vasut <marex@denx.de>
2015-12-17usb: s3c-otg: Staticize functions in s3c_udc_otg_xfer_dma.cMarek Vasut
Just staticize the functions, they are not used outside of the file. Signed-off-by: Marek Vasut <marex@denx.de>
2015-12-17usb: s3c-otg: Staticize s3c_udc_ep_set_stallMarek Vasut
This function is local to s3c_udc_otg_xfer_dma.c , staticize it. Signed-off-by: Marek Vasut <marex@denx.de>
2015-12-17usb: s3c-otg: Rename struct s3c_requestMarek Vasut
The driver is actually for the Designware DWC2 controller. This patch renames struct s3c_request to reflect this. Signed-off-by: Marek Vasut <marex@denx.de>
2015-12-17usb: s3c-otg: Rename struct s3c_epMarek Vasut
The driver is actually for the Designware DWC2 controller. This patch renames struct s3c_ep to reflect this. Signed-off-by: Marek Vasut <marex@denx.de>
2015-12-17usb: s3c-otg: Rename struct s3c_dev_*_epMarek Vasut
The driver is actually for the Designware DWC2 controller. This patch renames struct s3c_dev_*_ep to reflect this. Signed-off-by: Marek Vasut <marex@denx.de>
2015-12-17usb: s3c-otg: Rename struct s3c_usbotg_phy to dwc2_usbotg_phyMarek Vasut
The driver is actually for the Designware DWC2 controller. This patch renames struct s3c_usbotg_phy to struct dwc2_usbotg_phy to make things more obvious and clear. Signed-off-by: Marek Vasut <marex@denx.de>
2015-12-17usb: s3c-otg: Split private bits from s3c_udc.hMarek Vasut
Most of the functions are local to the s3c_udc driver, remove them from the s3c_udc.h header to stop those bits from propagating all over the place. Instead, move all the private stuff into new private s3c_udc_otg_priv.h header. Signed-off-by: Marek Vasut <marex@denx.de>
2015-12-17usb: s3c-otg: Rename struct s3c_usbotg_reg to dwc2_usbotg_regMarek Vasut
The driver is actually for the Designware DWC2 controller. This patch renames struct s3c_usbotg_reg to struct dwc2_usbotg_reg to make things more obvious and clear. Signed-off-by: Marek Vasut <marex@denx.de>
2015-12-17usb: s3c-otg: Rename struct s3c_udc to dwc2_udcMarek Vasut
The driver is actually for the Designware DWC2 controller. This patch renames struct s3c_udc to struct dwc2_udc to make things more obvious and clear. Signed-off-by: Marek Vasut <marex@denx.de>
2015-12-17usb: s3c-otg: Rename regs-otg.h to s3c_udc_otg_regs.hMarek Vasut
Rename the header file, so it's obvious which driver it's part of. No functional change. Signed-off-by: Marek Vasut <marex@denx.de>
2015-12-07usb: xhci: zynqmp: Removing unused function usb_phy_resetMarek Vasut
This patch removes unsued function usb_phy_reset, rather common function dwc3_phy_reset is used. Signed-off-by: Marek Vasut <marex@denx.de>
2015-12-07usb: xhci: fsl: Removing unused function usb_phy_resetRajesh Bhagat
This patch removes unsued function usb_phy_reset, rather common function dwc3_phy_reset is used. Signed-off-by: Rajesh Bhagat <rajesh.bhagat@freescale.com>
2015-12-07usb: xhci: dwc3: Adding reset delay requirement as per dwc3 databookRajesh Bhagat
As per dwc3 databook, delay is required before taking the core out of reset. This delay is required so that the PHY are stable, and then we can take core out of reset. Reference is taken from linux dwc3 code, file: drivers/usb/dwc3/core.c. Signed-off-by: Sriram Dash <sriram.dash@freescale.com> Signed-off-by: Rajesh Bhagat <rajesh.bhagat@freescale.com>
2015-12-07usb: add support for generic EHCI devicesAlexey Brodkin
This driver is meant to be used with any EHCI-compatible host controller in case if there's no need for platform-specific glue such as setup of controller or PHY's power mode via GPIOs etc. Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> Cc: Stephen Warren <swarren@nvidia.com> Cc: Simon Glass <sjg@chromium.org> Cc: Marek Vasut <marex@denx.de>
2015-12-07sunxi: usb: Rename the sunxi usb driver DM entryMarek Vasut
The DM entry should be unique, otherwise it will collide with other drivers. Fix this by assigning the driver a more unique name than usb_ehci. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Ian Campbell <ijc@hellion.org.uk> Cc: Simon Glass <sjg@chromium.org>
2015-12-07usb: zynqmp: Fix build warningsMarek Vasut
The driver does "return 0" in function with void type. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Michal Simek <monstr@monstr.eu> Cc: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
2015-12-07usb: dwc3: fix build warningsFelipe Balbi
fix the following build warnings: drivers/usb/dwc3/core.c: In function ‘dwc3_uboot_init’: drivers/usb/dwc3/core.c:625:6: warning: ‘dev’ is used uninitialized in this function [-Wuninitialized] mem = devm_kzalloc(dev, sizeof(*dwc) + DWC3_ALIGN_MASK, GFP_KERNEL); ^ drivers/usb/dwc3/dwc3-omap.c: In function ‘dwc3_omap_uboot_init’: drivers/usb/dwc3/dwc3-omap.c:380:7: warning: ‘dev’ is used uninitialized in this function [-Wuninitialized] omap = devm_kzalloc(dev, sizeof(*omap), GFP_KERNEL); Signed-off-by: Felipe Balbi <balbi@ti.com>
2015-12-07usb: host: xhci-omap: fix build breakFelipe Balbi
Fix the following build break: drivers/usb/host/xhci-omap.c:35:5: error: ‘board_usb_init’ aliased to external symbol ‘__board_usb_init’ int board_usb_init(int index, enum usb_init_type init) ^ Signed-off-by: Felipe Balbi <balbi@ti.com>
2015-12-07usb: zynqmp: Add XHCI driver supportSiva Durga Prasad Paladugu
Added USB XHCI driver support for zynqmp. Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
2015-11-22sunxi: musb: Implement dfu_usb_get_reset()Siarhei Siamashka
This is necessary to distinguish between the "dfu-util --detach" and the "dfu-util --reset" requests. The default weak implementation of dfu_usb_get_reset() unconditionally reboots the device, but we want to be able to continue the boot.scr execution after writing the kernel, fdt and ramdisk to RAM via DFU. Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2015-11-19usb: sandbox: Add a USB emulation driverSimon Glass
Add a simple USB keyboard driver for sandbox. It provides a function to 'load' it with input data, which it will then stream through to the normal U-Boot input subsystem. When the input data is exhausted, the keyboard stops providing data. Signed-off-by: Simon Glass <sjg@chromium.org>
2015-11-19usb: sandbox: Add support for interrupt operationsSimon Glass
Allow USB device emulation to support interrupt URBs so that we can use USB keyboards with sandbox. Signed-off-by: Simon Glass <sjg@chromium.org>
2015-11-19dm: usb: Remove inactive children after a bus scanSimon Glass
Each scan of the USB bus may return different results. Existing driver-model devices are reused when found, but if a device no longer exists it will stay around, de-activated, but bound. Detect these devices and remove them after the scan completes. Signed-off-by: Simon Glass <sjg@chromium.org>
2015-11-19dm: usb: Deprecate usb_get_dev_index()Simon Glass
This function should not be used with driver model. While there are users of USB Ethernet that use driver model for USB but not Ethernet, we have to keep it around. Add a comment to that effect. Signed-off-by: Simon Glass <sjg@chromium.org>
2015-11-19Revert "dm: usb: Use device_unbind_children to clean up usb devs on stop"Simon Glass
This reverts commit 6cda369509e0d3fa5f9e33c9d71589c4523799fa. We want to avoid having the USB stack rely on unbind. Signed-off-by: Simon Glass <sjg@chromium.org>
2015-11-19Revert "dm: usb: Rename usb_find_child to usb_find_emul_child"Simon Glass
This reverts commit 9b510df703d282effba4f56ac567aa8011d56e6b. We want to avoid having the USB stack rely on unbind. Signed-off-by: Simon Glass <sjg@chromium.org>
2015-11-19sandbox: usb: Allow finding a USB emulator for a deviceSimon Glass
Each USB device has an emulator. Currently this can only be found by supplying the 'pipe' value, which contains the device number. Add a way to find it directly from the emulated device. Signed-off-by: Simon Glass <sjg@chromium.org>
2015-11-19sandbox: usb: Allow up to 4 emulated devices on a hubSimon Glass
To support more advanced testing, support 4 devices instead of 2. Signed-off-by: Simon Glass <sjg@chromium.org>
2015-11-19sandbox: usb: Allow dynamic emulated USB device descriptorsSimon Glass
We would like the serial number to come from the device tree node name of the emulated device. This avoids them all having the same name. Adjust the code to support this. Signed-off-by: Simon Glass <sjg@chromium.org>
2015-11-19Move console definitions into a new console.h fileSimon Glass
The console includes a global variable and several functions that are only used by a small subset of U-Boot files. Before adding more functions, move the definitions into their own header file. Signed-off-by: Simon Glass <sjg@chromium.org>
2015-11-12driver: usb: Fix pointer conversion warnings for hikeyPrabhakar Kushwaha
Fix below compilation warings happening for hikey_defconfig drivers/usb/eth/smsc95xx.c:698:56: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] debug("** %s(), len %d, buf %#x\n", __func__, length, (int)msg); ^ include/common.h:109:26: note: in definition of macro ‘debug_cond’ printf(pr_fmt(fmt), ##args); \ ^ drivers/usb/eth/smsc95xx.c:698:2: note: in expansion of macro ‘debug’ debug("** %s(), len %d, buf %#x\n", __func__, length, (int)msg); ^ drivers/usb/eth/smsc95xx.c:718:2: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 2 has type ‘long unsigned int’ [-Wformat=] debug("Tx: len = %u, actual = %u, err = %d\n", ^ drivers/usb/eth/smsc95xx.c: In function ‘smsc95xx_recv’: drivers/usb/eth/smsc95xx.c:802:19: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] cur_buf_align = (int)buf_ptr - (int)recv_buf; ^ drivers/usb/eth/smsc95xx.c:802:34: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] cur_buf_align = (int)buf_ptr - (int)recv_buf; Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>