dev.s 680 Bytes
#include <regdef.h>
#include <asm.h>
#include <PR/R4300.h>

#include <PR/bcp.h>

.text
.align 2
.set    noreorder 
.ent __start
.globl __start
__start:
        # insure power remains on
        li      t0, (1<<PI_GPIO_ENABLE_SHIFT)|1
        sw      t0, PHYS_TO_K1(PI_GPIO_REG)

	# debug output
	li	t0, 0x20
	sw	t0, PHYS_TO_K1(PI_DRAM_ADDR_REG)

	# setup stack pointer and gp
	li	sp, PHYS_TO_K1(INTERNAL_RAM_END-4)
	la	gp, _gp

	#debug output
	sw	sp, PHYS_TO_K1(PI_DRAM_ADDR_REG)
		
	# jump to "C" code
	jal	main
	nop
	
        # power down 
        lw      t0, PHYS_TO_K1(PI_GPIO_REG)
        and     t0, t0, 0xfffffffe
        sw      t0, PHYS_TO_K1(PI_GPIO_REG)



.end __start