Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  *  PS3 bootwrapper entry.
0004  *
0005  *  Copyright (C) 2007 Sony Computer Entertainment Inc.
0006  *  Copyright 2007 Sony Corp.
0007  */
0008 
0009 #include "ppc_asm.h"
0010 
0011     .machine "ppc64"
0012 
0013     .text
0014 
0015 /*
0016  * __system_reset_overlay - The PS3 first stage entry.
0017  *
0018  * The bootwraper build script copies the 512 bytes at symbol
0019  * __system_reset_overlay to offset 0x100 of the rom image.  This symbol
0020  * must occupy 512 or less bytes.
0021  *
0022  * The PS3 has a single processor with two threads.
0023  */
0024 
0025     .globl __system_reset_overlay
0026 __system_reset_overlay:
0027 
0028     /* Switch to 32-bit mode. */
0029 
0030     mfmsr   r9
0031     clrldi  r9,r9,1
0032     mtmsrd  r9
0033     nop
0034 
0035     /* Get thread number in r3 and branch. */
0036 
0037     mfspr   r3, 0x88
0038     cntlzw. r3, r3
0039     beq 1f
0040 
0041     /* Secondary goes to __secondary_hold in kernel. */
0042 
0043     li  r4, 0x60
0044     mtctr   r4
0045     bctr
0046 
0047 1:
0048     /* Primary delays then goes to _zimage_start in wrapper. */
0049 
0050     or  31, 31, 31 /* db16cyc */
0051     or  31, 31, 31 /* db16cyc */
0052 
0053     lis r4, _zimage_start@ha
0054     addi    r4, r4, _zimage_start@l
0055     mtctr   r4
0056     bctr
0057 
0058     . = __system_reset_overlay + 512
0059 
0060 /*
0061  * __system_reset_kernel - Place holder for the kernel reset vector.
0062  *
0063  * The bootwrapper build script copies 512 bytes from offset 0x100
0064  * of the rom image to the symbol __system_reset_kernel.  At runtime
0065  * the bootwrapper program copies the 512 bytes at __system_reset_kernel
0066  * to ram address 0x100.  This symbol must occupy 512 bytes.
0067  */
0068 
0069     .globl __system_reset_kernel
0070 __system_reset_kernel:
0071 
0072     . = __system_reset_kernel + 512