Forget current bus power settings on full reset. Chip must be reconfigured.

Do not issue command if there is no card, clock or power.
Controller will not detect command timeout without clock active.
This commit is contained in:
Alexander Motin 2008-12-06 01:31:07 +00:00
parent f283c8f8fc
commit d8208d9eb1

View File

@ -301,8 +301,10 @@ sdhci_reset(struct sdhci_slot *slot, uint8_t mask)
WR1(slot, SDHCI_SOFTWARE_RESET, mask);
if (mask & SDHCI_RESET_ALL)
if (mask & SDHCI_RESET_ALL) {
slot->clock = 0;
slot->power = 0;
}
/* Wait max 100 ms */
timeout = 100;
@ -904,8 +906,11 @@ sdhci_start_command(struct sdhci_slot *slot, struct mmc_command *cmd)
/* Read controller present state. */
state = RD4(slot, SDHCI_PRESENT_STATE);
/* Do not issue command if there is no card. */
if ((state & SDHCI_CARD_PRESENT) == 0) {
/* Do not issue command if there is no card, clock or power.
* Controller will not detect timeout without clock active. */
if ((state & SDHCI_CARD_PRESENT) == 0 ||
slot->power == 0 ||
slot->clock == 0) {
cmd->error = MMC_ERR_FAILED;
slot->req = NULL;
slot->curcmd = NULL;