diff options
author | Xie Xiaobo <X.Xie@freescale.com> | 2013-11-06 10:08:02 +0100 |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2014-01-08 02:08:53 +0100 |
commit | 72c916ae97ff503b01fa21efe91d4328439ab004 (patch) | |
tree | 3281ef98ab14ea28d806eb34c729b28bb8b4f69d /arch/powerpc/platforms/85xx/common.c | |
parent | powerpc/85xx: Merge 85xx/p1023_defconfig into mpc85xx_smp and mpc85xx (diff) | |
download | linux-72c916ae97ff503b01fa21efe91d4328439ab004.tar.xz linux-72c916ae97ff503b01fa21efe91d4328439ab004.zip |
powerpc/85xx: Add QE common init function
Define a QE init function in common file, and avoid
the same codes being duplicated in board files.
Signed-off-by: Xie Xiaobo <X.Xie@freescale.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
Diffstat (limited to 'arch/powerpc/platforms/85xx/common.c')
-rw-r--r-- | arch/powerpc/platforms/85xx/common.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/85xx/common.c b/arch/powerpc/platforms/85xx/common.c index eba78c85303f..3b085c7ee539 100644 --- a/arch/powerpc/platforms/85xx/common.c +++ b/arch/powerpc/platforms/85xx/common.c @@ -9,6 +9,7 @@ #include <linux/of_irq.h> #include <linux/of_platform.h> +#include <asm/qe.h> #include <sysdev/cpm2_pic.h> #include "mpc85xx.h" @@ -82,3 +83,40 @@ void __init mpc85xx_cpm2_pic_init(void) 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 |