1. 02 1月, 2017 1 次提交
  2. 06 11月, 2016 1 次提交
    • J
      clk: rockchip: Ignore frac divisor for PLL equivalence when it's unused · bf92384b
      Julius Werner 提交于
      Rockchip RK3399 PLLs can be used in two separate modes: integral and
      fractional. We can select between these two modes with the unambiguously
      named DSMPD bit.
      
      During boot, we check all PLL settings to confirm that they match our
      PLL table for that frequency, and reinitialize the PLLs where they
      don't. The settings checked for this include the fractional divider
      field that is only used in fractional mode, even if we're in integral
      mode (DSMPD = 1) and that field has no effect.
      
      This patch changes the check to only compare the fractional divider if
      we're actually in fractional mode. This way, we won't reinitialize the
      PLL in cases where there's absolutely no reason for that, which may
      avoid glitching child clocks that should better not be glitched (e.g.
      PWM regulators).
      Signed-off-by: NJulius Werner <jwerner@chromium.org>
      
      [cloned the fix to the pretty similar rk3036 pll]
      Signed-off-by: NHeiko Stuebner <heiko@sntech.de>
      bf92384b
  3. 08 8月, 2016 1 次提交
  4. 09 5月, 2016 2 次提交
    • H
      clk: rockchip: drop old_rate calculation on pll rate changes · 7e5385dc
      Heiko Stuebner 提交于
      Previously when everything happened in the set_rate callbacks itself we
      needed the old_rate value for the possible rate rollback, so that made
      it easy to also use it in the debug output.
      
      Now with the param-handling being done in separate functions, reading and
      recalculating the current pll rate only to use it in a debug message that
      won't get displayed in regular cases anyway is quite a waste.
      
      Therefore drop that value from the debug output. In the worst case that
      previous rate will have been displayed on the rate change before.
      Signed-off-by: NHeiko Stuebner <heiko@sntech.de>
      7e5385dc
    • H
      clk: rockchip: simplify GRF handling in pll clocks · c9c3c6ee
      Heiko Stuebner 提交于
      With the previous commit, the clock drivers now know at init time if the
      GRF regmap is available. That means if it isn't available then, it also
      won't become available later and we can therefore switch PLLs, that need
      the GRF for the lock-status, to read-only mode - similar behaviour as the
      aborting of rate changes we did before.
      
      This saves some conditionals on every rate change and we can also drop
      the rockchip_clk_get_grf function completely.
      Signed-off-by: NHeiko Stuebner <heiko@sntech.de>
      c9c3c6ee
  5. 25 4月, 2016 1 次提交
  6. 27 3月, 2016 2 次提交
  7. 16 2月, 2016 1 次提交
  8. 24 11月, 2015 1 次提交
  9. 02 10月, 2015 1 次提交
  10. 25 8月, 2015 2 次提交
    • H
      clk: rockchip: register pll mux before pll itself · 10897370
      Heiko Stuebner 提交于
      The structure is xin24m -> pll -> pll-mux (xin24m,pll,xin32k). The pll
      does have an init callback to make sure the boot-selected frequency is
      using the expected pll settings and resets the same frequency using
      the values provided in the driver if necessary.
      
      The setting itself also involves remuxing the pll-mux temporarily to
      the xin24m source to let the new pll rate settle. Until now this worked
      flawlessly, even when it had the flaw of accessing the mux settings
      before the mux actually got registered.
      
      With the recent clock-core conversions this flaw became apparent in
      null pointer dereference in
      [<c03fc400>] (clk_hw_get_num_parents) from [<c0400df0>] (clk_mux_get_parent+0x14/0xc8)
      [<c0400ddc>] (clk_mux_get_parent) from [<c040246c>] (rockchip_rk3066_pll_set_rate+0xd8/0x320)
      
      So to fix that, simply register the pll-mux before the pll, so that
      it will be fully initialized when the pll clock executes its init-
      callback and possibly touches the pll-mux clock.
      Signed-off-by: NHeiko Stuebner <heiko@sntech.de>
      Signed-off-by: NMichael Turquette <mturquette@baylibre.com>
      10897370
    • S
      clk: rockchip: Convert to clk_hw based provider APIs · 4c348750
      Stephen Boyd 提交于
      We're removing struct clk from the clk provider API, so switch
      this code to using the clk_hw based provider APIs.
      Reviewed-by: NHeiko Stuebner <heiko@sntech.de>
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      4c348750
  11. 29 7月, 2015 1 次提交
    • D
      clk: rockchip: Fix PLL bandwidth · 2bbfe001
      Douglas Anderson 提交于
      In the TRM we see that BWADJ is "a 12-bit bus that selects the values
      1-4096 for the bandwidth divider (NB)":
       NB = BWADJ[11:0] + 1
      The recommended setting of NB: NB = NF / 2.
      
      So:
        NB = NF / 2
        BWADJ[11:0] + 1 = NF / 2
        BWADJ[11:0] = NF / 2 - 1
      
      Right now, we have:
      
      {                                               \
              .rate   = _rate##U,                     \
              .nr = _nr,                              \
              .nf = _nf,                              \
              .no = _no,                              \
              .bwadj = (_nf >> 1),                    \
      }
      
      That means we set bwadj to NF / 2, not NF / 2 - 1
      
      All of this is a bit confusing because we specify "NR" (the 1-based
      value), "NF" (the 1-based value), "NO" (the 1-based value), but
      "BWADJ" (the 0-based value) instead of "NB" (the 1-based value).
      
      Let's change to working with "NB" and fix the off by one error.  This
      may affect PLL jitter in a small way (hopefully for the better).
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Reviewed-by: NHeiko Stuebner <heiko@sntech.de>
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      2bbfe001
  12. 21 7月, 2015 1 次提交
  13. 05 6月, 2015 1 次提交
  14. 25 11月, 2014 3 次提交
  15. 27 9月, 2014 1 次提交
    • D
      clk: rockchip: change pll rate without a clk-notifier · 9c030ea7
      Doug Anderson 提交于
      The Rockchip PLL code switches into slow mode (AKA bypass more AKA
      24MHz mode) before actually changing the PLL.  This keeps anyone from
      using the PLL while it's changing.  However, in all known Rockchip
      SoCs nobody should ever see the 24MHz when changing the PLL supplying
      the armclk because we should reparent children to an alternate
      (faster than 24MHz) PLL.
      
      One problem is that the code to switch to an alternate parent was
      running in PRE_RATE_CHANGE.  ...and the code to switch to slow mode
      was _also_ running in PRE_RATE_CHANGE.  That meant there was no real
      guarantee that we would switch to an alternate parent before switching
      to 24MHz mode.
      
      Let's move the switch to "slow mode" straight into
      rockchip_rk3066_pll_set_rate().  That means we're guaranteed that the
      24MHz is really a last-resort.
      
      Note that without this change on real systems we were the code to
      switch to an alternate parent at 24MHz.  In some older versions of
      that code we'd appy a (temporary) / 5 to the 24MHz causing us to run
      at 4.8MHz.  That wasn't enough to service USB interrupts in some cases
      and could lead to a system hang.
      Signed-off-by: NDoug Anderson <dianders@chromium.org>
      Signed-off-by: NHeiko Stuebner <heiko@sntech.de>
      9c030ea7
  16. 14 7月, 2014 1 次提交