liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 2f3b108ef15dd6b9b93ad85443777ed75f58e35c
parent 6adab44fcf93cd8d3b388ca766a0ac66c0c9c15e
Author: Daniel Barlow <dan@telent.net>
Date:   Sun, 23 Apr 2023 18:23:05 +0100

tftpboot: set phram erase block size to match hardware

this is needed for tftp boot with a jffs2 filesystem

Diffstat:
Mdevices/gl-mt300a/default.nix | 1+
Mdevices/gl-mt300n-v2/default.nix | 1+
Mmodules/tftpboot.nix | 2+-
3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/devices/gl-mt300a/default.nix b/devices/gl-mt300a/default.nix @@ -45,6 +45,7 @@ flash = { address = "0xbc050000"; size ="0xf80000"; + eraseBlockSize = "65536"; }; rootDevice = "1f05"; diff --git a/devices/gl-mt300n-v2/default.nix b/devices/gl-mt300n-v2/default.nix @@ -42,6 +42,7 @@ flash = { address = "0xbc050000"; size = "0xfb0000"; + eraseBlockSize = "65536"; }; rootDevice = "1f05"; diff --git a/modules/tftpboot.nix b/modules/tftpboot.nix @@ -34,7 +34,7 @@ in { rootfsStart=0x$(printf %x $((${cfg.loadAddress} + 0x100000 + $uimageSize))) rootfsBytes=$(($(stat -L -c %s ${config.outputs.rootfs}) + 0x100000 &(~0xfffff))) rootfsMb=$(($rootfsBytes >> 20)) - cmd="mtdparts=phram0:''${rootfsMb}M(rootfs) phram.phram=phram0,''${rootfsStart},''${rootfsMb}Mi memmap=''${rootfsMb}M\$''${rootfsStart} root=1f00"; + cmd="mtdparts=phram0:''${rootfsMb}M(rootfs) phram.phram=phram0,''${rootfsStart},''${rootfsMb}Mi,${config.hardware.flash.eraseBlockSize} memmap=''${rootfsMb}M\$''${rootfsStart} root=/dev/mtdblock0"; cat > $out << EOF setenv serverip ${cfg.serverip}