- now each arch has its own dt folder, with its own Makefile auto-patched
- simple Makefile autopatching with `add-only: true`
- as example convert 01 null-patch to bare-dt in `dt_32/` (drop from series too)
- Autopatcher was commiting atrocities to the upstream DTs that are so
carefully hand-crafted, by simply rewriting everything, or trying to be
smart and failing at it (`incremental: true`)
- Instead, add `add-only: true` mode, where we simply only ever add to the
end of the Makefile, adding each new .dts and optionally the `subdir-y`
for overlays
- desktop images have half the world in their initrd (plymouth?)
- `bdinfo` shows reserved regions, which are hit depending on the size of initrd
- when reserved region is hit, u-boot says `** Reading file would overwrite reserved memory **`
- done by AI after looking at `bdinfo` reserved regions
- hard lesson: all `0x` hex have to be double quoted, otherwise `Wrong image format for "source" command`
- add note about Meco having conjured up `load_addr` (it's `loadaddr`); doesn't hurt
- while at it, remove copypasta/duplicate bootlogo/consoleargs stanza
- similar to `rkdevflash`, but for Mediatek devices
- also simpler; lk.bin & fip.img are produced by image build and directly used
- requires Rust+Cargo, so add those to hostdeps
- since this is a core extension, those will be included in all Docker images too
- which was bound to happen anyway since Rust in Linux Kernel is no longer an experiment
- extensions/mtkflash: sha1-based bin path, use fork & add `--no-erase-boot1`
- example invocation:
- `BOARD=radxa-nio-12l BRANCH=collabora RELEASE=trixie EXT=ufs,mtkflash MTKFLASH_TTYACM_DEVICE=1`
- u-boot stores env in UFS LUN 1
- use a 2mb offset (different from vendor/Collabora's) to avoid any env conflict
- point fw_printenv/setenv at it at the correct offset and size
- set SRC_CMDLINE, used in extlinux/EXT=u-boot-menu scenarios
- note about d4/d8/d16 irrelevance now as we have RAM autodetection
- note about where the blobs (libdram/libbase/lk.bin) live in GH: https://github.com/armbian/mtkbin
- this patches u-boot default addresses with the same values used in the boot-genio bootscript
- this enables booting extlinux with large kernels and initrd (eg: `EXT=u-boot-menu`)
- backport fixes from upstream u-boot for
- BTRFS (plus enable BTRFS and BZIP2 support for radxa-nio-12l)
- tested with `CARD_DEVICE=/dev/mmcblk1 ROOTFS_TYPE=btrfs BTRFS_COMPRESSION=zstd` (no UFS!)
- also with `EXT=ufs CARD_DEVICE=/dev/sdc ROOTFS_TYPE=btrfs BTRFS_COMPRESSION=zstd` (UFS!)
- 4k block size UFS for UMS: fixes block size issue (USB issues unhandled)
- Enable "bind" command for the Mediatek-standard USB Gadget Ethernet
- this way, one doesn't need to cripple UFS to be able to boot from SD
- USB didn't get the same treatment as it's slow and **not working**...
- ...and beyond me to fix; both OTG and Host mode are funky in u-boot...
- ...but seem to work fine in kernel
- IMPORTANT: keep in mind: "SDcard is NOT UFS (4k block)" and don't fall for traps!
- Network note:
- `setenv ethaddr xx:xx:xx:xx:xx:xx` & `saveenv` & `reset`
- required for network booting; mtk doesn't use random/cpu# MAC
- required for stable MAC in kernel (keep IP from changing, etc)
- Use TFA + libdram to obtain and set the actual memory size.
- Overwrite the memory size in the devicetree that is passed to the kernel with the actual size detected.
- All credit to Bartosz Bilas' work for the mt8188/mt8370.
- This doesn't really "use" TF-A/libdram though, those call bl33 with magic arguments which we read here.
- That is implemented by a patch in TF-A for the mt8195 platform.
- With this, bl2 will pass down the DRAM size it gets from libdram
down to bl33 (u-boot proper) via a magic location
- This is a rework of the implementation for another MTK plat (GRINN)
- genio: implemented complete bootloader build according to Collabora's scripts
- main difference from other similar stack is that TF-A builds final FIP, not u-boot
- thus I first disable ATF build initially, then build it in hook
- alternatively: we could build our own FIP, but that would diverge too much
- declare functions inside hook so hashing does all the versioning automatically
- write_uboot_platform() is a no-op; don't write bootloader to image
- ensure bootloader _builds_ across bookworm/trixie/jammy/noble/resolute
- keep in mind original code is for bookworm (tested to build and work on trixie)
- need to juggle the `-Wl,` prefix on LDFLAGS
- this is not mainline ATF and it does "stupid with flags"
- genio: u-boot: always clean optee & first atf build before building
- so one can switch build host with `DOCKER_ARMBIAN_BASE_IMAGE` (UFS...)
- genio: u-boot: using `armbian/mtkbin` repo
- outputs fip.img & lk.bin directly to output(/images)
- disk images do _not_ contain any bootloader