Date:2011-10-10 04:01:45 (7 years 11 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
3TTY=/dev/ttyUSB0
4DIR=${1:-.}
5
6
7boot()
8{
9    make -C ../../../m1/jtag-boot boot
10}
11
12
13xterm -e "flterm --log $DIR/log --port $TTY --kernel boot.4e53273.bin" &
14
15n=0
16while 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
58done
m1rc3/norruption/2/bootsts
1#!/bin/sh
2jtag -q <<EOF | sed '/REG\[32\]=/s///p;d'
3cable milkymist
4detect
5instruction CFG_OUT 000100 BYPASS
6instruction CFG_IN 000101 BYPASS
7pld readreg 0x20
8EOF
m1rc3/norruption/2/getstby
1#!/bin/sh
2jtag -q <<EOF
3cable milkymist
4detect
5instruction CFG_OUT 000100 BYPASS
6instruction CFG_IN 000101 BYPASS
7pld load fjmem.bit
8initbus fjmem opcode=000010
9frequency 6000000
10detectflash 0
11endian big
12readmem 0 0xa0000 $1
13EOF
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
7jtag -q <<EOF
8cable milkymist
9detect
10instruction CFG_OUT 000100 BYPASS
11instruction CFG_IN 000101 BYPASS
12pld load fjmem.bit
13initbus fjmem opcode=000010
14frequency 6000000
15detectflash 0
16endian big
17lockflash 0xa0000 50
18EOF
m1rc3/norruption/2/putstby
1#!/bin/sh
2jtag -q <<EOF
3cable milkymist
4detect
5instruction CFG_OUT 000100 BYPASS
6instruction CFG_IN 000101 BYPASS
7pld load fjmem.bit
8initbus fjmem opcode=000010
9frequency 6000000
10detectflash 0
11endian big
12flashmem 0 $1 noverify
13EOF

Archive Download the corresponding diff file

Branches:
master



interactive