Skip to content

Commit

Permalink
Merge pull request #961 from NixOS/revert-958-visionfive2-mainline
Browse files Browse the repository at this point in the history
Revert "starfive visionfive2: use mainline kernel"
  • Loading branch information
Mic92 authored May 29, 2024
2 parents 806e9d4 + 9e06031 commit 8251761
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 10 deletions.
16 changes: 6 additions & 10 deletions starfive/visionfive/v2/default.nix
Original file line number Diff line number Diff line change
@@ -1,16 +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;
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=";
};
}];
kernelPackages = lib.mkDefault (pkgs.callPackage ./linux-6.6.nix {
inherit (config.boot) kernelPatches;
});

kernelParams =
lib.mkDefault [ "console=tty0" "console=ttyS0,115200n8" "earlycon=sbi" ];
Expand Down
26 changes: 26 additions & 0 deletions starfive/visionfive/v2/linux-6.6.nix
Original file line number Diff line number Diff line change
@@ -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 { }))

0 comments on commit 8251761

Please sign in to comment.