<DC-IRC>
<rpardini> Yes, but needs overlay to write to SPI, pboot self-nuke, but once done/otherwise works like a charm.
<DC-IRC>
<rpardini> Nice, I gotta juggle Armbian's `odroidn2` so it gets `BOOT_TARGET_DEVICES` and a preboot patch (or is there more to it?)
<DC-IRC>
<c0rnelius> Basically for the Odroids, I don't move the `BOOT_TARGET_DEVICES_USB(func) \` up in `meson64.h`, because you need an eMMC or SD to get USB boot working anyway. So instead I create a small img that gets u-boot flashed to it along with a boot `boot.scr` script. ```setenv bootlabel "USB Boot"
<DC-IRC>
<c0rnelius> usb start; if usb dev ${devnum}; then devtype=usb; run scan_dev_for_boot_part; fi
<DC-IRC>
<c0rnelius> ``` I could of course just patch the u-boot and flash the SD, but at the end of the day its basically the same and this way if someone really wanted they could add more options to the boot script.
<DC-IRC>
<Tenkawa> I do like that idea though if the spi can be overwritten could that loader just be flashed right directly into the spi?
<DC-IRC>
<Tenkawa> and then petitboot goes away completely
<DC-IRC>
<Tenkawa> and then you can use all bootable media types with your boot flow
<DC-IRC>
<Tenkawa> (but is it possible?)
<DC-IRC>
<c0rnelius> Would be nice.
<DC-IRC>
<rpardini> yeah, bootscript also works, but I gotta `BOOT_TARGET_DEVICES` for EFI-style boot, not to mention extlinux, although Armbian doesn't use either for meson64, users do...
<DC-IRC>
<rpardini> I've done for a few boards but not all
<DC-IRC>
<c0rnelius> My thing is. Why flash a whole img to an SD or EMMC if at the end of the day, my goal is to run off USB?
<DC-IRC>
<c0rnelius> Its whatever though. It apples and oranges.
<DC-IRC>
<rpardini> nah, idea is user boots off SD once (twice, in N2's case, to enable overlay/dtb for SPI) and `armbian-install` 's it to SPI, then writes <X> to USB and off he goes
<DC-IRC>
<rpardini> single use Armbian, call it.
<DC-IRC>
<c0rnelius> whats this overlay?
<DC-IRC>
<rpardini> not currently an overlay, but a separate DTB, but it's this:
<DC-IRC>
<rpardini> I _really_ gotta go clean up meson64's overlay act
<DC-IRC>
<c0rnelius> how is that erasing pboot?
<DC-IRC>
<rpardini> that allows you to write to SPI, `/dev/mtdblock0` is visible
<DC-IRC>
<c0rnelius> ah gotcha
<DC-IRC>
<rpardini> you nuke pboot from itself (flash_eraseall), since you need physical switch in SPI mode to be able to see SPI at all
<DC-IRC>
<rpardini> so switch to SPI, nuke pboot from itself, (keep switch at SPI, now empty), boot Armbian from SD with `-spi` DTB/overlay, then `/dev/mtdblock0` is yours to flash
<DC-IRC>
<rpardini> it's "the same as HC4" but with "switch instead of button" variant, otherwise the same gotchas
<DC-IRC>
<c0rnelius> hmm. might give this a try.
<DC-IRC>
<c0rnelius> have you tried making it an overlay instead of a DTB?
<DC-IRC>
<rpardini> I was overlay ignorant back then
<DC-IRC>
<rpardini> but yeah should be trivial
<DC-IRC>
<rpardini> the dtsi I wrote from instructions in the DT
<DC-IRC>
<rpardini> I had an (unrelated) requirement for DTB-per-HW-config (deployment scheme required `model` to be unique per HW-config)
<DC-IRC>
<rpardini> so yeah, do overlayify it away
<DC-IRC>
<c0rnelius> how many mtd parts u have to nuke?
<chewitt>
N2 has no need for complex SPI changes; just flick the switch to the right and the device boots from SD or eMMC
<chewitt>
petitcrap is ignored
<chewitt>
if users are too lazy to flick the swtich .. the solution is not software
<DC-IRC>
<c0rnelius> Well I do agree that its not really needed. I did just do it for shits-and-giggles and it does work.
<DC-IRC>
<rpardini> chewitt: yes, but we like mainline u-boot in SPI instead of pboot (enables booting, say, standard Fedora from USB. a bit boring to setup but works)
<DC-IRC>
<rpardini> no idea, I nuke them all.
<DC-IRC>
<c0rnelius> yeah I ended up nuking them all.
<DC-IRC>
<c0rnelius> couldn't get the overlay to work, so I just used one of ur dtbs.
<DC-IRC>
<rpardini> hopefully that worked?
<DC-IRC>
<c0rnelius> @rpardini the DTB worked. The overlay was giving me pinctrl conflicts and I didn't feel like playing with it. DTB was the easy road.