1. 26 10月, 2015 1 次提交
    • D
      clk: rockchip: Allow more precision for some mmc clock phases · f0232063
      Douglas Anderson 提交于
      Because of the inexact nature of the extra MMC delay elements (it's
      not possible to keep the phase monotonic and to also make phases (mod
      90) > 70), we previously only allowed phases (mod 90) of 22.5, 45,
      and 67.5.
      
      But it's not the end of the world if the MMC clock phase goes
      non-monotonic.  At most we'll be 25 degrees off.  It's way better to
      test more phases to look for bad ones than to be 25 degrees off, because
      in the case of MMC really the point is to find bad phases and get as far
      asway from the as possible.  If we get to test extra phases by going
      slightly non-monotonic then that might be fine.  Worst case we would
      end up at a phases that's slight differnt than the one we wanted, but
      at least we'd still be quite far away from the a bad phase.
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Fold in more precise variance-values of 44-77 instead of 40-80.
      Fold in the actual removal of the monotonic requirement and adapt
      patch message accordingly.
      Signed-off-by: NHeiko Stuebner <heiko@sntech.de>
      Acked-by: NStephen Boyd <sboyd@codeaurora.org>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      f0232063
  2. 15 9月, 2015 1 次提交
  3. 11 9月, 2015 3 次提交
  4. 25 8月, 2015 3 次提交
    • 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: Convert __clk_get_name(hw->clk) to clk_hw_get_name(hw) · 836ee0f7
      Stephen Boyd 提交于
      Use the provider based method to get a clock's name so that we
      can get rid of the clk member in struct clk_hw one day. Mostly
      converted with the following coccinelle script.
      
      @@
      struct clk_hw *E;
      @@
      
      -__clk_get_name(E->clk)
      +clk_hw_get_name(E)
      Acked-by: NHeiko Stuebner <heiko@sntech.de>
      Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
      Cc: Tomasz Figa <tomasz.figa@gmail.com>
      Cc: Peter De Schrijver <pdeschrijver@nvidia.com>
      Cc: Prashant Gaikwad <pgaikwad@nvidia.com>
      Cc: Stephen Warren <swarren@wwwdotorg.org>
      Acked-by: NThierry Reding <treding@nvidia.com>
      Cc: Thierry Reding <thierry.reding@gmail.com>
      Cc: Alexandre Courbot <gnurou@gmail.com>
      Cc: Tero Kristo <t-kristo@ti.com>
      Cc: Ulf Hansson <ulf.hansson@linaro.org>
      Acked-by: NSebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
      Acked-by: NAndrew Bresticker <abrestic@chromium.org>
      Cc: Ezequiel Garcia <ezequiel.garcia@imgtec.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Kevin Cernekee <cernekee@chromium.org>
      Acked-by: NGeert Uytterhoeven <geert+renesas@glider.be>
      Cc: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-rockchip@lists.infradead.org
      Cc: linux-samsung-soc@vger.kernel.org
      Cc: linux-tegra@vger.kernel.org
      Cc: linux-omap@vger.kernel.org
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      836ee0f7
    • 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
  5. 13 8月, 2015 1 次提交
  6. 12 8月, 2015 1 次提交
  7. 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
  8. 21 7月, 2015 1 次提交
  9. 07 7月, 2015 8 次提交
  10. 05 6月, 2015 1 次提交
  11. 06 5月, 2015 1 次提交
  12. 13 4月, 2015 1 次提交
  13. 22 1月, 2015 3 次提交
  14. 18 1月, 2015 1 次提交
  15. 01 1月, 2015 1 次提交
  16. 31 12月, 2014 1 次提交
    • D
      clk: rockchip: rk3288: Make s2r reliable by switching PLLs to slow mode · a7d95000
      Doug Anderson 提交于
      We've been seeing some crashes at resume time on rk3288-based systems.
      On some machines they simply never wake up from suspend.  Symptoms
      include:
      
      - System clearly got to sleep OK.  Power consumption is low, the PWM
        for the PWM regulator has stopped, and the "global_pwroff" output
        shows that the system is down.
      
      - When system tries to wake up power consumption goes up.
      
      - No kernel resume code (which was left in PMU SRAM) ran.  We added
        some basic logging to this code (write to a location in SRAM right
        at resume time) and didn't see the logging run.
      
      It appears that we can fix the problem by slowing down APLL before we
      suspend.  On the system I tested things seemed reliable if I disabled
      1.8GHz and 1.7GHz.  The Mask ROM itself tries to slow things down
      (which is why PLLs are in slow mode by the time we get to the kernel),
      but apparently it is crashing before it even gets there.
      
      We'll be super paranoid and not just go down to 1.6GHz but we'll match
      what the Mask ROM seems to be doing and go into slow mode.  We'll also
      be safe and put all PLLs (not just APLL) into slow mode (well, except
      DPLL which is needed for SDRAM).  We'll even put NPLL into slow mode
      which the Mask ROM didn't do (not that it's used for much important
      stuff at early resume time).
      
      Note that the old Rockchip reference code did something just like
      this, though they jammed it into pm.c instead of putting it in the
      syscore ops of the clock driver.
      Signed-off-by: NDoug Anderson <dianders@chromium.org>
      Signed-off-by: NHeiko Stuebner <heiko@sntech.de>
      a7d95000
  17. 29 12月, 2014 2 次提交
    • H
      clk: rockchip: fix rk3288 cpuclk core dividers · 9880d427
      Heiko Stuebner 提交于
      Commit 0e5bdb3f (clk: rockchip: switch to using the new cpuclk type
      for armclk) didn't take into account that the divider used on rk3288
      are of the (n+1) type.
      
      The rk3066 and rk3188 socs use more complex divider types making it
      necessary for the list-elements to be the real register-values to write.
      
      Therefore reduce divider values in the table accordingly so that they
      really are the values that should be written to the registers and match
      the dividers actually specified for the rk3288.
      Reported-by: NSonny Rao <sonnyrao@chromium.org>
      Fixes: 0e5bdb3f ("clk: rockchip: switch to using the new cpuclk type for armclk")
      Signed-off-by: NHeiko Stuebner <heiko@sntech.de>
      Reviewed-by: NDoug Anderson <dianders@chromium.org>
      Cc: stable@vger.kernel.org
      9880d427
    • H
      clk: rockchip: fix rk3066 pll lock bit location · 12551f02
      Heiko Stuebner 提交于
      The bit locations indicating the locking status of the plls on rk3066 are
      shifted by one to the right when compared to the rk3188, bits [7:4] instead
      of [8:5] on the rk3188, thus indicating the locking state of the wrong pll
      or a completely different information in case of the gpll.
      
      The recently introduced pll init code exposed that problem on some rk3066
      boards when it tried to bring the boot-pll value in line with the value
      from the rate table.
      
      Fix this by defining separate pll definitions for rk3066 with the correct
      locking indices.
      Signed-off-by: NHeiko Stuebner <heiko@sntech.de>
      Fixes: 2c14736c ("clk: rockchip: add clock driver for rk3188 and rk3066 clocks")
      Tested-by: NFUKAUMI Naoki <naobsd@gmail.com>
      Cc: stable@vger.kernel.org
      12551f02
  18. 21 12月, 2014 3 次提交
  19. 28 11月, 2014 2 次提交
  20. 27 11月, 2014 1 次提交
  21. 25 11月, 2014 3 次提交