|
36 | 36 |
|
37 | 37 | static unsigned int fmax = 515633; |
38 | 38 |
|
| 39 | +/** |
| 40 | + * struct variant_data - MMCI variant-specific quirks |
| 41 | + * @clkreg: default value for MCICLOCK register |
| 42 | + */ |
| 43 | +struct variant_data { |
| 44 | + unsigned int clkreg; |
| 45 | +}; |
| 46 | + |
| 47 | +static struct variant_data variant_arm = { |
| 48 | +}; |
| 49 | + |
| 50 | +static struct variant_data variant_u300 = { |
| 51 | +}; |
| 52 | + |
| 53 | +static struct variant_data variant_ux500 = { |
| 54 | + .clkreg = MCI_CLK_ENABLE, |
| 55 | +}; |
39 | 56 | /* |
40 | 57 | * This must be called with host->lock held |
41 | 58 | */ |
42 | 59 | static void mmci_set_clkreg(struct mmci_host *host, unsigned int desired) |
43 | 60 | { |
44 | | - u32 clk = 0; |
| 61 | + struct variant_data *variant = host->variant; |
| 62 | + u32 clk = variant->clkreg; |
45 | 63 |
|
46 | 64 | if (desired) { |
47 | 65 | if (desired >= host->mclk) { |
@@ -563,6 +581,7 @@ static const struct mmc_host_ops mmci_ops = { |
563 | 581 | static int __devinit mmci_probe(struct amba_device *dev, struct amba_id *id) |
564 | 582 | { |
565 | 583 | struct mmci_platform_data *plat = dev->dev.platform_data; |
| 584 | + struct variant_data *variant = id->data; |
566 | 585 | struct mmci_host *host; |
567 | 586 | struct mmc_host *mmc; |
568 | 587 | int ret; |
@@ -606,6 +625,7 @@ static int __devinit mmci_probe(struct amba_device *dev, struct amba_id *id) |
606 | 625 | goto clk_free; |
607 | 626 |
|
608 | 627 | host->plat = plat; |
| 628 | + host->variant = variant; |
609 | 629 | host->mclk = clk_get_rate(host->clk); |
610 | 630 | /* |
611 | 631 | * According to the spec, mclk is max 100 MHz, |
@@ -845,19 +865,28 @@ static struct amba_id mmci_ids[] = { |
845 | 865 | { |
846 | 866 | .id = 0x00041180, |
847 | 867 | .mask = 0x000fffff, |
| 868 | + .data = &variant_arm, |
848 | 869 | }, |
849 | 870 | { |
850 | 871 | .id = 0x00041181, |
851 | 872 | .mask = 0x000fffff, |
| 873 | + .data = &variant_arm, |
852 | 874 | }, |
853 | 875 | /* ST Micro variants */ |
854 | 876 | { |
855 | 877 | .id = 0x00180180, |
856 | 878 | .mask = 0x00ffffff, |
| 879 | + .data = &variant_u300, |
857 | 880 | }, |
858 | 881 | { |
859 | 882 | .id = 0x00280180, |
860 | 883 | .mask = 0x00ffffff, |
| 884 | + .data = &variant_u300, |
| 885 | + }, |
| 886 | + { |
| 887 | + .id = 0x00480180, |
| 888 | + .mask = 0x00ffffff, |
| 889 | + .data = &variant_ux500, |
861 | 890 | }, |
862 | 891 | { 0, 0 }, |
863 | 892 | }; |
|
0 commit comments