svn commit: r281863 - head/sys/arm/broadcom/bcm2835
Luiz Otavio O Souza
loos at FreeBSD.org
Wed Apr 22 18:35:03 UTC 2015
Author: loos
Date: Wed Apr 22 18:35:02 2015
New Revision: 281863
URL: https://svnweb.freebsd.org/changeset/base/281863
Log:
Fetch the SDHCI frequency from videocore (our prefered source) and only if
it fails, fetch the clock-frequency from DTB.
If both methods fail, use the hardcoded default.
Modified:
head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c
Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c
==============================================================================
--- head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Wed Apr 22 18:15:18 2015 (r281862)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Wed Apr 22 18:35:02 2015 (r281863)
@@ -181,17 +181,16 @@ bcm_sdhci_attach(device_t dev)
if (err == 0) {
/* Convert to MHz */
default_freq /= 1000000;
- if (bootverbose)
- device_printf(dev, "default frequency: %dMHz\n",
- default_freq);
+ }
+ if (default_freq == 0) {
+ node = ofw_bus_get_node(sc->sc_dev);
+ if ((OF_getencprop(node, "clock-frequency", &cell,
+ sizeof(cell))) > 0)
+ default_freq = cell / 1000000;
}
if (default_freq == 0)
default_freq = BCM2835_DEFAULT_SDHCI_FREQ;
- node = ofw_bus_get_node(sc->sc_dev);
- if ((OF_getprop(node, "clock-frequency", &cell, sizeof(cell))) > 0)
- default_freq = fdt32_to_cpu(cell)/1000000;
-
if (bootverbose)
device_printf(dev, "SDHCI frequency: %dMHz\n", default_freq);
More information about the svn-src-head
mailing list