aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/olpc.c
diff options
context:
space:
mode:
authorAndres Salomon <dilinger@queued.net>2010-06-18 17:46:53 -0400
committerH. Peter Anvin <hpa@linux.intel.com>2010-06-18 17:54:36 -0400
commitfd699c76552bbfa66631f019be415a87dbb08237 (patch)
tree49f136f22fc94230af214f9c9c21a6fc0b7180e1 /arch/x86/kernel/olpc.c
parent7e27d6e778cd87b6f2415515d7127eba53fe5d02 (diff)
x86, olpc: Add support for calling into OpenFirmware
Add support for saving OFW's cif, and later calling into it to run OFW commands. OFW remains resident in memory, living within virtual range 0xff800000 - 0xffc00000. A single page directory entry points to the pgdir that OFW actually uses, so rather than saving the entire page table, we grab and install that one entry permanently in the kernel's page table. This is currently only used by the OLPC XO. Note that this particular calling convention breaks PAE and PAT, and so cannot be used on newer x86 hardware. Signed-off-by: Andres Salomon <dilinger@queued.net> LKML-Reference: <20100618174653.7755a39a@dev.queued.net> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch/x86/kernel/olpc.c')
-rw-r--r--arch/x86/kernel/olpc.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/arch/x86/kernel/olpc.c b/arch/x86/kernel/olpc.c
index 8297160c41b3..156605281f56 100644
--- a/arch/x86/kernel/olpc.c
+++ b/arch/x86/kernel/olpc.c
@@ -21,10 +21,7 @@
21#include <asm/geode.h> 21#include <asm/geode.h>
22#include <asm/setup.h> 22#include <asm/setup.h>
23#include <asm/olpc.h> 23#include <asm/olpc.h>
24 24#include <asm/olpc_ofw.h>
25#ifdef CONFIG_OPEN_FIRMWARE
26#include <asm/ofw.h>
27#endif
28 25
29struct olpc_platform_t olpc_platform_info; 26struct olpc_platform_t olpc_platform_info;
30EXPORT_SYMBOL_GPL(olpc_platform_info); 27EXPORT_SYMBOL_GPL(olpc_platform_info);
@@ -188,14 +185,15 @@ err:
188} 185}
189EXPORT_SYMBOL_GPL(olpc_ec_cmd); 186EXPORT_SYMBOL_GPL(olpc_ec_cmd);
190 187
191#ifdef CONFIG_OPEN_FIRMWARE 188#ifdef CONFIG_OLPC_OPENFIRMWARE
192static void __init platform_detect(void) 189static void __init platform_detect(void)
193{ 190{
194 size_t propsize; 191 size_t propsize;
195 __be32 rev; 192 __be32 rev;
193 void *args[] = { NULL, "board-revision-int", &rev, (void *)4 };
194 void *res[] = { &propsize };
196 195
197 if (ofw("getprop", 4, 1, NULL, "board-revision-int", &rev, 4, 196 if (olpc_ofw("getprop", args, res) || propsize != 4) {
198 &propsize) || propsize != 4) {
199 printk(KERN_ERR "ofw: getprop call failed!\n"); 197 printk(KERN_ERR "ofw: getprop call failed!\n");
200 rev = cpu_to_be32(0); 198 rev = cpu_to_be32(0);
201 } 199 }