diff options
author | blogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2007-12-30 17:38:08 +0000 |
---|---|---|
committer | blogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2007-12-30 17:38:08 +0000 |
commit | f39cd042512614edfbed8b4ea22023c1f75145b2 (patch) | |
tree | c6f85a18f1e5ea9e15a4649f8956c53b33f3726d /target/linux/olpc/files/arch/i386/kernel/olpc-sleep.S | |
parent | 25040fe2c0cc788e36c2f4a4d82e84ddea8a71a1 (diff) |
cleaning up olpc patch 1
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@10060 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/olpc/files/arch/i386/kernel/olpc-sleep.S')
-rw-r--r-- | target/linux/olpc/files/arch/i386/kernel/olpc-sleep.S | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/target/linux/olpc/files/arch/i386/kernel/olpc-sleep.S b/target/linux/olpc/files/arch/i386/kernel/olpc-sleep.S new file mode 100644 index 000000000..9535c9a94 --- /dev/null +++ b/target/linux/olpc/files/arch/i386/kernel/olpc-sleep.S @@ -0,0 +1,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 + + ;; + + + |