]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/powerpc/kernel/setup-common.c
Pull ec into release branch
[linux-2.6-omap-h63xx.git] / arch / powerpc / kernel / setup-common.c
index 370803722e4773f9f69a09e8b2fa8d7ab8d3d3f0..4924c48cb1ffc64df621b6d2dd6790c2b0683100 100644 (file)
@@ -32,6 +32,7 @@
 #include <linux/unistd.h>
 #include <linux/serial.h>
 #include <linux/serial_8250.h>
+#include <linux/debugfs.h>
 #include <asm/io.h>
 #include <asm/prom.h>
 #include <asm/processor.h>
@@ -486,6 +487,14 @@ int check_legacy_ioport(unsigned long base_port)
 
        switch(base_port) {
        case I8042_DATA_REG:
+               if (!(np = of_find_compatible_node(NULL, NULL, "pnpPNP,303")))
+                       np = of_find_compatible_node(NULL, NULL, "pnpPNP,f03");
+               if (np) {
+                       parent = of_get_parent(np);
+                       of_node_put(np);
+                       np = parent;
+                       break;
+               }
                np = of_find_node_by_type(NULL, "8042");
                break;
        case FDC_BASE: /* FDC1 */
@@ -530,3 +539,56 @@ void __init setup_panic(void)
 {
        atomic_notifier_chain_register(&panic_notifier_list, &ppc_panic_block);
 }
+
+#ifdef CONFIG_CHECK_CACHE_COHERENCY
+/*
+ * For platforms that have configurable cache-coherency.  This function
+ * checks that the cache coherency setting of the kernel matches the setting
+ * left by the firmware, as indicated in the device tree.  Since a mismatch
+ * will eventually result in DMA failures, we print * and error and call
+ * BUG() in that case.
+ */
+
+#ifdef CONFIG_NOT_COHERENT_CACHE
+#define KERNEL_COHERENCY       0
+#else
+#define KERNEL_COHERENCY       1
+#endif
+
+static int __init check_cache_coherency(void)
+{
+       struct device_node *np;
+       const void *prop;
+       int devtree_coherency;
+
+       np = of_find_node_by_path("/");
+       prop = of_get_property(np, "coherency-off", NULL);
+       of_node_put(np);
+
+       devtree_coherency = prop ? 0 : 1;
+
+       if (devtree_coherency != KERNEL_COHERENCY) {
+               printk(KERN_ERR
+                       "kernel coherency:%s != device tree_coherency:%s\n",
+                       KERNEL_COHERENCY ? "on" : "off",
+                       devtree_coherency ? "on" : "off");
+               BUG();
+       }
+
+       return 0;
+}
+
+late_initcall(check_cache_coherency);
+#endif /* CONFIG_CHECK_CACHE_COHERENCY */
+
+#ifdef CONFIG_DEBUG_FS
+struct dentry *powerpc_debugfs_root;
+
+static int powerpc_debugfs_init(void)
+{
+       powerpc_debugfs_root = debugfs_create_dir("powerpc", NULL);
+
+       return powerpc_debugfs_root == NULL;
+}
+arch_initcall(powerpc_debugfs_init);
+#endif