diff options
Diffstat (limited to 'arch/powerpc/sysdev/cpm1.c')
-rw-r--r-- | arch/powerpc/sysdev/cpm1.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/arch/powerpc/sysdev/cpm1.c b/arch/powerpc/sysdev/cpm1.c index ecad10d4e928..8d103ca6d6ab 100644 --- a/arch/powerpc/sysdev/cpm1.c +++ b/arch/powerpc/sysdev/cpm1.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <linux/irq.h> | 31 | #include <linux/irq.h> |
32 | #include <linux/module.h> | 32 | #include <linux/module.h> |
33 | #include <linux/spinlock.h> | 33 | #include <linux/spinlock.h> |
34 | #include <linux/slab.h> | ||
34 | #include <asm/page.h> | 35 | #include <asm/page.h> |
35 | #include <asm/pgtable.h> | 36 | #include <asm/pgtable.h> |
36 | #include <asm/8xx_immap.h> | 37 | #include <asm/8xx_immap.h> |
@@ -485,9 +486,6 @@ int cpm1_clk_setup(enum cpm_clk_target target, int clock, int mode) | |||
485 | return -EINVAL; | 486 | return -EINVAL; |
486 | } | 487 | } |
487 | 488 | ||
488 | if (reg == &mpc8xx_immr->im_cpm.cp_sicr && mode == CPM_CLK_RX) | ||
489 | shift += 3; | ||
490 | |||
491 | for (i = 0; i < ARRAY_SIZE(clk_map); i++) { | 489 | for (i = 0; i < ARRAY_SIZE(clk_map); i++) { |
492 | if (clk_map[i][0] == target && clk_map[i][1] == clock) { | 490 | if (clk_map[i][0] == target && clk_map[i][1] == clock) { |
493 | bits = clk_map[i][2]; | 491 | bits = clk_map[i][2]; |
@@ -502,6 +500,17 @@ int cpm1_clk_setup(enum cpm_clk_target target, int clock, int mode) | |||
502 | 500 | ||
503 | bits <<= shift; | 501 | bits <<= shift; |
504 | mask <<= shift; | 502 | mask <<= shift; |
503 | |||
504 | if (reg == &mpc8xx_immr->im_cpm.cp_sicr) { | ||
505 | if (mode == CPM_CLK_RTX) { | ||
506 | bits |= bits << 3; | ||
507 | mask |= mask << 3; | ||
508 | } else if (mode == CPM_CLK_RX) { | ||
509 | bits <<= 3; | ||
510 | mask <<= 3; | ||
511 | } | ||
512 | } | ||
513 | |||
505 | out_be32(reg, (in_be32(reg) & ~mask) | bits); | 514 | out_be32(reg, (in_be32(reg) & ~mask) | bits); |
506 | 515 | ||
507 | return 0; | 516 | return 0; |