[bug#77090] Patch to add linux-libre mnt/reform variant

Message ID 87y0x0kb3y.fsf@wireframe
State New
Headers
Series [bug#77090] Patch to add linux-libre mnt/reform variant |

Commit Message

Vagrant Cascadian March 19, 2025, 8:40 p.m. UTC
  On 2025-03-19, pelzflorian (Florian Pelz) wrote:
> Vagrant Cascadian <vagrant@debian.org> writes:
>> The attached patch adds a kernel variant for mnt/reform systems.
>>
>>   https://mntre.com/reform.html
>>
>> I have boot tested it on a MNT/Reform2 rk3588 using Guix System, though
>> it may also work on other MNT/Reform variants to some degree.
>
> Oops, only now have I understood the MNT/Reform modularity means there
> can be many “processor modules” and you made this
> linux-arm64-libre-mnt-reform to support them all.
>
> Could you make this clear in a package synopsis, description?

Thanks for the suggestion!

I implemented a bare minimal description/synopsis update, but on
re-reading what you suggested again it could probably be elaborated on
to more explicitly mention the variants with different CPU modules...

Attached is a v2 of the patch that includes some of those suggestions
and other improvements.

Summary of changes since v0:

reform-debian-packages:
* apply guix style
* drop useless commented out #:tests?
* clean up comments around licenses
* install .dts files in vendor-specific directories

linux-libre-arm64-mnt-reform:
* apply guix style (except keep #true instead of #t, seriously!)
* do not use --force when applying patches
* simplify 'copy-reform-dts-files phase
* extend description and synopsis to mention mnt/reform systems

live well,
  vagrant
  

Comments

pelzflorian (Florian Pelz) March 22, 2025, 6:01 p.m. UTC | #1
Thank you Vagrant for this work.

Vagrant Cascadian <vagrant@debian.org> writes:
> +    (version "278f964619e597bf0b3aae67fef52bb541bc89e6")

This is a bad version; newer versions are not increasing.

The commit 278f964619e597bf0b3aae67fef52bb541bc89e6 you use for
reform-debian-packages is no longer the most recent commit.  Which commit
should we use?

We may need to remove the reprepro.sh (see end of this e-mail),

Vagrant Cascadian <vagrant@debian.org> writes:
> +    (license (list
> +              ;; FIXME license:mit
> +              ;; FIXME license:FSFAP
> +              license:bsd-2
> +              license:gpl2
> +              license:gpl2+
> +              license:gpl3))))

Likely should be
(list license:gpl2
      license:gpl2+
      license:gpl3+
      license:x11
      license:expat
      license:fsf-free)

I do not know where in your list, license:bsd-2 comes from.  Possibly
license:bsd-2 is correct for some file, too?

https://source.mnt.re/reform/reform-debian-packages/-/blob/main/patches/bmap-tools?ref_type=head
is license:gpl2, because bmaptools is and it is from a pull request to it.

https://source.mnt.re/reform/reform-debian-packages/-/blob/main/patches/ffmpeg?ref_type=heads
ffmpeg is  license:gpl2+

https://source.mnt.re/reform/reform-debian-packages/-/blob/main/patches/flash-kernel?ref_type=heads
is not copyright-worthy, but anyway
flash-kernel script is license:gpl2+

https://source.mnt.re/reform/reform-debian-packages/-/blob/main/patches/mesa?ref_type=heads
Mesa has license:x11.
License:x11 is the MIT license.

(define x11
  (license "X11"
           "http://directory.fsf.org/wiki/License:X11"
           "https://www.gnu.org/licenses/license-list#X11License"))

<https://directory.fsf.org/wiki/License:X11>
is the same as the license header <https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/src/panfrost/lib/pan_layout.c>

https://source.mnt.re/reform/reform-debian-packages/-/blob/main/patches/reform-tools?ref_type=heads
I find <https://salsa.debian.org/reform-team/reform-tools>
which is license:gpl3+

https://source.mnt.re/reform/reform-debian-packages/-/blob/main/patches/u-boot-menu?ref_type=heads
is <https://salsa.debian.org/debian/u-boot-menu>
appears to be license:gpl2 or license:gpl2+

https://source.mnt.re/reform/reform-debian-packages/-/blob/main/build_custom.sh?ref_type=heads
https://source.mnt.re/reform/reform-debian-packages/-/blob/main/common.sh?ref_type=heads
https://source.mnt.re/reform/reform-debian-packages/-/blob/main/setup.sh?ref_type=heads
is # SPDX-License-Identifier: MIT
is <https://spdx.org/licenses/MIT.html>
is <https://directory.fsf.org/wiki/License:Expat>
is license:expat

https://source.mnt.re/reform/reform-debian-packages/-/blob/main/filter-output?ref_type=heads
is # SPDX-License-Identifier: FSFAP
guix/import/utils.scm maps with %spdx-license-identifiers this way:
("FSFAP" . license:fsf-free)

https://source.mnt.re/reform/reform-debian-packages/-/blob/main/reprepro.sh?ref_type=heads
has no license :(
Remove it in an origin snippet?
Though you also do not use this tiny script.

I have not looked at the linux patches, but likely gpl2 or another
of the above GPL versions.

Regards,
Florian
  
Vagrant Cascadian March 22, 2025, 6:58 p.m. UTC | #2
On 2025-03-22, pelzflorian (Florian Pelz) wrote:
> Thank you Vagrant for this work.

And thanks for the review! :)


> Vagrant Cascadian <vagrant@debian.org> writes:
>> +    (version "278f964619e597bf0b3aae67fef52bb541bc89e6")
>
> This is a bad version; newer versions are not increasing.

Yeah, I wondered about this... did not think it mattered too much
because it just ships some patch files used as an input; it is not a
package someone is likely to include in a profile where the version
would matter. Might be a case for using (define ... instead of
(define-public ... of course I can make up a more meaningful
git-commit-hash derived version if we absolutely must... :)


> The commit 278f964619e597bf0b3aae67fef52bb541bc89e6 you use for
> reform-debian-packages is no longer the most recent commit.  Which commit
> should we use?

Current head is probably also fine (seems to have one new or updated
patch to the relevent kernel patches which might require adjusting patch
phase), but that was the commit I tested so far.


> Vagrant Cascadian <vagrant@debian.org> writes:
>> +    (license (list
>> +              ;; FIXME license:mit
>> +              ;; FIXME license:FSFAP
>> +              license:bsd-2
>> +              license:gpl2
>> +              license:gpl2+
>> +              license:gpl3))))
>
> Likely should be
> (list license:gpl2
>       license:gpl2+
>       license:gpl3+
>       license:x11
>       license:expat
>       license:fsf-free)

Sounds plausible to me. :)

FWIW, I am also fine with dropping anything outside of linux/ in a
snippet, if it makes the licensing simpler, as we really use none of
the other files.


> I do not know where in your list, license:bsd-2 comes from.  Possibly
> license:bsd-2 is correct for some file, too?

Most .dts related files in linux are dual-licensed under GPL and one of
various permissive licenses ... (e.g. GPL-2* OR BSD|MIT|X11).

  $ git grep SPDX linux/patches6.12/ | grep BSD
  linux/patches6.12/imx8mq-mnt-reform2/v19_20241126_sandor_yu_initial_support_cadence_mhdp8501_hdmi_dp_for_i_mx8mq.mbx:+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
  linux/patches6.12/imx8mq-mnt-reform2/v19_20241126_sandor_yu_initial_support_cadence_mhdp8501_hdmi_dp_for_i_mx8mq.mbx:+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
  linux/patches6.12/rk3588-mnt-reform2/0036-dt-bindings-display-bridge-Add-schema-for-Synopsys-D.patch:+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
  linux/patches6.12/rk3588-mnt-reform2/0037-dt-bindings-display-rockchip-Add-schema-for-RK3588-H.patch:+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
  linux/patches6.12/rk3588-mnt-reform2/0042-dt-bindings-media-Document-bindings-for-HDMI-RX-Cont.patch:+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
  linux/patches6.12/rk3588-mnt-reform2/3001-display-rockchip-add-schema-for-rk3588-hdmi-tx.patch:+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
  linux/patches6.12/rk3588-mnt-reform2/5001-rk3588-dsi2-driver.patch:+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)


> https://source.mnt.re/reform/reform-debian-packages/-/blob/main/patches/mesa?ref_type=heads
> Mesa has license:x11.
> License:x11 is the MIT license.
>
> (define x11
>   (license "X11"
>            "http://directory.fsf.org/wiki/License:X11"
>            "https://www.gnu.org/licenses/license-list#X11License"))
>
> <https://directory.fsf.org/wiki/License:X11>
> is the same as the license header
> <https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/src/panfrost/lib/pan_layout.c

That's good to know. I am a little less familiar with GNU licensing
conventions, mostly coming from Debian, while not totally different,
have some different conventional takes.


> https://source.mnt.re/reform/reform-debian-packages/-/blob/main/build_custom.sh?ref_type=heads
> https://source.mnt.re/reform/reform-debian-packages/-/blob/main/common.sh?ref_type=heads
> https://source.mnt.re/reform/reform-debian-packages/-/blob/main/setup.sh?ref_type=heads
> is # SPDX-License-Identifier: MIT
> is <https://spdx.org/licenses/MIT.html>
> is <https://directory.fsf.org/wiki/License:Expat>
> is license:expat

Also useful, thanks!


> https://source.mnt.re/reform/reform-debian-packages/-/blob/main/filter-output?ref_type=heads
> is # SPDX-License-Identifier: FSFAP
> guix/import/utils.scm maps with %spdx-license-identifiers this way:
> ("FSFAP" . license:fsf-free)

Great!


> https://source.mnt.re/reform/reform-debian-packages/-/blob/main/reprepro.sh?ref_type=heads
> has no license :(
> Remove it in an origin snippet?
> Though you also do not use this tiny script.

I can probably get upstream to fix that, but we also do not need it at
all.


> I have not looked at the linux patches, but likely gpl2 or another
> of the above GPL versions.

I focused on linux/patches6.12 mainly, as those were the ones I am
actually using, and other than the device-tree patches that are
dual-licensed, likely all the rest should be gpl2 or gpl2+.


live well,
  vagrant
  

Patch

From f6980be7bc497134ea754856af3b5133c26f5d7a Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant@debian.org>
Date: Wed, 19 Mar 2025 13:01:00 -0700
Subject: [PATCH v2] gnu: Add linux-libre-arm64-mnt-reform.

* gnu/packages/linux.scm (linux-libre-arm64-mnt-reform): New variable.
(reform-debian-packages): New variable.

Change-Id: I61fa18de361f2ea576608c329d168df03e163d83

Changes since v0:

reform-debian-packages:
* apply guix style
* drop useless commented out #:tests?
* clean up comments around licenses
* install .dts files in vendor-specific directories

linux-libre-arm64-mnt-reform:
* apply guix style (except keep #true instead of #t, seriously!)
* do not use --force when applying patches
* simplify 'copy-reform-dts-files phase
* extend description and synopsis to mention mnt/reform systems
---
 gnu/packages/linux.scm | 299 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 299 insertions(+)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index b0dc6cbcfd..c3cbe2a8d3 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -1463,6 +1463,305 @@  (define-public linux-libre-arm64-honeycomb
                         ("CONFIG_VHOST_VDPA" . m))
                       (default-extra-linux-options linux-libre-lts-version))))
 
+(define-public reform-debian-packages
+  (package
+    (name "reform-debian-packages")
+    (version "278f964619e597bf0b3aae67fef52bb541bc89e6")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://source.mnt.re/reform/reform-debian-packages.git")
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "19phz43ar2p9w0rq2pgzjx8zbxy2hppjbprvw95dvbkm8a20gv5v"))))
+    (build-system copy-build-system)
+    (arguments
+     (list
+      #:install-plan
+      #~'(("linux/patches6.12/" "/patches")
+          ("linux/" "/dts/amlogic"
+           #:include-regexp ("meson.*\\.dts$"))
+          ("linux/" "/dts/freescale"
+           #:include-regexp ("imx8.*\\.dts$"))
+          ("linux/" "/dts/freescale"
+           #:include-regexp ("fsl.*\\.dts$"))
+          ("linux/" "/dts/rockchip"
+           #:include-regexp ("rk3588.*\\.dts$"))
+          ("linux/config" "config"))))
+    (home-page "https://source.mnt.re/reform/reform-debian-packages")
+    (synopsis
+     "Linux kernel patches and device-trees used for MNT Reform systems")
+    (description
+     "Linux kernel patches and device-trees used for the MNT Reform systems")
+    (license (list
+              ;; FIXME license:mit
+              ;; FIXME license:FSFAP
+              license:bsd-2
+              license:gpl2
+              license:gpl2+
+              license:gpl3))))
+
+(define-public linux-libre-arm64-mnt-reform
+  ;; Kernel for use on the MNT/Reform systems
+  ;; https://mntre.com/reform.html
+  (let ((base (make-linux-libre* linux-libre-6.12-version
+                                 linux-libre-6.12-gnu-revision
+                                 linux-libre-6.12-source
+                                 '("aarch64-linux")
+                                 #:extra-version "arm64-mnt-reform"
+                                 #:extra-options
+                                 ;; https://source.mnt.re/reform/reform-debian-packages/-/blob/main/linux/config
+                                 (append `(("CONFIG_DRM_LVDS_CODEC" . m)
+                                           ("CONFIG_DRM_CDNS_MHDP8546" . m)
+                                           ("CONFIG_DRM_CDNS_HDMI_CEC" . m)
+                                           ("CONFIG_DRM_IMX_CDNS_MHDP" . m)
+                                           ("CONFIG_DRM_IMX_DCSS" . m)
+                                           ("CONFIG_PHY_FSL_IMX8MQ_HDPTX" . m)
+                                           ("CONFIG_DRM_PANEL_LVDS" . m)
+                                           ("CONFIG_I2C_IMX_LPI2C" . m)
+                                           ("CONFIG_I2C_MUX_REG" . m)
+                                           ("CONFIG_INTERCONNECT_IMX" . #true)
+                                           ("CONFIG_INTERCONNECT_IMX8MQ" . #true)
+                                           ("CONFIG_MFD_WM8994" . m)
+                                           ("CONFIG_MUX_GPIO" . m)
+                                           ("CONFIG_MUX_MMIO" . m)
+                                           ("CONFIG_RTC_DRV_PCF8523" . m)
+                                           ("CONFIG_USB_EHCI_FSL" . m)
+                                           ("CONFIG_NO_HZ_IDLE" . #true)
+                                           ("CONFIG_SND_SOC_FSL_MICFIL" . m)
+                                           ("CONFIG_SND_IMX_SOC" . m)
+                                           ("CONFIG_SND_SOC_FSL_ASOC_CARD" . m)
+                                           ("CONFIG_SND_SOC_IMX_AUDMIX" . m)
+                                           ("CONFIG_SND_SOC_IMX_HDMI" . m)
+                                           ("CONFIG_INPUT_JOYSTICK" . #true)
+                                           ("CONFIG_JOYSTICK_XPAD" . m)
+                                           ("CONFIG_JOYSTICK_XPAD_FF" . #true)
+                                           ("CONFIG_JOYSTICK_XPAD_LEDS" . #true)
+                                           ("CONFIG_INTERCONNECT_IMX8MP" . #true)
+                                           ("CONFIG_SND_SOC_FSL_ASRC" . #true)
+                                           ("CONFIG_DRM_IMX_LCDIF" . #true)
+                                           ("CONFIG_DRM_IMX8MP_DW_HDMI_BRIDGE" . #true)
+                                           ("CONFIG_DRM_IMX8MP_HDMI_PVI" . #true)
+                                           ("CONFIG_IMX8MM_THERMAL" . #true)
+                                           ("CONFIG_IMX2_WDT" . #true)
+                                           ("CONFIG_DRM_SAMSUNG_DSIM" . #true)
+                                           ("CONFIG_PHY_FSL_SAMSUNG_HDMI_PHY" . #true)
+                                           ("CONFIG_DRM" . #true)
+                                           ("CONFIG_DRM_PANEL_MNT_POCKET_REFORM" . #true)
+                                           ("CONFIG_IMX8M_BLK_CTRL" . #true)
+                                           ("CONFIG_IMX_GPCV2_PM_DOMAINS" . #true)
+                                           ("CONFIG_DRM_DISPLAY_CONNECTOR" . #true)
+                                           ("CONFIG_DRM_FSL_LDB" . #true)
+                                           ("CONFIG_BACKLIGHT_CLASS_DEVICE" . #true)
+                                           ("CONFIG_BACKLIGHT_PWM" . #true)
+                                           ("CONFIG_BACKLIGHT_GPIO" . #true)
+                                           ("CONFIG_BACKLIGHT_LED" . #true)
+                                           ("CONFIG_CPU_FREQ_GOV_PERFORMANCE" . #true)
+                                           ("CONFIG_CPU_FREQ_GOV_POWERSAVE" . #true)
+                                           ("CONFIG_CPU_FREQ_GOV_USERSPACE" . #true)
+                                           ("CONFIG_CPU_FREQ_GOV_ONDEMAND" . #true)
+                                           ("CONFIG_CPU_FREQ_GOV_CONSERVATIVE" . #true)
+                                           ("CONFIG_CPU_FREQ_GOV_SCHEDUTIL" . #true)
+                                           ("CONFIG_ARM_IMX_CPUFREQ_DT" . #true)
+                                           ("CONFIG_ARM_IMX_BUS_DEVFREQ" . #true)
+                                           ("CONFIG_IMX_IRQSTEER" . #true)
+                                           ("CONFIG_PCI_MESON" . #true)
+                                           ("CONFIG_DWMAC_MESON" . #true)
+                                           ("CONFIG_MDIO_BUS_MUX_MESON_G12A" . #true)
+                                           ("CONFIG_I2C_MESON" . #true)
+                                           ("CONFIG_PWM_MESON" . #true)
+                                           ("CONFIG_USB_DWC3_MESON_G12A" . #true)
+                                           ("CONFIG_MMC_MESON_GX" . #true)
+                                           ("CONFIG_MMC_MESON_MX_SDIO" . #true)
+                                           ("CONFIG_MESON_DDR_PMU" . #true)
+                                           ("CONFIG_RTW88_8822CS" . m)
+                                           ("CONFIG_PWM_FSL_FTM" . #true)
+                                           ("CONFIG_FSL_RCPM" . #true)
+                                           ("CONFIG_ARM_ROCKCHIP_CPUFREQ" . m)
+                                           ("CONFIG_DRM_PANTHOR" . m)
+                                           ("CONFIG_NVMEM_ROCKCHIP_OTP" . #true)
+                                           ("CONFIG_PHY_ROCKCHIP_SAMSUNG_HDPTX" . m)
+                                           ("CONFIG_PHY_ROCKCHIP_USBDP" . m)
+                                           ("CONFIG_ROCKCHIP_INNO_HDMI" . #true)
+                                           ("CONFIG_ROCKCHIP_LVDS" . #true)
+                                           ("CONFIG_ROCKCHIP_REGULATOR_COUPLER" . #true)
+                                           ("CONFIG_SPI_ROCKCHIP" . #true)
+                                           ("CONFIG_SPI_ROCKCHIP_SFC" . m)
+                                           ("CONFIG_ARM_SCMI_CPUFREQ" . m)
+                                           ("CONFIG_PHY_ROCKCHIP_SAMSUNG_DCPHY" . m)
+                                           ("CONFIG_VIDEO_ROCKCHIP_VDEC2" . m)
+                                           ("CONFIG_ROCKCHIP_DW_HDMI_QP" . #true)
+                                           ("CONFIG_ROCKCHIP_DW_MIPI_DSI" . #true))
+                                         (default-extra-linux-options
+                                          linux-libre-6.12-version)))))
+    (package
+      (inherit base)
+      (inputs (list reform-debian-packages))
+      (synopsis (string-append (package-synopsis base)
+                               " for MNT/Reform systems"))
+      (description (string-append (package-description base)
+                    "  Configuration options and patches have been applied for use with MNT/Reform systems."))
+      (arguments
+       (substitute-keyword-arguments (package-arguments base)
+         ((#:phases phases)
+          #~(modify-phases #$phases
+              (add-after 'unpack 'apply-reform-patches
+                (lambda* (#:key inputs #:allow-other-keys)
+                  (for-each (lambda (patch)
+                              (invoke "patch" "-p1" "-i"
+                                      (search-input-file inputs
+                                                         (string-append
+                                                          "patches/" patch))))
+                            (list
+                             "imx8mp-mnt-pocket-reform/2ghz/0001-imx8mp-2ghz-clk.patch"
+                             "imx8mp-mnt-pocket-reform/2ghz/0002-imx8mp-2ghz-opp.patch"
+                             "imx8mp-mnt-pocket-reform/audio/0000-revert-crashy-audiomix-pm-support.patch"
+                             "imx8mp-mnt-pocket-reform/mmc-sdio/0001-sdhci-add-no-sd-uhs-sdr104-devicetree-property.patch"
+                             "imx8mp-mnt-pocket-reform/mmc-sdio/0002-During-the-card-init-the-host-side-sometimes-may-nee.patch"
+                             "imx8mp-mnt-pocket-reform/mmc-sdio/0003-USDHC-IP-has-one-limitation-the-tuning-circuit-can-t.patch"
+                             "imx8mp-mnt-pocket-reform/pocket-panel/0001-v5-add-multi-display-panel-driver.patch"
+                             "imx8mp-mnt-reform2/0001-sn65dsi86-use-hs-clock-of-samsung-dsim-host-directly.patch"
+                             "imx8mp-mnt-reform2/0002-lcdif-dont-exceed-desired-pixel-clock.patch"
+                             "imx8mq-mnt-reform2/0001-nwl-dsi-fixup-mode-only-for-LCDIF-input-not-DCSS.patch"
+                             "imx8mq-mnt-reform2/0002-pci-imx6-add-support-for-internal-refclk-imx8mq.patch"
+                             "imx8mq-mnt-reform2/0003-lcdif-fix-pcie-interference.patch"
+                             "imx8mq-mnt-reform2/0004-mnt4002-imx-gpcv2-wake-smccc.patch.patch"
+                             ;; Does not apply, needs further investigation
+                             ;; "imx8mq-mnt-reform2/v19_20241126_sandor_yu_initial_support_cadence_mhdp8501_hdmi_dp_for_i_mx8mq.mbx"
+                             "ls1028a-mnt-reform2/0000-dtsi-add-hdptx.patch"
+                             "meson-g12b-bananapi-cm4-mnt-pocket-reform/0001-a311d-viu-fifo-lines-config.patch"
+                             "meson-g12b-bananapi-cm4-mnt-pocket-reform/0002-a311d-viu-fifo-lines-config-header.patch"
+                             "meson-g12b-bananapi-cm4-mnt-pocket-reform/0003-tlv320aic31xx-add-1228800hz-support.patch"
+                             "meson-g12b-bananapi-cm4-mnt-reform2/0001-Revert-drm-bridge-synopsys-dw-mipi-dsi-enable-EoTp-b.patch"
+                             "meson-g12b-bananapi-cm4-mnt-reform2/0011-dw-mipi-dsi-phy-stop-wait-time.patch"
+                             "meson-g12b-bananapi-cm4-mnt-reform2/0012-innolux-n125hce-gn1-timing-tweaks.patch"
+                             "meson-g12b-bananapi-cm4-mnt-reform2/0013-meson-viu-hold-fifo-lines.patch"
+                             "meson-g12b-bananapi-cm4-mnt-reform2/0014-meson-venc-sync.patch.patch"
+                             "meson-g12b-bananapi-cm4-mnt-reform2/0015-meson-dw-mipi-dsi-sync-invert.patch"
+                             "meson-g12b-bananapi-cm4-mnt-reform2/0016-sn65dsi86-burst-mode-support.patch"
+                             "meson-g12b-bananapi-cm4-mnt-reform2/0018-sn65dsi86-never-turn-off.patch"
+                             "meson-g12b-bananapi-cm4-mnt-reform2/0020-LOCAL-ALSA-Assign-internal-PCM-chmap-ELD-IEC958-kctl.patch"
+                             "meson-g12b-bananapi-cm4-mnt-reform2/0021-HACK-of-partial-revert-of-fdt.c-changes.patch"
+                             "meson-g12b-bananapi-cm4-mnt-reform2/0022-add-bt-and-eth-resets.patch"
+                             "meson-g12b-bananapi-cm4-mnt-reform2/0023-sdio-pullups.patch"
+                             "meson-g12b-bananapi-cm4-mnt-reform2/0024-sdio-improve-wifi-speed.patch"
+                             "rk3588-mnt-reform2/0001-regulator-Add-of_regulator_get_optional-for-pure-DT-.patch"
+                             "rk3588-mnt-reform2/0001-scripts-package-builddeb-allow-hooks-also-in-usr-sha.patch"
+                             "rk3588-mnt-reform2/0002-regulator-Add-devres-version-of-of_regulator_get_opt.patch"
+                             "rk3588-mnt-reform2/0004-arm64-dts-rockchip-rk3588-rock5b-add-USB-C-support.patch"
+                             "rk3588-mnt-reform2/0005-math.h-add-DIV_ROUND_UP_NO_OVERFLOW.patch"
+                             "rk3588-mnt-reform2/0006-clk-divider-Fix-divisor-masking-on-64-bit-platforms.patch"
+                             "rk3588-mnt-reform2/0007-clk-composite-replace-open-coded-abs_diff.patch"
+                             "rk3588-mnt-reform2/0008-clk-rockchip-support-clocks-registered-late.patch"
+                             "rk3588-mnt-reform2/0009-clk-rockchip-rk3588-register-GATE_LINK-later.patch"
+                             "rk3588-mnt-reform2/0010-clk-rockchip-expose-rockchip_clk_set_lookup.patch"
+                             "rk3588-mnt-reform2/0011-clk-rockchip-implement-linked-gate-clock-support.patch"
+                             "rk3588-mnt-reform2/0012-clk-rockchip-rk3588-drop-RK3588_LINKED_CLK.patch"
+                             "rk3588-mnt-reform2/0013-arm64-dts-rockchip-rk3588-evb1-add-bluetooth-rfkill.patch"
+                             "rk3588-mnt-reform2/0014-arm64-dts-rockchip-rk3588-evb1-improve-PCIe-ethernet.patch"
+                             "rk3588-mnt-reform2/0015-arm64-dts-rockchip-Slow-down-EMMC-a-bit-to-keep-IO-s.patch"
+                             "rk3588-mnt-reform2/0016-vop2-Add-clock-resets-support.patch"
+                             "rk3588-mnt-reform2/0017-arm64-dts-rockchip-Add-VOP-clock-resets-for-rk3588s.patch"
+                             "rk3588-mnt-reform2/0018-dt-bindings-display-vop2-Add-VP-clock-resets.patch"
+                             "rk3588-mnt-reform2/0019-media-v4l2-ctrls-core-Set-frame_mbs_only_flag-by-def.patch"
+                             "rk3588-mnt-reform2/0020-media-rockchip-Move-H264-CABAC-table-to-header-file.patch"
+                             "rk3588-mnt-reform2/0021-media-rockchip-Introduce-the-rkvdec2-driver.patch"
+                             "rk3588-mnt-reform2/0022-media-dt-bindings-rockchip-Document-RK3588-Video-Dec.patch"
+                             "rk3588-mnt-reform2/0023-arm64-dts-rockchip-Add-rkvdec2-Video-Decoder-on-rk35.patch"
+                             "rk3588-mnt-reform2/0024-arm64-defconfig-enable-Rockchip-RK3588-video-decoder.patch"
+                             "rk3588-mnt-reform2/0025-mfd-rk8xx-Fix-shutdown-handler.patch"
+                             "rk3588-mnt-reform2/0026-WIP-phy-phy-rockchip-samsung-hdptx-Add-FRL-EARC-supp.patch"
+                             "rk3588-mnt-reform2/0027-TESTING-phy-phy-rockchip-samsung-hdptx-Add-verbose-l.patch"
+                             "rk3588-mnt-reform2/0028-WIP-dt-bindings-display-rockchip-drm-Add-optional-cl.patch"
+                             "rk3588-mnt-reform2/0029-WIP-drm-rockchip-vop2-Improve-display-modes-handling.patch"
+                             "rk3588-mnt-reform2/0030-arm64-dts-rockchip-Add-HDMI0-bridge-to-rk3588.patch"
+                             "rk3588-mnt-reform2/0031-arm64-dts-rockchip-Enable-HDMI0-on-rock-5b.patch"
+                             "rk3588-mnt-reform2/0032-arm64-dts-rockchip-Enable-HDMI0-on-rk3588-evb1.patch"
+                             "rk3588-mnt-reform2/0033-WIP-arm64-dts-rockchip-Enable-HDMI0-PHY-clk-provider.patch"
+                             "rk3588-mnt-reform2/0034-WIP-arm64-dts-rockchip-Make-use-of-HDMI0-PHY-PLL-on-.patch"
+                             "rk3588-mnt-reform2/0035-WIP-arm64-dts-rockchip-Make-use-of-HDMI0-PHY-PLL-on-.patch"
+                             "rk3588-mnt-reform2/0036-dt-bindings-display-bridge-Add-schema-for-Synopsys-D.patch"
+                             "rk3588-mnt-reform2/0037-dt-bindings-display-rockchip-Add-schema-for-RK3588-H.patch"
+                             "rk3588-mnt-reform2/0038-drm-bridge-synopsys-Add-DW-HDMI-QP-TX-controller-dri.patch"
+                             "rk3588-mnt-reform2/0039-drm-rockchip-Add-basic-RK3588-HDMI-output-support.patch"
+                             "rk3588-mnt-reform2/0040-arm64-defconfig-Enable-Rockchip-extensions-for-Synop.patch"
+                             "rk3588-mnt-reform2/0041-MAINTAINERS-Add-entry-for-Synopsys-DesignWare-HDMI-R.patch"
+                             "rk3588-mnt-reform2/0042-dt-bindings-media-Document-bindings-for-HDMI-RX-Cont.patch"
+                             "rk3588-mnt-reform2/0043-arm64-dts-rockchip-Add-device-tree-support-for-HDMI-.patch"
+                             "rk3588-mnt-reform2/0044-media-platform-synopsys-Add-support-for-HDMI-input-d.patch"
+                             "rk3588-mnt-reform2/0045-arm64-defconfig-Enable-Synopsys-HDMI-receiver.patch"
+                             "rk3588-mnt-reform2/0046-arm64-dts-rockchip-Enable-HDMI-receiver-on-rock-5b.patch"
+                             "rk3588-mnt-reform2/0047-arm64-dts-rockchip-Enable-HDMI-receiver-on-RK3588-EV.patch"
+                             "rk3588-mnt-reform2/0048-arm64-defconfig-Enable-default-EDID-for-Synopsys-HDM.patch"
+                             "rk3588-mnt-reform2/0049-regulator-Add-devm_-of_regulator_get.patch"
+                             "rk3588-mnt-reform2/0050-pmdomain-rockchip-cleanup-mutex-handling-in-rockchip.patch"
+                             "rk3588-mnt-reform2/0051-pmdomain-rockchip-forward-rockchip_do_pmu_set_power_.patch"
+                             "rk3588-mnt-reform2/0052-pmdomain-rockchip-reduce-indentation-in-rockchip_pd_.patch"
+                             "rk3588-mnt-reform2/0053-dt-bindings-power-rockchip-add-regulator-support.patch"
+                             "rk3588-mnt-reform2/0054-pmdomain-rockchip-add-regulator-support.patch"
+                             "rk3588-mnt-reform2/0055-arm64-dts-rockchip-Add-GPU-power-domain-regulator-de.patch"
+                             "rk3588-mnt-reform2/0056-dt-bindings-net-wireless-brcm4329-fmac-add-pci14e4-4.patch"
+                             "rk3588-mnt-reform2/0057-dt-bindings-net-wireless-brcm4329-fmac-add-clock-des.patch"
+                             "rk3588-mnt-reform2/0058-wifi-brcmfmac-Add-optional-lpo-clock-enable-support.patch"
+                             ;; does not apply cleanly due to DEBLOBBING
+                             ;; "rk3588-mnt-reform2/0059-wifi-brcmfmac-add-flag-for-random-seed-during-firmwa.patch"
+                             "rk3588-mnt-reform2/0060-arm64-dts-rockchip-rk3588-evb1-add-WLAN-controller.patch"
+                             "rk3588-mnt-reform2/0061-arm64-dts-rockchip-add-and-enable-gpu-node-for-Radxa.patch"
+                             "rk3588-mnt-reform2/0062-arm64-dts-rockchip-Enable-HDMI0-on-rock-5a.patch"
+                             "rk3588-mnt-reform2/0100-rk3588-dtsi-add-hdmi1-controller.patch"
+                             "rk3588-mnt-reform2/0102-drm-panthor-Actually-suspend-IRQs-in-the-unplug-path.patch"
+                             "rk3588-mnt-reform2/3001-display-rockchip-add-schema-for-rk3588-hdmi-tx.patch"
+                             "rk3588-mnt-reform2/4000-mnt-rk3588-dual-hdmi-qp-rockchip.patch"
+                             "rk3588-mnt-reform2/4001-mnt-rk3588-dual-hdmi-vop2-pll.patch"
+                             "rk3588-mnt-reform2/5001-rk3588-dsi2-driver.patch"
+                             "rk3588-mnt-reform2/5002-rk3588-dsi-dts-nodes.patch"
+                             "rk3588-mnt-reform2/5100-modernize-hdmi1-in-dtsi.patch"
+                             "rk3588-mnt-reform2/5110-hdptx-crash-workaround.patch"
+                             "rk3588-mnt-reform2/5200-drm-rockchip-Set-dma-mask-to-64-bit.patch"))))
+              (add-after 'apply-reform-patches 'copy-reform-dts-files
+                (lambda* (#:key inputs #:allow-other-keys)
+                  (for-each (lambda (dts)
+                              (copy-file (search-input-file inputs
+                                                            (string-append
+                                                             "/dts/" dts))
+                                         (string-append "arch/arm64/boot/dts/"
+                                          dts)))
+                            (list
+                             "amlogic/meson-g12b-bananapi-cm4-mnt-pocket-reform.dts"
+                             "amlogic/meson-g12b-bananapi-cm4-mnt-reform2.dts"
+                             "freescale/fsl-ls1028a-mnt-reform2.dts"
+                             "freescale/imx8mp-mnt-pocket-reform.dts"
+                             "freescale/imx8mp-mnt-reform2.dts"
+                             "freescale/imx8mq-mnt-reform2-hdmi.dts"
+                             "freescale/imx8mq-mnt-reform2.dts"
+                             "rockchip/rk3588-mnt-pocket-reform.dts"
+                             "rockchip/rk3588-mnt-reform-next.dts"
+                             "rockchip/rk3588-mnt-reform2.dts"))))
+              (add-after 'apply-reform-patches 'adjust-makefiles-with-new-dtb
+                (lambda _
+                  (substitute* "arch/arm64/boot/dts/amlogic/Makefile"
+                    (("meson-g12b-bananapi-cm4-mnt-reform2.dtb")
+                     "meson-g12b-bananapi-cm4-mnt-reform2.dtb
+dtb-$(CONFIG_ARCH_MESON) += meson-g12b-bananapi-cm4-mnt-pocket-reform.dtb"))
+                  (substitute* "arch/arm64/boot/dts/freescale/Makefile"
+                    (("fsl-ls1028a-rdb.dtb")
+                     "fsl-ls1028a-rdb.dtb
+dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-mnt-reform2.dtb"))
+                  (substitute* "arch/arm64/boot/dts/freescale/Makefile"
+                    (("imx8mq-mnt-reform2.dtb")
+                     "imx8mq-mnt-reform2.dtb
+dtb-$(CONFIG_ARCH_MXC) += imx8mp-mnt-reform2.dtb
+dtb-$(CONFIG_ARCH_MXC) += imx8mp-mnt-pocket-reform.dtb
+dtb-$(CONFIG_ARCH_MXC) += imx8mq-mnt-reform2-hdmi.dtb"))
+                  (substitute* "arch/arm64/boot/dts/rockchip/Makefile"
+                    (("rk3588-rock-5b.dtb")
+                     "rk3588-rock-5b.dtb
+dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-reform2.dtb
+dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-reform-next.dtb
+dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-pocket-reform.dtb")))))))))))
+
 (define-public linux-libre-riscv64-generic
   (make-linux-libre* linux-libre-version
                      linux-libre-gnu-revision

base-commit: 1890807c87917b13c202ff1d9cba1a107cb5c3f9
-- 
2.39.5