Date: Mon, 15 Feb 2010 17:27:03 GMT From: Rafal Jaworowski <raj@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 174728 for review Message-ID: <201002151727.o1FHR389059025@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/chv.cgi?CH=174728 Change 174728 by raj@raj_fdt on 2010/02/15 17:26:17 Retrieve bus clock data from the DT blob and not from the [now] legacy bootinfo. Affected files ... .. //depot/projects/fdt/sys/powerpc/booke/platform_bare.c#4 edit Differences ... ==== //depot/projects/fdt/sys/powerpc/booke/platform_bare.c#4 (text+ko) ==== @@ -45,6 +45,10 @@ #include <machine/spr.h> #include <machine/vmparam.h> +#include <dev/ofw/ofw_bus.h> +#include <dev/ofw/ofw_bus_subr.h> +#include <dev/ofw/openfirm.h> + #include <powerpc/mpc85xx/mpc85xx.h> #include "platform_if.h" @@ -155,12 +159,24 @@ bare_timebase_freq(platform_t plat, struct cpuref *cpuref) { u_long ticks = -1; + phandle_t cpus, child; + pcell_t freq; + + if ((cpus = OF_finddevice("/cpus")) == 0) + goto out; + if ((child = OF_child(cpus)) == 0) + goto out; + + if (OF_getprop(child, "bus-frequency", (void *)&freq, + sizeof(freq)) <= 0) + goto out; /* * Time Base and Decrementer are updated every 8 CCB bus clocks. * HID0[SEL_TBCLK] = 0 */ - ticks = bootinfo->bi_bus_clk / 8; + ticks = freq / 8; +out: if (ticks <= 0) panic("Unable to determine timebase frequency!");
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201002151727.o1FHR389059025>