From 09d92bdcaa480d07675bec376289b36adeee3117 Mon Sep 17 00:00:00 2001 From: Tom Fitzhenry Date: Fri, 29 Sep 2023 04:11:18 +1000 Subject: [PATCH 1/4] pine64-pinebook-pro: remove "internal keyboard" libinput quirk This quirk has been upstreamed, and thus we longer need to keep it in nixos-hardware: https://gitlab.freedesktop.org/libinput/libinput/-/commit/c053d7b078b7ebc067c24fd43c728ec0dcd69bfd --- pine64/pinebook-pro/default.nix | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/pine64/pinebook-pro/default.nix b/pine64/pinebook-pro/default.nix index ea77ad33e..1aad5d1fc 100644 --- a/pine64/pinebook-pro/default.nix +++ b/pine64/pinebook-pro/default.nix @@ -53,17 +53,6 @@ '' ]; - # https://github.com/elementary/os/blob/05a5a931806d4ed8bc90396e9e91b5ac6155d4d4/build-pinebookpro.sh#L253-L257 - # Mark the keyboard as internal, so that "disable when typing" works for the touchpad - environment.etc."libinput/local-overrides.quirks".text = '' - [Pinebook Pro Keyboard] - MatchUdevType=keyboard - MatchBus=usb - MatchVendor=0x258A - MatchProduct=0x001E - AttrKeyboardIntegration=internal - ''; - hardware.enableRedistributableFirmware = true; hardware.firmware = [ (pkgs.callPackage ./firmware/ap6256-firmware { }) From 2d11a7dd324f3d326e294d918cddbc901a1799ba Mon Sep 17 00:00:00 2001 From: Tom Fitzhenry Date: Fri, 29 Sep 2023 04:13:27 +1000 Subject: [PATCH 2/4] pine64-pinebook-pro: remove udev quirk for "keyboard mouse" It's not clear what this is for, and other distros ( https://gitlab.com/postmarketOS/pmaports/-/commit/e9029c91536edbe3fd4109b90cfa92eddfd890b0 ) are now relying solely on upstream udev. --- pine64/pinebook-pro/default.nix | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/pine64/pinebook-pro/default.nix b/pine64/pinebook-pro/default.nix index 1aad5d1fc..5cc224c75 100644 --- a/pine64/pinebook-pro/default.nix +++ b/pine64/pinebook-pro/default.nix @@ -42,17 +42,6 @@ "rtc_rk808" ]; - services.udev.extraHwdb = lib.mkMerge [ - # https://github.com/elementary/os/blob/05a5a931806d4ed8bc90396e9e91b5ac6155d4d4/build-pinebookpro.sh#L253-L257 - # Disable the "keyboard mouse" in libinput. This is reported by the keyboard firmware - # and is probably a placeholder for a TrackPoint style mouse that doesn't exist - '' - evdev:input:b0003v258Ap001Ee0110-e0,1,2,4,k110,111,112,r0,1,am4,lsfw - ID_INPUT=0 - ID_INPUT_MOUSE=0 - '' - ]; - hardware.enableRedistributableFirmware = true; hardware.firmware = [ (pkgs.callPackage ./firmware/ap6256-firmware { }) From 406c11948b15b799e32e5b2e9d73e93687ae727f Mon Sep 17 00:00:00 2001 From: Tom Fitzhenry Date: Fri, 29 Sep 2023 04:49:22 +1000 Subject: [PATCH 3/4] pine64-pinebook-pro: add initrd modules for boot-from-NVMe --- pine64/pinebook-pro/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pine64/pinebook-pro/default.nix b/pine64/pinebook-pro/default.nix index 5cc224c75..848a5864f 100644 --- a/pine64/pinebook-pro/default.nix +++ b/pine64/pinebook-pro/default.nix @@ -36,6 +36,11 @@ "tcpm" "typec" + # PCIe/NVMe + "nvme" + "pcie_rockchip_host" + "phy_rockchip_pcie" + # Misc. modules "cw2015_battery" "gpio_charger" From 8518dc856f8e9324974b32349f42afedf27f8301 Mon Sep 17 00:00:00 2001 From: Tom Fitzhenry Date: Fri, 29 Sep 2023 05:23:02 +1000 Subject: [PATCH 4/4] pine64-pinebook-pro: remove superfluous ap6256-firmware package I have been running for >1 year with the upstream linux-firmware package (i.e. just hardware.enableRedistributableFirmware = true) https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/WHENCE#n2767 --- pine64/pinebook-pro/default.nix | 3 -- .../firmware/ap6256-firmware/default.nix | 39 ------------------- 2 files changed, 42 deletions(-) delete mode 100644 pine64/pinebook-pro/firmware/ap6256-firmware/default.nix diff --git a/pine64/pinebook-pro/default.nix b/pine64/pinebook-pro/default.nix index 848a5864f..37c1c841d 100644 --- a/pine64/pinebook-pro/default.nix +++ b/pine64/pinebook-pro/default.nix @@ -48,9 +48,6 @@ ]; hardware.enableRedistributableFirmware = true; - hardware.firmware = [ - (pkgs.callPackage ./firmware/ap6256-firmware { }) - ]; # The default powersave makes the wireless connection unusable. networking.networkmanager.wifi.powersave = lib.mkDefault false; diff --git a/pine64/pinebook-pro/firmware/ap6256-firmware/default.nix b/pine64/pinebook-pro/firmware/ap6256-firmware/default.nix deleted file mode 100644 index caddfb26f..000000000 --- a/pine64/pinebook-pro/firmware/ap6256-firmware/default.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ lib -, fetchFromGitHub -, runCommand -}: - -let - src = fetchFromGitHub { - owner = "nix-community"; - repo = "rkwifibt"; - rev = "3524d73251fe4d16f0f873e583aa63b12a90ac26"; - sha256 = "0ac7z3m5mnmk1qhf9pq9s3y6ky8jmd3ggn8m29797z1ng40q3cka"; - }; -in -runCommand "pinebookpro-ap6256-firmware" -{ - meta = with lib; { - license = licenses.unfreeRedistributable; - }; -} '' - (PS4=" $ "; set -x - cp ${src}/"firmware/broadcom/all/bt/BCM4345C5.hcd" "BCM4345C5.hcd" - cp ${src}/"firmware/broadcom/all/wifi/fw_bcm43456c5_ag.bin" "fw_bcm43456c5_ag.bin" - cp ${src}/"clm_blob/broadcom/AP6256/brcmfmac43456-sdio.clm_blob" "brcmfmac43456-sdio.clm_blob" - cp ${src}/"firmware/broadcom/all/wifi/nvram_ap6256.txt" "nvram_ap6256.txt" - mkdir -p $out/lib/firmware/brcm - # Bluetooth firmware - install -Dm644 "BCM4345C5.hcd" -t "$out/lib/firmware/" - install -Dm644 "BCM4345C5.hcd" "$out/lib/firmware/brcm/BCM.hcd" - install -Dm644 "BCM4345C5.hcd" -t "$out/lib/firmware/brcm/" - # Wifi firmware - install -Dm644 "nvram_ap6256.txt" -t "$out/lib/firmware/" - install -Dm644 "fw_bcm43456c5_ag.bin" "$out/lib/firmware/brcm/brcmfmac43456-sdio.bin" - install -Dm644 "brcmfmac43456-sdio.clm_blob" "$out/lib/firmware/brcm/brcmfmac43456-sdio.clm_blob" - install -Dm644 "nvram_ap6256.txt" "$out/lib/firmware/brcm/brcmfmac43456-sdio.radxa,rockpi4b.txt" - install -Dm644 "nvram_ap6256.txt" "$out/lib/firmware/brcm/brcmfmac43456-sdio.radxa,rockpi4c.txt" - install -Dm644 "nvram_ap6256.txt" "$out/lib/firmware/brcm/brcmfmac43456-sdio.pine64,pinebook-pro.txt" - install -Dm644 "nvram_ap6256.txt" "$out/lib/firmware/brcm/brcmfmac43456-sdio.pine64,rockpro64-v2.1.txt" - ) -''