|
@@ -217,14 +217,22 @@ IRQHANDLER(romcopy)
|
|
|
{
|
|
|
size_t rombase;
|
|
|
|
|
|
- /* The handover code from the normal startup will set tp to our ROM area */
|
|
|
+ /*
|
|
|
+ * The handover code from the normal startup will set tp to
|
|
|
+ * our ROM area, not including the SRAM image.
|
|
|
+ */
|
|
|
asm("mv %0,tp" : "=r" (rombase));
|
|
|
|
|
|
+ if (rombase) {
|
|
|
+ /* Test-only ROM image? */
|
|
|
+ rombase = ROM_OFFSET;
|
|
|
+ }
|
|
|
+
|
|
|
switch (romcopy_state++) {
|
|
|
case 0:
|
|
|
/* Copy testdata */
|
|
|
ROMCOPY_RAMADDR = (size_t)__dram_init_start;
|
|
|
- ROMCOPY_ROMADDR = rombase + SRAM_SIZE;
|
|
|
+ ROMCOPY_ROMADDR = rombase;
|
|
|
ROMCOPY_DATALEN = (size_t)__dram_init_len;
|
|
|
break;
|
|
|
case 1:
|