From 0d672e057b0f2fa4ce8f381f87283f79d920559b Mon Sep 17 00:00:00 2001 From: Jonas Heinrich Date: Sat, 1 Jun 2024 22:39:18 +0200 Subject: [PATCH] starfive visionfive2: use mainline kernel Co-authored-by: NickCao --- starfive/visionfive/v2/default.nix | 18 ++++++++++-------- starfive/visionfive/v2/linux-6.6.nix | 26 -------------------------- 2 files changed, 10 insertions(+), 34 deletions(-) delete mode 100644 starfive/visionfive/v2/linux-6.6.nix diff --git a/starfive/visionfive/v2/default.nix b/starfive/visionfive/v2/default.nix index 62cfe6304..ff11abfe7 100644 --- a/starfive/visionfive/v2/default.nix +++ b/starfive/visionfive/v2/default.nix @@ -1,15 +1,10 @@ { 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; - }); + # Switch to latest or LTE as soon they reach >= 6.11 + kernelPackages = lib.mkDefault pkgs.linuxPackages_testing; - kernelParams = - lib.mkDefault [ "console=tty0" "console=ttyS0,115200n8" "earlycon=sbi" ]; + kernelParams = [ "console=tty0" "console=ttyS0,115200n8" "earlycon=sbi" ]; initrd.availableKernelModules = [ "dw_mmc_starfive" ]; @@ -26,4 +21,11 @@ name = "qspi-patch"; dtsFile = ./qspi-patch.dts; }]; + + 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."; + } + ]; } diff --git a/starfive/visionfive/v2/linux-6.6.nix b/starfive/visionfive/v2/linux-6.6.nix deleted file mode 100644 index 5999dd648..000000000 --- a/starfive/visionfive/v2/linux-6.6.nix +++ /dev/null @@ -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 { }))