1. 25 7月, 2016 5 次提交
    • D
      mmc: sdhci-of-arasan: Revert: Always power the PHY off/on when clock changes · 6fc09244
      Douglas Anderson 提交于
      This reverts commit 4ac0d5f245e1 ("mmc: sdhci-of-arasan: Always power
      the PHY off/on when clock changes"), resolving conflicts with other
      patches that have come after.  It appears that on some boards / with
      some eMMC devices that the patch is causing problems.
      
      Presumably turning the phy off and on again at the wrong time while
      initially setting up the card is confusing the card, the host, or the
      PHY.  We have lots of power cycles while initially setting up the card
      because the main sdhci driver often turns off the clock by clearing
      SDHCI_CLOCK_CARD_EN and then calls host->ops->set_clock() to set the
      clock again.  With all of those, we ended up with lots of power cycles.
      
      Presumably the arguments made in the original patch still hold.  That
      is, whenever the card clock is turned off and on again (or changed) we
      really should wait for the DLL to lock again.  However, perhaps it's
      really not that critical for the lower speeds.
      
      It's possible that the right answer here is:
      * Whenever set_clock() is called we should double-check that the DLL is
        locked.
      * Whenever set_clock() is called and we're actually changing clocks we
        should do a power cycle around that.
      * When we're doing a power cycle just because the clock changed, we
        probably shouldn't do quite as many things (maybe don't need to
        recalibarate, etc).
      
      Unfortunately the interaction between SDHCI and the PHY is extremely
      limited because of the limited PHY API.  The PHY does have a reference
      to the card clock and could theoretically register for notifications,
      except that our clock is query only (it uses CLK_GET_RATE_NOCACHE) and
      so can't really be notified about updates.  I believe we would need a
      major redesign of clock handling in SDHCI core to do better than that,
      or we would need to make our one fake notifications.  :(
      
      Let's hope that we can eventually get more information from Arasan on
      how all this should be handled before doing tons more work.  Until then,
      let's get back to a known working state.  Note that the rest of the
      patches in the 150 MHz series should still work fine even without this
      one.
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Acked-by: NAdrian Hunter <adrian.hunter@intel.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      6fc09244
    • D
      mmc: sdhci-of-arasan: Add ability to export card clock · c390f211
      Douglas Anderson 提交于
      Some SD/eMMC PHYs (like the PHY from Arasan that is designed to work
      with arasan,sdhci-5.1) need to know the card clock in order to function
      properly.  Let's add the ability to expose this clock.  Any PHY that
      needs to know the clock rate can add a reference and query the clock
      rate.
      
      At the moment we register a CLK_GET_RATE_NOCACHE clock that simply
      allows querying the clock.  This allows us to be less intrusive with
      regards to the main SDHCI driver, which has complex logic for adjusting
      the SD clock.  Right now we always fully power cycle the PHY when the
      clock changes and that gives the PHY a good chance to query our clock.
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Reviewed-by: NHeiko Stuebner <heiko@sntech.de>
      Tested-by: NHeiko Stuebner <heiko@sntech.de>
      Acked-by: NAdrian Hunter <adrian.hunter@intel.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      c390f211
    • D
      mmc: sdhci-of-arasan: Properly set corecfg_baseclkfreq on rk3399 · 3ea4666e
      Douglas Anderson 提交于
      In the the earlier change in this series ("Documentation: mmc:
      sdhci-of-arasan: Add soc-ctl-syscon for corecfg regs") we can see the
      mechansim for specifying a syscon to properly set corecfg registers in
      sdhci-of-arasan.  Now let's use this mechanism to properly set
      corecfg_baseclkfreq on rk3399.
      
      >From [1] the corecfg_baseclkfreq is supposed to be set to:
        Base Clock Frequency for SD Clock.
        This is the frequency of the xin_clk.
      
      This is a relatively easy thing to do.  Note that we assume that xin_clk
      is not dynamic and we can check the clock at probe time.  If any real
      devices have a dynamic xin_clk future patches could register for
      notifiers for the clock.
      
      At the moment, setting corecfg_baseclkfreq is only supported for rk3399
      since we need a specific map for each implementation.  The code is
      written in a generic way that should make this easy to extend to other
      SoCs.  Note that a specific compatible string for rk3399 is already in
      use and so we add that to the table to match rk3399.
      
      [1]: https://arasan.com/wp-content/media/eMMC-5-1-Total-Solution_Rev-1-3.pdfSigned-off-by: NDouglas Anderson <dianders@chromium.org>
      Reviewed-by: NHeiko Stuebner <heiko@sntech.de>
      Reviewed-by: NShawn Lin <shawn.lin@rock-chips.com>
      Tested-by: NHeiko Stuebner <heiko@sntech.de>
      Acked-by: NAdrian Hunter <adrian.hunter@intel.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      3ea4666e
    • D
      mmc: sdhci-of-arasan: Always power the PHY off/on when clock changes · ca572f46
      Douglas Anderson 提交于
      In commit 802ac39a ("mmc: sdhci-of-arasan: fix set_clock when a phy
      is supported") we added code to power the PHY off and on whenever the
      clock was changed but we avoided doing the power cycle code when the
      clock was low speed.  Let's now do it always.
      
      Although there may be other reasons for power cycling the PHY when the
      clock changes, one of the main reasons is that we need to give the DLL a
      chance to re-lock with the new clock.
      
      One of the things that the DLL is for is tuning the Receive Clock in
      HS200 mode and STRB in HS400 mode.  Thus it is clear that we should make
      sure we power cycle the PHY (and wait for the DLL to lock) when we know
      we'll be in one of these two speed modes.  That's what the original code
      did, though it used the clock rate rather than the speed mode.  However,
      even in speed modes other than HS200,/HS400 the DLL is used for
      something since it can be clearly observed that the PHY doesn't function
      properly if you leave the DLL off.
      
      Although it appears less important to power cycle the PHY and wait for
      the DLL to lock when not in HS200/HS400 modes (no bugs were reported),
      it still seems wise to let the locking always happen nevertheless.
      
      Note: as part of this, we make sure that we never try to turn the PHY on
      when the clock is off (when the clock rate is 0).  The PHY cannot work
      when the clock is off since its DLL can't lock.
      
      This change requires ("phy: rockchip-emmc: Increase lock time
      allowance") and will cause problems if picked without that change.
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Reviewed-by: NShawn Lin <shawn.lin@rock-chips.com>
      Tested-by: NHeiko Stuebner <heiko@sntech.de>
      Acked-by: NAdrian Hunter <adrian.hunter@intel.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      ca572f46
    • S
      mmc: sdhci-of-arasan: implement enhanced strobe callback · a05c8465
      Shawn Lin 提交于
      Currently sdhci-arasan 5.1 can support enhanced strobe function,
      and we now limit it just for "arasan,sdhci-5.1". Add
      mmc-hs400-enhanced-strobe in DT to enable the function if we're
      sure our controller can support it.
      Signed-off-by: NShawn Lin <shawn.lin@rock-chips.com>
      Acked-by: NAdrian Hunter <adrian.hunter@intel.com>
      Reviewed-by: NDoug Anderson <dianders@chromium.org>
      Tested-by: NDoug Anderson <dianders@chromium.org>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      a05c8465
  2. 04 5月, 2016 1 次提交
  3. 17 3月, 2016 3 次提交
  4. 29 2月, 2016 3 次提交
  5. 27 8月, 2015 1 次提交
  6. 17 8月, 2015 1 次提交
  7. 01 6月, 2015 1 次提交
  8. 08 4月, 2015 1 次提交
  9. 23 3月, 2015 1 次提交
  10. 10 11月, 2014 2 次提交
  11. 09 9月, 2014 1 次提交
  12. 22 5月, 2014 4 次提交
  13. 14 1月, 2014 1 次提交