From ff35653b1493d6ae27acb04bf6851e095b23ffea Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Tue, 16 May 2023 19:42:48 +0800 Subject: [PATCH] starfive visionfive2: update kernel to 6.4.0 --- starfive/visionfive/v2/default.nix | 2 +- .../v2/{linux-6.3.nix => linux-6.4.nix} | 22 ++++----- starfive/visionfive/v2/verisilicon.patch | 46 +++++++++++++++++++ 3 files changed, 55 insertions(+), 15 deletions(-) rename starfive/visionfive/v2/{linux-6.3.nix => linux-6.4.nix} (50%) create mode 100644 starfive/visionfive/v2/verisilicon.patch diff --git a/starfive/visionfive/v2/default.nix b/starfive/visionfive/v2/default.nix index ee1ab3f..964b0e5 100644 --- a/starfive/visionfive/v2/default.nix +++ b/starfive/visionfive/v2/default.nix @@ -4,7 +4,7 @@ supportedFilesystems = lib.mkForce [ "btrfs" "reiserfs" "vfat" "f2fs" "xfs" "ntfs" "cifs" ]; consoleLogLevel = lib.mkDefault 7; - kernelPackages = lib.mkDefault (pkgs.callPackage ./linux-6.3.nix { + kernelPackages = lib.mkDefault (pkgs.callPackage ./linux-6.4.nix { inherit (config.boot) kernelPatches; }); diff --git a/starfive/visionfive/v2/linux-6.3.nix b/starfive/visionfive/v2/linux-6.4.nix similarity index 50% rename from starfive/visionfive/v2/linux-6.3.nix rename to starfive/visionfive/v2/linux-6.4.nix index 6d7ed86..d0b8e4e 100644 --- a/starfive/visionfive/v2/linux-6.3.nix +++ b/starfive/visionfive/v2/linux-6.4.nix @@ -1,7 +1,7 @@ -{ lib, callPackage, linuxPackagesFor, kernelPatches, fetchpatch, ... }: +{ lib, callPackage, linuxPackagesFor, kernelPatches, ... }: let - modDirVersion = "6.3.0-rc4"; + modDirVersion = "6.4.0"; linuxPkg = { lib, fetchFromGitHub, buildLinux, ... }@args: buildLinux (args // { version = "${modDirVersion}-starfive-visionfive2"; @@ -9,23 +9,17 @@ let src = fetchFromGitHub { owner = "starfive-tech"; repo = "linux"; - rev = "a57bdb1d13f93c8fc1b3c668cc74d585bb20f3f8"; - sha256 = "sha256-jnQnJChIGCyJt+zwGfUTsMhrwmWek/ngIM6Pae6OXuI="; + rev = "e5a381c51d624ffd8784db908a58ae227d0608a4"; + sha256 = "sha256-gg3+2ITdnpo49UmySiAJnk47STW1I7kF7fsKGBVayRE="; }; inherit modDirVersion; - kernelPatches = [ - { - patch = fetchpatch { - url = - "https://github.com/torvalds/linux/commit/d83806c4c0cccc0d6d3c3581a11983a9c186a138.diff"; - hash = "sha256-xUnEJkzQRIIBF/0GIpS0Cd+h6OdSiJlyva5xwxtleE0="; - }; - } - ] ++ kernelPatches; + kernelPatches = [{ + name = "verisilicon"; + patch = ./verisilicon.patch; + }] ++ kernelPatches; structuredExtraConfig = with lib.kernel; { - PL330_DMA = no; PINCTRL_STARFIVE_JH7110_SYS = yes; SERIAL_8250_DW = yes; }; diff --git a/starfive/visionfive/v2/verisilicon.patch b/starfive/visionfive/v2/verisilicon.patch new file mode 100644 index 0000000..4ef8c1e --- /dev/null +++ b/starfive/visionfive/v2/verisilicon.patch @@ -0,0 +1,46 @@ +From f6df0d69978ceb373d14c9337c4cda74d604f46d Mon Sep 17 00:00:00 2001 +From: Nick Cao +Date: Sat, 1 Jul 2023 17:19:22 +0800 +Subject: [PATCH 1/2] drm/verisilicon: add missing null entry in vs_drm_dt_ids + +--- + drivers/gpu/drm/verisilicon/vs_drv.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/gpu/drm/verisilicon/vs_drv.c b/drivers/gpu/drm/verisilicon/vs_drv.c +index b740fe934035..1255a373f7a2 100644 +--- a/drivers/gpu/drm/verisilicon/vs_drv.c ++++ b/drivers/gpu/drm/verisilicon/vs_drv.c +@@ -258,6 +258,7 @@ static SIMPLE_DEV_PM_OPS(vs_drm_pm_ops, vs_drm_suspend, vs_drm_resume); + + static const struct of_device_id vs_drm_dt_ids[] = { + { .compatible = "verisilicon,display-subsystem", }, ++ {}, + }; + + MODULE_DEVICE_TABLE(of, vs_drm_dt_ids); +-- +2.41.0 + +From f7d2f6e8c6e566cdd441b7bd4710f7628af15dcb Mon Sep 17 00:00:00 2001 +From: Nick Cao +Date: Sat, 1 Jul 2023 17:49:05 +0800 +Subject: [PATCH 2/2] drm/verisilicon: import DMA_BUF namespace + +--- + drivers/gpu/drm/verisilicon/vs_drv.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/gpu/drm/verisilicon/vs_drv.c b/drivers/gpu/drm/verisilicon/vs_drv.c +index 1255a373f7a2..8627027047aa 100644 +--- a/drivers/gpu/drm/verisilicon/vs_drv.c ++++ b/drivers/gpu/drm/verisilicon/vs_drv.c +@@ -299,4 +299,5 @@ module_init(vs_drm_init); + module_exit(vs_drm_fini); + + MODULE_DESCRIPTION("VeriSilicon DRM Driver"); ++MODULE_IMPORT_NS(DMA_BUF); + MODULE_LICENSE("GPL"); +-- +2.41.0 +