diff options
Diffstat (limited to 'drivers/mmc/host/mmci.c')
-rw-r--r-- | drivers/mmc/host/mmci.c | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 1bcbdd6763ac..2909bbc8ad00 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c | |||
@@ -430,6 +430,8 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) | |||
430 | clk = 255; | 430 | clk = 255; |
431 | host->cclk = host->mclk / (2 * (clk + 1)); | 431 | host->cclk = host->mclk / (2 * (clk + 1)); |
432 | } | 432 | } |
433 | if (host->hw_designer == 0x80) | ||
434 | clk |= MCI_FCEN; /* Bug fix in ST IP block */ | ||
433 | clk |= MCI_CLK_ENABLE; | 435 | clk |= MCI_CLK_ENABLE; |
434 | } | 436 | } |
435 | 437 | ||
@@ -440,15 +442,27 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) | |||
440 | case MMC_POWER_OFF: | 442 | case MMC_POWER_OFF: |
441 | break; | 443 | break; |
442 | case MMC_POWER_UP: | 444 | case MMC_POWER_UP: |
443 | pwr |= MCI_PWR_UP; | 445 | /* The ST version does not have this, fall through to POWER_ON */ |
444 | break; | 446 | if (host->hw_designer != 0x80) { |
447 | pwr |= MCI_PWR_UP; | ||
448 | break; | ||
449 | } | ||
445 | case MMC_POWER_ON: | 450 | case MMC_POWER_ON: |
446 | pwr |= MCI_PWR_ON; | 451 | pwr |= MCI_PWR_ON; |
447 | break; | 452 | break; |
448 | } | 453 | } |
449 | 454 | ||
450 | if (ios->bus_mode == MMC_BUSMODE_OPENDRAIN) | 455 | if (ios->bus_mode == MMC_BUSMODE_OPENDRAIN) { |
451 | pwr |= MCI_ROD; | 456 | if (host->hw_designer != 0x80) |
457 | pwr |= MCI_ROD; | ||
458 | else { | ||
459 | /* | ||
460 | * The ST Micro variant use the ROD bit for something | ||
461 | * else and only has OD (Open Drain). | ||
462 | */ | ||
463 | pwr |= MCI_OD; | ||
464 | } | ||
465 | } | ||
452 | 466 | ||
453 | writel(clk, host->base + MMCICLOCK); | 467 | writel(clk, host->base + MMCICLOCK); |
454 | 468 | ||
@@ -500,6 +514,12 @@ static int mmci_probe(struct amba_device *dev, void *id) | |||
500 | } | 514 | } |
501 | 515 | ||
502 | host = mmc_priv(mmc); | 516 | host = mmc_priv(mmc); |
517 | /* Bits 12 thru 19 is the designer */ | ||
518 | host->hw_designer = (dev->periphid >> 12) & 0xff; | ||
519 | /* Bits 20 thru 23 is the revison */ | ||
520 | host->hw_revision = (dev->periphid >> 20) & 0xf; | ||
521 | DBG(host, "designer ID = 0x%02x\n", host->hw_designer); | ||
522 | DBG(host, "revision = 0x%01x\n", host->hw_revision); | ||
503 | host->clk = clk_get(&dev->dev, NULL); | 523 | host->clk = clk_get(&dev->dev, NULL); |
504 | if (IS_ERR(host->clk)) { | 524 | if (IS_ERR(host->clk)) { |
505 | ret = PTR_ERR(host->clk); | 525 | ret = PTR_ERR(host->clk); |
@@ -693,6 +713,15 @@ static struct amba_id mmci_ids[] = { | |||
693 | .id = 0x00041181, | 713 | .id = 0x00041181, |
694 | .mask = 0x000fffff, | 714 | .mask = 0x000fffff, |
695 | }, | 715 | }, |
716 | /* ST Micro variants */ | ||
717 | { | ||
718 | .id = 0x00180180, | ||
719 | .mask = 0x00ffffff, | ||
720 | }, | ||
721 | { | ||
722 | .id = 0x00280180, | ||
723 | .mask = 0x00ffffff, | ||
724 | }, | ||
696 | { 0, 0 }, | 725 | { 0, 0 }, |
697 | }; | 726 | }; |
698 | 727 | ||