1. 05 Jan, 2016 5 commits
  2. 28 Dec, 2015 7 commits
    • Lucas Stach's avatar
      mmc: tegra: implement UHS tuning · c3c2384c
      Lucas Stach authored
      This implements the UHS tuning sequence in a similar way to the one
      contained in the TRM. It deviates in the way how to check if the tap
      value is passing, by using the common Linux MMC function, which does
      not only check for data CRC errors, but also if the received block
      pattern is correct.
      Signed-off-by: default avatarLucas Stach <dev@lynxeye.de>
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      c3c2384c
    • Lucas Stach's avatar
      mmc: tegra: disable SPI_MODE_CLKEN · 74cd42bc
      Lucas Stach authored
      The Tegra30 and up TRM states that this bit should always be
      programmed to 0 by driver software.
      Signed-off-by: default avatarLucas Stach <dev@lynxeye.de>
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      74cd42bc
    • Lucas Stach's avatar
      mmc: tegra: implement module external clock change · a8e326a9
      Lucas Stach authored
      Allow the the driver to change the clock supplied from the CAR directly,
      minimizing the need to divide the clock inside the SDMMC module itself.
      
      This allows for higher clock speeds than the default 48MHz supplied to
      the module and is a prerequisite to support DDR signaling modes, where
      the Tegra host needs to be run with a fixed internal divider of 2 for
      data to be sampled correctly. (Tegra K1 TRM v03p chapter 29.7.1.1)
      
      Also enable the broken preset value quirk as the preset values need to
      be adapted to the changed clocking. While Tegra114+ allows this through
      vendor registers, there is no such way for Tegra30. Takes the easy way
      out  and keep things consistent between the different SoC generations by
      flagging the preset registers as unusable.
      Signed-off-by: default avatarLucas Stach <dev@lynxeye.de>
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      a8e326a9
    • Jisheng Zhang's avatar
      mmc: sdhci: restore behavior when setting VDD via external regulator · 918f4cbd
      Jisheng Zhang authored
      After commit 52221610 ("mmc: sdhci: Improve external VDD regulator
      support"), for the VDD is supplied via external regulators, we ignore
      the code to convert a VDD voltage request into one of the standard
      SDHCI voltage levels, then program it in the SDHCI_POWER_CONTROL. This
      brings two issues:
      
      1. SDHCI_QUIRK2_CARD_ON_NEEDS_BUS_ON quirk isn't handled properly any
      more.
      
      2. What's more, once SDHCI_POWER_ON bit is set, some controllers such
      as the sdhci-pxav3 used in marvell berlin SoCs require the voltage
      levels programming in the SDHCI_POWER_CONTROL register, even the VDD
      is supplied by external regulator. So the host in marvell berlin SoCs
      still works fine after the commit. However, commit 3cbc6123 ("mmc:
      sdhci: Set SDHCI_POWER_ON with external vmmc") sets the SDHCI_POWER_ON
      bit, this would make the host in marvell berlin SoCs won't work any
      more with external vmmc.
      
      This patch restores the behavior when setting VDD through external
      regulator by moving the call of mmc_regulator_set_ocr() to the end
      of sdhci_set_power() function.
      
      After this patch, the sdcard on Marvell Berlin SoC boards work again.
      Signed-off-by: default avatarJisheng Zhang <jszhang@marvell.com>
      Fixes: 52221610 ("mmc: sdhci: Improve external VDD ...")
      Reviewed-by: default avatarLudovic Desroches <ludovic.desroches@atmel.com>
      Tested-by: default avatarLudovic Desroches <ludovic.desroches@atmel.com>
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      918f4cbd
    • Adrian Hunter's avatar
      mmc: It is not an error for the card to be removed while suspended · 520322d9
      Adrian Hunter authored
      A card can be removed while it is runtime suspended.
      Do not print an error message.
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      520322d9
    • Colin Cross's avatar
      mmc: block: Allow more than 8 partitions per card · 382c55f8
      Colin Cross authored
      It is quite common for Android devices to utilize more
      then 8 partitions on internal eMMC storage.
      
      The vanilla kernel can support this via
      CONFIG_MMC_BLOCK_MINORS, however that solution caps the
      system to 256 minors total, which limits the number of
      mmc cards the system can support.
      
      This patch, which has been carried for quite awhile in
      the AOSP common tree, provides an alternative solution
      that doesn't seem to limit the total card count. So I
      wanted to submit it for consideration upstream.
      
      This patch sets the GENHD_FL_EXT_DEVT flag, which will
      allocate minor number in major 259 for partitions past
      disk->minors.
      
      It also removes the use of disk_devt to determine devidx
      from md->disk. md->disk->first_minor is always initialized
      from devidx and can always be used to recover it.
      
      Cc: Ulf Hansson <ulf.hansson@linaro.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Ben Hutchings <ben@decadent.org.uk>
      Cc: Chuanxiao Dong <chuanxiao.dong@intel.com>
      Cc: Shawn Lin <shawn.lin@rock-chips.com>
      Cc: Austin S Hemmelgarn <ahferroin7@gmail.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Android Kernel Team <kernel-team@android.com>
      Cc: linux-mmc@vger.kernel.org
      Signed-off-by: default avatarColin Cross <ccross@android.com>
      [jstultz: Added context to commit message]
      Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      382c55f8
    • Ulf Hansson's avatar
      mmc: core: Optimize boot time by detecting cards simultaneously · 520bd7a8
      Ulf Hansson authored
      The mmc workqueue is an ordered workqueue, allowing only one work to
      execute per given time. As this workqueue is used for card detection, the
      conseqeunce is that cards will be detected one by one waiting for each
      other.
      
      Moreover, most of the time spent during card initialization is waiting for
      the card's internal firmware to be ready. From a CPU perspective this
      typically means waiting for a completion variable to be kicked via an
      IRQ-handler or waiting for a sleep timer to finish.
      
      This behaviour of detecting/initializing cards is sub-optimal, especially
      for SOCs having several controllers/cards.
      
      Let's convert to use the system_freezable_wq for the mmc detect works.
      This enables several works to be executed simultaneously and thus also
      cards to be detected like so.
      
      Tests on UX500, which holds two eMMC cards and an SD-card (actually also
      an SDIO card, currently not detected), shows a significant improved
      behaviour due to this change.
      
      Before this change, both the eMMC cards waited for the SD card to be
      initialized as its detect work entered the workqueue first. In some cases,
      depending on the characteristic of the SD-card, they got delayed 1-1.5 s.
      
      Additionally for the second eMMC, it needed to wait for the first eMMC to
      be initialized which added another 120-190 ms.
      
      Converting to the system_freezable_wq, removed these delays and made both
      the eMMC cards available far earlier in the boot sequence.
      
      Selecting the system_freezable_wq, in favour of for example the system_wq,
      is because we need card detection mechanism to be disabled once userspace
      are frozen during system PM. Currently the mmc core deal with this via PM
      notifiers, but following patches may utilize the behaviour of the
      system_freezable_wq, to simplify the use of the PM notifiers.
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      Tested-by: default avatarAlan Cooper <alcooperx@gmail.com>
      Tested-by: default avatarShawn Lin <shawn.lin@rock-chips.com>
      520bd7a8
  3. 22 Dec, 2015 28 commits