summaryrefslogtreecommitdiff
path: root/drivers/usb
AgeCommit message (Collapse)Author
2018-05-07SPDX: Convert all of our single license tags to Linux Kernel styleTom Rini
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <trini@konsulko.com>
2018-04-30usb: f_mass_storage: simplify logical expressionHeinrich Schuchardt
An unsigned int is always >= 0. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2018-04-30usb: gadget: remove duplicate assignment.Heinrich Schuchardt
We should not make the same assignement twice. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2018-04-28spl: disk: usb: Add dependencies to sprintf/strto*Alex Kiernan
If SPL serial support is disabled nothing brings in sprintf, snprintf or simple_strtoul: env/built-in.o: In function `regex_callback': env/attr.c:128: undefined reference to `sprintf' disk/built-in.o: In function `blk_get_device_by_str': disk/part.c:386: undefined reference to `simple_strtoul' disk/part.c:395: undefined reference to `simple_strtoul' disk/built-in.o: In function `blk_get_device_part_str': disk/part.c:522: undefined reference to `simple_strtoul' disk/built-in.o: In function `part_set_generic_name': disk/part.c:704: undefined reference to `sprintf' drivers/built-in.o: In function `init_peripheral_ep': drivers/usb/musb-new/musb_gadget.c:1826: undefined reference to `sprintf' drivers/built-in.o: In function `musb_core_init': drivers/usb/musb-new/musb_core.c:1451: undefined reference to `snprintf' Add those dependencies here. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
2018-04-27Remove unnecessary instances of DECLARE_GLOBAL_DATA_PTRTom Rini
We have a large number of places where while we historically referenced gd in the code we no longer do, as well as cases where the code added that line "just in case" during development and never dropped it. Signed-off-by: Tom Rini <trini@konsulko.com>
2018-04-26usb: gadget: composite: fix NULL pointer when a non standard request is receivedChristophe Kerello
In case usb configuration is unknown (cdev->config == NULL), non standard request should not be processed. Remove also the cdev->config check below which will never happen. This issue was seen using ums feature. Signed-off-by: Christophe Kerello <christophe.kerello@st.com> Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
2018-04-26usb: host: dwc3: fix phys initNeil Armstrong
When no PHYs are declared in the dwc3 node, the phy init fails. This patch checks if the "phys" property is presend and reports the error returned by dev_count_phandle_with_args(). This patchs also fixes the styles issues added in last commit. This patch should fix the DWC3 support on the UniPhier SoC family. Fixes: 7c839ea70c49 ("usb: host: dwc3: Add support for multiple PHYs") Reported-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2018-04-21usb: dwc3-of-simple: fix error check of clk_get_bulk when disabledNeil Armstrong
The disabled clk API returns -ENOSYS unlike the reset API returning -ENOTSUPP. Fixes: ca7fdc8b1267 ("usb: host: Add simple of glue driver for DWC3 USB Controllers integration") Reported-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2018-04-21usb: dwc3-of-simple: Add support for DRA7/AM57 platforms.Jean-Jacques Hiblot
Add the compatibility with "ti,dwc3" and enable it by default if DM_USB is enabled. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
2018-04-21usb: dwc3-of-simple: Fix dependenciesJean-Jacques Hiblot
This simple glue layer does not require CONFIG_MISC, but it does require CONFIG_DM_USB. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
2018-04-11usb: host: dwc3: Add support for multiple PHYsNeil Armstrong
DWC3 Ips can have more than 1 PHY for USB2 and 1 PHY for USB3, add support for a generic number of PHYs and adapt the code to handle a generic number of PHYs. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2018-04-11usb: host: Add simple of glue driver for DWC3 USB Controllers integrationNeil Armstrong
This is a port of the dwc3-of-simple driver from Linux to enable/deassert clock and resets of a simple DWC3 Controller HW glue. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2018-04-08net: Move enetaddr env access code to env config instead of net configAlex Kiernan
In order that we can use eth_env_* even when CONFIG_NET isn't set, move these functions to environment code from net code. This fixes failures such as: board/ti/am335x/built-in.o: In function `board_late_init': board/ti/am335x/board.c:752: undefined reference to `eth_env_set_enetaddr' u-boot/board/ti/am335x/board.c:766: undefined reference to `eth_env_set_enetaddr' which caters for use cases such as: commit f411b5cca48f ("board: am335x: Always set eth/eth1addr environment variable") when Ethernet is required in Linux, but not U-Boot. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
2018-04-08usb: gadget: USB_ETHER requires network supportAlex Kiernan
In order to compile the USB Ethernet gadget support we require that NET is enabled, add that dependency here. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2018-03-28usb: rockchip: remove duplicate assignement.Heinrich Schuchardt
Assigning f_rkusb->reboot_flag twice doesn't make sense. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2018-03-22lan7xxx: Require phylibAlexander Graf
The lan75xx and lan78xx drivers need to drive their phy via the generic phylib framework. Let's reflect that dependency in Kconfig, so that we don't get build errors when phylib does not get selected. Signed-off-by: Alexander Graf <agraf@suse.de> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2018-03-17usb: dwc2: Replace printf, pr_err by dev_info, dev_errPatrice Chotard
Replace printf() call by dev_info() and pr_err() by dev_err() Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
2018-03-17usb: dwc2: increase timeout in wait_for_chhltdChristophe Kerello
This patch increases timeout to 2s. It was seen on 2 USB devices (Verbatim STORE N GO 070B4AED0FB22358 and USB DISK 2.0 9000729BA41DDF40) that the request sense command takes between 1.3s and and 1.5s. Signed-off-by: Christophe Kerello <christophe.kerello@st.com> Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
2018-03-17usb: dwc2: disable external vbus supply when the device is removedChristophe Kerello
This patch adds an interface to disable the power in dwc2 driver. This new interface is called when the device is removed. Signed-off-by: Christophe Kerello <christophe.kerello@st.com> Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
2018-03-17usb: ohci-generic: replace pr_err() by dev_err()Patrice Chotard
As we get access to struct udevice, use dev_err() instead of pr_err(). Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
2018-03-17usb: ohci-generic: factorize PHY operationPatrice Chotard
Factorize PHY get/init/poweron and PHY poweroff/exit operations into separate function, it simplify the error path. Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
2018-03-17usb: ohci-generic: handle phy power on/offPatrice Chotard
Add generic_phy_power_on() and generic_phy_power_off() calls to switch ON/OFF phy during probe and remove functions. Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
2018-03-17usb: ehci-generic: replace pr_err() by dev_err()Patrice Chotard
As we get access to struct udevice, use dev_err() instead of pr_err(). Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
2018-03-17usb: ehci-generic: factorize PHY operationPatrice Chotard
Factorize PHY get/init/poweron and PHY poweroff/exit operations into separate function, it simplify the error path. Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
2018-03-17usb: ehci-generic: handle phy power on/offPatrice Chotard
Add generic_phy_power_on() and generic_phy_power_off() calls to switch ON/OFF phy during probe and remove functions. Signed-off-by: Christophe Kerello <christophe.kerello@st.com> Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
2018-03-17usb: Remove unused ppc4xx EHCI host driverStefan Roese
ppc4xx support was removed some time ago. Lets remove the now unused EHCI driver and all its references for this platform as well. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de> Cc: Marek Vasut <marex@denx.de>
2018-03-17ubs: xhci-dwc3: Enable USB3 PHY when availableVignesh R
DWC3 USB3 controllers will need USB3 PHY to be enabled, in addition to USB2 PHY, to be functional. Therefore enable USB3 PHY when available. Signed-off-by: Vignesh R <vigneshr@ti.com>
2018-03-17usb: xhci-dwc3: Refractor PHY operations into separate functionVignesh R
Refractor PHY get/init/poweron and PHY poweroff/exit operations into separate function so that its easy to support multiple PHYs. Signed-off-by: Vignesh R <vigneshr@ti.com>
2018-03-17usb: xhci-dwc3: Power on USB PHY before usingVignesh R
It is wrong that expect .phy_init() to also power on the PHY. Therefore, explicitly, call generic_phy_power_on() after generic_phy_power_init() in order to power on PHY before using it. Signed-off-by: Vignesh R <vigneshr@ti.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2018-03-17usb: dwc2: Allow selection of data buffer sizeAlexey Brodkin
If we use hardware with very small RAM (let's consider just a couple of hundreds of kB but not megabytes) it is not super convenient to lose 64kB for statically allocated bufer which most probably won't be used as big as it is. Typically we'll have much shorter data packages to excahnge and in the worst case longer packets will be split on separate transactions. For those corner-cases user will be able to set his buffer size of choice via USB_DWC2_BUFFER_SIZE option in menuconfig. By default we'll use 64 kB as it was hard-coeded before so existing users shouldn't be affected at all. Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> Cc: Marek Vasut <marex@denx.de>
2018-03-05Merge git://git.denx.de/u-boot-shTom Rini
2018-03-05libfdt: move headers to <linux/libfdt.h> and <linux/libfdt_env.h>Masahiro Yamada
Thomas reported U-Boot failed to build host tools if libfdt-devel package is installed because tools include libfdt headers from /usr/include/ instead of using internal ones. This commit moves the header code: include/libfdt.h -> include/linux/libfdt.h include/libfdt_env.h -> include/linux/libfdt_env.h and replaces include directives: #include <libfdt.h> -> #include <linux/libfdt.h> #include <libfdt_env.h> -> #include <linux/libfdt_env.h> Reported-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-03-05usb: xhci-rcar: Add R8A77965 M3N entriesMarek Vasut
Add entries for the R8A77965 M3N SoC. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
2018-02-21dfu: Rename _FUNCTION_DFU to DFU_OVER_Marek Vasut
Do the following to make the symbol names less confusing. sed -i "s/\([TU][^_]\+\)_FUNCTION_DFU/DFU_OVER_\1/g" \ `git grep _FUNCTION_DFU | cut -d ":" -f 1 | sort -u` Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Lukasz Majewski <lukma@denx.de>
2018-02-21usb: kbd: select SYS_STDIO_DEREGISTERHeinrich Schuchardt
If SYS_STDIO_DEREGISTER is not selected and USB_KEYBOARD is selected U-Boot cannot be built due to missing function stdio_deregister_dev. So USB_KEYBOARD should select SYS_STDIO_DEREGISTER. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2018-02-21usb: gadget: sdp: fix pointer cast warnings for 64bit archsAndre Heider
The SDP protocol contains multiple 32bit pointers. Add a helper function to get a valid pointer from these values and use it. This fixes the following warnings: drivers/usb/gadget/f_sdp.c: In function ‘sdp_rx_data_complete’: drivers/usb/gadget/f_sdp.c:347:10: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] memcpy((void *)sdp->dnl_address, req->buf + 1, datalen); ^ drivers/usb/gadget/f_sdp.c: In function ‘sdp_jump_imxheader’: drivers/usb/gadget/f_sdp.c:625:10: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] entry = (void *)headerv2->entry; ^ drivers/usb/gadget/f_sdp.c: In function ‘sdp_handle_in_ep’: drivers/usb/gadget/f_sdp.c:668:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] memcpy(&data[1], (void *)sdp_func->dnl_address, datalen); ^ drivers/usb/gadget/f_sdp.c:679:31: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] status = sdp_jump_imxheader((void *)sdp_func->jmp_address); ^ Signed-off-by: Andre Heider <a.heider@gmail.com>
2018-02-21usb: gadget: sdp: add missing line breaksAndre Heider
Cosmetic change. Signed-off-by: Andre Heider <a.heider@gmail.com> Reviewed-by: Lukasz Majewski <lukma@denx.de> Acked-by: Stefan Agner <stefan.agner@toradex.com>
2018-02-15usb: host: xhci-omap: Remove redundant board_usb_init and board_usb_cleanup ↵Faiz Abbas
functions board_usb_init()/_cleanup() should be in board files and don't have a place in the xhci-omap driver. Weak versions for board_usb_init()/_cleanup() already exist in common/usb.c (for host mode) and drivers/usb/gadget/g_dnl.c (for gadget mode). Therefore, remove init and cleanup functions from xhci-omap and implement them in the board files. Signed-off-by: Faiz Abbas <faiz_abbas@ti.com> Reviewed-by: Marek Vasut <marex@denx.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2018-02-15usb: dwc2: Rename CONFIG_DWC2_UTMI_PHY_WIDTH to CONFIG_DWC2_UTMI_WIDTHAlexey Brodkin
For some reason from day one we used to have both CONFIG_DWC2_UTMI_WIDTH mentioned in dwc2.h and in scripts/config_whitelist.txt but never really used and CONFIG_DWC2_UTMI_PHY_WIDTH used in real code in dwc2.c (but never defined). Moreover even though CONFIG_DWC2_UTMI_WIDTH might be either 8 or 16 depending on hardware (and the same is said in a comment for it in dwc2.h) but then 8 is hardcoded in the header leaving no ability to override this value in board's configuration. Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> Cc: Marek Vasut <marex@denx.de>
2018-02-05usb: ulpi: kconfig: Remove meaningless choice defaultUlf Magnusson
'default' on a choice refers to the symbol selected by default, not to the choice mode, so 'default n' is meaningless. No functional changes. Optional choices implicitly default to n mode (and there is no way to make them default to another mode). Discovered in Kconfiglib (https://github.com/ulfalizer/Kconfiglib), which prints the following warning: warning: the default selection n (undefined) of <choice> (defined at drivers/usb/ulpi/Kconfig:3) is not contained in the choice I've added a corresponding warning to the C tools too, which is currently in linux-next: https://patchwork.kernel.org/patch/9983667/ Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
2018-02-05usb: dwc2: make casts of ep->dma_buf consistentTom Rini
In most places in the code we cast this to an unsigned long, but in one place we cast to an unsigned int. For consistency and to fix a warning on 64bit targets, always cast this to unsigned long. For the long term we should however change the declaration of dma_buf. Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Acked-by: Lukasz Majewski <lukma@denx.de> Acked-by: Marek Vasut <marex@denx.de> Signed-off-by: Tom Rini <trini@konsulko.com>
2018-02-02Kconfig: gadget: Move CONFIG_USB_FUNCTION_MASS_STORAGE to KconfigLukasz Majewski
This commit moves USB_FUNCTION_MASS_STORAGE config to Kconfig. Signed-off-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2018-02-02Kconfig: gadget: Move CONFIG_USB_FUNCTION_THOR to KconfigLukasz Majewski
This commit moves USB_FUNCTION_THOR config to Kconfig. Signed-off-by: Lukasz Majewski <lukma@denx.de> Acked-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2018-02-02Kconfig: usb: Sort USB_FUNCTION_* entriesLukasz Majewski
Lets provide alphabetical order for USB_FUNCTION_* entries of USB_GADGET_DOWNLOAD Signed-off-by: Lukasz Majewski <lukma@denx.de>
2018-01-28usb: host: Drop unused hcd_name from r8a66597-hcd.cTom Rini
The variable hcd_name is unsued, drop. Cc: Marek Vasut <marex@denx.de> Cc: Chris Brandt <chris.brandt@renesas.com> Signed-off-by: Tom Rini <trini@konsulko.com>
2018-01-28usb: Remove isp116x-hcd supportTom Rini
The isp116x-hcd driver is extremely long unused, so just remove it. Cc: Marek Vasut <marex@denx.de> Signed-off-by: Tom Rini <trini@konsulko.com>
2018-01-27Merge git://git.denx.de/u-boot-usbTom Rini
2018-01-26Merge git://git.denx.de/u-boot-spiTom Rini
2018-01-25usb: ehci: mxs: fix swapped argument in ehci_writel()Daniel Schwierzeck
ehci_writel() swaps the arguments for address and value. One call in ehci-mxs ignores that. This fixes the warning: drivers/usb/host/ehci-mxs.c: In function ?ehci_hcd_stop?: drivers/usb/host/ehci-mxs.c:159:19: error: initialization makes integer from pointer without a cast [-Werror=int-conversion] ehci_writel(tmp, &hcor->or_usbcmd); ^ arch/arm/include/asm/io.h:117:34: note: in definition of macro ?writel? #define writel(v,c) ({ u32 __v = v; __iowmb(); __arch_putl(__v,c); __v; }) ^ drivers/usb/host/ehci-mxs.c:159:2: note: in expansion of macro ?ehci_writel? ^~~~~~~~~~~ Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2018-01-25usb: xhci: Fix bool initialization in xhci_bulk_txGustavo A. R. Silva
Bool initializations should use true and false. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Cc: Bin Meng <bmeng.cn@gmail.com> Cc: Marek Vasut <marex@denx.de>