1
0
Fork 0
mirror of https://github.com/NixOS/nixos-hardware synced 2024-10-18 10:57:22 +02:00

starfive visionfive2: use mainline kernel

Co-authored-by: NickCao <nickcao@nichi.co>
This commit is contained in:
Jonas Heinrich 2024-06-01 22:39:18 +02:00
parent b493dfd4a8
commit cbcd0302c7
2 changed files with 25 additions and 36 deletions

View file

@ -1,21 +1,36 @@
{ config, lib, pkgs, ... }: {
{
config,
lib,
pkgs,
...
}:
{
boot = {
# Force no ZFS (from nixos/modules/profiles/base.nix) until updated to kernel 6.0
supportedFilesystems =
lib.mkForce [ "btrfs" "reiserfs" "vfat" "f2fs" "xfs" "ntfs" "cifs" ];
consoleLogLevel = lib.mkDefault 7;
kernelPackages = lib.mkDefault (pkgs.callPackage ./linux-6.6.nix {
inherit (config.boot) kernelPatches;
});
kernelParams =
lib.mkDefault [ "console=tty0" "console=ttyS0,115200n8" "earlycon=sbi" ];
# Switch to default as soon they reach >= 6.11
kernelPackages = lib.mkDefault pkgs.linuxPackages_latest;
initrd.availableKernelModules = [ "dw_mmc_starfive" ];
# Support booting SD-image from NVME SSD
initrd.kernelModules = [
"clk-starfive-jh7110-aon"
"clk-starfive-jh7110-stg"
"phy-jh7110-pcie"
"pcie-starfive"
"nvme"
];
loader = {
grub.enable = lib.mkDefault false;
generic-extlinux-compatible.enable = lib.mkDefault true;
};
};
assertions = [
{
assertion = lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.11";
message = "The VisionFive 2 requires at least mainline kernel version 6.11 for minimum hardware support.";
}
];
}

View file

@ -1,26 +0,0 @@
{ lib, callPackage, linuxPackagesFor, kernelPatches, ... }:
let
modDirVersion = "6.6.0";
linuxPkg = { lib, fetchFromGitHub, buildLinux, ... }@args:
buildLinux (args // {
version = "${modDirVersion}-starfive-visionfive2";
src = fetchFromGitHub {
owner = "starfive-tech";
repo = "linux";
rev = "13eb70da2a73187c8c7aece13d23d68928aa8210";
hash = "sha256-bwB7Pc+Z+MWXPfWYdgtRGuhqjiNHLDGNCY62e4lBGvE=";
};
inherit modDirVersion kernelPatches;
structuredExtraConfig = with lib.kernel; {
PINCTRL_STARFIVE_JH7110_SYS = yes;
SERIAL_8250_DW = yes;
};
extraMeta.branch = "JH7110_VisionFive2_upstream";
} // (args.argsOverride or { }));
in lib.recurseIntoAttrs (linuxPackagesFor (callPackage linuxPkg { }))