[PATCH 1/2] BBB: Build a uMon image with a Configuration header and a GP header prepended.

Jarielle Catbagan jcatbagan93 at gmail.com
Wed Jul 8 21:28:41 UTC 2015


---
 ports/beagleboneblack/Makefile        |  9 ++++++-
 ports/beagleboneblack/config_header.S | 46 +++++++++++++++++++++++++++++++++++
 2 files changed, 54 insertions(+), 1 deletion(-)
 create mode 100644 ports/beagleboneblack/config_header.S

diff --git a/ports/beagleboneblack/Makefile b/ports/beagleboneblack/Makefile
index db285bd..c66ee62 100644
--- a/ports/beagleboneblack/Makefile
+++ b/ports/beagleboneblack/Makefile
@@ -86,12 +86,19 @@ 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
+	${CC} ${ASMFLAGS} -o config_header.o config_header.S
 	$(OBJCOPY) -O binary gp_header.o build_$(PLATFORM)/gp_header.bin
+	${OBJCOPY} -O binary config_header.o build_${PLATFORM}/config_header.bin
 	@cat build_$(PLATFORM)/gp_header.bin build_$(PLATFORM)/boot.bin > build_$(PLATFORM)/MLO
+	@cat build_$(PLATFORM)/config_header.bin build_$(PLATFORM)/gp_header.bin \
+		build_$(PLATFORM)/boot.bin > build_$(PLATFORM)/rawboot.bin
 	@echo Boot version of uMon built under $(BUILDDIR) ...
 	@ls $(BUILDDIR)/boot*
-	@echo Boot version of uMon attached with GP header build under $(BUILDDIR) ...
+	@echo Boot version of uMon prepended with a GP header built under $(BUILDDIR) ...
 	@ls $(BUILDDIR)/MLO
+	@echo Boot version of uMon prepended with a Configuration header and a GP header built
+	@echo under $(BUILDDIR) ...
+	@ls $(BUILDDIR)/rawboot.bin
 
 # ramtst:
 # A shortcut to $(BUILDDIR)/ramtst.$(FILETYPE).  This is a version of uMon
diff --git a/ports/beagleboneblack/config_header.S b/ports/beagleboneblack/config_header.S
new file mode 100644
index 0000000..dbf6ff0
--- /dev/null
+++ b/ports/beagleboneblack/config_header.S
@@ -0,0 +1,46 @@
+	.file "config_header.S"
+
+/* This is the Configuration Header TOC Structure that must be prepended to a GP Header followed
+ * by the uMon image in order to boot from non-XIP devices such as an SD card using "raw" mode.
+ * Please refer to the AM335x TRM, Section 26.1.7.5.5.1 "Configuration Header" for more information.
+ */
+
+	/* Start */
+	.word 0x000000a0
+	/* Size */
+	.word 0x00000050
+	/* Reserved */
+	.word 0x00000000
+	.word 0x00000000
+	.word 0x00000000
+	/* Filename */
+	.word 0x45534843
+	.word 0x4e495454
+	.word 0x00005347
+	/* Closing Item */
+	.word 0xffffffff
+	.word 0xffffffff
+	.word 0xffffffff
+	.word 0xffffffff
+	.word 0xffffffff
+	.word 0xffffffff
+	.word 0xffffffff
+	.word 0xffffffff
+
+	/* Gap between Configuration Header TOC Structure and Configuration Header Settings */
+	.rept 24
+	.word 0x00000000
+	.endr
+
+	/* Section Key */
+	.word 0xc0c0c0c1
+	/* Valid */
+	.byte 0x00
+	/* Version */
+	.byte 0x01
+	/* Reserved */
+	.rept 86
+	.word 0x00000000
+	.endr
+	.byte 0x00
+	.byte 0x00
-- 
2.3.4




More information about the umon-devel mailing list