28 #include <linux/errno.h>
29 #include <linux/sched.h>
30 #include <linux/kernel.h>
32 #include <linux/string.h>
35 #include <linux/module.h>
42 #include <asm/pgtable.h>
57 #define CPM_MAP_SIZE (0x40000)
63 #ifdef CONFIG_PPC_85xx
77 #ifndef CONFIG_PPC_EARLY_DEBUG_CPM
86 #define MAX_CR_CMD_LOOPS 10000
101 printk(
KERN_ERR "%s(): Not able to issue CPM command\n", __func__);
104 spin_unlock_irqrestore(&
cmd_lock, flags);
127 bp = cpm2_map_size(im_brgc1, 16);
129 bp = cpm2_map_size(im_brgc5, 16);
153 {CPM_CLK_FCC1, CPM_BRG5, 0},
154 {CPM_CLK_FCC1, CPM_BRG6, 1},
155 {CPM_CLK_FCC1, CPM_BRG7, 2},
156 {CPM_CLK_FCC1, CPM_BRG8, 3},
157 {CPM_CLK_FCC1, CPM_CLK9, 4},
158 {CPM_CLK_FCC1, CPM_CLK10, 5},
159 {CPM_CLK_FCC1, CPM_CLK11, 6},
160 {CPM_CLK_FCC1, CPM_CLK12, 7},
161 {CPM_CLK_FCC2, CPM_BRG5, 0},
162 {CPM_CLK_FCC2, CPM_BRG6, 1},
163 {CPM_CLK_FCC2, CPM_BRG7, 2},
164 {CPM_CLK_FCC2, CPM_BRG8, 3},
165 {CPM_CLK_FCC2, CPM_CLK13, 4},
166 {CPM_CLK_FCC2, CPM_CLK14, 5},
167 {CPM_CLK_FCC2, CPM_CLK15, 6},
168 {CPM_CLK_FCC2, CPM_CLK16, 7},
169 {CPM_CLK_FCC3, CPM_BRG5, 0},
170 {CPM_CLK_FCC3, CPM_BRG6, 1},
171 {CPM_CLK_FCC3, CPM_BRG7, 2},
172 {CPM_CLK_FCC3, CPM_BRG8, 3},
173 {CPM_CLK_FCC3, CPM_CLK13, 4},
174 {CPM_CLK_FCC3, CPM_CLK14, 5},
175 {CPM_CLK_FCC3, CPM_CLK15, 6},
176 {CPM_CLK_FCC3, CPM_CLK16, 7},
211 im_cpmux = cpm2_map(im_cpmux);
215 reg = &im_cpmux->cmx_scr;
219 reg = &im_cpmux->cmx_scr;
223 reg = &im_cpmux->cmx_scr;
227 reg = &im_cpmux->cmx_scr;
231 reg = &im_cpmux->cmx_fcr;
235 reg = &im_cpmux->cmx_fcr;
239 reg = &im_cpmux->cmx_fcr;
248 if (clk_map[i][0] == target && clk_map[i][1] == clock) {
249 bits = clk_map[
i][2];
269 cpm2_unmap(im_cpmux);
293 im_cpmux = cpm2_map(im_cpmux);
297 reg = &im_cpmux->cmx_smr;
302 reg = &im_cpmux->cmx_smr;
312 if (clk_map[i][0] == target && clk_map[i][1] == clock) {
313 bits = clk_map[
i][2];
325 cpm2_unmap(im_cpmux);
339 pin = 1 << (31 - pin);
342 setbits32(&iop[port].
dir, pin);
344 clrbits32(&iop[port].dir, pin);
347 setbits32(&iop[port].
par, pin);
349 clrbits32(&iop[port].par, pin);
352 setbits32(&iop[port].
sor, pin);
354 clrbits32(&iop[port].sor, pin);
357 setbits32(&iop[port].
odr, pin);
359 clrbits32(&iop[port].odr, pin);
362 static int cpm_init_par_io(
void)
366 for_each_compatible_node(np,
NULL,
"fsl,cpm2-pario-bank")