Commit 4f18b9e6 authored by Nicholas Piggin's avatar Nicholas Piggin Committed by Michael Ellerman

powerpc/64: Move initial base and TOC pointer calculation

A later change moves the non-prom case to run at the virtual address
earlier, which calls for virtual TOC and kernel base. Split these two
calculations for prom and non-prom to make that change simpler.
Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
[mpe: Retain relative_toc call for start_initialization_book3e]
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230408021752.862660-2-npiggin@gmail.com
parent 40f7b523
...@@ -515,15 +515,6 @@ __start_initialization_multiplatform: ...@@ -515,15 +515,6 @@ __start_initialization_multiplatform:
/* Zero r13 (paca) so early program check / mce don't use it */ /* Zero r13 (paca) so early program check / mce don't use it */
li r13,0 li r13,0
/* Get TOC pointer (current runtime address) */
bl relative_toc
/* find out where we are now */
bcl 20,31,$+4
0: mflr r26 /* r26 = runtime addr here */
addis r26,r26,(_stext - 0b)@ha
addi r26,r26,(_stext - 0b)@l /* current runtime base addr */
/* /*
* Are we booted from a PROM Of-type client-interface ? * Are we booted from a PROM Of-type client-interface ?
*/ */
...@@ -540,16 +531,38 @@ __start_initialization_multiplatform: ...@@ -540,16 +531,38 @@ __start_initialization_multiplatform:
mr r29,r9 mr r29,r9
#endif #endif
/* Get TOC pointer (current runtime address) */
bl relative_toc
#ifdef CONFIG_PPC_BOOK3E_64 #ifdef CONFIG_PPC_BOOK3E_64
bl start_initialization_book3e bl start_initialization_book3e
#else #else
bl start_initialization_book3s bl start_initialization_book3s
#endif /* CONFIG_PPC_BOOK3E_64 */ #endif /* CONFIG_PPC_BOOK3E_64 */
/* Get TOC pointer */
bl relative_toc
/* find out where we are now */
bcl 20,31,$+4
0: mflr r26 /* r26 = runtime addr here */
addis r26,r26,(_stext - 0b)@ha
addi r26,r26,(_stext - 0b)@l /* current runtime base addr */
b __after_prom_start b __after_prom_start
__REF __REF
__boot_from_prom: __boot_from_prom:
#ifdef CONFIG_PPC_OF_BOOT_TRAMPOLINE #ifdef CONFIG_PPC_OF_BOOT_TRAMPOLINE
/* Get TOC pointer */
bl relative_toc
/* find out where we are now */
bcl 20,31,$+4
0: mflr r26 /* r26 = runtime addr here */
addis r26,r26,(_stext - 0b)@ha
addi r26,r26,(_stext - 0b)@l /* current runtime base addr */
/* Save parameters */ /* Save parameters */
mr r31,r3 mr r31,r3
mr r30,r4 mr r30,r4
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment