diff options
Diffstat (limited to 'arch/powerpc/sysdev/cpm2.c')
| -rw-r--r-- | arch/powerpc/sysdev/cpm2.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/powerpc/sysdev/cpm2.c b/arch/powerpc/sysdev/cpm2.c index f1c3395633b9..eb5927212fab 100644 --- a/arch/powerpc/sysdev/cpm2.c +++ b/arch/powerpc/sysdev/cpm2.c | |||
| @@ -52,6 +52,7 @@ cpm_cpm2_t __iomem *cpmp; /* Pointer to comm processor space */ | |||
| 52 | * the communication processor devices. | 52 | * the communication processor devices. |
| 53 | */ | 53 | */ |
| 54 | cpm2_map_t __iomem *cpm2_immr; | 54 | cpm2_map_t __iomem *cpm2_immr; |
| 55 | EXPORT_SYMBOL(cpm2_immr); | ||
| 55 | 56 | ||
| 56 | #define CPM_MAP_SIZE (0x40000) /* 256k - the PQ3 reserve this amount | 57 | #define CPM_MAP_SIZE (0x40000) /* 256k - the PQ3 reserve this amount |
| 57 | of space for CPM as it is larger | 58 | of space for CPM as it is larger |
| @@ -60,7 +61,7 @@ cpm2_map_t __iomem *cpm2_immr; | |||
| 60 | void __init cpm2_reset(void) | 61 | void __init cpm2_reset(void) |
| 61 | { | 62 | { |
| 62 | #ifdef CONFIG_PPC_85xx | 63 | #ifdef CONFIG_PPC_85xx |
| 63 | cpm2_immr = ioremap(CPM_MAP_ADDR, CPM_MAP_SIZE); | 64 | cpm2_immr = ioremap(get_immrbase() + 0x80000, CPM_MAP_SIZE); |
| 64 | #else | 65 | #else |
| 65 | cpm2_immr = ioremap(get_immrbase(), CPM_MAP_SIZE); | 66 | cpm2_immr = ioremap(get_immrbase(), CPM_MAP_SIZE); |
| 66 | #endif | 67 | #endif |
| @@ -129,7 +130,8 @@ void __cpm2_setbrg(uint brg, uint rate, uint clk, int div16, int src) | |||
| 129 | brg -= 4; | 130 | brg -= 4; |
| 130 | } | 131 | } |
| 131 | bp += brg; | 132 | bp += brg; |
| 132 | val = (((clk / rate) - 1) << 1) | CPM_BRG_EN | src; | 133 | /* Round the clock divider to the nearest integer. */ |
| 134 | val = (((clk * 2 / rate) - 1) & ~1) | CPM_BRG_EN | src; | ||
| 133 | if (div16) | 135 | if (div16) |
| 134 | val |= CPM_BRG_DIV16; | 136 | val |= CPM_BRG_DIV16; |
| 135 | 137 | ||
