Werner's Miscellanea
Sign in or create your account | Project List | Help
Werner's Miscellanea Commit Details
Date: | 2011-10-10 04:01:45 (12 years 5 months ago) |
---|---|
Author: | Werner Almesberger |
Commit: | d433f73101e600e1906119103bfcf97cf018fa88 |
Message: | m1rc3/norruption/2/: new loop and tools, with auto-reporting and
auto-recovery Untested :-) |
Files: |
m1rc3/norruption/2/aloop (1 diff) m1rc3/norruption/2/bootsts (1 diff) m1rc3/norruption/2/getstby (1 diff) m1rc3/norruption/2/lockmost (1 diff) m1rc3/norruption/2/putstby (1 diff) |
Change Details
m1rc3/norruption/2/aloop | ||
---|---|---|
1 | #!/bin/bash | |
2 | ||
3 | TTY=/dev/ttyUSB0 | |
4 | DIR=${1:-.} | |
5 | ||
6 | ||
7 | boot() | |
8 | { | |
9 | make -C ../../../m1/jtag-boot boot | |
10 | } | |
11 | ||
12 | ||
13 | xterm -e "flterm --log $DIR/log --port $TTY --kernel boot.4e53273.bin" & | |
14 | ||
15 | n=0 | |
16 | while true; do | |
17 | n=`expr $n + 1` | |
18 | echo ===== $n ===== | |
19 | ||
20 | labsw ch1=0 ch2=0 | |
21 | sleep 2 | |
22 | labsw ch1=1 ch2=1 | |
23 | sleep 1 | |
24 | ||
25 | bs=`./bootsts` | |
26 | ||
27 | if [ "$bs" = "0x0001" ]; then | |
28 | boot | |
29 | sleep 10 | |
30 | echo echo === $n === `date` >$TTY | |
31 | sleep 5 | |
32 | continue | |
33 | fi | |
34 | ||
35 | echo bootsts = $bs >$DIR/stat$n | |
36 | ||
37 | ./getstby $DIR/corrupt$n.bin | |
38 | ||
39 | boot | |
40 | ||
41 | # 1.0-4.3 seconds | |
42 | sleep 2 | |
43 | ||
44 | echo '\033serialboot' >$TTY | |
45 | ||
46 | # >= 7.9 seconds | |
47 | sleep 9 | |
48 | ||
49 | echo -n a >$TTY | |
50 | ||
51 | # takes about 3 seconds | |
52 | sleep 4 | |
53 | ||
54 | ./putstby standby.fpg | |
55 | ||
56 | diff -u <(hexdup -C standby.fpg) \ | |
57 | <(hexdump -C $DIR/corrupt$n.bin) >$DIR/diff$n | |
58 | done |
m1rc3/norruption/2/bootsts | ||
---|---|---|
1 | #!/bin/sh | |
2 | jtag -q <<EOF | sed '/REG\[32\]=/s///p;d' | |
3 | cable milkymist | |
4 | detect | |
5 | instruction CFG_OUT 000100 BYPASS | |
6 | instruction CFG_IN 000101 BYPASS | |
7 | pld readreg 0x20 | |
8 | EOF |
m1rc3/norruption/2/getstby | ||
---|---|---|
1 | #!/bin/sh | |
2 | jtag -q <<EOF | |
3 | cable milkymist | |
4 | detect | |
5 | instruction CFG_OUT 000100 BYPASS | |
6 | instruction CFG_IN 000101 BYPASS | |
7 | pld load fjmem.bit | |
8 | initbus fjmem opcode=000010 | |
9 | frequency 6000000 | |
10 | detectflash 0 | |
11 | endian big | |
12 | readmem 0 0xa0000 $1 | |
13 | EOF |
m1rc3/norruption/2/lockmost | ||
---|---|---|
1 | #!/bin/sh | |
2 | # | |
3 | # lockmost - lock standby, soc-rescue, bios-rescue, splash-rescue, and | |
4 | # flickernoise-rescue, but leave standby unlocked | |
5 | # | |
6 | ||
7 | jtag -q <<EOF | |
8 | cable milkymist | |
9 | detect | |
10 | instruction CFG_OUT 000100 BYPASS | |
11 | instruction CFG_IN 000101 BYPASS | |
12 | pld load fjmem.bit | |
13 | initbus fjmem opcode=000010 | |
14 | frequency 6000000 | |
15 | detectflash 0 | |
16 | endian big | |
17 | lockflash 0xa0000 50 | |
18 | EOF |
m1rc3/norruption/2/putstby | ||
---|---|---|
1 | #!/bin/sh | |
2 | jtag -q <<EOF | |
3 | cable milkymist | |
4 | detect | |
5 | instruction CFG_OUT 000100 BYPASS | |
6 | instruction CFG_IN 000101 BYPASS | |
7 | pld load fjmem.bit | |
8 | initbus fjmem opcode=000010 | |
9 | frequency 6000000 | |
10 | detectflash 0 | |
11 | endian big | |
12 | flashmem 0 $1 noverify | |
13 | EOF |
Branches:
master