aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/musb-new
AgeCommit message (Collapse)Author
2021-01-05dm: core: Access device ofnode through functionsSimon Glass
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-13dm: treewide: Rename ..._platdata variables to just ..._platSimon Glass
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-13dm: treewide: Rename ofdata_to_platdata() to of_to_plat()Simon Glass
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-13dm: treewide: Rename dev_get_platdata() to dev_get_plat()Simon Glass
Rename this to be consistent with the change from 'platdata'. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-12-13dm: treewide: Rename 'platdata' variables to just 'plat'Simon Glass
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 Glass
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 Hayama
%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 Anderson
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 Anderson
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 Anderson
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 Delaunay
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 Andrushchenko
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-03usb: Drop dm.h header fileSimon Glass
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-18common: Drop linux/bitops.h from common headerSimon Glass
Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18common: Drop linux/delay.h from common headerSimon Glass
Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18common: Drop linux/bug.h from common headerSimon Glass
Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18common: Drop log.h from common headerSimon Glass
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 Yang
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-05dm: core: Create a new header file for 'compat' featuresSimon Glass
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-05dm: core: Require users of devres to include the headerSimon Glass
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 lee
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-07usb: Drop use of BUG_ON() and WARN_ON()Simon Glass
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-02common: Move serial_printf() to the serial headerSimon Glass
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 Suchanek
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 Ford
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. Woods
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 Kiernan
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 Kiernan
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>
2019-01-18musb-new: sunxi: Use CLK and RESET supportJagan Teki
Now clock and reset drivers are available for respective SoC's so use clk and reset ops on musb driver. Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> Acked-by: Maxime Ripard <maxime.ripard@bootlin.com> Reviewed-by: Marek Vasut <marex@denx.de>
2018-12-14usb: musb-new: sunxi: Fix null pointer accessStefan Mavrodiev
When the device is in peripheral mode there is no struct usb_bus_priv allocated pointer, as the uclass driver ("usb_dev_generic") doesn't call per_device_auto_alloc_size. This results in writing to the internal SDRAM at priv->desc_before_addr = true; Signed-off-by: Stefan Mavrodiev <stefan@olimex.com>
2018-12-14usb: musb-new: Add support for DM_USBJean-Jacques Hiblot
Enable DM for USB peripheral in the musb-new driver. Also make sure that the driver can be used in the SPL. This implies that: * the driver must work with and without the OF_CONTROL option. That in turn, implies that the platform data can be passed in a struct ti_musb_platdata or be read from the dtb * usb.o is linked in the SPL if host support is enabled Another change is that the driver does not fail to bind (and stop the boot process) if one of the child driver does not bind. Reporting the error is enough. This kind of error would appear if the port is configured in the DTS but the driver is not activated in the config. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2018-12-14usb: musb-new: Allow the diver not to use the set_phy_power() callbackJean-Jacques Hiblot
The set_phy_power() callback is part of struct omap_musb_board_data. This structure is part of the platform data passed to the musb-new driver. This does not really fit with the Driver Model, so allow not to use struct omap_musb_board_data to turn the phy on or off. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2018-12-07dm: usb: create a new UCLASS ID for USB gadget devicesJean-Jacques Hiblot
UCLASS_USB_DEV_GENERIC was meant for USB devices connected to host controllers, not gadget devices. Adding a new UCLASS for gadget devices alone. Also move the generic DM code for USB gadgets in a separate file for clarity. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
2018-11-26usb: s/CONFIG_DM_USB/CONFIG_IS_ENABLED(DM_USB)/Sven Schwermer
This allows to disable the USB driver model in SPL because it checks the CONFIG_SPL_DM_USB variable for SPL builds. Nothing changes for regular non-SPL builds. Signed-off-by: Sven Schwermer <sven@svenschwermer.de>
2018-08-24Merge branch 'master' of git://git.denx.de/u-boot-usbTom Rini
2018-08-23usb: musb-new: Call musb_platform_exit from musb_stopJagan Teki
musb stop is musb core call during unregister or shutting down gadget or host musb. For graceful exit add musb_platform_exit on musb_stop so-that it can exit the musb platform driver as well. Tested-by: Chen-Yu Tsai <wens@csie.org> # A33-OlinuXino Tested-by: Jagan Teki <jagan@amarulasolutions.com> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2018-08-23usb: musb-new: sunxi: Add proper musb exit supportJagan Teki
musb have platform ops to do proper graceful exit, so add the exit call and move musb platform exit code instead of keeping it in driver remove. This make proper shutdown of musb where .remove will call disable, exit serially via musb_stop. Tested-by: Chen-Yu Tsai <wens@csie.org> # A33-OlinuXino Tested-by: Jagan Teki <jagan@amarulasolutions.com> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2018-08-23musb-new: sunxi: Access ahb_reset0_cfg via ccm offsetJagan Teki
reset0 is not available for sun4i, 5i and 7i so access the reset0 offset from ccm via driver data for relevant Allwinner SoC. this will eventually drop the existing ifdef for SUN6I. Tested-by: Chen-Yu Tsai <wens@csie.org> # A33-OlinuXino Tested-by: Jagan Teki <jagan@amarulasolutions.com> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2018-08-23usb: musb-new: sunxi: Allocate struct phy in privateJagan Teki
Allocate struct phy in private structure instead of allocating locally and assign it to a pointer. This eventually fix miss alignment phy which is used in another functions. Tested-by: Chen-Yu Tsai <wens@csie.org> # A33-OlinuXino Tested-by: Jagan Teki <jagan@amarulasolutions.com> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2018-08-23usb: musb-new: Fix improper musb host pointerJagan Teki
When MUSB is operating in peripheral mode, probe registering musb core using musb_register which intern return int value for validation. so there is no scope to preserve struct musb pointer but the same can be used in .remove musb_stop. So fix this by return musb_register with struct musb pointer. Cc: Igor Grinberg <grinberg@compulab.co.il> Cc: Purna Chandra Mandal <purna.mandal@microchip.com> Tested-by: Chen-Yu Tsai <wens@csie.org> # A33-OlinuXino Tested-by: Jagan Teki <jagan@amarulasolutions.com> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2018-08-21usb: musb-new: omap2430: Enable DM_USB and OF supportAdam Ford
With upcoming changes that require CONFIG_BLK, this broke USB Mass Storage on the OMAP3 boards because if CONFIG_BLK is enabled, it assumes that DM_USB is enabled, but it wasn't yet available on omap3 and omap4 boards. This patch converts the OMAP2430 MUSB glue to support DM_USB and extracts the necessary information based on the device tree. It's based on the ti-musb driver, but there are enough significant differences in both the architecture and device tree entires between am33xx and OMAP3/OMAP4, that I think it makes sense to continue to keep the separate. Per doc/driver-model/usb-info.txt, the USB gadget stuff hasn't migrated to DM_USB yet, so this only supports USB Host for now. Users wanting USB Gadgets will need to disable DM_USB and leave it the old way for now. Signed-off-by: Adam Ford <aford173@gmail.com>
2018-08-21usb: musb-new: omap2430: Remove dead codeAdam Ford
A bunch of code was encapsulated in #ifdef's whether or not it is building or for U-Boot. Since this code is always building for U-Boot, this patch removes the dead code. Signed-off-by: Adam Ford <aford173@gmail.com>
2018-06-07bug.h: introduce WARN_ONCERamon Fried
Add WARN_ONCE definition to allow single time notification of warnings to the user. Taken from Linux kernel (4.17) with slight changes (Removed __section(.data.once)) Signed-off-by: Ramon Fried <ramon.fried@gmail.com> [trini: Drop the musb and dwc3 compat versions] Signed-off-by: Tom Rini <trini@konsulko.com>
2018-05-28usb: sunxi: Switch to use generic-phyJagan Teki
Allwinner USB PHY handling can be done through driver-model generic-phy so add the generic-phy ops to relevant places on host and musb sunxi driver and enable them in respective SOC's. Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> Acked-by: Jun Nie <jun.nie@linaro.org>
2018-05-28phy: sun4i-usb: Add a sunxi specific function for setting squelch-detectJagan Teki
The sunxi otg phy has a bug where it wrongly detects a high speed squelch when reset on the root port gets de-asserted with a lo-speed device. The workaround for this is to disable squelch detect before de-asserting reset, and re-enabling it after the reset de-assert is done. Add a sunxi specific phy function to allow the sunxi-musb glue to do this. Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> Acked-by: Jun Nie <jun.nie@linaro.org>
2018-05-28musb: sunxi: Add support for H3/H5/A64Jagan Teki
Like other Allwinner SoC, the H3/H5/A64 is missing the config register from the musb hardware block. Use a known working value for it like other SoC. Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> Acked-by: Jun Nie <jun.nie@linaro.org>
2018-05-28musb: sunxi: Use BIT instead of numerical shiftJagan Teki
Use BIT is possible areas instead of numerical shift. Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> Acked-by: Jun Nie <jun.nie@linaro.org>
2018-05-28musb: sunxi: Add OTG device clkgate and reset for H3/H5Jagan Teki
Add OTG device clkgate and reset for H3/H5 through driver_data. Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> Acked-by: Jun Nie <jun.nie@linaro.org>
2018-05-28musb: sunxi: Add fifo configJagan Teki
Unlike other Allwinner SOC's H3/H5/V3s OTG support 4 endpoints with relevant fifo configs, rest all have 5 endpoints. So add the fifo configs and defer them based on driver_data. Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> Acked-by: Jun Nie <jun.nie@linaro.org>
2018-05-28musb: sunxi: Use simple way to fill musb_hdrc pdataJagan Teki
Filling musb_hdrc pdata using structure will unnecessary add extra ifdefs, so fill them inside probe call for better code understanding and get rid ifdefs using devicetree compatible. Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> Acked-by: Jun Nie <jun.nie@linaro.org>