Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ See code for all available configurations.
| [HP Probook 460G11](hp/probook/460g11) | `<nixos-hardware/hp/probook/460g11>` | `hp-probook-46011` |
| [Huawei Matebook X Pro (2020)](huawei/machc-wa) | `<nixos-hardware/huawei/machc-wa>` | `huawei-machc-wa` |
| [i.MX8QuadMax Multisensory Enablement Kit](nxp/imx8qm-mek/) | `<nixos-hardware/nxp/imx8qm-mek>` | `nxp-imx8qm-mek` |
| [Intel Compute Stick STCK1A](intel/compute-stick/stck1a/) | `<nixos-hardware/intel/compute-stick/stck1a>` | `intel-compute-stick-stck1a` |
| [Intel NUC 5i5RYB](intel/nuc/5i5ryb/) | `<nixos-hardware/intel/nuc/5i5ryb>` | `intel-nuc-5i5ryb` |
| [Intel NUC 8i7BEH](intel/nuc/8i7beh/) | `<nixos-hardware/intel/nuc/8i7beh>` | `intel-nuc-8i7beh` |
| [Kobol Helios4](kobol/helios4) | `<nixos-hardware/kobol/helios4>` | `kobol-helios-4` |
Expand Down
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 8 additions & 0 deletions intel/compute-stick/stck1a/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Intel Compute Stick (STCK1A)

## Supported Devices

* STCK1A32WFC
* STCK1A32WFCR
* STCK1A32WFCL
* STCK1A8LFC
8 changes: 8 additions & 0 deletions intel/compute-stick/stck1a/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{ lib, pkgs, ... }:

{
imports = [
../../../common/cpu/intel/bay-trail
./sd-slot-fix.nix
];
}
29 changes: 29 additions & 0 deletions intel/compute-stick/stck1a/dsl/sd-slot-cd-gpio-fix.dsl
Original file line number Diff line number Diff line change
@@ -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 } },
}
})
}
}
48 changes: 48 additions & 0 deletions intel/compute-stick/stck1a/sd-slot-fix.nix
Original file line number Diff line number Diff line change
@@ -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)
];
};
}