1
0
mirror of git://projects.qi-hardware.com/wernermisc.git synced 2024-11-15 10:50:37 +02:00

m1/jtag-boot/: quick hack to boot an M1 with the "regular" bitstream (from NOR)

This commit is contained in:
Werner Almesberger 2011-09-06 11:37:01 -03:00
parent e98ea2bfdb
commit 87aa1e7345
4 changed files with 43 additions and 0 deletions

10
m1/jtag-boot/Makefile Normal file
View File

@ -0,0 +1,10 @@
.PHONY: boot clean
boot: boot.jtag boot.bit
jtag boot.jtag
boot.bit: mkboot
./mkboot >$@ || { rm -rf $@; exit 1; }
clean:
rm -f boot.bit

BIN
m1/jtag-boot/boot.bit Normal file

Binary file not shown.

5
m1/jtag-boot/boot.jtag Normal file
View File

@ -0,0 +1,5 @@
cable milkymist
detect
instruction CFG_OUT 000100 BYPASS
instruction CFG_IN 000101 BYPASS
pld load boot.bit

28
m1/jtag-boot/mkboot Executable file
View File

@ -0,0 +1,28 @@
#!/usr/bin/perl
#
# mkboot - generate a bitstream (in .bit format) that boots an M1
# with the "regular" bitstream, using UrJTAG
#
# Hacked 2001 by Werner Almesberger
#
# magic, copied from xilinx_bitstream.c:xlx_bitstream_load_bit
print pack("C*",
0x00, 0x09, 0x0f, 0xf0, 0x0f, 0xf0, 0x0f, 0xf0,
0x0f, 0xf0, 0x00, 0x00, 0x01);
@seq = (
# 0xffff, # DUMMY
0xaa99, # Sync(1)
0x5566, # Sync(2)
0x3261, # write GENERAL1
0x0000, # start address 15:0
0x3281, # write GENERAL2
0x0037, # start address 23:16
0x30a1, # write CMD
0x000e); # IPROG
# 0x2000); # NOP
print pack("aN", "e", 2*@seq);
print pack("n*", @seq);