diff options
author | Zhicheng Fan <b32736@freescale.com> | 2012-02-22 00:44:06 -0500 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2012-03-16 15:59:38 -0400 |
commit | 04e358d896a7351c6cb453bcaa62cbbe99ae6c7c (patch) | |
tree | 44a3159c03f5550e6428f87662d2cc8d715ec41f /arch/powerpc/platforms/85xx/mpc85xx_rdb.c | |
parent | c141b38f8643b46701c9db819909120c5b667a26 (diff) |
powerpc/85xx: Add Quicc Engine support for p1025rdb
Signed-off-by: Zhicheng Fan <b32736@freescale.com>
Acked-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms/85xx/mpc85xx_rdb.c')
-rw-r--r-- | arch/powerpc/platforms/85xx/mpc85xx_rdb.c | 77 |
1 files changed, 76 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c index e5b260c0995b..db214cd4c822 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c | |||
@@ -26,6 +26,9 @@ | |||
26 | #include <asm/prom.h> | 26 | #include <asm/prom.h> |
27 | #include <asm/udbg.h> | 27 | #include <asm/udbg.h> |
28 | #include <asm/mpic.h> | 28 | #include <asm/mpic.h> |
29 | #include <asm/qe.h> | ||
30 | #include <asm/qe_ic.h> | ||
31 | #include <asm/fsl_guts.h> | ||
29 | 32 | ||
30 | #include <sysdev/fsl_soc.h> | 33 | #include <sysdev/fsl_soc.h> |
31 | #include <sysdev/fsl_pci.h> | 34 | #include <sysdev/fsl_pci.h> |
@@ -47,6 +50,10 @@ void __init mpc85xx_rdb_pic_init(void) | |||
47 | struct mpic *mpic; | 50 | struct mpic *mpic; |
48 | unsigned long root = of_get_flat_dt_root(); | 51 | unsigned long root = of_get_flat_dt_root(); |
49 | 52 | ||
53 | #ifdef CONFIG_QUICC_ENGINE | ||
54 | struct device_node *np; | ||
55 | #endif | ||
56 | |||
50 | if (of_flat_dt_is_compatible(root, "fsl,MPC85XXRDB-CAMP")) { | 57 | if (of_flat_dt_is_compatible(root, "fsl,MPC85XXRDB-CAMP")) { |
51 | mpic = mpic_alloc(NULL, 0, MPIC_NO_RESET | | 58 | mpic = mpic_alloc(NULL, 0, MPIC_NO_RESET | |
52 | MPIC_BIG_ENDIAN | | 59 | MPIC_BIG_ENDIAN | |
@@ -61,6 +68,18 @@ void __init mpc85xx_rdb_pic_init(void) | |||
61 | 68 | ||
62 | BUG_ON(mpic == NULL); | 69 | BUG_ON(mpic == NULL); |
63 | mpic_init(mpic); | 70 | mpic_init(mpic); |
71 | |||
72 | #ifdef CONFIG_QUICC_ENGINE | ||
73 | np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic"); | ||
74 | if (np) { | ||
75 | qe_ic_init(np, 0, qe_ic_cascade_low_mpic, | ||
76 | qe_ic_cascade_high_mpic); | ||
77 | of_node_put(np); | ||
78 | |||
79 | } else | ||
80 | pr_err("%s: Could not find qe-ic node\n", __func__); | ||
81 | #endif | ||
82 | |||
64 | } | 83 | } |
65 | 84 | ||
66 | /* | 85 | /* |
@@ -68,7 +87,7 @@ void __init mpc85xx_rdb_pic_init(void) | |||
68 | */ | 87 | */ |
69 | static void __init mpc85xx_rdb_setup_arch(void) | 88 | static void __init mpc85xx_rdb_setup_arch(void) |
70 | { | 89 | { |
71 | #ifdef CONFIG_PCI | 90 | #if defined(CONFIG_PCI) || defined(CONFIG_QUICC_ENGINE) |
72 | struct device_node *np; | 91 | struct device_node *np; |
73 | #endif | 92 | #endif |
74 | 93 | ||
@@ -84,6 +103,62 @@ static void __init mpc85xx_rdb_setup_arch(void) | |||
84 | #endif | 103 | #endif |
85 | 104 | ||
86 | mpc85xx_smp_init(); | 105 | mpc85xx_smp_init(); |
106 | |||
107 | #ifdef CONFIG_QUICC_ENGINE | ||
108 | np = of_find_compatible_node(NULL, NULL, "fsl,qe"); | ||
109 | if (!np) { | ||
110 | pr_err("%s: Could not find Quicc Engine node\n", __func__); | ||
111 | goto qe_fail; | ||
112 | } | ||
113 | |||
114 | qe_reset(); | ||
115 | of_node_put(np); | ||
116 | |||
117 | np = of_find_node_by_name(NULL, "par_io"); | ||
118 | if (np) { | ||
119 | struct device_node *ucc; | ||
120 | |||
121 | par_io_init(np); | ||
122 | of_node_put(np); | ||
123 | |||
124 | for_each_node_by_name(ucc, "ucc") | ||
125 | par_io_of_config(ucc); | ||
126 | |||
127 | } | ||
128 | #if defined(CONFIG_UCC_GETH) || defined(CONFIG_SERIAL_QE) | ||
129 | if (machine_is(p1025_rdb)) { | ||
130 | |||
131 | struct ccsr_guts_85xx __iomem *guts; | ||
132 | |||
133 | np = of_find_node_by_name(NULL, "global-utilities"); | ||
134 | if (np) { | ||
135 | guts = of_iomap(np, 0); | ||
136 | if (!guts) { | ||
137 | |||
138 | pr_err("mpc85xx-rdb: could not map global utilities register\n"); | ||
139 | |||
140 | } else { | ||
141 | /* P1025 has pins muxed for QE and other functions. To | ||
142 | * enable QE UEC mode, we need to set bit QE0 for UCC1 | ||
143 | * in Eth mode, QE0 and QE3 for UCC5 in Eth mode, QE9 | ||
144 | * and QE12 for QE MII management singals in PMUXCR | ||
145 | * register. | ||
146 | */ | ||
147 | setbits32(&guts->pmuxcr, MPC85xx_PMUXCR_QE(0) | | ||
148 | MPC85xx_PMUXCR_QE(3) | | ||
149 | MPC85xx_PMUXCR_QE(9) | | ||
150 | MPC85xx_PMUXCR_QE(12)); | ||
151 | iounmap(guts); | ||
152 | } | ||
153 | of_node_put(np); | ||
154 | } | ||
155 | |||
156 | } | ||
157 | #endif | ||
158 | |||
159 | qe_fail: | ||
160 | #endif /* CONFIG_QUICC_ENGINE */ | ||
161 | |||
87 | printk(KERN_INFO "MPC85xx RDB board from Freescale Semiconductor\n"); | 162 | printk(KERN_INFO "MPC85xx RDB board from Freescale Semiconductor\n"); |
88 | } | 163 | } |
89 | 164 | ||