summaryrefslogtreecommitdiff
path: root/arch/sparc/cpu
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc/cpu')
-rw-r--r--arch/sparc/cpu/leon2/prom.c2
-rw-r--r--arch/sparc/cpu/leon2/start.S28
-rw-r--r--arch/sparc/cpu/leon3/prom.c2
-rw-r--r--arch/sparc/cpu/leon3/start.S28
4 files changed, 32 insertions, 28 deletions
diff --git a/arch/sparc/cpu/leon2/prom.c b/arch/sparc/cpu/leon2/prom.c
index cd2571f..7829e7a 100644
--- a/arch/sparc/cpu/leon2/prom.c
+++ b/arch/sparc/cpu/leon2/prom.c
@@ -25,6 +25,8 @@ extern struct linux_romvec *kernel_arg_promvec;
#define PROM_TEXT __attribute__ ((__section__ (".prom.text")))
#define PROM_DATA __attribute__ ((__section__ (".prom.data")))
+void *__prom_start_reloc; /* relocated prom_start address */
+
/* for __va */
extern int __prom_start;
#define PAGE_OFFSET 0xf0000000
diff --git a/arch/sparc/cpu/leon2/start.S b/arch/sparc/cpu/leon2/start.S
index 7362ae1..1b404da 100644
--- a/arch/sparc/cpu/leon2/start.S
+++ b/arch/sparc/cpu/leon2/start.S
@@ -414,24 +414,24 @@ fixup_got:
bcs 30b ! while (ptr < end)
nop
-#if 0 /* FIXME: Relocated PROM address should be calculated! */
-
prom_relocate:
SPARC_LOAD_ADDRESS(__prom_start, l7, g2)
SPARC_LOAD_ADDRESS(__prom_end, l7, g3)
- set CONFIG_SYS_PROM_OFFSET, %g4
-
-prom_relocate_loop:
- ldd [%g2],%l0
- ldd [%g2+8],%l2
- std %l0,[%g4]
- std %l2,[%g4+8]
- inc 16,%g2
- subcc %g3,%g2,%g0
- bne prom_relocate_loop
- inc 16,%g4
+ /*
+ * Calculated addres is stored in this variable by
+ * reserve_prom() function in common/board_f.c
+ */
+ SPARC_LOAD_ADDRESS(__prom_start_reloc, l7, g4)
+ ld [%g4], %g4
-#endif
+40: ldd [%g2], %l0
+ ldd [%g2+8], %l2
+ std %l0, [%g4]
+ std %l2, [%g4+8]
+ inc 16, %g2
+ cmp %g2, %g3
+ bcs 40b
+ inc 16, %g4
! %o0 = stack pointer (relocated)
! %o1 = global data pointer (relocated)
diff --git a/arch/sparc/cpu/leon3/prom.c b/arch/sparc/cpu/leon3/prom.c
index c391be7..1f185b7 100644
--- a/arch/sparc/cpu/leon3/prom.c
+++ b/arch/sparc/cpu/leon3/prom.c
@@ -33,6 +33,8 @@ DECLARE_GLOBAL_DATA_PTR;
ambapp_dev_gptimer *gptimer;
+void *__prom_start_reloc; /* relocated prom_start address */
+
/* for __va */
extern int __prom_start;
#define PAGE_OFFSET 0xf0000000
diff --git a/arch/sparc/cpu/leon3/start.S b/arch/sparc/cpu/leon3/start.S
index 52e82b5..1527d72 100644
--- a/arch/sparc/cpu/leon3/start.S
+++ b/arch/sparc/cpu/leon3/start.S
@@ -397,24 +397,24 @@ fixup_got:
bcs 30b ! while (ptr < end)
nop
-#if 0 /* FIXME: Relocated PROM address should be calculated! */
-
prom_relocate:
SPARC_LOAD_ADDRESS(__prom_start, l7, g2)
SPARC_LOAD_ADDRESS(__prom_end, l7, g3)
- set CONFIG_SYS_PROM_OFFSET, %g4
-
-prom_relocate_loop:
- ldd [%g2],%l0
- ldd [%g2+8],%l2
- std %l0,[%g4]
- std %l2,[%g4+8]
- inc 16,%g2
- subcc %g3,%g2,%g0
- bne prom_relocate_loop
- inc 16,%g4
+ /*
+ * Calculated addres is stored in this variable by
+ * reserve_prom() function in common/board_f.c
+ */
+ SPARC_LOAD_ADDRESS(__prom_start_reloc, l7, g4)
+ ld [%g4], %g4
-#endif
+40: ldd [%g2], %l0
+ ldd [%g2+8], %l2
+ std %l0, [%g4]
+ std %l2, [%g4+8]
+ inc 16, %g2
+ cmp %g2, %g3
+ bcs 40b
+ inc 16, %g4
! %o0 = stack pointer (relocated)
! %o1 = global data pointer (relocated)