starfive visionfive2: replace 8GB memory patch with overlay

This commit is contained in:
Jakob Leifhelm 2023-05-23 19:05:21 +02:00
parent 71ce85372a
commit e2864d99fd
No known key found for this signature in database
GPG key ID: 6817AA0238100822
5 changed files with 52 additions and 18 deletions

View file

@ -31,10 +31,6 @@ Create and configure the `flake.nix` file:
# 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;
@ -57,3 +53,33 @@ Build the sd image.
``` sh
nix build .#
```
## Additional configuration
Additional configuration may be needed depending on your specific hardware configuration.
### Board rev 1.2A
If you have the 1.2A board revision add the following to your config:
``` nix
hardware.deviceTree.name =
lib.mkDefault "starfive/jh7110-starfive-visionfive-2-v1.2a.dtb";
```
### 8GB memory
If your board has 8GB of RAM add the following to your config:
#### Board rev 1.3B
``` nix
hardware.deviceTree.overlays = [{
name = "8GB-patch";
dtsFile =
"${nixos-hardware}/starfive/visionfive/v2/visionfive-2-v1.3b-8GB.dts";
}];
```
#### Board rev 1.2A
``` nix
hardware.deviceTree.overlays = [{
name = "8GB-patch";
dtsFile =
"${nixos-hardware}/starfive/visionfive/v2/visionfive-2-v1.2a-8GB.dts";
}];
```

View file

@ -1,13 +0,0 @@
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 {

View file

@ -15,7 +15,6 @@ let
inherit modDirVersion;
kernelPatches = [
{ patch = ./fix-memory-size.patch; }
{
patch = fetchpatch {
url =

View file

@ -0,0 +1,11 @@
/dts-v1/;
/plugin/;
/ {
compatible = "starfive,visionfive-2-v1.2a", "starfive,jh7110";
fragment@0 {
target-path = "/memory@40000000";
__overlay__ {
reg = <0x0 0x40000000 0x2 0x0>;
};
};
};

View file

@ -0,0 +1,11 @@
/dts-v1/;
/plugin/;
/ {
compatible = "starfive,visionfive-2-v1.3b", "starfive,jh7110";
fragment@0 {
target-path = "/memory@40000000";
__overlay__ {
reg = <0x0 0x40000000 0x2 0x0>;
};
};
};