From 4c2ca0f7c8d042cca3823658bfb10560865cb06a Mon Sep 17 00:00:00 2001 From: Scott Long Date: Mon, 13 Sep 2004 15:15:38 +0000 Subject: [PATCH] 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. --- sys/dev/esp/esp_sbus.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/dev/esp/esp_sbus.c b/sys/dev/esp/esp_sbus.c index eb32f1dde386..ba8f38209ad4 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",