From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: barebox@lists.infradead.org
Subject: [PATCH 3/3] arm: at91: add custom barebox-arm-head
Date: Fri, 3 Aug 2012 07:59:53 +0200 [thread overview]
Message-ID: <1343973593-23482-3-git-send-email-plagnioj@jcrosoft.com> (raw)
In-Reply-To: <1343973593-23482-1-git-send-email-plagnioj@jcrosoft.com>
On at91 we need to put the size to load is the sram at the 6th exception vector
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
arch/arm/Kconfig | 1 +
arch/arm/mach-at91/include/mach/barebox-arm-head.h | 33 ++++++++++++++++++++
2 files changed, 34 insertions(+)
create mode 100644 arch/arm/mach-at91/include/mach/barebox-arm-head.h
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 8b0a28d..ce32efb 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -27,6 +27,7 @@ config ARCH_AT91
select GENERIC_GPIO
select CLKDEV_LOOKUP
select HAS_DEBUG_LL
+ select HAVE_MACH_ARM_HEAD
config ARCH_EP93XX
bool "Cirrus Logic EP93xx"
diff --git a/arch/arm/mach-at91/include/mach/barebox-arm-head.h b/arch/arm/mach-at91/include/mach/barebox-arm-head.h
new file mode 100644
index 0000000..a9c8dd4
--- /dev/null
+++ b/arch/arm/mach-at91/include/mach/barebox-arm-head.h
@@ -0,0 +1,33 @@
+#ifndef __MACH_ARM_HEAD_H
+#define __MACH_ARM_HEAD_H
+
+#ifdef CONFIG_SHELL_NONE
+#define AT91_EXV6 ".word _barebox_image_size\n"
+#else
+#define AT91_EXV6 ".word _barebox_bare_init_size\n"
+#endif
+
+static inline void barebox_arm_head(void)
+{
+ __asm__ __volatile__ (
+#ifdef CONFIG_THUMB2_BAREBOX
+#error Thumb2 is not supported
+#else
+ "b reset\n"
+ "1: b 1b\n"
+ "1: b 1b\n"
+ "1: b 1b\n"
+ "1: b 1b\n"
+ AT91_EXV6 /* image size to load by the bootrom */
+ "1: b 1b\n"
+ "1: b 1b\n"
+#endif
+ ".asciz \"barebox\"\n"
+ ".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 */
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
prev parent reply other threads:[~2012-08-03 5:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-03 5:57 [PATCH 0/3] AT91: Rom boot prepare Jean-Christophe PLAGNIOL-VILLARD
2012-08-03 5:59 ` [PATCH 1/3] arm: at91: add debug_ll support Jean-Christophe PLAGNIOL-VILLARD
2012-08-03 5:59 ` [PATCH 2/3] arm introduce CONFIG_MACH_ARM_HEAD option to allow custom head Jean-Christophe PLAGNIOL-VILLARD
2012-08-03 5:59 ` Jean-Christophe PLAGNIOL-VILLARD [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1343973593-23482-3-git-send-email-plagnioj@jcrosoft.com \
--to=plagnioj@jcrosoft.com \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox