[U-Boot] [PATCH 16/32] Blackfin: kill off LDR jump block

Mike Frysinger vapier at gentoo.org
Mon Mar 23 03:45:25 CET 2009


The Boot ROM uses EVT1 as the entry point so set that rather than having
to use a tiny jump block in the default EVT1 location.

Signed-off-by: Mike Frysinger <vapier at gentoo.org>
---
 blackfin_config.mk             |    1 +
 board/bf533-ezkit/u-boot.lds.S |    5 ++---
 board/bf533-stamp/u-boot.lds.S |    5 ++---
 board/bf537-stamp/u-boot.lds.S |    5 ++---
 board/bf561-ezkit/u-boot.lds.S |    5 ++---
 cpu/blackfin/cpu.c             |    8 +-------
 cpu/blackfin/initcode.c        |    4 ++++
 7 files changed, 14 insertions(+), 19 deletions(-)

diff --git a/blackfin_config.mk b/blackfin_config.mk
index f3fcd7a..04a7529 100644
--- a/blackfin_config.mk
+++ b/blackfin_config.mk
@@ -36,6 +36,7 @@ endif
 
 SYM_PREFIX = _
 
+LDR_FLAGS += -J
 LDR_FLAGS += --bmode $(subst BFIN_BOOT_,,$(CONFIG_BFIN_BOOT_MODE))
 LDR_FLAGS += --use-vmas
 ifneq ($(CONFIG_BFIN_BOOT_MODE),BFIN_BOOT_BYPASS)
diff --git a/board/bf533-ezkit/u-boot.lds.S b/board/bf533-ezkit/u-boot.lds.S
index da16726..f80f894 100644
--- a/board/bf533-ezkit/u-boot.lds.S
+++ b/board/bf533-ezkit/u-boot.lds.S
@@ -44,12 +44,11 @@
 
 OUTPUT_ARCH(bfin)
 
-/* The 0xC offset is so we don't clobber the tiny LDR jump block. */
 MEMORY
 {
 	ram     : ORIGIN = CONFIG_SYS_MONITOR_BASE, LENGTH = CONFIG_SYS_MONITOR_LEN
-	l1_code : ORIGIN = L1_INST_SRAM+0xC, LENGTH = L1_INST_SRAM_SIZE
-	l1_data : ORIGIN = L1_DATA_B_SRAM,   LENGTH = L1_DATA_B_SRAM_SIZE
+	l1_code : ORIGIN = L1_INST_SRAM,            LENGTH = L1_INST_SRAM_SIZE
+	l1_data : ORIGIN = L1_DATA_B_SRAM,          LENGTH = L1_DATA_B_SRAM_SIZE
 }
 
 ENTRY(_start)
diff --git a/board/bf533-stamp/u-boot.lds.S b/board/bf533-stamp/u-boot.lds.S
index 76daa75..8ddfa81 100644
--- a/board/bf533-stamp/u-boot.lds.S
+++ b/board/bf533-stamp/u-boot.lds.S
@@ -44,12 +44,11 @@
 
 OUTPUT_ARCH(bfin)
 
-/* The 0xC offset is so we don't clobber the tiny LDR jump block. */
 MEMORY
 {
 	ram     : ORIGIN = CONFIG_SYS_MONITOR_BASE, LENGTH = CONFIG_SYS_MONITOR_LEN
-	l1_code : ORIGIN = L1_INST_SRAM+0xC, LENGTH = L1_INST_SRAM_SIZE
-	l1_data : ORIGIN = L1_DATA_B_SRAM,   LENGTH = L1_DATA_B_SRAM_SIZE
+	l1_code : ORIGIN = L1_INST_SRAM,            LENGTH = L1_INST_SRAM_SIZE
+	l1_data : ORIGIN = L1_DATA_B_SRAM,          LENGTH = L1_DATA_B_SRAM_SIZE
 }
 
 ENTRY(_start)
diff --git a/board/bf537-stamp/u-boot.lds.S b/board/bf537-stamp/u-boot.lds.S
index 76daa75..8ddfa81 100644
--- a/board/bf537-stamp/u-boot.lds.S
+++ b/board/bf537-stamp/u-boot.lds.S
@@ -44,12 +44,11 @@
 
 OUTPUT_ARCH(bfin)
 
-/* The 0xC offset is so we don't clobber the tiny LDR jump block. */
 MEMORY
 {
 	ram     : ORIGIN = CONFIG_SYS_MONITOR_BASE, LENGTH = CONFIG_SYS_MONITOR_LEN
-	l1_code : ORIGIN = L1_INST_SRAM+0xC, LENGTH = L1_INST_SRAM_SIZE
-	l1_data : ORIGIN = L1_DATA_B_SRAM,   LENGTH = L1_DATA_B_SRAM_SIZE
+	l1_code : ORIGIN = L1_INST_SRAM,            LENGTH = L1_INST_SRAM_SIZE
+	l1_data : ORIGIN = L1_DATA_B_SRAM,          LENGTH = L1_DATA_B_SRAM_SIZE
 }
 
 ENTRY(_start)
diff --git a/board/bf561-ezkit/u-boot.lds.S b/board/bf561-ezkit/u-boot.lds.S
index 3d0453e..4220e81 100644
--- a/board/bf561-ezkit/u-boot.lds.S
+++ b/board/bf561-ezkit/u-boot.lds.S
@@ -44,12 +44,11 @@
 
 OUTPUT_ARCH(bfin)
 
-/* The 0xC offset is so we don't clobber the tiny LDR jump block. */
 MEMORY
 {
 	ram     : ORIGIN = CONFIG_SYS_MONITOR_BASE, LENGTH = CONFIG_SYS_MONITOR_LEN
-	l1_code : ORIGIN = L1_INST_SRAM+0xC, LENGTH = L1_INST_SRAM_SIZE
-	l1_data : ORIGIN = L1_DATA_B_SRAM,   LENGTH = L1_DATA_B_SRAM_SIZE
+	l1_code : ORIGIN = L1_INST_SRAM,            LENGTH = L1_INST_SRAM_SIZE
+	l1_data : ORIGIN = L1_DATA_B_SRAM,          LENGTH = L1_DATA_B_SRAM_SIZE
 }
 
 ENTRY(_start)
diff --git a/cpu/blackfin/cpu.c b/cpu/blackfin/cpu.c
index 30c214b..c2ff8cd 100644
--- a/cpu/blackfin/cpu.c
+++ b/cpu/blackfin/cpu.c
@@ -25,18 +25,12 @@ ulong bfin_poweron_retx;
 __attribute__ ((__noreturn__))
 void cpu_init_f(ulong bootflag, ulong loaded_from_ldr)
 {
-	/* Build a NOP slide over the LDR jump block.  Whee! */
-	serial_early_puts("NOP Slide\n");
-	char nops[0xC];
-	memset(nops, 0x00, sizeof(nops));
-	extern char _stext_l1;
-	memcpy(&_stext_l1 - sizeof(nops), nops, sizeof(nops));
-
 	if (!loaded_from_ldr) {
 		/* Relocate sections into L1 if the LDR didn't do it -- don't
 		 * check length because the linker script does the size
 		 * checking at build time.
 		 */
+		extern char _stext_l1;
 		serial_early_puts("L1 Relocate\n");
 		extern char _stext_l1, _etext_l1, _stext_l1_lma;
 		memcpy(&_stext_l1, &_stext_l1_lma, (&_etext_l1 - &_stext_l1));
diff --git a/cpu/blackfin/initcode.c b/cpu/blackfin/initcode.c
index 3f3b479..342b96a 100644
--- a/cpu/blackfin/initcode.c
+++ b/cpu/blackfin/initcode.c
@@ -372,6 +372,10 @@ void initcode(ADI_BOOT_DATA *bootstruct)
 	bfin_write_SIC_IWR(-1);
 #endif
 
+	/* tell the bootrom where our entry point is */
+	if (CONFIG_BFIN_BOOT_MODE != BFIN_BOOT_BYPASS)
+		bfin_write_EVT1(CONFIG_SYS_MONITOR_BASE);
+
 	serial_putc('>');
 	serial_putc('\n');
 
-- 
1.6.2



More information about the U-Boot mailing list