1. 08 8月, 2016 1 次提交
  2. 09 5月, 2016 2 次提交
    • 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
    • H
      clk: rockchip: lookup General Register Files in rockchip_clk_init · 6f339dc2
      Heiko Stuebner 提交于
      In the distant past syscons were initialized pretty late and weren't
      available at the time the clock init ran. As the GRF is mainly needed
      for PLL lock-status checking, we had this lazy init that tried to grab
      the syscon on PLL rate changes and denied these changes if it was not
      available.
      
      These days syscons are available very early and recent addition to
      rockchip clocks, like the PLL clk_init actually also rely on them
      being available at that time, so there is no need to keep that lazy
      init around, as it will also result in some more simplifications in
      other parts of the clock-code.
      Signed-off-by: NHeiko Stuebner <heiko@sntech.de>
      6f339dc2
  3. 20 4月, 2016 1 次提交
  4. 27 3月, 2016 2 次提交
  5. 04 2月, 2016 1 次提交
    • H
      clk: rockchip: add a factor clock type · 29a30c26
      Heiko Stuebner 提交于
      Add a clock type for fixed factor clocks. This allows us to define fixed
      factor clocks where they appear in the clock hierarchy instead of in the
      init function.
      
      The additional factor_gate type, finally allows us to model some last
      parts of the clock tree correctly.
      Signed-off-by: NHeiko Stuebner <heiko@sntech.de>
      29a30c26
  6. 03 2月, 2016 1 次提交
  7. 30 1月, 2016 1 次提交
    • H
      clk-divider: make sure read-only dividers do not write to their register · 50359819
      Heiko Stuebner 提交于
      Commit e6d5e7d9 ("clk-divider: Fix READ_ONLY when divider > 1") removed
      the special ops struct for read-only clocks and instead opted to handle
      them inside the regular ops.
      
      On the rk3368 this results in breakage as aclkm now gets set a value.
      While it is the same divider value, the A53 core still doesn't like it,
      which can result in the cpu ending up in a hang.
      The reason being that "ACLKENMasserts one clock cycle before the rising
      edge of ACLKM" and the clock should only be touched when STANDBYWFIL2
      is asserted.
      
      To fix this, reintroduce the read-only ops but do include the round_rate
      callback. That way no writes that may be unsafe are done to the divider
      register in any case.
      
      The Rockchip use of the clk_divider_ops is adapted to this split again,
      as is the nxp, lpc18xx-ccu driver that was included since the original
      commit. On lpc18xx-ccu the divider seems to always be read-only
      so only uses the new ops now.
      
      Fixes: e6d5e7d9 ("clk-divider: Fix READ_ONLY when divider > 1")
      Reported-by: NZhang Qing <zhangqing@rock-chips.com>
      Signed-off-by: NHeiko Stuebner <heiko@sntech.de>
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      50359819
  8. 24 12月, 2015 1 次提交
  9. 21 12月, 2015 1 次提交
    • H
      clk: rockchip: only enter pll slow-mode directly before reboots on rk3288 · dfff24bd
      Heiko Stuebner 提交于
      As commit 1d33929e ("clk: rockchip: switch PLLs to slow mode before
      reboot for rk3288") states, switching the PLLs to slow-mode is only
      necessary when rebooting using the soft-reset done through the CRU.
      
      The dwc2 controllers used create really big number of interrupts in
      special constellations involving usb-hubs and their number is so high,
      it can even overwhelm the interrupt handler if the cpu-speed os to low.
      
      Right now the PLLs are put into slow-mode in a shutdown syscore_ops
      callback which means it happens on all reboots (not only the soft-reset
      ones) and even on poweroff actions.
      
      This can result in the system not powering off and getting stuck instead,
      so we should move the slow-mode change nearer to the actual reboot action.
      
      For this we introduce the possiblity to also set a callback that gets
      called from the restart-handler directly prior to restarting the system
      and move the shutdown-callback to this new option.
      
      With this the slow-mode switch is done only on the necessary reboots
      and also has a smaller possibility of causing artifacts.
      
      Fixes: 1d33929e ("clk: rockchip: switch PLLs to slow mode before reboot for rk3288")
      Signed-off-by: NHeiko Stuebner <heiko.stuebner@collabora.com>
      Reviewed-by: NDouglas Anderson <dianders@chromium.org>
      dfff24bd
  10. 03 10月, 2015 1 次提交
  11. 07 7月, 2015 1 次提交
  12. 05 6月, 2015 1 次提交
  13. 13 4月, 2015 1 次提交
  14. 28 11月, 2014 1 次提交
    • A
      clk: rockchip: Add support for the mmc clock phases using the framework · 89bf26cb
      Alexandru M Stan 提交于
      This patch adds the 2 physical clocks for the mmc (drive and sample). They're
      mostly there for the phase properties, but they also show the true clock
      (by dividing by RK3288_MMC_CLKGEN_DIV).
      
      The drive and sample phases are generated by dividing an upstream parent clock
      by 2, this allows us to adjust the phase by 90 deg.
      
      There's also an option to have up to 255 delay elements (40-80 picoseconds long).
      This driver uses those elements (under the assumption that they're 60 ps long)
      to generate approximate 22.5 degrees options. 67.5 (22.5*3) might be as high as
      90 deg if the delay elements are as big as 80 ps, so a finer division (smaller
      than 22.5) was not picked because the phase might not be monotonic anymore.
      Suggested-by: NHeiko Stuebner <heiko@sntech.de>
      Signed-off-by: NAlexandru M Stan <amstan@chromium.org>
      Signed-off-by: NHeiko Stuebner <heiko@sntech.de>
      89bf26cb
  15. 25 11月, 2014 1 次提交
  16. 18 11月, 2014 1 次提交
    • J
      clk-divider: Fix READ_ONLY when divider > 1 · e6d5e7d9
      James Hogan 提交于
      Commit 79c6ab50 (clk: divider: add CLK_DIVIDER_READ_ONLY flag) in
      v3.16 introduced the CLK_DIVIDER_READ_ONLY flag which caused the
      recalc_rate() and round_rate() clock callbacks to be omitted.
      
      However using this flag has the unfortunate side effect of causing the
      clock recalculation code when a clock rate change is attempted to always
      treat it as a pass-through clock, i.e. with a fixed divide of 1, which
      may not be the case. Child clock rates are then recalculated using the
      wrong parent rate.
      
      Therefore instead of dropping the recalc_rate() and round_rate()
      callbacks, alter clk_divider_bestdiv() to always report the current
      divider as the best divider so that it is never altered.
      
      For me the read only clock was the system clock, which divided the PLL
      rate by 2, from which both the UART and the SPI clocks were divided.
      Initial setting of the UART rate set it correctly, but when the SPI
      clock was set, the other child clocks were miscalculated. The UART clock
      was recalculated using the PLL rate as the parent rate, resulting in a
      UART new_rate of double what it should be, and a UART which spewed forth
      garbage when the rate changes were propagated.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Thomas Abraham <thomas.ab@samsung.com>
      Cc: Tomasz Figa <t.figa@samsung.com>
      Cc: Max Schwarz <max.schwarz@online.de>
      Cc: <stable@vger.kernel.org> # v3.16+
      Acked-by: NHaojian Zhuang <haojian.zhuang@gmail.com>
      Signed-off-by: NMichael Turquette <mturquette@linaro.org>
      e6d5e7d9
  17. 05 11月, 2014 1 次提交
  18. 01 10月, 2014 1 次提交
  19. 27 9月, 2014 1 次提交
  20. 03 9月, 2014 3 次提交
  21. 14 7月, 2014 2 次提交