nixos-riscv/notes.md

7.2 KiB

dev/build TLDRs

  • nix flake show .

  • nix repl followed by :lf . to much about in a REPL

  • nix build .#nixosConfigurations.asgaut.config.system.build.sdImage

  • nix build .#images.asgaut-sd to cross build

  • TODO to build via binfmt emulation

  • zstd -vdcfT4 result/sd-image/*.img.zst | dd of=/dev/sda2 status=progress; sync

VF2 Overview

  • The VisionFive 2
    • Shortname: vf2
    • https://www.kickstarter.com/projects/starfive/visionfive-2
    • https://wiki.rvspace.org/
    • StarFive JH7110 64-bit CPU
      • CPU: quad SiFive U74 1.5GHz cores and comes paired with
      • GPU: BXE-4-32 GPU from Imagination Technologies.
        • OpenGL ES 3.2
        • OpenCL 1.2
        • Vulkan 1.2
      • 2/4/8 GB RAM
      • IO
        • 1x HMDI (up to 4kp30)
        • H.264 decode
        • H.265 decode/encode
        • 2x Gigabit Ethernet
        • 2x USB 2.0
        • 2x USB 3.0
        • 2x M.2 NVMe
        • MIPI CSI
        • MIPI DSI
        • MIPI LCD
        • 4pin GPIO
      • power:
        • 5v DC via USB-C PD up to 30W
        • 5v Dc via GPIO minimum 3A
        • PoE (requires separate hardware module?)
    • Storage
      • SD
      • NVMe
      • SPI flash
    • Their linux tree
  • U-Boot
    • used as firmware and bootloader (instead of GRUB like for x86) on ARM and RISCV
    • Generic Distro Configuration Concept
    • U-Boot is scripted to scan all attached storage devices & partitions and look for a file named /extlinux/extlinux.conf or /boot/extlinux/extlinux.conf

Some VisionFive/RISCV/U-Boot reading

Nix flakes

I'm new lol

nixos builders

github:NickCao/nixos-riscv

sources of interest:

$ nix flake show github:NickCao/nixos-riscv
github:NickCao/nixos-riscv/4ebf1f02b169f2bf6103776633e873d7968bdb32
├───hydraJobs
│   ├───bootrom-unmatched: derivation 'bootrom'
│   ├───bootrom-visionfive: derivation 'bootrom-visionfive'
│   ├───firmware-vf2: derivation 'firmware-vf2-riscv64-unknown-linux-gnu'
│   ├───linux-vf2: derivation 'linux-riscv64-unknown-linux-gnu-6.1.0-vf2'
│   ├───opensbi: derivation 'opensbi-riscv64-unknown-linux-gnu-1.2'
│   ├───opensbi-vf2: derivation 'opensbi-riscv64-unknown-linux-gnu-1.2'
│   ├───qemu: derivation 'qemu-riscv64-unknown-linux-gnu-7.2.0'
│   ├───uboot-unmatched: derivation 'uboot-sifive_unmatched_defconfig-riscv64-unknown-linux-gnu-2022.10'
│   ├───uboot-unmatched-ram: derivation 'uboot-sifive_unmatched_defconfig-riscv64-unknown-linux-gnu-2022.10'
│   ├───uboot-vf2: derivation 'uboot-starfive_visionfive2_defconfig-riscv64-unknown-linux-gnu-f1d959f'
│   ├───uboot-visionfive: derivation 'uboot-starfive_jh7100_visionfive_smode_defconfig-riscv64-unknown-linux-gnu-e068256b4ea2d01562317cd47caab971815ba174'
│   ├───unmatched: derivation 'nixos-sd-image-23.05.20230119.c75b147-riscv64-linux.img-riscv64-unknown-linux-gnu'
│   ├───visionfive: derivation 'nixos-sd-image-23.05.20230119.c75b147-riscv64-linux.img-riscv64-unknown-linux-gnu'
│   └───visionfive2: derivation 'nixos-sd-image-23.05.20230119.c75b147-riscv64-linux.img-riscv64-unknown-linux-gnu'
├───nixosConfigurations
│   ├───qemu: NixOS configuration
│   ├───unmatched: NixOS configuration
│   ├───visionfive: NixOS configuration
│   └───visionfive2: NixOS configuration
└───overlay: Nixpkgs overlay

github:zhaofengli/nixos-riscv64

... no visionfive 2?

$ nix flake show github:zhaofengli/nixos-riscv64
github:zhaofengli/nixos-riscv64/def02c67833bf551288c5cbd8ed6652b255d2fe8
├───hydraJobs
│   └───world
│       ├───simpleSystem: derivation 'nixos-system-nixos-23.05pre-git'
│       ├───tier0: derivation 'tier0'
│       ├───tier1: derivation 'tier1'
│       └───tier2: derivation 'tier2'
├───legacyPackages
│   └───riscv64-linux omitted (use '--legacy' to show)
├───nixosModules
│   ├───unmatched: NixOS module
│   └───visionfive: NixOS module
└───overlay: Nixpkgs overlay

BARF

https://www.waveshare.com/wiki/VisionFive2

https://doc-en.rvspace.org/Doc_Center/visionfive_2.html https://github.com/starfive-tech/VisionFive2 https://github.com/starfive-tech/u-boot https://github.com/u-boot/u-boot/blob/master/doc/board/starfive/visionfive2.rst http://forum.rvspace.org/t/usb-serial-needed/897/4 https://reddit.com/r/RISCV/comments/zy30vl/comment/j3zhzkx/ https://forum.rvspace.org/t/nvme-boot-using-visionfive2-software-v2-11-5/2464/1 https://forum.rvspace.org/t/i-tried-the-v3-0-4-sdcard-img-from-sdcard-and-from-nvme/2965 https://u-boot.readthedocs.io/en/latest/board/starfive/visionfive2.html