From 2e46384b04a8f60589e8f7ad9333e6903b6c7f06 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Thu, 12 Jan 2012 14:03:43 -0300 Subject: [PATCH] m1nor: lock the read-only portions of the flash after flashing --- m1/tools/m1nor | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/m1/tools/m1nor b/m1/tools/m1nor index 0d8c866..5ff23d9 100755 --- a/m1/tools/m1nor +++ b/m1/tools/m1nor @@ -100,9 +100,20 @@ EOF classify "$n" echo flashmem "$off" "$n" noverify done + echo lockflash 0 55 + echo detectflash 0 echo pld reconfigure ) | jtag -q || exit +# +# Fun fact: a direct flashmem-lockflash-pld reconfigure sequence leaves +# the FPGA in a weird state from which it can't boot out of standby, neither +# via JTAG (pld load ...) or by pressing the middle button. +# +# The only thing that seems to help is to run "detectflash" after the locking. +# (Tried "peek", "usleep", "pld readreg", ... without success.) +# + # # FIXME: the exit code of "jtag" doesn't indicate whether the session was # successful.