summaryrefslogtreecommitdiff
path: root/chip/mec1322/lpc.c
diff options
context:
space:
mode:
authorVic (Chun-Ju) Yang <victoryang@chromium.org>2014-01-16 16:02:09 +0800
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-01-17 18:06:58 +0000
commit83d082a1f2173da5e087d3a853096cd9b720bc26 (patch)
tree2a1bc3c418b36f0fe2ede92d9cde54e2d387df5a /chip/mec1322/lpc.c
parentca9c2744eace5c803a948502c032f99d602a0566 (diff)
downloadchrome-ec-83d082a1f2173da5e087d3a853096cd9b720bc26.tar.gz
mec1322: Use EMI module for port 80
EMI module is the only LPC module suitable for port 80 implementation, and thus let's move it to 0x80. Consequently the EMI mapped memory is moved to 0x82-0x87. BUG=chrome-os-partner:24107 TEST=Write to port 80 and see the data printed to console BRANCH=None Change-Id: I7d749650d6d109af2941a1db6e6c4a32e7482f61 Signed-off-by: Vic (Chun-Ju) Yang <victoryang@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/182796 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'chip/mec1322/lpc.c')
-rw-r--r--chip/mec1322/lpc.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/chip/mec1322/lpc.c b/chip/mec1322/lpc.c
index 7974940e34..2e76b6c39e 100644
--- a/chip/mec1322/lpc.c
+++ b/chip/mec1322/lpc.c
@@ -12,6 +12,7 @@
#include "host_command.h"
#include "keyboard_protocol.h"
#include "lpc.h"
+#include "port80.h"
#include "registers.h"
#include "task.h"
#include "timer.h"
@@ -186,16 +187,16 @@ static void setup_lpc(void)
/* TODO(crosbug.com/p/24107): Route KIRQ to SER_IRQ1 */
- /* Set up EMI module for memory mapped region.
- * TODO(crosbug.com/p/24107): Use LPC memory transaction for this
- * when we have updated info of memory BAR
- * register.
- */
- MEC1322_LPC_EMI_BAR = 0x0800800f;
+ /* Set up EMI module for memory mapped region and port 80 */
+ MEC1322_LPC_EMI_BAR = 0x0080800f;
MEC1322_EMI_MBA0 = ptr;
MEC1322_EMI_MRL0 = 0x200;
MEC1322_EMI_MWL0 = 0x100;
+ MEC1322_INT_ENABLE(15) |= 1 << 2;
+ MEC1322_INT_BLK_EN |= 1 << 15;
+ task_enable_irq(MEC1322_IRQ_EMI);
+
/* We support LPC args and version 3 protocol */
*(lpc_get_memmap_range() + EC_MEMMAP_HOST_CMD_FLAGS) =
EC_HOST_CMD_FLAG_LPC_ARGS_SUPPORTED |
@@ -224,6 +225,12 @@ static void lpc_init(void)
*/
DECLARE_HOOK(HOOK_INIT, lpc_init, HOOK_PRIO_INIT_LPC);
+static void emi_interrupt(void)
+{
+ port_80_write(MEC1322_EMI_H2E_MBX);
+}
+DECLARE_IRQ(MEC1322_IRQ_EMI, emi_interrupt, 1);
+
static void acpi_0_interrupt(void)
{
uint8_t value, result, is_cmd;