<Armbian-Discord> <c​0rnelius> Yeah that LED mess on the zero is something else. i remove it from the DTS and use an overlay depending on the revision I'm messing with.
<Armbian-Discord> <T​onymac32> Probably the best option
<Armbian-Discord> <c​0rnelius> pretty much the only option that makes any sense.
<Armbian-Discord> <A​oyfe> Okies, so Armbian won't boot from USB on my ODroid HC4. u-boot gives me the following on the serial console:
<Armbian-Discord> <A​oyfe> ```
<Armbian-Discord> <A​oyfe> => usb start
<Armbian-Discord> <A​oyfe> starting USB...
<Armbian-Discord> <A​oyfe> Bus usb@ff500000: Register 3000140 NbrPorts 3
<Armbian-Discord> <A​oyfe> Starting the controller
<Armbian-Discord> <A​oyfe> USB XHCI 1.10
<Armbian-Discord> <A​oyfe> scanning bus usb@ff500000 for devices... cannot reset port 2!?
<Armbian-Discord> <A​oyfe> 1 USB Device(s) found
<Armbian-Discord> <A​oyfe> scanning usb for storage devices... 0 Storage Device(s) found
<Armbian-Discord> <A​oyfe> ```
<Armbian-Discord> <A​oyfe> lsusb output for the UFD in question: https://gist.github.com/DWSR/d728db58e84236cd972d2b2ca55cc13b
<Armbian-Discord> <c​0rnelius> if you run env print "i believe" it gives you the if fi to run to start from it. I had to do it a few times when I bricked something. I can't recall off the top of my had the whole statement.
<Armbian-Discord> <c​0rnelius> this doesn't look very good scanning bus usb@ff500000 for devices... cannot reset port 2!?
<Armbian-Discord> <A​oyfe> Yeah, if I unplug the UFD and then run usb reset on the u-boot console, that goes away.
<Armbian-Discord> <A​oyfe> However, the UFD is correctly detected if I boot Armbian from an SD card.
<Armbian-Discord> <c​0rnelius> sounds likely its something not enabled in u-boot then.
<Armbian-Discord> <A​oyfe> Exciting.
<Armbian-Discord> <c​0rnelius> does it boot from USB when using petitboot?
<Armbian-Discord> <A​oyfe> No idea.
<Armbian-Discord> <A​oyfe> Doesn't appear to be much to figure out when booting from USB: https://github.com/u-boot/u-boot/blob/master/doc/README.usb#L63
<Armbian-Discord> <c​0rnelius> if it was easy it would just work out of the box.
<Armbian-Discord> <A​oyfe> If it was easy I wouldn't be on Day 3 of trying to get all this to work. 😄
<Armbian-Discord> <A​oyfe> Looks like the answer is "add support for this UFD to u-boot or buy another one", from the look of things?
<Armbian-Discord> <c​0rnelius> basically, yes.
<Armbian-Discord> <A​oyfe> Wonder why it works in Linux
<Armbian-Discord> <c​0rnelius> what exactly is on the USB?
<Armbian-Discord> <c​0rnelius> how is the filesystem structured ?
<Armbian-Discord> <c​0rnelius> there is an auto in the usb start statement I suggested that just looks for something it knows and runs with it. In my case I had a FAT boot partition with an extlinux.conf file on it. It booted right up.
<Armbian-Discord> <A​oyfe> It's Armbian on the USB stick
<Armbian-Discord> <A​oyfe> I ran usb start though, which will just scan for devices without trying to boot from them
<Armbian-Discord> <c​0rnelius> so ext4. a ROOTFS and /boot. No specific designated BOOT partition.
<Armbian-Discord> <A​oyfe> Yeah, that's right
<Armbian-Discord> <A​oyfe> But I'm getting that error message when I just scan the USB bus./
<Armbian-Discord> <c​0rnelius> I can't say for sure as I haven't played around enough with it, but I can say when I had a BOOT partition it worked everytime.
<Armbian-Discord> <c​0rnelius> Yeah thats a problem. I don't know.
<Armbian-Discord> <A​oyfe> Did you wipe SPI?
<Armbian-Discord> <c​0rnelius> The board I was doing this on doesn't have SPI. Same SoC though. I don't see why that would matter to much if it wiped. The whole reason to wipe is to make it not register.
<Armbian-Discord> <A​oyfe> If it's wiped then it's booting directly from u-boot on the USB stick rather than trying to scan USB devices afterwards.
<Armbian-Discord> <c​0rnelius> Well thats a good point. How are you loading u-boot? emmc or sd?
<Armbian-Discord> <c​0rnelius> In my case it was flashed to eMMC and booting USB.
<Armbian-Discord> <A​oyfe> flashed to SPI from an sdcard-booted Armbian install
<Armbian-Discord> <c​0rnelius> ah... hmm. beyond my scope of understanding then 🙂
<Armbian-Discord> <c​0rnelius> So beyond having a recovery option whats the need to boot from USB? I always find it super strange that so many people want to do this on arm devices.
<Armbian-Discord> <A​oyfe> sdcards are absolute ass as root media. 🙂
<Armbian-Discord> <c​0rnelius> the Hc4 does have an eMMC option right and if using pboot I thought they could run the whole OS off the SATA.
<Armbian-Discord> <A​oyfe> It does, but I specifically don't want to use the SATA drives for boot media because of Ceph
<Armbian-Discord> <c​0rnelius> but you could put a boot partition on the emmc and then the rootfs on the sata. best of both worlds and nothing hanging off the board.
<Armbian-Discord> <A​oyfe> No, Ceph wants the entire drive. 🙂
<Armbian-Discord> <c​0rnelius> I see
<Armbian-Discord> <A​oyfe> As does Talos
<Armbian-Discord> <A​oyfe> So UFD as the boot media gives me something small and easy to work with as the rootfs/boot device, then Ceph deals with bulk storage.
<Armbian-Discord> <A​oyfe> @rpardini Any thoughts here? u-boot gives back weird things when I look at the USB hub:
<Armbian-Discord> <A​oyfe> ```
<Armbian-Discord> <A​oyfe> => usb info
<Armbian-Discord> <A​oyfe> 1: Hub, USB Revision 3.0
<Armbian-Discord> <A​oyfe> - U-Boot XHCI Host Controller
<Armbian-Discord> <A​oyfe> - Class: Hub
<Armbian-Discord> <A​oyfe> - PacketSize: 512 Configurations: 1
<Armbian-Discord> <A​oyfe> - Vendor: 0x0000 Product 0x0000 Version 1.0
<Armbian-Discord> <A​oyfe> Configuration: 1
<Armbian-Discord> <A​oyfe> - Interfaces: 1 Self Powered 0mA
<Armbian-Discord> <A​oyfe> Interface: 0
<Armbian-Discord> <A​oyfe> - Alternate Setting 0, Endpoints: 1
<Armbian-Discord> <A​oyfe> - Class Hub
<Armbian-Discord> <A​oyfe> - Endpoint 1 In Interrupt MaxPacket 8 Interval 255ms
<Armbian-Discord> <A​oyfe> ```
<Armbian-Discord> <A​oyfe> This appears to affect booting from my UFD.
Armbian-Discord has quit [Remote host closed the connection]
Armbian-Discord has joined #armbian-amlogic
<Armbian-Discord> <r​pardini> Nah. I haven't plugged anything into my HC4's USB2 port for years. Try: update u-boot, first to 22.10, then to 23.01, then go hunting for patches. A fix/revert for the HC4 usb has posted to kernel list -- that might take a while to trickle down to u-boot sources.
<Armbian-Discord> <n​armstrong> Hmm I think I never tested the usb on the hc4 since boot from usb, I’ll have a try this week
<Armbian-Discord> <A​oyfe> USB works once I'm in Linux, it just doesn't work in u-boot.
<Armbian-Discord> <A​oyfe> The problem appears to be that u-boot doesn't have a driver for it, which is sort of interesting since the vendor ID indicates it's a "Linux Foundation root hub"
<Armbian-Discord> <r​pardini> That 1: Hub, USB Revision 3.0 there could indicate a C4 thing leaking into the HC4, maybe...?
<Armbian-Discord> <A​oyfe> I think the ethernet and a couple other devices are on USB.
<Armbian-Discord> <T​enkawa> Sounds like Broadcom....
<Armbian-Discord> <T​enkawa> heh
<Armbian-Discord> <T​enkawa> Why would they want to be like them
<Armbian-Discord> <T​onymac32> Drivers maybe, but I feel like anything before these newest Amlogics were supported fast enough not to f around with that
<Armbian-Discord> <c​0rnelius> Hmm. I just booted the Le Potato using USB. Must be able to do it on the HC4.
<Armbian-Discord> <A​oyfe> Yeah, I'm sure it's possible, just seems weird that it doesn't work out of the box
<Armbian-Discord> <A​oyfe> When building u-boot using https://github.com/LibreELEC/amlogic-boot-fip so that I can flash it to SPI, do I use u-boot.bin or u-boot.bin.sd.bin?
<Armbian-Discord> <A​oyfe> nevermind, it's u-boot.bin . Anyway, updating to 2023.01 doesn't solve the issue.
<Armbian-Discord> <A​oyfe> @rpardini Is this the patch you were referring to? https://lore.kernel.org/linux-arm-kernel/20230104140608.28432-1-nemunaire@nemunai.re/T/
<Armbian-Discord> <r​pardini> yeah but that's kernel and I'm sure if/how does that apply to u-boot, or if that's reverting something that never ever made it to u-boot, etc.
<Armbian-Discord> <A​oyfe> Looks like it applies
<Armbian-Discord> <A​oyfe> This is the part where I sheepishly admit that I have never dealt with diffs from an e-mail list before. Is there any way to easily take the patch body in that email and apply it to the u-boot source?
<Armbian-Discord> <r​pardini> dude it's 2 lines, don't overcomplicate things
<Armbian-Discord> <A​oyfe> Fair 😛
<Armbian-Discord> <r​pardini> "how can I apply a patch to a file in a project to another"
<Armbian-Discord> <r​pardini> 😛
<Armbian-Discord> <A​oyfe> I'm trying to generate the patch so that I can leverage Talos' build chain.
<Armbian-Discord> <r​pardini> append .patch to the commit URL in github or such
<Armbian-Discord> <A​oyfe> All good, just manually made the changes locally and generated the patch
<Armbian-Discord> <c​0rnelius> The way I got this to work was creating a boot img "contains a boot script" for SD and then flashing the OS to USB. So it boots from SD first, finds the script and loads the USB.
<Armbian-Discord> <c​0rnelius> there is nothing on the SD but the script and I flashed u-boot to it.
<Armbian-Discord> <A​oyfe> Right, the problem here seems to be that u-boot has no idea how to deal with the USB hub.
<Armbian-Discord> <A​oyfe> So it doesn't even detect that there's a USB device there to boot from.
<Armbian-Discord> <c​0rnelius> it looks disabled in the dts ```
<Armbian-Discord> <c​0rnelius> &usb2_phy0 {
<Armbian-Discord> <c​0rnelius> status = "disabled";
<Armbian-Discord> <c​0rnelius> };
<Armbian-Discord> <c​0rnelius> ```
<Armbian-Discord> <c​0rnelius> Hmm. I got this Tritium H5 to USB boot as well. I suspect you just need to patch that DTS u-boot file.
<Armbian-Discord> <A​oyfe> Yeah the patch from my link looks like it enables it. I'll test it shortly
<Armbian-Discord> <c​0rnelius> ah i guess I should have read up. didn't notice ur link.