From d26eb2c1947638ccbae9284a3a3daab83945994c Mon Sep 17 00:00:00 2001 From: Nathan Whitehorn Date: Wed, 23 Oct 2013 14:28:59 +0000 Subject: [PATCH] If the device tree directly contains the timebase frequency, use it. This property is required by ePAPR, but maintain the fallback to bus-frequency for compatibility. MFC after: 2 weeks --- sys/powerpc/booke/platform_bare.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/powerpc/booke/platform_bare.c b/sys/powerpc/booke/platform_bare.c index 65fb55411c0..a3d9df7d69a 100644 --- a/sys/powerpc/booke/platform_bare.c +++ b/sys/powerpc/booke/platform_bare.c @@ -188,6 +188,10 @@ bare_timebase_freq(platform_t plat, struct cpuref *cpuref) if ((child = OF_child(cpus)) == 0) goto out; + if (OF_getprop(child, "timebase-frequency", (void *)&ticks, + sizeof(ticks)) == sizeof(ticks)) + goto out; + freq = 0; if (OF_getprop(child, "bus-frequency", (void *)&freq, sizeof(freq)) <= 0)