u-boot/common
Fabrice Gasnier ba1fa2abde usb: onboard-hub: add driver to manage onboard hub supplies
The main issue the driver addresses is that a USB hub needs to be
powered before it can be discovered. This is often solved by using
"regulator-always-on".

This driver is inspired by the Linux v6.1 driver. It only enables (or
disables) the hub vdd (3v3) supply, so it can be enumerated.
Scanning of the device tree is done in a similar manner to the sandbox,
by the usb-uclass. DT part looks like:

&usbh_ehci {
	...
	#address-cells = <1>;
	#size-cells = <0>;
	hub@1 {
		compatible = "usb424,2514";
		reg = <1>;
		vdd-supply = <&v3v3>;
	};
};

When the bus gets probed, the driver is automatically probed/removed from
the bus tree, as an example on stm32:
STM32MP> usb start
starting USB...
STM32MP> dm tree
 Class     Index  Probed  Driver                Name
-----------------------------------------------------------
 usb           0  [ + ]   ehci_generic          |   |-- usb@5800d000
 usb_hub       0  [ + ]   usb_onboard_hub       |   |   `-- hub@1
 usb_hub       1  [ + ]   usb_hub               |   |       `-- usb_hub

STM32MP> usb tree
USB device tree:
  1  Hub (480 Mb/s, 0mA)
  |  u-boot EHCI Host Controller
  |
  +-2  Hub (480 Mb/s, 2mA)

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2023-01-12 16:19:53 +01:00
..
eeprom SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
init global: Migrate CONFIG_MALLOC_F_ADDR to CFG 2022-12-23 10:14:51 -05:00
spl Merge branch 'next' 2023-01-09 11:30:08 -05:00
autoboot.c Rename CONFIG_SYS_TEXT_BASE to CONFIG_TEXT_BASE 2022-10-31 11:01:31 -04:00
avb_verify.c avb: Fix error when partition not found 2021-03-17 12:50:19 -04:00
bloblist.c bloblist: Drop debugging 2022-10-31 11:02:44 -04:00
board_f.c global: Migrate CONFIG_PRAM to CFG 2022-12-23 10:15:11 -05:00
board_info.c board-info: Call sysinfo_detect() before sysinfo_get_str() 2021-07-14 16:48:00 -04:00
board_r.c global: Migrate CONFIG_PRAM to CFG 2022-12-23 10:15:11 -05:00
bootstage.c bootstage: Show func name for bootstage_mark/error 2022-08-20 18:07:32 -06:00
bouncebuf.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
cli_hush.c global: Remove undef CONFIG_... for unused values 2022-12-23 10:07:03 -05:00
cli_readline.c Revert "cli_readline: Only insert printable chars" 2022-11-21 09:23:00 -05:00
cli_simple.c cli: Support macro processing with a fixed-size buffer 2020-12-04 16:10:01 -05:00
cli.c fdt: Start a test for the fdt command 2022-07-26 02:30:56 -06:00
command.c doc: replace @return by Return: 2022-01-19 18:11:34 +01:00
console.c console: file should always be non-negative 2022-12-02 19:17:24 +01:00
cros_ec.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
cyclic.c cyclic: get rid of cyclic_init() 2022-11-02 08:42:03 +01:00
ddr_spd.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
dfu.c cyclic: Use schedule() instead of WATCHDOG_RESET() 2022-09-18 10:26:33 +02:00
dlmalloc.c test: Support testing malloc() failures 2022-09-29 16:07:58 -04:00
dlmalloc.src
edid.c doc: replace @return by Return: 2022-01-19 18:11:34 +01:00
event.c event: Add an event for main_loop 2022-10-31 14:47:32 -04:00
exports.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
fdt_simplefb.c video: Rename CONFIG_DM_VIDEO to CONFIG_VIDEO 2022-10-30 20:07:17 +01:00
fdt_support.c global: Move remaining CONFIG_SYS_PCI* to CFG_SYS_PCI* 2022-12-05 16:06:07 -05:00
flash.c Audit <flash.h> inclusion 2022-08-04 16:18:47 -04:00
hash.c doc: replace @return by Return: 2022-01-19 18:11:34 +01:00
hwconfig.c hwconfig: Allow to use restricted env 2022-08-20 18:12:51 -04:00
iomux.c IOMUX: Fix buffer overflow in iomux_replace_device() 2021-04-27 08:05:30 -04:00
iotrace.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
kallsyms.c global: Convert simple_strtoul() with hex to hextoul() 2021-08-02 13:32:14 -04:00
Kconfig sandbox: Move CONFIG_IO_TRACE to Kconfig 2022-12-05 16:07:13 -05:00
kgdb_stubs.c common: Drop asm/ptrace.h from common header 2020-05-18 21:19:23 -04:00
kgdb.c common: board_r: drop initr_kgdb wrapper 2022-01-18 08:31:02 -05:00
log_console.c log: Allow padding of the function name 2021-07-21 10:27:35 -06:00
log_syslog.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
log.c common: Drop display_options.h from common header 2022-08-10 13:46:55 -04:00
main.c efi_loader: split efi_init_obj_list() into two stages 2022-04-23 22:05:41 +02:00
Makefile usb: onboard-hub: add driver to manage onboard hub supplies 2023-01-12 16:19:53 +01:00
malloc_simple.c malloc: Annotate allocator for valgrind 2022-04-11 10:00:30 -04:00
memsize.c Merge branch 'next' 2023-01-09 11:30:08 -05:00
menu.c cyclic: Use schedule() instead of WATCHDOG_RESET() 2022-09-18 10:26:33 +02:00
miiphyutil.c Convert CONFIG_PHY_RESET_DELAY to Kconfig 2022-03-25 12:01:15 +00:00
qfw.c x86: qemu: move QFW to its own uclass 2021-04-12 17:44:55 -04:00
s_record.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
scp03.c common: SCP03 control (enable and provision of keys) 2021-03-13 13:14:52 -05:00
splash_source.c splash: get devpart from environment variable 2022-10-30 20:01:40 +01:00
splash.c video: Rename CONFIG_DM_VIDEO to CONFIG_VIDEO 2022-10-30 20:07:17 +01:00
stackprot.c Add support for stack-protector 2021-04-20 07:31:12 -04:00
stdio.c video: Rename CONFIG_DM_VIDEO to CONFIG_VIDEO 2022-10-30 20:07:17 +01:00
system_map.c
update.c Audit <flash.h> inclusion 2022-08-04 16:18:47 -04:00
usb_hub.c usb: Add missing guard around env_get() in usb_hub 2022-10-10 18:08:18 +02:00
usb_kbd.c cyclic: Use schedule() instead of WATCHDOG_RESET() 2022-09-18 10:26:33 +02:00
usb_onboard_hub.c usb: onboard-hub: add driver to manage onboard hub supplies 2023-01-12 16:19:53 +01:00
usb_storage.c usb: storage: continue probe on "Invalid device" 2022-11-04 12:22:45 +01:00
usb.c usb: Add 1ms delay after first Get Descriptor request 2022-11-03 23:36:48 +01:00
xyzModem.c cyclic: Use schedule() instead of WATCHDOG_RESET() 2022-09-18 10:26:33 +02:00