liminix

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

commit 0a2881914b7504a614a13736474ec59c24282155
parent 4638092d3d46df05dd00f7ff75ae6a453528827e
Author: Daniel Barlow <dan@telent.net>
Date:   Mon, 10 Apr 2023 20:39:26 +0100

set erase block size to something that works for jffs2

Diffstat:
Mdevices/gl-ar750/default.nix | 4++++
Mmodules/hardware.nix | 1+
Mmodules/jffs2.nix | 2+-
3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/devices/gl-ar750/default.nix b/devices/gl-ar750/default.nix @@ -87,6 +87,7 @@ flash = { address = "0x9F060000"; size ="0xfa0000"; + eraseBlockSize = "65536"; }; rootDevice = "1f05"; dts = { @@ -163,12 +164,15 @@ AR8216_PHY = "y"; # eth1 is behind a switch MTD_SPI_NOR = "y"; + MTD_SPI_NOR_USE_4K_SECTORS = "n"; # jffs2 needs min 8k erase block + SPI_ATH79 = "y"; # these are copied from OpenWrt. SPI_MASTER= "y"; # At least one of them is necessary SPI_MEM= "y"; SPI_AR934X= "y"; SPI_BITBANG= "y"; SPI_GPIO= "y"; + GPIO_ATH79 = "y"; GPIOLIB = "y"; EXPERT="y"; diff --git a/modules/hardware.nix b/modules/hardware.nix @@ -24,6 +24,7 @@ in { # for wireless devices, etc address = mkOption { type = types.str; }; size = mkOption { type = types.str; }; + eraseBlockSize = mkOption { type = types.str; }; }; loadAddress = mkOption { default = null; }; entryPoint = mkOption { }; diff --git a/modules/jffs2.nix b/modules/jffs2.nix @@ -33,7 +33,7 @@ in }} cp $pkgClosure/registration nix-path-registration grafts=$(sed < $pkgClosure/store-paths 's/^\(.*\)$/--graft \1:\1/g') - mkfs.jffs2 ${endian} --pad --root $TMPDIR/empty --output $out $grafts + mkfs.jffs2 ${endian} -e ${config.hardware.flash.eraseBlockSize} --pad --root $TMPDIR/empty --output $out $grafts ''; jffs2boot = let o = config.outputs; in