- Oct 25, 2019
-
-
Sam Protsenko authored
mmc_wait_dat0() expects timeout argument to be in usec units. But some overlying functions operate on timeout in msec units. Convert timeout from msec to usec when passing it to mmc_wait_dat0(). This fixes 'avb' commands on BeagleBoard X15, because next chain was failing: get_partition() -> mmc_switch_part() -> __mmc_switch() -> mmc_wait_dat0() when passing incorrect timeout from __mmc_switch() to mmc_wait_dat0(). Fixes: bb98b8c5c06a ("mmc: During a switch, poll on dat0 if available and check the final status") Signed-off-by:
Sam Protsenko <semen.protsenko@linaro.org> Reviewed-by:
Eugeniu Rosca <rosca.eugeniu@gmail.com> Tested-by:
Eugeniu Rosca <rosca.eugeniu@gmail.com> Reviewed-by:
Peng Fan <peng.fan@nxp.com> Tested-by:
Igor Opaniuk <igor.opaniuk@gmail.com> Reviewed-by:
Igor Opaniuk <igor.opaniuk@gmail.com>
-
Baruch Siach authored
The comment about init op being NULL used to be next to the NULL check code. Commit 8ca51e51 ("dm: mmc: Add a way to use driver model for MMC operations") separated the comment from the code. Put them back together. Fixes: 8ca51e51 ("dm: mmc: Add a way to use driver model for MMC operations") Signed-off-by:
Baruch Siach <baruch@tkos.co.il> Reviewed-by:
Peng Fan <peng.fan@nxp.com>
-
Peng Fan authored
eMMC 5.1+ supports HS400 Enhances Strobe mode without the need for tuning procedure. The flow is as following: - set HS_TIMIMG (Highspeed) - Host change freq to <= 52Mhz - set the bus width to Enhanced strobe and DDR8Bit(CMD6), EXT_CSD[183] = 0x86 instead of 0x80 - set HS_TIMING to 0x3 (HS400) - Host change freq to <= 200Mhz - Host select HS400 enhanced strobe complete Signed-off-by:
Peng Fan <peng.fan@nxp.com>
-
Anup Patel authored
The MMC mode and width are fixed for MMC SPI host hence we skip sd_select_mode_and_width() and mmc_select_mode_and_width() for MMC SPI host. Signed-off-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Tested-by:
Bin Meng <bmeng.cn@gmail.com>
-
Jean-Jacques Hiblot authored
This operation may fail. Retry it a few times before giving up and report a failure. Signed-off-by:
Jean-Jacques Hiblot <jjhiblot@ti.com>
-
Jean-Jacques Hiblot authored
Accessing the boot partition had been error prone with HS200 and HS400 and was disabled. The driver first switched to a lesser mode and then switched the partition access. It was mostly due to a bad handling of the switch and has been fixed, so let's remove this 'feature' Signed-off-by:
Jean-Jacques Hiblot <jjhiblot@ti.com>
-
Jean-Jacques Hiblot authored
The switch operation can sometimes make the bus unreliable, in that case the send_status parameter should be false to indicate not to poll using CMD13. If polling on dat0 is possible, we should use it to detect the end of the operation. At the end of the operation it is safe to use CMD13 to get the status of the card. It is important to do so because the operation may have failed. Signed-off-by:
Jean-Jacques Hiblot <jjhiblot@ti.com>
-
Jean-Jacques Hiblot authored
The e-MMC spec allows the e-MMC to specify a timeout for the partition switch command. It can take up to 2550 ms. There is no lower limit to this value in the spec, but do as the the linux driver does and force it to be at least 300ms. Signed-off-by:
Jean-Jacques Hiblot <jjhiblot@ti.com>
-
Jean-Jacques Hiblot authored
Starting with rev 4.5, the eMMC can define a generic timeout for the SWITCH command. Following Linux Kernel code, the timeout also changed from 1000 -> 500 Signed-off-by:
Jean-Jacques Hiblot <jjhiblot@ti.com>
-
Jean-Jacques Hiblot authored
Using the DAT0 line as a rdy/busy line is an alternative to reading the status register of the card. It especially useful in situation where the bus is not in a good shape, like when modes are switched. This is also how the linux driver behaves. Note of warning: As per the specification, while polling on DAT0 the CLK must not turned off: "[...] Without a clock edge the Device (unless previously disconnected by a deselect command (CMD7)) will force the DAT0 line down, forever. [...]" Signed-off-by:
Jean-Jacques Hiblot <jjhiblot@ti.com>
-
Jean-Jacques Hiblot authored
mmc_send_status() is currently used to poll the card until it is ready, not actually returning the status of the card. Make it return the status and add another function to poll the card. Also remove the 'extern' declaration in the mmc-private.h header to comply with the coding standard. Signed-off-by:
Jean-Jacques Hiblot <jjhiblot@ti.com>
-
Jean-Jacques Hiblot authored
This reverts commit 318a7a57. The last and only user of this callback had been the omap_hsmmc driver. It is not used anymore. Removing the callback. Signed-off-by:
Jean-Jacques Hiblot <jjhiblot@ti.com>
-
Marek Vasut authored
U-Boot code currently only applies this restriction to HS200 mode, extend this to HS400 mode as well. Currently U-Boot code not support accessing boot partition in HS200/400 mode. This needs more check. Signed-off-by:
Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Jean-Jacques Hiblot <jjhiblot@ti.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> Cc: Peng Fan <peng.fan@nxp.com> Reviewed-by:
Peng Fan <peng.fan@nxp.com>
-
Marek Vasut authored
The tiny printf implementation only supports %x format specifier, it does not support %X . Since it makes little difference whether the debug output prints hex numbers in capitals or not, change it to %x and make the MMC_TRACE output work with tiny printf too. Signed-off-by:
Marek Vasut <marex@denx.de> Cc: Jaehoon Chung <jh80.chung@samsung.com> Cc: Simon Glass <sjg@chromium.org>
-
Andre Przywara authored
Commit d0851c893706 ("blk: Call part_init() in the post_probe() method") removed the call to part_init() in mmc.c, as this is done by the DM_MMC framework. However Allwinner is (still) relying on a non-DM MMC driver, so we are now missing the implicit partition init, leading to failing MMC accesses due to the missing partition information. Bring the call back just for non-DM MMC driver to fix this regression. Signed-off-by:
Andre Przywara <andre.przywara@arm.com> Reviewed-by:
Simon Glass <sjg@chromium.org> Tested-by:
Soeren Moch <smoch@web.de>
-
Bin Meng authored
part_init() is currently called in every DM BLK driver, either in its bind() or probe() method. However we can use the BLK uclass driver's post_probe() method to do it automatically. Update all DM BLK drivers to adopt this change. Signed-off-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
Peng Fan authored
Add HS400 support. Selecting HS400 needs first select HS200 according to spec, so use a dedicated function for HS400. Add HS400 related macros. Remove the restriction of only using the low 6 bits of EXT_CSD_CARD_TYPE, using all the 8 bits. Signed-off-by:
Peng Fan <peng.fan@nxp.com> Cc: Jaehoon Chung <jh80.chung@samsung.com> Cc: Jean-Jacques Hiblot <jjhiblot@ti.com> Cc: Stefano Babic <sbabic@denx.de> Cc: Kishon Vijay Abraham I <kishon@ti.com> Cc: Faiz Abbas <faiz_abbas@ti.com> Cc: Marek Vasut <marex@denx.de> Signed-off-by:
Peng Fan <peng.fan@nxp.com> Signed-off-by:
Troy Kisky <troy.kisky@boundarydevices.com>
-
Jon Nettleton authored
This code is useful for testing the existance of devices that do not have card detect capabilities. This breaks out the core functionality and leaves the actual init logic and error reporting in mmc_start_init(). Signed-off-by:
Jon Nettleton <jon@solid-run.com> Signed-off-by:
Baruch Siach <baruch@tkos.co.il> Reviewed-by:
Stefano Babic <sbabic@denx.de>
-
BOUGH CHEN authored
After the commit b9a2a0e2e9c0 ("mmc: Add support for downgrading HS200/HS400 to HS mode"), it add a parameter in mmc_set_card_speed() which indicates that the HS200/HS400 to HS downgrade is happening. During the HS400 initialization, first select to HS200, and config the related clock rate, then downgrade to HS mode. So here also need to config the downgrade value to be true for two reasons. First, make sure in the function mmc_set_card_speed(), after switch to HS mode, first config the clock rate, then read the EXT_CSD, avoid receiving data of EXT_CSD in HS mode at 200MHz. Second, after issue the MMC_CMD_SWITCH command, it need to wait a bit then switch bus properties. Test on i.MX8QM MEK board, some Micron eMMC will stuck in transfer mode in this case, and USDHC will never get data transfer complete status, cause the uboot hang. Signed-off-by:
Haibo Chen <haibo.chen@nxp.com> Acked-by:
Marek Vasut <marek.vasut@gmail.com>
-
Marek Vasut authored
Older kernel versions or systems which do not connect eMMC reset line properly may not be able to handle situations where either the eMMC is left in HS200/HS400 mode or SD card in UHS modes by the bootloader and may misbehave. Downgrade the eMMC to HS/HS52 mode and/or SD card to non-UHS mode before booting the kernel to allow such older kernels to work with modern U-Boot. Signed-off-by:
Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Tom Rini <trini@konsulko.com>
-
Marek Vasut authored
When using CMD6 to switch eMMC card timing from HS200/HS400 to HS/legacy, do not poll for the completion status using CMD13, but rather wait 50mS. Once the card receives the CMD6 and starts executing it, the bus is in undefined state until both the card finishes executing the command and until the controller switches the bus to matching timing configuration. During this time, it is not possible to transport any commands or data across the bus, which includes the CMD13. Signed-off-by:
Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Jaehoon Chung <jh80.chung@samsung.com>
-
Marek Vasut authored
The mmc_select_mode_and_width() function can be called while the card is in HS200/HS400 mode and can be used to downgrade the card to lower mode, e.g. HS. This is used for example by mmc_boot_part_access_chk() which cannot access the card in HS200/HS400 mode and which is in turn called by saveenv if env is in the MMC. In such case, forcing the card clock to legacy frequency cannot work. Instead, the card must be switched to HS mode first, from which it can then be reprogrammed as needed. However, this procedure needs additional code changes, since the current implementation checks whether the card correctly switched to HS mode in mmc_set_card_speed(). The check only expects that the card will be going to HS mode from lower modes, not from higher modes, hence add a parameter which indicates that the HS200/HS400 to HS downgrade is happening. This makes the code send the switch command first, reconfigure the controller next and finally perform the EXT_CSD readback check. The last two steps cannot be done in reverse order as the card is already in HS mode when the clock are being switched on the controller side. Signed-off-by:
Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by:
Troy Kisky <troy.kisky@boundarydevices.com>
-
Marek Vasut authored
According to SD Specifications Part 1 Physical Layer Simplified Specification Version 6.00 August 29, 2018, section 4.3.10 (Switch Function Command) and section 5.6 (SCR register), SD cards version 1.00 and 1.01 do not support the SD CMD 6. Currently, U-Boot will issue CMD 6 unconditionally in sd_set_card_speed() while configuring the bus for selected frequency. This will make SD cards version 1.00 and 1.01 time out and thus fail detection altogether. Fix this by not sending CMD 6 on such cards. Tested on Matsushita Electric Industrial Co., Ltd. Japan RP-SD008B / Victor 8MB SD card, CU-SD008, which is correctly detected with this patch as: Device: sd@ee160000 Manufacturer ID: 1 OEM: 5041 Name: S008B Bus Speed: 25000000 Mode : SD Legacy Rd Block Len: 512 SD version 1.0 High Capacity: No Capacity: 6.5 MiB Bus Width: 4-bit Erase Group Size: 512 Bytes Signed-off-by:
Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
-
- Oct 23, 2019
-
-
Troy Kisky authored
Signed-off-by:
Troy Kisky <troy.kisky@boundarydevices.com>
-
- Oct 17, 2019
-
-
Troy Kisky authored
Signed-off-by:
Troy Kisky <troy.kisky@boundarydevices.com>
-
Troy Kisky authored
Signed-off-by:
Troy Kisky <troy.kisky@boundarydevices.com>
-
Troy Kisky authored
Signed-off-by:
Troy Kisky <troy.kisky@boundarydevices.com>
-
Troy Kisky authored
Signed-off-by:
Troy Kisky <troy.kisky@boundarydevices.com>
-
- Oct 16, 2019
-
-
Troy Kisky authored
Signed-off-by:
Troy Kisky <troy.kisky@boundarydevices.com>
-
- Oct 13, 2019
-
-
Troy Kisky authored
Signed-off-by:
Troy Kisky <troy.kisky@boundarydevices.com>
-
Troy Kisky authored
Signed-off-by:
Troy Kisky <troy.kisky@boundarydevices.com>
-
- Oct 10, 2019
-
-
Laci Tele authored
Signed-off-by:
Laci Tele <laci@boundarydevices.com>
-
- Oct 08, 2019
-
-
Troy Kisky authored
Signed-off-by:
Troy Kisky <troy.kisky@boundarydevices.com>
-
- Oct 05, 2019
-
-
Troy Kisky authored
Signed-off-by:
Troy Kisky <troy.kisky@boundarydevices.com>
-
- Oct 04, 2019
-
-
Troy Kisky authored
Signed-off-by:
Troy Kisky <troy.kisky@boundarydevices.com>
-
Troy Kisky authored
Signed-off-by:
Troy Kisky <troy.kisky@boundarydevices.com>
-
- Oct 01, 2019
-
-
Troy Kisky authored
Signed-off-by:
Troy Kisky <troy.kisky@boundarydevices.com>
-
Troy Kisky authored
Signed-off-by:
Troy Kisky <troy.kisky@boundarydevices.com>
-
- Sep 26, 2019
-
-
Troy Kisky authored
Signed-off-by:
Troy Kisky <troy.kisky@boundarydevices.com>
-
- Sep 25, 2019
-
-
Troy Kisky authored
Signed-off-by:
Troy Kisky <troy.kisky@boundarydevices.com>
-