blackfin: Uart divisor should be set after their values are generated.
authorSonic Zhang <sonic.zhang@analog.com>
Thu, 14 Mar 2013 04:47:12 +0000 (12:47 +0800)
committerSonic Zhang <sonic.zhang@analog.com>
Mon, 13 May 2013 08:30:17 +0000 (16:30 +0800)
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
arch/blackfin/cpu/initcode.c

index 4b10b6c6b2f971ac1c4e1458c25bacbdba78cc88..8ef0b92c238c580efefa04749333d4bf4b3163a7 100644 (file)
@@ -715,8 +715,8 @@ update_serial_clocks(ADI_BOOT_DATA *bs, uint sdivB, uint divB, uint vcoB)
         * for dividing which means we'd generate a libgcc reference.
         */
        unsigned int sdivR, vcoR;
-       unsigned int dividend = sdivB * divB * vcoR;
-       unsigned int divisor = vcoB * sdivR;
+       unsigned int dividend;
+       unsigned int divisor;
        unsigned int quotient;
 
        serial_putc('a');
@@ -729,6 +729,9 @@ update_serial_clocks(ADI_BOOT_DATA *bs, uint sdivB, uint divB, uint vcoB)
        sdivR = bfin_read_PLL_DIV() & 0xf;
        vcoR = (bfin_read_PLL_CTL() >> 9) & 0x3f;
 #endif
+
+       dividend = sdivB * divB * vcoR;
+       divisor = vcoB * sdivR;
        quotient = early_division(dividend, divisor);
        serial_early_put_div(quotient - ANOMALY_05000230);
        serial_putc('c');