aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorRabin Vincent <rabin.vincent@stericsson.com>2010-07-21 07:55:59 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2010-07-29 10:40:56 -0400
commit08458ef6eede6cf7d5a33c3a7c8bcdc3943012c2 (patch)
treec812872f484531e6d7a77ea14e22b7805f5856a4 /drivers/mmc
parent4380c14fd77338bac9d1da4dc5dd9f6eb4966c82 (diff)
ARM: 6246/1: mmci: support larger MMCIDATALENGTH register
The Ux500 variant has a 24-bit MMCIDATALENGTH register, as opposed to the 16-bit one on the ARM version. Acked-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/mmci.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index 379af904bf6c..7edae83603dd 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -40,22 +40,27 @@ static unsigned int fmax = 515633;
40 * struct variant_data - MMCI variant-specific quirks 40 * struct variant_data - MMCI variant-specific quirks
41 * @clkreg: default value for MCICLOCK register 41 * @clkreg: default value for MCICLOCK register
42 * @clkreg_enable: enable value for MMCICLOCK register 42 * @clkreg_enable: enable value for MMCICLOCK register
43 * @datalength_bits: number of bits in the MMCIDATALENGTH register
43 */ 44 */
44struct variant_data { 45struct variant_data {
45 unsigned int clkreg; 46 unsigned int clkreg;
46 unsigned int clkreg_enable; 47 unsigned int clkreg_enable;
48 unsigned int datalength_bits;
47}; 49};
48 50
49static struct variant_data variant_arm = { 51static struct variant_data variant_arm = {
52 .datalength_bits = 16,
50}; 53};
51 54
52static struct variant_data variant_u300 = { 55static struct variant_data variant_u300 = {
53 .clkreg_enable = 1 << 13, /* HWFCEN */ 56 .clkreg_enable = 1 << 13, /* HWFCEN */
57 .datalength_bits = 16,
54}; 58};
55 59
56static struct variant_data variant_ux500 = { 60static struct variant_data variant_ux500 = {
57 .clkreg = MCI_CLK_ENABLE, 61 .clkreg = MCI_CLK_ENABLE,
58 .clkreg_enable = 1 << 14, /* HWFCEN */ 62 .clkreg_enable = 1 << 14, /* HWFCEN */
63 .datalength_bits = 24,
59}; 64};
60/* 65/*
61 * This must be called with host->lock held 66 * This must be called with host->lock held
@@ -699,10 +704,11 @@ static int __devinit mmci_probe(struct amba_device *dev, struct amba_id *id)
699 mmc->max_phys_segs = NR_SG; 704 mmc->max_phys_segs = NR_SG;
700 705
701 /* 706 /*
702 * Since we only have a 16-bit data length register, we must 707 * Since only a certain number of bits are valid in the data length
703 * ensure that we don't exceed 2^16-1 bytes in a single request. 708 * register, we must ensure that we don't exceed 2^num-1 bytes in a
709 * single request.
704 */ 710 */
705 mmc->max_req_size = 65535; 711 mmc->max_req_size = (1 << variant->datalength_bits) - 1;
706 712
707 /* 713 /*
708 * Set the maximum segment size. Since we aren't doing DMA 714 * Set the maximum segment size. Since we aren't doing DMA