Skip to content

robinfinkelmann/fml13v01-nixos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

This repo attempts to port NixOS to the first generation RiscV board by DeepComputing for the Framework 13 laptop (known as fml13v01).

What works

  • Cross-compilation
  • Native compilation
  • Linux 6.17 from nixpkgs (some hardware support missing, i.e. GPU and VPU drivers)
  • Vendor's Linux 6.6.20 (does not compile)
  • Vendor's u-boot (even with graphics!)
  • u-boot from nixpkgs (compiles and launches, but does not boot)
  • edk2 (not yet attempted)
  • GPU drivers
  • VPU drivers
  • Network
  • Nix
  • NixOS
  • Many nixpkgs

Compilation

As native performance of the fml13v01's CPU is sub-par, this repo cross-compiles from x86_64-linux by default. For first boot, building an sd image is required. For subsequent updates, using a remote building / deployment configuration via SSH is recommended.

Kernel

For now, the port only works with the latest upstream linux kernel. This, however, does not contain GPU or VPU drivers, therefore no display output is active.

An effort is ongoing to compile the vendor's 6.6.20 linux kernel.

U-Boot

For now, the port only works with the vendor's u-boot environment. The upstream u-boot does compile and start, and should support the hardware, however it can by default not boot into NixOS successfully. This is due to sysboot not being available in the u-boot environment. Adapting the u-boot derivation or switching to a different boot mechanism might work, and would be desirable.

OpenSBI

There was no apparent difference between usig the upstream or the vendor's OpenSBI, which is why the upstream OpenSBI is chosen. In contrast to nixos-hardware's VisionFive-v2 port, we package OpenSBI with a payload of u-boot, instead of the other way around (at least that's how I understand it).

Usage

As this project is still quite unstable and early in development, I recommend cloning / forking and adjusting stuff to your needs from there.

Using this flake standalone:

Clone the repo on an x86_64-linux host, then build the sd image:

nix build .

The resulting image can then be copied to an sd card:

dd if=result/sd-image/<name>.img /dev/<sd-blockdevice> status=progress

The board should successfully boot into NixOS when powered on. The first boot might take a couple extra minutes, when resizing the filesystem to fit the sd card.

For now, there is no display output after the u-boot process. However, network should be available, allowing you to use ssh to connect.

If you need a serial connection, follow the guide by DeepComputing. Note that you need a USB-C cable that supports side-band-use (SBU), e.g. DisplayPort Alt Mode or Thunderbolt. When in doubt, check the cable for continuity on SBU1/2 using two USB-C breakout boards. Also note that you might need to rotate the USB-C cable for success, depending on the type of breakout board you use (ironic, I know).

Using this flake as a NixOS module:

TODO

Impoorting this flake into a seperate flake's NixOS config

Warning: This setup is not tested by me!

Import this repo into your flake:

{
    inputs.fml13v01-nixos = {
        url = "github:robinfinkelmann/fml13v01-nixos";
        inputs.nixpkg.follows = "nixpkgs";
    };
}

Copy the NixOS config from this repo into your own flake, and adjust the import:

{ config, ... }: {
    imports = [
    "${fml13v01-nixos}/fml13v01/sd-image-installer.nix"
    ];

    # Rest of the config
};

Provide a package for the sd image:

{
    outputs.packages.x86_64-linux.fml13v01-sdImage = self.outputs.nixosConfigurations.fml13v01.config.system.build.sdImage;
}

Then build the sd image:

nix build .#fml13v01-sdImage

Structure

Useful references

About

NixOS for the DeepComputing RiscV board for Framework 13

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages