so, this is very rough round the edges, and not even close to being ready for prime-time yet, but...
I have 64-bit Gentoo running on my (4GiB*) Pi4! Screenshot:
Some details. This is using a vanilla bcm2711_defconfig 64-bit kernel (4.19.y), which I cross-compiled on a PC. Following the hints in issue #3032, I also downloaded the latest raspberrypi/tools and cross-compiled armstub8-gic.bin, as follows (NB this is not a tutorial, just a pointer for those who like early-stage hacking):
Code: Select all
user@gentoopc ~ $ git clone https://github.com/raspberrypi/tools.git user@gentoopc ~ $ cd tools/armstubs user@gentoopc ~/tools/armstubs $ make CC8=aarch64-unknown-linux-gnu-gcc \ LD8=aarch64-unknown-linux-gnu-ld \ OBJCOPY8=aarch64-unknown-linux-gnu-objcopy \ OBJDUMP8=aarch64-unknown-linux-gnu-objdump \ armstub8-gic.bin
The (64-bit, ARMv8-A) userland is taken vanilla from the current 1.4.2 release of gentoo-on-rpi3-64bit, but is mounted on a USB stick to avoid SD issues with the current kernel (however, boot is via microSD, as the USB-only boot vector is not yet supported for the Pi4).
To replicate this (again, not a tutorial!), burn a vanilla gentoo-on-rpi3-64bit image to both a microSD card and a USB stick (or drive); preferably a USB3 variant (we'll use this for the rootfs; SD card not usable for root ATM under 64-bit, or at least I couldn't make it work). For simplicity, boot the USB stick on an RPi3B+ or similar once, to allow the initial setup to get done in a controlled environment.
Upgrade the firmware on the microSD card's boot partition's filesystem to the latest version (copy from the current Raspbian Buster release if in doubt).
Copy the armstub8-gic.bin (see above) to your microSD card's boot partition's filesystem (top level directory), along with the kernel8.img, bcm2711-rpi-4-b.dtb, and the overlays/ directory. As usual, copy the module set directory (in this case, 4.19.56-v8+/) to /lib/modules/ on the USB stick's root partition's filesystem.
Modify /boot/cmdline.txt (microSD card) so it reads:
Code: Select all
dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/sda2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait mem=1G
Also modify /boot/config.txt (microSD card) so the only non-commented lines read:
Code: Select all
[pi4] arm_64bit=1 total_mem=1024 enable_gic=1 armstub=armstub8-gic.bin
Once done, attach peripherals (use microHDMI0 port), insert both microSD and USB stick into the Pi4, apply power and pray!
If all is well you should get a relatively clean OpenRC boot into an Xfce4 desktop as above. Once booted, have a play - most things should work fine, and the speed boost moving to the Pi4 (from the 3B/3B+) is pretty impressive!
Note that at the moment, Bluetooth works OK, but WiFi doesn't (although that might just be some userland stuff that needs sorting, haven't looked). Ethernet works. Only framebuffer rendering works. No microSD card visible post-boot.
But these things will get addressed soon, I hope. Once the kernel is in better shape, I'll look to package the Pi4-specific userland bits and release an image.
Acknowledgement: thanks to the various contributors on issue #3032 for pointing the way.
* Memory must currently be clamped to 1GiB given restrictions in the kernel, at the moment; see e.g. commit cdb78ce.
Edited to add link to new 1.5.0 image.