From 0cc1214203def995d0863a389bbbe002c24a377f Mon Sep 17 00:00:00 2001 From: Jakob Leifhelm Date: Sun, 16 Apr 2023 22:43:32 +0200 Subject: [PATCH 01/10] Init starfive visionfive 2 --- flake.nix | 1 + starfive/visionfive/v2/README.md | 5 ++ starfive/visionfive/v2/default.nix | 25 +++++++++ starfive/visionfive/v2/firmware.nix | 56 +++++++++++++++++++ starfive/visionfive/v2/fix-memory-size.patch | 13 +++++ starfive/visionfive/v2/linux_6_3.nix | 28 ++++++++++ starfive/visionfive/v2/opensbi.nix | 42 ++++++++++++++ starfive/visionfive/v2/sd-image-installer.nix | 11 ++++ starfive/visionfive/v2/sd-image.nix | 51 +++++++++++++++++ starfive/visionfive/v2/spl-tool.nix | 18 ++++++ starfive/visionfive/v2/uboot.nix | 20 +++++++ 11 files changed, 270 insertions(+) create mode 100644 starfive/visionfive/v2/README.md create mode 100644 starfive/visionfive/v2/default.nix create mode 100644 starfive/visionfive/v2/firmware.nix create mode 100644 starfive/visionfive/v2/fix-memory-size.patch create mode 100644 starfive/visionfive/v2/linux_6_3.nix create mode 100644 starfive/visionfive/v2/opensbi.nix create mode 100644 starfive/visionfive/v2/sd-image-installer.nix create mode 100644 starfive/visionfive/v2/sd-image.nix create mode 100644 starfive/visionfive/v2/spl-tool.nix create mode 100644 starfive/visionfive/v2/uboot.nix diff --git a/flake.nix b/flake.nix index 8a2f54f..76b5a5a 100644 --- a/flake.nix +++ b/flake.nix @@ -156,6 +156,7 @@ kobol-helios4 = import ./kobol/helios4; samsung-np900x3c = import ./samsung/np900x3c; starfive-visionfive-v1 = import ./starfive/visionfive/v1; + starfive-visionfive-2 = import ./starfive/visionfive/v2; supermicro = import ./supermicro; supermicro-a1sri-2758f = import ./supermicro/a1sri-2758f; supermicro-m11sdv-8c-ln4f = import ./supermicro/m11sdv-8c-ln4f; diff --git a/starfive/visionfive/v2/README.md b/starfive/visionfive/v2/README.md new file mode 100644 index 0000000..10496e7 --- /dev/null +++ b/starfive/visionfive/v2/README.md @@ -0,0 +1,5 @@ +# Creating SD-Image + +``` nix + +``` diff --git a/starfive/visionfive/v2/default.nix b/starfive/visionfive/v2/default.nix new file mode 100644 index 0000000..8cdd608 --- /dev/null +++ b/starfive/visionfive/v2/default.nix @@ -0,0 +1,25 @@ +{ 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_3.nix { inherit (config.boot) kernelPatches; }); + + kernelParams = + lib.mkDefault [ "console=tty0" "console=ttyS0,115200n8" "earlycon=sbi" ]; + + initrd.availableKernelModules = [ + "dw_mmc_starfive" + ]; + + loader = { + grub.enable = lib.mkDefault false; + generic-extlinux-compatible.enable = lib.mkDefault true; + }; + + hardware.deviceTree.name = + lib.mkDefault "starfive/jh7110-starfive-visionfive-2-v1.3b.dtb"; + }; +} diff --git a/starfive/visionfive/v2/firmware.nix b/starfive/visionfive/v2/firmware.nix new file mode 100644 index 0000000..c313068 --- /dev/null +++ b/starfive/visionfive/v2/firmware.nix @@ -0,0 +1,56 @@ +{ callPackage, runCommand, writeText, stdenv, dtc }: +let + uboot = callPackage ./uboot.nix { }; + opensbi = callPackage ./opensbi.nix { + withPayload = "${uboot}/u-boot.bin"; + withFDT = "${uboot}/starfive_visionfive2.dtb"; + }; + spl-tool = callPackage ./spl-tool.nix { }; + its-file = writeText "visionfive2-uboot-fit-image.its" '' + /dts-v1/; + + / { + description = "U-boot-spl FIT image for JH7110 VisionFive2"; + #address-cells = <2>; + + images { + firmware { + description = "u-boot"; + data = /incbin/("${opensbi}/share/opensbi/lp64/generic/firmware/fw_payload.bin"); + type = "firmware"; + arch = "riscv"; + os = "u-boot"; + load = <0x0 0x40000000>; + entry = <0x0 0x40000000>; + compression = "none"; + }; + }; + + configurations { + default = "config-1"; + + config-1 { + description = "U-boot-spl FIT config for JH7110 VisionFive2"; + firmware = "firmware"; + }; + }; + }; + ''; +in { + inherit opensbi uboot; + spl = runCommand "starfive-visionfive2-spl" { } '' + mkdir -p $out/share/starfive-visionfive2/ + ln -s ${uboot}/u-boot-spl.bin . + ${spl-tool}/bin/spl_tool -c -f ./u-boot-spl.bin + cp u-boot-spl.bin.normal.out $out/share/starfive-visionfive2/spl.bin + ''; + uboot-fit-image = stdenv.mkDerivation { + name = "starfive-visionfive2-uboot-fit-image"; + nativeBuildInputs = [ dtc ]; + phases = [ "installPhase" ]; + installPhase = '' + mkdir -p $out/share/starfive-visionfive2/ + ${uboot}/mkimage -f ${its-file} -A riscv -O u-boot -T firmware $out/share/starfive-visionfive2/visionfive2_fw_payload.img + ''; + }; +} diff --git a/starfive/visionfive/v2/fix-memory-size.patch b/starfive/visionfive/v2/fix-memory-size.patch new file mode 100644 index 0000000..a8bd5bc --- /dev/null +++ b/starfive/visionfive/v2/fix-memory-size.patch @@ -0,0 +1,13 @@ +diff --git a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi +index 752bb0b6fd00..93670da6cabd 100644 +--- a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi ++++ b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi +@@ -30,7 +30,7 @@ cpus { + + memory@40000000 { + device_type = "memory"; +- reg = <0x0 0x40000000 0x1 0x0>; ++ reg = <0x0 0x40000000 0x2 0x0>; + }; + + thermal-zones { diff --git a/starfive/visionfive/v2/linux_6_3.nix b/starfive/visionfive/v2/linux_6_3.nix new file mode 100644 index 0000000..88c7887 --- /dev/null +++ b/starfive/visionfive/v2/linux_6_3.nix @@ -0,0 +1,28 @@ +{ lib, callPackage, linuxPackagesFor, kernelPatches, fetchpatch, ... }: + +let + modDirVersion = "6.3.0-rc3"; + linuxPkg = { lib, fetchFromGitHub, buildLinux, ... }@args: + buildLinux (args // { + version = "${modDirVersion}-starfive-visionfive2"; + + src = fetchFromGitHub { + owner = "starfive-tech"; + repo = "linux"; + rev = "2a6909fb414dfc72ae391791ec6edc3eedd13e6f"; + sha256 = "sha256-FeY6N+hk0PTpuIuA1hkcS+B+ozn6iHV6YaRVx1kuYHc="; + }; + + inherit modDirVersion; + kernelPatches = [{ patch = ./fix-memory-size.patch; }] ++ kernelPatches; + + structuredExtraConfig = with lib.kernel; { + PL330_DMA = no; + PINCTRL_STARFIVE_JH7110_SYS = yes; + SERIAL_8250_DW = yes; + }; + + extraMeta.branch = "JH7110_VisionFive2_upstream"; + } // (args.argsOverride or { })); + +in lib.recurseIntoAttrs (linuxPackagesFor (callPackage linuxPkg { })) diff --git a/starfive/visionfive/v2/opensbi.nix b/starfive/visionfive/v2/opensbi.nix new file mode 100644 index 0000000..6a7e84f --- /dev/null +++ b/starfive/visionfive/v2/opensbi.nix @@ -0,0 +1,42 @@ +{ lib +, stdenv +, fetchFromGitHub +, python3 +, withPlatform ? "generic" +, withPayload ? null +, withFDT ? null +}: + +stdenv.mkDerivation rec { + pname = "opensbi"; + version = "1.3-git-2868f26"; + + src = fetchFromGitHub { + owner = "riscv-software-src"; + repo = "opensbi"; + rev = "2868f26131308ff345382084681ea89c5b0159f1"; + sha256 = "sha256-E+nVFLSpH6lQ2nVmMlVRTr7qYRVY0ULW7gUvAyTr90I="; + }; + + postPatch = '' + patchShebangs ./scripts + ''; + + nativeBuildInputs = [ python3 ]; + + installFlags = [ + "I=$(out)" + ]; + + makeFlags = [ + "PLATFORM=${withPlatform}" + "FW_TEXT_START=0x40000000" + ] ++ lib.optionals (withPayload != null) [ + "FW_PAYLOAD_PATH=${withPayload}" + ] ++ lib.optionals (withFDT != null) [ + "FW_FDT_PATH=${withFDT}" + ]; + + dontStrip = true; + dontPatchELF = true; +} diff --git a/starfive/visionfive/v2/sd-image-installer.nix b/starfive/visionfive/v2/sd-image-installer.nix new file mode 100644 index 0000000..ee9d364 --- /dev/null +++ b/starfive/visionfive/v2/sd-image-installer.nix @@ -0,0 +1,11 @@ +{ modulesPath, ... }: +{ + imports = [ + "${modulesPath}/profiles/installation-device.nix" + ./sd-image.nix + ]; + + # The installation media is also the installation target, + # so we don't want to provide the installation configuration.nix. + installer.cloneConfig = false; +} diff --git a/starfive/visionfive/v2/sd-image.nix b/starfive/visionfive/v2/sd-image.nix new file mode 100644 index 0000000..06af34c --- /dev/null +++ b/starfive/visionfive/v2/sd-image.nix @@ -0,0 +1,51 @@ +{ config, pkgs, lib, modulesPath, ... }: + +let + firmware = pkgs.callPackage ./firmware.nix { }; +in { + imports = [ + "${modulesPath}/profiles/base.nix" + "${modulesPath}/installer/sd-card/sd-image.nix" + ./default.nix + ]; + + sdImage = { + imageName = + "${config.sdImage.imageBaseName}-${config.system.nixos.label}-${pkgs.stdenv.hostPlatform.system}-starfive-visionfive2.img"; + + # Overridden by postBuildCommands + populateFirmwareCommands = ""; + + firmwarePartitionOffset = 4; + firmwareSize = 4; + + postBuildCommands = '' + # preserve root partition + eval $(partx $img -o START,SECTORS --nr 2 --pairs) + + # increase image size for gpt backup header + truncate -s '+2M' $img + + sfdisk $img < Date: Sun, 16 Apr 2023 22:53:29 +0200 Subject: [PATCH 02/10] starfive-visionfive2: Add README.md --- starfive/visionfive/v2/README.md | 53 +++++++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/starfive/visionfive/v2/README.md b/starfive/visionfive/v2/README.md index 10496e7..4dea95f 100644 --- a/starfive/visionfive/v2/README.md +++ b/starfive/visionfive/v2/README.md @@ -1,5 +1,56 @@ -# Creating SD-Image +# Creating a SD-Image +Create and configure the `flake.nix` file: ``` nix +{ + # Kernel is broken on riscv64 see https://github.com/NixOS/nixpkgs/issues/225756 + inputs.nixpkgs.url = + "github:nixos/nixpkgs/c3e12e57c3e3d5c84cc500420be4507b3de33e90"; + inputs.nixos-hardware.url = "github:nixos/nixos-hardware"; + inputs.flake-utils.url = "github:numtide/flake-utils"; + outputs = { self, nixpkgs, nixos-hardware, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + rec { + packages.default = packages.sd-image; + packages.sd-image = (import "${nixpkgs}/nixos" { + configuration = + { config, ... }: { + imports = [ + "${nixos-hardware}/starfive/visionfive/v2/sd-image-installer.nix" + ]; + # If you want to use ssh set a password + # users.users.nixos.password = "super secure password"; + # OR add your public ssh key + # users.users.nixos.openssh.authorizedKeys.keys = [ "ssh-rsa ..." ]; + + # AND configure networking + # networking.interfaces.end0.useDHCP = true; + # networking.interfaces.end1.useDHCP = true; + + # If you have the 2A variant uncomment the following line + # hardware.deviceTree.name = + # lib.mkDefault "starfive/jh7110-starfive-visionfive-2-v1.2a.dtb"; + + # Additional configuration goes here + + sdImage.compressImage = false; + + nixpkgs.crossSystem = { + config = "riscv64-unknown-linux-gnu"; + system = "riscv64-linux"; + }; + + system.stateVersion = "23.05"; + }; + inherit system; + }).config.system.build.sdImage; + }); +} +``` + +Build the sd image. + +``` sh +nix build .# ``` From 34f96de8c9ad390d8717e3ca6260afd5f500de04 Mon Sep 17 00:00:00 2001 From: Jakob Leifhelm Date: Sun, 16 Apr 2023 22:54:39 +0200 Subject: [PATCH 03/10] starfive-visionfive2: add to README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 5da1f79..0fd29dd 100644 --- a/README.md +++ b/README.md @@ -216,6 +216,7 @@ See code for all available configurations. | [Raspberry Pi 4](raspberry-pi/4) | `` | | [Samsung Series 9 NP900X3C](samsung/np900x3c) | `` | | [StarFive VisionFive v1](starfive/visionfive/v1) | `` | +| [StarFive VisionFive 2](starfive/visionfive/v2) | `` | | [Supermicro A1SRi-2758F](supermicro/a1sri-2758f) | `` | | [Supermicro M11SDV-8C-LN4F](supermicro/m11sdv-8c-ln4f) | `` | | [Supermicro X10SLL-F](supermicro/x10sll-f) | `` | From 7b2aec9939065fe56e424a47164906de721c9c84 Mon Sep 17 00:00:00 2001 From: Jakob Leifhelm Date: Tue, 18 Apr 2023 09:15:12 +0200 Subject: [PATCH 04/10] starfive visionfive2: Fix deviceTree name --- starfive/visionfive/v2/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/starfive/visionfive/v2/default.nix b/starfive/visionfive/v2/default.nix index 8cdd608..91a7645 100644 --- a/starfive/visionfive/v2/default.nix +++ b/starfive/visionfive/v2/default.nix @@ -18,8 +18,8 @@ grub.enable = lib.mkDefault false; generic-extlinux-compatible.enable = lib.mkDefault true; }; + }; hardware.deviceTree.name = lib.mkDefault "starfive/jh7110-starfive-visionfive-2-v1.3b.dtb"; - }; } From 4fb7708a20fc1f6ba5de3d3767efed34979c2f56 Mon Sep 17 00:00:00 2001 From: Jakob Leifhelm Date: Tue, 18 Apr 2023 09:19:48 +0200 Subject: [PATCH 05/10] starfive visionfive2: Update spl_tool --- starfive/visionfive/v2/spl-tool.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/starfive/visionfive/v2/spl-tool.nix b/starfive/visionfive/v2/spl-tool.nix index f56841f..3949845 100644 --- a/starfive/visionfive/v2/spl-tool.nix +++ b/starfive/visionfive/v2/spl-tool.nix @@ -6,8 +6,8 @@ stdenv.mkDerivation rec{ src = fetchFromGitHub { owner = "starfive-tech"; repo = "soft_3rdpart"; - rev = "cd7b50cd9f9eca66c23ebd19f06a172ce0be591f"; - sha256 = "sha256-hRmP74gz0Y9KnSwXCjxEiArJE+FonI9rGghZTK54qGs="; + rev = "89ff3396250538548643c3322f74640712b80893"; + sha256 = "sha256-Ni3pBWKgr4bYJb/uJ+5EbSQl6JwWoO2lZFk2Xpi63IA="; sparseCheckout = [ "spl_tool" ]; }; sourceRoot = "source/spl_tool"; From f5298eb1d7be19f8651649cbdf16068b6ce7ad50 Mon Sep 17 00:00:00 2001 From: Jakob Leifhelm Date: Tue, 18 Apr 2023 10:40:20 +0200 Subject: [PATCH 06/10] starfive visionfive2: Fix kernel on nixos-unstable --- starfive/visionfive/v2/README.md | 4 +--- starfive/visionfive/v2/default.nix | 2 +- .../visionfive/v2/{linux_6_3.nix => linux-6.3.nix} | 11 ++++++++++- 3 files changed, 12 insertions(+), 5 deletions(-) rename starfive/visionfive/v2/{linux_6_3.nix => linux-6.3.nix} (70%) diff --git a/starfive/visionfive/v2/README.md b/starfive/visionfive/v2/README.md index 4dea95f..d6655ce 100644 --- a/starfive/visionfive/v2/README.md +++ b/starfive/visionfive/v2/README.md @@ -3,9 +3,7 @@ Create and configure the `flake.nix` file: ``` nix { - # Kernel is broken on riscv64 see https://github.com/NixOS/nixpkgs/issues/225756 - inputs.nixpkgs.url = - "github:nixos/nixpkgs/c3e12e57c3e3d5c84cc500420be4507b3de33e90"; + inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; inputs.nixos-hardware.url = "github:nixos/nixos-hardware"; inputs.flake-utils.url = "github:numtide/flake-utils"; outputs = { self, nixpkgs, nixos-hardware, flake-utils }: diff --git a/starfive/visionfive/v2/default.nix b/starfive/visionfive/v2/default.nix index 91a7645..ffe6a68 100644 --- a/starfive/visionfive/v2/default.nix +++ b/starfive/visionfive/v2/default.nix @@ -5,7 +5,7 @@ lib.mkForce [ "btrfs" "reiserfs" "vfat" "f2fs" "xfs" "ntfs" "cifs" ]; consoleLogLevel = lib.mkDefault 7; kernelPackages = - lib.mkDefault (pkgs.callPackage ./linux_6_3.nix { inherit (config.boot) kernelPatches; }); + lib.mkDefault (pkgs.callPackage ./linux-6.3.nix { inherit (config.boot) kernelPatches; }); kernelParams = lib.mkDefault [ "console=tty0" "console=ttyS0,115200n8" "earlycon=sbi" ]; diff --git a/starfive/visionfive/v2/linux_6_3.nix b/starfive/visionfive/v2/linux-6.3.nix similarity index 70% rename from starfive/visionfive/v2/linux_6_3.nix rename to starfive/visionfive/v2/linux-6.3.nix index 88c7887..f35c071 100644 --- a/starfive/visionfive/v2/linux_6_3.nix +++ b/starfive/visionfive/v2/linux-6.3.nix @@ -14,7 +14,16 @@ let }; inherit modDirVersion; - kernelPatches = [{ patch = ./fix-memory-size.patch; }] ++ kernelPatches; + kernelPatches = [ + { patch = ./fix-memory-size.patch; } + { + patch = fetchpatch { + url = + "https://github.com/torvalds/linux/commit/d83806c4c0cccc0d6d3c3581a11983a9c186a138.diff"; + hash = "sha256-xUnEJkzQRIIBF/0GIpS0Cd+h6OdSiJlyva5xwxtleE0="; + }; + } + ] ++ kernelPatches; structuredExtraConfig = with lib.kernel; { PL330_DMA = no; From 16d6b81a4760d9a4991bcd99b6351e182059cdc5 Mon Sep 17 00:00:00 2001 From: Jakob Leifhelm Date: Sun, 23 Apr 2023 18:11:02 +0200 Subject: [PATCH 07/10] starfive visionfive2: Fix cross compilation --- starfive/visionfive/v2/firmware.nix | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/starfive/visionfive/v2/firmware.nix b/starfive/visionfive/v2/firmware.nix index c313068..97592b3 100644 --- a/starfive/visionfive/v2/firmware.nix +++ b/starfive/visionfive/v2/firmware.nix @@ -1,11 +1,11 @@ -{ callPackage, runCommand, writeText, stdenv, dtc }: +{ callPackage, pkgsBuildHost, runCommand, writeText, stdenv, dtc }: let uboot = callPackage ./uboot.nix { }; opensbi = callPackage ./opensbi.nix { withPayload = "${uboot}/u-boot.bin"; withFDT = "${uboot}/starfive_visionfive2.dtb"; }; - spl-tool = callPackage ./spl-tool.nix { }; + spl-tool = pkgsBuildHost.callPackage ./spl-tool.nix { }; its-file = writeText "visionfive2-uboot-fit-image.its" '' /dts-v1/; @@ -38,12 +38,17 @@ let ''; in { inherit opensbi uboot; - spl = runCommand "starfive-visionfive2-spl" { } '' - mkdir -p $out/share/starfive-visionfive2/ - ln -s ${uboot}/u-boot-spl.bin . - ${spl-tool}/bin/spl_tool -c -f ./u-boot-spl.bin - cp u-boot-spl.bin.normal.out $out/share/starfive-visionfive2/spl.bin - ''; + spl = stdenv.mkDerivation { + name = "starfive-visionfive2-spl"; + depsBuildBuild = [ spl-tool ]; + phases = [ "installPhase" ]; + installPhase = '' + mkdir -p $out/share/starfive-visionfive2/ + ln -s ${uboot}/u-boot-spl.bin . + spl_tool -c -f ./u-boot-spl.bin + cp u-boot-spl.bin.normal.out $out/share/starfive-visionfive2/spl.bin + ''; + }; uboot-fit-image = stdenv.mkDerivation { name = "starfive-visionfive2-uboot-fit-image"; nativeBuildInputs = [ dtc ]; From 2ce2f3f9789a24f4ddd7f925b7b5f67ec8920e33 Mon Sep 17 00:00:00 2001 From: Jakob Leifhelm Date: Sun, 23 Apr 2023 18:43:25 +0200 Subject: [PATCH 08/10] starfive visionfive2: fix flake check --- starfive/visionfive/v2/README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/starfive/visionfive/v2/README.md b/starfive/visionfive/v2/README.md index d6655ce..51e811f 100644 --- a/starfive/visionfive/v2/README.md +++ b/starfive/visionfive/v2/README.md @@ -5,8 +5,13 @@ Create and configure the `flake.nix` file: { inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; inputs.nixos-hardware.url = "github:nixos/nixos-hardware"; + + # Some dependencies of this flake are not yet available on non linux systems + inputs.systems.url = "github:nix-systems/x86_64-linux"; inputs.flake-utils.url = "github:numtide/flake-utils"; - outputs = { self, nixpkgs, nixos-hardware, flake-utils }: + inputs.flake-utils.inputs.systems.follows = "systems"; + + outputs = { self, nixpkgs, nixos-hardware, flake-utils, ... }: flake-utils.lib.eachDefaultSystem (system: rec { packages.default = packages.sd-image; From b0fd96252521a42c2c691c7eb0fffb958b6f49b4 Mon Sep 17 00:00:00 2001 From: Jakob Leifhelm Date: Sat, 29 Apr 2023 16:50:06 +0200 Subject: [PATCH 09/10] starfive visionfive2: update u-boot --- starfive/visionfive/v2/uboot.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/starfive/visionfive/v2/uboot.nix b/starfive/visionfive/v2/uboot.nix index 6a6cd65..be156b7 100644 --- a/starfive/visionfive/v2/uboot.nix +++ b/starfive/visionfive/v2/uboot.nix @@ -6,8 +6,8 @@ buildUBoot { src = fetchFromGitHub { owner = "starfive-tech"; repo = "u-boot"; - rev = "688befadf1d337dee3593e6cc0fe1c737cc150bd"; - sha256 = "sha256-RGADEJRZyuzjblxowdHnhj78eMJBIWnvkwEcpSen5Oo="; + rev = "ac0ac696256abf412826d74ee918dd417e207d7b"; + sha256 = "sha256-cyEMKkTIiET8hnWgD6poZSzfjmRAqUtyRQM0yvNY230="; }; defconfig = "starfive_visionfive2_defconfig"; From 0cfe255229e2f617377feaceb3e890d9cf884125 Mon Sep 17 00:00:00 2001 From: Jakob Leifhelm Date: Sat, 29 Apr 2023 16:50:43 +0200 Subject: [PATCH 10/10] starfive visionfive2: update kernel --- starfive/visionfive/v2/default.nix | 9 ++++----- starfive/visionfive/v2/linux-6.3.nix | 6 +++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/starfive/visionfive/v2/default.nix b/starfive/visionfive/v2/default.nix index ffe6a68..ee1ab3f 100644 --- a/starfive/visionfive/v2/default.nix +++ b/starfive/visionfive/v2/default.nix @@ -4,15 +4,14 @@ supportedFilesystems = lib.mkForce [ "btrfs" "reiserfs" "vfat" "f2fs" "xfs" "ntfs" "cifs" ]; consoleLogLevel = lib.mkDefault 7; - kernelPackages = - lib.mkDefault (pkgs.callPackage ./linux-6.3.nix { inherit (config.boot) kernelPatches; }); + kernelPackages = lib.mkDefault (pkgs.callPackage ./linux-6.3.nix { + inherit (config.boot) kernelPatches; + }); kernelParams = lib.mkDefault [ "console=tty0" "console=ttyS0,115200n8" "earlycon=sbi" ]; - initrd.availableKernelModules = [ - "dw_mmc_starfive" - ]; + initrd.availableKernelModules = [ "dw_mmc_starfive" ]; loader = { grub.enable = lib.mkDefault false; diff --git a/starfive/visionfive/v2/linux-6.3.nix b/starfive/visionfive/v2/linux-6.3.nix index f35c071..0a07584 100644 --- a/starfive/visionfive/v2/linux-6.3.nix +++ b/starfive/visionfive/v2/linux-6.3.nix @@ -1,7 +1,7 @@ { lib, callPackage, linuxPackagesFor, kernelPatches, fetchpatch, ... }: let - modDirVersion = "6.3.0-rc3"; + modDirVersion = "6.3.0-rc4"; linuxPkg = { lib, fetchFromGitHub, buildLinux, ... }@args: buildLinux (args // { version = "${modDirVersion}-starfive-visionfive2"; @@ -9,8 +9,8 @@ let src = fetchFromGitHub { owner = "starfive-tech"; repo = "linux"; - rev = "2a6909fb414dfc72ae391791ec6edc3eedd13e6f"; - sha256 = "sha256-FeY6N+hk0PTpuIuA1hkcS+B+ozn6iHV6YaRVx1kuYHc="; + rev = "a57bdb1d13f93c8fc1b3c668cc74d585bb20f3f8"; + sha256 = "sha256-jnQnJChIGCyJt+zwGfUTsMhrwmWek/ngIM6Pae6OXuI="; }; inherit modDirVersion;