LDFLAGS_DIRECT += -marmelf$(LDFLAGS_DIRECT_$(XEN_OS))_eabi
CONFIG_LOAD_ADDRESS ?= 0x80000000
+
+# XXX: When running on the model there is no bootloader to provide a
+# device tree. It must be linked into Xen.
+ifndef CONFIG_DTB_FILE
+$(error CONFIG_DTB_FILE must be set to the absolute filename of a DTB)
+endif
#obj-bin-y += ....o
+ifdef CONFIG_DTB_FILE
+obj-y += dtb.o
+AFLAGS += -DCONFIG_DTB_FILE=\"$(CONFIG_DTB_FILE)\"
+endif
+
ALL_OBJS := head.o $(ALL_OBJS)
$(TARGET): $(TARGET)-syms
# XXX: VE model loads by VMA so instead of
# making a proper ELF we link with LMA == VMA and adjust crudely
- $(OBJCOPY) --change-addresses +0x7fe00000 $< $@
+ $(OBJCOPY) --change-addresses +0x80000000 $< $@
# XXX strip it
#$(TARGET): $(TARGET)-syms $(efi-y) boot/mkelf32
sed -e 's/xen\.lds\.o:/xen\.lds:/g' <.xen.lds.d >.xen.lds.d.new
mv -f .xen.lds.d.new .xen.lds.d
+dtb.o: $(CONFIG_DTB_FILE)
+
.PHONY: clean
clean::
rm -f asm-offsets.s xen.lds
--- /dev/null
+ .section .dtb,#alloc
+ .incbin CONFIG_DTB_FILE
adr r9, start /* r9 := paddr (start) */
sub r10, r9, r0 /* r10 := phys-offset */
+ /* Using the DTB in the .dtb section? */
+#ifdef CONFIG_DTB_FILE
+ ldr r8, =_sdtb
+ add r8, r10 /* r8 := paddr(DTB) */
+#endif
+
#ifdef EARLY_UART_ADDRESS
/* Say hello */
ldr r11, =EARLY_UART_ADDRESS /* r11 := UART base address */
} :text
_end = . ;
+ /* Section for the device tree blob (if any). */
+ _sdtb = .;
+ .dtb : { *(.dtb) } :text
+
/* Sections to be discarded */
/DISCARD/ : {
*(.exit.text)