summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@chromium.org>2016-09-22 13:28:10 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-09-23 12:21:27 -0700
commit4a974141a5b70ce97800f209a6bc0644d8249c99 (patch)
tree36e6409641318d96cf3699246dbc0df7ca7e02bd
parent576de77c1b02bba2d850fc2d6d9c570d78b8d802 (diff)
downloadchrome-ec-4a974141a5b70ce97800f209a6bc0644d8249c99.tar.gz
chip/npcx: Fix interrupt enabling during lpc_init
1. interrupt enabling should be the last thing done when lpc_init completes required intialization 2. memset to 0 of static uninitialized variables is not required. Remove that. BUG=chrome-os-partner:57642 BRANCH=None TEST=Verified that LPC communication is fine after sysjump to RW. Change-Id: Ib8891dccf2b301590ebca41b75680d954d88a4d3 Signed-off-by: Furquan Shaikh <furquan@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/388752 Tested-by: Mulin Chao <mlchao@nuvoton.com> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Mulin Chao <mlchao@nuvoton.com>
-rw-r--r--chip/npcx/lpc.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/chip/npcx/lpc.c b/chip/npcx/lpc.c
index 7652b1bbeb..43330e906c 100644
--- a/chip/npcx/lpc.c
+++ b/chip/npcx/lpc.c
@@ -885,6 +885,11 @@ static void lpc_init(void)
/* Write protect of Share memory */
NPCX_WIN_WR_PROT(1) = 0xFF;
+ /* We support LPC args and version 3 protocol */
+ *(lpc_get_memmap_range() + EC_MEMMAP_HOST_CMD_FLAGS) =
+ EC_HOST_CMD_FLAG_LPC_ARGS_SUPPORTED |
+ EC_HOST_CMD_FLAG_VERSION_3;
+
/* Turn on PMC2 for Host Command usage */
SET_BIT(NPCX_HIPMCTL(PMC_HOST_CMD), 0);
SET_BIT(NPCX_HIPMCTL(PMC_HOST_CMD), 1);
@@ -895,6 +900,10 @@ static void lpc_init(void)
NPCX_SMC_CTL = NPCX_SMC_CTL&~0x7F;
/* Clear status */
NPCX_SMC_STS = NPCX_SMC_STS;
+
+ /* Restore event masks if needed */
+ lpc_post_sysjump();
+
/* Create mailbox */
/*
@@ -928,18 +937,6 @@ static void lpc_init(void)
#endif
lpc_task_enable_irq();
- /* Initialize host args and memory map to all zero */
- memset(lpc_host_args, 0, sizeof(*lpc_host_args));
- memset(lpc_get_memmap_range(), 0, EC_MEMMAP_SIZE);
-
- /* We support LPC args and version 3 protocol */
- *(lpc_get_memmap_range() + EC_MEMMAP_HOST_CMD_FLAGS) =
- EC_HOST_CMD_FLAG_LPC_ARGS_SUPPORTED |
- EC_HOST_CMD_FLAG_VERSION_3;
-
- /* Restore event masks if needed */
- lpc_post_sysjump();
-
/* Sufficiently initialized */
init_done = 1;