From b1d811488912cee34452b9208d8ae428c1799801 Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Sat, 31 Jan 2026 21:49:56 -0600 Subject: [PATCH] runners: Added optional BENCH/TEST_NAND geometry Having BENCH/TEST_NAND ifdefs that enable the relevant timings, but _not_ the relevant geometry, is certainly a choice. Defaulting to NAND geometry when BENCH/TEST_NAND is defined is more useful, if only for minimizing confusion. --- runners/bench_defines.h | 16 ++++++++++++++-- runners/test_defines.h | 14 +++++++++++--- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/runners/bench_defines.h b/runners/bench_defines.h index e2d2a807..5456d12f 100644 --- a/runners/bench_defines.h +++ b/runners/bench_defines.h @@ -4,9 +4,17 @@ // preconfigured defines that control how benches run #ifdef BENCH_DEFINE // name value (overridable) + #ifndef BENCH_NAND + // NOR flash geometry BENCH_DEFINE(READ_SIZE, 1 ) BENCH_DEFINE(PROG_SIZE, 1 ) BENCH_DEFINE(BLOCK_SIZE, 4096 ) + #else + // NAND flash geometry + BENCH_DEFINE(READ_SIZE, 1 ) + BENCH_DEFINE(PROG_SIZE, 512 ) + BENCH_DEFINE(BLOCK_SIZE, 131072 ) + #endif BENCH_DEFINE(BLOCK_COUNT, DISK_SIZE/BLOCK_SIZE ) BENCH_DEFINE(DISK_SIZE, 1024*1024 ) BENCH_DEFINE(BLOCK_RECYCLES, -1 ) @@ -26,7 +34,9 @@ BENCH_DEFINE(LOOKGBMAP_THRESH, BLOCK_COUNT/4 ) BENCH_DEFINE(ERASE_VALUE, 0xff ) #ifndef BENCH_NAND - // default timings for NOR flash, based on w25q64jv: + // NOR flash timings + // + // based on w25q64jv: // https://www.winbond.com/resource-files/ // W25Q64JV%20RevM%2012242024%20Plus.pdf // @@ -67,7 +77,9 @@ BENCH_DEFINE(ERASED_TIMING, 10986 ) #endif #else - // default timings for NAND flash, based on w25n01gv: + // NAND flash timings + // + // based on w25n01gv: // https://www.winbond.com/resource-files/W25N01GV%20Rev%20R%20070323.pdf // // FR=104 MHz, quad read/prog (9.6 ns * 8/4) diff --git a/runners/test_defines.h b/runners/test_defines.h index 3adad7e2..c54c8800 100644 --- a/runners/test_defines.h +++ b/runners/test_defines.h @@ -4,9 +4,17 @@ // preconfigured defines that control how tests run #ifdef TEST_DEFINE // name value (overridable) - TEST_DEFINE(READ_SIZE, 1 ) - TEST_DEFINE(PROG_SIZE, 1 ) - TEST_DEFINE(BLOCK_SIZE, 4096 ) + #ifndef TEST_NAND + // NOR flash geometry + TEST_DEFINE(READ_SIZE, 1 ) + TEST_DEFINE(PROG_SIZE, 1 ) + TEST_DEFINE(BLOCK_SIZE, 4096 ) + #else + // NAND flash geometry + TEST_DEFINE(READ_SIZE, 1 ) + TEST_DEFINE(PROG_SIZE, 512 ) + TEST_DEFINE(BLOCK_SIZE, 131072 ) + #endif TEST_DEFINE(BLOCK_COUNT, DISK_SIZE/BLOCK_SIZE ) TEST_DEFINE(DISK_SIZE, 1024*1024 ) TEST_DEFINE(BLOCK_RECYCLES, -1 )