From 87aa1e7345dc4fc1d344f551711052a2f50a8022 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Tue, 6 Sep 2011 11:37:01 -0300 Subject: [PATCH] m1/jtag-boot/: quick hack to boot an M1 with the "regular" bitstream (from NOR) --- m1/jtag-boot/Makefile | 10 ++++++++++ m1/jtag-boot/boot.bit | Bin 0 -> 34 bytes m1/jtag-boot/boot.jtag | 5 +++++ m1/jtag-boot/mkboot | 28 ++++++++++++++++++++++++++++ 4 files changed, 43 insertions(+) create mode 100644 m1/jtag-boot/Makefile create mode 100644 m1/jtag-boot/boot.bit create mode 100644 m1/jtag-boot/boot.jtag create mode 100755 m1/jtag-boot/mkboot 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 0000000000000000000000000000000000000000..06c53ad4a07137625e89c3cffa5f5253b0bc5fee GIT binary patch literal 34 lcmZSJ7&S7O8!Tkt0|2K_2-W}q literal 0 HcmV?d00001 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);