summaryrefslogtreecommitdiffstats
path: root/sys/dev/esp
diff options
context:
space:
mode:
authorscottl <scottl@FreeBSD.org>2004-09-13 15:15:38 +0000
committerscottl <scottl@FreeBSD.org>2004-09-13 15:15:38 +0000
commit26d40a801f18edf3ea44321899f2eefeb4abbe1e (patch)
tree79caf4f2064197a88210fd85b832731c021c7e6e /sys/dev/esp
parenta5693287e110eb43ec8e5c95e9f77f3c6355b060 (diff)
downloadFreeBSD-src-26d40a801f18edf3ea44321899f2eefeb4abbe1e.zip
FreeBSD-src-26d40a801f18edf3ea44321899f2eefeb4abbe1e.tar.gz
Pull the correct clock frequency value out of OFW. Why the helper function
doesn't do this is beyond me, but that will be investigated later. This results in programming the chip with the correct frequency, which in turn allows devices to negotiate up to the full 20MB/s.
Diffstat (limited to 'sys/dev/esp')
-rw-r--r--sys/dev/esp/esp_sbus.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/esp/esp_sbus.c b/sys/dev/esp/esp_sbus.c
index eb32f1d..ba8f382 100644
--- a/sys/dev/esp/esp_sbus.c
+++ b/sys/dev/esp/esp_sbus.c
@@ -193,8 +193,12 @@ esp_sbus_attach(device_t dev)
node = ofw_bus_get_node(dev);
if (OF_getprop(node, "initiator-id", &sc->sc_id,
sizeof(sc->sc_id)) == -1)
- sc->sc_id = 7;;
- sc->sc_freq = sbus_get_clockfreq(dev);
+ sc->sc_id = 7;
+ if (OF_getprop(node, "clock-frequency", &sc->sc_freq,
+ sizeof(sc->sc_freq)) == -1) {
+ printf("failed to query OFW for clock-frequency\n");
+ sc->sc_freq = sbus_get_clockfreq(dev);
+ }
#ifdef ESP_SBUS_DEBUG
device_printf(dev, "espattach_sbus: sc_id %d, freq %d\n",
OpenPOWER on IntegriCloud