#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 
+#include <asm/qe.h>
 #include <sysdev/cpm2_pic.h>
 
 #include "mpc85xx.h"
        irq_set_chained_handler(irq, cpm2_cascade);
 }
 #endif
+
+#ifdef CONFIG_QUICC_ENGINE
+void __init mpc85xx_qe_init(void)
+{
+       struct device_node *np;
+
+       np = of_find_compatible_node(NULL, NULL, "fsl,qe");
+       if (!np) {
+               np = of_find_node_by_name(NULL, "qe");
+               if (!np) {
+                       pr_err("%s: Could not find Quicc Engine node\n",
+                                       __func__);
+                       return;
+               }
+       }
+
+       if (!of_device_is_available(np)) {
+               of_node_put(np);
+               return;
+       }
+
+       qe_reset();
+       of_node_put(np);
+
+       np = of_find_node_by_name(NULL, "par_io");
+       if (np) {
+               struct device_node *ucc;
+
+               par_io_init(np);
+               of_node_put(np);
+
+               for_each_node_by_name(ucc, "ucc")
+                       par_io_of_config(ucc);
+
+       }
+}
+#endif
 
 static inline void __init mpc85xx_cpm2_pic_init(void) {}
 #endif /* CONFIG_CPM2 */
 
+#ifdef CONFIG_QUICC_ENGINE
+extern void mpc85xx_qe_init(void);
+#else
+static inline void __init mpc85xx_qe_init(void) {}
+#endif
+
 #endif
 
 /*
- * Copyright (C) 2006-2010, 2012 Freescale Semiconductor, Inc.
+ * Copyright (C) 2006-2010, 2012-2013 Freescale Semiconductor, Inc.
  * All rights reserved.
  *
  * Author: Andy Fleming <afleming@freescale.com>
 {
        struct device_node *np;
 
-       np = of_find_compatible_node(NULL, NULL, "fsl,qe");
-       if (!np) {
-               np = of_find_node_by_name(NULL, "qe");
-               if (!np)
-                       return;
-       }
-
-       if (!of_device_is_available(np)) {
-               of_node_put(np);
-               return;
-       }
-
-       qe_reset();
-       of_node_put(np);
-
-       np = of_find_node_by_name(NULL, "par_io");
-       if (np) {
-               struct device_node *ucc;
-
-               par_io_init(np);
-               of_node_put(np);
-
-               for_each_node_by_name(ucc, "ucc")
-                       par_io_of_config(ucc);
-       }
-
+       mpc85xx_qe_init();
        mpc85xx_mds_reset_ucc_phys();
 
        if (machine_is(p1021_mds)) {
 
 /*
  * MPC85xx RDB Board Setup
  *
- * Copyright 2009,2012 Freescale Semiconductor Inc.
+ * Copyright 2009,2012-2013 Freescale Semiconductor Inc.
  *
  * This program is free software; you can redistribute  it and/or modify it
  * under  the terms of  the GNU General  Public License as published by the
        fsl_pci_assign_primary();
 
 #ifdef CONFIG_QUICC_ENGINE
-       np = of_find_compatible_node(NULL, NULL, "fsl,qe");
-       if (!np) {
-               pr_err("%s: Could not find Quicc Engine node\n", __func__);
-               goto qe_fail;
-       }
-
-       qe_reset();
-       of_node_put(np);
-
-       np = of_find_node_by_name(NULL, "par_io");
-       if (np) {
-               struct device_node *ucc;
-
-               par_io_init(np);
-               of_node_put(np);
-
-               for_each_node_by_name(ucc, "ucc")
-                       par_io_of_config(ucc);
-
-       }
+       mpc85xx_qe_init();
 #if defined(CONFIG_UCC_GETH) || defined(CONFIG_SERIAL_QE)
        if (machine_is(p1025_rdb)) {
 
 
        }
 #endif
-
-qe_fail:
 #endif /* CONFIG_QUICC_ENGINE */
 
        printk(KERN_INFO "MPC85xx RDB board from Freescale Semiconductor\n");