void pm1_ibf_interrupt(void) { int is_cmd; uint8_t value, result; if (pm_get_status(LPC_ACPI_CMD) & EC_LPC_STATUS_FROM_HOST) { /* Set the busy bit */ pm_set_status(LPC_ACPI_CMD, EC_LPC_STATUS_PROCESSING, 1); /* data from command port or data port */ is_cmd = pm_get_status(LPC_ACPI_CMD) & EC_LPC_STATUS_LAST_CMD; /* Get command or data */ value = pm_get_data_in(LPC_ACPI_CMD); /* Handle whatever this was. */ if (acpi_ap_to_ec(is_cmd, value, &result)) pm_put_data_out(LPC_ACPI_CMD, result); /* Clear the busy bit */ pm_set_status(LPC_ACPI_CMD, EC_LPC_STATUS_PROCESSING, 0); /* * ACPI 5.0-12.6.1: Generate SCI for Input Buffer Empty * Output Buffer Full condition on the kernel channel. */ lpc_generate_sci(); } task_clear_pending_irq(IT83XX_IRQ_PMC_IN); }
void acpi_0_interrupt(void) { uint8_t value, result, is_cmd; is_cmd = MEC1322_ACPI_EC_STATUS(0) & EC_LPC_STATUS_LAST_CMD; /* Set the bust bi */ MEC1322_ACPI_EC_STATUS(0) |= EC_LPC_STATUS_PROCESSING; /* Read command/data; this clears the FRMH bit. */ value = MEC1322_ACPI_EC_OS2EC(0, 0); /* Handle whatever this was. */ if (acpi_ap_to_ec(is_cmd, value, &result)) MEC1322_ACPI_EC_EC2OS(0, 0) = result; /* Clear the busy bit */ MEC1322_ACPI_EC_STATUS(0) &= ~EC_LPC_STATUS_PROCESSING; /* * ACPI 5.0-12.6.1: Generate SCI for Input Buffer Empty / Output Buffer * Full condition on the kernel channel. */ lpc_generate_sci(); }
/** * Handle write to ACPI I/O port * * @param is_cmd Is write command (is_cmd=1) or data (is_cmd=0) */ static void handle_acpi_write(int is_cmd) { uint8_t value, result; /* Read command/data; this clears the FRMH status bit. */ value = NPCX_HIPMDI(PMC_ACPI); /* Handle whatever this was. */ if (acpi_ap_to_ec(is_cmd, value, &result)) NPCX_HIPMDO(PMC_ACPI) = result; /* * ACPI 5.0-12.6.1: Generate SCI for Input Buffer Empty / Output Buffer * Full condition on the kernel channel. */ lpc_generate_sci(); }
/** * Handle write to ACPI I/O port * * @param is_cmd Is write command (is_cmd=1) or data (is_cmd=0) */ static void handle_acpi_write(int is_cmd) { uint8_t value, result; /* Set processing flag before reading command byte */ SET_BIT(NPCX_HIPMST(PMC_ACPI), NPCX_HIPMST_F0); /* Read command/data; this clears the FRMH status bit. */ value = NPCX_HIPMDI(PMC_ACPI); /* Handle whatever this was. */ if (acpi_ap_to_ec(is_cmd, value, &result)) NPCX_HIPMDO(PMC_ACPI) = result; /* Clear processing flag */ CLEAR_BIT(NPCX_HIPMST(PMC_ACPI), NPCX_HIPMST_F0); /* * ACPI 5.0-12.6.1: Generate SCI for Input Buffer Empty / Output Buffer * Full condition on the kernel channel. */ lpc_generate_sci(); }
/** * Handle write to ACPI I/O port * * @param is_cmd Is write command (is_cmd=1) or data (is_cmd=0) */ static void handle_acpi_write(int is_cmd) { uint8_t value, result; /* Set the busy bit */ LM4_LPC_ST(LPC_CH_ACPI) |= LM4_LPC_ST_BUSY; /* Read command/data; this clears the FRMH status bit. */ value = LPC_POOL_ACPI[0]; /* Handle whatever this was. */ if (acpi_ap_to_ec(is_cmd, value, &result)) LPC_POOL_ACPI[1] = result; /* Clear the busy bit */ LM4_LPC_ST(LPC_CH_ACPI) &= ~LM4_LPC_ST_BUSY; /* * ACPI 5.0-12.6.1: Generate SCI for Input Buffer Empty / Output Buffer * Full condition on the kernel channel. */ lpc_generate_sci(); }