diff --git a/default.nix b/default.nix index a339172..642b075 100644 --- a/default.nix +++ b/default.nix @@ -77,7 +77,7 @@ in // ( if pkgs.system == "riscv64-linux" then { - inherit (pkgsWithOverlay) vf2Kernel vf2KernelPackages; + inherit (pkgsWithOverlay) vf2Kernel; } else {} ) diff --git a/flake.lock b/flake.lock index db040eb..54a608b 100644 --- a/flake.lock +++ b/flake.lock @@ -259,11 +259,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1686752049, - "narHash": "sha256-GtSbXZ6ia/o+f/I5O/5ee8HGmKuwQWZhtyd2u5y5TOk=", + "lastModified": 1686893450, + "narHash": "sha256-QqfAYtYlb0xYY/bFIOoTxBrfNFrv3Z/J/fcZr1uQn9E=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "eafbb465a91939b9a47bc05fcef0f948903755c1", + "rev": "e9705582939a5c4d49527cffc871eed5f73d05dc", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index eb1002e..7379e97 100644 --- a/flake.nix +++ b/flake.nix @@ -121,7 +121,7 @@ // ( if system == "riscv64-linux" then { - inherit (pkgs) vf2Kernel vf2KernelPackages; + inherit (pkgs) vf2Kernel; } else {} ); @@ -129,12 +129,9 @@ modules = import ./modules; lib = import ./lib {inherit pkgs;}; - hydraJobs = - if (system == "x86_64-linux") || (system == "aarch64-linux") - then { - inherit packages devShells formatter; - } - else {}; + hydraJobs = { + inherit packages devShells formatter; + }; } ); } diff --git a/hydra/jobsets.nix b/hydra/jobsets.nix index de7cb4c..4581d4d 100644 --- a/hydra/jobsets.nix +++ b/hydra/jobsets.nix @@ -4,7 +4,7 @@ }: let pkgs = import nixpkgs {}; prs = builtins.fromJSON (builtins.readFile prsJSON); - systems = ["x86_64-linux" "aarch64-linux"]; + systems = ["x86_64-linux" "aarch64-linux" "riscv64-linux"]; nixpkgs_version = ["master"]; mkJobsets = system: version: (builtins.listToAttrs ( diff --git a/linux/vf2/default.nix b/linux/vf2/default.nix index d4496e1..979b795 100644 --- a/linux/vf2/default.nix +++ b/linux/vf2/default.nix @@ -20,34 +20,69 @@ in inherit (source) rev sha256; }; + kernelPatches = with pkgs; [ + # https://lore.kernel.org/all/20230524000012.15028-1-andre.przywara@arm.com/ + rec { + name = "axp15060-1.patch"; + patch = fetchpatch { + inherit name; + url = "https://lore.kernel.org/all/20230524000012.15028-2-andre.przywara@arm.com/raw"; + hash = "sha256-kj4vQaT4CV29EHv8MtuTgM/semIPDdv2dmveo/X27vU="; + }; + } + rec { + name = "axp15060-2.patch"; + patch = fetchpatch { + inherit name; + url = "https://lore.kernel.org/all/20230524000012.15028-3-andre.przywara@arm.com/raw"; + hash = "sha256-QCPQyKqoapMtqEDB9QgAuXA7n8e1OtG+YlIgeSQBxXM="; + }; + } + rec { + name = "axp15060-3.patch"; + patch = fetchpatch { + inherit name; + url = "https://lore.kernel.org/all/20230524000012.15028-4-andre.przywara@arm.com/raw"; + hash = "sha256-SpKDm4PXR6qs7kX5SGVpFF/EPBijMhX1NsFUHrlCynM="; + }; + } + ]; + structuredExtraConfig = with lib.kernel; { - ARCH_STARFIVE = yes; - SOC_STARFIVE = yes; - - SERIAL_8250 = yes; - - NO_HZ_IDLE = yes; CPU_FREQ = yes; CPUFREQ_DT = yes; CPUFREQ_DT_PLATDEV = yes; - HIBERNATION = yes; - + DMADEVICES = yes; GPIO_SYSFS = yes; - POWER_RESET_GPIO_RESET = yes; - + HIBERNATION = yes; + NO_HZ_IDLE = yes; + POWER_RESET_GPIO_RESTART = yes; PROC_KCORE = yes; - PWM = yes; PWM_STARFIVE_PTC = yes; - + RD_GZIP = yes; + SENSORS_SFCTEMP = yes; + SERIAL_8250_DW = yes; SIFIVE_CCACHE = yes; + SIFIVE_PLIC = yes; - V4L_PLATFORM_DRIVERS = no; # TODO: Make module + RTC_DRV_STARFIVE = yes; + SPI_PL022 = yes; + SPI_PL022_STARFIVE = yes; + + I2C = yes; + MFD_AXP20X = yes; + MFD_AXP20X_I2C = yes; + REGULATOR_AXP20X = yes; + + # FATAL: modpost: drivers/gpu/drm/verisilicon/vs_drm: struct of_device_id is not terminated with a NULL entry! DRM_VERISILICON = no; PL330_DMA = no; }; + preferBuiltin = true; + extraMeta = { branch = "JH7110_VisionFive2_upstream"; description = "Linux kernel for StarFive's VisionFive2"; diff --git a/overlay.nix b/overlay.nix index e888306..ca1e3f6 100644 --- a/overlay.nix +++ b/overlay.nix @@ -15,7 +15,6 @@ system: self: super: let riscv-overlay = self: super: { vf2Kernel = self.callPackage ./linux/vf2 {kernelPatches = [];}; - vf2KernelPackages = super.linuxPackagesFor self.vf2Kernel; }; overlays = [