summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ports/beagleboneblack/Makefile7
-rw-r--r--ports/beagleboneblack/gp_header.S7
2 files changed, 14 insertions, 0 deletions
diff --git a/ports/beagleboneblack/Makefile b/ports/beagleboneblack/Makefile
index 0525dec..db285bd 100644
--- a/ports/beagleboneblack/Makefile
+++ b/ports/beagleboneblack/Makefile
@@ -83,8 +83,15 @@ OBJS = $(LOCSOBJ) $(CPUSOBJ) $(LOCCOBJ) $(CPUCOBJ) $(COMCOBJ) \
# load a new version onto an already running system.
#
boot: $(BUILDDIR)/boot.$(FILETYPE)
+ $(CC) $(ASMFLAGS) -D \
+ BIN_SIZE=$(shell wc --bytes build_$(PLATFORM)/boot.bin | cut -f 1 -d ' ') \
+ -o gp_header.o gp_header.S
+ $(OBJCOPY) -O binary gp_header.o build_$(PLATFORM)/gp_header.bin
+ @cat build_$(PLATFORM)/gp_header.bin build_$(PLATFORM)/boot.bin > build_$(PLATFORM)/MLO
@echo Boot version of uMon built under $(BUILDDIR) ...
@ls $(BUILDDIR)/boot*
+ @echo Boot version of uMon attached with GP header build under $(BUILDDIR) ...
+ @ls $(BUILDDIR)/MLO
# ramtst:
# A shortcut to $(BUILDDIR)/ramtst.$(FILETYPE). This is a version of uMon
diff --git a/ports/beagleboneblack/gp_header.S b/ports/beagleboneblack/gp_header.S
new file mode 100644
index 0000000..3efceae
--- /dev/null
+++ b/ports/beagleboneblack/gp_header.S
@@ -0,0 +1,7 @@
+ .file "gp_header.S"
+
+/* This GP header is prepended to uMon images when booting from non-XIP devices (e.g. SD).
+ * Refer to the AM335x TRM, Section 26.1.9 for more information.
+ */
+ .word BIN_SIZE + 8
+ .word 0x402f0400