It comes pre-installed with OrangePi branded Ubuntu on the emmc. Unfortunately you cannot boot from the tf card if the emmc has uboot installed on it. You have to use dd an zero out the first 30 meg or so of the emmc in order to boot from tf. This means if you want to dual boot you are going to be swapping tf cards and the emmc cannot be used for any OS which is a bummer as its slightly faster access. I wiped the emmc and have it mounted to /home.
Item | Contents | SD location |
---|---|---|
idbloader.img | TPL & SPL | LBA 64 |
u_boot.itb | U-Boot & ATF | LBA 16384 |
openssl passwd -1 vim etc/shadow
wget https://distfiles.gentoo.org/snapshots/portage-latest.tar.bz2
tar -xf portage-latest.tar.bz2
cd /etc/portage ln -s ../../var/db/repos/gentoo/profiles/default/linux/arm64/17.0 make.profile
COMMON_FLAGS="-march=armv8-a+crc+crypto -mtune=cortex-a72.cortex-a53 -mfix-cortex-a53-835769 -mfix-cortex-a53-843419"
emerge --ask app-misc/ca-certificates
emerge --ask app-misc/wireless-regdb
modprobe sprdwl_ng
fallocate -l 4G /swapfile chmod 600 /swapfile mkswap /swapfile swapon /swafile
blkid >> /etc/fstab vim /etc/fstab UUID=blahblah / ext4 /defaults 0 1 /swapfile swap swap sw 0 0
useradd -m -G users,wheel,audio -s /bin/bash foobar passwd foobar
To enable serial console in gentoo edit inittab:
f0:12345:respawn:/sbin/agetty 1500000 ttyS2 vt100
DTECH UART Cable | |
---|---|
White | RXD |
Green | TXD |
Black | GND |
Red | VCC +5V |
su - screen /dev/ttyUSB0 1500000
Existing kernel doesn't have required settings for GPU!!! Really this is the kernel from vendor supplied image. It's really old, 5.10 so working an updated kernel.
# CONFIG_DRM_PANFROST is not set
The reason it is not set is the code is broken. Source
drivers/gpu/drm/panfrost/panfrost_mmu.c:359:10: error: 'const struct iommu_flush_ops' has no member named 'tlb_flush_leave'; did you mean'tlb_flush_all'?
Looking at a newer kernel that line doesn't exist so I removed it.
static const struct iommu_flush_ops mmu_tlb_ops = { .tlb_flush_all = mmu_tlb_inv_context_s1, .tlb_flush_walk = mmu_tlb_flush_walk, };
It compiles now, but I wonder if I should remove this function as well(I guess I'll do some testing and decide):
static void mmu_tlb_flush_leaf(unsigned long iova, size_t size, size_t granule, void *cookie) { mmu_tlb_sync_context(cookie); }
The module compiles and loads but isn't really functional now.
The orangepi ubuntu based image uses this kernel(5.18). Its slightly newer. I couldn't get it to work with module compression(enabled with XZ compression in the image). It threw an error whenever trying to load a module. Which is really weird as I initially just copied the kernel and modules from the image and it works fine with their image. Something must prevent this from working with the openrc-stage3 from Gentoo but I didn't dig real deep into this. After recompiling without module compression it works other than rfkill.ko appears to hang when loading on boot (required by sprdwl_ng) but eventually completes loading and works fine so I've switched to this kernel for the time being.
Found more recent source(6.8-rc2). It compiles and I get video output but it hangs on first daemon load. This is going to require some more work.