WIP: update linux devterm to latest #551
12 changed files with 1453 additions and 100 deletions
|
@ -10,11 +10,13 @@
|
|||
networking.hostName = "devterm";
|
||||
imports = [
|
||||
./desktop.nix
|
||||
"${nixos-hardware}/raspberry-pi/4/pkgs-overlays.nix"
|
||||
];
|
||||
boot.loader = {
|
||||
grub.enable = lib.mkDefault false;
|
||||
generic-extlinux-compatible.enable = lib.mkDefault true;
|
||||
};
|
||||
hardware.raspberry-pi."4".apply-overlays-dtmerge.enable = true;
|
||||
boot.initrd = {
|
||||
includeDefaultModules = false;
|
||||
availableKernelModules = [
|
||||
|
@ -54,7 +56,7 @@
|
|||
};
|
||||
networking.networkmanager.enable = true;
|
||||
users.users.darkkirb.extraGroups = ["networkmanager"];
|
||||
hardware.deviceTree.filter = "*rpi*.dtb";
|
||||
hardware.deviceTree.filter = "bcm2711-rpi-cm4.dtb";
|
||||
hardware.deviceTree.overlays = [
|
||||
{
|
||||
name = "dwc2";
|
||||
|
@ -64,6 +66,10 @@
|
|||
name = "cma";
|
||||
dtsFile = ./devterm/cma-overlay.dts;
|
||||
}
|
||||
{
|
||||
name = "i2c0-overlay";
|
||||
dtsFile = ./devterm/i2c0-overlay.dts;
|
||||
}
|
||||
{
|
||||
name = "vc4-kms-v3d-pi4";
|
||||
dtsFile = ./devterm/vc4-kms-v3d-pi4-overlay.dts;
|
||||
|
|
|
@ -113,14 +113,14 @@
|
|||
status = "okay";
|
||||
};
|
||||
};
|
||||
fragment@18 {
|
||||
/*fragment@18 {
|
||||
target = <&audio>;
|
||||
__overlay__ {
|
||||
brcm,disable-headphones = <0x00>;
|
||||
status = "okay";
|
||||
bcrm,disable-hdmi;
|
||||
};
|
||||
};
|
||||
};*/
|
||||
fragment@19 {
|
||||
target-path = "/chosen";
|
||||
__overlay__ {
|
||||
|
|
83
config/devterm/i2c0-overlay.dts
Normal file
83
config/devterm/i2c0-overlay.dts
Normal 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";
|
||||
};
|
||||
};
|
|
@ -1,7 +1,7 @@
|
|||
/dts-v1/;
|
||||
/plugin/;
|
||||
/ {
|
||||
compatible = "bcrm,bcm2711";
|
||||
compatible = "brcm,bcm2711";
|
||||
fragment@0 {
|
||||
target = <&spi>;
|
||||
__overlay__ {
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* vc4-fkms-v3d-overlay.dts
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
/plugin/;
|
||||
|
||||
|
@ -15,7 +18,7 @@
|
|||
fragment@2 {
|
||||
target = <&firmwarekms>;
|
||||
__overlay__ {
|
||||
status = "disabled";
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -32,4 +35,10 @@
|
|||
status = "okay";
|
||||
};
|
||||
};
|
||||
fragment@5 {
|
||||
target-path = "/chosen";
|
||||
__overlay__ {
|
||||
bootargs = "clk_ignore_unused";
|
||||
};
|
||||
};
|
||||
};
|
|
@ -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
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
{fetchFromGitHub}: let
|
||||
source = builtins.fromJSON (builtins.readFile ./devterm.json);
|
||||
in
|
||||
fetchFromGitHub {
|
||||
owner = "clockworkpi";
|
||||
repo = "DevTerm";
|
||||
inherit (source) rev sha256;
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
{fetchFromGitHub}: let
|
||||
source = builtins.fromJSON (builtins.readFile ./kernel.json);
|
||||
in
|
||||
fetchFromGitHub {
|
||||
owner = "raspberrypi";
|
||||
repo = "linux";
|
||||
inherit (source) rev sha256;
|
||||
}
|
|
@ -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
|
||||
}
|
|
@ -2,21 +2,22 @@
|
|||
callPackage,
|
||||
buildLinux,
|
||||
lib,
|
||||
linuxKernel,
|
||||
...
|
||||
} @ args: let
|
||||
devterm = callPackage ./devterm.nix {};
|
||||
in
|
||||
} @ args:
|
||||
buildLinux (
|
||||
args
|
||||
// {
|
||||
src = callPackage ./kernel-source.nix {};
|
||||
version = "5.10.17-v8";
|
||||
src = linuxKernel.packages.linux_rpi4.kernel.src;
|
||||
version = linuxKernel.packages.linux_rpi4.kernel.modDirVersion + "-v8";
|
||||
defconfig = "bcm2711_defconfig";
|
||||
autoModules = false;
|
||||
kernelPatches = [
|
||||
kernelPatches =
|
||||
linuxKernel.packages.linux_rpi4.kernel.kernelPatches
|
||||
++ [
|
||||
{
|
||||
name = "devterm";
|
||||
patch = "${devterm}/Code/patch/cm4/cm4_kernel_0704.patch";
|
||||
patch = ./linux-devterm.patch;
|
||||
extraStructuredConfig = with lib.kernel; {
|
||||
AXP20X_ADC = module;
|
||||
AXP20X_POWER = module;
|
||||
|
@ -33,11 +34,6 @@ in
|
|||
FW_LOADER_COMPRESS = yes;
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "subcmd-util";
|
||||
patch = ./subcmd-util.patch;
|
||||
extraConfig = "";
|
||||
}
|
||||
];
|
||||
enableCommonConfig = false;
|
||||
}
|
||||
|
|
1328
packages/linux/devterm/linux-devterm.patch
Normal file
1328
packages/linux/devterm/linux-devterm.patch
Normal file
File diff suppressed because it is too large
Load diff
|
@ -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
|
Loading…
Reference in a new issue