]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - arch/arm/cpu/arm926ejs/mxs/spl_power_init.c
mxs: spl: print the actual battery brownout level rather than the constant string...
[karo-tx-uboot.git] / arch / arm / cpu / arm926ejs / mxs / spl_power_init.c
index 3d26b8d1b37525c924f96d7dd8e1056be19baab6..e02ad7e8859a2a2f9c2d60657c2836484ff2dcc0 100644 (file)
@@ -114,19 +114,16 @@ static void mxs_power_clock2pll(void)
 
        debug("SPL: Switching CPU core clock source to PLL\n");
 
-       /*
-        * TODO: Are we really? It looks like we turn on PLL0, but we then
-        * set the CLKCTRL_CLKSEQ_BYPASS_CPU bit of the (which was already
-        * set by mxs_power_clock2xtal()). Clearing this bit here seems to
-        * introduce some instability (causing the CPU core to hang). Maybe
-        * we aren't giving PLL0 enough time to stabilise?
-        */
        writel(CLKCTRL_PLL0CTRL0_POWER,
                &clkctrl_regs->hw_clkctrl_pll0ctrl0_set);
-       udelay(100);
+       /*
+        * The PLL is documented to lock within 10 µs from setting
+        * the POWER bit.
+        */
+       udelay(15);
 
        /*
-        * TODO: Should the PLL0 FORCE_LOCK bit be set here followed be a
+        * TODO: Should the PLL0 FORCE_LOCK bit be set here followed by a
         * wait on the PLL0 LOCK bit?
         */
        writel(CLKCTRL_CLKSEQ_BYPASS_CPU,
@@ -896,7 +893,9 @@ static void mxs_fixed_batt_boot(void)
  */
 static void mxs_init_batt_bo(void)
 {
-       debug("SPL: Initialising battery brown-out level to 3.0V\n");
+       debug("SPL: Initialising battery brown-out level to %u.%uV\n",
+               (BATT_BO_VAL * 40 + 2400) / 1000,
+               (BATT_BO_VAL * 40 + 2400) / 100 % 10);
 
        /* Brownout at 3V */
        clrsetbits_le32(&power_regs->hw_power_battmonitor,