From ae64b45fc4c2d2af8d40ebe69704ccf57fca3b81 Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Sun, 5 Mar 2023 18:08:24 +0100 Subject: [PATCH] Add Hardkernel HC4 support --- README.md | 1 + flake.nix | 1 + hardkernel/odroid-hc4/default.nix | 26 ++++++++++++++++++++++++++ 3 files changed, 28 insertions(+) create mode 100644 hardkernel/odroid-hc4/default.nix diff --git a/README.md b/README.md index af1ac31..f5f2517 100644 --- a/README.md +++ b/README.md @@ -202,6 +202,7 @@ See code for all available configurations. | [Microsoft Surface Laptop (AMD)](microsoft/surface/surface-laptop-amd)| ``| | [Microsoft Surface Range (Common Modules)](microsoft/surface/common)| `` | | [Microsoft Surface Pro 3](microsoft/surface-pro/3) | `` | +| [Hardkernel Odroid HC4](hardkernel/odroid-hc4/default.nix) | `` | | [Omen en00015p](omen/en00015p) | `` | | [One-Netbook OneNetbook 4](onenetbook/4) | `` | | [Panasonic Let's Note CF-LX4 ](panasonic/letsnote/cf-lx4) | `` | diff --git a/flake.nix b/flake.nix index c276c1d..4e01a11 100644 --- a/flake.nix +++ b/flake.nix @@ -142,6 +142,7 @@ msi-gs60 = import ./msi/gs60; msi-gl62 = import ./msi/gl62; nxp-imx8qm-mek = import ./nxp/imx8qm-mek; + hardkernel-odroid-hc4 = import ./hardkernel/odroid-hc4; omen-en00015p = import ./omen/en00015p; onenetbook-4 = import ./onenetbook/4; pcengines-apu = import ./pcengines/apu; diff --git a/hardkernel/odroid-hc4/default.nix b/hardkernel/odroid-hc4/default.nix new file mode 100644 index 0000000..804e6b7 --- /dev/null +++ b/hardkernel/odroid-hc4/default.nix @@ -0,0 +1,26 @@ +{ lib, ... }: + +{ + # Based on the config from https://www.armbian.com/odroid-hc4/ + hardware.fancontrol = { + enable = lib.mkDefault true; + config = lib.mkDefault '' + INTERVAL=10 + DEVPATH=hwmon0=devices/virtual/thermal/thermal_zone0 hwmon2=devices/platform/pwm-fan + DEVNAME=hwmon0=cpu_thermal hwmon2=pwmfan + FCTEMPS=hwmon2/pwm1=hwmon0/temp1_input + FCFANS= hwmon2/pwm1=hwmon2/fan1_input + MINTEMP=hwmon2/pwm1=50 + MAXTEMP=hwmon2/pwm1=60 + MINSTART=hwmon2/pwm1=20 + MINSTOP=hwmon2/pwm1=28 + MINPWM=hwmon2/pwm1=0 + MAXPWM=hwmon2/pwm1=255 + ''; + }; + + # Linux 5.15 sometimes crash under heavy network usage + systemd.watchdog.runtimeTime = lib.mkDefault "1min"; + + hardware.deviceTree.filter = "meson-sm1-odroid-hc4.dtb"; +}