1
0
mirror of git://projects.qi-hardware.com/wernermisc.git synced 2024-12-19 15:25:19 +02:00

m1rc3/norruption/2/dumplock: dump NOR locks (untested)

This commit is contained in:
Werner Almesberger 2011-10-14 06:09:13 -03:00
parent cb024e1f42
commit e0f8fc0a06

33
m1rc3/norruption/2/dumplock Executable file
View File

@ -0,0 +1,33 @@
#!/bin/sh
blocks=55
offset=2 # 0 for manufacturer ID (0x89)
hex()
{
( echo obase=16; echo $1; ) | bc -q
}
(
cat <<EOF
cable milkymist
detect
instruction CFG_OUT 000100 BYPASS
instruction CFG_IN 000101 BYPASS
pld load fjmem.bit
initbus fjmem opcode=000010
frequency 6000000
detectflash 0
poke 0 0x90
EOF
a=$offset
i=0
while [ $i -le $blocks ]; do
echo peek 0x`hex $a`
a=`expr $a + 128 \* 1024`
i=`expr $i + 1`
done
echo poke 0 0xff
) | jtag -q