aboutsummaryrefslogtreecommitdiff
path: root/arch/arm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/cpu/armv7/start.S23
-rw-r--r--arch/arm/include/asm/arch-omap4/spl.h1
2 files changed, 24 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S
index 7df97c5a3..5b53c7a56 100644
--- a/arch/arm/cpu/armv7/start.S
+++ b/arch/arm/cpu/armv7/start.S
@@ -124,6 +124,29 @@ IRQ_STACK_START_IN:
*/
reset:
+#if defined CONFIG_SPL_BUILD && defined CONFIG_SPL_USB
+/*
+ * When loaded over USB the code lands at the base
+ * of SRAM so we need to copy to our actual link
+ * address. The destination overlaps with the source
+ * so copy backwards.
+ */
+ ldr sp, =(CONFIG_SYS_INIT_SP_ADDR)
+ bic sp, sp, #7 /* 8-byte alignment for ABI compliance */
+ ldr r8, =_start /* linked here */
+ adr r7, _start /* loaded here */
+ subs r6, r8, r7 /* offset */
+ beq done /* nothing todo */
+ ldr r9, =__image_copy_end /* dest = end of linked code */
+ sub r7, r9, r6 /* source = dest - offset */
+2: ldr r6, [r7], #-4
+ str r6, [r9], #-4
+ cmp r9, r8
+ bne 2b
+ ldr lr, =done
+ mov pc, lr
+done:
+#endif
bl save_boot_params
/*
* set the cpu to SVC32 mode
diff --git a/arch/arm/include/asm/arch-omap4/spl.h b/arch/arm/include/asm/arch-omap4/spl.h
index cec84dc54..abbb9bc44 100644
--- a/arch/arm/include/asm/arch-omap4/spl.h
+++ b/arch/arm/include/asm/arch-omap4/spl.h
@@ -31,5 +31,6 @@
#define BOOT_DEVICE_MMC1 5
#define BOOT_DEVICE_MMC2 6
#define BOOT_DEVICE_MMC2_2 0xFF
+#define BOOT_DEVICE_USB 69 /* usb periperal */
#endif