return true;
}
-static unsigned long copy_flash(unsigned int offset)
+static unsigned long copy_flash(unsigned int offset, unsigned int dst_offs)
{
Elf64_Ehdr ehdr;
Elf64_Phdr ph;
puts(" addr ");
uart_writeuint32((uint32_t)(unsigned long)addr);
puts("\r\n");
- fl_read(addr, off, size);
+ fl_read(addr+dst_offs, off, size);
poff += ehdr.e_phentsize;
}
(failcnt == 0))
{
// identify ELF, copy if present, and get the start address
- unsigned long faddr = copy_flash(spi_offs);
+ unsigned long faddr = copy_flash(spi_offs,
+ 0x600000); // hack!
if (faddr != -1ul) {
// jump to absolute address
- /* could do it this way but hey modify head.S instead
- mtspr(8, faddr); // move address to LR
- __asm__ volatile("blr");
- */
+ mtspr(8, faddr); // move address to LR
+ __asm__ volatile("blr");
// works with head.S which copies r3 into ctr then does bctr
return faddr;