summaryrefslogtreecommitdiff
path: root/cpu/blackfin/start.S
diff options
context:
space:
mode:
Diffstat (limited to 'cpu/blackfin/start.S')
-rw-r--r--cpu/blackfin/start.S24
1 files changed, 14 insertions, 10 deletions
diff --git a/cpu/blackfin/start.S b/cpu/blackfin/start.S
index 7cbd632..7a3abba 100644
--- a/cpu/blackfin/start.S
+++ b/cpu/blackfin/start.S
@@ -95,6 +95,7 @@ ENTRY(_start)
/* Save RETX so we can pass it while booting Linux */
r7 = RETX;
+#if CONFIG_MEM_SIZE
/* Figure out where we are currently executing so that we can decide
* how to best reprogram and relocate things. We'll pass below:
* R4: load address of _start
@@ -131,6 +132,9 @@ ENTRY(_start)
r3.h = 0x2000;
cc = r5 < r3 (iu);
if cc jump .Ldma_and_reprogram;
+#else
+ r6 = 1 (x); /* fake loaded_from_ldr = 1 */
+#endif
r0 = 0 (x); /* set bootstruct to NULL */
call _initcode;
jump .Lprogrammed;
@@ -139,11 +143,10 @@ ENTRY(_start)
.Ldma_and_reprogram:
r0.l = LO(L1_INST_SRAM);
r0.h = HI(L1_INST_SRAM);
- r1.l = __initcode_start;
- r1.h = __initcode_start;
- r2.l = __initcode_end;
- r2.h = __initcode_end;
- r2 = r2 - r1; /* convert r2 into length of initcode */
+ r1.l = __initcode_lma;
+ r1.h = __initcode_lma;
+ r2.l = __initcode_len;
+ r2.h = __initcode_len;
r1 = r1 - r4; /* convert r1 from load address of initcode ... */
r1 = r1 + r5; /* ... to current (not load) address of initcode */
p3 = r0;
@@ -155,6 +158,7 @@ ENTRY(_start)
.Lprogrammed:
serial_early_set_baud
+#if CONFIG_MEM_SIZE
/* Relocate from wherever we are (FLASH/RAM/etc...) to the hardcoded
* monitor location in the end of RAM. We know that memcpy() only
* uses registers, so it is safe to call here. Note that this only
@@ -167,18 +171,18 @@ ENTRY(_start)
r2.l = LO(CONFIG_SYS_MONITOR_LEN);
r2.h = HI(CONFIG_SYS_MONITOR_LEN);
call _memcpy_ASM;
+#endif
/* Initialize BSS section ... we know that memset() does not
* use the BSS, so it is safe to call here. The bootrom LDR
* takes care of clearing things for us.
*/
serial_early_puts("Zero BSS");
- r0.l = __bss_start;
- r0.h = __bss_start;
+ r0.l = __bss_vma;
+ r0.h = __bss_vma;
r1 = 0 (x);
- r2.l = __bss_end;
- r2.h = __bss_end;
- r2 = r2 - r0;
+ r2.l = __bss_len;
+ r2.h = __bss_len;
call _memset;
.Lnorelocate: