[PATCH 8/8] mx25 3ds: add support for boot from UART
Baruch Siach
baruch at tkos.co.il
Wed Jun 9 03:05:07 EDT 2010
For details of the UART protocol see the i.MX25 Reference Manual, section 7.8
"Serial Download protocol".
Signed-off-by: Baruch Siach <baruch at tkos.co.il>
---
arch/arm/mach-imx/Kconfig | 5 +++++
board/freescale-mx25-3-stack/3stack.c | 4 ++++
board/freescale-mx25-3-stack/lowlevel_init.S | 5 +++++
3 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index 419daab..40cebed 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -319,6 +319,11 @@ config FREESCALE_MX25_3STACK_SDRAM_64MB_DDR2
config FREESCALE_MX25_3STACK_SDRAM_128MB_MDDR
bool "128 MB (mDDR)"
endchoice
+
+config FREESCALE_MX25_3STACK_UART_BOOT
+ bool "Boot from UART"
+ depends on ARCH_IMX_INTERNAL_BOOT
+
endif
endmenu
diff --git a/board/freescale-mx25-3-stack/3stack.c b/board/freescale-mx25-3-stack/3stack.c
index a657a47..081487a 100644
--- a/board/freescale-mx25-3-stack/3stack.c
+++ b/board/freescale-mx25-3-stack/3stack.c
@@ -44,7 +44,11 @@ extern unsigned long _stext;
void __naked __flash_header_start go(void)
{
+#if defined CONFIG_FREESCALE_MX25_3STACK_UART_BOOT
+ __asm__ (".word exception_vectors\n");
+#else
__asm__ __volatile__("b exception_vectors\n");
+#endif
}
struct imx_dcd_entry __dcd_entry_0x400 dcd_entry[] = {
diff --git a/board/freescale-mx25-3-stack/lowlevel_init.S b/board/freescale-mx25-3-stack/lowlevel_init.S
index 73bb147..b65a070 100644
--- a/board/freescale-mx25-3-stack/lowlevel_init.S
+++ b/board/freescale-mx25-3-stack/lowlevel_init.S
@@ -73,6 +73,11 @@ board_init_lowlevel:
writel(0x000FDFFF, IMX_CCM_BASE + CCM_CGCR2)
writel(0x0000FEFF, IMX_CCM_BASE + MX25_CCM_MCR)
+#if defined CONFIG_FREESCALE_MX25_3STACK_UART_BOOT
+ /* initialize CCM_CCTL, ARM clk = 400, AHB clk = 133 */
+ writel(0x20034000, IMX_CCM_BASE + 0x8);
+#endif
+
/* Skip SDRAM initialization if we run from RAM */
cmp pc, #0x80000000
bls 1f
--
1.7.1
More information about the barebox
mailing list