* [PATCH 0/3] AT91: Rom boot prepare
@ 2012-08-03 5:57 Jean-Christophe PLAGNIOL-VILLARD
2012-08-03 5:59 ` [PATCH 1/3] arm: at91: add debug_ll support Jean-Christophe PLAGNIOL-VILLARD
0 siblings, 1 reply; 4+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-08-03 5:57 UTC (permalink / raw)
To: barebox
Hi,
This patch serie prepare the support of Rom boot
The following changes since commit 6efca01b82a59f32b016f9cfd46b12e8e632ee92:
eukrea_cpuimx35: fix USB host (2012-08-02 11:01:18 +0200)
are available in the git repository at:
git://git.jcrosoft.org/barebox.git master
for you to fetch changes up to bfefad599289a98656013d9d9ce753fbb484f071:
arm: at91: add custom barebox-arm-head (2012-08-03 13:36:41 +0800)
----------------------------------------------------------------
Jean-Christophe PLAGNIOL-VILLARD (3):
arm: at91: add debug_ll support
arm introduce CONFIG_MACH_ARM_HEAD option to allow custom head
arm: at91: add custom barebox-arm-head
arch/arm/Kconfig | 5 +++++
arch/arm/include/asm/barebox-arm-head.h | 4 ++++
arch/arm/mach-at91/include/mach/barebox-arm-head.h | 33 +++++++++++++++++++++++++++++++++
arch/arm/mach-at91/include/mach/debug_ll.h | 37 +++++++++++++++++++++++++++++++++++++
4 files changed, 79 insertions(+)
create mode 100644 arch/arm/mach-at91/include/mach/barebox-arm-head.h
create mode 100644 arch/arm/mach-at91/include/mach/debug_ll.h
Best Regards,
J.
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/3] arm: at91: add debug_ll support
2012-08-03 5:57 [PATCH 0/3] AT91: Rom boot prepare Jean-Christophe PLAGNIOL-VILLARD
@ 2012-08-03 5:59 ` 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 ` [PATCH 3/3] arm: at91: add custom barebox-arm-head Jean-Christophe PLAGNIOL-VILLARD
0 siblings, 2 replies; 4+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-08-03 5:59 UTC (permalink / raw)
To: barebox
Today we only use the DBGU port
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
arch/arm/Kconfig | 1 +
arch/arm/mach-at91/include/mach/debug_ll.h | 37 ++++++++++++++++++++++++++++
2 files changed, 38 insertions(+)
create mode 100644 arch/arm/mach-at91/include/mach/debug_ll.h
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 08c742b..8665c16 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -23,6 +23,7 @@ config ARCH_AT91
bool "Atmel AT91"
select GENERIC_GPIO
select CLKDEV_LOOKUP
+ select HAS_DEBUG_LL
config ARCH_EP93XX
bool "Cirrus Logic EP93xx"
diff --git a/arch/arm/mach-at91/include/mach/debug_ll.h b/arch/arm/mach-at91/include/mach/debug_ll.h
new file mode 100644
index 0000000..ee824cb
--- /dev/null
+++ b/arch/arm/mach-at91/include/mach/debug_ll.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2012
+ * Jean-Christophe PLAGNIOL-VILLARD <planioj@jcrosoft.com>
+ *
+ * Under GPLv2
+ */
+
+#ifndef __MACH_DEBUG_LL_H__
+#define __MACH_DEBUG_LL_H__
+
+#include <asm/io.h>
+#include <mach/hardware.h>
+
+#define UART_BASE (AT91_BASE_SYS + AT91_DBGU)
+
+#define ATMEL_US_CSR 0x0014
+#define ATMEL_US_THR 0x001c
+#define ATMEL_US_TXRDY (1 << 1)
+#define ATMEL_US_TXEMPTY (1 << 9)
+
+/*
+ * The following code assumes the serial port has already been
+ * initialized by the bootloader. If you didn't setup a port in
+ * your bootloader then nothing will appear (which might be desired).
+ *
+ * This does not append a newline
+ */
+static void putc(int c)
+{
+ while (!(__raw_readl(UART_BASE + ATMEL_US_CSR) & ATMEL_US_TXRDY))
+ barrier();
+ __raw_writel(c, UART_BASE + ATMEL_US_THR);
+
+ while (!(__raw_readl(UART_BASE + ATMEL_US_CSR) & ATMEL_US_TXEMPTY))
+ barrier();
+}
+#endif
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 2/3] arm introduce CONFIG_MACH_ARM_HEAD option to allow custom head
2012-08-03 5:59 ` [PATCH 1/3] arm: at91: add debug_ll support Jean-Christophe PLAGNIOL-VILLARD
@ 2012-08-03 5:59 ` Jean-Christophe PLAGNIOL-VILLARD
2012-08-03 5:59 ` [PATCH 3/3] arm: at91: add custom barebox-arm-head Jean-Christophe PLAGNIOL-VILLARD
1 sibling, 0 replies; 4+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-08-03 5:59 UTC (permalink / raw)
To: barebox
This is needed by at91 to specify the size of the binary to load from the
bootrom when booting for non nor flash.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
arch/arm/Kconfig | 3 +++
arch/arm/include/asm/barebox-arm-head.h | 4 ++++
2 files changed, 7 insertions(+)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 8665c16..8b0a28d 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -14,6 +14,9 @@ config ARM_LINUX
default y
depends on CMD_BOOTZ || CMD_BOOTU || CMD_BOOTM
+config HAVE_MACH_ARM_HEAD
+ bool
+
menu "System Type "
choice
diff --git a/arch/arm/include/asm/barebox-arm-head.h b/arch/arm/include/asm/barebox-arm-head.h
index 2c250e9..0b1d786 100644
--- a/arch/arm/include/asm/barebox-arm-head.h
+++ b/arch/arm/include/asm/barebox-arm-head.h
@@ -1,6 +1,9 @@
#ifndef __ASM_ARM_HEAD_H
#define __ASM_ARM_HEAD_H
+#ifdef CONFIG_HAVE_MACH_ARM_HEAD
+#include <mach/barebox-arm-head.h>
+#else
static inline void barebox_arm_head(void)
{
__asm__ __volatile__ (
@@ -31,5 +34,6 @@ static inline void barebox_arm_head(void)
".word _barebox_image_size\n" /* image size to copy */
);
}
+#endif
#endif /* __ASM_ARM_HEAD_H */
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 3/3] arm: at91: add custom barebox-arm-head
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
1 sibling, 0 replies; 4+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-08-03 5:59 UTC (permalink / raw)
To: barebox
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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-08-03 5:59 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH 3/3] arm: at91: add custom barebox-arm-head Jean-Christophe PLAGNIOL-VILLARD
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox