#include <machine/bootinfo.h>
#include <machine/vcacheregs.h>
#include <mips/asm.h>
#include <mips/cpuregs.h>

	.text
	.globl  start
start:
	.set noreorder
	.set mips32
#ifdef __GP_SUPPORT__
        la	gp, _C_LABEL (_gp)
#endif
#if 0
	li	t0, (VC_TLB_EN_ICACHE | VC_TLB_EN_DCACHE)
	mtc2	t0, $VC_TLB_EN, 0
#endif

	la	sp, _C_LABEL(stk)	#setup stack
	la	t0, _C_LABEL (edata)
	la	t2, _C_LABEL(end)	# memset(edata, 0, end - edata)
1:					# but inline, stack is in bss !
	sw	zero, 0(t0)
	addiu	t0, t0, 4
	bne	t0, t2, 1b
	nop

	j	_C_LABEL(main) #main(struct tsar_firmware_info *a0)
	nop
2:
	j	2b

	.globl	_rtt
_rtt:
	j _rtt
	nop

	.bss
	.space 4096		# 4k bytes for stack
stk:	.space 1
