diff --git a/mnt/reform/kernel.nix b/mnt/reform/kernel.nix index b67dad7a..10c90929 100644 --- a/mnt/reform/kernel.nix +++ b/mnt/reform/kernel.nix @@ -7,14 +7,9 @@ ... }: let - modDirVersion = "6.16.5"; - reformDebianPackages = fetchFromGitLab { - domain = "source.mnt.re"; - owner = "reform"; - repo = "reform-debian-packages"; - rev = "830c94db42beef876dc58ea56711659ae7bd415d"; - hash = "sha256-mdORgTOM7RJnEjY5G/iWMHf69wQkql11yRpQ/DrQKb4="; - }; + sources = lib.importJSON ./sources.json; + modDirVersion = sources.modDirVersion; + reformDebianPackages = fetchFromGitLab sources.reformDebianPackages; linuxPkg = { lib, @@ -31,26 +26,20 @@ let src = fetchzip { url = "mirror://kernel/linux/kernel/v${lib.versions.major modDirVersion}.x/linux-${modDirVersion}.tar.xz"; - hash = "sha256-XiTuH40b3VJqzwygZzU0FcvMDj41Rq6IsMbm+3+QxDY="; + hash = "sha256-sE+AfJwaQueiL1caWWfGQ1nf0qsDvEJOe3ZaVHTwelA="; }; - # Use postPatch to apply patches from a directory without IFD - postPatch = '' - for patch in ${reformDebianPackages}/linux/patches${lib.versions.majorMinor modDirVersion}/*/*.patch; do - echo "Applying patch: $patch" - patch -p1 < "$patch" - done - ''; - - kernelPatches = [ - { - name = "reform-dts"; - patch = callPackage ./dtsPatch.nix { - inherit reformDebianPackages; - kernelSource = src; - }; - } - ]; + kernelPatches = + (map (patch: { patch = "${reformDebianPackages}/${patch}"; }) (import ./kernelPatches.nix)) + ++ [ + { + name = "reform-dts"; + patch = callPackage ./dtsPatch.nix { + inherit reformDebianPackages; + kernelSource = src; + }; + } + ]; structuredExtraConfig = with lib.kernel; { # configuration options from https://source.mnt.re/reform/reform-debian-packages/-/blob/7f31ba3a6742d60d8d502c1d86e63ef5df3916bf/linux/config @@ -82,7 +71,7 @@ let JOYSTICK_XPAD_LEDS = yes; INTERCONNECT_IMX8MP = yes; - SND_SOC_FSL_ASRC = yes; + SND_SOC_FSL_ASRC = module; # From the documentation: This option is only useful for out-of-tree drivers since in-tree drivers select it automatically. DRM_IMX_LCDIF = yes; DRM_IMX8MP_DW_HDMI_BRIDGE = yes; DRM_IMX8MP_HDMI_PVI = yes; @@ -135,7 +124,7 @@ let SPI_ROCKCHIP = yes; SPI_ROCKCHIP_SFC = module; ARM_SCMI_CPUFREQ = module; - VIDEO_ROCKCHIP_VDEC2 = module; + # VIDEO_ROCKCHIP_VDEC2 = module; # no rkvdec2 patch included any more ROCKCHIP_DW_HDMI_QP = yes; ROCKCHIP_DW_MIPI_DSI2 = yes; PHY_ROCKCHIP_SAMSUNG_DCPHY = yes; @@ -143,7 +132,7 @@ let GPIO_ROCKCHIP = yes; PL330_DMA = yes; - DRM_MEGACHIPS_STDPXXXX_GE_B850V3_FW = no; # patches for 6.16 break this driver + DRM_ZYNQMP_DPSUB = no; # patches for 6.17 break this driver }; } // (args.argsOverride or { }) diff --git a/mnt/reform/kernelPatches.nix b/mnt/reform/kernelPatches.nix new file mode 100644 index 00000000..704b4aad --- /dev/null +++ b/mnt/reform/kernelPatches.nix @@ -0,0 +1,85 @@ +[ + "linux/patches6.17/imx8mp-mnt-pocket-reform/2ghz/0001-imx8mp-2ghz-clk.patch" + "linux/patches6.17/imx8mp-mnt-pocket-reform/2ghz/0002-imx8mp-2ghz-opp.patch" + "linux/patches6.17/imx8mp-mnt-pocket-reform/audio/0000-revert-crashy-audiomix-pm-support.patch" + "linux/patches6.17/imx8mp-mnt-pocket-reform/mmc-sdio/0001-sdhci-add-no-sd-uhs-sdr104-devicetree-property.patch" + "linux/patches6.17/imx8mp-mnt-pocket-reform/mmc-sdio/0002-During-the-card-init-the-host-side-sometimes-may-nee.patch" + "linux/patches6.17/imx8mp-mnt-pocket-reform/mmc-sdio/0003-USDHC-IP-has-one-limitation-the-tuning-circuit-can-t.patch" + "linux/patches6.17/imx8mp-mnt-pocket-reform/pocket-panel/0001-v5-add-multi-display-panel-driver.patch" + "linux/patches6.17/imx8mp-mnt-pocket-reform/pocket-panel/0002-pocket-panel-fix-sleep-add-orientation.patch" + "linux/patches6.17/imx8mp-mnt-reform2/0001-sn65dsi86-use-hs-clock-of-samsung-dsim-host-directly.patch" + "linux/patches6.17/imx8mp-mnt-reform2/0002-lcdif-dont-exceed-desired-pixel-clock.patch" + "linux/patches6.17/imx8mq-mnt-reform2/0001-drm-etnaviv-Fix-flush-sequence-logic.patch" + "linux/patches6.17/imx8mq-mnt-reform2/0001-imx8mq-mnt-reform2.dts-multiple-fixes-for-display-wi.patch" + "linux/patches6.17/imx8mq-mnt-reform2/0001-nwl-dsi-fixup-mode-only-for-LCDIF-input-not-DCSS.patch" + "linux/patches6.17/imx8mq-mnt-reform2/0002-Revert-drm-bridge-nwl-dsi-Use-vsync-hsync-polarity-f.patch" + "linux/patches6.17/imx8mq-mnt-reform2/0003-lcdif-fix-pcie-interference.patch" + "linux/patches6.17/imx8mq-mnt-reform2/0004-mnt4002-imx-gpcv2-wake-smccc.patch.patch" + "linux/patches6.17/imx8mq-mnt-reform2/0005-pci-imx6-add-support-for-internal-refclk-imx8mq.patch" + "linux/patches6.17/imx8mq-mnt-reform2/0006-imx8mq-import-HDMI-driver-and-make-DCSS-compatible-w.patch" + "linux/patches6.17/ls1028a-mnt-reform2/0000-dtsi-add-hdptx.patch" + "linux/patches6.17/meson-g12b-bananapi-cm4-mnt-pocket-reform/0001-a311d-viu-fifo-lines-config.patch" + "linux/patches6.17/meson-g12b-bananapi-cm4-mnt-pocket-reform/0002-a311d-viu-fifo-lines-config-header.patch" + "linux/patches6.17/meson-g12b-bananapi-cm4-mnt-pocket-reform/0003-tlv320aic31xx-add-1228800hz-support.patch" + "linux/patches6.17/meson-g12b-bananapi-cm4-mnt-reform2/0001-Revert-drm-bridge-synopsys-dw-mipi-dsi-enable-EoTp-b.patch" + "linux/patches6.17/meson-g12b-bananapi-cm4-mnt-reform2/0001-meson-g12b-bananapi-cm4-mnt-reform2.dts-fix-audio-an.patch" + "linux/patches6.17/meson-g12b-bananapi-cm4-mnt-reform2/0011-dw-mipi-dsi-phy-stop-wait-time.patch" + "linux/patches6.17/meson-g12b-bananapi-cm4-mnt-reform2/0012-innolux-n125hce-gn1-timing-tweaks.patch" + "linux/patches6.17/meson-g12b-bananapi-cm4-mnt-reform2/0013-meson-viu-hold-fifo-lines.patch" + "linux/patches6.17/meson-g12b-bananapi-cm4-mnt-reform2/0014-meson-venc-sync.patch.patch" + "linux/patches6.17/meson-g12b-bananapi-cm4-mnt-reform2/0015-meson-dw-mipi-dsi-sync-invert.patch" + "linux/patches6.17/meson-g12b-bananapi-cm4-mnt-reform2/0016-sn65dsi86-burst-mode-support.patch" + "linux/patches6.17/meson-g12b-bananapi-cm4-mnt-reform2/0018-sn65dsi86-never-turn-off.patch" + "linux/patches6.17/meson-g12b-bananapi-cm4-mnt-reform2/0020-LOCAL-ALSA-Assign-internal-PCM-chmap-ELD-IEC958-kctl.patch" + "linux/patches6.17/meson-g12b-bananapi-cm4-mnt-reform2/0021-HACK-of-partial-revert-of-fdt.c-changes.patch" + "linux/patches6.17/meson-g12b-bananapi-cm4-mnt-reform2/0022-add-bt-and-eth-resets.patch" + "linux/patches6.17/meson-g12b-bananapi-cm4-mnt-reform2/0023-sdio-pullups.patch" + "linux/patches6.17/meson-g12b-bananapi-cm4-mnt-reform2/0024-sdio-improve-wifi-speed.patch" + "linux/patches6.17/meson-g12b-bananapi-cm4-mnt-reform2/0030-WORKAROUND-meson-plane-disable-afbc-32x8.patch" + "linux/patches6.17/rk3588-mnt-reform2/0001-MERGED-drm-bridge-Pass-down-connector-to-drm-bridge-.patch" + "linux/patches6.17/rk3588-mnt-reform2/0010-MERGED-arm64-dts-rockchip-add-pd_npu-label-for-RK358.patch" + "linux/patches6.17/rk3588-mnt-reform2/0011-MERGED-arm64-dts-rockchip-Add-nodes-for-NPU-and-its-.patch" + "linux/patches6.17/rk3588-mnt-reform2/0024-math.h-add-DIV_ROUND_UP_NO_OVERFLOW.patch" + "linux/patches6.17/rk3588-mnt-reform2/0025-clk-divider-Fix-divisor-masking-on-64-bit-platforms.patch" + "linux/patches6.17/rk3588-mnt-reform2/0026-clk-composite-replace-open-coded-abs_diff.patch" + "linux/patches6.17/rk3588-mnt-reform2/0030-mfd-rk8xx-Fix-shutdown-handler.patch" + "linux/patches6.17/rk3588-mnt-reform2/0033-arm64-dts-rockchip-Add-VOP-clock-resets-for-rk3588s.patch" + "linux/patches6.17/rk3588-mnt-reform2/0035-drm-rockchip-vop2-Add-core-reset-support.patch" + "linux/patches6.17/rk3588-mnt-reform2/0037-drm-bridge-synopsys-Add-DW-DPTX-Controller-support-l.patch" + "linux/patches6.17/rk3588-mnt-reform2/0038-drm-rockchip-Add-RK3588-DPTX-output-support.patch" + "linux/patches6.17/rk3588-mnt-reform2/0041-drm-birdge-simple-bridge-Add-support-for-radxa-ra620.patch" + "linux/patches6.17/rk3588-mnt-reform2/0042-arm64-dts-rockchip-Add-DP0-for-rk3588.patch" + "linux/patches6.17/rk3588-mnt-reform2/0043-arm64-dts-rockchip-Add-DP1-for-rk3588.patch" + "linux/patches6.17/rk3588-mnt-reform2/0046-arm64-defconfig-Enable-Rockchip-RK3588-DisplayPort-C.patch" + "linux/patches6.17/rk3588-mnt-reform2/0048-arm64-dts-rockchip-Fix-USB-C-description-for-RK3588-.patch" + "linux/patches6.17/rk3588-mnt-reform2/0068-drm-bridge-dw-hdmi-qp-Add-CEC-support.patch" + "linux/patches6.17/rk3588-mnt-reform2/0069-drm-bridge-dw-hdmi-qp-Fixup-timer-base-setup.patch" + "linux/patches6.17/rk3588-mnt-reform2/0070-drm-rockchip-dw_hdmi_qp-Improve-error-handling-with-.patch" + "linux/patches6.17/rk3588-mnt-reform2/0071-drm-rockchip-dw_hdmi_qp-Provide-CEC-IRQ-in-dw_hdmi_q.patch" + "linux/patches6.17/rk3588-mnt-reform2/0072-drm-rockchip-dw_hdmi_qp-Provide-ref-clock-rate-in-dw.patch" + "linux/patches6.17/rk3588-mnt-reform2/0075-phy-hdmi-Add-HDMI-2.1-FRL-configuration-options.patch" + "linux/patches6.17/rk3588-mnt-reform2/0076-phy-rockchip-samsung-hdptx-Fix-reported-clock-rate-i.patch" + "linux/patches6.17/rk3588-mnt-reform2/0077-phy-rockchip-samsung-hdptx-Reduce-ROPLL-loop-bandwid.patch" + "linux/patches6.17/rk3588-mnt-reform2/0078-phy-rockchip-samsung-hdptx-Prevent-Inter-Pair-Skew-f.patch" + "linux/patches6.17/rk3588-mnt-reform2/0079-phy-rockchip-samsung-hdptx-Use-usleep_range-instead-.patch" + "linux/patches6.17/rk3588-mnt-reform2/0080-phy-rockchip-samsung-hdptx-Fix-coding-style-alignmen.patch" + "linux/patches6.17/rk3588-mnt-reform2/0081-phy-rockchip-samsung-hdptx-Consistently-use-rk_-hdpt.patch" + "linux/patches6.17/rk3588-mnt-reform2/0082-phy-rockchip-samsung-hdptx-Enable-lane-output-in-com.patch" + "linux/patches6.17/rk3588-mnt-reform2/0083-phy-rockchip-samsung-hdptx-Cleanup-_cmn_init_seq-lis.patch" + "linux/patches6.17/rk3588-mnt-reform2/0084-phy-rockchip-samsung-hdptx-Compute-clk-rate-from-PLL.patch" + "linux/patches6.17/rk3588-mnt-reform2/0085-phy-rockchip-samsung-hdptx-Drop-hw_rate-driver-data.patch" + "linux/patches6.17/rk3588-mnt-reform2/0086-phy-rockchip-samsung-hdptx-Switch-to-driver-specific.patch" + "linux/patches6.17/rk3588-mnt-reform2/0087-phy-rockchip-samsung-hdptx-Extend-rk_hdptx_phy_verif.patch" + "linux/patches6.17/rk3588-mnt-reform2/0088-phy-rockchip-samsung-hdptx-Add-HDMI-2.1-FRL-support.patch" + "linux/patches6.17/rk3588-mnt-reform2/0089-drm-rockchip-vop2-Check-bpc-before-switching-DCLK-so.patch" + "linux/patches6.17/rk3588-mnt-reform2/0091-drm-rockchip-dw_hdmi_qp-Switch-to-phy_configure.patch" + "linux/patches6.17/rk3588-mnt-reform2/0114-media-dt-bindings-video-interfaces-add-defines-for-s.patch" + "linux/patches6.17/rk3588-mnt-reform2/0123-phy-rockchip-phy-rockchip-inno-csidphy-allow-writes-.patch" + "linux/patches6.17/rk3588-mnt-reform2/0126-arm64-defconfig-enable-rockchip-camera-interface-and.patch" + "linux/patches6.17/rk3588-mnt-reform2/0127-arm64-dts-rockchip-add-the-vip-node-to-px30.patch" + "linux/patches6.17/rk3588-mnt-reform2/0131-arm64-dts-rockchip-add-mipi-csi-2-dphy-nodes-to-rk35.patch" + "linux/patches6.17/rk3588-mnt-reform2/0142-drm-bridge-dw-hdmi-qp-Fix-spurious-IRQ-on-resume.patch" + "linux/patches6.17/rk3588-mnt-reform2/2001-drm-bridge-dw-hdmi-qp-Return-0-in-audio-prepare-when.patch" + "linux/patches6.17/rk3588-mnt-reform2/2003-drm-bridge-synopsys-Do-not-warn-about-audio-params-c.patch" + "linux/patches6.17/rk3588-mnt-reform2/5200-drm-rockchip-Set-dma-mask-to-64-bit.patch" +] diff --git a/mnt/reform/lpc.nix b/mnt/reform/lpc.nix index ad1ef3d8..12c4cc7c 100644 --- a/mnt/reform/lpc.nix +++ b/mnt/reform/lpc.nix @@ -14,8 +14,8 @@ stdenv.mkDerivation rec { domain = "source.mnt.re"; owner = "reform"; repo = "reform-tools"; - rev = "45f930403492aa2156522bfe30edb02e33494b69"; - hash = "sha256-no33CsV69nu1TR0cqxQDd1bFXqhjqOW9IUDxds0fyxE="; + rev = "95fff02ea84386e4e9815ee650032b1a5bd6107c"; + hash = "sha256-bFiVvpLTboxhA5SmMcf60iazEsgFehabsdqZMZ3APuI="; }; sourceRoot = "source/lpc"; @@ -26,7 +26,9 @@ stdenv.mkDerivation rec { nativeBuildInputs = kernel.moduleBuildDependencies; installPhase = '' + runHook preInstall make -C "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" M="$(pwd)" INSTALL_MOD_PATH=$out modules_install $makeFlags + runHook postInstall ''; makeFlags = kernelModuleMakeFlags ++ [ diff --git a/mnt/reform/sources.json b/mnt/reform/sources.json new file mode 100644 index 00000000..eef9357b --- /dev/null +++ b/mnt/reform/sources.json @@ -0,0 +1,10 @@ +{ + "modDirVersion": "6.17.2", + "reformDebianPackages": { + "domain": "source.mnt.re", + "owner": "reform", + "repo": "reform-debian-packages", + "rev": "5716c458627142bcce54caf39e4018e58b16e3ac", + "hash": "sha256-aZMzlt8DwlFLMnG0PvF80nlb8eCvgbVy9CHkPA1gU7c=" + } +} diff --git a/mnt/reform/updateKernelPatches.nix b/mnt/reform/updateKernelPatches.nix new file mode 100644 index 00000000..59d3e4ca --- /dev/null +++ b/mnt/reform/updateKernelPatches.nix @@ -0,0 +1,10 @@ +let + nixpkgs = import { }; + pkgs = nixpkgs.pkgs; + lib = nixpkgs.lib; + sources = lib.importJSON ./sources.json; + reformDebianPackages = pkgs.fetchFromGitLab sources.reformDebianPackages; +in +map (lib.removePrefix "${reformDebianPackages}/") ( + lib.filesystem.listFilesRecursive "${reformDebianPackages}/linux/patches${lib.versions.majorMinor sources.modDirVersion}" +) diff --git a/mnt/reform/updateKernelPatches.sh b/mnt/reform/updateKernelPatches.sh new file mode 100755 index 00000000..032fc3af --- /dev/null +++ b/mnt/reform/updateKernelPatches.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env sh + +nix eval --file updateKernelPatches.nix > kernelPatches.nix +nix fmt kernelPatches.nix