[AArch64] Installing NixOS on a CM3588

I’ve ordered a CM3588 (wiki for the board is here) from friendlyelec.com, and only realized after that there is no explicit NixOS support for it, at least none that I can find¹.

However, it’s an AArch64 board and there’s support for e.g. Ubuntu and OpenMediaVault, which means it has to be possible to get working without hardcore kernel hacking (i.e. implementing drivers).

Does anyone here have any experience on how to go about something like getting NixOS to run on the CM3588?

¹ But even if I’d known, that board currently looks like one of the best ways to build an energy efficient NAS. It’s expected energy use is around 7-10W idle, which is about half what you’d expect from a NAS from e.g. Synology.

1 Like

I have that same board, and from the digging I’ve found here is what I’ve found:

  • The closest supported board by NixOS is the NanoPi-R6C.
    • This board does not boot the regular NixOS ARM ISO using U-boot
    • However, EDK2-RK3588 is a UEFI implementation for the SoC (the same SoC as our CM3588), which can be flashed to the eMMC.
    • With the UEFI flashed, the NanoPi-R6C can boot the regular NixOS ARM ISO.
  • EDK2-RK3588 does not support CM3588, but I don’t see any reasons to why it couldn’t
    • It seems they rely on Armbian for the device tree files, and armbian does have support for this board.

So going forward I think we need to add support for the CM3588 in EDK2-RK3588, and then everything will Just Work™ (fingers crossed).

1 Like

I have created an issue here: Board request: NanoPc CM3588 NAS · Issue #142 · edk2-porting/edk2-rk3588 · GitHub

1 Like

This is great, thank you for requesting support for the board.
Now let’s hope they respond with adding support.

I will dig out this thread because the issue on github was closed and I want to continue discussion on the cm3588 running NixOS.

I did find out that the debian image does use less energy than nixos. So far I discovered two differences:

  • the 2.5 gigabit ethernet uses a different kernel module on debian r8125 instead of r8169 on nixos
  • the available scaling frequencies differ debian goes down to 408 MHz where nixos only has 1008 MHz as lowest frequency.

I don’t think this is related to the EDK2 firmware, but maybe to the devicetree for the rk3588 or the cm3588-nas, but I could not find those frequencies in the devicetree files here: linux/arch/arm64/boot/dts/rockchip at master · torvalds/linux · GitHub

Maybe someone has more knowledge to find out where those frequencies get set wrongly. I would assume the extra 1 wattage which nixos consumes could be related to the 2.5x minimum frequency of the cpu cores.

1 Like

For me the extra watt NixOS isn’t even a huge deal, but the heat it generates even at its lowest frequency makes me very uneasy.
I’m starting to think using armbian is the better option until this (and booting from ZFS across 4 SSDs, which I can’t get to work for the life of me, while installing NixOS to, and then also booting from, the slower-and-more-fragile eMMC drive works fine) is fixed.

Some updates from my side: The “wrong” frequency values can be seen in the device tree with the dtc tool (dtc -I fs /proc/device-tree). So maybe it can be fixed by a small overload of the device-tree. I still need to check on debian how the device-tree looks there.

Its also important not to set the device-tree in hardware.deviceTree in your configuration, otherwise the HDMI output won’t work.

Out of curiosity: if not in hardware.deviceTree, then where should it be set? I ask because last time I didn’t set it at all, it resulted in an unbootable config.

I should have been more explicit. You just don’t set the devicetree at all on nixos side. The UEFI already loads a devicetree.

Ok, but that raises a question for me: what EFI firmware are you using?