misc_64.S 14 KB

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