aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorJohn Rigby <john.rigby@linaro.org>2011-10-18 21:19:17 -0600
committerJohn Rigby <john.rigby@linaro.org>2012-12-06 12:16:42 -0700
commit5461313e54cce1bc85c0599d6dc7ba3c49094b62 (patch)
tree0d47a1545cea98c812324527b2879ca89667b5ce /arch
parentc8e42565afaaea61e1e5e159ca850652baa247f6 (diff)
downloadu-boot-linaro-stable-5461313e54cce1bc85c0599d6dc7ba3c49094b62.tar.gz
OMAP4: Panda: Add usb peripheral boot
Stripped down fastboot protocol for now but could be just about anything. Will revisit once a fastboot or dfu implementation hits upstream. Signed-off-by: John Rigby <john.rigby@linaro.org> Conflicts: arch/arm/cpu/armv7/omap-common/Makefile arch/arm/include/asm/omap_common.h common/spl/spl.c include/configs/omap4_common.h spl/Makefile
Diffstat (limited to 'arch')
-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