new file mode 100644
@@ -0,0 +1 @@
+boot_rom.bin
@@ -7,7 +7,7 @@
tests-common = \
$(TEST_DIR)/selftest.elf
-all: test_cases
+all: $(TEST_DIR)/boot_rom.bin test_cases
##################################################################
@@ -34,8 +34,15 @@ FLATLIBS = $(libcflat) $(LIBFDT_archive) $(libgcc)
-Wl,-T,powerpc/flat.lds,--build-id=none \
$(filter %.o, $^) $(FLATLIBS)
+$(TEST_DIR)/boot_rom.bin: $(TEST_DIR)/boot_rom.elf
+ dd if=/dev/zero of=$@ bs=256 count=1
+ $(OBJCOPY) -O binary $^ >(cat - >>$@)
+
+$(TEST_DIR)/boot_rom.elf: $(TEST_DIR)/boot_rom.o
+ $(LD) -nostdlib -Ttext=0x100 --entry=start --build-id=none -o $@ $<
+
powerpc_clean: libfdt_clean asm_offsets_clean
- $(RM) $(TEST_DIR)/*.{o,elf} \
+ $(RM) $(TEST_DIR)/*.{o,elf} $(TEST_DIR)/boot_rom.bin \
$(TEST_DIR)/.*.d lib/powerpc/.*.d
##################################################################
new file mode 100644
@@ -0,0 +1,5 @@
+#define SPAPR_KERNEL_LOAD_ADDR 0x400000
+.text
+.globl start
+start:
+ b SPAPR_KERNEL_LOAD_ADDR - 0x100