1. 22 12月, 2015 3 次提交
  2. 26 10月, 2015 2 次提交
    • D
      mmc: core: Add mmc_regulator_set_vqmmc() · 2086f801
      Douglas Anderson 提交于
      This adds logic to the MMC core to set VQMMC.  This is expected to be
      called by MMC drivers like dw_mmc as part of (or instead of) their
      start_signal_voltage_switch() callback.
      
      A few notes:
      
      * When setting the signal voltage to 3.3V we do our best to make VQMMC
        and VMMC match.  It's been reported that this makes some old cards
        happy since they were tested back in the day before UHS when VQMMC
        and VMMC were provided by the same regulator.  A nice side effect of
        this is that we don't end up on the hairy edge of VQMMC (2.7V),
        which some EEs claim is a little too close to the minimum for
        comfort.
        This is done in two steps. At first we try to find a VQMMC within
        a 0.3V tolerance of VMMC and if this is not supported by the
        supplying regulator we try to find a suitable voltage within the
        whole 2.7V-3.6V area of the spec.
      
      * The two step approach is currently necessary, as the used
        regulator_set_voltage_triplet(min, target, max) uses a simple
        implementation that just tries two basic steps:
      	regulator_set_voltage(target, max);
      	regulator_set_voltage(min, target);
        So with only one step with 2.7-3.6V borders, if a suitable voltage
        is a bit below VMMC, we would directly get the lowest 2.7V
        which some boards (like Rockchips) don't like at all.
      
      * When setting the signal voltage to 1.8V or 1.2V we aim for that
        specific voltage instead of picking the lowest one in the range.
      
      * We very purposely don't print errors in mmc_regulator_set_vqmmc().
        There are cases where the MMC core will try several different
        voltages and we don't want to pollute the logs.
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Signed-off-by: NHeiko Stuebner <heiko@sntech.de>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      2086f801
    • U
      mmc: core: Remove MMC_CLKGATE · 9eadcc05
      Ulf Hansson 提交于
      MMC_CLKGATE was once invented to save power by gating the bus clock at
      request inactivity. At that time it served its purpose. The modern way to
      deal with power saving for these scenarios, is by using runtime PM.
      
      Nowadays, several host drivers have deployed runtime PM, but for those
      that haven't and which still cares power saving at request inactivity,
      it's certainly time to deploy runtime PM as it has been around for several
      years now.
      
      To simplify code to mmc core and thus decrease maintenance efforts, this
      patch removes all code related to MMC_CLKGATE.
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Reviewed-by: NLinus Walleij <linus.walleij@linaro.org>
      9eadcc05
  3. 17 8月, 2015 1 次提交
  4. 01 6月, 2015 4 次提交
    • A
      mmc: core: Add 'card' to drive strength selection callback · f168359e
      Adrian Hunter 提交于
      In preparation for supporting also eMMC drive strength,
      add the 'card' as a parameter so that the callback can
      distinguish different types of cards if necessary.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      f168359e
    • A
      mmc: core: Allow card drive strength to be different to host · b4f30a17
      Adrian Hunter 提交于
      Initialization of UHS-I modes for SD and SDIO cards
      employs a callback to allow the host driver to
      choose a drive strength value. Currently that
      assumes the card drive strength and host driver
      type must be the same value. Change to let the
      callback make that decision and return both the
      card drive strength and host driver type.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      b4f30a17
    • L
      mmc: Add support for disabling write-protect detection · 9f6e0bff
      Lars-Peter Clausen 提交于
      It is not uncommon to see systems where there is no physical write-protect
      signal (e.g. when using eMMC or microSD card slots). For some controllers,
      which have a dedicated write-protection detection logic (like SDHCI
      controllers), the get_ro() callback can return bogus data in such a case.
      
      Instead of handling this on a per controller basis this patch adds a new
      capability flag to the MMC core that can be set to specify that the result
      of get_ro() is invalid. When the flag is set the core will not call
      get_ro() and assume that the card is always read-write.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      9f6e0bff
    • A
      mmc: host: Add facility to support re-tuning · dfa13ebb
      Adrian Hunter 提交于
      Currently, there is core support for tuning during
      initialization. There can also be a need to re-tune
      periodically (e.g. sdhci) or to re-tune after the
      host controller is powered off (e.g. after PM
      runtime suspend / resume) or to re-tune in response
      to CRC errors.
      
      The main requirements for re-tuning are:
        - ability to enable / disable re-tuning
        - ability to flag that re-tuning is needed
        - ability to re-tune before any request
        - ability to hold off re-tuning if the card is busy
        - ability to hold off re-tuning if re-tuning is in
        progress
        - ability to run a re-tuning timer
      
      To support those requirements 7 members are added to struct
      mmc_host:
      
        unsigned int		can_retune:1;	/* re-tuning can be used */
        unsigned int		doing_retune:1;	/* re-tuning in progress */
        unsigned int		retune_now:1;   /* do re-tuning at next req */
        int			need_retune;	/* re-tuning is needed */
        int			hold_retune;	/* hold off re-tuning */
        unsigned int		retune_period;  /* re-tuning period in secs */
        struct timer_list	retune_timer;	/* for periodic re-tuning */
      
      need_retune is an integer so it can be set without needing
      synchronization. hold_retune is a integer to allow nesting.
      
      Various simple functions are provided to set / clear those
      variables.
      
      Subsequent patches take those functions into use.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      dfa13ebb
  5. 27 3月, 2015 1 次提交
  6. 28 1月, 2015 1 次提交
    • U
      mmc: core: Initial support for MMC power sequences · 3aa8793f
      Ulf Hansson 提交于
      System on chip designs may specify a specific MMC power sequence. To
      successfully detect an (e)MMC/SD/SDIO card, that power sequence must
      be followed while initializing the card.
      
      To be able to handle these SOC specific power sequences, let's add a
      MMC power sequence interface. It provides the following functions to
      help the mmc core to deal with these power sequences.
      
      mmc_pwrseq_alloc() - Invoked from mmc_of_parse(), to initialize data.
      mmc_pwrseq_pre_power_on()- Invoked in the beginning of mmc_power_up().
      mmc_pwrseq_post_power_on()- Invoked at the end in mmc_power_up().
      mmc_pwrseq_power_off()- Invoked from mmc_power_off().
      mmc_pwrseq_free() - Invoked from mmc_free_host(), to free data.
      
      Each MMC power sequence provider will be responsible to implement a set
      of callbacks. These callbacks mirrors the functions above.
      
      This patch adds the skeleton, following patches will extend the core of
      the MMC power sequence and add support for a specific simple MMC power
      sequence.
      
      Do note, since the mmc_pwrseq_alloc() is invoked from mmc_of_parse(),
      host drivers needs to make use of this API to enable the support for
      MMC power sequences. Moreover the MMC power sequence support depends on
      CONFIG_OF.
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Tested-by: NJavier Martinez Canillas <javier.martinez@collabora.co.uk>
      Reviewed-by: NJavier Martinez Canillas <javier.martinez@collabora.co.uk>
      3aa8793f
  7. 19 1月, 2015 1 次提交
  8. 26 11月, 2014 1 次提交
  9. 24 9月, 2014 1 次提交
  10. 09 9月, 2014 3 次提交
  11. 22 5月, 2014 1 次提交
  12. 13 5月, 2014 4 次提交
  13. 22 4月, 2014 1 次提交
  14. 21 4月, 2014 1 次提交
  15. 23 2月, 2014 1 次提交
    • U
      mmc: core: Rename max_discard_to to max_busy_timeout · 68eb80e0
      Ulf Hansson 提交于
      Rename host->max_discard_to to host->max_busy_timeout, to reflect that
      it tells the mmc core layer about the maximum supported busy detection
      timeout by the host.
      
      This timeout is at the moment only applicable to erase/trim/discard
      commands. By the renaming we provide the option of make use of it for
      other commands that cares about busy detection. In other words, those
      commands that wants an R1B response, like for example the mmc switch
      command.
      
      Do note that the max_busy_timeout is supposed to be specified only by
      hosts supporting MMC_CAP_WAIT_WHILE_BUSY.
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NChris Ball <chris@printf.net>
      68eb80e0
  16. 14 2月, 2014 6 次提交
  17. 31 10月, 2013 3 次提交
  18. 28 6月, 2013 1 次提交
    • U
      mmc: core: Invent MMC_CAP2_FULL_PWR_CYCLE · 53275c21
      Ulf Hansson 提交于
      MMC_CAP2_FULL_PWR_CYCLE shall be set by host drivers which are able to
      do a complete power cycle of the card. In the eMMC case that includes
      both vcc and vccq.
      
      This CAP is providing the protocol layer with important information,
      needed to take optimized decisions during card initialization and in
      the suspend/resume sequence.
      
      MMC_CAP2_POWEROFF_NOTIFY is replaced by MMC_CAP2_FULL_PWR_CYCLE, since
      it makes sense to use a wider scope for it.
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NChris Ball <cjb@laptop.org>
      53275c21
  19. 27 6月, 2013 1 次提交
  20. 27 5月, 2013 3 次提交
    • U
      mmc: core: Restructure and simplify code for mmc sleep|awake · 07a68216
      Ulf Hansson 提交于
      The mmc_card_sleep|awake APIs are not being used since the support is
      already properly encapsulated within the suspend sequence. Sleep|awake
      command is also specific for eMMC.
      
      We remove the sleep|awake bus_ops, the mmc_card_sleep|awake APIs and
      move the code into the mmc specific core instead. This also includes
      the mmc ops function, mmc_sleepawake. All releated functions have then
      become static and we have got far less code to maintain.
      
      Additionally this patch also simplifies the code from mmc_sleepawake,
      since it is only used to put the card to sleep and not awake.
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NChris Ball <cjb@laptop.org>
      07a68216
    • U
      mmc: core: Support aggressive power management for (e)MMC/SD · c4d770d7
      Ulf Hansson 提交于
      Aggressive power management is suitable when saving power is
      essential. At request inactivity timeout, aka pm runtime
      autosuspend timeout, the card will be suspended.
      
      Once a new request arrives, the card will be re-initalized and
      thus the first request will suffer from a latency. This latency
      is card-specific, experiments has shown in general that SD-cards
      has quite poor initialization time, around 300ms-1100ms. eMMC is
      not surprisingly far better but still a couple of hundreds of ms
      has been observed.
      
      Except for the request latency, it is important to know that
      suspending the card will also prevent the card from executing
      internal house-keeping operations in idle mode. This could mean
      degradation in performance.
      
      To use this feature make sure the request inactivity timeout is
      chosen carefully. This has not been done as a part of this patch.
      
      Enable this feature by using host cap MMC_CAP_AGGRESSIVE_PM and
      by setting CONFIG_MMC_UNSAFE_RESUME.
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NChris Ball <cjb@laptop.org>
      c4d770d7
    • M
      mmc: card: Adding support for sanitize in eMMC 4.5 · 775a9362
      Maya Erez 提交于
      The sanitize support is added as a user-app ioctl call, and
      was removed from the block-device request, since its purpose is
      to be invoked not via File-System but by a user.
      
      This feature deletes the unmap memory region of the eMMC card,
      by writing to a specific register in the EXT_CSD.
      
      unmap region is the memory region that was previously deleted
      (by erase, trim or discard operation).
      
      In order to avoid timeout when sanitizing large-scale cards,
      the timeout for sanitize operation is 240 seconds.
      Signed-off-by: NYaniv Gardi <ygardi@codeaurora.org>
      Signed-off-by: NMaya Erez <merez@codeaurora.org>
      Signed-off-by: NChris Ball <cjb@laptop.org>
      775a9362