diff options
Diffstat (limited to 'arch/mips/au1000/common/time.c')
-rw-r--r-- | arch/mips/au1000/common/time.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/arch/mips/au1000/common/time.c b/arch/mips/au1000/common/time.c index f113b512d7b1..e122bbc6cd88 100644 --- a/arch/mips/au1000/common/time.c +++ b/arch/mips/au1000/common/time.c | |||
@@ -209,18 +209,22 @@ unsigned long cal_r4koff(void) | |||
209 | while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C1S); | 209 | while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C1S); |
210 | au_writel(0, SYS_TOYWRITE); | 210 | au_writel(0, SYS_TOYWRITE); |
211 | while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C1S); | 211 | while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C1S); |
212 | } else | ||
213 | no_au1xxx_32khz = 1; | ||
212 | 214 | ||
213 | cpu_speed = (au_readl(SYS_CPUPLL) & 0x0000003f) * | 215 | /* |
214 | AU1000_SRC_CLK; | 216 | * On early Au1000, sys_cpupll was write-only. Since these |
215 | } | 217 | * silicon versions of Au1000 are not sold by AMD, we don't bend |
216 | else { | 218 | * over backwards trying to determine the frequency. |
217 | /* The 32KHz oscillator isn't running, so assume there | 219 | */ |
218 | * isn't one and grab the processor speed from the PLL. | 220 | if (cur_cpu_spec[0]->cpu_pll_wo) |
219 | * NOTE: some old silicon doesn't allow reading the PLL. | 221 | #ifdef CONFIG_SOC_AU1000_FREQUENCY |
220 | */ | 222 | cpu_speed = CONFIG_SOC_AU1000_FREQUENCY; |
223 | #else | ||
224 | cpu_speed = 396000000; | ||
225 | #endif | ||
226 | else | ||
221 | cpu_speed = (au_readl(SYS_CPUPLL) & 0x0000003f) * AU1000_SRC_CLK; | 227 | cpu_speed = (au_readl(SYS_CPUPLL) & 0x0000003f) * AU1000_SRC_CLK; |
222 | no_au1xxx_32khz = 1; | ||
223 | } | ||
224 | mips_hpt_frequency = cpu_speed; | 228 | mips_hpt_frequency = cpu_speed; |
225 | // Equation: Baudrate = CPU / (SD * 2 * CLKDIV * 16) | 229 | // Equation: Baudrate = CPU / (SD * 2 * CLKDIV * 16) |
226 | set_au1x00_uart_baud_base(cpu_speed / (2 * ((int)(au_readl(SYS_POWERCTRL)&0x03) + 2) * 16)); | 230 | set_au1x00_uart_baud_base(cpu_speed / (2 * ((int)(au_readl(SYS_POWERCTRL)&0x03) + 2) * 16)); |