svn commit: r265968 - stable/10/sys/powerpc/booke
Ian Lepore
ian at FreeBSD.org
Tue May 13 18:00:42 UTC 2014
Author: ian
Date: Tue May 13 18:00:41 2014
New Revision: 265968
URL: http://svnweb.freebsd.org/changeset/base/265968
Log:
MFC r256973, r256974
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. Allow 32 or 64 bits.
Modified:
stable/10/sys/powerpc/booke/platform_bare.c
Modified: stable/10/sys/powerpc/booke/platform_bare.c
==============================================================================
--- stable/10/sys/powerpc/booke/platform_bare.c Tue May 13 17:59:17 2014 (r265967)
+++ stable/10/sys/powerpc/booke/platform_bare.c Tue May 13 18:00:41 2014 (r265968)
@@ -188,6 +188,25 @@ bare_timebase_freq(platform_t plat, stru
if ((child = OF_child(cpus)) == 0)
goto out;
+ switch (OF_getproplen(child, "timebase-frequency")) {
+ case 4:
+ {
+ uint32_t tbase;
+ OF_getprop(child, "timebase-frequency", &tbase, sizeof(tbase));
+ ticks = tbase;
+ return (ticks);
+ }
+ case 8:
+ {
+ uint64_t tbase;
+ OF_getprop(child, "timebase-frequency", &tbase, sizeof(tbase));
+ ticks = tbase;
+ return (ticks);
+ }
+ default:
+ break;
+ }
+
freq = 0;
if (OF_getprop(child, "bus-frequency", (void *)&freq,
sizeof(freq)) <= 0)
More information about the svn-src-stable-10
mailing list