summaryrefslogtreecommitdiffstats
path: root/arch/arm/include/asm
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2011-12-10 15:33:41 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2012-02-28 09:55:02 +0100
commit2c2d00a2816099ef90c149562b9f939048742c1f (patch)
tree38dd508bb09695330bfce64054f00f73be98b0e1 /arch/arm/include/asm
parent5c50423b7011346c4a38309d82394e6a2d3cdf29 (diff)
downloadbarebox-2c2d00a2816099ef90c149562b9f939048742c1f.tar.gz
barebox-2c2d00a2816099ef90c149562b9f939048742c1f.tar.xz
ARM: move exception vectors away from start of binary
Traditionally U-Boot and barebox have the exception vectors at the start of the binary. There is no real reason in doing so, because in the majority of cases this data will not be at 0x0 where it could be used as vectors directly anyway. This patch puts the vectors into a separate linker section and defines an head function which is placed at the start of the image instead. Putting this in a separate function also has the advantage that it can be placed at the start of images which require an additional header like several Freescale i.MX images. As the head function contains the barebox arm magic those images can now also be detected as barebox images. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/include/asm')
-rw-r--r--arch/arm/include/asm/barebox-arm-head.h24
-rw-r--r--arch/arm/include/asm/barebox-arm.h2
2 files changed, 26 insertions, 0 deletions
diff --git a/arch/arm/include/asm/barebox-arm-head.h b/arch/arm/include/asm/barebox-arm-head.h
new file mode 100644
index 0000000000..fdbee8cdda
--- /dev/null
+++ b/arch/arm/include/asm/barebox-arm-head.h
@@ -0,0 +1,24 @@
+#ifndef __ASM_ARM_HEAD_H
+#define __ASM_ARM_HEAD_H
+
+static inline void barebox_arm_head(void)
+{
+ __asm__ __volatile__ (
+ "b reset\n"
+ "1: b 1b\n"
+ "1: b 1b\n"
+ "1: b 1b\n"
+ "1: b 1b\n"
+ "1: b 1b\n"
+ "1: b 1b\n"
+ "1: b 1b\n"
+ ".word 0x65726162\n" /* 'bare' */
+ ".word 0x00786f62\n" /* 'box' */
+ ".word _text\n" /* text base. If copied there,
+ * barebox can skip relocation
+ */
+ ".word _barebox_image_size\n" /* image size to copy */
+ );
+}
+
+#endif /* __ASM_ARM_HEAD_H */
diff --git a/arch/arm/include/asm/barebox-arm.h b/arch/arm/include/asm/barebox-arm.h
index 7bb1af1606..333978241c 100644
--- a/arch/arm/include/asm/barebox-arm.h
+++ b/arch/arm/include/asm/barebox-arm.h
@@ -36,6 +36,8 @@ int cleanup_before_linux(void);
int board_init(void);
int dram_init (void);
+extern char __exceptions_start[], __exceptions_stop[];
+
void board_init_lowlevel(void);
void board_init_lowlevel_return(void);
void arch_init_lowlevel(void);