# Hello world
MEMORY_SIZE=8192
-RAM_INIT_FILE=hello_world/hello_world.bin
-#RAM_INIT_FILE=coldboot/coldboot.bin
+#RAM_INIT_FILE=hello_world/hello_world.bin
+RAM_INIT_FILE=coldboot/coldboot.bin
SIM_MAIN_BRAM=false
# Micropython
clean:
- @rm -f ../lib/*.o ../libgram/src/*.o *.o coldboot.elf coldboot.bin coldboot.hex coldboot.as coldboot.S powerpc.lds
+ @rm -f ../lib/*.o ../libgram/src/*.o *.o coldboot.elf coldboot.bin \
+ coldboot.hex coldboot.as coldboot.S powerpc.lds
distclean: clean
rm -f *~
#endif
puts("done\n");
+#if 0 // ooo, annoying: won't work. no idea why
// temporary hard-hack: boot directly from QSPI. really
// should do something like detect at least... something
if ((ftr & SYS_REG_INFO_HAS_SPI_FLASH))
__asm__ volatile("blr");
return 0;
}
+#endif
// memcpy from SPI Flash then boot
if ((ftr & SYS_REG_INFO_HAS_SPI_FLASH) &&
(failcnt == 0))
{
+/*
+ puts("ELF @ QSPI\n");
// identify ELF, copy if present, and get the start address
unsigned long faddr = copy_flash(spi_offs,
0x600000); // hack!
// works with head.S which copies r3 into ctr then does bctr
return faddr;
}
+ puts("copy QSPI\n");
+*/
+ // another terrible hack: copy from flash at offset 0x600000
+ // a block of size 0x600000 into mem address 0x600000, then
+ // jump to it. this allows a dtb image to be executed
+ uint32_t *mem = (uint32_t*)0x600000;
+ fl_read(mem, 0x600000, 0x600000);
+ mtspr(8, 0x600000); // move address to LR
+ __asm__ volatile("blr");
}
return 0;
endif
endif
-#BOOT_INIT_BASE ?= 0xf0000000 # at QSPI address
- BOOT_INIT_BASE ?= 0xff000000 # at ROM hi address (with coldboot firmware)
+BOOT_INIT_BASE ?= 0xf0000000 # at QSPI address
+# BOOT_INIT_BASE ?= 0xff000000 # at ROM hi address (with coldboot firmware)
# BOOT_INIT_BASE ?= 0x0 # start at zero (usual)
CC = $(CROSS_COMPILE)gcc