1#include "asm_regnames.h"
2#include "spimconsreg.h"
3#define MEM_ADDR 0xa0000000
4#define SPIM_ADDR 0xa2000000
5	.text
6	.globl	__start
7__start:
8	/* Writing to device memory with sb requires us to be conscious
9	 * of endianness. This will tell us what endianness we are, so
10	 * we can write to the least significant byte of the register
11	 * (as documented in the manual.) */
12	li	t2, 1
13	li	t3, MEM_ADDR
14	sw	t2, 0(t3)
15	lb	t2, 0(t3)
16	beqz	t2, BE
17LE:	li	t2, 0
18	b	chkrdy
19BE:	li	t2, 3
20chkrdy:
21	li	a0, SPIM_ADDR
22	add	t2, t2, a0
23	addiu	t2, t2, DISPLAY_1_DATA
24wait:
25	lw	t0, DISPLAY_1_CONTROL(a0)
26	andi	t0, t0, CTL_RDY
27	beqz	t0, wait
28print:
29	li	t1, 'Z'
30	sb	t1, 0(t2)
31done:
32	break
33	# Halt on user tlb exceptions
34	.org	0x100
35	break
36	# Handle exceptions
37	.org	0x180
38	break
39