diff options
Diffstat (limited to 'purgatory/arch/ppc64/v2wrap.S')
-rw-r--r-- | purgatory/arch/ppc64/v2wrap.S | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/purgatory/arch/ppc64/v2wrap.S b/purgatory/arch/ppc64/v2wrap.S index 3f78620..dc5034f 100644 --- a/purgatory/arch/ppc64/v2wrap.S +++ b/purgatory/arch/ppc64/v2wrap.S @@ -18,6 +18,8 @@ # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # +#include "ppc64_asm.h" + # v2wrap.S # a wrapper to call purgatory code to backup first # 32kB of first kernel into the backup region @@ -46,6 +48,7 @@ ori rn,rn,name##@l .machine ppc64 + .align 8 .globl purgatory_start purgatory_start: b master .org purgatory_start + 0x5c # ABI: possible run_at_load flag at 0x5c @@ -76,7 +79,7 @@ master: ld 1,0(6) #setup stack subi 1,1,112 - bl .purgatory + bl DOTSYM(purgatory) nop or 3,3,3 # ok now to high priority, lets boot @@ -87,11 +90,25 @@ master: LOADADDR(16, dt_offset) ld 3,0(16) # load device-tree address mr 16,3 # save dt address in reg16 +#ifdef __BIG_ENDIAN__ lwz 6,20(3) # fetch version number +#else + li 4,20 + lwbrx 6,3,4 # fetch BE version number +#endif cmpwi 0,6,2 # v2 ? blt 80f +#ifdef __BIG_ENDIAN__ stw 17,28(3) # save my cpu number as boot_cpu_phys +#else + li 4,28 + stwbrx 17,3,4 # Store my cpu as BE value +#endif 80: + LOADADDR(6,opal_base) # For OPAL early debug + ld 8,0(6) # load the OPAL base address in r8 + LOADADDR(6,opal_entry) # For OPAL early debug + ld 9,0(6) # load the OPAL entry address in r9 LOADADDR(6,kernel) ld 4,0(6) # load the kernel address LOADADDR(6,run_at_load) # the load flag |