summaryrefslogtreecommitdiffstats
path: root/arch/arm/cpu/arm926ejs/orion5x
diff options
context:
space:
mode:
authorHeiko Schocher <hs@denx.de>2010-09-17 13:10:42 +0200
committerWolfgang Denk <wd@denx.de>2010-09-19 19:29:54 +0200
commitab86f72c354f9b2572340f72b74ca0a258c451bd (patch)
tree33cadeb2dbb7f31824789189621305d6eda772ab /arch/arm/cpu/arm926ejs/orion5x
parent561142af20f1fd7b425d9425730014e656defb91 (diff)
downloadblackbird-obmc-uboot-ab86f72c354f9b2572340f72b74ca0a258c451bd.tar.gz
blackbird-obmc-uboot-ab86f72c354f9b2572340f72b74ca0a258c451bd.zip
ARM: implement relocation for ARM926
Change the implementation for arm926 to relocate the code to an arbitrary address in RAM. Adapt the TX25 (i.MX25), magnesium board to test the changes. On the tx25 board TEXT_BASE is set to the final relocation address to prevent one more copying of u-boot code when relocating. More info see: doc/README.arm-relocation da850 board: Tested-by: Ben Gardiner <bengardiner@nanometrics.ca> Portions of this work were supported by funding from the CE Linux Forum. Signed-off-by: Heiko Schocher <hs@denx.de> Cc: Ben Gardiner <bengardiner@nanometrics.ca>
Diffstat (limited to 'arch/arm/cpu/arm926ejs/orion5x')
-rw-r--r--arch/arm/cpu/arm926ejs/orion5x/dram.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/arch/arm/cpu/arm926ejs/orion5x/dram.c b/arch/arm/cpu/arm926ejs/orion5x/dram.c
index c719798a66..c5c8ab7e4d 100644
--- a/arch/arm/cpu/arm926ejs/orion5x/dram.c
+++ b/arch/arm/cpu/arm926ejs/orion5x/dram.c
@@ -49,7 +49,7 @@ u32 orion5x_sdram_bar(enum memory_bank bank)
result = winregs[bank].base;
return result;
}
-
+#if defined(CONFIG_SYS_ARM_WITHOUT_RELOC)
int dram_init(void)
{
int i;
@@ -62,3 +62,25 @@ int dram_init(void)
}
return 0;
}
+#else
+int dram_init (void)
+{
+ /* dram_init must store complete ramsize in gd->ram_size */
+ gd->ram_size = get_ram_size(
+ (volatile long *) orion5x_sdram_bar(0),
+ CONFIG_MAX_RAM_BANK_SIZE);
+ return 0;
+}
+
+void dram_init_banksize (void)
+{
+ int i;
+
+ for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) {
+ gd->bd->bi_dram[i].start = orion5x_sdram_bar(i);
+ gd->bd->bi_dram[i].size = get_ram_size(
+ (volatile long *) (gd->bd->bi_dram[i].start),
+ CONFIG_MAX_RAM_BANK_SIZE);
+ }
+}
+#endif
OpenPOWER on IntegriCloud