diff options
author | Shawn Nematbakhsh <shawnn@chromium.org> | 2015-04-07 14:32:22 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-04-10 18:48:46 +0000 |
commit | 52791fc2ac548c4659ecab5344aae430c0d8adc0 (patch) | |
tree | c48a46d7f53498c276314a89cce6f90c2eb9ad3a | |
parent | 2e19bcb0cfd989f80ce100ce35ba4bfd7822fc94 (diff) | |
download | chrome-ec-52791fc2ac548c4659ecab5344aae430c0d8adc0.tar.gz |
mec1322: Setup EMI unit at base address 0x800
Use EMI unit for access to host command / memmap data.
BUG=chrome-os-partner:38224
TEST=Manual on glower. Verify system boots + ectool works.
BRANCH=None
Change-Id: I06768a68fdf43f09d5e7425c293efff6a69a8878
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/264454
Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r-- | chip/mec1322/lpc.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/chip/mec1322/lpc.c b/chip/mec1322/lpc.c index c746374a39..ab1df04893 100644 --- a/chip/mec1322/lpc.c +++ b/chip/mec1322/lpc.c @@ -36,7 +36,6 @@ static int init_done; static struct ec_lpc_host_args * const lpc_host_args = (struct ec_lpc_host_args *)mem_mapped; - #ifdef CONFIG_KEYBOARD_IRQ_GPIO static void keyboard_irq_assert(void) { @@ -224,12 +223,22 @@ static void setup_lpc(void) /* TODO(crosbug.com/p/24107): Route KIRQ to SER_IRQ1 */ - /* Set up EMI module for memory mapped region and port 80 */ - MEC1322_LPC_EMI_BAR = 0x0080800f; + /* Set up EMI module for memory mapped region, base address 0x800 */ + MEC1322_LPC_EMI_BAR = 0x0800800f; MEC1322_INT_ENABLE(15) |= 1 << 2; MEC1322_INT_BLK_EN |= 1 << 15; task_enable_irq(MEC1322_IRQ_EMI); + /* Access data RAM through alias address */ + MEC1322_EMI_MBA0 = (uint32_t)mem_mapped - 0x118000 + 0x20000000; + + /* + * Limit EMI read / write range. First 256 bytes are RW for host + * commands. Second 256 bytes are RO for mem-mapped data. + */ + MEC1322_EMI_MRL0 = 0x200; + MEC1322_EMI_MWL0 = 0x100; + /* We support LPC args and version 3 protocol */ *(lpc_get_memmap_range() + EC_MEMMAP_HOST_CMD_FLAGS) = EC_HOST_CMD_FLAG_LPC_ARGS_SUPPORTED | |