diff options
author | Louis Yung-Chieh Lo <yjlou@chromium.org> | 2012-01-20 14:33:15 +0800 |
---|---|---|
committer | Louis Yung-Chieh Lo <yjlou@chromium.org> | 2012-02-02 20:51:45 +0800 |
commit | 7e8d739b3885a9180e0cf3fd01eae13779440832 (patch) | |
tree | 6012aeda0974c97f1b0c897e8da060f08981c8f0 /include/lpc.h | |
parent | 965987eeac617d0efc932242b697e3ed55b6a667 (diff) | |
download | chrome-ec-7e8d739b3885a9180e0cf3fd01eae13779440832.tar.gz |
Fix the missing IRQ problem.
The problem comes from the different assumption of interrupt mode in EC and
the PCH. The PCH assumes IRQ1 is edge-triggered and triggered at a rising edge.
However, the auto-IRQ functino of EC is level-triggered and uses low-active to
assert an IRQ. This makes the deadlock so that the kernel never gets an
interrupt until a byte is manually pulled from host.
So, the solution is manually firing an IRQ_1 to host after EC puts a byte to
port 0x60. Note that the auto IRQ needs to be disabled in order to avoid
the interference with manual IRQ generation.
This CL also moves chip specific code to lm4/lpc.c and handle some minor
keyboard commands.
BUG=none
TEST=on hacked baord.
Change-Id: Ib57f5a4d749cb019e4c3c00da110054c4f335c7b
Diffstat (limited to 'include/lpc.h')
-rw-r--r-- | include/lpc.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/lpc.h b/include/lpc.h index 8cf87668f6..94b92b41bb 100644 --- a/include/lpc.h +++ b/include/lpc.h @@ -10,6 +10,13 @@ #include "common.h" + +/* Manually generates an IRQ to host. + * Note that the irq_num == 0 would set the AH bit (Active High). + */ +void lpc_manual_irq(int irq_num); + + /* Initializes the LPC module. */ int lpc_init(void); @@ -25,6 +32,12 @@ uint8_t *lpc_get_host_range(int slot); * commands, 1 for usermode-originated commands. */ void lpc_send_host_response(int slot, int status); +/* Return true if the TOH is still set */ +int lpc_keyboard_has_char(void); + +/* Send a byte to host via port 0x60 and asserts IRQ if specified. */ +void lpc_keyboard_put_char(uint8_t chr, int send_irq); + /* Returns non-zero if the COMx interface has received a character. */ int lpc_comx_has_char(void); |