linux-amlogic.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* Re: Odroid n2+ usb broken on reboot
       [not found] <CAEUiLubXaPGZsE6y_X6mBTD1ZK-2w82fbRD5z8+MKvDZtZKOtA@mail.gmail.com>
@ 2025-05-05  7:07 ` neil.armstrong
  2025-05-05 13:12   ` Wayne Schroeder
  0 siblings, 1 reply; 13+ messages in thread
From: neil.armstrong @ 2025-05-05  7:07 UTC (permalink / raw)
  To: Wayne Schroeder, u-boot
  Cc: u-boot-amlogic@groups.io, linux-amlogic@lists.infradead.org

Hi,

+CC u-boot-amlogic@groups.io
+CC linux-amlogic@lists.infradead.org

On 05/05/2025 00:34, Wayne Schroeder wrote:
> Hello.  I am not sure if this is a bug, or even related to u-boot, but I am
> reporting it here because it was easiest to resolve via a u-boot change.
> 
> I am using u-boot-2025.04 (source) with a mainline linux from Arch Linux
> Arm.
> Linux alarm 6.14.4-1-aarch64-ARCH #1 SMP PREEMPT_DYNAMIC Sat Apr 26
> 13:02:01 MDT 2025 aarch64 GNU/Linux
> 
> On my odroid-n2+, the USB ports work on the first boot after power.  If I
> run shutdown -r now, or hit ctl-alt-del and otherwise reboot the system,
> the usb ports do not function at the next or subsequent boot up.

I think it's a very long term issue, USB lacks a proper reset at probe on
warm reset, does USB still work from U-Boot after the reboot ?

> 
> My apologies if this is not applicable to u-boot because it is a linux
> issue--I am not sure what the source of the issue is, but adjusting the
> u-boot .config after make odroid-n2_defconfig resolved the issue entirely.
> 
> I am booting via extlinux/extlinux.conf and have adjusted my
> CONFIG_BOOTCOMMAND before build to execute a usb reset prior to the
> existing run distro_bootcmd.
> 
> CONFIG_BOOTCOMMAND="usb reset; run distro_bootcmd"

I'm pretty sure there's driver callbacks we should implement to do the
same here, I need to check.

> 
> This has allowed me to reboot the system and successfully have access to
> the USB devices such as my keyboard, mouse, and root file system on USB3
> SSD.
> 
> Thanks!
> 
> Wayne


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Odroid n2+ usb broken on reboot
  2025-05-05  7:07 ` Odroid n2+ usb broken on reboot neil.armstrong
@ 2025-05-05 13:12   ` Wayne Schroeder
  2025-05-07 12:01     ` neil.armstrong
  0 siblings, 1 reply; 13+ messages in thread
From: Wayne Schroeder @ 2025-05-05 13:12 UTC (permalink / raw)
  To: neil.armstrong
  Cc: u-boot, u-boot-amlogic@groups.io,
	linux-amlogic@lists.infradead.org

If I add the usb reset command, it works reliably at reboot, but it
does not work on a fresh power-up with that change.


On Mon, May 5, 2025 at 2:07 AM <neil.armstrong@linaro.org> wrote:

> I think it's a very long term issue, USB lacks a proper reset at probe on
> warm reset, does USB still work from U-Boot after the reboot ?
>

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Odroid n2+ usb broken on reboot
  2025-05-05 13:12   ` Wayne Schroeder
@ 2025-05-07 12:01     ` neil.armstrong
  2025-05-07 13:01       ` Anand Moon
  2025-05-07 13:03       ` Wayne Schroeder
  0 siblings, 2 replies; 13+ messages in thread
From: neil.armstrong @ 2025-05-07 12:01 UTC (permalink / raw)
  To: Wayne Schroeder
  Cc: u-boot, u-boot-amlogic@groups.io,
	linux-amlogic@lists.infradead.org

On 05/05/2025 15:12, Wayne Schroeder wrote:
> If I add the usb reset command, it works reliably at reboot, but it
> does not work on a fresh power-up with that change.

OK this means there's a dangling resource, Does USB always work within
U-Boot or it breaks U-Boot and Linux in those cases ?

> 
> 
> On Mon, May 5, 2025 at 2:07 AM <neil.armstrong@linaro.org> wrote:
> 
>> I think it's a very long term issue, USB lacks a proper reset at probe on
>> warm reset, does USB still work from U-Boot after the reboot ?
>>


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Odroid n2+ usb broken on reboot
  2025-05-07 12:01     ` neil.armstrong
@ 2025-05-07 13:01       ` Anand Moon
  2025-05-07 13:03       ` Wayne Schroeder
  1 sibling, 0 replies; 13+ messages in thread
From: Anand Moon @ 2025-05-07 13:01 UTC (permalink / raw)
  To: u-boot-amlogic, neil.armstrong
  Cc: Wayne Schroeder, u-boot, linux-amlogic@lists.infradead.org

Hi Wayne,

On Wed, 7 May 2025 at 17:31, Neil Armstrong via groups.io
<neil.armstrong=linaro.org@groups.io> wrote:
>
> On 05/05/2025 15:12, Wayne Schroeder wrote:
> > If I add the usb reset command, it works reliably at reboot, but it
> > does not work on a fresh power-up with that change.
>
> OK this means there's a dangling resource, Does USB always work within
> U-Boot or it breaks U-Boot and Linux in those cases ?
>
> >
> >
> > On Mon, May 5, 2025 at 2:07 AM <neil.armstrong@linaro.org> wrote:
> >
> >> I think it's a very long term issue, USB lacks a proper reset at probe on
> >> warm reset, does USB still work from U-Boot after the reboot ?
> >>
>
I wanted to enable CONFIG_USB_ONBOARD_HUB on Odroid platform on u-boot
I think this should help USB hub reset, I'll check this and let you know.

Thanks
-Anand

>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#2670): https://groups.io/g/u-boot-amlogic/message/2670
> Mute This Topic: https://groups.io/mt/112625435/6056667
> Group Owner: u-boot-amlogic+owner@groups.io
> Unsubscribe: https://groups.io/g/u-boot-amlogic/unsub [linux.amoon@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Odroid n2+ usb broken on reboot
  2025-05-07 12:01     ` neil.armstrong
  2025-05-07 13:01       ` Anand Moon
@ 2025-05-07 13:03       ` Wayne Schroeder
  2025-05-08 16:21         ` Ferass El Hafidi
  1 sibling, 1 reply; 13+ messages in thread
From: Wayne Schroeder @ 2025-05-07 13:03 UTC (permalink / raw)
  To: Neil Armstrong
  Cc: u-boot, u-boot-amlogic@groups.io,
	linux-amlogic@lists.infradead.org

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
get it to work, I have to do a usb reset and sleep some amount of time
before doing distro boot.  I picked 10 seconds.  If you would like for
me to do some scripted boot command additions before my extlinux to
gather data, I can.

Right now, what I have done is make a reboot hook in linux to touch a
file on the boot partition that my bootcommand fatrms and if it was
present, it resets usb and sleeps 10 seconds, so it's reliable to
reboot remotely like that.  Let me know how else I can gather any
data.

On Wed, May 7, 2025 at 7:01 AM <neil.armstrong@linaro.org> wrote:
>
> On 05/05/2025 15:12, Wayne Schroeder wrote:
> > If I add the usb reset command, it works reliably at reboot, but it
> > does not work on a fresh power-up with that change.
>
> OK this means there's a dangling resource, Does USB always work within
> U-Boot or it breaks U-Boot and Linux in those cases ?
>
> >
> >
> > On Mon, May 5, 2025 at 2:07 AM <neil.armstrong@linaro.org> wrote:
> >
> >> I think it's a very long term issue, USB lacks a proper reset at probe on
> >> warm reset, does USB still work from U-Boot after the reboot ?
> >>
>

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Odroid n2+ usb broken on reboot
  2025-05-07 13:03       ` Wayne Schroeder
@ 2025-05-08 16:21         ` Ferass El Hafidi
  2025-05-08 19:54           ` Wayne Schroeder
  0 siblings, 1 reply; 13+ messages in thread
From: Ferass El Hafidi @ 2025-05-08 16:21 UTC (permalink / raw)
  To: Wayne Schroeder, Neil Armstrong
  Cc: u-boot, u-boot-amlogic@groups.io,
	linux-amlogic@lists.infradead.org

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.

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Odroid n2+ usb broken on reboot
  2025-05-08 16:21         ` Ferass El Hafidi
@ 2025-05-08 19:54           ` Wayne Schroeder
  2025-05-09  7:08             ` Anand Moon
  0 siblings, 1 reply; 13+ messages in thread
From: Wayne Schroeder @ 2025-05-08 19:54 UTC (permalink / raw)
  To: Ferass El Hafidi
  Cc: Neil Armstrong, u-boot, u-boot-amlogic@groups.io,
	linux-amlogic@lists.infradead.org

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@postmarketos.org> 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.

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Odroid n2+ usb broken on reboot
  2025-05-08 19:54           ` Wayne Schroeder
@ 2025-05-09  7:08             ` Anand Moon
  2025-05-09 15:01               ` Wayne Schroeder
  0 siblings, 1 reply; 13+ messages in thread
From: Anand Moon @ 2025-05-09  7:08 UTC (permalink / raw)
  To: Wayne Schroeder
  Cc: Ferass El Hafidi, Neil Armstrong, u-boot,
	u-boot-amlogic@groups.io, linux-amlogic@lists.infradead.org

Hi Wayne,

On Fri, 9 May 2025 at 01:25, Wayne Schroeder <raz@chewies.net> 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@postmarketos.org> 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?

https://patchwork.ozlabs.org/project/uboot/list/?series=456088

Thanks
-Anand

> _______________________________________________
> linux-amlogic mailing list
> linux-amlogic@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-amlogic

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Odroid n2+ usb broken on reboot
  2025-05-09  7:08             ` Anand Moon
@ 2025-05-09 15:01               ` Wayne Schroeder
  2025-05-10 20:21                 ` Wayne Schroeder
  0 siblings, 1 reply; 13+ messages in thread
From: Wayne Schroeder @ 2025-05-09 15:01 UTC (permalink / raw)
  To: Anand Moon
  Cc: Ferass El Hafidi, Neil Armstrong, u-boot,
	u-boot-amlogic@groups.io, linux-amlogic@lists.infradead.org

Yes.  Will report back how it works on the n2+.


On Fri, May 9, 2025 at 2:08 AM Anand Moon <linux.amoon@gmail.com> wrote:
>
> Hi Wayne,
>
> On Fri, 9 May 2025 at 01:25, Wayne Schroeder <raz@chewies.net> 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@postmarketos.org> 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?
>
> https://patchwork.ozlabs.org/project/uboot/list/?series=456088
>
> Thanks
> -Anand
>
> > _______________________________________________
> > linux-amlogic mailing list
> > linux-amlogic@lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/linux-amlogic

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Odroid n2+ usb broken on reboot
  2025-05-09 15:01               ` Wayne Schroeder
@ 2025-05-10 20:21                 ` Wayne Schroeder
  2025-05-12  6:59                   ` Anand Moon
  0 siblings, 1 reply; 13+ messages in thread
From: Wayne Schroeder @ 2025-05-10 20:21 UTC (permalink / raw)
  To: Anand Moon
  Cc: Ferass El Hafidi, Neil Armstrong, u-boot,
	u-boot-amlogic@groups.io, linux-amlogic@lists.infradead.org

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

On Fri, May 9, 2025 at 10:01 AM Wayne Schroeder <raz@chewies.net> wrote:
>
> Yes.  Will report back how it works on the n2+.
>
>
> On Fri, May 9, 2025 at 2:08 AM Anand Moon <linux.amoon@gmail.com> wrote:
> >
> > Hi Wayne,
> >
> > On Fri, 9 May 2025 at 01:25, Wayne Schroeder <raz@chewies.net> 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@postmarketos.org> 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?
> >
> > https://patchwork.ozlabs.org/project/uboot/list/?series=456088
> >
> > Thanks
> > -Anand
> >
> > > _______________________________________________
> > > linux-amlogic mailing list
> > > linux-amlogic@lists.infradead.org
> > > http://lists.infradead.org/mailman/listinfo/linux-amlogic

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Odroid n2+ usb broken on reboot
  2025-05-10 20:21                 ` Wayne Schroeder
@ 2025-05-12  6:59                   ` Anand Moon
  2025-05-12  9:35                     ` Christian Hewitt
  0 siblings, 1 reply; 13+ messages in thread
From: Anand Moon @ 2025-05-12  6:59 UTC (permalink / raw)
  To: Wayne Schroeder
  Cc: Ferass El Hafidi, Neil Armstrong, u-boot,
	u-boot-amlogic@groups.io, linux-amlogic@lists.infradead.org

Hi Wayne,

On Sun, 11 May 2025 at 01:51, Wayne Schroeder <raz@chewies.net> 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@chewies.net> wrote:
> >
> > Yes.  Will report back how it works on the n2+.
> >
> >
> > On Fri, May 9, 2025 at 2:08 AM Anand Moon <linux.amoon@gmail.com> wrote:
> > >
> > > Hi Wayne,
> > >
> > > On Fri, 9 May 2025 at 01:25, Wayne Schroeder <raz@chewies.net> 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@postmarketos.org> 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?
> > >
> > > https://patchwork.ozlabs.org/project/uboot/list/?series=456088
> > >
> > > Thanks
> > > -Anand
> > >
> > > > _______________________________________________
> > > > linux-amlogic mailing list
> > > > linux-amlogic@lists.infradead.org
> > > > http://lists.infradead.org/mailman/listinfo/linux-amlogic

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: Odroid n2+ usb broken on reboot
  2025-05-12  6:59                   ` Anand Moon
@ 2025-05-12  9:35                     ` Christian Hewitt
  2025-05-12 10:04                       ` Anand Moon
  0 siblings, 1 reply; 13+ messages in thread
From: Christian Hewitt @ 2025-05-12  9:35 UTC (permalink / raw)
  To: u-boot-amlogic, linux.amoon
  Cc: Wayne Schroeder, Ferass El Hafidi, Neil Armstrong, u-boot,
	linux-amlogic@lists.infradead.org

> On 12 May 2025, at 10:59 am, Anand Moon via groups.io <linux.amoon=gmail.com@groups.io> wrote:
> 
> Hi Wayne,
> 
> On Sun, 11 May 2025 at 01:51, Wayne Schroeder <raz@chewies.net> 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@chewies.net> wrote:
>>> 
>>> Yes.  Will report back how it works on the n2+.
>>> 
>>> 
>>> On Fri, May 9, 2025 at 2:08 AM Anand Moon <linux.amoon@gmail.com> wrote:
>>>> 
>>>> Hi Wayne,
>>>> 
>>>> On Fri, 9 May 2025 at 01:25, Wayne Schroeder <raz@chewies.net> 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@postmarketos.org> 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?
>>>> 
>>>> https://patchwork.ozlabs.org/project/uboot/list/?series=456088
>>>> 
>>>> Thanks
>>>> -Anand
>>>> 
>>>>> _______________________________________________
>>>>> linux-amlogic mailing list
>>>>> linux-amlogic@lists.infradead.org
>>>>> http://lists.infradead.org/mailman/listinfo/linux-amlogic
> 
> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#2696): https://groups.io/g/u-boot-amlogic/message/2696
> Mute This Topic: https://groups.io/mt/112625435/6407323
> Group Owner: u-boot-amlogic+owner@groups.io
> Unsubscribe: https://groups.io/g/u-boot-amlogic/unsub [christianshewitt@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-



_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Odroid n2+ usb broken on reboot
  2025-05-12  9:35                     ` Christian Hewitt
@ 2025-05-12 10:04                       ` Anand Moon
  0 siblings, 0 replies; 13+ messages in thread
From: Anand Moon @ 2025-05-12 10:04 UTC (permalink / raw)
  To: Christian Hewitt
  Cc: u-boot-amlogic, Wayne Schroeder, Ferass El Hafidi, Neil Armstrong,
	u-boot, linux-amlogic@lists.infradead.org

Hi Christian,

On Mon, 12 May 2025 at 15:05, Christian Hewitt
<christianshewitt@gmail.com> wrote:
>
> > On 12 May 2025, at 10:59 am, Anand Moon via groups.io <linux.amoon=gmail.com@groups.io> wrote:
> >
> > Hi Wayne,
> >
> > On Sun, 11 May 2025 at 01:51, Wayne Schroeder <raz@chewies.net> 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@chewies.net> wrote:
> >>>
> >>> Yes.  Will report back how it works on the n2+.
> >>>
> >>>
> >>> On Fri, May 9, 2025 at 2:08 AM Anand Moon <linux.amoon@gmail.com> wrote:
> >>>>
> >>>> Hi Wayne,
> >>>>
> >>>> On Fri, 9 May 2025 at 01:25, Wayne Schroeder <raz@chewies.net> 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@postmarketos.org> 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?
> >>>>
> >>>> https://patchwork.ozlabs.org/project/uboot/list/?series=456088
> >>>>
> >>>> Thanks
> >>>> -Anand
> >>>>
> >>>>> _______________________________________________
> >>>>> linux-amlogic mailing list
> >>>>> linux-amlogic@lists.infradead.org
> >>>>> http://lists.infradead.org/mailman/listinfo/linux-amlogic
> >
> >
> > -=-=-=-=-=-=-=-=-=-=-=-
> > Groups.io Links: You receive all messages sent to this group.
> > View/Reply Online (#2696): https://groups.io/g/u-boot-amlogic/message/2696
> > Mute This Topic: https://groups.io/mt/112625435/6407323
> > Group Owner: u-boot-amlogic+owner@groups.io
> > Unsubscribe: https://groups.io/g/u-boot-amlogic/unsub [christianshewitt@gmail.com]
> > -=-=-=-=-=-=-=-=-=-=-=-
>
>

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2025-05-12 10:27 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CAEUiLubXaPGZsE6y_X6mBTD1ZK-2w82fbRD5z8+MKvDZtZKOtA@mail.gmail.com>
2025-05-05  7:07 ` Odroid n2+ usb broken on reboot neil.armstrong
2025-05-05 13:12   ` Wayne Schroeder
2025-05-07 12:01     ` neil.armstrong
2025-05-07 13:01       ` Anand Moon
2025-05-07 13:03       ` Wayne Schroeder
2025-05-08 16:21         ` Ferass El Hafidi
2025-05-08 19:54           ` Wayne Schroeder
2025-05-09  7:08             ` Anand Moon
2025-05-09 15:01               ` Wayne Schroeder
2025-05-10 20:21                 ` Wayne Schroeder
2025-05-12  6:59                   ` Anand Moon
2025-05-12  9:35                     ` Christian Hewitt
2025-05-12 10:04                       ` Anand Moon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).