Skip to contentSkip to conversation

OLPC: Add XO-1 suspend/resume support

PATCH Superseded Daniel Drake 2 participants 3 messages Oct 20, 2010 x86

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 OLPC: Add XO-1 suspend/resume support

Add code needed for basic suspend/resume of the XO-1 laptop.

---
 arch/x86/Kconfig                  |    2 +-
 arch/x86/include/asm/olpc.h       |    5 +-
 arch/x86/kernel/Makefile          |    2 +-
 arch/x86/kernel/olpc-xo1-wakeup.S |  133 +++++++++++++++++++++++++++++++++++++
 arch/x86/kernel/olpc-xo1.c        |   79 ++++++++++++++++++++++
 5 files changed, 218 insertions(+), 3 deletions(-)
 create mode 100644 arch/x86/kernel/olpc-xo1-wakeup.S

v2: add dependency on CONFIG_PM_SLEEP (thanks Randy), avoid requirement on hacking swsusp_pg_dir by switching to initial_page_table Depends on the following patch:
x86-32, mm: Add an initial page table for core bootstrapping

arch/x86/Kconfig +1 -1
index 6a81891..581abc7 100644
@@ -2036,7 +2036,7 @@ config OLPC
 
 config OLPC_XO1
 	tristate "OLPC XO-1 support"
-	depends on OLPC && PCI
+	depends on OLPC && PCI && PM_SLEEP
 	---help---
 	  Add support for non-essential features of the OLPC XO-1 laptop.
 
arch/x86/include/asm/olpc.h +4 -1
index 101229b..54dfe92 100644
@@ -88,7 +88,10 @@ extern int olpc_ec_mask_unset(uint8_t bits);
 
 /* EC commands */
 
-#define EC_FIRMWARE_REV		0x08
+#define EC_FIRMWARE_REV			0x08
+#define EC_WAKE_UP_WLAN			0x24
+#define EC_SET_SCI_INHIBIT		0x32
+#define EC_SET_SCI_INHIBIT_RELEASE	0x34
 
 /* SCI source values */
 
arch/x86/kernel/Makefile +1 -1
index 2c833d8..dfbc0c6 100644
@@ -108,7 +108,7 @@ obj-$(CONFIG_SCx200)		+= scx200.o
 scx200-y			+= scx200_32.o
 
 obj-$(CONFIG_OLPC)		+= olpc.o
-obj-$(CONFIG_OLPC_XO1)		+= olpc-xo1.o
+obj-$(CONFIG_OLPC_XO1)		+= olpc-xo1.o olpc-xo1-wakeup.o
 obj-$(CONFIG_OLPC_OPENFIRMWARE)	+= olpc_ofw.o
 obj-$(CONFIG_X86_MRST)		+= mrst.o
 
arch/x86/kernel/olpc-xo1-wakeup.S new file +133 -0

133 lines not on this page · raw message

arch/x86/kernel/olpc-xo1.c +79 -0

103 lines not on this page · raw message

Signature · 1 line
1.7.2.3
#1 lore raw
Quoted 23 lines · On Wed, 20 Oct 2010 16:17:23 +0100 (BST) Daniel Drake <[email protected]> wrote:

Add code needed for basic suspend/resume of the XO-1 laptop.

---
 arch/x86/Kconfig                  |    2 +-
 arch/x86/include/asm/olpc.h       |    5 +-
 arch/x86/kernel/Makefile          |    2 +-
 arch/x86/kernel/olpc-xo1-wakeup.S |  133

+++++++++++++++++++++++++++++++++++++
arch/x86/kernel/olpc-xo1.c | 79 ++++++++++++++++++++++ 5
files changed, 218 insertions(+), 3 deletions(-) create mode 100644 arch/x86/kernel/olpc-xo1-wakeup.S

v2: add dependency on CONFIG_PM_SLEEP (thanks Randy), avoid requirement on hacking swsusp_pg_dir by switching to initial_page_table Depends on the following patch:
x86-32, mm: Add an initial page table for core bootstrapping

arch/x86/Kconfig +0 -0
index 6a81891..581abc7 100644

arch/x86/Kconfig config OLPC · line 2040

Quoted 6 lines
arch/x86/Kconfig +1 -1
@@ -2036,7 +2036,7 @@ config OLPC
 
 config OLPC_XO1
 	tristate "OLPC XO-1 support"
-	depends on OLPC && PCI
+	depends on OLPC && PCI && PM_SLEEP
 	---help---

My suggestion would be:

config OLPC_XO1_PM

	bool
	depends on OLPC && PCI && PM_SLEEP
	default y

No help necessary; just silently turn it on if PM_SLEEP is enabled, but don't make all OLPC support dependent upon PM_SLEEP.

#2 lore raw
Quoted 36 lines · On Wed, 20 Oct 2010 09:06:13 -0700 Andres Salomon <[email protected]> wrote:
Quoted 23 lines · On Wed, 20 Oct 2010 16:17:23 +0100 (BST) Daniel Drake <[email protected]> wrote:

Add code needed for basic suspend/resume of the XO-1 laptop.

---
 arch/x86/Kconfig                  |    2 +-
 arch/x86/include/asm/olpc.h       |    5 +-
 arch/x86/kernel/Makefile          |    2 +-
 arch/x86/kernel/olpc-xo1-wakeup.S |  133

+++++++++++++++++++++++++++++++++++++
arch/x86/kernel/olpc-xo1.c | 79 ++++++++++++++++++++++ 5
files changed, 218 insertions(+), 3 deletions(-) create mode 100644 arch/x86/kernel/olpc-xo1-wakeup.S

v2: add dependency on CONFIG_PM_SLEEP (thanks Randy), avoid requirement on hacking swsusp_pg_dir by switching to initial_page_table Depends on the following patch:
x86-32, mm: Add an initial page table for core bootstrapping

arch/x86/Kconfig +0 -0
index 6a81891..581abc7 100644

arch/x86/Kconfig config OLPC · line 2040

Quoted 6 lines
arch/x86/Kconfig +1 -1
@@ -2036,7 +2036,7 @@ config OLPC
 
 config OLPC_XO1
 	tristate "OLPC XO-1 support"
-	depends on OLPC && PCI
+	depends on OLPC && PCI && PM_SLEEP
 	---help---

My suggestion would be:

Quoted 8 lines

config OLPC_XO1_PM

	bool
	depends on OLPC && PCI && PM_SLEEP
	default y

No help necessary; just silently turn it on if PM_SLEEP is enabled, but don't make all OLPC support dependent upon PM_SLEEP.

Actually, scratch that; I didn't realize that CONFIG_OLPC != CONFIG_OLPC_XO1. The config looks fine the way you proposed.