Skip to content

Commit 0be593f

Browse files
committed
intel/compute-stick/stck1a: init
1 parent 9ed85f8 commit 0be593f

File tree

6 files changed

+86
-0
lines changed

6 files changed

+86
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ See code for all available configurations.
234234
| [HP Probook 460G11](hp/probook/460g11) | `<nixos-hardware/hp/probook/460g11>` | `hp-probook-46011` |
235235
| [Huawei Matebook X Pro (2020)](huawei/machc-wa) | `<nixos-hardware/huawei/machc-wa>` | `huawei-machc-wa` |
236236
| [i.MX8QuadMax Multisensory Enablement Kit](nxp/imx8qm-mek/) | `<nixos-hardware/nxp/imx8qm-mek>` | `nxp-imx8qm-mek` |
237+
| [Intel Compute Stick STCK1A](intel/compute-stick/stck1a/) | `<nixos-hardware/intel/compute-stick/stck1a>` | `intel-compute-stick-stck1a` |
237238
| [Intel NUC 5i5RYB](intel/nuc/5i5ryb/) | `<nixos-hardware/intel/nuc/5i5ryb>` | `intel-nuc-5i5ryb` |
238239
| [Intel NUC 8i7BEH](intel/nuc/8i7beh/) | `<nixos-hardware/intel/nuc/8i7beh>` | `intel-nuc-8i7beh` |
239240
| [Kobol Helios4](kobol/helios4) | `<nixos-hardware/kobol/helios4>` | `kobol-helios-4` |

flake.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@
166166
hp-laptop-14s-dq2024nf = import ./hp/laptop/14s-dq2024nf;
167167
huawei-machc-wa = import ./huawei/machc-wa;
168168
hp-notebook-14-df0023 = import ./hp/notebook/14-df0023;
169+
intel-compute-stick-stck1a = import ./intel/compute-stick/stck1a;
169170
intel-nuc-5i5ryb = import ./intel/nuc/5i5ryb;
170171
intel-nuc-8i7beh = import ./intel/nuc/8i7beh;
171172
lenovo-ideacentre-k330 = import ./lenovo/ideacentre/k330;
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Intel Compute Stick (STCK1A)
2+
3+
## Supported Devices
4+
5+
* STCK1A32WFC
6+
* STCK1A32WFCR
7+
* STCK1A32WFCL
8+
* STCK1A8LFC
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{ lib, pkgs, ... }:
2+
3+
{
4+
imports = [
5+
../../../common/cpu/intel/bay-trail
6+
./sd-slot-fix.nix
7+
];
8+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
DefinitionBlock ("sd-slot-cd-gpio-fix.aml", "SSDT", 1, "Vendor", "Accel", 0x00000001)
2+
{
3+
External (\_SB.SDHD, DeviceObj)
4+
5+
Scope (\_SB.SDHD)
6+
{
7+
Name (_DSD, Package ()
8+
{
9+
ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
10+
Package ()
11+
{
12+
/*
13+
* The sdhci-acpi driver expects a cd (card-detect) GPIO
14+
* from the first Gpio/GpioInt entry in the device's _CRS.
15+
*
16+
* Unfortunately, the first entry is a GpioInt, which the driver
17+
* cannot use for card detection (it only supports plain Gpio).
18+
*
19+
* As a result, the driver fails to detect the SD card.
20+
*
21+
* This SSDT patch explicitly directs the driver to use
22+
* the second Gpio resource (index 1), which is the correct
23+
* Gpio entry for card detection.
24+
*/
25+
Package () { "gpios", Package () { ^SDHD, 1, 0, 0 } },
26+
}
27+
})
28+
}
29+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{ config, lib, pkgs, ... }:
2+
3+
let
4+
cfg = config.hardware.intel.compute-stick.stck1a.sd-slot-fix;
5+
sd-slot-fix-overlay-initrd = pkgs.stdenv.mkDerivation {
6+
name = "sd-slot-fix-overlay-initrd";
7+
src = ./dsl;
8+
9+
phases = [ "unpackPhase" "installPhase" ];
10+
11+
nativeBuildInputs = with pkgs; [
12+
acpica-tools
13+
cpio
14+
];
15+
16+
installPhase = ''
17+
mkdir -p kernel/firmware/acpi
18+
19+
iasl -sa sd-slot-cd-gpio-fix.dsl
20+
21+
cp sd-slot-cd-gpio-fix.aml kernel/firmware/acpi/
22+
find kernel | cpio -H newc --create > $out
23+
'';
24+
};
25+
in {
26+
options.hardware = {
27+
intel.compute-stick.stck1a.sd-slot-fix = {
28+
enable = lib.mkEnableOption ''
29+
fix for the Intel Compute Stick STCK1A SD slot.
30+
'';
31+
};
32+
};
33+
34+
config = lib.mkIf cfg.enable {
35+
boot.initrd.prepend = [
36+
(toString sd-slot-fix-overlay-initrd)
37+
];
38+
};
39+
}

0 commit comments

Comments
 (0)