mirror of
https://github.com/NixOS/nixos-hardware.git
synced 2025-11-22 10:19:44 +01:00
Merge pull request #1671 from leifhelm/mnt-reform
Fix and update kernel. Update uboot
This commit is contained in:
commit
27973e0f41
12 changed files with 221 additions and 64 deletions
|
|
@ -7,14 +7,9 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
modDirVersion = "6.16.5";
|
sources = lib.importJSON ./sources.json;
|
||||||
reformDebianPackages = fetchFromGitLab {
|
modDirVersion = sources.modDirVersion;
|
||||||
domain = "source.mnt.re";
|
reformDebianPackages = fetchFromGitLab sources.reformDebianPackages;
|
||||||
owner = "reform";
|
|
||||||
repo = "reform-debian-packages";
|
|
||||||
rev = "830c94db42beef876dc58ea56711659ae7bd415d";
|
|
||||||
hash = "sha256-mdORgTOM7RJnEjY5G/iWMHf69wQkql11yRpQ/DrQKb4=";
|
|
||||||
};
|
|
||||||
linuxPkg =
|
linuxPkg =
|
||||||
{
|
{
|
||||||
lib,
|
lib,
|
||||||
|
|
@ -31,18 +26,15 @@ let
|
||||||
|
|
||||||
src = fetchzip {
|
src = fetchzip {
|
||||||
url = "mirror://kernel/linux/kernel/v${lib.versions.major modDirVersion}.x/linux-${modDirVersion}.tar.xz";
|
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
|
kernelPatches =
|
||||||
postPatch = ''
|
(map (patch: {
|
||||||
for patch in ${reformDebianPackages}/linux/patches${lib.versions.majorMinor modDirVersion}/*/*.patch; do
|
name = patch;
|
||||||
echo "Applying patch: $patch"
|
patch = "${reformDebianPackages}/${patch}";
|
||||||
patch -p1 < "$patch"
|
}) (import ./kernelPatches.nix))
|
||||||
done
|
++ [
|
||||||
'';
|
|
||||||
|
|
||||||
kernelPatches = [
|
|
||||||
{
|
{
|
||||||
name = "reform-dts";
|
name = "reform-dts";
|
||||||
patch = callPackage ./dtsPatch.nix {
|
patch = callPackage ./dtsPatch.nix {
|
||||||
|
|
@ -82,7 +74,7 @@ let
|
||||||
JOYSTICK_XPAD_LEDS = yes;
|
JOYSTICK_XPAD_LEDS = yes;
|
||||||
|
|
||||||
INTERCONNECT_IMX8MP = 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_IMX_LCDIF = yes;
|
||||||
DRM_IMX8MP_DW_HDMI_BRIDGE = yes;
|
DRM_IMX8MP_DW_HDMI_BRIDGE = yes;
|
||||||
DRM_IMX8MP_HDMI_PVI = yes;
|
DRM_IMX8MP_HDMI_PVI = yes;
|
||||||
|
|
@ -135,7 +127,7 @@ let
|
||||||
SPI_ROCKCHIP = yes;
|
SPI_ROCKCHIP = yes;
|
||||||
SPI_ROCKCHIP_SFC = module;
|
SPI_ROCKCHIP_SFC = module;
|
||||||
ARM_SCMI_CPUFREQ = 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_HDMI_QP = yes;
|
||||||
ROCKCHIP_DW_MIPI_DSI2 = yes;
|
ROCKCHIP_DW_MIPI_DSI2 = yes;
|
||||||
PHY_ROCKCHIP_SAMSUNG_DCPHY = yes;
|
PHY_ROCKCHIP_SAMSUNG_DCPHY = yes;
|
||||||
|
|
@ -143,7 +135,7 @@ let
|
||||||
GPIO_ROCKCHIP = yes;
|
GPIO_ROCKCHIP = yes;
|
||||||
PL330_DMA = 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 { })
|
// (args.argsOverride or { })
|
||||||
|
|
|
||||||
85
mnt/reform/kernelPatches.nix
Normal file
85
mnt/reform/kernelPatches.nix
Normal file
|
|
@ -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"
|
||||||
|
]
|
||||||
|
|
@ -14,8 +14,8 @@ stdenv.mkDerivation rec {
|
||||||
domain = "source.mnt.re";
|
domain = "source.mnt.re";
|
||||||
owner = "reform";
|
owner = "reform";
|
||||||
repo = "reform-tools";
|
repo = "reform-tools";
|
||||||
rev = "45f930403492aa2156522bfe30edb02e33494b69";
|
rev = "95fff02ea84386e4e9815ee650032b1a5bd6107c";
|
||||||
hash = "sha256-no33CsV69nu1TR0cqxQDd1bFXqhjqOW9IUDxds0fyxE=";
|
hash = "sha256-bFiVvpLTboxhA5SmMcf60iazEsgFehabsdqZMZ3APuI=";
|
||||||
};
|
};
|
||||||
|
|
||||||
sourceRoot = "source/lpc";
|
sourceRoot = "source/lpc";
|
||||||
|
|
@ -26,7 +26,9 @@ stdenv.mkDerivation rec {
|
||||||
nativeBuildInputs = kernel.moduleBuildDependencies;
|
nativeBuildInputs = kernel.moduleBuildDependencies;
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
make -C "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" M="$(pwd)" INSTALL_MOD_PATH=$out modules_install $makeFlags
|
make -C "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" M="$(pwd)" INSTALL_MOD_PATH=$out modules_install $makeFlags
|
||||||
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
|
|
||||||
makeFlags = kernelModuleMakeFlags ++ [
|
makeFlags = kernelModuleMakeFlags ++ [
|
||||||
|
|
|
||||||
23
mnt/reform/pkgs/default.nix
Normal file
23
mnt/reform/pkgs/default.nix
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
callPackage,
|
||||||
|
}:
|
||||||
|
rec {
|
||||||
|
reform-flash-uboot =
|
||||||
|
lib.mapAttrs (_name: config: callPackage ./reform-flash-uboot.nix { inherit config; })
|
||||||
|
{
|
||||||
|
reform2-rk3588-dsi = {
|
||||||
|
warn = true;
|
||||||
|
mmc = "mmcblk0";
|
||||||
|
mmcBoot0 = false;
|
||||||
|
ubootOffset = 32768;
|
||||||
|
flashbinOffset = 0;
|
||||||
|
image = "${ubootImage.reform2-rk3588-dsi}/rk3588-mnt-reform2-dsi-flash.bin";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
uboot.reform2-rk3588-dsi = callPackage ../rk3588/uboot.nix { };
|
||||||
|
ubootImage.reform2-rk3588-dsi = callPackage ../rk3588/uboot-image.nix {
|
||||||
|
uboot = uboot.reform2-rk3588-dsi;
|
||||||
|
};
|
||||||
|
}
|
||||||
44
mnt/reform/pkgs/reform-flash-uboot.nix
Normal file
44
mnt/reform/pkgs/reform-flash-uboot.nix
Normal file
|
|
@ -0,0 +1,44 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
writeShellApplication,
|
||||||
|
config,
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
dev = "/dev/" + config.mmc + lib.optionalString config.mmcBoot0 "boot0";
|
||||||
|
in
|
||||||
|
writeShellApplication {
|
||||||
|
name = "reform-flash-uboot";
|
||||||
|
text = ''
|
||||||
|
if [ "$(id -u)" -ne 0 ]; then
|
||||||
|
echo "reform-flash-uboot has to be run as root / using sudo."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
''
|
||||||
|
+ lib.optionalString config.warn ''
|
||||||
|
echo "W: Flashing u-boot to eMMC on $(cat /proc/device-tree/model) is not without risk." >&2
|
||||||
|
echo "W: If you flash the wrong u-boot or if the flashing process goes wrong, it is" >&2
|
||||||
|
echo "W: possible to soft-brick your board. Restoring it might need some extra hardware." >&2
|
||||||
|
echo "W: Please only proceed if you are sure that the benefits outweigh the risks for you." >&2
|
||||||
|
printf "Are you sure you want to proceed? [y/N] "
|
||||||
|
read -r response
|
||||||
|
|
||||||
|
if [ "$response" != "y" ]; then
|
||||||
|
echo "Exiting."
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
''
|
||||||
|
+ ''
|
||||||
|
echo "Writing ${config.image} to ${dev}" >&2
|
||||||
|
''
|
||||||
|
+ lib.optionalString config.mmcBoot0 ''
|
||||||
|
echo 0 >"/sys/class/block/${config.mmc}boot0/force_ro"
|
||||||
|
''
|
||||||
|
+ ''
|
||||||
|
dd if='${config.image}' of='${dev}' bs=512 seek='${
|
||||||
|
builtins.toString (config.ubootOffset / 512)
|
||||||
|
}' skip='${builtins.toString (config.flashbinOffset / 512)}'
|
||||||
|
''
|
||||||
|
+ lib.optionalString config.mmcBoot0 ''
|
||||||
|
echo 1 >"/sys/class/block/${config.mmc}boot0/force_ro"
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
@ -1,25 +0,0 @@
|
||||||
{
|
|
||||||
runCommand,
|
|
||||||
uboot,
|
|
||||||
fetchFromGitHub,
|
|
||||||
}:
|
|
||||||
# script from https://source.mnt.re/reform/reform-rk3588-uboot/-/blob/b530d65f4a878c0329a594fa248ba8da59d2e05f/build.sh
|
|
||||||
runCommand "mnt-reform-firmware-rk3855${uboot.variant}" { } ''
|
|
||||||
mkdir $out
|
|
||||||
cp -r ${uboot} u-boot
|
|
||||||
cp -r ${uboot.rkbin} rkbin
|
|
||||||
chmod -R +rw u-boot
|
|
||||||
chmod -R +rw rkbin
|
|
||||||
cd u-boot
|
|
||||||
mkdir spl
|
|
||||||
mv u-boot-spl.bin spl
|
|
||||||
../rkbin/tools/boot_merger rock5b-rk3588.ini
|
|
||||||
cd ..
|
|
||||||
# rkbin stuff
|
|
||||||
cd rkbin
|
|
||||||
./tools/boot_merger RKBOOT/RK3588MINIALL.ini
|
|
||||||
# concatenate
|
|
||||||
cd ..
|
|
||||||
cp u-boot/idbloader.img $out/mnt-reform2-rk3588${uboot.variant}-flash.bin
|
|
||||||
dd if=u-boot/u-boot.itb of=$out/mnt-reform2-rk3588${uboot.variant}-flash.bin seek=16320
|
|
||||||
''
|
|
||||||
|
|
@ -44,8 +44,8 @@
|
||||||
storeContents = config.installerImage.storeContents;
|
storeContents = config.installerImage.storeContents;
|
||||||
comp = config.installerImage.squashfsCompression;
|
comp = config.installerImage.squashfsCompression;
|
||||||
};
|
};
|
||||||
uboot = pkgs.callPackage ./uboot.nix { };
|
packages = pkgs.callPackage ../pkgs { };
|
||||||
firmware = pkgs.callPackage ./firmware.nix { inherit uboot; };
|
ubootImage = packages.ubootImage.reform2-rk3588-dsi;
|
||||||
content = pkgs.callPackage (
|
content = pkgs.callPackage (
|
||||||
{
|
{
|
||||||
stdenv,
|
stdenv,
|
||||||
|
|
@ -215,7 +215,7 @@
|
||||||
eval $(partx $img -o START,SECTORS --nr 1 --pairs)
|
eval $(partx $img -o START,SECTORS --nr 1 --pairs)
|
||||||
dd conv=notrunc if=${content} of=$img seek=$START count=$SECTORS
|
dd conv=notrunc if=${content} of=$img seek=$START count=$SECTORS
|
||||||
|
|
||||||
dd conv=notrunc if=${firmware}/mnt-reform2-rk3588-dsi-flash.bin of=$img seek=64
|
dd conv=notrunc if=${ubootImage}/rk3588-mnt-reform2-dsi-flash.bin of=$img seek=64
|
||||||
|
|
||||||
if test -n "$compressImage"; then
|
if test -n "$compressImage"; then
|
||||||
zstd -T$NIX_BUILD_CORES --rm $img
|
zstd -T$NIX_BUILD_CORES --rm $img
|
||||||
|
|
|
||||||
11
mnt/reform/rk3588/uboot-image.nix
Normal file
11
mnt/reform/rk3588/uboot-image.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
runCommand,
|
||||||
|
uboot,
|
||||||
|
fetchFromGitHub,
|
||||||
|
}:
|
||||||
|
# script from https://source.mnt.re/reform/reform-rk3588-uboot/-/blob/28289e36cd1cb90b302780e83b014250c880c4ec/build.sh
|
||||||
|
runCommand "mnt-reform-uboot-image-rk3855${uboot.variant}" { } ''
|
||||||
|
mkdir $out
|
||||||
|
cp ${uboot}/idbloader.img $out/rk3588-mnt-reform2${uboot.variant}-flash.bin
|
||||||
|
dd if=${uboot}/u-boot.itb of=$out/rk3588-mnt-reform${uboot.variant}-flash.bin seek=16320
|
||||||
|
''
|
||||||
|
|
@ -10,14 +10,14 @@ let
|
||||||
domain = "source.mnt.re";
|
domain = "source.mnt.re";
|
||||||
owner = "reform";
|
owner = "reform";
|
||||||
repo = "reform-rk3588-uboot";
|
repo = "reform-rk3588-uboot";
|
||||||
rev = "55bca0174e7bb449e96028d64ad8348f5af35977";
|
rev = "28289e36cd1cb90b302780e83b014250c880c4ec";
|
||||||
hash = "sha256-A3u1afGK65cGOwENQtu8Hh+fLsSDNxc3rEebkd3QOic=";
|
hash = "sha256-fWGyC+rlfL0NYYRFLvdF7EiO3s9GfFkfhAbTEM5ECAM=";
|
||||||
};
|
};
|
||||||
rkbin = fetchFromGitHub {
|
rkbin = fetchFromGitHub {
|
||||||
owner = "rockchip-linux";
|
owner = "rockchip-linux";
|
||||||
repo = "rkbin";
|
repo = "rkbin";
|
||||||
rev = "f43a462e7a1429a9d407ae52b4745033034a6cf9";
|
rev = "272136301989d493000425935bd4ead0ef04d06b";
|
||||||
hash = "sha256-geESfZP8ynpUz/i/thpaimYo3kzqkBX95gQhMBzNbmk=";
|
hash = "sha256-qXnuZyFNc6gYTkAtPg1t9WHwj8OiTxOLvsHUuvolK/w=";
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
buildUBoot rec {
|
buildUBoot rec {
|
||||||
|
|
@ -32,6 +32,7 @@ buildUBoot rec {
|
||||||
patches = [
|
patches = [
|
||||||
"${mntPatches}/0001-ini-ddrbin-bump.patch"
|
"${mntPatches}/0001-ini-ddrbin-bump.patch"
|
||||||
"${mntPatches}/0002-add-target-init-mnt-reform-series.patch"
|
"${mntPatches}/0002-add-target-init-mnt-reform-series.patch"
|
||||||
|
"${mntPatches}/0003-scripts-dtc-pylibfdt-libfdt-i_shipped-Use-SWIG_AppendOutp.patch"
|
||||||
];
|
];
|
||||||
prePatch = ''
|
prePatch = ''
|
||||||
cp ${mntPatches}/*.dts arch/arm/dts/
|
cp ${mntPatches}/*.dts arch/arm/dts/
|
||||||
|
|
@ -45,7 +46,7 @@ buildUBoot rec {
|
||||||
"spl/u-boot-spl.bin"
|
"spl/u-boot-spl.bin"
|
||||||
];
|
];
|
||||||
variant = "-dsi";
|
variant = "-dsi";
|
||||||
defconfig = "mnt-reform2-rk3588${variant}_defconfig";
|
defconfig = "rk3588-mnt-reform2${variant}_defconfig";
|
||||||
extraMakeFlags = [
|
extraMakeFlags = [
|
||||||
"BL31=${armTrustedFirmwareRK3588}/bl31.elf"
|
"BL31=${armTrustedFirmwareRK3588}/bl31.elf"
|
||||||
"ROCKCHIP_TPL=${rkbin}/bin/rk35/rk3588_ddr_lp4_2112MHz_lp5_2400MHz_v1.18.bin"
|
"ROCKCHIP_TPL=${rkbin}/bin/rk35/rk3588_ddr_lp4_2112MHz_lp5_2400MHz_v1.18.bin"
|
||||||
|
|
|
||||||
10
mnt/reform/sources.json
Normal file
10
mnt/reform/sources.json
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
"modDirVersion": "6.17.2",
|
||||||
|
"reformDebianPackages": {
|
||||||
|
"domain": "source.mnt.re",
|
||||||
|
"owner": "reform",
|
||||||
|
"repo": "reform-debian-packages",
|
||||||
|
"rev": "5716c458627142bcce54caf39e4018e58b16e3ac",
|
||||||
|
"hash": "sha256-aZMzlt8DwlFLMnG0PvF80nlb8eCvgbVy9CHkPA1gU7c="
|
||||||
|
}
|
||||||
|
}
|
||||||
10
mnt/reform/updateKernelPatches.nix
Normal file
10
mnt/reform/updateKernelPatches.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
let
|
||||||
|
nixpkgs = import <nixpkgs> { };
|
||||||
|
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}"
|
||||||
|
)
|
||||||
4
mnt/reform/updateKernelPatches.sh
Executable file
4
mnt/reform/updateKernelPatches.sh
Executable file
|
|
@ -0,0 +1,4 @@
|
||||||
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
nix eval --file updateKernelPatches.nix > kernelPatches.nix
|
||||||
|
nix fmt kernelPatches.nix
|
||||||
Loading…
Add table
Add a link
Reference in a new issue