aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-vexpress/tc2-sleep.S
blob: 9bf8348fcc8d6c205580fc787c6014e8ed0cf708 (plain)
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#include <linux/linkage.h>

#define SPC_PHYS_BASE           0x7FFF0000
#define A15_CONF          	0x400

ENTRY(tc2_cpu_resume)
	mrc	p15, 0, r0, c0, c0, 5
	ands	r0, r0, #0xff00
	ldr	r1, =SPC_PHYS_BASE
	mov	r2, #A15_CONF
	add	r1, r1, r2
	ldr	r1, [r1]
	and	r1, r1, #0x7
	cmp	r1, r0, lsr #8
	adr	r0, value
	addne	r0, r0, #16
	ldmia	r0, {r1, r2, r3, r4}	@ CCI address, SCC snoop control & val
	mvn	r3, r3			@ undo actions done at shutdown
	ldr	r0, [r2]
	and	r5, r0, r3
	str	r5, [r2]
	mov	r0, #3			@ enable CCI for the cluster
	str	r0, [r1]
	adr	r1, cci_ctrl
	ldr	r1, [r1]
loop:
	ldr	r0, [r1]
	ands	r0, r0, #1
	bne	loop
	mov	r0, #0			@ disable power down enable
	str	r0, [r4]
	b	cpu_resume
ENDPROC(tc2_cpu_resume)

ENTRY(disable_snoops)
	mrc	p15, 0, r0, c0, c0, 5
	ands	r0, r0, #0xff00
	ldr	r1, scc_ptr
	ldr	r1, [r1]
	mov	r2, #A15_CONF
	add	r1, r1, r2
	ldr	r1, [r1]
	and	r1, r1, #0x7
	cmp	r1, r0, lsr #8
	adr	r0, vvalue
	addne	r0, r0, #8
	ldmia	r0, {r2, r3}	@ CCI address, SCC snoop control & val
	ldr	r1, scc_ptr
	ldr	r1, [r1]
	add	r2, r1, r2
	ldr	r0, [r2]
	orr	r0, r0, r3
	dsb
	isb
	str	r0, [r2]
	wfi
ENDPROC(disable_snoops)

cci_ctrl:
	.long	0x2c09000c
value:
	.long 	0x2c094000
	.long 	0x7fff0404
	.long 	0x180
	.long 	0x7fff0b30
	.long 	0x2c095000
	.long 	0x7fff0504
	.long 	0x2000
	.long 	0x7fff0b34
vvalue:
	.long 	0x404
	.long 	0x180
	.long 	0x504
	.long 	0x2000
scc_ptr:
	.long vscc