]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - arch/x86/kernel/olpc.c
x86, olpc: Add support for calling into OpenFirmware
[net-next-2.6.git] / arch / x86 / kernel / olpc.c
index 9d1d263f786fdd694513ba8383b635bcdcea319e..156605281f569583168aa98c1ab76619264198f4 100644 (file)
 #include <linux/spinlock.h>
 #include <linux/io.h>
 #include <linux/string.h>
+
 #include <asm/geode.h>
+#include <asm/setup.h>
 #include <asm/olpc.h>
-
-#ifdef CONFIG_OPEN_FIRMWARE
-#include <asm/ofw.h>
-#endif
+#include <asm/olpc_ofw.h>
 
 struct olpc_platform_t olpc_platform_info;
 EXPORT_SYMBOL_GPL(olpc_platform_info);
@@ -186,14 +185,15 @@ err:
 }
 EXPORT_SYMBOL_GPL(olpc_ec_cmd);
 
-#ifdef CONFIG_OPEN_FIRMWARE
+#ifdef CONFIG_OLPC_OPENFIRMWARE
 static void __init platform_detect(void)
 {
        size_t propsize;
        __be32 rev;
+       void *args[] = { NULL, "board-revision-int", &rev, (void *)4 };
+       void *res[] = { &propsize };
 
-       if (ofw("getprop", 4, 1, NULL, "board-revision-int", &rev, 4,
-                       &propsize) || propsize != 4) {
+       if (olpc_ofw("getprop", args, res) || propsize != 4) {
                printk(KERN_ERR "ofw: getprop call failed!\n");
                rev = cpu_to_be32(0);
        }
@@ -243,9 +243,11 @@ static int __init olpc_init(void)
        olpc_ec_cmd(EC_FIRMWARE_REV, NULL, 0,
                        (unsigned char *) &olpc_platform_info.ecver, 1);
 
-       /* check to see if the VSA exists */
-       if (cs5535_has_vsa2())
-               olpc_platform_info.flags |= OLPC_F_VSA;
+#ifdef CONFIG_PCI_OLPC
+       /* If the VSA exists let it emulate PCI, if not emulate in kernel */
+       if (!cs5535_has_vsa2())
+               x86_init.pci.arch_init = pci_olpc_init;
+#endif
 
        printk(KERN_INFO "OLPC board revision %s%X (EC=%x)\n",
                        ((olpc_platform_info.boardrev & 0xf) < 8) ? "pre" : "",