On 3/18/25 11:46 AM, Jerome Forissier wrote:
To prepare for the introduction of threads in the USB initialization
sequence, move code out of usb_init() into a new helper function:
usb_init_bus(). No functional change.
Signed-off-by: Jerome Forissier <jerome.foriss...@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodi...@linaro.org>
---
drivers/usb/host/usb-uclass.c | 88 +++++++++++++++++++----------------
1 file changed, 48 insertions(+), 40 deletions(-)
diff --git a/drivers/usb/host/usb-uclass.c b/drivers/usb/host/usb-uclass.c
index bfec303e7af..cc803241461 100644
--- a/drivers/usb/host/usb-uclass.c
+++ b/drivers/usb/host/usb-uclass.c
@@ -287,9 +287,55 @@ static int usb_probe_companion(struct udevice *bus)
return 0;
}
+static int controllers_initialized;
I'm afraid this won't work, you will have to track the controllers in a
list somehow, because it is possible to unbind DM devices even using the
'unbind' command from U-Boot command line.
Also, why not simply track the controller state using DM in the first place?