From bb28e090cd5521eb4cdc6123d970e35470671213 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 17 Nov 2013 20:13:13 +0100 Subject: simtrace: main_factory: Program OTP area with simtrace version --- firmware/src/simtrace/main_factory.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'firmware/src/simtrace') diff --git a/firmware/src/simtrace/main_factory.c b/firmware/src/simtrace/main_factory.c index 3585fa6..268c45f 100644 --- a/firmware/src/simtrace/main_factory.c +++ b/firmware/src/simtrace/main_factory.c @@ -25,7 +25,6 @@ #include #include #include -#include "../openpcd.h" #include "../simtrace.h" #include #include @@ -33,6 +32,11 @@ #include #include #include +#include + +#include "spi_flash.h" +#include "prod_info.h" + void _init_func(void) { @@ -57,8 +61,22 @@ int _main_dbgu(char key) DEBUGPCRF("main_dbgu"); switch (key) { - case 'f': - spiflash_id(); + case 'g': + for (i = 1; i <= 16; i++) { + int s = spiflash_otp_get_lock(i); + DEBUGPCR("OTP region %d locked: %d", i, s); + } + break; + case 'p': + prod_info_write(0, SIMTRACE_VER(1,3,0), 0); + break; + case 'P': + { + u_int32_t version; + int rc = prod_info_get(&version, NULL); + if (rc >= 0) + DEBUGPCR("Version: 0x%08x\n", version); + } break; case '?': help(); -- cgit v1.2.3