From 1e3c2a85da63a4eb6dae4fa978064e47bcdbbe74 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Tue, 28 May 2024 18:18:08 -0400 Subject: [PATCH 1/2] Revert "starfive visionfive2: enable required drivers" This reverts commit 03e1d2d5842a730713ab1fdbf0f25d3735019b8c. --- starfive/visionfive/v2/default.nix | 9 --------- 1 file changed, 9 deletions(-) diff --git a/starfive/visionfive/v2/default.nix b/starfive/visionfive/v2/default.nix index dceca67..c4a328f 100644 --- a/starfive/visionfive/v2/default.nix +++ b/starfive/visionfive/v2/default.nix @@ -2,15 +2,6 @@ boot = { consoleLogLevel = lib.mkDefault 7; kernelPackages = lib.mkDefault pkgs.linuxPackages_latest; - kernelPatches = [{ - name = "JH7110"; - patch = pkgs.fetchpatch { - # https://patchwork.kernel.org/project/linux-riscv/patch/20240506034627.66765-1-hal.feng@starfivetech.com/ - name = "v2-riscv-defconfig-Enable-StarFive-JH7110-drivers.patch"; - url = "https://patchwork.kernel.org/series/850668/mbox/"; - hash = "sha256-81Brj61TOUoyVBxrXQh2VU3gTh/1V3uo33ic3sJPk2w="; - }; - }]; kernelParams = lib.mkDefault [ "console=tty0" "console=ttyS0,115200n8" "earlycon=sbi" ]; From 9e0603134617ec23ce67e1806e905ca07abc92d3 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Tue, 28 May 2024 18:18:08 -0400 Subject: [PATCH 2/2] Revert "starfive visionfive2: use mainline kernel" This reverts commit 413452614f52f3f5e7038f8456b6c0082a5594dc. --- starfive/visionfive/v2/default.nix | 7 ++++++- starfive/visionfive/v2/linux-6.6.nix | 26 ++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 starfive/visionfive/v2/linux-6.6.nix diff --git a/starfive/visionfive/v2/default.nix b/starfive/visionfive/v2/default.nix index c4a328f..c1042e1 100644 --- a/starfive/visionfive/v2/default.nix +++ b/starfive/visionfive/v2/default.nix @@ -1,7 +1,12 @@ { 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.linuxPackages_latest; + kernelPackages = lib.mkDefault (pkgs.callPackage ./linux-6.6.nix { + inherit (config.boot) kernelPatches; + }); kernelParams = lib.mkDefault [ "console=tty0" "console=ttyS0,115200n8" "earlycon=sbi" ]; diff --git a/starfive/visionfive/v2/linux-6.6.nix b/starfive/visionfive/v2/linux-6.6.nix new file mode 100644 index 0000000..5999dd6 --- /dev/null +++ b/starfive/visionfive/v2/linux-6.6.nix @@ -0,0 +1,26 @@ +{ 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 { }))