summaryrefslogtreecommitdiff
path: root/drivers/usb/musb-new
AgeCommit message (Collapse)AuthorFilesLines
2023-07-21sunxi: Kconfig: rework PHY_USB_SUN4I selectionAndre Przywara1-0/+1
At the moment we use "select" in each Allwinner SoC's Kconfig section to include the USB PHY driver in the build. This means it cannot be disabled via Kconfig, although USB is not really a strictly required core functionality, and a particular board might not even include USB ports. Rework the Kconfig part by removing the "select" lines for each SoC's section, and instead letting it default to "y" in the PHY driver section itself. We use "depends on !" to exclude the few SoCs we don't support (yet). The Allwinner V3s does not enable USB (PHY) support at the moment, even though it should work: let the PHY default to "n" to keep the current behaviour. Also the MUSB USB driver directly calls some functions from the PHY driver, so let the former depend on the PHY driver. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com> Tested-by: Sam Edwards <CFSworks@gmail.com>
2023-06-08usb: musb-new: sunxi: remove unused defineSam Edwards1-2/+0
This is a remnant from when the USB controller driver managed the reset signal itself. A patch from the very end of 2018 changed this driver to delegate reset (and clock) management to the proper control unit driver, but left this unused define behind. Signed-off-by: Sam Edwards <CFSworks@gmail.com> Reviewed-by: Marek Vasut <marex@denx.de>
2023-06-08usb: musb-new: sunxi: fix error checkSam Edwards1-1/+1
The `musb_register` function returns some ERR_PTR(...) on failure, not NULL, so update the check here appropriately. Signed-off-by: Sam Edwards <CFSworks@gmail.com> Reviewed-by: Marek Vasut <marex@denx.de>
2023-05-06drivers: use devfdt_get_addr_index_ptr when cast to pointerJohan Jonker1-1/+1
The fdt_addr_t and phys_addr_t size have been decoupled. A 32bit CPU can expect 64-bit data from the device tree parser, so use devfdt_get_addr_index_ptr instead of the devfdt_get_addr_index function in the various files in the drivers directory that cast to a pointer. As we are there also streamline the error response to -EINVAL on return. Signed-off-by: Johan Jonker <jbx6244@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-02-10Correct SPL uses of USB_MUSB_HOSTSimon Glass1-1/+1
This converts 2 usages of this option to the non-SPL form, since there is no SPL_USB_MUSB_HOST defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-20global: Finish CONFIG -> CFG migrationTom Rini3-5/+5
At this point, the remaining places where we have a symbol that is defined as CONFIG_... are in fairly odd locations. While as much dead code has been removed as possible, some of these locations are simply less obvious at first. In other cases, this code is used, but was defined in such a way as to have been missed by earlier checks. Perform a rename of all such remaining symbols to be CFG_... rather than CONFIG_... Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-01-18musb-new: omap2430: fix compiling in DM_USB_GADGET configAndreas Kemnade1-0/+19
Add the separate IRQ handling function and change the registration. Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
2023-01-18musb-new: omap2430: no host data access in gadget modeAndreas Kemnade1-18/+16
Avoid accessing structures (usb_bus_priv) only present when musb is in host mode. Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
2022-09-18cyclic: Use schedule() instead of WATCHDOG_RESET()Stefan Roese1-1/+1
Globally replace all occurances of WATCHDOG_RESET() with schedule(), which handles the HW_WATCHDOG functionality and the cyclic infrastructure. Signed-off-by: Stefan Roese <sr@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Tom Rini <trini@konsulko.com> [am335x_evm, mx6cuboxi, rpi_3,dra7xx_evm, pine64_plus, am65x_evm, j721e_evm]
2022-07-15musb: sunxi: Allow host-side USB with external VBUSSamuel Holland1-6/+0
Now that the PHY driver will not try to drive VBUS if it is already driven by an external supply, there is no need to check the VBUS voltage before powering on the PHY. Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-07-12usb: common: move urb code to commonRui Miguel Silva6-120/+5
Move urb code from musb only use to a more common scope, so other drivers in the future can use the handling of urb in usb. Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
2022-01-19doc: replace @return by Return:Heinrich Schuchardt3-3/+3
Sphinx expects Return: and not @return to indicate a return value. find . -name '*.c' -exec \ sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \; find . -name '*.h' -exec \ sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \; Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-01-17drivers: musb_gadget: Save endpoint desc to usb_ep->descqianfan Zhao1-2/+1
Fix fastboot flash bug. If the downloading file size is equal to the partition size, "fastboot flash" can't work, at least in sunxi platform, because used an uninitalized point: ep->desc. This patch also fixed 'data abort' bug in am335x platform. Reproduce: fastboot flash loader1 spl/sunxi-spl.bin. Signed-off-by: qianfan Zhao <qianfanguijin@163.com> Reviewed-by: Sean Anderson <seanga2@gmail.com>
2021-11-15usb: Make USB_MUSB_PIO_ONLY selected by USB_MUSB_SUNXISamuel Dionne-Riel1-0/+1
This ensures the USB_MUSB_PIO_ONLY config is set to an apppropriate value from the changes enabling USB_MUSB_GADGET does. Namely, USB_MUSB_PIO_ONLY default to =y on USB_MUSB_SUNXI being y. Signed-off-by: Samuel Dionne-Riel <samuel@dionne-riel.com>
2021-10-11sunxi: Clean up inclusions of asm/arch/gpio.hSamuel Holland1-2/+0
As part of migrating to DM_GPIO and DM_PINCTRL, eventually we will remove the asm/arch/gpio.h header. In preparation, clean up the various files that include it. Some files did not contain any GPIO code at all, so this header was completely unused. A few files contained only legacy platform-specific GPIO code for setting up pin muxes. They were left unchanged, as that code will be completely removed by the DM_PINCTRL migration. The remaining files contain some combination of DM_GPIO and legacy GPIO code. For those, switch to including asm/gpio.h (if it wasn't included already). Right now, this header provides both sets of functions, because ARCH_SUNXI selects GPIO_EXTRA_HEADER. This will still be the right header to include once the DM_GPIO migration is complete and GPIO_EXTRA_HEADER is no longer needed. Signed-off-by: Samuel Holland <samuel@sholland.org> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2021-09-30WS cleanup: remove SPACE(s) followed by TABWolfgang Denk1-2/+2
Signed-off-by: Wolfgang Denk <wd@denx.de>
2021-09-30WS cleanup: remove trailing white spaceWolfgang Denk2-2/+2
Signed-off-by: Wolfgang Denk <wd@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-09-01Kconfig: Remove all default n/no optionsMichal Simek1-2/+0
default n/no doesn't need to be specified. It is default option anyway. Signed-off-by: Michal Simek <michal.simek@xilinx.com> [trini: Rework FSP_USE_UPD portion] Signed-off-by: Tom Rini <trini@konsulko.com>
2021-07-19usb: Enforce DM_USB migration for USB_HOST devices.Tom Rini1-5/+8
As the deadline for migration to DM_USB, when using a USB host controller has now gone two years past the deadline, enforce migration. This is done by: - Ensuring that all host controller options (other than the very legacy old MUSB ones) now select USB_HOST. USB_HOST now enforces DM_USB and OF_CONTROL. - Remove other parts of Kconfig logic that had platforms pick DM_USB. - To keep Kconfig happy, have some select statements test for USB_HOST as well. - Re-order some Kconfig entries and menus so that we can cleanly pick host or gadget roles. For the various HCD options that have platform glue options, group them together and update dependencies in some cases. - As SPL_DM_USB is not required, on platforms that had not yet enabled it, disable it. Cc: Marek Vasut <marex@denx.de> Cc: Icenowy Zheng <icenowy@aosc.io> Cc: Samuel Holland <samuel@sholland.org> Cc: FUKAUMI Naoki <naobsd@gmail.com> Cc: Andre Przywara <andre.przywara@arm.com> Cc: Jagan Teki <jagan@amarulasolutions.com> Signed-off-by: Tom Rini <trini@konsulko.com>
2021-07-14usb: musb-new: Add glue driver for ST-Ericsson Ux500Stephan Gerhold4-2/+191
The ST-Ericsson DB8500 SoC contains a MUSB OTG controller which supports both host and gadget mode. For some reason there is nothing special about it - add a simple glue driver for Ux500 that literally just sets up MUSB together with a generic PHY. There are no SoC-specific registers etc needed to make USB work. The new Ux500 glue driver is only tested to work with DM_USB and DM_USB_GADGET. Both host and gadget mode work fine on the u8500 "stemmy" board that is already present in U-Boot. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
2021-05-16usb: musb-new: Extend and move Allwinner quirk into KconfigAndre Przywara2-2/+11
All newer Allwinner SoCs (since about 2013) miss the CONFIGDATA register in their MUSB implementation, so they need a quirk to hardcode this. Currently this quirk depends on listing the SoCs affected in musb_reg.h, which means that this list needs to grow with every new chip. Move the quirk feature into Kconfig, next to PIO_ONLY, and change the default to y (for Allwinner builds), while listing the early implementations as exceptions. This fixes USB peripheral operation on some newer SoCs, which were not explicitly listed before. Tested on H6, H616, R40 (which were broken before), and also on the H5 and A20, for regressions. Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2021-02-02common: Drop asm/global_data.h from common headerSimon Glass4-0/+4
Move this out of the common header and include it only where needed. In a number of cases this requires adding "struct udevice;" to avoid adding another large header or in other cases replacing / adding missing header files that had been pulled in, very indirectly. Finally, we have a few cases where we did not need to include <asm/global_data.h> at all, so remove that include. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com>
2021-01-05dm: core: Access device ofnode through functionsSimon Glass1-1/+1
At present ofnode is present in the device even if it is never used. With of-platdata this field is not used, so can be removed. In preparation for this, change the access to go through inline functions. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-12-14dm: treewide: Rename ..._platdata variables to just ..._platSimon Glass6-19/+19
Try to maintain some consistency between these variables by using _plat as a suffix for them. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-12-14dm: treewide: Rename ofdata_to_platdata() to of_to_plat()Simon Glass3-11/+11
This name is far too long. Rename it to remove the 'data' bits. This makes it consistent with the platdata->plat rename. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-12-14dm: treewide: Rename dev_get_platdata() to dev_get_plat()Simon Glass3-10/+10
Rename this to be consistent with the change from 'platdata'. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-12-14dm: treewide: Rename 'platdata' variables to just 'plat'Simon Glass6-90/+85
We use 'priv' for private data but often use 'platdata' for platform data. We can't really use 'pdata' since that is ambiguous (it could mean private or platform data). Rename some of the latter variables to end with 'plat' for consistency. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-12-13dm: treewide: Rename auto_alloc_size members to be shorterSimon Glass6-14/+14
This construct is quite long-winded. In earlier days it made some sense since auto-allocation was a strange concept. But with driver model now used pretty universally, we can shorten this to 'auto'. This reduces verbosity and makes it easier to read. Coincidentally it also ensures that every declaration is on one line, thus making dtoc's job easier. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-20usb: musb-new: Fix typo in caution messageNaoki Hayama1-1/+1
%s/Occured/Occurred/ Signed-off-by: Naoki Hayama <naoki.hayama@lineo.co.jp>
2020-10-16usb: musb-new: mt85xx: Fix not calling dev_err with a deviceSean Anderson1-3/+4
This driver doesn't use DM (in the correct places), so we use a device and not a udevice. We also need to include device_compat.h Signed-off-by: Sean Anderson <seanga2@gmail.com>
2020-10-16usb: musb-new: Include device_compat.hSean Anderson5-1/+11
This was included, but was ifdef'd out. We also need dm.h for struct udevice. Signed-off-by: Sean Anderson <seanga2@gmail.com>
2020-09-30usb: musb-new: sunxi: Fix not calling dev_err with a deviceSean Anderson1-4/+5
This driver does not use DM, so we need to use a struct device instead of a struct udevice. Not ideal, but it'll have to do for now. Signed-off-by: Sean Anderson <seanga2@gmail.com> Tested-by: Patrick Delaunay <patrick.delaunay@st.com>
2020-09-08usb: musb-new: sunxi: change trace level for phy errors managed by uclassPatrick Delaunay1-4/+4
As the error message is now displayed by generic phy functions, the dev_err/pr_err can be change to dev_dbg/pr_debug. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2020-08-14xen: Port Xen hypervisor related code from mini-osOleksandr Andrushchenko1-4/+0
Port hypervisor related code from Mini-OS. This is referencing the code of Mini-OS from [1] by Huang Shijie and Volodymyr Babchuk which is for ARM64. Update essential arch code to support required bit operations, memory barriers etc. Copyright for the bits ported belong to at least the following authors, please see related files for details: Copyright (c) 2002-2003, K A Fraser Copyright (c) 2005, Grzegorz Milos, gm281@cam.ac.uk,Intel Research Cambridge Copyright (c) 2014, Karim Allah Ahmed <karim.allah.ahmed@gmail.com> [1] - https://github.com/zyzii/mini-os.git Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com> Signed-off-by: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com> [trini: Drop wmb() from musb-net/linux-compat.h now] Signed-off-by: Tom Rini <trini@konsulko.com>
2020-08-04usb: Drop dm.h header fileSimon Glass3-36/+47
This header file should not be included in other header files. Remove it and use a forward declaration instead. Also move the inline function out into a C file. We should not include C code in headers. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-19common: Drop linux/bitops.h from common headerSimon Glass3-0/+3
Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-19common: Drop linux/delay.h from common headerSimon Glass7-0/+7
Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-19common: Drop linux/bug.h from common headerSimon Glass4-0/+4
Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-19common: Drop log.h from common headerSimon Glass7-0/+7
Move this header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-03-30usb: Migrate to support live DT for some driverKever Yang1-7/+5
Use ofnode_ instead of fdt_ APIs so that the drivers can support live DT. This patch updates usb_get_dr_mode() and usb_get_maximum_speed() to use ofnode as parameter instead of fdt offset. And all the drivers who use these APIs update to use live dt APIs at the same time. Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2020-02-06dm: core: Create a new header file for 'compat' featuresSimon Glass12-0/+13
At present dm/device.h includes the linux-compatible features. This requires including linux/compat.h which in turn includes a lot of headers. One of these is malloc.h which we thus end up including in every file in U-Boot. Apart from the inefficiency of this, it is problematic for sandbox which needs to use the system malloc() in some files. Move the compatibility features into a separate header file. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-02-06dm: core: Require users of devres to include the headerSimon Glass7-0/+7
At present devres.h is included in all files that include dm.h but few make use of it. Also this pulls in linux/compat which adds several more headers. Drop the automatic inclusion and require files to include devres themselves. This provides a good indication of which files use devres. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Anatolij Gustschin <agust@denx.de>
2020-01-25usb: musb-new: mt85xx: add musb-new gadget driver.mingming lee3-1/+428
Using musb-new structure for mt85xx gadget driver. Add gadget driver dts for mt8518 SoCs. Signed-off-by: mingming lee <mingming.lee@mediatek.com>
2020-01-08usb: Drop use of BUG_ON() and WARN_ON()Simon Glass2-1/+5
These macros use __FILE__ which inserts the full path of the object file into U-Boot, thus increasing file size. Drop these usages. An older version of this patch was submitted here: http://patchwork.ozlabs.org/patch/1205784/ Signed-off-by: Simon Glass <sjg@chromium.org>
2019-12-03common: Move serial_printf() to the serial headerSimon Glass1-0/+1
Move this function header to serial.h since this function is clearly related to serial. The function itself stays in console.c since we don't have a single serial file. DM and non-DM each has a separate file so we would have to either create a new common serial file, or repeat the function in both serial.c and serial-uclass.c, neither of which seem worthwhile. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2019-09-11usb: Add nonblock argument to submit_int_msgMichal Suchanek1-5/+7
This will be used to implement non-blocking keyboard polling in case of errors. Signed-off-by: Michal Suchanek <msuchanek@suse.de>
2019-08-08usb: musb-new: Add support for da8xx-musbAdam Ford3-0/+359
With the recently added phy driver, this patch will enable the musb driver on the da8xx to operate in host mode. Signed-off-by: Adam Ford <aford173@gmail.com>
2019-07-13usb: musb-new: omap2430: Fix compilation warning with USB_MUSB_GADGETDerald D. Woods1-2/+6
This commit addresses the following warning, when _NOT_ USB_MUSB_HOST: [...] CC drivers/usb/gadget/f_mass_storage.o CC drivers/usb/musb-new/omap2430.o CC drivers/usb/gadget/f_fastboot.o CC env/common.o CC env/env.o /src/etinker/software/u-boot-master/drivers/usb/musb-new/omap2430.c: In function ‘omap2430_musb_probe’: /src/etinker/software/u-boot-master/drivers/usb/musb-new/omap2430.c:239:6: warning: assignment to ‘int’ from ‘struct musb *’ makes integer from pointer without a cast [-Wint-conversion] ret = musb_register(&platdata->plat, ^ LD drivers/usb/host/built-in.o CC drivers/usb/gadget/f_sdp.o CC fs/ext4/ext4fs.o [...] Signed-off-by: Derald D. Woods <woods.technical@gmail.com>
2019-04-19usb: Select USB_MUSB_DSPS with USB_MUSB_TIAlex Kiernan1-0/+1
USB_MUSB_TI requires USB_MUSB_DSPS, failing at link time if it's not selected: drivers/usb/musb-new/built-in.o: In function `ti_musb_host_ofdata_to_platdata': drivers/usb/musb-new/ti-musb.c:193: undefined reference to `musb_dsps_ops' or if OF_CONTROL is not selected: arch/arm/mach-omap2/built-in.o:(.data.usb0+0x24): undefined reference to `musb_dsps_ops' Reviewed-by: Hannes Schmelzer <oe5hpm@oevsv.at> Tested-by: Hannes Schmelzer <oe5hpm@oevsv.at> Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
2019-04-19configs: Migrate USB_MUSB_DISABLE_BULK_COMBINE_SPLIT to KconfigAlex Kiernan1-0/+9
Migrate support for disable MUSB bulk split/combine to Kconfig Green Travis build: https://travis-ci.org/akiernan/u-boot/builds/519101867 Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>