diff --git a/m1/jtag-boot/Makefile b/m1/jtag-boot/Makefile new file mode 100644 index 0000000..e50e5d3 --- /dev/null +++ b/m1/jtag-boot/Makefile @@ -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 diff --git a/m1/jtag-boot/boot.bit b/m1/jtag-boot/boot.bit new file mode 100644 index 0000000..06c53ad Binary files /dev/null and b/m1/jtag-boot/boot.bit differ diff --git a/m1/jtag-boot/boot.jtag b/m1/jtag-boot/boot.jtag new file mode 100644 index 0000000..06295ae --- /dev/null +++ b/m1/jtag-boot/boot.jtag @@ -0,0 +1,5 @@ +cable milkymist +detect +instruction CFG_OUT 000100 BYPASS +instruction CFG_IN 000101 BYPASS +pld load boot.bit diff --git a/m1/jtag-boot/mkboot b/m1/jtag-boot/mkboot new file mode 100755 index 0000000..b3d624f --- /dev/null +++ b/m1/jtag-boot/mkboot @@ -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);