pif2DiagBoot.s 945 Bytes
/*
 * pif2Boot.s: 
 *	Bootstrap file which jumps to the former boot location at
 *	0x400; pif2 chips vector into ramrom at 0x1000.
 */
#include "regdef.h"
#include "asm.h"
#include "rcp.h"

#define PIF1_BOOT_LOCATION	0xb0000400

LEAF (tm_rdram_pif2boot)                       # Address = 0xB0001000.

	.set noreorder
 	# Trigger remapping for controllers

        li      t0,0xbfc007fc
	/*
loop1:
        lw      t1,0(t0)
        li      t2,0x800
        and     t1,t2
        bne     t1,zero,loop1

        #wait for 20 usec.

	nop
        nop
        nop
*/

        lw      t1,0(t0)
        li      t2,0x10
        or      t1,t2
        sw      t1,0(t0)
        nop
        nop

	.set reorder
wait1:
        lw      t1,PHYS_TO_K1(SI_STATUS_REG)
        andi    t1,SI_STATUS_RD_BUSY
        bnez    t1,wait1

        lw      t1,0(t0)
        li      t2,0x20
        sw      t2,0(t0)

	la	t4, PIF1_BOOT_LOCATION
	jr	t4

END (tm_rdram_pif2boot)