1. 29 11月, 2016 5 次提交
  2. 27 9月, 2016 4 次提交
    • W
      mmc: add define for R1 response without CRC · 51b50c96
      Wolfram Sang 提交于
      The core uses it for polling. Give drivers a proper define handle this
      case like for other response types.
      Signed-off-by: NWolfram Sang <wsa+renesas@sang-engineering.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      51b50c96
    • A
      mmc: core: Add support for sending commands during data transfer · 5163af5a
      Adrian Hunter 提交于
      A host controller driver exposes its capability using caps flag
      MMC_CAP_CMD_DURING_TFR. A driver with that capability can accept requests
      that are marked mrq->cap_cmd_during_tfr = true. Then the driver informs the
      upper layers when the command line is available for further commands by
      calling mmc_command_done(). Because of that, the driver will not then
      automatically send STOP commands, and it is the responsibility of the upper
      layer to send a STOP command if it is required.
      
      For requests submitted through the mmc_wait_for_req() interface, the caller
      sets mrq->cap_cmd_during_tfr = true which causes mmc_wait_for_req() in fact
      not to wait. The caller can then send commands that do not use the data
      lines. Finally the caller can wait for the transfer to complete by calling
      mmc_wait_for_req_done() which is now exported.
      
      For requests submitted through the mmc_start_req() interface, the caller
      again sets mrq->cap_cmd_during_tfr = true, but mmc_start_req() anyway does
      not wait. The caller can then send commands that do not use the data
      lines. Finally the caller can wait for the transfer to complete in the
      normal way i.e. calling mmc_start_req() again.
      
      Irrespective of how a cap_cmd_during_tfr request is started,
      mmc_is_req_done() can be called if the upper layer needs to determine if
      the request is done. However the appropriate waiting function (either
      mmc_wait_for_req_done() or mmc_start_req()) must still be called.
      
      The implementation consists primarily of a new completion
      mrq->cmd_completion which notifies when the command line is available for
      further commands. That completion is completed by mmc_command_done().
      When there is an ongoing data transfer, calls to mmc_wait_for_req() will
      automatically wait on that completion, so the caller does not have to do
      anything special.
      
      Note, in the case of errors, the driver may call mmc_request_done() without
      calling mmc_command_done() because mmc_request_done() always calls
      mmc_command_done().
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      5163af5a
    • G
      mmc: dw_mmc: add reset support to dwmmc host controller · d6786fef
      Guodong Xu 提交于
      Dwmmc host controller may in unknown state when entering kernel boot. One
      example is when booting from eMMC, bootloader need initialize MMC host
      controller into some state so it can read. In order to make sure MMC host
      controller in a clean initial state, this reset support is added.
      
      With this patch, a 'resets' property can be added into dw_mmc device
      tree node. The hardware logic is: dwmmc host controller IP receives a reset
      signal from a 'reset provider' (eg. power management unit). The 'resets'
      property points to this reset signal. So, during dwmmc driver probe,
      it can use this signal to reset itself.
      
      Refer to [1] for more information.
      
      [1] Documentation/devicetree/bindings/reset/reset.txt
      Signed-off-by: NGuodong Xu <guodong.xu@linaro.org>
      Signed-off-by: NXinwei Kong <kong.kongxinwei@hisilicon.com>
      Signed-off-by: NZhangfei Gao <zhangfei.gao@linaro.org>
      Reviewed-by: NShawn Lin <shawn.lin@rock-chips.com>
      Signed-off-by: NJaehoon Chung <jh80.chung@samsung.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      d6786fef
    • U
      mmc: sd: Export SD Status via “ssr” device attribute · 5275a652
      Uri Yanai 提交于
      The SD Status register contains several important fields related to the
      SD Card proprietary features.
      Those fields may be used by user space applications for vendor specific
      usage.
      None of those fields are exported today by the driver to user space.
      In this patch, we are reading the SD Status register and exporting
      (using MMC_DEV_ATTR) the SD Status register to the user space.
      Signed-off-by: NUri Yanai <uri.yanai@sandisk.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      5275a652
  3. 09 9月, 2016 1 次提交
  4. 25 7月, 2016 6 次提交
  5. 17 5月, 2016 1 次提交
    • A
      mmc: core: Add a facility to "pause" re-tuning · 7ff27609
      Adrian Hunter 提交于
      Re-tuning is not possible when switched to the RPMB
      partition.  However re-tuning should not be needed
      if re-tuning is done immediately before switching,
      a small set of operations is done, and then we
      immediately switch back to the main partition.
      
      To ensure that re-tuning can't be done for a short
      while, add a facility to "pause" re-tuning.
      
      The existing facility to hold / release re-tuning
      is used but it also flags re-tuning as needed to cause
      re-tuning before the next command (which will be the
      switch to RPMB).
      
      We also need to "unpause" in the recovery path, which
      is catered for by adding it to mmc_retune_disable().
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      7ff27609
  6. 12 5月, 2016 1 次提交
  7. 02 5月, 2016 6 次提交
  8. 29 2月, 2016 4 次提交
  9. 06 1月, 2016 1 次提交
  10. 22 12月, 2015 4 次提交
  11. 27 10月, 2015 1 次提交
    • C
      mmc: mmc: extend the mmc_send_tuning() · 9979dbe5
      Chaotian Jing 提交于
      The mmc_execute_tuning() has already prepared the opcode,
      there is no need to prepare it again at mmc_send_tuning(),
      and, there is a BUG of mmc_send_tuning() to determine the opcode
      by bus width, assume eMMC was running at HS200, 4bit mode,
      then the mmc_send_tuning() will overwrite the opcode from CMD21
      to CMD19, then got error.
      
      in addition, extend an argument of "cmd_error" to allow getting
      if there was cmd error when tune response.
      Signed-off-by: NChaotian Jing <chaotian.jing@mediatek.com>
      [Ulf: Rebased patch]
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      9979dbe5
  12. 26 10月, 2015 4 次提交
    • S
      mmc: dw_mmc: Add external dma interface support · 3fc7eaef
      Shawn Lin 提交于
      DesignWare MMC Controller can supports two types of DMA
      mode: external dma and internal dma. We get a RK312x platform
      integrated dw_mmc and ARM pl330 dma controller. This patch add
      edmac ops to support these platforms. I've tested it on RK31xx
      platform with edmac mode and RK3288 platform with idmac mode.
      Signed-off-by: NShawn Lin <shawn.lin@rock-chips.com>
      Signed-off-by: NJaehoon Chung <jh80.chung@samsung.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      3fc7eaef
    • 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
    • U
      mmc: core: Convert __mmc_switch() into an internal core function · f90d2e40
      Ulf Hansson 提交于
      As there are no users of the __mmc_switch() API, except for the mmc core
      itself, let's convert it from an exported function into an internal.
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      f90d2e40
  13. 27 8月, 2015 1 次提交
  14. 17 8月, 2015 1 次提交
    • A
      mmc: dw_mmc: add quirk for broken data transfer over scheme · 57e10486
      Addy Ke 提交于
      This patch add a new quirk to add a s/w timer to notify the driver
      to terminate current transfer and report a data timeout to the core,
      if DTO interrupt does NOT come within the given time.
      
      dw_mmc call mmc_request_done func to finish transfer depends on
      DTO interrupt. If DTO interrupt does not come in sending data state,
      the current transfer will be blocked.
      
      We got the reply from synopsys:
      There are two counters but both use the same value of [31:8] bits.
      Data timeout counter doesn't wait for stop clock and you should get
      DRTO even when the clock is not stopped.
      Host Starvation timeout counter is triggered with stop clock condition.
      
      This means that host should get DRTO and DTO interrupt.
      
      But this case really exists, when driver reads tuning data from
      card on RK3288-pink2 board. I measured waveforms by oscilloscope
      and found that card clock was always on and data lines were always
      holded high level in sending data state.
      
      There are two possibility that data over interrupt doesn't come in
      reading data state on RK3X SoCs:
      - get command done interrupt, but doesn't get any data-related interrupt.
      - get data error interrupt, but doesn't get data over interrupt.
      Signed-off-by: NAddy Ke <addy.ke@rock-chips.com>
      Signed-off-by: NHeiko Stuebner <heiko@sntech.de>
      Signed-off-by: NJaehoon Chung <jh80.chung@samsung.com>
      57e10486