misc_64.S 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696
  1. /*
  2. * This file contains miscellaneous low-level functions.
  3. * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
  4. *
  5. * Largely rewritten by Cort Dougan (cort@cs.nmt.edu)
  6. * and Paul Mackerras.
  7. * Adapted for iSeries by Mike Corrigan (mikejc@us.ibm.com)
  8. * PPC64 updates by Dave Engebretsen (engebret@us.ibm.com)
  9. *
  10. * This program is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU General Public License
  12. * as published by the Free Software Foundation; either version
  13. * 2 of the License, or (at your option) any later version.
  14. *
  15. */
  16. #include <linux/sys.h>
  17. #include <asm/unistd.h>
  18. #include <asm/errno.h>
  19. #include <asm/processor.h>
  20. #include <asm/page.h>
  21. #include <asm/cache.h>
  22. #include <asm/ppc_asm.h>
  23. #include <asm/asm-offsets.h>
  24. #include <asm/cputable.h>
  25. #include <asm/thread_info.h>
  26. #include <asm/kexec.h>
  27. #include <asm/ptrace.h>
  28. #include <asm/mmu.h>
  29. #include <asm/export.h>
  30. #include <asm/feature-fixups.h>
  31. .text
  32. _GLOBAL(call_do_softirq)
  33. mflr r0
  34. std r0,16(r1)
  35. stdu r1,THREAD_SIZE-STACK_FRAME_OVERHEAD(r3)
  36. mr r1,r3
  37. bl __do_softirq
  38. ld r1,0(r1)
  39. ld r0,16(r1)
  40. mtlr r0
  41. blr
  42. _GLOBAL(call_do_irq)
  43. mflr r0
  44. std r0,16(r1)
  45. stdu r1,THREAD_SIZE-STACK_FRAME_OVERHEAD(r4)
  46. mr r1,r4
  47. bl __do_irq
  48. ld r1,0(r1)
  49. ld r0,16(r1)
  50. mtlr r0
  51. blr
  52. .section ".toc","aw"
  53. PPC64_CACHES:
  54. .tc ppc64_caches[TC],ppc64_caches
  55. .section ".text"
  56. /*
  57. * Write any modified data cache blocks out to memory
  58. * and invalidate the corresponding instruction cache blocks.
  59. *
  60. * flush_icache_range(unsigned long start, unsigned long stop)
  61. *
  62. * flush all bytes from start through stop-1 inclusive
  63. */
  64. _GLOBAL_TOC(flush_icache_range)
  65. BEGIN_FTR_SECTION
  66. PURGE_PREFETCHED_INS
  67. blr
  68. END_FTR_SECTION_IFSET(CPU_FTR_COHERENT_ICACHE)
  69. /*
  70. * Flush the data cache to memory
  71. *
  72. * Different systems have different cache line sizes
  73. * and in some cases i-cache and d-cache line sizes differ from
  74. * each other.
  75. */
  76. ld r10,PPC64_CACHES@toc(r2)
  77. lwz r7,DCACHEL1BLOCKSIZE(r10)/* Get cache block size */
  78. addi r5,r7,-1
  79. andc r6,r3,r5 /* round low to line bdy */
  80. subf r8,r6,r4 /* compute length */
  81. add r8,r8,r5 /* ensure we get enough */
  82. lwz r9,DCACHEL1LOGBLOCKSIZE(r10) /* Get log-2 of cache block size */
  83. srd. r8,r8,r9 /* compute line count */
  84. beqlr /* nothing to do? */
  85. mtctr r8
  86. 1: dcbst 0,r6
  87. add r6,r6,r7
  88. bdnz 1b
  89. sync
  90. /* Now invalidate the instruction cache */
  91. lwz r7,ICACHEL1BLOCKSIZE(r10) /* Get Icache block size */
  92. addi r5,r7,-1
  93. andc r6,r3,r5 /* round low to line bdy */
  94. subf r8,r6,r4 /* compute length */
  95. add r8,r8,r5
  96. lwz r9,ICACHEL1LOGBLOCKSIZE(r10) /* Get log-2 of Icache block size */
  97. srd. r8,r8,r9 /* compute line count */
  98. beqlr /* nothing to do? */
  99. mtctr r8
  100. 2: icbi 0,r6
  101. add r6,r6,r7
  102. bdnz 2b
  103. isync
  104. blr
  105. _ASM_NOKPROBE_SYMBOL(flush_icache_range)
  106. EXPORT_SYMBOL(flush_icache_range)
  107. /*
  108. * Like above, but only do the D-cache.
  109. *
  110. * flush_dcache_range(unsigned long start, unsigned long stop)
  111. *
  112. * flush all bytes from start to stop-1 inclusive
  113. */
  114. _GLOBAL_TOC(flush_dcache_range)
  115. /*
  116. * Flush the data cache to memory
  117. *
  118. * Different systems have different cache line sizes
  119. */
  120. ld r10,PPC64_CACHES@toc(r2)
  121. lwz r7,DCACHEL1BLOCKSIZE(r10) /* Get dcache block size */
  122. addi r5,r7,-1
  123. andc r6,r3,r5 /* round low to line bdy */
  124. subf r8,r6,r4 /* compute length */
  125. add r8,r8,r5 /* ensure we get enough */
  126. lwz r9,DCACHEL1LOGBLOCKSIZE(r10) /* Get log-2 of dcache block size */
  127. srd. r8,r8,r9 /* compute line count */
  128. beqlr /* nothing to do? */
  129. mtctr r8
  130. 0: dcbst 0,r6
  131. add r6,r6,r7
  132. bdnz 0b
  133. sync
  134. blr
  135. EXPORT_SYMBOL(flush_dcache_range)
  136. _GLOBAL(flush_inval_dcache_range)
  137. ld r10,PPC64_CACHES@toc(r2)
  138. lwz r7,DCACHEL1BLOCKSIZE(r10) /* Get dcache block size */
  139. addi r5,r7,-1
  140. andc r6,r3,r5 /* round low to line bdy */
  141. subf r8,r6,r4 /* compute length */
  142. add r8,r8,r5 /* ensure we get enough */
  143. lwz r9,DCACHEL1LOGBLOCKSIZE(r10)/* Get log-2 of dcache block size */
  144. srd. r8,r8,r9 /* compute line count */
  145. beqlr /* nothing to do? */
  146. sync
  147. isync
  148. mtctr r8
  149. 0: dcbf 0,r6
  150. add r6,r6,r7
  151. bdnz 0b
  152. sync
  153. isync
  154. blr
  155. /*
  156. * Flush a particular page from the data cache to RAM.
  157. * Note: this is necessary because the instruction cache does *not*
  158. * snoop from the data cache.
  159. *
  160. * void __flush_dcache_icache(void *page)
  161. */
  162. _GLOBAL(__flush_dcache_icache)
  163. /*
  164. * Flush the data cache to memory
  165. *
  166. * Different systems have different cache line sizes
  167. */
  168. BEGIN_FTR_SECTION
  169. PURGE_PREFETCHED_INS
  170. blr
  171. END_FTR_SECTION_IFSET(CPU_FTR_COHERENT_ICACHE)
  172. /* Flush the dcache */
  173. ld r7,PPC64_CACHES@toc(r2)
  174. clrrdi r3,r3,PAGE_SHIFT /* Page align */
  175. lwz r4,DCACHEL1BLOCKSPERPAGE(r7) /* Get # dcache blocks per page */
  176. lwz r5,DCACHEL1BLOCKSIZE(r7) /* Get dcache block size */
  177. mr r6,r3
  178. mtctr r4
  179. 0: dcbst 0,r6
  180. add r6,r6,r5
  181. bdnz 0b
  182. sync
  183. /* Now invalidate the icache */
  184. lwz r4,ICACHEL1BLOCKSPERPAGE(r7) /* Get # icache blocks per page */
  185. lwz r5,ICACHEL1BLOCKSIZE(r7) /* Get icache block size */
  186. mtctr r4
  187. 1: icbi 0,r3
  188. add r3,r3,r5
  189. bdnz 1b
  190. isync
  191. blr
  192. _GLOBAL(__bswapdi2)
  193. EXPORT_SYMBOL(__bswapdi2)
  194. srdi r8,r3,32
  195. rlwinm r7,r3,8,0xffffffff
  196. rlwimi r7,r3,24,0,7
  197. rlwinm r9,r8,8,0xffffffff
  198. rlwimi r7,r3,24,16,23
  199. rlwimi r9,r8,24,0,7
  200. rlwimi r9,r8,24,16,23
  201. sldi r7,r7,32
  202. or r3,r7,r9
  203. blr
  204. #ifdef CONFIG_PPC_EARLY_DEBUG_BOOTX
  205. _GLOBAL(rmci_on)
  206. sync
  207. isync
  208. li r3,0x100
  209. rldicl r3,r3,32,0
  210. mfspr r5,SPRN_HID4
  211. or r5,r5,r3
  212. sync
  213. mtspr SPRN_HID4,r5
  214. isync
  215. slbia
  216. isync
  217. sync
  218. blr
  219. _GLOBAL(rmci_off)
  220. sync
  221. isync
  222. li r3,0x100
  223. rldicl r3,r3,32,0
  224. mfspr r5,SPRN_HID4
  225. andc r5,r5,r3
  226. sync
  227. mtspr SPRN_HID4,r5
  228. isync
  229. slbia
  230. isync
  231. sync
  232. blr
  233. #endif /* CONFIG_PPC_EARLY_DEBUG_BOOTX */
  234. #if defined(CONFIG_PPC_PMAC) || defined(CONFIG_PPC_MAPLE)
  235. /*
  236. * Do an IO access in real mode
  237. */
  238. _GLOBAL(real_readb)
  239. mfmsr r7
  240. ori r0,r7,MSR_DR
  241. xori r0,r0,MSR_DR
  242. sync
  243. mtmsrd r0
  244. sync
  245. isync
  246. mfspr r6,SPRN_HID4
  247. rldicl r5,r6,32,0
  248. ori r5,r5,0x100
  249. rldicl r5,r5,32,0
  250. sync
  251. mtspr SPRN_HID4,r5
  252. isync
  253. slbia
  254. isync
  255. lbz r3,0(r3)
  256. sync
  257. mtspr SPRN_HID4,r6
  258. isync
  259. slbia
  260. isync
  261. mtmsrd r7
  262. sync
  263. isync
  264. blr
  265. /*
  266. * Do an IO access in real mode
  267. */
  268. _GLOBAL(real_writeb)
  269. mfmsr r7
  270. ori r0,r7,MSR_DR
  271. xori r0,r0,MSR_DR
  272. sync
  273. mtmsrd r0
  274. sync
  275. isync
  276. mfspr r6,SPRN_HID4
  277. rldicl r5,r6,32,0
  278. ori r5,r5,0x100
  279. rldicl r5,r5,32,0
  280. sync
  281. mtspr SPRN_HID4,r5
  282. isync
  283. slbia
  284. isync
  285. stb r3,0(r4)
  286. sync
  287. mtspr SPRN_HID4,r6
  288. isync
  289. slbia
  290. isync
  291. mtmsrd r7
  292. sync
  293. isync
  294. blr
  295. #endif /* defined(CONFIG_PPC_PMAC) || defined(CONFIG_PPC_MAPLE) */
  296. #ifdef CONFIG_PPC_PASEMI
  297. _GLOBAL(real_205_readb)
  298. mfmsr r7
  299. ori r0,r7,MSR_DR
  300. xori r0,r0,MSR_DR
  301. sync
  302. mtmsrd r0
  303. sync
  304. isync
  305. LBZCIX(R3,R0,R3)
  306. isync
  307. mtmsrd r7
  308. sync
  309. isync
  310. blr
  311. _GLOBAL(real_205_writeb)
  312. mfmsr r7
  313. ori r0,r7,MSR_DR
  314. xori r0,r0,MSR_DR
  315. sync
  316. mtmsrd r0
  317. sync
  318. isync
  319. STBCIX(R3,R0,R4)
  320. isync
  321. mtmsrd r7
  322. sync
  323. isync
  324. blr
  325. #endif /* CONFIG_PPC_PASEMI */
  326. #if defined(CONFIG_CPU_FREQ_PMAC64) || defined(CONFIG_CPU_FREQ_MAPLE)
  327. /*
  328. * SCOM access functions for 970 (FX only for now)
  329. *
  330. * unsigned long scom970_read(unsigned int address);
  331. * void scom970_write(unsigned int address, unsigned long value);
  332. *
  333. * The address passed in is the 24 bits register address. This code
  334. * is 970 specific and will not check the status bits, so you should
  335. * know what you are doing.
  336. */
  337. _GLOBAL(scom970_read)
  338. /* interrupts off */
  339. mfmsr r4
  340. ori r0,r4,MSR_EE
  341. xori r0,r0,MSR_EE
  342. mtmsrd r0,1
  343. /* rotate 24 bits SCOM address 8 bits left and mask out it's low 8 bits
  344. * (including parity). On current CPUs they must be 0'd,
  345. * and finally or in RW bit
  346. */
  347. rlwinm r3,r3,8,0,15
  348. ori r3,r3,0x8000
  349. /* do the actual scom read */
  350. sync
  351. mtspr SPRN_SCOMC,r3
  352. isync
  353. mfspr r3,SPRN_SCOMD
  354. isync
  355. mfspr r0,SPRN_SCOMC
  356. isync
  357. /* XXX: fixup result on some buggy 970's (ouch ! we lost a bit, bah
  358. * that's the best we can do). Not implemented yet as we don't use
  359. * the scom on any of the bogus CPUs yet, but may have to be done
  360. * ultimately
  361. */
  362. /* restore interrupts */
  363. mtmsrd r4,1
  364. blr
  365. _GLOBAL(scom970_write)
  366. /* interrupts off */
  367. mfmsr r5
  368. ori r0,r5,MSR_EE
  369. xori r0,r0,MSR_EE
  370. mtmsrd r0,1
  371. /* rotate 24 bits SCOM address 8 bits left and mask out it's low 8 bits
  372. * (including parity). On current CPUs they must be 0'd.
  373. */
  374. rlwinm r3,r3,8,0,15
  375. sync
  376. mtspr SPRN_SCOMD,r4 /* write data */
  377. isync
  378. mtspr SPRN_SCOMC,r3 /* write command */
  379. isync
  380. mfspr 3,SPRN_SCOMC
  381. isync
  382. /* restore interrupts */
  383. mtmsrd r5,1
  384. blr
  385. #endif /* CONFIG_CPU_FREQ_PMAC64 || CONFIG_CPU_FREQ_MAPLE */
  386. /* kexec_wait(phys_cpu)
  387. *
  388. * wait for the flag to change, indicating this kernel is going away but
  389. * the slave code for the next one is at addresses 0 to 100.
  390. *
  391. * This is used by all slaves, even those that did not find a matching
  392. * paca in the secondary startup code.
  393. *
  394. * Physical (hardware) cpu id should be in r3.
  395. */
  396. _GLOBAL(kexec_wait)
  397. bl 1f
  398. 1: mflr r5
  399. addi r5,r5,kexec_flag-1b
  400. 99: HMT_LOW
  401. #ifdef CONFIG_KEXEC_CORE /* use no memory without kexec */
  402. lwz r4,0(r5)
  403. cmpwi 0,r4,0
  404. beq 99b
  405. #ifdef CONFIG_PPC_BOOK3S_64
  406. li r10,0x60
  407. mfmsr r11
  408. clrrdi r11,r11,1 /* Clear MSR_LE */
  409. mtsrr0 r10
  410. mtsrr1 r11
  411. rfid
  412. #else
  413. /* Create TLB entry in book3e_secondary_core_init */
  414. li r4,0
  415. ba 0x60
  416. #endif
  417. #endif
  418. /* this can be in text because we won't change it until we are
  419. * running in real anyways
  420. */
  421. kexec_flag:
  422. .long 0
  423. #ifdef CONFIG_KEXEC_CORE
  424. #ifdef CONFIG_PPC_BOOK3E
  425. /*
  426. * BOOK3E has no real MMU mode, so we have to setup the initial TLB
  427. * for a core to identity map v:0 to p:0. This current implementation
  428. * assumes that 1G is enough for kexec.
  429. */
  430. kexec_create_tlb:
  431. /*
  432. * Invalidate all non-IPROT TLB entries to avoid any TLB conflict.
  433. * IPROT TLB entries should be >= PAGE_OFFSET and thus not conflict.
  434. */
  435. PPC_TLBILX_ALL(0,R0)
  436. sync
  437. isync
  438. mfspr r10,SPRN_TLB1CFG
  439. andi. r10,r10,TLBnCFG_N_ENTRY /* Extract # entries */
  440. subi r10,r10,1 /* Last entry: no conflict with kernel text */
  441. lis r9,MAS0_TLBSEL(1)@h
  442. rlwimi r9,r10,16,4,15 /* Setup MAS0 = TLBSEL | ESEL(r9) */
  443. /* Set up a temp identity mapping v:0 to p:0 and return to it. */
  444. #if defined(CONFIG_SMP) || defined(CONFIG_PPC_E500MC)
  445. #define M_IF_NEEDED MAS2_M
  446. #else
  447. #define M_IF_NEEDED 0
  448. #endif
  449. mtspr SPRN_MAS0,r9
  450. lis r9,(MAS1_VALID|MAS1_IPROT)@h
  451. ori r9,r9,(MAS1_TSIZE(BOOK3E_PAGESZ_1GB))@l
  452. mtspr SPRN_MAS1,r9
  453. LOAD_REG_IMMEDIATE(r9, 0x0 | M_IF_NEEDED)
  454. mtspr SPRN_MAS2,r9
  455. LOAD_REG_IMMEDIATE(r9, 0x0 | MAS3_SR | MAS3_SW | MAS3_SX)
  456. mtspr SPRN_MAS3,r9
  457. li r9,0
  458. mtspr SPRN_MAS7,r9
  459. tlbwe
  460. isync
  461. blr
  462. #endif
  463. /* kexec_smp_wait(void)
  464. *
  465. * call with interrupts off
  466. * note: this is a terminal routine, it does not save lr
  467. *
  468. * get phys id from paca
  469. * switch to real mode
  470. * mark the paca as no longer used
  471. * join other cpus in kexec_wait(phys_id)
  472. */
  473. _GLOBAL(kexec_smp_wait)
  474. lhz r3,PACAHWCPUID(r13)
  475. bl real_mode
  476. li r4,KEXEC_STATE_REAL_MODE
  477. stb r4,PACAKEXECSTATE(r13)
  478. SYNC
  479. b kexec_wait
  480. /*
  481. * switch to real mode (turn mmu off)
  482. * we use the early kernel trick that the hardware ignores bits
  483. * 0 and 1 (big endian) of the effective address in real mode
  484. *
  485. * don't overwrite r3 here, it is live for kexec_wait above.
  486. */
  487. real_mode: /* assume normal blr return */
  488. #ifdef CONFIG_PPC_BOOK3E
  489. /* Create an identity mapping. */
  490. b kexec_create_tlb
  491. #else
  492. 1: li r9,MSR_RI
  493. li r10,MSR_DR|MSR_IR
  494. mflr r11 /* return address to SRR0 */
  495. mfmsr r12
  496. andc r9,r12,r9
  497. andc r10,r12,r10
  498. mtmsrd r9,1
  499. mtspr SPRN_SRR1,r10
  500. mtspr SPRN_SRR0,r11
  501. rfid
  502. #endif
  503. /*
  504. * kexec_sequence(newstack, start, image, control, clear_all(),
  505. copy_with_mmu_off)
  506. *
  507. * does the grungy work with stack switching and real mode switches
  508. * also does simple calls to other code
  509. */
  510. _GLOBAL(kexec_sequence)
  511. mflr r0
  512. std r0,16(r1)
  513. /* switch stacks to newstack -- &kexec_stack.stack */
  514. stdu r1,THREAD_SIZE-STACK_FRAME_OVERHEAD(r3)
  515. mr r1,r3
  516. li r0,0
  517. std r0,16(r1)
  518. BEGIN_FTR_SECTION
  519. /*
  520. * This is the best time to turn AMR/IAMR off.
  521. * key 0 is used in radix for supervisor<->user
  522. * protection, but on hash key 0 is reserved
  523. * ideally we want to enter with a clean state.
  524. * NOTE, we rely on r0 being 0 from above.
  525. */
  526. mtspr SPRN_IAMR,r0
  527. BEGIN_FTR_SECTION_NESTED(42)
  528. mtspr SPRN_AMOR,r0
  529. END_FTR_SECTION_NESTED_IFSET(CPU_FTR_HVMODE, 42)
  530. END_FTR_SECTION_IFSET(CPU_FTR_ARCH_300)
  531. /* save regs for local vars on new stack.
  532. * yes, we won't go back, but ...
  533. */
  534. std r31,-8(r1)
  535. std r30,-16(r1)
  536. std r29,-24(r1)
  537. std r28,-32(r1)
  538. std r27,-40(r1)
  539. std r26,-48(r1)
  540. std r25,-56(r1)
  541. stdu r1,-STACK_FRAME_OVERHEAD-64(r1)
  542. /* save args into preserved regs */
  543. mr r31,r3 /* newstack (both) */
  544. mr r30,r4 /* start (real) */
  545. mr r29,r5 /* image (virt) */
  546. mr r28,r6 /* control, unused */
  547. mr r27,r7 /* clear_all() fn desc */
  548. mr r26,r8 /* copy_with_mmu_off */
  549. lhz r25,PACAHWCPUID(r13) /* get our phys cpu from paca */
  550. /* disable interrupts, we are overwriting kernel data next */
  551. #ifdef CONFIG_PPC_BOOK3E
  552. wrteei 0
  553. #else
  554. mfmsr r3
  555. rlwinm r3,r3,0,17,15
  556. mtmsrd r3,1
  557. #endif
  558. /* We need to turn the MMU off unless we are in hash mode
  559. * under a hypervisor
  560. */
  561. cmpdi r26,0
  562. beq 1f
  563. bl real_mode
  564. 1:
  565. /* copy dest pages, flush whole dest image */
  566. mr r3,r29
  567. bl kexec_copy_flush /* (image) */
  568. /* turn off mmu now if not done earlier */
  569. cmpdi r26,0
  570. bne 1f
  571. bl real_mode
  572. /* copy 0x100 bytes starting at start to 0 */
  573. 1: li r3,0
  574. mr r4,r30 /* start, aka phys mem offset */
  575. li r5,0x100
  576. li r6,0
  577. bl copy_and_flush /* (dest, src, copy limit, start offset) */
  578. 1: /* assume normal blr return */
  579. /* release other cpus to the new kernel secondary start at 0x60 */
  580. mflr r5
  581. li r6,1
  582. stw r6,kexec_flag-1b(5)
  583. cmpdi r27,0
  584. beq 1f
  585. /* clear out hardware hash page table and tlb */
  586. #ifdef PPC64_ELF_ABI_v1
  587. ld r12,0(r27) /* deref function descriptor */
  588. #else
  589. mr r12,r27
  590. #endif
  591. mtctr r12
  592. bctrl /* mmu_hash_ops.hpte_clear_all(void); */
  593. /*
  594. * kexec image calling is:
  595. * the first 0x100 bytes of the entry point are copied to 0
  596. *
  597. * all slaves branch to slave = 0x60 (absolute)
  598. * slave(phys_cpu_id);
  599. *
  600. * master goes to start = entry point
  601. * start(phys_cpu_id, start, 0);
  602. *
  603. *
  604. * a wrapper is needed to call existing kernels, here is an approximate
  605. * description of one method:
  606. *
  607. * v2: (2.6.10)
  608. * start will be near the boot_block (maybe 0x100 bytes before it?)
  609. * it will have a 0x60, which will b to boot_block, where it will wait
  610. * and 0 will store phys into struct boot-block and load r3 from there,
  611. * copy kernel 0-0x100 and tell slaves to back down to 0x60 again
  612. *
  613. * v1: (2.6.9)
  614. * boot block will have all cpus scanning device tree to see if they
  615. * are the boot cpu ?????
  616. * other device tree differences (prop sizes, va vs pa, etc)...
  617. */
  618. 1: mr r3,r25 # my phys cpu
  619. mr r4,r30 # start, aka phys mem offset
  620. mtlr 4
  621. li r5,0
  622. blr /* image->start(physid, image->start, 0); */
  623. #endif /* CONFIG_KEXEC_CORE */