Пример #1
0
void ec_mem_write(u8 addr, u8 data)
{
	ec_write_cmd(EC_CMD_WRITE_RAM);
	ec_write_ib(addr);
	ec_write_ib(data);
	return;
}
Пример #2
0
void mainboard_suspend_resume(void)
{
    /* Call SMM finalize() handlers before resume */
    outb(0xcb, 0xb2);

    /* Stout EC needs to be put back in ACPI mode */
    ec_write_cmd(EC_CMD_NOTIFY_ACPI_ENTER);
}
Пример #3
0
int mainboard_smi_apmc(u8 apmc)
{
	printk(BIOS_DEBUG, "mainboard_smi_apmc: %x\n", apmc);
	switch (apmc) {
	case APMC_ACPI_EN:
		printk(BIOS_DEBUG, "APMC: ACPI_EN\n");
		/* Clear all pending events and enable SCI */
		ec_write_cmd(EC_CMD_ENABLE_ACPI_MODE);
		break;

	case APMC_ACPI_DIS:
		printk(BIOS_DEBUG, "APMC: ACPI_DIS\n");
		/* Clear all pending events and tell the EC that ACPI is disabled */
		ec_write_cmd(EC_CMD_DISABLE_ACPI_MODE);
		break;
	}
	return 0;
}
Пример #4
0
u8 ec_it8518_get_event(void)
{
	u8 cmd = 0;
	u8 status = inb(EC_SC);
	if (status & SCI_EVT) 	{
		ec_write_cmd(QR_EC);
		cmd = ec_read_ob();
	} else if ( status & SMI_EVT) {
		ec_kbc_write_cmd(EC_KBD_SMI_EVENT);
		cmd = ec_kbc_read_ob();
	}
	return cmd;
}
Пример #5
0
	/*
	 * The Stout EC needs to be reset to RW mode. It is important that
	 * the RTC_PWR_STS is not set until ramstage EC init.
	 */
static void early_ec_init(void)
{
	u8 ec_status = ec_read(EC_STATUS_REG);
	int rec_mode = get_recovery_mode_switch();

	if (((ec_status & 0x3) == EC_IN_RO_MODE) ||
	    ((ec_status & 0x3) == EC_IN_RECOVERY_MODE)) {

		printk(BIOS_DEBUG, "EC Cold Boot Detected\n");
		if (!rec_mode) {
			/*
			 * Tell EC to exit RO mode
			 */
			printk(BIOS_DEBUG, "EC will exit RO mode and boot normally\n");
			ec_write_cmd(EC_CMD_EXIT_BOOT_BLOCK);
			die("wait for ec to reset");
		}
	} else {
		printk(BIOS_DEBUG, "EC Warm Boot Detected\n");
		ec_write_cmd(EC_CMD_WARM_RESET);
	}
}
Пример #6
0
void ec_write(u16 addr, u8 data)
{
	ec_write_cmd(WR_EC);
	ec_write_ib(addr);
	ec_write_ib(data);
}
Пример #7
0
u8 ec_read(u16 addr)
{
	ec_write_cmd(RD_EC);
	ec_write_ib(addr);
	return ec_read_ob();
}
Пример #8
0
/*
 * These functions are for accessing the ENE932 device RAM space
 */
u8 ec_mem_read(u8 addr)
{
	ec_write_cmd(EC_CMD_READ_RAM);
	ec_write_ib(addr);
	return ec_read_ob();
}
Пример #9
0
void mainboard_suspend_resume(void)
{
	/* Stout EC needs to be put back in ACPI mode */
	ec_write_cmd(EC_CMD_NOTIFY_ACPI_ENTER);
}