1
0
Fork 0
remarkable-uboot/drivers
Andy Fleming 7798f6dbd5 mmc: Properly determine maximum supported bus width
At some point, a confusion arose about the use of the bit
definitions in host_caps for bus widths, and the value
in ext_csd. By coincidence, a simple shift could convert
between one and the other:

MMC_MODE_1BIT = 0, EXT_CSD_BUS_WIDTH_1 = 0
MMC_MODE_4BIT = 0x100, EXT_CSD_BUS_WIDTH_4 = 1
MMC_MODE_8BIT = 0x200, EXT_CSD_BUS_WIDTH_8 = 2

However, as host_caps is a bitmask of supported things,
there is not, in fact, a one-to-one correspondence. host_caps
is capable of containing MODE_4BIT | MODE_8BIT, so nonsensical
things were happening where we would try to set the bus width
to 12.

The new code clarifies the very different namespaces:

host_caps/card_caps = bitmask (MMC_MODE_*)
ext CSD fields are just an index (EXT_CSD_BUS_WIDTH_*)
mmc->bus_width integer number of bits (1, 4, 8)

We create arrays to map between the namespaces, like in Linux.

Signed-off-by: Andy Fleming <afleming@freescale.com>
Tested-by: Jaehoon Chung <jh80.chung@samsung.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
2012-11-27 17:48:46 -06:00
..
bios_emulator Add abs() macro to return absolute value 2012-05-15 08:31:37 +02:00
block drivers/block/: sparse fixes 2012-11-04 11:00:37 -07:00
bootcount Consolidate bootcount code into drivers/bootcount 2012-09-01 14:26:02 +02:00
dfu dfu:usb:fix: Read the "filesize" environment variable only when file read 2012-09-21 00:05:00 +02:00
dma MX28: DMA: Prolong the DMA timeout 2012-09-01 14:58:29 +02:00
fpga FPGA: Cyclon II: Correctly reset the FPGA before configuration 2012-10-29 14:21:20 -07:00
gpio drivers/gpio/mpc83xx_gpio.c: sparse fixes 2012-11-04 11:00:37 -07:00
hwmon hwmon: do not init sensors on startup 2011-08-04 23:30:38 +02:00
i2c Merge branch 'master' of git://git.denx.de/u-boot-arm 2012-10-26 15:44:31 -07:00
input drivers/input/input.c: sparse fix 2012-11-04 11:00:37 -07:00
misc powerpc/mpc8xxx: move LAW code into arch/powerpc/cpu/mpc8xxx 2012-11-26 15:41:22 -06:00
mmc mmc: Properly determine maximum supported bus width 2012-11-27 17:48:46 -06:00
mtd nand: Add torture feature 2012-11-26 15:41:29 -06:00
net drivers/net/: sparse fixes 2012-11-04 11:00:36 -07:00
pci powerpc/boot: Change the compile macro for SRIO & PCIE boot master module 2012-10-22 15:52:46 -05:00
pcmcia PXA: Remove PXA PCMCIA support 2012-03-26 23:09:23 +02:00
power power:pmic: Rename CONFIG_DIALOG_PMIC defines to CONFIG_DIALOG_POWER 2012-11-14 11:21:12 +01:00
qe mpc83xx: add support for mpc8309 2012-10-23 15:23:26 -05:00
rtc pmic: Extend PMIC framework to support multiple instances of PMIC devices 2012-11-14 11:21:09 +01:00
serial serial/ns16550: wait for TEMT before initializing 2012-11-26 15:41:20 -06:00
spi Merge remote-tracking branch 'u-boot-ti/master' 2012-10-26 07:00:28 +02:00
tpm Introduce generic TPM support in u-boot 2011-12-07 08:45:51 +01:00
twserial Switch from archive libraries to partial linking 2010-11-17 21:02:18 +01:00
usb Remove obsolete header file 2012-11-27 09:41:10 -07:00
video Video: fix compiler warnings in bus_vcxk 2012-11-14 12:27:49 +01:00
watchdog dm: wdt: arm: Move tnetv107x into drivers/watchdog/ 2012-10-18 06:52:02 +02:00