intel/compute-stick/stck1a: init

This commit is contained in:
Karolis Stasaitis 2025-10-18 12:10:33 +02:00
parent 9ed85f8afe
commit 5051632234
6 changed files with 95 additions and 0 deletions

View file

@ -0,0 +1,8 @@
# Intel Compute Stick (STCK1A)
## Supported Devices
* STCK1A32WFC
* STCK1A32WFCR
* STCK1A32WFCL
* STCK1A8LFC

View file

@ -0,0 +1,8 @@
{ lib, pkgs, ... }:
{
imports = [
../../../common/cpu/intel/bay-trail
./sd-slot-fix.nix
];
}

View file

@ -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 } },
}
})
}
}

View file

@ -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)
];
};
}