summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2009-01-21 17:39:11 +0000
committerimp <imp@FreeBSD.org>2009-01-21 17:39:11 +0000
commit43f8f3168fefb8779d8d073c79fd04a79aaa4d96 (patch)
treed899fd2b98e6ffc7dce47d487a996ebda60e5970 /sys
parentd3951a19a75832e8c3b95f95ed517b2b8c9b5752 (diff)
downloadFreeBSD-src-43f8f3168fefb8779d8d073c79fd04a79aaa4d96.zip
FreeBSD-src-43f8f3168fefb8779d8d073c79fd04a79aaa4d96.tar.gz
o The f_max is really at91_master_clock / 2, not 30MHz, so compute it as such.
o Only set 4-bit caps on those boards that have 4-bit caps (this means that because we don't set wire4 yet, this forces us to always use 1-bit bus). o Don't test wire4 when setting up the bus width, since bad things will happen if we do. # This likely won't fix the busted at91 sd card support, but these are # needful changes for correctness.
Diffstat (limited to 'sys')
-rw-r--r--sys/arm/at91/at91_mci.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/arm/at91/at91_mci.c b/sys/arm/at91/at91_mci.c
index f55e371..067abc2 100644
--- a/sys/arm/at91/at91_mci.c
+++ b/sys/arm/at91/at91_mci.c
@@ -199,9 +199,12 @@ at91_mci_attach(device_t dev)
goto out;
}
sc->host.f_min = 375000;
- sc->host.f_max = 30000000;
+ sc->host.f_max = at91_master_clock / 2; /* Typically 30MHz */
sc->host.host_ocr = MMC_OCR_320_330 | MMC_OCR_330_340;
- sc->host.caps = MMC_CAP_4_BIT_DATA;
+ if (sc->wire4)
+ sc->host.caps = MMC_CAP_4_BIT_DATA;
+ else
+ sc->host.caps = 0;
child = device_add_child(dev, "mmc", 0);
device_set_ivars(dev, &sc->host);
err = bus_generic_attach(dev);
@@ -294,7 +297,7 @@ at91_mci_update_ios(device_t brdev, device_t reqdev)
else
clkdiv = (at91_master_clock / ios->clock) / 2;
}
- if (ios->bus_width == bus_width_4 && sc->wire4)
+ if (ios->bus_width == bus_width_4)
WR4(sc, MCI_SDCR, RD4(sc, MCI_SDCR) | MCI_SDCR_SDCBUS);
else
WR4(sc, MCI_SDCR, RD4(sc, MCI_SDCR) & ~MCI_SDCR_SDCBUS);
OpenPOWER on IntegriCloud