diff options
| author | Ian Lepore <ian@FreeBSD.org> | 2013-08-18 19:08:53 +0000 |
|---|---|---|
| committer | Ian Lepore <ian@FreeBSD.org> | 2013-08-18 19:08:53 +0000 |
| commit | 677ee4943ad86772e034f1a9196b4726c083fadd (patch) | |
| tree | 4f62af8f35ca8af52fedfb235e8ad9413b6aff8a /sys/dev/sdhci | |
| parent | 7f144242fc01abffde833894738507ddc6d51729 (diff) | |
Notes
Diffstat (limited to 'sys/dev/sdhci')
| -rw-r--r-- | sys/dev/sdhci/sdhci.c | 9 | ||||
| -rw-r--r-- | sys/dev/sdhci/sdhci.h | 2 |
2 files changed, 9 insertions, 2 deletions
diff --git a/sys/dev/sdhci/sdhci.c b/sys/dev/sdhci/sdhci.c index c4afb8a41476f..1fc1358efda7c 100644 --- a/sys/dev/sdhci/sdhci.c +++ b/sys/dev/sdhci/sdhci.c @@ -835,8 +835,13 @@ sdhci_finish_command(struct sdhci_slot *slot) uint8_t extra = 0; for (i = 0; i < 4; i++) { uint32_t val = RD4(slot, SDHCI_RESPONSE + i * 4); - slot->curcmd->resp[3 - i] = (val << 8) + extra; - extra = val >> 24; + if (slot->quirks & SDHCI_QUIRK_DONT_SHIFT_RESPONSE) + slot->curcmd->resp[3 - i] = val; + else { + slot->curcmd->resp[3 - i] = + (val << 8) | extra; + extra = val >> 24; + } } } else slot->curcmd->resp[0] = RD4(slot, SDHCI_RESPONSE); diff --git a/sys/dev/sdhci/sdhci.h b/sys/dev/sdhci/sdhci.h index cda845ca17a4c..d13640933f475 100644 --- a/sys/dev/sdhci/sdhci.h +++ b/sys/dev/sdhci/sdhci.h @@ -57,6 +57,8 @@ #define SDHCI_QUIRK_BROKEN_TIMEOUT_VAL (1<<11) /* SDHCI_CAPABILITIES is invalid */ #define SDHCI_QUIRK_MISSING_CAPS (1<<12) +/* Hardware shifts the 136-bit response, don't do it in software. */ +#define SDHCI_QUIRK_DONT_SHIFT_RESPONSE (1<<13) /* * Controller registers |
