1. 27 10月, 2011 2 次提交
  2. 26 5月, 2011 2 次提交
  3. 25 5月, 2011 9 次提交
    • P
      mmc: sdhci: add hooks for setting UHS in platform specific code · 6322cdd0
      Philip Rakity 提交于
      Allow platform specific code to set UHS registers if
      implementation requires speciial platform specific handling
      Signed-off-by: NPhilip Rakity <prakity@marvell.com>
      Reviewed-by: NArindam Nath <arindam.nath@amd.com>
      Signed-off-by: NChris Ball <cjb@laptop.org>
      6322cdd0
    • A
      mmc: sdhci: add support for retuning mode 1 · cf2b5eea
      Arindam Nath 提交于
      Host Controller v3.00 can support retuning modes 1,2 or 3 depending on
      the bits 46-47 of the Capabilities register. Also, the timer count for
      retuning is indicated by bits 40-43 of the same register. We initialize
      timer_list for retuning the first time we execute tuning procedure. This
      condition is indicated by SDHCI_NEEDS_RETUNING not being set. Since
      retuning mode 1 sets a limit of 4MB on the maximum data length, we set
      max_blk_count appropriately. Once the tuning timer expires, we set
      SDHCI_NEEDS_RETUNING flag, and if the flag is set, we execute tuning
      procedure before sending the next command. We need to restore mmc_request
      structure after executing retuning procedure since host->mrq is used
      inside the procedure to send CMD19. We also disable and re-enable this
      flag during suspend and resume respectively, as per the spec v3.00.
      
      Tested by Zhangfei Gao with a Toshiba uhs card and general hs card,
      on mmp2 in SDMA mode.
      Signed-off-by: NArindam Nath <arindam.nath@amd.com>
      Reviewed-by: NPhilip Rakity <prakity@marvell.com>
      Tested-by: NPhilip Rakity <prakity@marvell.com>
      Acked-by: NZhangfei Gao <zhangfei.gao@marvell.com>
      Signed-off-by: NChris Ball <cjb@laptop.org>
      cf2b5eea
    • A
      mmc: sdhci: add support for programmable clock mode · c3ed3877
      Arindam Nath 提交于
      Host Controller v3.00 supports programmable clock mode as an optional
      feature. The support for this mode is indicated by non-zero value in
      bits 48-55 of the Capabilities register. If supported, the actual
      value of Clock Multiplier is one more than the value provided in the
      bit fields. We only set Clock Generator Select (bit 5) and SDCLK
      Frequency Select (bits 8-15) of the Clock Control register in case
      Preset Value Enable is not set, otherwise these fields are automatically
      set by the Host Controller based on the UHS mode selected. Also, since
      the maximum and minimum clock frequency in this mode can be
      (Base Clock * Clock Mul) and (Base Clock * Clock Mul)/1024 respectively,
      f_max and f_min have been recalculated to reflect this change.
      
      Tested by Zhangfei Gao with a Toshiba uhs card and general hs card,
      on mmp2 in SDMA mode.
      Signed-off-by: NArindam Nath <arindam.nath@amd.com>
      Reviewed-by: NPhilip Rakity <prakity@marvell.com>
      Tested-by: NPhilip Rakity <prakity@marvell.com>
      Acked-by: NZhangfei Gao <zhangfei.gao@marvell.com>
      Signed-off-by: NChris Ball <cjb@laptop.org>
      c3ed3877
    • A
      mmc: sd: add support for tuning during uhs initialization · b513ea25
      Arindam Nath 提交于
      Host Controller needs tuning during initialization to operate SDR50
      and SDR104 UHS-I cards. Whether SDR50 mode actually needs tuning is
      indicated by bit 45 of the Host Controller Capabilities register.
      A new command CMD19 has been defined in the Physical Layer spec
      v3.01 to request the card to send tuning pattern.
      
      We enable Buffer Read Ready interrupt at the very begining of tuning
      procedure, because that is the only interrupt generated by the Host
      Controller during tuning. We program the block size to 64 in the
      Block Size register. We make sure that DMA Enable and Multi Block
      Select in the Transfer Mode register are set to 0 before actually
      sending CMD19. The tuning block is sent by the card to the Host
      Controller using DAT lines, so we set Data Present Select (bit 5) in
      the Command register. The Host Controller is responsible for doing
      the verfication of tuning block sent by the card at the hardware
      level. After sending CMD19, we wait for Buffer Read Ready interrupt.
      In case we don't receive an interrupt after the specified timeout
      value, we fall back on fixed sampling clock by setting Execute
      Tuning (bit 6) and Sampling Clock Select (bit 7) of Host Control2
      register to 0. Before exiting the tuning procedure, we disable Buffer
      Read Ready interrupt and re-enable other interrupts.
      
      Tested by Zhangfei Gao with a Toshiba uhs card and general hs card,
      on mmp2 in SDMA mode.
      Signed-off-by: NArindam Nath <arindam.nath@amd.com>
      Reviewed-by: NPhilip Rakity <prakity@marvell.com>
      Tested-by: NPhilip Rakity <prakity@marvell.com>
      Acked-by: NZhangfei Gao <zhangfei.gao@marvell.com>
      Signed-off-by: NChris Ball <cjb@laptop.org>
      b513ea25
    • A
      mmc: sd: add support for uhs bus speed mode selection · 49c468fc
      Arindam Nath 提交于
      This patch adds support for setting UHS-I bus speed mode during UHS-I
      initialization procedure. Since both the host and card can support
      more than one bus speed, we select the highest speed based on both of
      their capabilities. First we set the bus speed mode for the card using
      CMD6 mode 1, and then we program the host controller to support the
      required speed mode. We also set High Speed Enable in case one of the
      UHS-I modes is selected. We take care to reset SD clock before setting
      UHS mode in the Host Control2 register, and then re-enable it as per
      the Host Controller spec v3.00. We then set the clock frequency for
      the UHS-I mode selected.
      
      Tested by Zhangfei Gao with a Toshiba uhs card and general hs card,
      on mmp2 in SDMA mode.
      Signed-off-by: NArindam Nath <arindam.nath@amd.com>
      Reviewed-by: NPhilip Rakity <prakity@marvell.com>
      Tested-by: NPhilip Rakity <prakity@marvell.com>
      Acked-by: NZhangfei Gao <zhangfei.gao@marvell.com>
      Signed-off-by: NChris Ball <cjb@laptop.org>
      49c468fc
    • A
      mmc: sd: add support for driver type selection · d6d50a15
      Arindam Nath 提交于
      This patch adds support for setting driver strength during UHS-I
      initialization procedure. Since UHS-I cards set S18A (bit 24) in
      response to ACMD41, we use this as a base for UHS-I initialization.
      We modify the parameter list of mmc_sd_get_cid() so that we can
      save the ROCR from ACMD41 to check whether bit 24 is set.
      
      We decide whether the Host Controller supports A, C, or D driver
      type depending on the Capabilities register. Driver type B is
      suported by default. We then set the appropriate driver type for
      the card using CMD6 mode 1. As per Host Controller spec v3.00, we
      set driver type for the host only if Preset Value Enable in the
      Host Control2 register is not set. SDHCI_HOST_CONTROL has been
      renamed to SDHCI_HOST_CONTROL1 to conform to the spec.
      
      Tested by Zhangfei Gao with a Toshiba uhs card and general hs card,
      on mmp2 in SDMA mode.
      Signed-off-by: NArindam Nath <arindam.nath@amd.com>
      Reviewed-by: NPhilip Rakity <prakity@marvell.com>
      Tested-by: NPhilip Rakity <prakity@marvell.com>
      Acked-by: NZhangfei Gao <zhangfei.gao@marvell.com>
      Signed-off-by: NChris Ball <cjb@laptop.org>
      d6d50a15
    • A
      mmc: sd: add support for signal voltage switch procedure · f2119df6
      Arindam Nath 提交于
      Host Controller v3.00 adds another Capabilities register. Apart
      from other things, this new register indicates whether the Host
      Controller supports SDR50, SDR104, and DDR50 UHS-I modes. The spec
      doesn't mention about explicit support for SDR12 and SDR25 UHS-I
      modes, so the Host Controller v3.00 should support them by default.
      Also if the controller supports SDR104 mode, it will also support
      SDR50 mode as well. So depending on the host support, we set the
      corresponding MMC_CAP_* flags. One more new register. Host Control2
      is added in v3.00, which is used during Signal Voltage Switch
      procedure described below.
      
      Since as per v3.00 spec, UHS-I supported hosts should set S18R
      to 1, we set S18R (bit 24) of OCR before sending ACMD41. We also
      need to set XPC (bit 28) of OCR in case the host can supply >150mA.
      This support is indicated by the Maximum Current Capabilities
      register of the Host Controller.
      
      If the response of ACMD41 has both CCS and S18A set, we start the
      signal voltage switch procedure, which if successfull, will switch
      the card from 3.3V signalling to 1.8V signalling. Signal voltage
      switch procedure adds support for a new command CMD11 in the
      Physical Layer Spec v3.01. As part of this procedure, we need to
      set 1.8V Signalling Enable (bit 3) of Host Control2 register, which
      if remains set after 5ms, means the switch to 1.8V signalling is
      successfull. Otherwise, we clear bit 24 of OCR and retry the
      initialization sequence. When we remove the card, and insert the
      same or another card, we need to make sure that we start with 3.3V
      signalling voltage. So we call mmc_set_signal_voltage() with
      MMC_SIGNAL_VOLTAGE_330 set so that we are back to 3.3V signalling
      voltage before we actually start initializing the card.
      
      Tested by Zhangfei Gao with a Toshiba uhs card and general hs card,
      on mmp2 in SDMA mode.
      Signed-off-by: NArindam Nath <arindam.nath@amd.com>
      Reviewed-by: NPhilip Rakity <prakity@marvell.com>
      Tested-by: NPhilip Rakity <prakity@marvell.com>
      Acked-by: NZhangfei Gao <zhangfei.gao@marvell.com>
      Signed-off-by: NChris Ball <cjb@laptop.org>
      f2119df6
    • P
      mmc: sdhci: Add pre and post reset processing for chip specific reset · 393c1a34
      Philip Rakity 提交于
      Marvell pxa controllers have private registers that may need to be
      modified before and after a reset is done.
      
      For example, the SD reset operation, RESET_ALL, will reset the private
      registers to their default state.  This will cause the clock adjustment
      registers that may have been programmed to have incorrect values.
      
      RESET_DATA sometimes needs to be delayed before the reset is done
      (depending on SoC) to enable any transactions being handled by the
      SDIO card to be completed.  Needed in pre SD 3.0 silicon to handle
      clock gating.
      
      Implement hooks to allow this to happen.
      Signed-off-by: NPhilip Rakity <prakity@marvell.com>
      Signed-off-by: NChris Ball <cjb@laptop.org>
      393c1a34
    • M
      mmc: sdhci: work around broken dma boundary behavior · f6a03cbf
      Mikko Vinni 提交于
      Some SD host controllers (noticed on an integrated JMicron SD reader on an
      HP Pavilion dv5-1250eo laptop) don't update the dma address register before
      signaling a dma interrupt due to a dma boundary. Update the register
      manually to the next boundary (by default 512KiB), at which the transfer
      stopped.
      
      As long as each transfer is at most 512KiB in size (guaranteed by a BUG_ON
      in sdhci_prepare_data()) and the boundary is kept at the default value,
      this fix is needed at most once per transfer. Smaller boundaries are taken
      care of by counting the transferred bytes.
      
      Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=28462Signed-off-by: NMikko Vinni <mmvinni@yahoo.com>
      Signed-off-by: NChris Ball <cjb@laptop.org>
      f6a03cbf
  4. 25 3月, 2011 1 次提交
  5. 09 1月, 2011 2 次提交
  6. 23 11月, 2010 1 次提交
  7. 08 11月, 2010 1 次提交
  8. 23 10月, 2010 6 次提交
  9. 21 8月, 2010 1 次提交
  10. 11 8月, 2010 5 次提交
  11. 28 5月, 2010 4 次提交
  12. 18 12月, 2009 1 次提交
  13. 23 9月, 2009 2 次提交
  14. 30 7月, 2009 1 次提交
    • A
      sdhci: get rid of "frequency too high" flood when using eSDHC · a9e58f25
      Anton Vorontsov 提交于
      Since commit 8dfd0374 ("MMC core: limit
      minimum initialization frequency to 400kHz") MMC core checks for minimum
      frequency, and that causes following messages flood when using eSDHC
      controllers:
      
        ...
        mmc0: Minimum clock frequency too high for identification mode
        mmc0: Minimum clock frequency too high for identification mode
        ...
      
      The warnings are legitimate, since if we'd use 133 MHz clocks for standard
      SDHCI controllers, we'd not able to scale frequency down to 400 kHz.
      
      But eSDHC controllers have a non-standard SD clock management, so we can
      divide clock by 256 * 16, not just 256.
      
      This patch introduces get_min_clock() callback for sdhci core and
      implements it for sdhci-of driver, and thus fixes the issue.
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Cc: Matt Fleming <matt@console-pimps.org>
      Cc: Ian Molton <ian@mnementh.co.uk>
      Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com>
      Cc: Pierre Ossman <drzeus@drzeus.cx>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a9e58f25
  15. 22 6月, 2009 2 次提交