summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorAndrew Gabbasov <andrew_gabbasov@mentor.com>2014-12-01 06:59:09 -0600
committerPantelis Antoniou <pantelis.antoniou@konsulko.com>2014-12-12 21:08:06 +0200
commit786e8f818c25265d12d5d06e257fe2b1ba516134 (patch)
tree2b9ea577186b40176a55900be8e4d37fca8283c1 /common
parentdfcb683a31d4222c30a9ef5d4acea1142f6bde48 (diff)
downloadu-boot-imx-786e8f818c25265d12d5d06e257fe2b1ba516134.zip
u-boot-imx-786e8f818c25265d12d5d06e257fe2b1ba516134.tar.gz
u-boot-imx-786e8f818c25265d12d5d06e257fe2b1ba516134.tar.bz2
mmc: Fix handling of bus widths and DDR card capabilities
If the MMC_MODE_DDR_52MHz flag is set in card capabilities bitmask, it is never cleared, even if switching to DDR mode fails, and if the controller driver uses this flag to check the DDR mode, it can take incorrect actions. Also, DDR related checks in mmc_startup() incorrectly handle the case when the host controller does not support some bus widths (e.g. can't support 8 bits), since the host_caps is checked for DDR bit, but not bus width bits. This fix clearly separates using of card_caps bitmask, having there the flags for the capabilities, that the card can support, and actual operation mode, described outside of card_caps (i.e. bus_width and ddr_mode fields in mmc structure). Separate host controller drivers may need to be updated to use the actual flags. Respectively, the capabilities checks in mmc_startup are made more correct and clear. Also, some clean up is made with errors handling and code syntax layout. Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
Diffstat (limited to 'common')
-rw-r--r--common/cmd_mmc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c
index 4286e26..96478e4 100644
--- a/common/cmd_mmc.c
+++ b/common/cmd_mmc.c
@@ -90,7 +90,8 @@ static void print_mmcinfo(struct mmc *mmc)
puts("Capacity: ");
print_size(mmc->capacity, "\n");
- printf("Bus Width: %d-bit\n", mmc->bus_width);
+ printf("Bus Width: %d-bit%s\n", mmc->bus_width,
+ mmc->ddr_mode ? " DDR" : "");
}
static struct mmc *init_mmc_device(int dev, bool force_init)
{