Re: [RFC v1 7/7] usb: onboard-hub: Add conditional compilation for I2C initialization
Hi Quentin, On Tue, 13 May 2025 at 21:52, Quentin Schulz <quentin.schulz@...> wrote: Hi Anand,
On 5/13/25 6:14 PM, Anand Moon wrote:
Hi All,
On Mon, 12 May 2025 at 13:51, Anand Moon via groups.io <linux.amoon@...> wrote:
Hi Quentin,
On Mon, 12 May 2025 at 12:36, Quentin Schulz <quentin.schulz@...> wrote:
Hi Anand,
On 5/9/25 7:45 PM, Anand Moon wrote:
Hi Quentin,
On Fri, 9 May 2025 at 17:21, Quentin Schulz <quentin.schulz@...> wrote:
Hi Neil, Anand,
On 5/9/25 9:57 AM, Neil Armstrong wrote:
On 09/05/2025 09:02, Anand Moon wrote:
Add conditional compilation for the usb5744_i2c_init() function based on the CONFIG_DM_I2C configuration, to avoid compilation failure.
CC net/net-common.o AR net/built-in.o LDS u-boot.lds LD u-boot aarch64-linux-gnu-ld.bfd: common/usb_onboard_hub.o: in function `usb5744_i2c_init': /home/amoon/mainline/u-boot/amlogic/u-boot-maineline/common/ usb_onboard_hub.c:74:(.text.usb5744_i2c_init+0xfc): undefined reference to `i2c_get_chip' aarch64-linux-gnu-ld.bfd: /home/amoon/mainline/u-boot/amlogic/u-boot- maineline/common/usb_onboard_hub.c:89:(.text.usb5744_i2c_init+0x1a0): undefined reference to `dm_i2c_write' aarch64-linux-gnu-ld.bfd: /home/amoon/mainline/u-boot/amlogic/u-boot- maineline/common/usb_onboard_hub.c:96:(.text.usb5744_i2c_init+0x1c8): undefined reference to `dm_i2c_write' aarch64-linux-gnu-ld.bfd: /home/amoon/mainline/u-boot/amlogic/u-boot- maineline/common/usb_onboard_hub.c:104:(.text.usb5744_i2c_init+0x1f0): undefined reference to `dm_i2c_write' Segmentation fault (core dumped) make: *** [Makefile:1824: u-boot] Error 139 make: *** Deleting file 'u-boot'
Signed-off-by: Anand Moon <linux.amoon@...> --- common/usb_onboard_hub.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/common/usb_onboard_hub.c b/common/usb_onboard_hub.c index 1242513c631..92e3f3a92c9 100644 --- a/common/usb_onboard_hub.c +++ b/common/usb_onboard_hub.c @@ -30,6 +30,7 @@ struct onboard_hub_data { int (*init)(struct udevice *dev); }; +#if CONFIG_IS_ENABLED(DM_I2C) static int usb5744_i2c_init(struct udevice *dev) { /* @@ -109,6 +110,7 @@ static int usb5744_i2c_init(struct udevice *dev) return 0; } +#endif int usb_onboard_hub_reset(struct udevice *dev) { @@ -222,7 +224,9 @@ static const struct onboard_hub_data usb2514_data = { }; static const struct onboard_hub_data usb5744_data = { +#if CONFIG_IS_ENABLED(DM_I2C) .init = usb5744_i2c_init, +#endif .power_on_delay_us = 1000, .reset_us = 5, }; I think you should completely disable usb5744_data in this case
I would recommend to go the same route as the Linux kernel which has a special Kconfig option for it, c.f. USB_ONBOARD_DEV_USB5744 which adds the necessary dependencies.
On Linux kernel, it needs to parse the device node with i2c-bus.
Seems like it does in U-Boot too? c.f. usb5744_i2c_init() with dev_read_phandle_with_args with i2c-bus?
ok.
We probably should be careful and figure out which boards are actually using the usb5744 and add this symbol to their defconfig so they don't regress.
From my initial analysis configs/xilinx_zynqmp_kria_defconfig which use CONFIG_USB_ONBOARD_HUB I believe using DM_I2C to guard the code is the best approach. it should be around .init() callback to guard this to work.
I disagree. The driver clearly supports the USB5744 and the driver is compiled regardless of DM_I2C support which is required (as far as I understood, maybe that's incorrect?) for being able to use USB5744? I don't like hidden dependencies.
Okay, I will add a new configuration option to guard the code as done in the Linux kernel.
Also, I believe Neil's point is we shouldn't try to probe the USB5744 if there is no DM_I2C support, simply excluding .init() callback will probably just render this "support" of USB5744 non-functional?
Let me debug this more, I will update the next version. I need to check if this binds correctly to the USB hub reset. I am trying to get the usb_onboard_hub to bind. but this driver is not getting probed in the first place, I am missing some configuration to get this working.
Don't know your setup, but maybe have a look at
?
Thank you for the tip. I've incorporated all the changes as suggested in this series. However, I'm still unable to get the usb_onboard_hub_probe to execute, which is preventing me from further debugging. Cheers, Quentin
Thanks -Anand
|
Re: [RFC v1 7/7] usb: onboard-hub: Add conditional compilation for I2C initialization
Hi All, On Mon, 12 May 2025 at 13:51, Anand Moon via groups.io <linux.amoon@...> wrote: Hi Quentin,
On Mon, 12 May 2025 at 12:36, Quentin Schulz <quentin.schulz@...> wrote:
Hi Anand,
On 5/9/25 7:45 PM, Anand Moon wrote:
Hi Quentin,
On Fri, 9 May 2025 at 17:21, Quentin Schulz <quentin.schulz@...> wrote:
Hi Neil, Anand,
On 5/9/25 9:57 AM, Neil Armstrong wrote:
On 09/05/2025 09:02, Anand Moon wrote:
Add conditional compilation for the usb5744_i2c_init() function based on the CONFIG_DM_I2C configuration, to avoid compilation failure.
CC net/net-common.o AR net/built-in.o LDS u-boot.lds LD u-boot aarch64-linux-gnu-ld.bfd: common/usb_onboard_hub.o: in function `usb5744_i2c_init': /home/amoon/mainline/u-boot/amlogic/u-boot-maineline/common/ usb_onboard_hub.c:74:(.text.usb5744_i2c_init+0xfc): undefined reference to `i2c_get_chip' aarch64-linux-gnu-ld.bfd: /home/amoon/mainline/u-boot/amlogic/u-boot- maineline/common/usb_onboard_hub.c:89:(.text.usb5744_i2c_init+0x1a0): undefined reference to `dm_i2c_write' aarch64-linux-gnu-ld.bfd: /home/amoon/mainline/u-boot/amlogic/u-boot- maineline/common/usb_onboard_hub.c:96:(.text.usb5744_i2c_init+0x1c8): undefined reference to `dm_i2c_write' aarch64-linux-gnu-ld.bfd: /home/amoon/mainline/u-boot/amlogic/u-boot- maineline/common/usb_onboard_hub.c:104:(.text.usb5744_i2c_init+0x1f0): undefined reference to `dm_i2c_write' Segmentation fault (core dumped) make: *** [Makefile:1824: u-boot] Error 139 make: *** Deleting file 'u-boot'
Signed-off-by: Anand Moon <linux.amoon@...> --- common/usb_onboard_hub.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/common/usb_onboard_hub.c b/common/usb_onboard_hub.c index 1242513c631..92e3f3a92c9 100644 --- a/common/usb_onboard_hub.c +++ b/common/usb_onboard_hub.c @@ -30,6 +30,7 @@ struct onboard_hub_data { int (*init)(struct udevice *dev); }; +#if CONFIG_IS_ENABLED(DM_I2C) static int usb5744_i2c_init(struct udevice *dev) { /* @@ -109,6 +110,7 @@ static int usb5744_i2c_init(struct udevice *dev) return 0; } +#endif int usb_onboard_hub_reset(struct udevice *dev) { @@ -222,7 +224,9 @@ static const struct onboard_hub_data usb2514_data = { }; static const struct onboard_hub_data usb5744_data = { +#if CONFIG_IS_ENABLED(DM_I2C) .init = usb5744_i2c_init, +#endif .power_on_delay_us = 1000, .reset_us = 5, }; I think you should completely disable usb5744_data in this case
I would recommend to go the same route as the Linux kernel which has a special Kconfig option for it, c.f. USB_ONBOARD_DEV_USB5744 which adds the necessary dependencies.
On Linux kernel, it needs to parse the device node with i2c-bus.
Seems like it does in U-Boot too? c.f. usb5744_i2c_init() with dev_read_phandle_with_args with i2c-bus?
ok.
We probably should be careful and figure out which boards are actually using the usb5744 and add this symbol to their defconfig so they don't regress.
From my initial analysis configs/xilinx_zynqmp_kria_defconfig which use CONFIG_USB_ONBOARD_HUB I believe using DM_I2C to guard the code is the best approach. it should be around .init() callback to guard this to work.
I disagree. The driver clearly supports the USB5744 and the driver is compiled regardless of DM_I2C support which is required (as far as I understood, maybe that's incorrect?) for being able to use USB5744? I don't like hidden dependencies.
Okay, I will add a new configuration option to guard the code as done in the Linux kernel.
Also, I believe Neil's point is we shouldn't try to probe the USB5744 if there is no DM_I2C support, simply excluding .init() callback will probably just render this "support" of USB5744 non-functional?
Let me debug this more, I will update the next version. I need to check if this binds correctly to the USB hub reset.
I am trying to get the usb_onboard_hub to bind. but this driver is not getting probed in the first place, I am missing some configuration to get this working. Hit any key to stop autoboot: 0 => usb start starting USB... Register 3000140 NbrPorts 3 Starting the controller USB XHCI 1.10 Bus usb@ff500000: 4 USB Device(s) found scanning usb for storage devices... 1 Storage Device(s) found => dm tree ... mmc 1 [ + ] meson_gx_mmc | |-- mmc@ffe07000 blk 1 [ ] mmc_blk | | |-- mmc@... bootdev 2 [ ] mmc_bootdev | | `-- mmc@... simple_bus 11 [ + ] dwc3-meson-g12a | `-- usb@ffe09000 usb_gadget 0 [ ] dwc2-udc-otg | |-- usb@ff400000 usb 0 [ + ] xhci-dwc3 | `-- usb@ff500000 usb_hub 0 [ + ] usb_hub | `-- usb_hub usb_hub 1 [ + ] usb_hub | |-- usb_hub usb_hub 2 [ + ] usb_hub | `-- usb_hub usb_mass_s 0 [ + ] usb_mass_storage | `-- usb_mass_storage blk 2 [ + ] usb_storage_blk | |-- usb_mass_storage.lun0 partition 0 [ + ] blk_partition | | `-- usb_mass_storage.lun0:1 bootdev 3 [ ] usb_bootdev | `-- usb_mass_storage.lun0.bootdev clk 2 [ + ] fixed_clock |-- xtal-clk Thanks -Anand
|
Re: [RFC v1 7/7] usb: onboard-hub: Add conditional compilation for I2C initialization
Hi Anand, On 5/9/25 7:45 PM, Anand Moon wrote: Hi Quentin, On Fri, 9 May 2025 at 17:21, Quentin Schulz <quentin.schulz@...> wrote:
Hi Neil, Anand,
On 5/9/25 9:57 AM, Neil Armstrong wrote:
On 09/05/2025 09:02, Anand Moon wrote:
Add conditional compilation for the usb5744_i2c_init() function based on the CONFIG_DM_I2C configuration, to avoid compilation failure.
CC net/net-common.o AR net/built-in.o LDS u-boot.lds LD u-boot aarch64-linux-gnu-ld.bfd: common/usb_onboard_hub.o: in function `usb5744_i2c_init': /home/amoon/mainline/u-boot/amlogic/u-boot-maineline/common/ usb_onboard_hub.c:74:(.text.usb5744_i2c_init+0xfc): undefined reference to `i2c_get_chip' aarch64-linux-gnu-ld.bfd: /home/amoon/mainline/u-boot/amlogic/u-boot- maineline/common/usb_onboard_hub.c:89:(.text.usb5744_i2c_init+0x1a0): undefined reference to `dm_i2c_write' aarch64-linux-gnu-ld.bfd: /home/amoon/mainline/u-boot/amlogic/u-boot- maineline/common/usb_onboard_hub.c:96:(.text.usb5744_i2c_init+0x1c8): undefined reference to `dm_i2c_write' aarch64-linux-gnu-ld.bfd: /home/amoon/mainline/u-boot/amlogic/u-boot- maineline/common/usb_onboard_hub.c:104:(.text.usb5744_i2c_init+0x1f0): undefined reference to `dm_i2c_write' Segmentation fault (core dumped) make: *** [Makefile:1824: u-boot] Error 139 make: *** Deleting file 'u-boot'
Signed-off-by: Anand Moon <linux.amoon@...> --- common/usb_onboard_hub.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/common/usb_onboard_hub.c b/common/usb_onboard_hub.c index 1242513c631..92e3f3a92c9 100644 --- a/common/usb_onboard_hub.c +++ b/common/usb_onboard_hub.c @@ -30,6 +30,7 @@ struct onboard_hub_data { int (*init)(struct udevice *dev); }; +#if CONFIG_IS_ENABLED(DM_I2C) static int usb5744_i2c_init(struct udevice *dev) { /* @@ -109,6 +110,7 @@ static int usb5744_i2c_init(struct udevice *dev) return 0; } +#endif int usb_onboard_hub_reset(struct udevice *dev) { @@ -222,7 +224,9 @@ static const struct onboard_hub_data usb2514_data = { }; static const struct onboard_hub_data usb5744_data = { +#if CONFIG_IS_ENABLED(DM_I2C) .init = usb5744_i2c_init, +#endif .power_on_delay_us = 1000, .reset_us = 5, }; I think you should completely disable usb5744_data in this case
I would recommend to go the same route as the Linux kernel which has a special Kconfig option for it, c.f. USB_ONBOARD_DEV_USB5744 which adds the necessary dependencies.
On Linux kernel, it needs to parse the device node with i2c-bus.
Seems like it does in U-Boot too? c.f. usb5744_i2c_init() with dev_read_phandle_with_args with i2c-bus? We probably should be careful and figure out which boards are actually using the usb5744 and add this symbol to their defconfig so they don't regress.
From my initial analysis configs/xilinx_zynqmp_kria_defconfig which use CONFIG_USB_ONBOARD_HUB I believe using DM_I2C to guard the code is the best approach. it should be around .init() callback to guard this to work.
I disagree. The driver clearly supports the USB5744 and the driver is compiled regardless of DM_I2C support which is required (as far as I understood, maybe that's incorrect?) for being able to use USB5744? I don't like hidden dependencies. Also, I believe Neil's point is we shouldn't try to probe the USB5744 if there is no DM_I2C support, simply excluding .init() callback will probably just render this "support" of USB5744 non-functional? Cheers, Quentin Cheers, Quentin Thanks -Anand
|
Re: Odroid n2+ usb broken on reboot
Applied patches to 2025.04 release (applied clean). Made stock defconfig for odroid n2, built, signed, installed. The reboot issue remains and usb ports are unavailable to linux kernel after reboot.
It is worth noting that linux does see some enumeration of devices after a while, but even if it logs to the console about device attachment, the devices don't actually function. This was the same behavior with the release version.
Wayne
toggle quoted message
Show quoted text
On Fri, May 9, 2025 at 10:01?AM Wayne Schroeder <raz@...> wrote: Yes. Will report back how it works on the n2+.
On Fri, May 9, 2025 at 2:08?AM Anand Moon <linux.amoon@...> wrote:
Hi Wayne,
On Fri, 9 May 2025 at 01:25, Wayne Schroeder <raz@...> wrote:
I actually already have a working solution that I documented in my github repo (dubschro/odroid-n2). All I do is set BOOTCOMMAND to check/delete a flag file on my boot partition and if it is found, then reset usb and sleep for 10 seconds. I then have a systemd shutdown script only on reboot to touch that file.
CONFIG_BOOTCOMMAND="fatrm mmc 0:1 reboot && echo Resetting USB on reboot... && usb reset && sleep 10; run distro_bootcmd"
It is a hack, but... the system reliably reboots remotely now, and that's the important part for now.
Wayne
On Thu, May 8, 2025 at 11:22?AM Ferass El Hafidi <funderscore@...> wrote:
On Wed May 7, 2025 at 1:03 PM UTC, Wayne Schroeder wrote:
It's hard for me to quantify if usb works in u-boot as I'm not loading off of any usb storage devices. It certainly never lets me use the keyboard to abort auto boot, and never has. On reboot, to reliably You can send bytes via UART to abort boot, if you happen to have a UART adapter around.
Can you test this series to see if this resolves the issue?
Thanks -Anand
_______________________________________________ linux-amlogic mailing list linux-amlogic@...
|
Re: Odroid n2+ usb broken on reboot
Yes. Will report back how it works on the n2+.
toggle quoted message
Show quoted text
On Fri, May 9, 2025 at 2:08?AM Anand Moon <linux.amoon@...> wrote: Hi Wayne,
On Fri, 9 May 2025 at 01:25, Wayne Schroeder <raz@...> wrote:
I actually already have a working solution that I documented in my github repo (dubschro/odroid-n2). All I do is set BOOTCOMMAND to check/delete a flag file on my boot partition and if it is found, then reset usb and sleep for 10 seconds. I then have a systemd shutdown script only on reboot to touch that file.
CONFIG_BOOTCOMMAND="fatrm mmc 0:1 reboot && echo Resetting USB on reboot... && usb reset && sleep 10; run distro_bootcmd"
It is a hack, but... the system reliably reboots remotely now, and that's the important part for now.
Wayne
On Thu, May 8, 2025 at 11:22?AM Ferass El Hafidi <funderscore@...> wrote:
On Wed May 7, 2025 at 1:03 PM UTC, Wayne Schroeder wrote:
It's hard for me to quantify if usb works in u-boot as I'm not loading off of any usb storage devices. It certainly never lets me use the keyboard to abort auto boot, and never has. On reboot, to reliably You can send bytes via UART to abort boot, if you happen to have a UART adapter around.
Can you test this series to see if this resolves the issue?
Thanks -Anand
_______________________________________________ linux-amlogic mailing list linux-amlogic@...
|
Re: Odroid n2+ usb broken on reboot
Hi Christian, On Mon, 12 May 2025 at 15:05, Christian Hewitt <christianshewitt@...> wrote:
On 12 May 2025, at 10:59?am, Anand Moon via groups.io <linux.amoon@...> wrote:
Hi Wayne,
On Sun, 11 May 2025 at 01:51, Wayne Schroeder <raz@...> wrote:
Applied patches to 2025.04 release (applied clean). Made stock defconfig for odroid n2, built, signed, installed. The reboot issue remains and usb ports are unavailable to linux kernel after reboot.
It is worth noting that linux does see some enumeration of devices after a while, but even if it logs to the console about device attachment, the devices don't actually function. This was the same behavior with the release version.
Thanks for testing these patches. We need to modify the boot order to probe USB before MMC Why? Most Amlogic boards boot from an mmc device (SD or internal flash storage) not USB. It smells like a workaround not a fix, and I wonder what the performance impact on boot will be?
I'm providing a solution that may not apply to all Amlogic boards. The goal is to ensure the USB device binds early, allowing the USB keyboard and mass storage device to be detected promptly. However, I'm unsure if booting from USB mass storage is supported. Thanks -Anand Christian
diff --git a/include/configs/meson64.h b/include/configs/meson64.h index f3275b37a51..3ace59880bd 100644 --- a/include/configs/meson64.h +++ b/include/configs/meson64.h @@ -119,8 +119,8 @@ #define BOOT_TARGET_DEVICES(func) \ func(ROMUSB, romusb, na) \ func(USB_DFU, usbdfu, na) \ - BOOT_TARGET_MMC(func) \ BOOT_TARGET_DEVICES_USB(func) \ + BOOT_TARGET_MMC(func) \ BOOT_TARGET_NVME(func) \ BOOT_TARGET_SCSI(func) \ BOOT_TARGET_PXE(func) \
Here is the boot sequence at my end. ------------------------ U-Boot 2025.07-rc1-00223-g704a4d1fd804 (May 12 2025 - 12:15:29 +0530) odroid-n2/n2-plus
Model: Hardkernel ODROID-N2 SoC: Amlogic Meson G12B (S922X) Revision 29:c (40:2) DRAM: 1 GiB (total 3.8 GiB) Core: 402 devices, 30 uclasses, devicetree: separate MMC: mmc@ffe05000: 0, mmc@ffe07000: 1 Loading Environment from nowhere... OK In: usbkbd,serial Out: vidconsole,serial Err: vidconsole,serial Board variant: n2-plus Net: eth0: ethernet@ff3f0000
Hit any key to stop autoboot: 0 starting USB... Register 3000140 NbrPorts 3 Starting the controller USB XHCI 1.10 Bus usb@ff500000: 4 USB Device(s) found scanning usb for storage devices... 1 Storage Device(s) found
Device 0: Vendor: ASMT Rev: 0 Prod: 2115 Type: Hard Disk Capacity: 114473.4 MB = 111.7 GB (234441648 x 512) ... is now current device Scanning usb 0:1... Card did not respond to voltage select! : -110 Cannot persist EFI variables without system partition Loading Boot0000 'mmc 1' failed Loading Boot0001 'usb 0' failed EFI boot manager: Cannot load any image Card did not respond to voltage select! : -110 switch to partitions #0, OK mmc1(part 0) is current device Scanning mmc 1:1... Found /extlinux/extlinux.conf Retrieving file: /extlinux/extlinux.conf 1: Manjaro ARM Retrieving file: /Image Retrieving file: /initramfs-linux.img append: initrd=/initramfs-linux.img console=ttyAML0,115200n8 root=PARTUUID=0efc7c36-02 rootwait audit=0 clk_ignore_unused plymouth.ignore-serial-consoles
Wayne
On Fri, May 9, 2025 at 10:01?AM Wayne Schroeder <raz@...> wrote:
Yes. Will report back how it works on the n2+.
On Fri, May 9, 2025 at 2:08?AM Anand Moon <linux.amoon@...> wrote:
Hi Wayne,
On Fri, 9 May 2025 at 01:25, Wayne Schroeder <raz@...> wrote:
I actually already have a working solution that I documented in my github repo (dubschro/odroid-n2). All I do is set BOOTCOMMAND to check/delete a flag file on my boot partition and if it is found, then reset usb and sleep for 10 seconds. I then have a systemd shutdown script only on reboot to touch that file.
CONFIG_BOOTCOMMAND="fatrm mmc 0:1 reboot && echo Resetting USB on reboot... && usb reset && sleep 10; run distro_bootcmd"
It is a hack, but... the system reliably reboots remotely now, and that's the important part for now.
Wayne
I did not modify this at my end. However, this is not required with the above fix.
Thanks -Anand
On Thu, May 8, 2025 at 11:22?AM Ferass El Hafidi <funderscore@...> wrote:
On Wed May 7, 2025 at 1:03 PM UTC, Wayne Schroeder wrote:
It's hard for me to quantify if usb works in u-boot as I'm not loading off of any usb storage devices. It certainly never lets me use the keyboard to abort auto boot, and never has. On reboot, to reliably You can send bytes via UART to abort boot, if you happen to have a UART adapter around.
Can you test this series to see if this resolves the issue?
Thanks -Anand
_______________________________________________ linux-amlogic mailing list linux-amlogic@...
|
Re: Odroid n2+ usb broken on reboot
On 12 May 2025, at 10:59?am, Anand Moon via groups.io <linux.amoon@...> wrote:
Hi Wayne,
On Sun, 11 May 2025 at 01:51, Wayne Schroeder <raz@...> wrote:
Applied patches to 2025.04 release (applied clean). Made stock defconfig for odroid n2, built, signed, installed. The reboot issue remains and usb ports are unavailable to linux kernel after reboot.
It is worth noting that linux does see some enumeration of devices after a while, but even if it logs to the console about device attachment, the devices don't actually function. This was the same behavior with the release version.
Thanks for testing these patches. We need to modify the boot order to probe USB before MMC Why? Most Amlogic boards boot from an mmc device (SD or internal flash storage) not USB. It smells like a workaround not a fix, and I wonder what the performance impact on boot will be? Christian diff --git a/include/configs/meson64.h b/include/configs/meson64.h index f3275b37a51..3ace59880bd 100644 --- a/include/configs/meson64.h +++ b/include/configs/meson64.h @@ -119,8 +119,8 @@ #define BOOT_TARGET_DEVICES(func) \ func(ROMUSB, romusb, na) \ func(USB_DFU, usbdfu, na) \ - BOOT_TARGET_MMC(func) \ BOOT_TARGET_DEVICES_USB(func) \ + BOOT_TARGET_MMC(func) \ BOOT_TARGET_NVME(func) \ BOOT_TARGET_SCSI(func) \ BOOT_TARGET_PXE(func) \
Here is the boot sequence at my end. ------------------------ U-Boot 2025.07-rc1-00223-g704a4d1fd804 (May 12 2025 - 12:15:29 +0530) odroid-n2/n2-plus
Model: Hardkernel ODROID-N2 SoC: Amlogic Meson G12B (S922X) Revision 29:c (40:2) DRAM: 1 GiB (total 3.8 GiB) Core: 402 devices, 30 uclasses, devicetree: separate MMC: mmc@ffe05000: 0, mmc@ffe07000: 1 Loading Environment from nowhere... OK In: usbkbd,serial Out: vidconsole,serial Err: vidconsole,serial Board variant: n2-plus Net: eth0: ethernet@ff3f0000
Hit any key to stop autoboot: 0 starting USB... Register 3000140 NbrPorts 3 Starting the controller USB XHCI 1.10 Bus usb@ff500000: 4 USB Device(s) found scanning usb for storage devices... 1 Storage Device(s) found
Device 0: Vendor: ASMT Rev: 0 Prod: 2115 Type: Hard Disk Capacity: 114473.4 MB = 111.7 GB (234441648 x 512) ... is now current device Scanning usb 0:1... Card did not respond to voltage select! : -110 Cannot persist EFI variables without system partition Loading Boot0000 'mmc 1' failed Loading Boot0001 'usb 0' failed EFI boot manager: Cannot load any image Card did not respond to voltage select! : -110 switch to partitions #0, OK mmc1(part 0) is current device Scanning mmc 1:1... Found /extlinux/extlinux.conf Retrieving file: /extlinux/extlinux.conf 1: Manjaro ARM Retrieving file: /Image Retrieving file: /initramfs-linux.img append: initrd=/initramfs-linux.img console=ttyAML0,115200n8 root=PARTUUID=0efc7c36-02 rootwait audit=0 clk_ignore_unused plymouth.ignore-serial-consoles
Wayne
On Fri, May 9, 2025 at 10:01?AM Wayne Schroeder <raz@...> wrote:
Yes. Will report back how it works on the n2+.
On Fri, May 9, 2025 at 2:08?AM Anand Moon <linux.amoon@...> wrote:
Hi Wayne,
On Fri, 9 May 2025 at 01:25, Wayne Schroeder <raz@...> wrote:
I actually already have a working solution that I documented in my github repo (dubschro/odroid-n2). All I do is set BOOTCOMMAND to check/delete a flag file on my boot partition and if it is found, then reset usb and sleep for 10 seconds. I then have a systemd shutdown script only on reboot to touch that file.
CONFIG_BOOTCOMMAND="fatrm mmc 0:1 reboot && echo Resetting USB on reboot... && usb reset && sleep 10; run distro_bootcmd"
It is a hack, but... the system reliably reboots remotely now, and that's the important part for now.
Wayne
I did not modify this at my end. However, this is not required with the above fix.
Thanks -Anand
On Thu, May 8, 2025 at 11:22?AM Ferass El Hafidi <funderscore@...> wrote:
On Wed May 7, 2025 at 1:03 PM UTC, Wayne Schroeder wrote:
It's hard for me to quantify if usb works in u-boot as I'm not loading off of any usb storage devices. It certainly never lets me use the keyboard to abort auto boot, and never has. On reboot, to reliably You can send bytes via UART to abort boot, if you happen to have a UART adapter around.
Can you test this series to see if this resolves the issue?
Thanks -Anand
_______________________________________________ linux-amlogic mailing list linux-amlogic@...
|
Re: [RFC v1 7/7] usb: onboard-hub: Add conditional compilation for I2C initialization
Hi Quentin, On Mon, 12 May 2025 at 12:36, Quentin Schulz <quentin.schulz@...> wrote: Hi Anand,
On 5/9/25 7:45 PM, Anand Moon wrote:
Hi Quentin,
On Fri, 9 May 2025 at 17:21, Quentin Schulz <quentin.schulz@...> wrote:
Hi Neil, Anand,
On 5/9/25 9:57 AM, Neil Armstrong wrote:
On 09/05/2025 09:02, Anand Moon wrote:
Add conditional compilation for the usb5744_i2c_init() function based on the CONFIG_DM_I2C configuration, to avoid compilation failure.
CC net/net-common.o AR net/built-in.o LDS u-boot.lds LD u-boot aarch64-linux-gnu-ld.bfd: common/usb_onboard_hub.o: in function `usb5744_i2c_init': /home/amoon/mainline/u-boot/amlogic/u-boot-maineline/common/ usb_onboard_hub.c:74:(.text.usb5744_i2c_init+0xfc): undefined reference to `i2c_get_chip' aarch64-linux-gnu-ld.bfd: /home/amoon/mainline/u-boot/amlogic/u-boot- maineline/common/usb_onboard_hub.c:89:(.text.usb5744_i2c_init+0x1a0): undefined reference to `dm_i2c_write' aarch64-linux-gnu-ld.bfd: /home/amoon/mainline/u-boot/amlogic/u-boot- maineline/common/usb_onboard_hub.c:96:(.text.usb5744_i2c_init+0x1c8): undefined reference to `dm_i2c_write' aarch64-linux-gnu-ld.bfd: /home/amoon/mainline/u-boot/amlogic/u-boot- maineline/common/usb_onboard_hub.c:104:(.text.usb5744_i2c_init+0x1f0): undefined reference to `dm_i2c_write' Segmentation fault (core dumped) make: *** [Makefile:1824: u-boot] Error 139 make: *** Deleting file 'u-boot'
Signed-off-by: Anand Moon <linux.amoon@...> --- common/usb_onboard_hub.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/common/usb_onboard_hub.c b/common/usb_onboard_hub.c index 1242513c631..92e3f3a92c9 100644 --- a/common/usb_onboard_hub.c +++ b/common/usb_onboard_hub.c @@ -30,6 +30,7 @@ struct onboard_hub_data { int (*init)(struct udevice *dev); }; +#if CONFIG_IS_ENABLED(DM_I2C) static int usb5744_i2c_init(struct udevice *dev) { /* @@ -109,6 +110,7 @@ static int usb5744_i2c_init(struct udevice *dev) return 0; } +#endif int usb_onboard_hub_reset(struct udevice *dev) { @@ -222,7 +224,9 @@ static const struct onboard_hub_data usb2514_data = { }; static const struct onboard_hub_data usb5744_data = { +#if CONFIG_IS_ENABLED(DM_I2C) .init = usb5744_i2c_init, +#endif .power_on_delay_us = 1000, .reset_us = 5, }; I think you should completely disable usb5744_data in this case
I would recommend to go the same route as the Linux kernel which has a special Kconfig option for it, c.f. USB_ONBOARD_DEV_USB5744 which adds the necessary dependencies.
On Linux kernel, it needs to parse the device node with i2c-bus.
Seems like it does in U-Boot too? c.f. usb5744_i2c_init() with dev_read_phandle_with_args with i2c-bus?
ok. We probably should be careful and figure out which boards are actually using the usb5744 and add this symbol to their defconfig so they don't regress.
From my initial analysis configs/xilinx_zynqmp_kria_defconfig which use CONFIG_USB_ONBOARD_HUB I believe using DM_I2C to guard the code is the best approach. it should be around .init() callback to guard this to work.
I disagree. The driver clearly supports the USB5744 and the driver is compiled regardless of DM_I2C support which is required (as far as I understood, maybe that's incorrect?) for being able to use USB5744? I don't like hidden dependencies.
Okay, I will add a new configuration option to guard the code as done in the Linux kernel. Also, I believe Neil's point is we shouldn't try to probe the USB5744 if there is no DM_I2C support, simply excluding .init() callback will probably just render this "support" of USB5744 non-functional?
Let me debug this more, I will update the next version. I need to check if this binds correctly to the USB hub reset. Cheers, Quentin Thanks -Anand
|
Re: Odroid n2+ usb broken on reboot
Hi Wayne, On Sun, 11 May 2025 at 01:51, Wayne Schroeder <raz@...> wrote: Applied patches to 2025.04 release (applied clean). Made stock defconfig for odroid n2, built, signed, installed. The reboot issue remains and usb ports are unavailable to linux kernel after reboot.
It is worth noting that linux does see some enumeration of devices after a while, but even if it logs to the console about device attachment, the devices don't actually function. This was the same behavior with the release version.
Thanks for testing these patches. We need to modify the boot order to probe USB before MMC diff --git a/include/configs/meson64.h b/include/configs/meson64.h index f3275b37a51..3ace59880bd 100644 --- a/include/configs/meson64.h +++ b/include/configs/meson64.h @@ -119,8 +119,8 @@ #define BOOT_TARGET_DEVICES(func) \ func(ROMUSB, romusb, na) \ func(USB_DFU, usbdfu, na) \ - BOOT_TARGET_MMC(func) \ BOOT_TARGET_DEVICES_USB(func) \ + BOOT_TARGET_MMC(func) \ BOOT_TARGET_NVME(func) \ BOOT_TARGET_SCSI(func) \ BOOT_TARGET_PXE(func) \ Here is the boot sequence at my end. ------------------------ U-Boot 2025.07-rc1-00223-g704a4d1fd804 (May 12 2025 - 12:15:29 +0530) odroid-n2/n2-plus Model: Hardkernel ODROID-N2 SoC: Amlogic Meson G12B (S922X) Revision 29:c (40:2) DRAM: 1 GiB (total 3.8 GiB) Core: 402 devices, 30 uclasses, devicetree: separate MMC: mmc@ffe05000: 0, mmc@ffe07000: 1 Loading Environment from nowhere... OK In: usbkbd,serial Out: vidconsole,serial Err: vidconsole,serial Board variant: n2-plus Net: eth0: ethernet@ff3f0000 Hit any key to stop autoboot: 0 starting USB... Register 3000140 NbrPorts 3 Starting the controller USB XHCI 1.10 Bus usb@ff500000: 4 USB Device(s) found scanning usb for storage devices... 1 Storage Device(s) found Device 0: Vendor: ASMT Rev: 0 Prod: 2115 Type: Hard Disk Capacity: 114473.4 MB = 111.7 GB (234441648 x 512) ... is now current device Scanning usb 0:1... Card did not respond to voltage select! : -110 Cannot persist EFI variables without system partition Loading Boot0000 'mmc 1' failed Loading Boot0001 'usb 0' failed EFI boot manager: Cannot load any image Card did not respond to voltage select! : -110 switch to partitions #0, OK mmc1(part 0) is current device Scanning mmc 1:1... Found /extlinux/extlinux.conf Retrieving file: /extlinux/extlinux.conf 1: Manjaro ARM Retrieving file: /Image Retrieving file: /initramfs-linux.img append: initrd=/initramfs-linux.img console=ttyAML0,115200n8 root=PARTUUID=0efc7c36-02 rootwait audit=0 clk_ignore_unused plymouth.ignore-serial-consoles Wayne
On Fri, May 9, 2025 at 10:01?AM Wayne Schroeder <raz@...> wrote:
Yes. Will report back how it works on the n2+.
On Fri, May 9, 2025 at 2:08?AM Anand Moon <linux.amoon@...> wrote:
Hi Wayne,
On Fri, 9 May 2025 at 01:25, Wayne Schroeder <raz@...> wrote:
I actually already have a working solution that I documented in my github repo (dubschro/odroid-n2). All I do is set BOOTCOMMAND to check/delete a flag file on my boot partition and if it is found, then reset usb and sleep for 10 seconds. I then have a systemd shutdown script only on reboot to touch that file.
CONFIG_BOOTCOMMAND="fatrm mmc 0:1 reboot && echo Resetting USB on reboot... && usb reset && sleep 10; run distro_bootcmd"
It is a hack, but... the system reliably reboots remotely now, and that's the important part for now.
Wayne
I did not modify this at my end. However, this is not required with the above fix. Thanks -Anand On Thu, May 8, 2025 at 11:22?AM Ferass El Hafidi <funderscore@...> wrote:
On Wed May 7, 2025 at 1:03 PM UTC, Wayne Schroeder wrote:
It's hard for me to quantify if usb works in u-boot as I'm not loading off of any usb storage devices. It certainly never lets me use the keyboard to abort auto boot, and never has. On reboot, to reliably You can send bytes via UART to abort boot, if you happen to have a UART adapter around.
Can you test this series to see if this resolves the issue?
Thanks -Anand
_______________________________________________ linux-amlogic mailing list linux-amlogic@...
|
Re: [RFC v1 7/7] usb: onboard-hub: Add conditional compilation for I2C initialization
Hi Quentin, On Fri, 9 May 2025 at 17:21, Quentin Schulz <quentin.schulz@...> wrote: Hi Neil, Anand,
On 5/9/25 9:57 AM, Neil Armstrong wrote:
On 09/05/2025 09:02, Anand Moon wrote:
Add conditional compilation for the usb5744_i2c_init() function based on the CONFIG_DM_I2C configuration, to avoid compilation failure.
CC net/net-common.o AR net/built-in.o LDS u-boot.lds LD u-boot aarch64-linux-gnu-ld.bfd: common/usb_onboard_hub.o: in function `usb5744_i2c_init': /home/amoon/mainline/u-boot/amlogic/u-boot-maineline/common/ usb_onboard_hub.c:74:(.text.usb5744_i2c_init+0xfc): undefined reference to `i2c_get_chip' aarch64-linux-gnu-ld.bfd: /home/amoon/mainline/u-boot/amlogic/u-boot- maineline/common/usb_onboard_hub.c:89:(.text.usb5744_i2c_init+0x1a0): undefined reference to `dm_i2c_write' aarch64-linux-gnu-ld.bfd: /home/amoon/mainline/u-boot/amlogic/u-boot- maineline/common/usb_onboard_hub.c:96:(.text.usb5744_i2c_init+0x1c8): undefined reference to `dm_i2c_write' aarch64-linux-gnu-ld.bfd: /home/amoon/mainline/u-boot/amlogic/u-boot- maineline/common/usb_onboard_hub.c:104:(.text.usb5744_i2c_init+0x1f0): undefined reference to `dm_i2c_write' Segmentation fault (core dumped) make: *** [Makefile:1824: u-boot] Error 139 make: *** Deleting file 'u-boot'
Signed-off-by: Anand Moon <linux.amoon@...> --- common/usb_onboard_hub.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/common/usb_onboard_hub.c b/common/usb_onboard_hub.c index 1242513c631..92e3f3a92c9 100644 --- a/common/usb_onboard_hub.c +++ b/common/usb_onboard_hub.c @@ -30,6 +30,7 @@ struct onboard_hub_data { int (*init)(struct udevice *dev); }; +#if CONFIG_IS_ENABLED(DM_I2C) static int usb5744_i2c_init(struct udevice *dev) { /* @@ -109,6 +110,7 @@ static int usb5744_i2c_init(struct udevice *dev) return 0; } +#endif int usb_onboard_hub_reset(struct udevice *dev) { @@ -222,7 +224,9 @@ static const struct onboard_hub_data usb2514_data = { }; static const struct onboard_hub_data usb5744_data = { +#if CONFIG_IS_ENABLED(DM_I2C) .init = usb5744_i2c_init, +#endif .power_on_delay_us = 1000, .reset_us = 5, }; I think you should completely disable usb5744_data in this case
I would recommend to go the same route as the Linux kernel which has a special Kconfig option for it, c.f. USB_ONBOARD_DEV_USB5744 which adds the necessary dependencies.
On Linux kernel, it needs to parse the device node with i2c-bus. We probably should be careful and figure out which boards are actually using the usb5744 and add this symbol to their defconfig so they don't regress.
From my initial analysis configs/xilinx_zynqmp_kria_defconfig which use CONFIG_USB_ONBOARD_HUB I believe using DM_I2C to guard the code is the best approach. it should be around .init() callback to guard this to work. Cheers, Quentin Thanks -Anand
|
Re: Odroid n2+ usb broken on reboot
I actually already have a working solution that I documented in my github repo (dubschro/odroid-n2). All I do is set BOOTCOMMAND to check/delete a flag file on my boot partition and if it is found, then reset usb and sleep for 10 seconds. I then have a systemd shutdown script only on reboot to touch that file. CONFIG_BOOTCOMMAND="fatrm mmc 0:1 reboot && echo Resetting USB on reboot... && usb reset && sleep 10; run distro_bootcmd" It is a hack, but... the system reliably reboots remotely now, and that's the important part for now. Wayne On Thu, May 8, 2025 at 11:22?AM Ferass El Hafidi <funderscore@...> wrote: On Wed May 7, 2025 at 1:03 PM UTC, Wayne Schroeder wrote:
It's hard for me to quantify if usb works in u-boot as I'm not loading off of any usb storage devices. It certainly never lets me use the keyboard to abort auto boot, and never has. On reboot, to reliably You can send bytes via UART to abort boot, if you happen to have a UART adapter around.
|
Re: [RFC v1 7/7] usb: onboard-hub: Add conditional compilation for I2C initialization
Hi Neil, Anand, On 5/9/25 9:57 AM, Neil Armstrong wrote: On 09/05/2025 09:02, Anand Moon wrote:
Add conditional compilation for the usb5744_i2c_init() function based on the CONFIG_DM_I2C configuration, to avoid compilation failure.
?? CC????? net/net-common.o ?? AR????? net/built-in.o ?? LDS???? u-boot.lds ?? LD????? u-boot aarch64-linux-gnu-ld.bfd: common/usb_onboard_hub.o: in function `usb5744_i2c_init': /home/amoon/mainline/u-boot/amlogic/u-boot-maineline/common/ usb_onboard_hub.c:74:(.text.usb5744_i2c_init+0xfc): undefined reference to `i2c_get_chip' aarch64-linux-gnu-ld.bfd: /home/amoon/mainline/u-boot/amlogic/u-boot- maineline/common/usb_onboard_hub.c:89:(.text.usb5744_i2c_init+0x1a0): undefined reference to `dm_i2c_write' aarch64-linux-gnu-ld.bfd: /home/amoon/mainline/u-boot/amlogic/u-boot- maineline/common/usb_onboard_hub.c:96:(.text.usb5744_i2c_init+0x1c8): undefined reference to `dm_i2c_write' aarch64-linux-gnu-ld.bfd: /home/amoon/mainline/u-boot/amlogic/u-boot- maineline/common/usb_onboard_hub.c:104:(.text.usb5744_i2c_init+0x1f0): undefined reference to `dm_i2c_write' Segmentation fault (core dumped) make: *** [Makefile:1824: u-boot] Error 139 make: *** Deleting file 'u-boot'
Signed-off-by: Anand Moon <linux.amoon@...> --- ? common/usb_onboard_hub.c | 4 ++++ ? 1 file changed, 4 insertions(+)
diff --git a/common/usb_onboard_hub.c b/common/usb_onboard_hub.c index 1242513c631..92e3f3a92c9 100644 --- a/common/usb_onboard_hub.c +++ b/common/usb_onboard_hub.c @@ -30,6 +30,7 @@ struct onboard_hub_data { ????? int (*init)(struct udevice *dev); ? }; +#if CONFIG_IS_ENABLED(DM_I2C) ? static int usb5744_i2c_init(struct udevice *dev) ? { ????? /* @@ -109,6 +110,7 @@ static int usb5744_i2c_init(struct udevice *dev) ????? return 0; ? } +#endif ? int usb_onboard_hub_reset(struct udevice *dev) ? { @@ -222,7 +224,9 @@ static const struct onboard_hub_data usb2514_data = { ? }; ? static const struct onboard_hub_data usb5744_data = { +#if CONFIG_IS_ENABLED(DM_I2C) ????? .init = usb5744_i2c_init, +#endif ????? .power_on_delay_us = 1000, ????? .reset_us = 5, ? }; I think you should completely disable usb5744_data in this case
I would recommend to go the same route as the Linux kernel which has a special Kconfig option for it, c.f. USB_ONBOARD_DEV_USB5744 which adds the necessary dependencies. We probably should be careful and figure out which boards are actually using the usb5744 and add this symbol to their defconfig so they don't regress. Cheers, Quentin
|
Re: [RFC v1 7/7] usb: onboard-hub: Add conditional compilation for I2C initialization
Hi Neil, On Fri, 9 May 2025 at 13:27, Neil Armstrong <neil.armstrong@...> wrote: On 09/05/2025 09:02, Anand Moon wrote:
Add conditional compilation for the usb5744_i2c_init() function based on the CONFIG_DM_I2C configuration, to avoid compilation failure.
CC net/net-common.o AR net/built-in.o LDS u-boot.lds LD u-boot aarch64-linux-gnu-ld.bfd: common/usb_onboard_hub.o: in function `usb5744_i2c_init': /home/amoon/mainline/u-boot/amlogic/u-boot-maineline/common/usb_onboard_hub.c:74:(.text.usb5744_i2c_init+0xfc): undefined reference to `i2c_get_chip' aarch64-linux-gnu-ld.bfd: /home/amoon/mainline/u-boot/amlogic/u-boot-maineline/common/usb_onboard_hub.c:89:(.text.usb5744_i2c_init+0x1a0): undefined reference to `dm_i2c_write' aarch64-linux-gnu-ld.bfd: /home/amoon/mainline/u-boot/amlogic/u-boot-maineline/common/usb_onboard_hub.c:96:(.text.usb5744_i2c_init+0x1c8): undefined reference to `dm_i2c_write' aarch64-linux-gnu-ld.bfd: /home/amoon/mainline/u-boot/amlogic/u-boot-maineline/common/usb_onboard_hub.c:104:(.text.usb5744_i2c_init+0x1f0): undefined reference to `dm_i2c_write' Segmentation fault (core dumped) make: *** [Makefile:1824: u-boot] Error 139 make: *** Deleting file 'u-boot'
Signed-off-by: Anand Moon <linux.amoon@...> --- common/usb_onboard_hub.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/common/usb_onboard_hub.c b/common/usb_onboard_hub.c index 1242513c631..92e3f3a92c9 100644 --- a/common/usb_onboard_hub.c +++ b/common/usb_onboard_hub.c @@ -30,6 +30,7 @@ struct onboard_hub_data { int (*init)(struct udevice *dev); };
+#if CONFIG_IS_ENABLED(DM_I2C) static int usb5744_i2c_init(struct udevice *dev) { /* @@ -109,6 +110,7 @@ static int usb5744_i2c_init(struct udevice *dev)
return 0; } +#endif
int usb_onboard_hub_reset(struct udevice *dev) { @@ -222,7 +224,9 @@ static const struct onboard_hub_data usb2514_data = { };
static const struct onboard_hub_data usb5744_data = { +#if CONFIG_IS_ENABLED(DM_I2C) .init = usb5744_i2c_init, +#endif .power_on_delay_us = 1000, .reset_us = 5, }; I think you should completely disable usb5744_data in this case
Let me check this. I will update it in the next version. Neil Thanks -Anand
|
Re: [RFC v1 2/7] configs: odorid-c2: Enable Onboard HUB driver
Hi Neil, On Fri, 9 May 2025 at 13:26, Neil Armstrong <neil.armstrong@...> wrote: s/odorid-c2/odroid-c2/ in the subject
Oops, I will fix this in the next version. On 09/05/2025 09:02, Anand Moon wrote:
Enable the onboard USB HUB driver to power the USB_HUB_GL852G-OHG on the Odroid C2.
Signed-off-by: Anand Moon <linux.amoon@...> --- configs/odroid-c2_defconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/configs/odroid-c2_defconfig b/configs/odroid-c2_defconfig index bcaab46f8bc..f8a66a923c9 100644 --- a/configs/odroid-c2_defconfig +++ b/configs/odroid-c2_defconfig @@ -59,6 +59,7 @@ CONFIG_SYSINFO_SMBIOS=y CONFIG_USB=y CONFIG_USB_DWC2=y CONFIG_USB_KEYBOARD=y +CONFIG_USB_ONBOARD_HUB=y CONFIG_VIDEO=y # CONFIG_VIDEO_BPP8 is not set # CONFIG_VIDEO_BPP16 is not set With that fixed: Reviewed-by: Neil Armstrong <neil.armstrong@...> Thanks -Anand
|
Re: [RFC v1 3/7] usb: onboard-hub: Add support for Genesys GL853G
On 09/05/2025 09:02, Anand Moon wrote: Enable support for the Genesys GL853G USB2.0 and USB3.1 Hub on the Odroid N2 and N2-plus. The GL853G driver activates the hub reset signal, which toggles the GPIO. Signed-off-by: Anand Moon <linux.amoon@...> --- => dm tree simple_bus 11 [ + ] dwc3-meson-g12a | `-- usb@ffe09000 usb_gadget 0 [ ] dwc2-udc-otg | |-- usb@ff400000 usb 0 [ + ] xhci-dwc3 | `-- usb@ff500000 usb_hub 0 [ + ] usb_hub | `-- usb_hub usb_hub 1 [ + ] usb_hub | |-- usb_hub usb_mass_s 0 [ + ] usb_mass_storage | | `-- usb_mass_storage blk 2 [ + ] usb_storage_blk | | |-- usb_mass_storage.lun0 partition 0 [ + ] blk_partition | | | `-- usb_mass_storage.lun0:1 bootdev 3 [ ] usb_bootdev | | `-- usb_mass_storage.lun0.bootdev usb_hub 2 [ + ] usb_hub | `-- usb_hub clk 2 [ + ] fixed_clock |-- xtal-clk --- common/usb_onboard_hub.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/common/usb_onboard_hub.c b/common/usb_onboard_hub.c index 39bbc1aefa2..3914e2f773d 100644 --- a/common/usb_onboard_hub.c +++ b/common/usb_onboard_hub.c @@ -231,6 +231,10 @@ static const struct onboard_hub_data genesys_gl852g_data = { .reset_us = 50, }; +static const struct onboard_hub_data genesys_gl853g_data = { + .reset_us = 50, +}; + static const struct udevice_id usb_onboard_hub_ids[] = { /* Use generic usbVID,PID dt-bindings (usb-device.yaml) */ { .compatible = "usb424,2514", /* USB2514B USB 2.0 */ @@ -244,6 +248,9 @@ static const struct udevice_id usb_onboard_hub_ids[] = { }, { .compatible = "usb5e3,610", /* GL852G USB 2.0 */ .data = (ulong)&genesys_gl852g_data, + }, { + .compatible = "usb5e3,620", /* GL852G USB 3.1 */ + .data = (ulong)&genesys_gl853g_data, } }; Reviewed-by: Neil Armstrong <neil.armstrong@...>
|
Re: [RFC v1 5/7] usb: onboard-hub: Add support for VL817 USB hub
On 09/05/2025 09:02, Anand Moon wrote: Enable support for the Via labs VL817 USB2.0 and USB3.1 Hub on the Odroid C4. The Via labs VL817 USB driver activates the hub reset signal, which toggles the GPIO. Signed-off-by: Anand Moon <linux.amoon@...> --- => dm tree simple_bus 11 [ + ] dwc3-meson-g12a | `-- usb@ffe09000 usb_gadget 0 [ ] dwc2-udc-otg | |-- usb@ff400000 usb 0 [ + ] xhci-dwc3 | `-- usb@ff500000 usb_hub 0 [ + ] usb_hub | `-- usb_hub usb_hub 1 [ + ] usb_hub | |-- usb_hub usb_mass_s 0 [ + ] usb_mass_storage | | `-- usb_mass_storage blk 2 [ + ] usb_storage_blk | | |-- usb_mass_storage.lun0 partition 0 [ + ] blk_partition | | | |-- usb_mass_storage.lun0:1 partition 1 [ + ] blk_partition | | | |-- usb_mass_storage.lun0:2 partition 2 [ + ] blk_partition | | | |-- usb_mass_storage.lun0:3 partition 3 [ + ] blk_partition | | | `-- usb_mass_storage.lun0:4 bootdev 3 [ ] usb_bootdev | | `-- usb_mass_storage.lun0.bootdev usb_hub 2 [ + ] usb_hub | `-- usb_hub --- common/usb_onboard_hub.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/common/usb_onboard_hub.c b/common/usb_onboard_hub.c index 3914e2f773d..1242513c631 100644 --- a/common/usb_onboard_hub.c +++ b/common/usb_onboard_hub.c @@ -235,6 +235,10 @@ static const struct onboard_hub_data genesys_gl853g_data = { .reset_us = 50, }; +static const struct onboard_hub_data vialab_vl817_data = { + .reset_us = 10, +}; + static const struct udevice_id usb_onboard_hub_ids[] = { /* Use generic usbVID,PID dt-bindings (usb-device.yaml) */ { .compatible = "usb424,2514", /* USB2514B USB 2.0 */ @@ -251,6 +255,12 @@ static const struct udevice_id usb_onboard_hub_ids[] = { }, { .compatible = "usb5e3,620", /* GL852G USB 3.1 */ .data = (ulong)&genesys_gl853g_data, + }, { + .compatible = "usb2109,817", /* Via labs VL817 2.0 */ + .data = (ulong)&vialab_vl817_data, + }, { + .compatible = "usb2109,2817", /* Via labs VL817 3.1 */ + .data = (ulong)&vialab_vl817_data, } }; Reviewed-by: Neil Armstrong <neil.armstrong@...>
|
Re: [RFC v1 7/7] usb: onboard-hub: Add conditional compilation for I2C initialization
On 09/05/2025 09:02, Anand Moon wrote: Add conditional compilation for the usb5744_i2c_init() function based on the CONFIG_DM_I2C configuration, to avoid compilation failure. CC net/net-common.o AR net/built-in.o LDS u-boot.lds LD u-boot aarch64-linux-gnu-ld.bfd: common/usb_onboard_hub.o: in function `usb5744_i2c_init': /home/amoon/mainline/u-boot/amlogic/u-boot-maineline/common/usb_onboard_hub.c:74:(.text.usb5744_i2c_init+0xfc): undefined reference to `i2c_get_chip' aarch64-linux-gnu-ld.bfd: /home/amoon/mainline/u-boot/amlogic/u-boot-maineline/common/usb_onboard_hub.c:89:(.text.usb5744_i2c_init+0x1a0): undefined reference to `dm_i2c_write' aarch64-linux-gnu-ld.bfd: /home/amoon/mainline/u-boot/amlogic/u-boot-maineline/common/usb_onboard_hub.c:96:(.text.usb5744_i2c_init+0x1c8): undefined reference to `dm_i2c_write' aarch64-linux-gnu-ld.bfd: /home/amoon/mainline/u-boot/amlogic/u-boot-maineline/common/usb_onboard_hub.c:104:(.text.usb5744_i2c_init+0x1f0): undefined reference to `dm_i2c_write' Segmentation fault (core dumped) make: *** [Makefile:1824: u-boot] Error 139 make: *** Deleting file 'u-boot' Signed-off-by: Anand Moon <linux.amoon@...> --- common/usb_onboard_hub.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/usb_onboard_hub.c b/common/usb_onboard_hub.c index 1242513c631..92e3f3a92c9 100644 --- a/common/usb_onboard_hub.c +++ b/common/usb_onboard_hub.c @@ -30,6 +30,7 @@ struct onboard_hub_data { int (*init)(struct udevice *dev); }; +#if CONFIG_IS_ENABLED(DM_I2C) static int usb5744_i2c_init(struct udevice *dev) { /* @@ -109,6 +110,7 @@ static int usb5744_i2c_init(struct udevice *dev) return 0; } +#endif int usb_onboard_hub_reset(struct udevice *dev) { @@ -222,7 +224,9 @@ static const struct onboard_hub_data usb2514_data = { }; static const struct onboard_hub_data usb5744_data = { +#if CONFIG_IS_ENABLED(DM_I2C) .init = usb5744_i2c_init, +#endif .power_on_delay_us = 1000, .reset_us = 5, }; I think you should completely disable usb5744_data in this case Neil
|
Re: [RFC v1 6/7] configs: odorid-c4: Enable Oboard HUB driver
On 09/05/2025 09:02, Anand Moon wrote: Enable the onboard USB HUB driver to power the Via labs VL817 USB 3.1 hub on the Odroid C4. Signed-off-by: Anand Moon <linux.amoon@...> --- configs/odroid-c4_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/odroid-c4_defconfig b/configs/odroid-c4_defconfig index cc3d7fc7484..3c5e53828a1 100644 --- a/configs/odroid-c4_defconfig +++ b/configs/odroid-c4_defconfig @@ -64,6 +64,7 @@ CONFIG_USB_DWC3=y # CONFIG_USB_DWC3_GADGET is not set CONFIG_USB_DWC3_MESON_G12A=y CONFIG_USB_KEYBOARD=y +CONFIG_USB_ONBOARD_HUB=y CONFIG_USB_GADGET=y CONFIG_USB_GADGET_VENDOR_NUM=0x1b8e CONFIG_USB_GADGET_PRODUCT_NUM=0xfada Same as patch 2, with that fixed: Reviewed-by: Neil Armstrong <neil.armstrong@...>
|
Re: [RFC v1 4/7] configs: odorid-n2: Enable Oboard HUB driver
On 09/05/2025 09:02, Anand Moon wrote: Enable the onboard USB HUB driver to power the USB_HUB_GL853G-OHG on the Odroid N2 and Odroid N2-pluss. Signed-off-by: Anand Moon <linux.amoon@...> --- configs/odroid-n2_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/odroid-n2_defconfig b/configs/odroid-n2_defconfig index a8cbaee3c96..1bf687c1e6d 100644 --- a/configs/odroid-n2_defconfig +++ b/configs/odroid-n2_defconfig @@ -64,6 +64,7 @@ CONFIG_USB_DWC3=y # CONFIG_USB_DWC3_GADGET is not set CONFIG_USB_DWC3_MESON_G12A=y CONFIG_USB_KEYBOARD=y +CONFIG_USB_ONBOARD_HUB=y CONFIG_USB_GADGET=y CONFIG_USB_GADGET_VENDOR_NUM=0x1b8e CONFIG_USB_GADGET_PRODUCT_NUM=0xfada Same as patch 2, with that fixed: Reviewed-by: Neil Armstrong <neil.armstrong@...>
|
Re: [RFC v1 2/7] configs: odorid-c2: Enable Onboard HUB driver
s/odorid-c2/odroid-c2/ in the subject On 09/05/2025 09:02, Anand Moon wrote: Enable the onboard USB HUB driver to power the USB_HUB_GL852G-OHG on the Odroid C2. Signed-off-by: Anand Moon <linux.amoon@...> --- configs/odroid-c2_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/odroid-c2_defconfig b/configs/odroid-c2_defconfig index bcaab46f8bc..f8a66a923c9 100644 --- a/configs/odroid-c2_defconfig +++ b/configs/odroid-c2_defconfig @@ -59,6 +59,7 @@ CONFIG_SYSINFO_SMBIOS=y CONFIG_USB=y CONFIG_USB_DWC2=y CONFIG_USB_KEYBOARD=y +CONFIG_USB_ONBOARD_HUB=y CONFIG_VIDEO=y # CONFIG_VIDEO_BPP8 is not set # CONFIG_VIDEO_BPP16 is not set With that fixed: Reviewed-by: Neil Armstrong <neil.armstrong@...>
|