/*
* 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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Schizo Power Management Driver
*
* This driver deals with Safari bus interface and it is used
* as part of the protocol to change the clock speed on Safari bus.
*
* The routine on this driver is referenced by Platform Power
* Management driver of systems like Excalibur. Driver is
* loaded because of an explicit dependency defined in PPM driver.
* PPM driver also attaches the driver.
*/
/*
* Function prototypes
*/
/*
* Private data for schizo_pm driver
*/
struct spm_soft_state {
};
/*
* Configuration data structures
*/
DEVO_REV, /* devo_rev, */
0, /* refcnt */
nodev, /* getinfo */
nulldev, /* identify */
nulldev, /* probe */
spm_attach, /* attach */
spm_detach, /* detach */
nodev, /* reset */
(struct cb_ops *)0, /* cb_ops */
(struct bus_ops *)0, /* bus_ops */
NULL, /* power */
ddi_quiesce_not_supported, /* devo_quiesce */
};
/*
* Driver globals
*/
static void *spm_state;
&mod_driverops, /* Type of module = driver */
"schizo pm driver", /* name of module */
&spm_ops, /* driver ops */
};
(void *)&modldrv,
};
/*
* Schizo CSR E* bit masks
*/
/*
* bit masks to set schizo clock in parallel with setting cpu clock.
* Used when changing cpu speeds.
*
* NOTE: The order of entries must be from slowest to fastest.
*/
};
/*
* Normally, the address of the registers we use would be accessed from
* our "official" private data. However, since the dip is not passed
* in when spm_change_speed (see below) is called, and since there is
* only one unit of the spm "device", we keep it here as a static.
*/
int
_init(void)
{
int error;
sizeof (struct spm_soft_state), 0)) != 0)
return (error);
return (error);
}
int
_fini(void)
{
int error;
return (error);
}
int
{
}
static int
{
int rv;
switch (cmd) {
case DDI_ATTACH:
if (spm_inst != -1) {
"only one instance is allowed.");
return (DDI_FAILURE);
}
break;
case DDI_RESUME:
return (DDI_SUCCESS);
default:
return (DDI_FAILURE);
}
return (DDI_FAILURE);
}
return (DDI_FAILURE);
}
/*
* Map the Safari E* Control register.
*/
if (rv != DDI_SUCCESS) {
return (rv);
}
return (DDI_SUCCESS);
}
/*ARGSUSED*/
static int
{
switch (cmd) {
case DDI_SUSPEND:
return (DDI_SUCCESS);
case DDI_DETACH:
return (DDI_FAILURE);
default:
return (DDI_FAILURE);
}
}
/*
* This globally visible function is the main reason this driver exists.
* It will be called by a platform power management driver to write to
* the schizo ASIC csr which changes schizo's clock rate. This is a
* required step when changing the clock of the cpus.
*
* NOTE - The caller should enter this routine sequentially.
*/
void
{
}