NixOS on RISCV/VisionFive 2: Difference between revisions

m Mention UEFI and EDK2
Onny (talk | contribs)
Update mainline kernel information
Line 31: Line 31:


== Status ==
== Status ==
NixOS runs well on the Visionfive 2 with the current <code>nixos-hardware</code> module https://github.com/NixOS/nixos-hardware/tree/master/starfive/visionfive/v2 (used in the example below); this module bundles an older StarFive custom Linux kernel https://github.com/starfive-tech/linux and its custom firmware for the time being.  
See  https://rvspace.org/en/project/JH7110_Upstream_Plan for an overview of which features are already supported by the latest mainline kernel used by NixOS.  


However, this setup needs to be '''updated, build and tested separately''' from the other NixOS Linux kernel variations, '''which is a large, unmaintainable burden for the NixOS community''' when the VisionFive 2 board is not the only supported SoC; so we don't want that.
Please note that HDMI display patches haven't been merged yet.  


Instead '''we just want to maintain the generic, mainline "upstream" Linux kernel''' for all RISCV baords.
There's also a port of the UEFI reference implementation EDK2 available at https://github.com/starfive-tech/edk2 to support a future generic RISCV Linux image that can be booted from any RISCV device.
 
Luckily, the Visionfive 2 developers have pushed their Linux kernel patches quite early to the upstream mainline kernel and have gotten almost all merged already.
 
'''See  https://rvspace.org/en/project/JH7110_Upstream_Plan for an overview of what device is supported in which Linux kernel version.'''
 
NixOS (more precisely nixpkgs) already has the generic '''Linux kernel 6.9 available, which supports almost everything you need out of the box''' (for a server as HDMI display patches haven't been merged into 6.9). This means NixOS should be able to run without a custom kernel once https://github.com/NixOS/nixos-hardware/pull/958 is merged.
 
Also the NixOS version of the popular boot-loader [https://github.com/u-boot/u-boot U-Boot], used by this board, has already received all required patches to fully support this board out-of-the-box.
 
There's even a port of the UEFI reference implementation EDK2 available at https://github.com/starfive-tech/edk2 to support a future generic RISCV Linux image that can be booted from any RISCV device.


= Building a SD-card image =
= Building a SD-card image =