Date: Tue, 13 May 2014 18:00:41 +0000 (UTC) From: Ian Lepore <ian@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265968 - stable/10/sys/powerpc/booke Message-ID: <201405131800.s4DI0fGk011750@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201405131800.s4DI0fGk011750>