From 69429404abaf365ed649a2863830c1909f3626b2 Mon Sep 17 00:00:00 2001 From: Arnout Engelen Date: Thu, 2 Jan 2025 10:47:12 +0100 Subject: [PATCH] tftpboot: explicitly mark phram as mappable --- modules/outputs/tftpboot.nix | 1 + pkgs/kernel/default.nix | 5 ++--- pkgs/kernel/phram-always-memremap.patch | 20 -------------------- 3 files changed, 3 insertions(+), 23 deletions(-) delete mode 100644 pkgs/kernel/phram-always-memremap.patch diff --git a/modules/outputs/tftpboot.nix b/modules/outputs/tftpboot.nix index 9c6d0389..f6f077a1 100644 --- a/modules/outputs/tftpboot.nix +++ b/modules/outputs/tftpboot.nix @@ -121,6 +121,7 @@ in { node=$(printf "phram-rootfs@%x" $rootfsStart) fdtput -p -t s dtb /reserved-memory/$node compatible phram fdtput -p -t lx dtb /reserved-memory/$node reg $ac_prefix $(hex $rootfsStart) $sz_prefix $(hex $rootfsSize) + fdtput -p -t i dtb /reserved-memory/$node no-map 0 cmd="liminix ${cmdline} mtdparts=phram0:''${rootfsSize}(rootfs) phram.phram=phram0,''${rootfsStart},''${rootfsSize},${toString config.hardware.flash.eraseBlockSize} root=/dev/mtdblock0"; fdtput -t s dtb /chosen ${config.boot.commandLineDtbNode} "$cmd" diff --git a/pkgs/kernel/default.nix b/pkgs/kernel/default.nix index 6662d5a1..9634127d 100644 --- a/pkgs/kernel/default.nix +++ b/pkgs/kernel/default.nix @@ -61,9 +61,8 @@ stdenv.mkDerivation rec { patches = [ ./cmdline-cookie.patch ./mips-malta-fdt-from-bootloader.patch - ./phram-always-memremap.patch - ];# ++ lib.optional (lib.versionOlder version "5.18.0") - #./phram-allow-cached-mappings.patch + ] ++ lib.optional (lib.versionOlder version "5.18.0") + ./phram-allow-cached-mappings.patch; # this is here to work around what I think is a bug in nixpkgs # packaging of ncurses: it installs pkg-config data files which diff --git a/pkgs/kernel/phram-always-memremap.patch b/pkgs/kernel/phram-always-memremap.patch deleted file mode 100644 index 46b78e16..00000000 --- a/pkgs/kernel/phram-always-memremap.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/drivers/mtd/devices/phram.c 2024-12-20 23:42:19.248462526 +0100 -+++ b/drivers/mtd/devices/phram.c 2024-12-20 23:41:11.344218259 +0100 -@@ -85,7 +85,7 @@ - { - void *addr = NULL; - -- if (phram->cached) -+ if (phram->cached || true) - addr = memremap(start, len, MEMREMAP_WB); - else - addr = (void __force *)ioremap(start, len); -@@ -101,7 +101,7 @@ - { - void *addr = phram->mtd.priv; - -- if (phram->cached) { -+ if (phram->cached || true) { - memunmap(addr); - return; - }