From 5051632234d256135f63c89a87b4a5137a9d4ad6 Mon Sep 17 00:00:00 2001 From: Karolis Stasaitis Date: Sat, 18 Oct 2025 12:10:33 +0200 Subject: [PATCH] intel/compute-stick/stck1a: init --- README.md | 1 + flake.nix | 1 + intel/compute-stick/stck1a/README.md | 8 ++++ intel/compute-stick/stck1a/default.nix | 8 ++++ .../stck1a/dsl/sd-slot-cd-gpio-fix.dsl | 29 +++++++++++ intel/compute-stick/stck1a/sd-slot-fix.nix | 48 +++++++++++++++++++ 6 files changed, 95 insertions(+) create mode 100644 intel/compute-stick/stck1a/README.md create mode 100644 intel/compute-stick/stck1a/default.nix create mode 100644 intel/compute-stick/stck1a/dsl/sd-slot-cd-gpio-fix.dsl create mode 100644 intel/compute-stick/stck1a/sd-slot-fix.nix diff --git a/README.md b/README.md index cb5134948..269ee6caf 100644 --- a/README.md +++ b/README.md @@ -234,6 +234,7 @@ See code for all available configurations. | [HP Probook 460G11](hp/probook/460g11) | `` | `hp-probook-46011` | | [Huawei Matebook X Pro (2020)](huawei/machc-wa) | `` | `huawei-machc-wa` | | [i.MX8QuadMax Multisensory Enablement Kit](nxp/imx8qm-mek/) | `` | `nxp-imx8qm-mek` | +| [Intel Compute Stick STCK1A](intel/compute-stick/stck1a/) | `` | `intel-compute-stick-stck1a` | | [Intel NUC 5i5RYB](intel/nuc/5i5ryb/) | `` | `intel-nuc-5i5ryb` | | [Intel NUC 8i7BEH](intel/nuc/8i7beh/) | `` | `intel-nuc-8i7beh` | | [Kobol Helios4](kobol/helios4) | `` | `kobol-helios-4` | diff --git a/flake.nix b/flake.nix index 32fb1e0f8..b9c0ecb1c 100644 --- a/flake.nix +++ b/flake.nix @@ -166,6 +166,7 @@ hp-laptop-14s-dq2024nf = import ./hp/laptop/14s-dq2024nf; huawei-machc-wa = import ./huawei/machc-wa; hp-notebook-14-df0023 = import ./hp/notebook/14-df0023; + intel-compute-stick-stck1a = import ./intel/compute-stick/stck1a; intel-nuc-5i5ryb = import ./intel/nuc/5i5ryb; intel-nuc-8i7beh = import ./intel/nuc/8i7beh; lenovo-ideacentre-k330 = import ./lenovo/ideacentre/k330; diff --git a/intel/compute-stick/stck1a/README.md b/intel/compute-stick/stck1a/README.md new file mode 100644 index 000000000..f8d534d09 --- /dev/null +++ b/intel/compute-stick/stck1a/README.md @@ -0,0 +1,8 @@ +# Intel Compute Stick (STCK1A) + +## Supported Devices + +* STCK1A32WFC +* STCK1A32WFCR +* STCK1A32WFCL +* STCK1A8LFC diff --git a/intel/compute-stick/stck1a/default.nix b/intel/compute-stick/stck1a/default.nix new file mode 100644 index 000000000..eeed4d18e --- /dev/null +++ b/intel/compute-stick/stck1a/default.nix @@ -0,0 +1,8 @@ +{ lib, pkgs, ... }: + +{ + imports = [ + ../../../common/cpu/intel/bay-trail + ./sd-slot-fix.nix + ]; +} diff --git a/intel/compute-stick/stck1a/dsl/sd-slot-cd-gpio-fix.dsl b/intel/compute-stick/stck1a/dsl/sd-slot-cd-gpio-fix.dsl new file mode 100644 index 000000000..92215ea76 --- /dev/null +++ b/intel/compute-stick/stck1a/dsl/sd-slot-cd-gpio-fix.dsl @@ -0,0 +1,29 @@ +DefinitionBlock ("sd-slot-cd-gpio-fix.aml", "SSDT", 5, "NIXOS", "SDHDFIX", 0x00000001) +{ + External (\_SB.SDHD, DeviceObj) + + Scope (\_SB.SDHD) + { + Name (_DSD, Package () + { + ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), + Package () + { + /* + * The sdhci-acpi driver expects a cd (card-detect) GPIO + * from the first Gpio/GpioInt entry in the device's _CRS. + * + * Unfortunately, the first entry is a GpioInt, which the driver + * cannot use for card detection (it only supports plain Gpio). + * + * As a result, the driver fails to detect the SD card. + * + * This SSDT patch explicitly directs the driver to use + * the second Gpio resource (index 1), which is the correct + * Gpio entry for card detection. + */ + Package () { "gpios", Package () { ^SDHD, 1, 0, 0 } }, + } + }) + } +} diff --git a/intel/compute-stick/stck1a/sd-slot-fix.nix b/intel/compute-stick/stck1a/sd-slot-fix.nix new file mode 100644 index 000000000..63eaaf23f --- /dev/null +++ b/intel/compute-stick/stck1a/sd-slot-fix.nix @@ -0,0 +1,48 @@ +{ + config, + lib, + pkgs, + ... +}: + +let + cfg = config.hardware.intel.compute-stick.stck1a.sd-slot-fix; + sd-slot-fix-overlay-initrd = pkgs.stdenv.mkDerivation { + name = "sd-slot-fix-overlay-initrd"; + src = ./dsl; + + phases = [ + "unpackPhase" + "installPhase" + ]; + + nativeBuildInputs = with pkgs; [ + acpica-tools + cpio + ]; + + installPhase = '' + mkdir -p kernel/firmware/acpi + + iasl -sa sd-slot-cd-gpio-fix.dsl + + cp sd-slot-cd-gpio-fix.aml kernel/firmware/acpi/ + find kernel | cpio -H newc --create > $out + ''; + }; +in +{ + options.hardware = { + intel.compute-stick.stck1a.sd-slot-fix = { + enable = lib.mkEnableOption '' + fix for the Intel Compute Stick STCK1A SD slot. + ''; + }; + }; + + config = lib.mkIf cfg.enable { + boot.initrd.prepend = [ + (toString sd-slot-fix-overlay-initrd) + ]; + }; +}