示例#1
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 */
		/* EC cmd:59 data:E8 */
		ec_kbc_write_cmd(0x59);
		ec_kbc_write_ib(0xE8);

		/* Set LID GPI to generate SCIs */
		gpi_route_interrupt(EC_LID_GPI, GPI_IS_SCI);
		break;
	case APMC_ACPI_DIS:
		printk(BIOS_DEBUG, "APMC: ACPI_DIS\n");
		/* Clear all pending events */
		/* EC cmd:59 data:e9 */
		ec_kbc_write_cmd(0x59);
		ec_kbc_write_ib(0xE9);

		/* Set LID GPI to generate SMIs */
		gpi_route_interrupt(EC_LID_GPI, GPI_IS_SMI);
		break;
	}
	return 0;
}
示例#2
0
void mainboard_smi_sleep(u8 slp_typ)
{
	printk(BIOS_DEBUG, "mainboard_smi_sleep: %x\n", slp_typ);
	/* Disable SCI and SMI events */


	/* Clear pending events that may trigger immediate wake */


	/* Enable wake events */


	/* Tell the EC to Disable USB power */
	if (smm_get_gnvs()->s3u0 == 0 && smm_get_gnvs()->s3u1 == 0) {
		ec_kbc_write_cmd(0x45);
		ec_kbc_write_ib(0xF2);
	}
}
示例#3
0
文件: ec.c 项目: AdriDlu/coreboot
void parrot_ec_init(void)
{
	printk(BIOS_DEBUG, "Parrot EC Init\n");

	/* Clean up the buffers. We don't know the initial condition. */
	kbc_cleanup_buffers();

	/* Report EC info */
	/* EC version: cmd 0x51 - returns three bytes */
	ec_kbc_write_cmd(0x51);
	printk(BIOS_DEBUG,"  EC version %x.%x.%x\n",
		   ec_kbc_read_ob(), ec_kbc_read_ob(), ec_kbc_read_ob());

	/* EC Project name: cmd 0x52, 0xA0 - returns five bytes */
	ec_kbc_write_cmd(0x52);
	ec_kbc_write_ib(0xA0);
	printk(BIOS_DEBUG,"  EC Project: %c%c%c%c%c\n",
		   ec_kbc_read_ob(),ec_kbc_read_ob(),ec_kbc_read_ob(),
		   ec_kbc_read_ob(), ec_kbc_read_ob());

	/* Print the hardware revision */
	printk(BIOS_DEBUG,"  Parrot Revision %x\n", parrot_rev());

	/* US Keyboard */
	ec_kbc_write_cmd(0x59);
	ec_kbc_write_ib(0xE5);

	/* Enable IRQ1 */
	ec_kbc_write_cmd(0x59);
	ec_kbc_write_ib(0xD1);

	/* TODO - Do device detection and device maintain state (nvs) */
	/* Enable Wireless and Bluetooth */
	ec_kbc_write_cmd(0x45);
	ec_kbc_write_ib(0xAD);

	/* Set Wireless and Bluetooth Available */
	ec_kbc_write_cmd(0x45);
	ec_kbc_write_ib(0xA8);

	/* Set Wireless and Bluetooth Enable */
	ec_kbc_write_cmd(0x45);
	ec_kbc_write_ib(0xA2);
}
示例#4
0
文件: ec.c 项目: AdriDlu/coreboot
/* The keyboard matrix tells the EC how the keyboard is wired internally */
static void set_keyboard_matrix_us(void)
{
	ec_kbc_write_cmd(0x59);
	ec_kbc_write_ib(0xE5);
}
示例#5
0
文件: ec.c 项目: AdriDlu/coreboot
/* Tell EC to operate in APM mode. Events generate SMIs instead of SCIs */
static void enter_apm_mode(void)
{
	ec_kbc_write_cmd(0x59);
	ec_kbc_write_ib(0xE9);
}
示例#6
0
文件: ec.c 项目: AdriDlu/coreboot
/* Parrot Hardware Revision */
u8 parrot_rev(void)
{
	ec_kbc_write_cmd(0x45);
	ec_kbc_write_ib(0x40);
	return ec_kbc_read_ob();
}