summaryrefslogtreecommitdiff
path: root/common/board_f.c
diff options
context:
space:
mode:
authorFrancois Retief <fgretief@spaceteq.co.za>2015-11-23 13:05:44 +0200
committerFrancois Retief <fgretief@spaceteq.co.za>2015-12-03 13:15:49 +0200
commit1e85ccec536f86a96e5e317b5a59a6f5180451f3 (patch)
tree85818582f0a825daf140ceb8afb8412d7fad8cf8 /common/board_f.c
parentc97088c3cfa84e7e53fddd26896f145cc8c431a2 (diff)
downloadu-boot-1e85ccec536f86a96e5e317b5a59a6f5180451f3.tar.gz
sparc: Update PROM initialization code for generic board
Fixed the prom_relocate() function in start.S file by reserving memory in the board_init_f sequence and saving the offset to the __prom_start_reloc variable. This value is used as the destination when relocating the PROM. Add the prom_init() function to the end of the board_init_r sequence. Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>
Diffstat (limited to 'common/board_f.c')
-rw-r--r--common/board_f.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/common/board_f.c b/common/board_f.c
index 2dd10b9819..8325dc333c 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -357,6 +357,20 @@ static int setup_dest_addr(void)
return 0;
}
+#if defined(CONFIG_SPARC)
+static int reserve_prom(void)
+{
+ /* defined in arch/sparc/cpu/leon?/prom.c */
+ extern void *__prom_start_reloc;
+ int size = 8192; /* page table = 2k, prom = 6k */
+ gd->relocaddr -= size;
+ __prom_start_reloc = map_sysmem(gd->relocaddr + 2048, size - 2048);
+ debug("Reserving %dk for PROM and page table at %08lx\n", size,
+ gd->relocaddr);
+ return 0;
+}
+#endif
+
#if defined(CONFIG_LOGBUFFER) && !defined(CONFIG_ALT_LB_ADDR)
static int reserve_logbuffer(void)
{
@@ -909,6 +923,9 @@ static init_fnc_t init_sequence_f[] = {
/* Blackfin u-boot monitor should be on top of the ram */
reserve_uboot,
#endif
+#if defined(CONFIG_SPARC)
+ reserve_prom,
+#endif
#if defined(CONFIG_LOGBUFFER) && !defined(CONFIG_ALT_LB_ADDR)
reserve_logbuffer,
#endif