Commit graph

23 commits

Author SHA1 Message Date
Veerabhadrarao Badiganti
7ffd15f63d mmc: sdhci-msm: Don't turnoff Vcc during initialization
As per emmc specification, device should be notified either with
power-off or sleep notification before turning off the Vcc.
Failing to do so might affect the device longevity.

In mmc driver initialization phase even before device probing
gets completed, Vcc is getting turned off without these notifications.
Since it can't send commands at this stage, So just ensure that Vcc
is not turned off till initialization gets completed.

Change-Id: I0bbf0077357d66c888147be40a0c5d312b9ce063
Signed-off-by: Veerabhadrarao Badiganti <vbadigan@codeaurora.org>
2017-06-22 10:55:19 +05:30
Veerabhadrarao Badiganti
7fc028dfca mmc: host: sdhci-msm: Don't clear IO_PAD_PWR_SWITCH when faking 3V support
Don't clear io pad power switch setting when 3V support is faked.
This bit has to be cleared for allowing IO pad to switch to 3V when
Vccq is really configured to 3V. But in case of faking 3V where we
configure Vccq to 1.8V only, we shouldn't clear this bit.

Change-Id: Ib1a9a2eb7189e161e22c8baf588453b3f2632eb7
Signed-off-by: Veerabhadrarao Badiganti <vbadigan@codeaurora.org>
2017-06-16 15:23:42 +05:30
Subhash Jadavani
a4b36d773b mmc: sdhci-msm: add SDR104 CRC workaround enablement control
On Certain chipsets, SDR104 mode might be unstable causing CRC error on
the interface. So we need a workaround which would skip printing register
dumps on CRC errors and also downgrade bus speed mode to SDR50/DDR50 in
case of continuous CRC errors. This patch adds "qcom,sdr104-wa" property
to enable this workaround if required.

Change-Id: I626d8ef45a97e8e6558e7f20be496de1f5a2a438
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2017-04-03 10:42:30 -07:00
Sayali Lokhande
62edbae8ba mmc: sdhci-msm: Cache mmc data structures for debugging
Add debug RAM to store few important mmc data structures
on first point of failure(like mmc_card, mmc_host, sdhci_host)
for debugging purpose, otherwise it will be overwritten as
BUG_ON is removed now.

Change-Id: Ia1388a77aeed60d4d49a63b8798d3a925a60ac2c
Signed-off-by: Sayali Lokhande <sayalil@codeaurora.org>
2017-03-24 01:24:29 -07:00
Veerabhadrarao Badiganti
92907bcb94 mmc: sdhci-msm-ice: Enable ICE HCI if supported
Check if the SDHC has ICE HCI support. If support is present,
enable the cryptoghrapic support inside SDHC.

Also ensure that it is re-enabled after SDHC is reset.
By default ICE HCI is disabled.

Change-Id: I43a65279088d70b415c396bc3e51e0e510bb7f9c
Signed-off-by: Veerabhadrarao Badiganti <vbadigan@codeaurora.org>
2017-01-31 20:50:00 +05:30
Sayali Lokhande
4d0e947477 mmc: host: Register changes for msmfalcon
For SDCC version 5.0.0, MCI registers are
removed from SDCC interface and some registers
are moved to HC. This change is to support MCI
register removal for msmfalcon.
New compatible string "qcom,sdhci-msm-v5" is
added for msmfalcon to support this change.

Change-Id: I9a972c5656762385f11214fe22398cc14a996d29
Signed-off-by: Sayali Lokhande <sayalil@codeaurora.org>
2016-10-12 08:58:23 +05:30
Sahitya Tummala
bb0fb32d8a mmc: sdhci-msm: Fix recursive tuning issue
For any commands, that are sent during tuning sequence
CRC errors are expected. But if SDHCI_NEEDS_RETUNING flag
is set, then it will recursively do the tuning and gets
stuck in tuning. Fix this by not allowing the re-tuning to
happen while it is already in tuning process.

Change-Id: I9cc39f03a01c34f2f5639d4c20776fd575c25231
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
2016-05-31 15:28:10 -07:00
Ritesh Harjani
c45bebe32d mmc: sdhci-msm: Fix wakeup functionality for SDIO
There could be a case where after platform device (sdhci_msm)
suspend, (where external gpio to IRQ is configured for wakeup
in case of sdio) external gpioIRQ is raised before
system suspend is completed.
To solve this problem we use a flag to signal
sdhci_msm_suspend_noirq to abort suspend with -EBUSY signal.

Change-Id: I82617d5a02674af24d330601e41fb3c20278f672
Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
2016-05-31 15:28:03 -07:00
Asutosh Das
bad8692dfc mmc: sdhci: delay the QoS vote removal
By delaying the QoS vote removal, there is some improvement
in performance in single threaded use cases.

Change-Id: I80545486057c55c697b72b56d57e2ea47cff86b9
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
2016-05-31 15:27:56 -07:00
Ritesh Harjani
4940ee4c4a mmc: sdhci-msm: Add wakeup functionality support for sdio
This adds external GPIO wakeup support to sdhci-msm driver
for sdio cards.

Change-Id: Ic3e280b975d293ea8adadadafecfa8115fe5f428
Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
2016-05-31 15:27:55 -07:00
Dinesh K Garg
d98585de72 crypto: ice: Make ICE init & reset API synchronous
ICE init & reset can be synchronous now because ICE does not need
to go to secure side for any ICE configuration. This would simplify
interface and make call more efficient.

Change-Id: I7aa4e2d3ba3383d25758b21b8ae261a0220f35f9
Signed-off-by: Dinesh K Garg <dineshg@codeaurora.org>
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
[subhashj@codeaurora.org: fixed merge conflicts, dropped changes
to ICE and UFS driver as they are already present]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-05-31 15:27:47 -07:00
Pavan Anamula
b4b3041ed6 mmc: sdhci-msm: add the ability to fake 3.0v support for SDIO devices
As SDIO spec doesn't allow advertisement of 1.8v support, some SDIO
devices advertise support of only 3.0v even though they support 1.8v
as well.
sdhc3 host controller only supports 1.8v and rejects the initialization
of SDIO devices that advertise 3.0v support.
This change adds fake support for 3.0v to sdhc host controller.
This will allow initialization of SDIO devices that supports 1.8v but
advertise 3.0v support.

Change-Id: I5a98c54ad4998e6439f83081628c9c083e95bbf0
Signed-off-by: Pavan Anamula <pavana@codeaurora.org>
2016-05-31 15:27:46 -07:00
Gilad Broner
8552909808 mmc: sdhci-msm: add sysfs entries for PM QoS
Add sysfs entries to allow getting the current status of
PM QoS voting and enable or disable voting.

Change-Id: If5b8e4b155090343112916c9c57a766bb2104e10
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
2016-05-31 15:27:35 -07:00
Gilad Broner
17a072dd25 mmc: sdhci-msm: add PM QoS legacy voting
Add PM QoS voting mechanism to sdhci-msm driver for legacy
eMMC.
Two types of voting schemes are supported:
1) Vote for HW IRQ
2) Vote for a cpu group according to the request's designated cpu
Using PM QoS voting should benefit performance.

Change-Id: I5d2b71fc4eabfa5060f343634fbc7363f2ee1344
Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org>
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
[subhashj@codeaurora.org: fixed merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-05-31 15:27:30 -07:00
Gilad Broner
64be1cd3e0 mmc: sdhci-msm: add PM QoS voting
Add PM QoS voting mechanism to sdhci-msm driver for command queueing.
Two types of voting schemes are supported:
1) Vote for HW IRQ
2) Vote for a cpu group according to the request's designated cpu
Using PM QoS voting should benefit performance.

Change-Id: I8a20653eeb6348d5b442c846708d92c8fb64a8e9
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
[subhashj@codeaurora.org: fixed trivial merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-05-31 15:27:30 -07:00
Gilad Broner
8a67fa5b17 mmc: sdhci-msm: add PM QoS properties for IRQ and cpu group voting
Add the necessary device tree properties and parsing in the driver
to support PM QoS voting for IRQ and CPU groups for CMDQ / legacy modes.

Change-Id: I1a94978ca66823d2ce78ee230cf36b4ebb72e6d8
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
[subhashj@codeaurora.org: fixed trivial merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-05-31 15:27:28 -07:00
Konstantin Dorfman
fd6903e1eb mmc: sdhci: remove support for pm_qos
pm_qos is causing race conditions in CQ mode with
power management. Removing the feature in order to
allow power management.

Change-Id: I340cd784829f389f18df6bff664337aca0f3c867
Signed-off-by: Dov Levenglick <dovl@codeaurora.org>
Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org>
2016-05-31 15:27:28 -07:00
Venkat Gopalakrishnan
b6184a1b46 mmc: sdhci-msm: fix register address change for DDR_CONFIG
The power on reset value of DDR_CONFIG register was fixed in
controller revision (major - 0x1 and minor > 0x49) to address
the default rclk delay value after characterization. The register
offset for this register was also changed starting from this
revision. Make necessary changes to account for this.

Change-Id: I4e4a87aebd24e5669b03a914c6e0f4b469f5ec7b
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-05-31 15:27:24 -07:00
Sahitya Tummala
94fe36b713 mmc: sdhci-msm: get the load notification from clock scaling
This is needed to scale up/down the ICE clock during runtime
as per the load on eMMC.

Change-Id: I60d06458767c817298783219caf767866e7bf12f
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
2016-05-31 15:27:12 -07:00
Subhash Jadavani
41eb870d51 mmc: sdhci-msm: skip eMMC slot probe if eMMC isn't a bootdevice
If eMMC is not a primary bootdevice, there isn't any point of probing
eMMC device hence disable the probing in such case.

Change-Id: I92fa8c2ef373fd8a9140dbfb41356684aaa28e4e
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-05-31 15:26:57 -07:00
Ritesh Harjani
e925dcbfb5 mmc: sdhci-msm: Add hs400 enhanced strobe mode support to host
This adds hs400 enhanced strobe mode(emmc 5.1 feature)
support to sdhci-msm platform host.

Change-Id: Id35e0b9e47ea725202c8e4a3ca479d52cc872920
Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-05-31 15:26:48 -07:00
Sahitya Tummala
f32bccfb7f mmc: sdhci-msm-ice: Add Inline Crypto Engine (ICE) support
eMMC controller may have an Inline Crypto Engine (ICE) attached,
which can be used to encrypt/decrypt data going to/from eMMC.
This patch adds a new client driver sdhci-msm-ice.c which interacts
with ICE driver present in (drivers/crypto/msm/) and thus provides
an interface to the low-level SDHCI driver to do the data
encryption/decryption.

Change-Id: I6ac78072563f77c481425a5ec149ec46a9b0a80d
Signed-off-by: Krishna Konda <kkonda@codeaurora.org>
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
[subhashj@codeaurora.org: fixed trivial merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-05-31 15:26:25 -07:00
Sahitya Tummala
a4a793c49e mmc: sdhci-msm: Move common definitions to header file
This is needed by Inline Crypto Engine (ICE) driver.

Change-Id: Ibfe151098f4f0395b5b9dbdc463723b8e0265487
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-05-31 15:26:21 -07:00