WIP: update linux devterm to latest #551

Closed
DarkKirb wants to merge 12 commits from update-linux-devterm into main
12 changed files with 1453 additions and 100 deletions

View file

@ -10,11 +10,13 @@
networking.hostName = "devterm"; networking.hostName = "devterm";
imports = [ imports = [
./desktop.nix ./desktop.nix
"${nixos-hardware}/raspberry-pi/4/pkgs-overlays.nix"
]; ];
boot.loader = { boot.loader = {
grub.enable = lib.mkDefault false; grub.enable = lib.mkDefault false;
generic-extlinux-compatible.enable = lib.mkDefault true; generic-extlinux-compatible.enable = lib.mkDefault true;
}; };
hardware.raspberry-pi."4".apply-overlays-dtmerge.enable = true;
boot.initrd = { boot.initrd = {
includeDefaultModules = false; includeDefaultModules = false;
availableKernelModules = [ availableKernelModules = [
@ -54,7 +56,7 @@
}; };
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
users.users.darkkirb.extraGroups = ["networkmanager"]; users.users.darkkirb.extraGroups = ["networkmanager"];
hardware.deviceTree.filter = "*rpi*.dtb"; hardware.deviceTree.filter = "bcm2711-rpi-cm4.dtb";
hardware.deviceTree.overlays = [ hardware.deviceTree.overlays = [
{ {
name = "dwc2"; name = "dwc2";
@ -64,6 +66,10 @@
name = "cma"; name = "cma";
dtsFile = ./devterm/cma-overlay.dts; dtsFile = ./devterm/cma-overlay.dts;
} }
{
name = "i2c0-overlay";
dtsFile = ./devterm/i2c0-overlay.dts;
}
{ {
name = "vc4-kms-v3d-pi4"; name = "vc4-kms-v3d-pi4";
dtsFile = ./devterm/vc4-kms-v3d-pi4-overlay.dts; dtsFile = ./devterm/vc4-kms-v3d-pi4-overlay.dts;

View file

@ -113,14 +113,14 @@
status = "okay"; status = "okay";
}; };
}; };
fragment@18 { /*fragment@18 {
target = <&audio>; target = <&audio>;
__overlay__ { __overlay__ {
brcm,disable-headphones = <0x00>; brcm,disable-headphones = <0x00>;
status = "okay"; status = "okay";
bcrm,disable-hdmi; bcrm,disable-hdmi;
}; };
}; };*/
fragment@19 { fragment@19 {
target-path = "/chosen"; target-path = "/chosen";
__overlay__ { __overlay__ {

View file

@ -0,0 +1,83 @@
/dts-v1/;
/plugin/;
/{
compatible = "brcm,bcm2711";
fragment@0 {
target = <&i2c0if>;
__overlay__ {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&i2c0_pins>;
};
};
fragment@1 {
target = <&i2c0_pins>;
pins1: __overlay__ {
brcm,pins = <0 1>;
brcm,function = <4>; /* alt0 */
};
};
fragment@2 {
target = <&i2c0_pins>;
pins2: __dormant__ {
brcm,pins = <28 29>;
brcm,function = <4>; /* alt0 */
};
};
fragment@3 {
target = <&i2c0_pins>;
pins3: __dormant__ {
brcm,pins = <44 45>;
brcm,function = <5>; /* alt1 */
};
};
fragment@4 {
target = <&i2c0_pins>;
pins4: __dormant__ {
brcm,pins = <46 47>;
brcm,function = <4>; /* alt0 */
};
};
fragment@5 {
target = <&i2c0>;
__dormant__ {
compatible = "brcm,bcm2708-i2c";
};
};
fragment@6 {
target = <&i2c0mux>;
__overlay__ {
status = "disabled";
};
};
fragment@7 {
target-path = "/aliases";
__overlay__ {
i2c0 = "/soc/i2c@7e205000";
};
};
fragment@8 {
target-path = "/__symbols__";
__overlay__ {
i2c0 = "/soc/i2c@7e205000";
};
};
__overrides__ {
pins_0_1 = <0>,"+1-2-3-4";
pins_28_29 = <0>,"-1+2-3-4";
pins_44_45 = <0>,"-1-2+3-4";
pins_46_47 = <0>,"-1-2-3+4";
combine = <0>, "!5";
};
};

View file

@ -1,7 +1,7 @@
/dts-v1/; /dts-v1/;
/plugin/; /plugin/;
/ { / {
compatible = "bcrm,bcm2711"; compatible = "brcm,bcm2711";
fragment@0 { fragment@0 {
target = <&spi>; target = <&spi>;
__overlay__ { __overlay__ {

View file

@ -1,4 +1,7 @@
// SPDX-License-Identifier: GPL-2.0 /*
* vc4-fkms-v3d-overlay.dts
*/
/dts-v1/; /dts-v1/;
/plugin/; /plugin/;
@ -7,29 +10,35 @@
fragment@1 { fragment@1 {
target = <&fb>; target = <&fb>;
__overlay__ { __overlay__ {
status = "disabled"; status = "disabled";
}; };
}; };
fragment@2 { fragment@2 {
target = <&firmwarekms>; target = <&firmwarekms>;
__overlay__ { __overlay__ {
status = "disabled"; status = "okay";
}; };
}; };
fragment@3 { fragment@3 {
target = <&v3d>; target = <&v3d>;
__overlay__ { __overlay__ {
status = "okay"; status = "okay";
}; };
}; };
fragment@4 { fragment@4 {
target = <&vc4>; target = <&vc4>;
__overlay__ { __overlay__ {
status = "okay"; status = "okay";
}; };
}; };
fragment@5 {
target-path = "/chosen";
__overlay__ {
bootargs = "clk_ignore_unused";
};
};
}; };

View file

@ -1,12 +0,0 @@
{
"url": "https://github.com/clockworkpi/DevTerm.git",
"rev": "9a0598e0877f4bdca207074b2c0e7cb229d290f0",
"date": "2024-06-10T08:02:03-07:00",
"path": "/nix/store/nwfg32dz37g5dmnd5xvcsmp9wh7jq0qq-DevTerm",
"sha256": "1461vicaqnnvfczgxzvq8chkcjk2l178n668dixyx6kfp7rf0b31",
"hash": "sha256-YSzg8rlumu57bMgYi06gYko2IUN4//4+c9tarFjcwZA=",
"fetchLFS": false,
"fetchSubmodules": false,
"deepClone": false,
"leaveDotGit": false
}

View file

@ -1,8 +0,0 @@
{fetchFromGitHub}: let
source = builtins.fromJSON (builtins.readFile ./devterm.json);
in
fetchFromGitHub {
owner = "clockworkpi";
repo = "DevTerm";
inherit (source) rev sha256;
}

View file

@ -1,8 +0,0 @@
{fetchFromGitHub}: let
source = builtins.fromJSON (builtins.readFile ./kernel.json);
in
fetchFromGitHub {
owner = "raspberrypi";
repo = "linux";
inherit (source) rev sha256;
}

View file

@ -1,12 +0,0 @@
{
"url": "https://github.com/raspberrypi/linux",
"rev": "3a33f11c48572b9dd0fecac164b3990fc9234da8",
"date": "2021-04-29T20:34:42+01:00",
"path": "/nix/store/g3cawyxkjchyhz4860d92ql0p6hj2gvj-linux-3a33f11",
"sha256": "154aicn2cd4a6kpnifcb899px6jijg2abavjm3y4w5lfwpipmqck",
"hash": "sha256-k+F64+WOFk78qHKrpcSTUZp+U0KLuWjvNIo0JiyLipQ=",
"fetchLFS": false,
"fetchSubmodules": false,
"deepClone": false,
"leaveDotGit": false
}

View file

@ -2,21 +2,22 @@
callPackage, callPackage,
buildLinux, buildLinux,
lib, lib,
linuxKernel,
... ...
} @ args: let } @ args:
devterm = callPackage ./devterm.nix {}; buildLinux (
in args
buildLinux ( // {
args src = linuxKernel.packages.linux_rpi4.kernel.src;
// { version = linuxKernel.packages.linux_rpi4.kernel.modDirVersion + "-v8";
src = callPackage ./kernel-source.nix {}; defconfig = "bcm2711_defconfig";
version = "5.10.17-v8"; autoModules = false;
defconfig = "bcm2711_defconfig"; kernelPatches =
autoModules = false; linuxKernel.packages.linux_rpi4.kernel.kernelPatches
kernelPatches = [ ++ [
{ {
name = "devterm"; name = "devterm";
patch = "${devterm}/Code/patch/cm4/cm4_kernel_0704.patch"; patch = ./linux-devterm.patch;
extraStructuredConfig = with lib.kernel; { extraStructuredConfig = with lib.kernel; {
AXP20X_ADC = module; AXP20X_ADC = module;
AXP20X_POWER = module; AXP20X_POWER = module;
@ -33,12 +34,7 @@ in
FW_LOADER_COMPRESS = yes; FW_LOADER_COMPRESS = yes;
}; };
} }
{
name = "subcmd-util";
patch = ./subcmd-util.patch;
extraConfig = "";
}
]; ];
enableCommonConfig = false; enableCommonConfig = false;
} }
) )

File diff suppressed because it is too large Load diff

View file

@ -1,29 +0,0 @@
---
tools/lib/subcmd/subcmd-util.h | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/tools/lib/subcmd/subcmd-util.h b/tools/lib/subcmd/subcmd-util.h
index 794a375dad36..7009fc176636 100644
--- a/tools/lib/subcmd/subcmd-util.h
+++ b/tools/lib/subcmd/subcmd-util.h
@@ -49,13 +49,12 @@ static NORETURN inline void die(const char *err, ...)
static inline void *xrealloc(void *ptr, size_t size)
{
- void *ret = realloc(ptr, size);
- if (!ret && !size)
- ret = realloc(ptr, 1);
+ void *ret;
+ if (!size)
+ size = 1;
+ ret = realloc(ptr, size);
if (!ret) {
ret = realloc(ptr, size);
- if (!ret && !size)
- ret = realloc(ptr, 1);
if (!ret)
die("Out of memory, realloc failed");
}
--
2.34.1