Add machine frues-surface3
This commit is contained in:
parent
8fb1ec8330
commit
a6a5402907
5 changed files with 2430 additions and 0 deletions
3
clan.nix
3
clan.nix
|
@ -11,6 +11,9 @@
|
||||||
frues-port = {
|
frues-port = {
|
||||||
tags = ["desktop" "spain"];
|
tags = ["desktop" "spain"];
|
||||||
};
|
};
|
||||||
|
frues-surface3 = {
|
||||||
|
tags = ["desktop" "spain"];
|
||||||
|
};
|
||||||
terrier = {
|
terrier = {
|
||||||
tags = ["server" "headless" "raspberry"];
|
tags = ["server" "headless" "raspberry"];
|
||||||
};
|
};
|
||||||
|
|
63
machines/frues-surface3/0002-surface3-spi.patch
Normal file
63
machines/frues-surface3/0002-surface3-spi.patch
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
From fc5a0e4525516353e76a8a3ef348dcd84d935fc4 Mon Sep 17 00:00:00 2001
|
||||||
|
From: kitakar5525 <34676735+kitakar5525@users.noreply.github.com>
|
||||||
|
Date: Fri, 6 Dec 2019 23:10:30 +0900
|
||||||
|
Subject: [PATCH 2/7] surface3-spi
|
||||||
|
|
||||||
|
---
|
||||||
|
drivers/input/touchscreen/surface3_spi.c | 26 ++++++++++++++++++++++++
|
||||||
|
1 file changed, 26 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/drivers/input/touchscreen/surface3_spi.c b/drivers/input/touchscreen/surface3_spi.c
|
||||||
|
index ce4828b1415a..63b0b8ddf090 100644
|
||||||
|
--- a/drivers/input/touchscreen/surface3_spi.c
|
||||||
|
+++ b/drivers/input/touchscreen/surface3_spi.c
|
||||||
|
@@ -25,6 +25,12 @@
|
||||||
|
#define SURFACE3_REPORT_TOUCH 0xd2
|
||||||
|
#define SURFACE3_REPORT_PEN 0x16
|
||||||
|
|
||||||
|
+bool use_dma = false;
|
||||||
|
+module_param(use_dma, bool, 0644);
|
||||||
|
+MODULE_PARM_DESC(use_dma,
|
||||||
|
+ "Disable DMA mode if you encounter touch input crash. "
|
||||||
|
+ "(default: false, disabled to avoid crash)");
|
||||||
|
+
|
||||||
|
struct surface3_ts_data {
|
||||||
|
struct spi_device *spi;
|
||||||
|
struct gpio_desc *gpiod_rst[2];
|
||||||
|
@@ -326,6 +332,13 @@ static int surface3_spi_create_pen_input(struct surface3_ts_data *data)
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
+static bool surface3_spi_can_dma(struct spi_controller *ctlr,
|
||||||
|
+ struct spi_device *spi,
|
||||||
|
+ struct spi_transfer *tfr)
|
||||||
|
+{
|
||||||
|
+ return use_dma;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
static int surface3_spi_probe(struct spi_device *spi)
|
||||||
|
{
|
||||||
|
struct surface3_ts_data *data;
|
||||||
|
@@ -368,6 +381,19 @@ static int surface3_spi_probe(struct spi_device *spi)
|
||||||
|
if (error)
|
||||||
|
return error;
|
||||||
|
|
||||||
|
+ /*
|
||||||
|
+ * Set up DMA
|
||||||
|
+ *
|
||||||
|
+ * TODO: Currently, touch input with DMA seems to be broken.
|
||||||
|
+ * On 4.19 LTS, touch input will crash after suspend.
|
||||||
|
+ * On recent stable kernel (at least after 5.1), touch input will crash after
|
||||||
|
+ * the first touch. No problem with PIO on those kernels.
|
||||||
|
+ * Maybe we need to configure DMA here.
|
||||||
|
+ *
|
||||||
|
+ * Link to issue: https://github.com/jakeday/linux-surface/issues/596
|
||||||
|
+ */
|
||||||
|
+ spi->controller->can_dma = surface3_spi_can_dma;
|
||||||
|
+
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
--
|
||||||
|
2.25.0
|
||||||
|
|
14
machines/frues-surface3/configuration.nix
Normal file
14
machines/frues-surface3/configuration.nix
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
{pkgs, ...}: {
|
||||||
|
hm-pedro.de = "gnome";
|
||||||
|
|
||||||
|
services.xserver.enable = true;
|
||||||
|
services.xserver.displayManager.gdm.enable = true;
|
||||||
|
services.xserver.desktopManager.gnome.enable = true;
|
||||||
|
|
||||||
|
boot.kernelPatches = [
|
||||||
|
{
|
||||||
|
name = "surface3-spi";
|
||||||
|
patch = ./0002-surface3-spi.patch;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
59
machines/frues-surface3/disko.nix
Normal file
59
machines/frues-surface3/disko.nix
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
{
|
||||||
|
boot.loader.grub = {
|
||||||
|
enable = true;
|
||||||
|
efiSupport = true;
|
||||||
|
device = "nodev";
|
||||||
|
};
|
||||||
|
|
||||||
|
disko.devices = {
|
||||||
|
disk = {
|
||||||
|
main = {
|
||||||
|
type = "disk";
|
||||||
|
device = "/dev/disk/by-id/mmc-064GEA_0x55da4659";
|
||||||
|
content = {
|
||||||
|
type = "gpt";
|
||||||
|
partitions = {
|
||||||
|
ESP = {
|
||||||
|
size = "500M";
|
||||||
|
type = "EF00";
|
||||||
|
content = {
|
||||||
|
type = "filesystem";
|
||||||
|
format = "vfat";
|
||||||
|
mountpoint = "/boot";
|
||||||
|
mountOptions = ["umask=0077"];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
luks = {
|
||||||
|
size = "100%";
|
||||||
|
content = {
|
||||||
|
type = "luks";
|
||||||
|
name = "crypted";
|
||||||
|
settings.allowDiscards = true;
|
||||||
|
content = {
|
||||||
|
type = "filesystem";
|
||||||
|
format = "f2fs";
|
||||||
|
mountpoint = "/";
|
||||||
|
extraArgs = [
|
||||||
|
"-i"
|
||||||
|
"-O"
|
||||||
|
"extra_attr,inode_checksum,sb_checksum,compression"
|
||||||
|
];
|
||||||
|
mountOptions = [
|
||||||
|
"compress_algorithm=zstd:6,compress_chksum,atgc,gc_merge,lazytime,nodiscard"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
encryptedSwap = {
|
||||||
|
size = "4G";
|
||||||
|
content = {
|
||||||
|
type = "swap";
|
||||||
|
randomEncryption = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
2291
machines/frues-surface3/facter.json
Normal file
2291
machines/frues-surface3/facter.json
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue