summaryrefslogtreecommitdiffstats
path: root/target/linux/olpc/files-2.6.23/arch/i386/kernel/olpc-sleep.S
diff options
context:
space:
mode:
authorryd <ryd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2008-02-19 04:03:49 +0000
committerryd <ryd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2008-02-19 04:03:49 +0000
commite4a3634c00818e77664da2c3592a95e8c8fad5d6 (patch)
tree5aec8287ecd3034c53cbbeb5a6408389b1d34507 /target/linux/olpc/files-2.6.23/arch/i386/kernel/olpc-sleep.S
parentac24192a897d17c7416cfc1a58ad5432404662de (diff)
Adding .24 support for olpc
kernel compiles fine, but graphic support is broken to test new kernel version, change target/linux/olpc/Makefile from .23.16 to .24 git-svn-id: svn://svn.openwrt.org/openwrt/trunk@10493 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/olpc/files-2.6.23/arch/i386/kernel/olpc-sleep.S')
-rw-r--r--target/linux/olpc/files-2.6.23/arch/i386/kernel/olpc-sleep.S39
1 files changed, 39 insertions, 0 deletions
diff --git a/target/linux/olpc/files-2.6.23/arch/i386/kernel/olpc-sleep.S b/target/linux/olpc/files-2.6.23/arch/i386/kernel/olpc-sleep.S
new file mode 100644
index 000000000..9535c9a94
--- /dev/null
+++ b/target/linux/olpc/files-2.6.23/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
+
+ ;;
+
+
+