head-rom.S 1.8 KB
Newer Older
L
Linus Torvalds 已提交
1 2 3 4 5 6 7 8 9 10
	
	.global _start
	.global _stext

	.global _rambase
	.global _ramvec
	.global _ramstart
	.global _ramend

#ifdef CONFIG_INIT_LCD
11
	.global bootlogo_bits
L
Linus Torvalds 已提交
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
#endif

	.data

/*
 *      Set up the usable of RAM stuff. Size of RAM is determined then
 *      an initial stack set up at the end.
 */
.align 4
_ramvec:
.long   0
_rambase:
.long   0
_ramstart:
.long   0
_ramend:
.long   0

30 31
#define	RAMEND	(CONFIG_RAMBASE + CONFIG_RAMSIZE)

L
Linus Torvalds 已提交
32 33 34 35
	.text
_start:
_stext:	movew	#0x2700,%sr
#ifdef CONFIG_INIT_LCD
36
	movel	#bootlogo_bits, 0xfffffA00 /* LSSA */
L
Linus Torvalds 已提交
37 38 39 40 41 42 43 44 45 46
	moveb	#0x28,   0xfffffA05	/* LVPW */
	movew	#0x280,  0xFFFFFa08	/* LXMAX */
	movew	#0x1df,  0xFFFFFa0a	/* LYMAX */
	moveb	#0,      0xfffffa29	/* LBAR */
	moveb	#0,      0xfffffa25	/* LPXCD */
	moveb	#0x08,   0xFFFFFa20	/* LPICF */
	moveb	#0x01,   0xFFFFFA21	/* -ve pol */
	moveb	#0x81,   0xfffffA27	/* LCKCON */
	movew	#0xff00, 0xfffff412	/* LCD pins */
#endif
47
	moveal  #RAMEND-CONFIG_MEMORY_RESERVE*0x100000 - 0x10, %sp
L
Linus Torvalds 已提交
48 49 50 51 52 53 54 55 56 57 58 59 60 61
	movew	#32767, %d0  /* PLL settle wait loop */
1:	subq	#1, %d0
	bne	1b

	/* Copy data segment from ROM to RAM */
	moveal	#_etext, %a0
	moveal	#_sdata, %a1
	moveal	#_edata, %a2

	/* Copy %a0 to %a1 until %a1 == %a2 */
1:	movel	%a0@+, %a1@+
	cmpal	%a1, %a2
	bhi	1b

62 63
	moveal	#__bss_start, %a0
	moveal	#__bss_stop, %a1
L
Linus Torvalds 已提交
64 65 66 67 68 69 70 71
	/* Copy 0 to %a0 until %a0 == %a1 */
	
1:
	clrl	%a0@+
	cmpal	%a0, %a1
	bhi	1b

        movel   #_sdata, %d0    
72
        movel   %d0, _rambase        
73
        movel   #__bss_stop, %d0
74 75 76 77 78
        movel   %d0, _ramstart
	movel	#RAMEND-CONFIG_MEMORY_RESERVE*0x100000, %d0
	movel	%d0, _ramend
	movel	#CONFIG_VECTORBASE,	%d0
	movel	%d0, _ramvec
L
Linus Torvalds 已提交
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
	
/*
 * load the current task pointer and stack
 */
	lea	init_thread_union, %a0
	lea	0x2000(%a0), %sp

1:	jsr	start_kernel
        bra 1b
_exit:

	jmp	_exit


putc:
	moveb	%d7,0xfffff907
1:
	movew	0xfffff906, %d7
	andw	#0x2000, %d7
	beq	1b
	rts

	.data
env:
	.long	0
	.text