Due to the lazy probing, the gadget driver might not be probed when the
u-boot cli is active. In this case the "ums" command won't work, for
example. If enabled, probe the USB gadget during board_init().

Signed-off-by: Michael Walle <mwa...@kernel.org>
---
 board/sunxi/board.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index ed86f1df5dc..7f93aba9ee7 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -189,6 +189,7 @@ enum env_location env_get_location(enum env_operation op, 
int prio)
 int board_init(void)
 {
        __maybe_unused int id_pfr1, ret;
+       struct udevice *dev;
 
        gd->bd->bi_boot_params = (PHYS_SDRAM_0 + 0x100);
 
@@ -225,6 +226,9 @@ int board_init(void)
        if (ret)
                return ret;
 
+       if (CONFIG_IS_ENABLED(USB_GADGET))
+               uclass_get_device(UCLASS_USB_GADGET_GENERIC, 0, &dev);
+
        eth_init_board();
 
        return 0;
-- 
2.39.2

Reply via email to