staticvoid reset_cpu(void)
{ /* * reset cpu to full speed, this is needed when enabling cpu frequency * scalling
*/
writel(readl(LOONGSON_CHIPCFG) | 0x7, LOONGSON_CHIPCFG);
}
/* reset support for fuloong2f */
staticvoid fl2f_reboot(void)
{
reset_cpu();
/* send a reset signal to south bridge. * * NOTE: if enable "Power Management" in kernel, rtl8169 will not reset * normally with this reset operation and it will not work in PMON, but * you can type halt command and then reboot, seems the hardware reset * logic not work normally.
*/
{
u32 hi, lo;
_rdmsr(DIVIL_MSR_REG(DIVIL_SOFT_RESET), &hi, &lo);
lo |= 0x00000001;
_wrmsr(DIVIL_MSR_REG(DIVIL_SOFT_RESET), hi, lo);
}
}
staticvoid fl2f_shutdown(void)
{
u32 hi, lo, val; int gpio_base;
/* get gpio base */
_rdmsr(DIVIL_MSR_REG(DIVIL_LBAR_GPIO), &hi, &lo);
gpio_base = lo & 0xff00;
/* make cs5536 gpio13 output enable */
val = inl(gpio_base + GPIOL_OUT_EN);
val &= ~(1 << (16 + 13));
val |= (1 << 13);
outl(val, gpio_base + GPIOL_OUT_EN);
mmiowb(); /* make cs5536 gpio13 output low level voltage. */
val = inl(gpio_base + GPIOL_OUT_VAL) & ~(1 << (13));
val |= (1 << (16 + 13));
outl(val, gpio_base + GPIOL_OUT_VAL);
mmiowb();
}
/* reset support for yeeloong2f and mengloong2f notebook */
staticvoid ml2f_reboot(void)
{
reset_cpu();
/* sending an reset signal to EC(embedded controller) */
ec_write(REG_RESET, BIT_RESET_ON);
}
#define yl2f89_reboot ml2f_reboot
/* menglong(7inches) laptop has different shutdown logic from 8.9inches */ #define EC_SHUTDOWN_IO_PORT_HIGH 0xff2d #define EC_SHUTDOWN_IO_PORT_LOW 0xff2e #define EC_SHUTDOWN_IO_PORT_DATA 0xff2f #define REG_SHUTDOWN_HIGH 0xFC #define REG_SHUTDOWN_LOW 0x29 #define BIT_SHUTDOWN_ON (1 << 1)
staticvoid ml2f_shutdown(void)
{
u8 val;
u64 i;
outb(REG_SHUTDOWN_HIGH, EC_SHUTDOWN_IO_PORT_HIGH);
outb(REG_SHUTDOWN_LOW, EC_SHUTDOWN_IO_PORT_LOW);
mmiowb();
val = inb(EC_SHUTDOWN_IO_PORT_DATA);
outb(val & (~BIT_SHUTDOWN_ON), EC_SHUTDOWN_IO_PORT_DATA);
mmiowb(); /* need enough wait here... how many microseconds needs? */ for (i = 0; i < 0x10000; i++)
delay();
outb(val | BIT_SHUTDOWN_ON, EC_SHUTDOWN_IO_PORT_DATA);
mmiowb();
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.