aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorPhilippe Langlais <philippe.langlais@stericsson.com>2011-03-25 03:51:52 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2011-05-26 05:33:35 -0400
commit1784b157c89cd2b5e6a3840abfdab6ed51f31d86 (patch)
tree22d0a9425f5cc2881f10fd76846ca8960d56fe8f /drivers/mmc
parent729303191ef4bd5df4c5e9ffca62268758928b2c (diff)
ARM: 6832/1: mmci: support for ST-Ericsson db8500v2
ST-Ericsson modified ARM PrimeCell PL180 block has not got an updated corresponding amba-id, althought the IP block has changed in db8500v2. The change was done to the datactrl register. Using the overrided subversion ID, account for this. Signed-off-by: Philippe Langlais <philippe.langlais@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/mmci.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index 4941e06fe2e1..5da5bea0f9f0 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -51,6 +51,7 @@ static unsigned int fmax = 515633;
51 * is asserted (likewise for RX) 51 * is asserted (likewise for RX)
52 * @sdio: variant supports SDIO 52 * @sdio: variant supports SDIO
53 * @st_clkdiv: true if using a ST-specific clock divider algorithm 53 * @st_clkdiv: true if using a ST-specific clock divider algorithm
54 * @blksz_datactrl16: true if Block size is at b16..b30 position in datactrl register
54 */ 55 */
55struct variant_data { 56struct variant_data {
56 unsigned int clkreg; 57 unsigned int clkreg;
@@ -60,6 +61,7 @@ struct variant_data {
60 unsigned int fifohalfsize; 61 unsigned int fifohalfsize;
61 bool sdio; 62 bool sdio;
62 bool st_clkdiv; 63 bool st_clkdiv;
64 bool blksz_datactrl16;
63}; 65};
64 66
65static struct variant_data variant_arm = { 67static struct variant_data variant_arm = {
@@ -92,6 +94,17 @@ static struct variant_data variant_ux500 = {
92 .st_clkdiv = true, 94 .st_clkdiv = true,
93}; 95};
94 96
97static struct variant_data variant_ux500v2 = {
98 .fifosize = 30 * 4,
99 .fifohalfsize = 8 * 4,
100 .clkreg = MCI_CLK_ENABLE,
101 .clkreg_enable = MCI_ST_UX500_HWFCEN,
102 .datalength_bits = 24,
103 .sdio = true,
104 .st_clkdiv = true,
105 .blksz_datactrl16 = true,
106};
107
95/* 108/*
96 * This must be called with host->lock held 109 * This must be called with host->lock held
97 */ 110 */
@@ -465,7 +478,10 @@ static void mmci_start_data(struct mmci_host *host, struct mmc_data *data)
465 blksz_bits = ffs(data->blksz) - 1; 478 blksz_bits = ffs(data->blksz) - 1;
466 BUG_ON(1 << blksz_bits != data->blksz); 479 BUG_ON(1 << blksz_bits != data->blksz);
467 480
468 datactrl = MCI_DPSM_ENABLE | blksz_bits << 4; 481 if (variant->blksz_datactrl16)
482 datactrl = MCI_DPSM_ENABLE | (data->blksz << 16);
483 else
484 datactrl = MCI_DPSM_ENABLE | blksz_bits << 4;
469 485
470 if (data->flags & MMC_DATA_READ) 486 if (data->flags & MMC_DATA_READ)
471 datactrl |= MCI_DPSM_DIRECTION; 487 datactrl |= MCI_DPSM_DIRECTION;
@@ -1311,9 +1327,14 @@ static struct amba_id mmci_ids[] = {
1311 }, 1327 },
1312 { 1328 {
1313 .id = 0x00480180, 1329 .id = 0x00480180,
1314 .mask = 0x00ffffff, 1330 .mask = 0xf0ffffff,
1315 .data = &variant_ux500, 1331 .data = &variant_ux500,
1316 }, 1332 },
1333 {
1334 .id = 0x10480180,
1335 .mask = 0xf0ffffff,
1336 .data = &variant_ux500v2,
1337 },
1317 { 0, 0 }, 1338 { 0, 0 },
1318}; 1339};
1319 1340