diff gsm-fw/sysglue/flashboot.S @ 636:06ecb305f650

flashImage for BootROM-enabled targets: put something sensible at 0
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Mon, 01 Sep 2014 19:34:31 +0000
parents 658a83ff7221
children a8fc7526935e
line wrap: on
line diff
--- a/gsm-fw/sysglue/flashboot.S	Mon Sep 01 18:45:37 2014 +0000
+++ b/gsm-fw/sysglue/flashboot.S	Mon Sep 01 19:34:31 2014 +0000
@@ -5,6 +5,38 @@
 
 #include "../include/config.h"
 
+#if FLASH_BOOT_VIA_BOOTROM
+/*
+ * Put something sensible in the boot ROM overlay area, just for the
+ * heck of it, or for extra robustness.
+ */
+	.section	bootrom.overlay,"ax",%progbits
+	.code	32
+	.org	0
+	b	BootROM_disabled_entry
+#include "vectors.S"
+BootROM_disabled_entry:
+/* copy the boot ROM switch code to IRAM and jump to it */
+	ldr	r4, =__romswitch_flash_addr
+	ldr	r5, =__romswitch_ram_addr
+	ldr	r2, =__romswitch_size
+1:	ldr	r0, [r4], #4
+	str	r0, [r5], #4
+	subs	r2, r2, #4
+	bhi	1b
+	ldr	pc, =__romswitch_ram_addr
+
+	.section	bootrom.switch,"ax",%progbits
+	.code	32
+	.org	0
+@ enable the Calypso boot ROM
+	ldr	r1, =0xFFFFFB10
+	mov	r2, #0x0100
+	strh	r2, [r1]
+@ jump to it!
+	mov	pc, #0
+#endif
+
 	.section	flashboot.text,"ax",%progbits
 	.code	32
 	.org	0