diff options
| -rw-r--r-- | drivers/mmc/host/mmci.c | 12 |
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 | */ |
| 44 | struct variant_data { | 45 | struct 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 | ||
| 49 | static struct variant_data variant_arm = { | 51 | static struct variant_data variant_arm = { |
| 52 | .datalength_bits = 16, | ||
| 50 | }; | 53 | }; |
| 51 | 54 | ||
| 52 | static struct variant_data variant_u300 = { | 55 | static 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 | ||
| 56 | static struct variant_data variant_ux500 = { | 60 | static 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 |
