File: head-ftvpci.S

package info (click to toggle)
kernel-source-2.4.14 2.4.14-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 139,160 kB
  • ctags: 428,423
  • sloc: ansic: 2,435,554; asm: 141,119; makefile: 8,258; sh: 3,099; perl: 2,561; yacc: 1,177; cpp: 755; tcl: 577; lex: 352; awk: 251; lisp: 218; sed: 72
file content (47 lines) | stat: -rw-r--r-- 1,182 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/* 
 * linux/arch/arm/boot/compressed/head-ftvpci.S
 * 
 * Copyright (C) 2000 FutureTV Labs Ltd.
 * 
 * Special startup code for FTV PCI board.
 */

/*
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version
 * 2 of the License, or (at your option) any later version.
 */

	.section        ".start", #alloc, #execinstr
ftv_start:
	mcr	p15, 0, r0, c7, c5, 0		@ flush I cache
	mrc	p15, 0, r0, c1, c0
	orr	r0, r0, #1 << 12
	mcr	p15, 0, r0, c1, c0		@ enable I cache
	mov	r0, #0
	mcreq	p15, 0, r0, c15, c1, 2		@ enable clock switching

	/* check to see if the kernel must be relocated */
	ldr	ip, =ftv_start
	adr	sl, ftv_start
	teq	ip, sl
	beq	2f				@ no need to copy

	/* in the wrong place -> presumably, executing out of ROM */
	sub	ip, ip, sl			@ displacement
	ldr	lr, =_start			@ destination
	sub	sp, lr, ip			@ source
	ldr	fp, =_edata			@ end of copied area
1:	ldmia	sp!, {r0, r1, r2, r3, r4, r5, r6, r10}
	stmia	lr!, {r0, r1, r2, r3, r4, r5, r6, r10}
	cmp	lr, fp
	ble	1b

2:
	mov	r8, #0
	mov	r7, #3
	b	1f
.ltorg
1:
	/* fall back into head.S */