Commit graph

677 commits

Author SHA1 Message Date
Rajkumar Ayyasamy
f5838b7edc mmc: fix dest address
After reading data from mmc, dest pointer will point to
the end address. To calculate the start of dest pointer
number of bytes copied has to be subtracted.

Signed-off-by: Rajkumar Ayyasamy <arajkuma@codeaurora.org>
Change-Id: I24610a3b3bb498c4ee4ebba58e557d109c6af1ef
2020-11-25 04:18:37 -08:00
Vandhiadevan
4ae7d14b9d ipq5018: Enable eMMC support.
This eMMC flash controller support only 4-bit
Update sdhci driver to support 4-bit mode.

Change-Id: Iddaa0807b7cf339fcfa5add0b96955757b33c716
Signed-off-by: Vandhiadevan <vkarunam@codeaurora.org>
2019-11-21 19:58:18 +05:30
Antony Arun T
6dded97c74 ipq6018: fixing "reset never completed issue"
As per the SD controller hardware design document
the SD bus power should be turned off and the iopad
voltage has to be set to 3V (default), before
doing reset for all in SD host controller.

Change-Id: Ia77bb0acefe1e619c8ae7a2bc60024bf1ac5c6cd
Signed-off-by: Antony Arun T <antothom@codeaurora.org>
2019-06-26 18:15:32 +05:30
Antony Arun T
263809b4a7 ipq6018: moving __weak function definition to common file
moving __weak function from board specific file to
common file to avoid implicit declaration of function
warning

Change-Id: I60232c24eb3f7c4e16831de16452def3fe2671c3
Signed-off-by: Antony Arun T <antothom@codeaurora.org>
2019-06-09 22:05:24 -07:00
Antony Arun T
fb27ca9881 mmc: ipq6018: fix for mmc iopad issue
Change-Id: I71353b93ef7c62bfcdff2f9207bb26bcdd882c88
Signed-off-by: Antony Arun T <antothom@codeaurora.org>
2019-05-27 21:36:57 +05:30
Antony Arun T
d6c1d173ed Revert "ipq6018: enable mmc workaround"
This reverts commit 27df165798.

Change-Id: Ib729f94b4862cfcd7c3ce1cbc467dade503fc179
Signed-off-by: Antony Arun T <antothom@codeaurora.org>
2019-05-27 21:33:53 +05:30
Antony Arun T
27df165798 ipq6018: enable mmc workaround
Change-Id: I93e0dae86195b0e434cef25651614d515c724288
Signed-off-by: Antony Arun T <antothom@codeaurora.org>
2019-05-25 20:38:53 +05:30
Md Sadre Alam
9b5bbf1e0e ipq40xx: driver: mmc: Added erase quirk for eMMC part
eMMC part THGBMNG5D1LBAIT (Toshiba 4GB) is taking long time for
the secure trim.This leads to erase timeout. Manufacturer ID based
quirk is added for the specific part to use trim instead of secure
trim for block erase.

without this change we can see the error erase timeout and erase failed.
error:

MMC erase: dev # 0, block # 6690, count 2047 ... sdhci_send_command:
MMC: 0 busy timeout increasing to: 2000 ms.
sdhci_send_command: MMC: 0 busy timeout increasing to: 4000 ms.
timeout.
mmc erase failed
-1 blocks erased: ERROR

Change-Id: I1126690400b274bb4735750584d7fb4b105e6618
Signed-off-by: Md Sadre Alam <mdalam@codeaurora.org>
2019-02-28 14:14:22 +05:30
Md Sadre Alam
ca63b592db driver: mmc: sdhci: Add condition for DAT inhibit bit.
This change will handle masking of DAT inhibit bit of
present state register. This status bit is genarated if
either the DAT Line Active or Read Transfer Active is set to
1. If this bit is 0, it indicates the host controller can issue
the next command.

Commands with busy signal belong to Command Inhibit(DAT).
e.g (R1b, R5b type).

Changing from 1 to 0 generates a transfer complete interrupt
in normal interrupt status register.

If this bit value is 1: Cannot issue command which uses DAT line.
If this bit value is 0: Can issue command which uses DAT line.

This change is masking SDHCI_DATA_INHIBIT bit only if card is in
busy state.

Without this change we can get the erase timeout error.
error:
MMC erase: dev # 0, block # 27682, count 16383 ...
sdhci_send_command: MMC: 0 busy timeout increasing to: 2000 ms.

Change-Id: I0612e576c09a7fd077bed1a1ee717afcddfa7e87
Signed-off-by: Md Sadre Alam <mdalam@codeaurora.org>
2019-02-20 14:22:12 +05:30
sameeruddin shaik
8338952d77 ipq807x: Fix compiler warnings in u-boot
Change-Id: Icd0c082fcc5d191745e4e4242dda5a7f3b22c4f0
Signed-off-by: sameeruddin shaik <samesh@codeaurora.org>
2019-01-22 12:57:57 +05:30
Linux Build Service Account
d1673a3783 Merge "ipq806x: Change the minimum write protect region size for Micron eMMC" 2018-11-13 12:13:01 -08:00
Vinoth Gnanasekaran
c99a4a2099 ipq806x: Change the minimum write protect region size for Micron eMMC
This change is a workaround for Micron eMMC card. As per the card
extended CSD register value, the minimum size of a write protect
region is 0x8000 blocks (16MB). So the user should give start address
and size to align with 0x8000. But this eMMC part actually does
protect 32MB of memory.

We changing the minimum write protect region size from 0x8000 to
0x10000 for Micron eMMC card.

Change-Id: Id53c337374dfba8adb6bd550826337d8ecfe17f3
Signed-off-by: Vinoth Gnanasekaran <vgnana@codeaurora.org>
2018-11-13 14:31:35 +05:30
Vinoth Gnanasekaran
cd6a575b7d ipq806x: Send STOP_TRANSMISSION command after DATA_TIMEOUT error
The Device will accept the requested number of data blocks, terminate
the transaction and return to transfer state. Stop command is not
required at the end of this type of multiple blocks write unless
terminated with an error.  This change will send the
STOP_TRANIMISSION command if the command failed.

Change-Id: I9bd419ab8931d80a4a2eeba9f5bd42222257a824
Signed-off-by: Vinoth Gnanasekaran <vgnana@codeaurora.org>
2018-11-13 12:20:14 +05:30
Balaji Prakash Jagadeesan
bd6ce22a08 ipq806x: qca_mmc: capture the errors during write to fifo
This patch checks for the errors during the fifo write itself
like in qca_pio_read function. Previously, error was checked
only after the total xfer_size is written to the fifo and
errors during the fifo write operation were ignored.

Change-Id: I2a549b0032bfd774973773cc49b595c75682aac7
Signed-off-by: Balaji Prakash Jagadeesan <bjagadee@codeaurora.org>
2018-08-30 15:16:15 +05:30
Gokul Sriram Palanisamy
6eba23c6c0 qca: Removed duplicate header file qca_common.h
Change-Id: I437d016bce46b21a1d93520f4f28cfa7b2f3e3e5
Signed-off-by: Gokul Sriram Palanisamy <gokulsri@codeaurora.org>
2018-08-20 06:21:41 -07:00
sameeruddin shaik
faa4f24040 mmc: Fix for memory leak in sdhci
We are allocating the dma descriptors,but they are not explicitly
freed. This change will free the dma descriptors after every transfer.

Change-Id: I0a851923ab4d2551215e29b34c7c31b85502fb3f
Signed-off-by: sameeruddin shaik <samesh@codeaurora.org>
2018-08-16 02:53:52 -07:00
Vinoth Gnanasekaran
4dc439fee1 ipq40xx: mmc: Added erase quirk for eMMC part
eMMC part THGBMBG5D1KBAIT is taking long time for the secure trim.
This leads to erase timeout. Manufacturer ID based quirk is added
for the specific part to use trim instead of secure trim for block erase.

Change-Id: Id4ecfde9585e112521863439f684feb5e0caaa51
Signed-off-by: Vinoth Gnanasekaran <vgnana@codeaurora.org>
2018-06-06 22:03:38 -07:00
Pradeep Das
dc6c6754c7 mmc: Added erase quirk for eMMC part
eMMC part SDIN8DE1-8G is taking long time for the secure trim.
This leads to erase timeout. Manufacturer ID based quirk is added
for the specific part to use trim instead of secure trim for block erase.

Change-Id: I13d5a9f19edf5daf9c1f4d5c2ec16b4f3b680159
Signed-off-by: Pradeep Das <pkdas@codeaurora.org>
2018-05-14 00:03:37 -07:00
Antony Arun T
6d417e1ed0 emmc: fix for mmc_init failure
Change-Id: I0c7202725415253492db29b693d6c9937856f3e5
Signed-off-by: Antony Arun T <antothom@codeaurora.org>
2018-04-05 11:30:00 +05:30
Antony Arun T
2281952673 mmc: waiting for the card to exit from busy state
Since OCR value is changed,1ms delay is added to
give cards time to respond.

Change-Id: I18bddbc9d01ab2c62529c9f2065331f83b7ecca9
Signed-off-by: Antony Arun T <antothom@codeaurora.org>
2018-03-21 17:16:54 +05:30
Gokul Sriram Palanisamy
201def52b9 ARM: mmc: Added power-on write protection support
Change-Id: Iba7e4bfcbee3f5106ef7d0ecc64e8af175732f7c
Signed-off-by: Gokul Sriram Palanisamy <gokulsri@codeaurora.org>
2018-03-12 05:25:56 -07:00
Nikhil Prakash V
e47694ebe8 ipq807x: Changes for fixing kw issues
Adding nullpointer condition checks before the pointer
is accessed or passed to a function as argument.

Change-Id: I6848c132076708f69fad00a75e42a1c2f33b6215
Signed-off-by: Nikhil Prakash V <nprakash@codeaurora.org>
2018-03-06 14:06:48 +05:30
Linux Build Service Account
3174e97d20 Merge "ipq40xx: Replace sprintf with snprintf" 2018-02-27 23:40:26 -08:00
Gokul Sriram Palanisamy
4a788032d8 ipq807x: dcache support for mmc driver
This patch makes mmc driver dcache aware to keep
the mmc functionality intact, with or without dcache
is enabled.

flush_cache used here does both clean and invalidate
cache thus preventing data loss during unaligned access,
if any.

Change-Id: I0910bd17678d3855bba27e9f8f7c08606774b28d
Signed-off-by: Gokul Sriram Palanisamy <gokulsri@codeaurora.org>
2018-02-18 22:15:34 -08:00
Sasirekaa Madhesu
c5ffa908c0 ipq40xx: Replace sprintf with snprintf
Change-Id: I2f1d31901ce4c4b15dad9e25265597518d4b4122
Signed-off-by: Sasirekaa Madhesu <smadhesu@codeaurora.org>
2018-02-08 12:40:04 +05:30
Antony Arun T
ea2ca09563 ipq40xx: fix emmc erase timeout issue
This patch fixes the erase timeout issue in emmc.

Change-Id: I35031d834fda4ee7560e84787e18e8bc0a3f28fe
Signed-off-by: Antony Arun T <antothom@codeaurora.org>
2018-01-23 15:10:35 +05:30
Gokul Sriram Palanisamy
0c3cc6d7e7 ARM: sdhci: Added auto increment for command timeout
Change-Id: I79a2ec29e5623e12838e82581324c41dab78b872
Signed-off-by: Gokul Sriram Palanisamy <gokulsri@codeaurora.org>
2017-12-22 03:44:23 -08:00
Rajkumar Ayyasamy
fb0e42bb80 mmc: Timeout calculation for erase operation
The erase timeout has been calculated using the
EXT_CSD_TRIM_MULT so that the erase operation with
larger block counts are not affected.

Change-Id: Ia6dd9318c44b4da315c2b2a82cfabe9eff0aeb41
Signed-off-by: Rajkumar Ayyasamy <arajkuma@codeaurora.org>
2017-11-30 12:52:59 +05:30
Vasudevan Murugesan
d7c16e971b ipq807x: sdhci: Modified sdhci command timeout to 200msec
Change-Id: I641123fdcb7d56e08e3faad78558e81bcd470506
Signed-off-by: Vasudevan Murugesan <vmuruges@codeaurora.org>
2017-11-15 03:07:39 -08:00
Vasudevan Murugesan
7fd4f44ace ipq807x: mmc: Enabled SDHCI ADMA support
This patch enables SDHCI mode and also supports
data transfer using ADMA method.

Change-Id: Ia3187fec9024ad0972ca720cf0b9ddc6a59b906c
Signed-off-by: Vasudevan Murugesan <vmuruges@codeaurora.org>
2017-11-03 02:52:37 -07:00
Stefan Wahren
b77ce142bb mmc: add MMC_VERSION_5_1
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
(cherry picked from commit 1a3619cf82)

Change-Id: I7884f7b58cadb6935ffa266d35af64a4e5ca68cb
Signed-off-by: Gokul Sriram Palanisamy <gokulsri@codeaurora.org>
2017-09-12 15:25:15 +05:30
Sham Muthayyan
cad4eba461 mmc: eMMC add Secured Trim command support
Secured Trim command does eMMC erase for  unalligned block size.

Change-Id: I4dc7bea15c8fcb57e07d19c398b1c8e2289da100
Signed-off-by: Sham Muthayyan <smuthayy@codeaurora.org>
2017-04-11 23:55:40 -07:00
Vasudevan Murugesan
f96d461a27 ipq806x: Enabled SDCC support
This patch enables qca_mmc driver and
also has the changes required for emmc
support

Change-Id: Icc8d807caffced79d6ca576fe6220c522ebda3f7
Signed-off-by: Vasudevan Murugesan <vmuruges@codeaurora.org>
2017-02-01 21:23:50 -08:00
Prabhu Jayakumar
97c3087906 qca: move ARM specific files to another sublevel
As the U-boot source is going to be common between ARM and MIPS
architecture , it is required to pick only the files specific
to the respective architectures during the build.

So, move the qca arm target specific common files to another
sub level by specifying the ARCH arm.

Change-Id: I06b538834109981f21fef6270bfb8e437a2f5a7e
Signed-off-by: Prabhu Jayakumar <pjayak@codeaurora.org>
2017-01-06 12:33:30 +05:30
G Dhivya
70dde8bf2e ipq40xx: Remove mmc_init call during board init
This fix removes the mmc_init that is being called during
board init to prevent error message in cases where eMMC
card is not connected.

Change-Id: I918c71c391002d24e704be30043ff0cc8dfd4f83
Signed-off-by: G Dhivya <gdhivya@codeaurora.org>
2016-11-23 15:08:29 +05:30
Saravanan Jaganathan
2230d5482d qca: ipq: Fixed compiler warnings
Fixed warnings for both ipq807x and ipq40xx
builds.

Change-Id: I69accebf525ee52f470335a14474378f5e7f65b0
Signed-off-by: Saravanan Jaganathan <sjaganat@codeaurora.org>
2016-07-09 17:41:34 +05:30
Vasudevan Murugesan
e452f79755 ipq807x: Enable EFI partition type for eMMC
Change-Id: I29b4d4b3d4b5a047e9bb1d71347c36a489a0eea2
Signed-off-by: Vasudevan Murugesan <vmuruges@codeaurora.org>
2016-06-10 03:58:15 -07:00
Vasudevan Murugesan
80664c0da4 ipq807x: mmc: Initial changes for compilable mmc driver
This patch has the initial changes required to make the
qca_mmc driver buildable. Also added the Kconfig
options required for the qca_mmc driver.

Change-Id: I15c0e9288ae5c7ae361659dff1e84b619de989a8
Signed-off-by: Vasudevan Murugesan <vmuruges@codeaurora.org>
2016-04-06 18:29:39 +05:30
Vasudevan Murugesan
056b5702d2 ipq807x: Added MMC Kconfig options
Change-Id: Ia487c6e887137db937eef29d8947501fcd071090
Signed-off-by: Vasudevan Murugesan <vmuruges@codeaurora.org>
2016-04-01 02:24:46 -07:00
Vasudevan Murugesan
a07af4aa36 ipq807x: mmc: Added eMMC driver files
Change-Id: Icf1683ebe1c7e99c336d884983215d7b416c988b
Signed-off-by: Vasudevan Murugesan <vmuruges@codeaurora.org>
2016-03-21 14:16:28 +05:30
Eric Nelson
1aa2d074a7 mmc: update MMC_ERASE argument to match Linux kernel.
Table 41 of the JEDEC standard for eMMC says that bit 31 of
the command argument is obsolete when issuing the ERASE
command (CMD38) on page 115 of this document:
	http://www.jedec.org/sites/default/files/docs/jesd84-B45.pdf

The SD Card Association Physical Layer Simplified Specification also
makes no mention of the use of bit 31.
	https://www.sdcard.org/downloads/pls/part1_410.pdf

The Linux kernel distinguishes between secure (bit 31 set) and
non-secure erase, and this patch copies the macro names from
include/linux/mmc/core.h.

Tested-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Eric Nelson <eric@nelint.com>
Tested-by: Hector Palacios <hector.palacios@digi.com>
2016-01-04 11:17:43 -05:00
Tom Rini
f1993ca066 Merge branch 'master' of git://www.denx.de/git/u-boot-imx 2016-01-03 10:32:24 -05:00
Eric Nelson
f0b5f23f32 ARM: imx: fsl_esdhc: fix usage of low 4 bits of sysctl register
The low four bits of the SYSCTL register are reserved on the USDHC
controller on i.MX6 and i.MX7 processors, but are used for clocking
operations on earlier models.

Guard against their usage by hiding the bit mask macros on those
processors.

These bits are used to prevent glitches when changing clocks on
i.MX35 et al. Use the RSTA bit instead for i.MX6 and i.MX7.

>From the i.MX6DQ RM:
	To prevent possible glitch on the card clock, clear the
	FRC_SDCLK_ON bit when changing clock divisor value(SDCLKFS
	or DVS in System Control Register) or setting RSTA bit.

Signed-off-by: Eric Nelson <eric@nelint.com>
Reviewed-by: Fabio Estevam <fabio.estevam@freescale.com>
Reviewed-by: Stefano Babic <sbabic@denx.de>
Reviewed-by: Hector Palacios <hector.palacios@digi.com>
2016-01-03 15:21:21 +01:00
Dinh Nguyen
a1684b6105 arm: socfpga: fix up a questionable macro for SDMMC
Move the macro into the socfpga_dwmci_clksel().

Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
Signed-off-by: Marek Vasut <marex@denx.de>
[fix parenthesis in the sdmmc_mask]
2015-12-20 03:44:56 +01:00
Sjoerd Simons
fc011f6402 mmc: mmc: Don't use sprintf when using tiny-printf
There is no sprintf implementation in tiny-printf, so don't try to use
it when tiny-printf if used.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
2015-12-13 17:07:31 -07:00
Tom Rini
dcf4cb068e Merge branch 'zynq' of git://www.denx.de/git/u-boot-microblaze 2015-12-07 08:13:02 -05:00
Michal Simek
d9ae52c8f0 zynq: sdhci: Move driver to DM
Move driver to DM

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2015-12-07 10:14:29 +01:00
Michal Simek
400434537b zynq: sdhci: Remove zynq_sdhci_of_init()
Prepare for using DM.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2015-12-07 10:14:29 +01:00
Siva Durga Prasad Paladugu
b8a9bebeec zynq: sdhci: Calculate minimum frequency based on max frequency
Calculate the minimum sd clock based on max clock. This will
be done by add_sdhci() if we pass minimum clock as zero.
It also does based on SD host contoller version.

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2015-12-07 10:14:29 +01:00
Marek Vasut
c35ed77a78 mmc: dwmmc: socfpga: Convert to DM
Convert the SoCFPGA shim for registering the DWMMC driver to DM.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chin Liang See <clsee@altera.com>
Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
2015-12-07 00:15:59 +01:00