pcr.c (194679) | pcr.c (208150) |
---|---|
1/*- 2 * Copyright (c) 2009 Nathan Whitehorn 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 21 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 22 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2009 Nathan Whitehorn 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 21 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 22 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/powerpc/cpufreq/pcr.c 194679 2009-06-23 04:28:32Z nwhitehorn $"); | 28__FBSDID("$FreeBSD: head/sys/powerpc/cpufreq/pcr.c 208150 2010-05-16 15:21:13Z nwhitehorn $"); |
29 30#include <sys/param.h> 31#include <sys/systm.h> 32#include <sys/bus.h> 33#include <sys/cpu.h> 34#include <sys/kernel.h> 35#include <sys/module.h> 36 --- 160 unchanged lines hidden (view full) --- 197 198 cpu = ofw_bus_get_node(device_get_parent(dev)); 199 200 if (cpu <= 0) { 201 device_printf(dev,"No CPU device tree node!\n"); 202 return (ENXIO); 203 } 204 | 29 30#include <sys/param.h> 31#include <sys/systm.h> 32#include <sys/bus.h> 33#include <sys/cpu.h> 34#include <sys/kernel.h> 35#include <sys/module.h> 36 --- 160 unchanged lines hidden (view full) --- 197 198 cpu = ofw_bus_get_node(device_get_parent(dev)); 199 200 if (cpu <= 0) { 201 device_printf(dev,"No CPU device tree node!\n"); 202 return (ENXIO); 203 } 204 |
205 if (OF_getproplen(cpu, "power-mode-data") <= 0) { 206 /* Use the first CPU's node */ 207 cpu = OF_child(OF_parent(cpu)); 208 } 209 |
|
205 /* 206 * Collect the PCR values for each mode from the device tree. 207 * These include bus timing information, and so cannot be 208 * directly computed. 209 */ 210 sc->nmodes = OF_getproplen(cpu, "power-mode-data"); 211 if (sc->nmodes <= 0 || sc->nmodes > sizeof(sc->pcr_vals)) { 212 device_printf(dev,"No power mode data in device tree!\n"); --- 121 unchanged lines hidden --- | 210 /* 211 * Collect the PCR values for each mode from the device tree. 212 * These include bus timing information, and so cannot be 213 * directly computed. 214 */ 215 sc->nmodes = OF_getproplen(cpu, "power-mode-data"); 216 if (sc->nmodes <= 0 || sc->nmodes > sizeof(sc->pcr_vals)) { 217 device_printf(dev,"No power mode data in device tree!\n"); --- 121 unchanged lines hidden --- |