ppm_plat.c revision 5cff782560a1c3cf913ba5574a5123a299f3315e
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Platform Power Management master pseudo driver platform support.
*/
static struct ppm_domit *
{
;
return (domit_p);
}
void
ppm_rebuild_cpu_domains(void)
{
char *str = "ppm_rebuild_cpu_domains";
/*
* Get the CPU domain data
*/
/*
* Find the CPU domain created from ppm.conf. It's only a
* temporary domain used to make sure that all CPUs are
* claimed. There should only be one such domain defined.
*/
;
str);
return;
}
return;
}
}
/*
* It is quite possible that the platform does not contain any
* power manageable CPUs. If so, devlist will be NULL.
*/
return;
}
/*
* Get the CPU dependencies as determined by the CPU driver. If
* the CPU driver didn't create a valid set of dependencies, then
* default to all CPUs in one domain.
*/
str);
return;
}
/*
* Build real CPU domains. OFFLINE the old one as we don't
* want it to be used when we're done.
*/
/*
* Add devices to new domain. As a precaution,
* make sure that the device is currently owned by the
* ppm.conf defined CPU domain. Adding the device to the
* domain will result in the domain's "devlist" and "owned"
* lists being properly formed. It will also update the
* dip pointer to the device structure. We have to manually
* build the "conflist" for the domain. But conveniently, the
* "conflist" data is easily obtainable from the "devlist".
*/
KM_SLEEP);
}
/*
* Note that we do not bother creating a "dc" list as there
* isn't one for x86 CPU power management. If this changes
* in the future some more work will need to be done to
* support it.
*/
/*
* Add the domain to the live list.
*/
ppm_domain_p = domp;
}
}
/*
* Used by ppm_redefine_topspeed() to set the highest power level of all CPUs
* in a domain.
*/
void
{
}
/*
* Redefine the highest power level for all CPUs in a domain. This
* functionality is necessary because ACPI uses the _PPC to define
* a CPU's highest power level *and* allows the _PPC to be redefined
* dynamically. _PPC changes are communicated through _PPC change
* notifications caught by the CPU device driver.
*/
void
ppm_redefine_topspeed(void *ctx)
{
char *str = "ppm_redefine_topspeed";
int topspeed;
int newspeed = -1;
"since cpupm interfaces are not initialized", str,
return;
}
"notification before PPMD_CPU_READY", str,
return;
}
/*
* Process each CPU in the domain.
*/
}
}
/*
* Traverses all domains looking for CPU domains and for each CPU domain
* redefines the topspeed for that domain. The reason that this is necessary
* is that on x86 platforms ACPI allows the highest power level to be
* redefined dynamically. Once all CPU devices have been started it we
* need to go back and reinitialize the topspeeds (just in case it's changed).
*/
void
ppm_init_topspeed(void)
{
continue;
continue;
}
}
/*
* For x86 platforms CPU domains must be built dynamically at bootime.
* Until the domains have been built, refuse all power transition
* requests.
*/
/* ARGSUSED */
{
"before it was ready dip(0x%p)", (void *)dip));
return (B_TRUE);
}
*result = DDI_FAILURE;
return (B_FALSE);
}
int
{
#ifdef DEBUG
char *str = "ppm_change_cpu_power";
#endif
int oldlevel;
int ret;
return (DDI_SUCCESS);
/* bring each cpu to next level */
if (ret == DDI_SUCCESS) {
continue;
}
/*
* If the driver was unable to lower cpu speed,
* the cpu probably got busy. Best to change
* speed back to normal.
*/
}
return (ret);
}
return (DDI_SUCCESS);
}