cm4008: Fix ROM relocation.
Subsystems (2)
PATCH 2/3 cm4008: Fix ROM relocation.
Changed CONFIG_SYS_TEXT_BASE to actual address (required for board_init_f) and moved it into cm4008.h, along with a warning that it must match PHYS_FLASH_1 (since lowlevel_init relocates there).
--- arch/arm/cpu/arm920t/ks8695/lowlevel_init.S | 9 +++++++-- board/cm4008/config.mk | 1 - include/configs/cm4008.h | 3 +++ 3 files changed, 10 insertions(+), 3 deletions(-) delete mode 100644 board/cm4008/config.mk
arch/arm/cpu/arm920t/ks8695/lowlevel_init.S +7 -2
@@ -92,11 +92,16 @@ lowlevel_init: * ram from address 0, and flash at 32MB. */ ldr r1, =(KS8695_IO_BASE+KS8695_MEM_CTRL0) + /* Remap flash memory to 768MB size, such that it covers + both 0 (boot) and 512MB (run) regions */ ldr r2, =0xbfc00040 str r2, [r1] /* large flash map */ - ldr pc, =(highflash+0x02000000-0x00f00000) /* jump to high flash address */ + /* Relies on PHYS_FLASH_1==CONFIG_SYS_TEXT_BASE */ + ldr pc, =(highflash) /* jump to high flash address */ highflash: - ldr r2, =0x8fe00040 + /* Move ROM to high address, and reconfigure to 4MiB size */ + ldr r2, =(((PHYS_FLASH_1+0x3f0000)<<(22-16))| \ + (PHYS_FLASH_1>>(16-12))|0x40) str r2, [r1] /* remap flash range */ /*
board/cm4008/config.mk deleted +0 -1
@@ -1 +0,0 @@ -CONFIG_SYS_TEXT_BASE = 0x00f00000
include/configs/cm4008.h +3 -0
@@ -118,6 +118,9 @@#define CONFIG_SYS_INIT_SP_ADDR 0x00020000/* lowest 128k of RAM */ +/* CONFIG_SYS_TEXT_BASE and PHYS_FLASH_1 must match for both +relocation in lowlevel_init.S and function array in board.c */ +#define CONFIG_SYS_TEXT_BASE 0x02000000#define PHYS_FLASH_1 0x02000000/* Flash Bank #1 */ #define PHYS_FLASH_SECT_SIZE 0x00020000/* 128 KB sectors (x1) */ #define CONFIG_SYS_FLASH_BASE PHYS_FLASH_1
Signature · 1 line
1.7.10
PATCH 2/3 cm4008: Fix ROM relocation.
Dear Yann Vernier,
Quoted 17 lines · Yann Vernier
Changed
CONFIG_SYS_TEXT_BASEto actual address (required forboard_init_f) and moved it intocm4008.h, along with a warning that it must matchPHYS_FLASH_1(sincelowlevel_initrelocates there).Signed-off-by Yann Vernier <[email protected]>--- arch/arm/cpu/arm920t/ks8695/lowlevel_init.S | 9 +++++++-- board/cm4008/config.mk | 1 - include/configs/cm4008.h | 3 +++ 3 files changed, 10 insertions(+), 3 deletions(-) delete mode 100644 board/cm4008/config.mkarch/arm/cpu/arm920t/ks8695/lowlevel_init.S +0
-0
arch/arm/cpu/arm920t/ks8695/lowlevel_init.S lowlevel_init: · line 96
Quoted 5 lines
arch/arm/cpu/arm920t/ks8695/lowlevel_init.S +2
-0@@ -92,11 +92,16 @@ lowlevel_init: * ram from address 0, and flash at 32MB. */ ldr r1, =(KS8695_IO_BASE+KS8695_MEM_CTRL0) + /* Remap flash memory to 768MB size, such that it covers + both 0 (boot) and 512MB (run) regions */
please use tab as indention (a tab is 8 chars) ->
http://www.denx.de/wiki/U-Boot/CodingStyle
Quoted 26 lines
arch/arm/cpu/arm920t/ks8695/lowlevel_init.S +5
-2ldr r2, =0xbfc00040 str r2, [r1] /* large flash map */ - ldr pc, =(highflash+0x02000000-0x00f00000) /* jump to high flash address */ + /* Relies on PHYS_FLASH_1==CONFIG_SYS_TEXT_BASE */ + ldr pc, =(highflash) /* jump to high flash address */ highflash: - ldr r2, =0x8fe00040 + /* Move ROM to high address, and reconfigure to 4MiB size */ + ldr r2, =(((PHYS_FLASH_1+0x3f0000)<<(22-16))| \ + (PHYS_FLASH_1>>(16-12))|0x40) str r2, [r1] /* remap flash range */ /*board/cm4008/config.mk deleted +0
-1@@ -1 +0,0 @@ -CONFIG_SYS_TEXT_BASE = 0x00f00000include/configs/cm4008.h +0
-0
include/configs/cm4008.h line 126
Quoted 9 lines
include/configs/cm4008.h +3
-0@@ -118,6 +118,9 @@#define CONFIG_SYS_INIT_SP_ADDR 0x00020000/* lowest 128k of RAM */ +/* CONFIG_SYS_TEXT_BASE and PHYS_FLASH_1 must match for both +relocation in lowlevel_init.S and function array in board.c */ +#define CONFIG_SYS_TEXT_BASE 0x02000000#define PHYS_FLASH_1 0x02000000/* Flash Bank #1 */ #define PHYS_FLASH_SECT_SIZE 0x00020000/* 128 KB sectors (x1) */ #define CONFIG_SYS_FLASH_BASE PHYS_FLASH_1
The PHYS_FLASH_1 is a remnant from older days. The CFI switched to the CONFIG_SYS_FLASH_BASE. Please remove the PHYS_FLASH_1 completely and just work with the CONFIG_SYS_FLASH_BASE.
Beside that looks really good.
Best regards
Andreas Bie?mann