Root/m1rc3/norruption/2/dumplock

Source at commit e0f8fc0a0675ddbee18830821af00f49741cd026 created 7 years 9 months ago.
By Werner Almesberger, m1rc3/norruption/2/dumplock: dump NOR locks (untested)
1#!/bin/sh
2
3blocks=55
4offset=2 # 0 for manufacturer ID (0x89)
5
6
7hex()
8{
9    ( echo obase=16; echo $1; ) | bc -q
10}
11
12
13(
14    cat <<EOF
15cable milkymist
16detect
17instruction CFG_OUT 000100 BYPASS
18instruction CFG_IN 000101 BYPASS
19pld load fjmem.bit
20initbus fjmem opcode=000010
21frequency 6000000
22detectflash 0
23poke 0 0x90
24EOF
25    a=$offset
26    i=0
27    while [ $i -le $blocks ]; do
28        echo peek 0x`hex $a`
29        a=`expr $a + 128 \* 1024`
30        i=`expr $i + 1`
31    done
32echo poke 0 0xff
33) | jtag -q
34

Archive Download this file

Branches:
master



interactive