summaryrefslogtreecommitdiffstats
path: root/include/mci.h
diff options
context:
space:
mode:
authorTrent Piepho <tpiepho@kymetacorp.com>2015-11-18 21:06:46 +0000
committerSascha Hauer <s.hauer@pengutronix.de>2015-11-19 08:52:10 +0100
commite11f5908d73540005e1aca804c167dbbeb61a6a8 (patch)
tree4440cb7084226a3e317b597a2458ab3b9ae0420c /include/mci.h
parentedc1bfa1fe475031a9b652e0500393cad7f15eae (diff)
downloadbarebox-e11f5908d73540005e1aca804c167dbbeb61a6a8.tar.gz
barebox-e11f5908d73540005e1aca804c167dbbeb61a6a8.tar.xz
mci: core: bus-width property should override driver default
The OF code for parsing bus-width would only add the specified width to those the driver might have already set capability flags for. Because of this, if the driver had set 8 or 4 bit width, it wasn't possible for the DT to specify that fewer pins were used on the board and a smaller width was necessary. Change this so the width in the DT overrides whatever widths the driver says it supports. There is no reason to have an incorrect device tree and it makes far more sense for the DT to override the driver default than for the driver default to override the DT. The widths the driver puts in host_caps before calling mci_of_parse() are considered the default if the DT doesn't specify bus-width. This should cause the least amount of change to existing boards, as despite a comment that no bus-width meant to use 1 bit, using the driver default is what was really happening. Unfortunately, half of existing drivers default to the largest width they support while the other half default to the smallest. Boards should just stick the width in the device tree. Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/mci.h')
-rw-r--r--include/mci.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/mci.h b/include/mci.h
index 41a757e6de..174d15022a 100644
--- a/include/mci.h
+++ b/include/mci.h
@@ -56,6 +56,8 @@
#define MMC_CAP_SD_HIGHSPEED (1 << 3)
#define MMC_CAP_MMC_HIGHSPEED (1 << 4)
#define MMC_CAP_MMC_HIGHSPEED_52MHZ (1 << 5)
+/* Mask of all caps for bus width */
+#define MMC_CAP_BIT_DATA_MASK (MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA)
#define SD_DATA_4BIT 0x00040000