summaryrefslogtreecommitdiffstats
path: root/target/linux/olpc/files/arch/i386/kernel/olpc-sleep.S
blob: 9535c9a9418c53e7400e5f04d80cd5bddf5643d8 (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
.text

ENTRY(olpc_sleep_asm)
olpc_sleep:
	;; Get the value of PM1_CNT and store it off
	
	add 08h, ax
	mov bx,dx
	in dx,eax
	or 2000h, ax
	mov ax,di
	
	;; flush the cache
	wbinvd

	;; GX2 must disable refresh before going into self-refresh 
	mov 2000000180xh, ecx
	rdmsr
	mov eax, esi
	and 0FF0000FFh, eax
	wrmsr

	;; Now, put  the memory into self refresh
	mov 2004, cx
	xor edx, edx
	xor eax, eax
	mov 04h, al
	wrmsr

	;; Thats all she wrote - time to go to sleep
	
	mov bx, dx
	movzx di, eax
	out eax, dx

	;;