npcx: espi: Fix pltrst handler for chipset reset hook [chromiumos/platform/ec : master]

11 views
Skip to first unread message

Duncan Laurie (Gerrit)

unread,
Oct 18, 2016, 5:44:58 PM10/18/16
to Vincent Palatin, Duncan Laurie
Duncan Laurie has uploaded a new change for review. (
https://chromium-review.googlesource.com/400035


Change subject: npcx: espi: Fix pltrst handler for chipset reset hook
......................................................................

npcx: espi: Fix pltrst handler for chipset reset hook

Enable the chipset_reset_hook by adding interrupt trigger on
pltrst assertion and fix the compilation when built with
CONFIG_CHIPSET_RESET_HOOK enabled.

BUG=chrome-os-partner:58666
BRANCH=none
TEST=build with CONFIG_ESPI and CONFIG_CHIPSET_RESET_HOOK

Change-Id: I64eb7a1acc58c07beba0d28f94d95ef33d7220fb
Signed-off-by: Duncan Laurie <dla...@chromium.org>
---
M chip/npcx/espi.c
1 file changed, 28 insertions(+), 14 deletions(-)



diff --git a/chip/npcx/espi.c b/chip/npcx/espi.c
index 7d84136..41d6148 100644
--- a/chip/npcx/espi.c
+++ b/chip/npcx/espi.c
@@ -14,6 +14,8 @@
#include "power.h"
#include "espi.h"
#include "lpc_chip.h"
+#include "hooks.h"
+#include "timer.h"

/* Console output macros */
#if !(DEBUG_ESPI)
@@ -91,7 +93,7 @@
/* SLP_S5 */
{MIWU_TABLE_2, MIWU_GROUP_1, 2, MIWU_EDGE_ANYING},
/* VW_WIRE_PLTRST */
- {MIWU_TABLE_2, MIWU_GROUP_1, 5, MIWU_EDGE_RISING},
+ {MIWU_TABLE_2, MIWU_GROUP_1, 5, MIWU_EDGE_ANYING},
/* VW_WIRE_OOB_RST_WARN */
{MIWU_TABLE_2, MIWU_GROUP_1, 6, MIWU_EDGE_ANYING},
/* VW_WIRE_HOST_RST_WARN */
@@ -382,28 +384,40 @@

/*****************************************************************************/
/* VW event handlers */

+#ifdef CONFIG_CHIPSET_RESET_HOOK
+static void espi_chipset_reset(void)
+{
+ hook_notify(HOOK_CHIPSET_RESET);
+}
+DECLARE_DEFERRED(espi_chipset_reset);
+#endif
+
/* PLTRST# event handler */
void espi_vw_evt_pltrst(void)
{
- CPRINTS("VW PLTRST: %d", espi_vw_get_wire(VW_PLTRST_L));
+ int pltrst = espi_vw_get_wire(VW_PLTRST_L);

- /* Disable eSPI peripheral channel support first */
- CLEAR_BIT(NPCX_ESPICFG, NPCX_ESPICFG_PCCHN_SUPP);
+ CPRINTS("VW PLTRST: %d", pltrst);

- /* Enable eSPI peripheral channel */
- SET_BIT(NPCX_ESPICFG, NPCX_ESPICFG_PCHANEN);
- /* Initialize host settings */
- host_register_init();
+ if (pltrst) {
+ /* PLTRST# deasserted */
+ /* Disable eSPI peripheral channel support first */
+ CLEAR_BIT(NPCX_ESPICFG, NPCX_ESPICFG_PCCHN_SUPP);

- /* Re-enable eSPI peripheral channel support */
- SET_BIT(NPCX_ESPICFG, NPCX_ESPICFG_PCCHN_SUPP);
+ /* Enable eSPI peripheral channel */
+ SET_BIT(NPCX_ESPICFG, NPCX_ESPICFG_PCHANEN);

+ /* Initialize host settings */
+ host_register_init();
+
+ /* Re-enable eSPI peripheral channel support */
+ SET_BIT(NPCX_ESPICFG, NPCX_ESPICFG_PCCHN_SUPP);
+ } else {
+ /* PLTRST# asserted */
#ifdef CONFIG_CHIPSET_RESET_HOOK
- if (lpc_get_pltrst_asserted()) {
- /* Notify HOOK_CHIPSET_RESET */
- hook_call_deferred(lpc_chipset_reset, MSEC);
- }
+ hook_call_deferred(&espi_chipset_reset_data, MSEC);
#endif
+ }
}

/* SLP_Sx event handler */

--
To view, visit https://chromium-review.googlesource.com/400035
To unsubscribe, visit https://chromium-review.googlesource.com/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I64eb7a1acc58c07beba0d28f94d95ef33d7220fb
Gerrit-PatchSet: 1
Gerrit-Project: chromiumos/platform/ec
Gerrit-Branch: master
Gerrit-Owner: Duncan Laurie <dla...@chromium.org>

Mulin Chao (Gerrit)

unread,
Oct 19, 2016, 10:12:50 PM10/19/16
to Duncan Laurie, Shawn N
Mulin Chao has posted comments on this change. (
https://chromium-review.googlesource.com/400035 )

Change subject: npcx: espi: Fix pltrst handler for chipset reset hook
......................................................................


Patch Set 1: Code-Review+1

> Uploaded patch set 1.
Gerrit-MessageType: comment
Gerrit-Change-Id: I64eb7a1acc58c07beba0d28f94d95ef33d7220fb
Gerrit-PatchSet: 1
Gerrit-Project: chromiumos/platform/ec
Gerrit-Branch: master
Gerrit-Owner: Duncan Laurie <dla...@chromium.org>
Gerrit-Reviewer: Mulin Chao <mlc...@nuvoton.com>
Gerrit-Reviewer: Shawn N <sha...@chromium.org>
Gerrit-HasComments: No

Shawn N (Gerrit)

unread,
Oct 20, 2016, 3:15:27 PM10/20/16
to Duncan Laurie, Mulin Chao
Shawn N has posted comments on this change. (
https://chromium-review.googlesource.com/400035 )

Change subject: npcx: espi: Fix pltrst handler for chipset reset hook
......................................................................


Patch Set 1: Code-Review+2
Gerrit-MessageType: comment
Gerrit-Change-Id: I64eb7a1acc58c07beba0d28f94d95ef33d7220fb
Gerrit-PatchSet: 1
Gerrit-Project: chromiumos/platform/ec
Gerrit-Branch: master
Gerrit-Owner: Duncan Laurie <dla...@chromium.org>

Duncan Laurie (Gerrit)

unread,
Oct 25, 2016, 1:49:31 PM10/25/16
to Duncan Laurie, Shawn N, Mulin Chao
Duncan Laurie has posted comments on this change. (
https://chromium-review.googlesource.com/400035 )

Change subject: npcx: espi: Fix pltrst handler for chipset reset hook
......................................................................


Patch Set 2: Verified+1
Gerrit-MessageType: comment
Gerrit-Change-Id: I64eb7a1acc58c07beba0d28f94d95ef33d7220fb
Gerrit-PatchSet: 2
Gerrit-Project: chromiumos/platform/ec
Gerrit-Branch: master
Gerrit-Owner: Duncan Laurie <dla...@chromium.org>
Gerrit-Reviewer: Duncan Laurie <dla...@chromium.org>

Duncan Laurie (Gerrit)

unread,
Oct 25, 2016, 4:24:13 PM10/25/16
to Duncan Laurie, Shawn N, Mulin Chao

Duncan Laurie posted comments on npcx: espi: Fix pltrst handler for chipset reset hook.

View Change

Patch Set 2: Commit-Queue+1

    To view, visit this change. To unsubscribe, visit settings.

    Gerrit-MessageType: comment
    Gerrit-Change-Id: I64eb7a1acc58c07beba0d28f94d95ef33d7220fb
    Gerrit-PatchSet: 2

    Gerrit-Project: chromiumos/platform/ec
    Gerrit-Branch: master
    Gerrit-Owner: Duncan Laurie <dla...@chromium.org>

    Gerrit-HasComments: No

    ChromeOS Commit Bot (Gerrit)

    unread,
    Oct 25, 2016, 8:34:58 PM10/25/16
    to Duncan Laurie, Mulin Chao, Shawn N
    Hello Duncan Laurie, Mulin Chao, Shawn N,

    I'd like you to reexamine a change. Please visit

    https://chromium-review.googlesource.com/400035

    to look at the new patch set (#3).

    Change subject: npcx: espi: Fix pltrst handler for chipset reset hook
    ......................................................................

    npcx: espi: Fix pltrst handler for chipset reset hook

    Enable the chipset_reset_hook by adding interrupt trigger on
    pltrst assertion and fix the compilation when built with
    CONFIG_CHIPSET_RESET_HOOK enabled.

    BUG=chrome-os-partner:58666
    BRANCH=none
    TEST=build with CONFIG_ESPI and CONFIG_CHIPSET_RESET_HOOK

    Change-Id: I64eb7a1acc58c07beba0d28f94d95ef33d7220fb
    Signed-off-by: Duncan Laurie <dla...@chromium.org>
    Reviewed-on: https://chromium-review.googlesource.com/400035
    Reviewed-by: Mulin Chao <mlc...@nuvoton.com>
    Reviewed-by: Shawn N <sha...@chromium.org>
    ---
    M chip/npcx/espi.c
    1 file changed, 28 insertions(+), 14 deletions(-)


    Gerrit-MessageType: newpatchset
    Gerrit-Change-Id: I64eb7a1acc58c07beba0d28f94d95ef33d7220fb
    Gerrit-PatchSet: 3
    Gerrit-Project: chromiumos/platform/ec
    Gerrit-Branch: master
    Gerrit-Owner: Duncan Laurie <dla...@chromium.org>

    ChromeOS Commit Bot (Gerrit)

    unread,
    Oct 25, 2016, 8:34:58 PM10/25/16
    to Duncan Laurie, Shawn N, Mulin Chao
    ChromeOS Commit Bot has submitted this change and it was merged. (
    https://chromium-review.googlesource.com/400035 )

    Change subject: npcx: espi: Fix pltrst handler for chipset reset hook
    ......................................................................

    npcx: espi: Fix pltrst handler for chipset reset hook

    Enable the chipset_reset_hook by adding interrupt trigger on
    pltrst assertion and fix the compilation when built with
    CONFIG_CHIPSET_RESET_HOOK enabled.

    BUG=chrome-os-partner:58666
    BRANCH=none
    TEST=build with CONFIG_ESPI and CONFIG_CHIPSET_RESET_HOOK

    Change-Id: I64eb7a1acc58c07beba0d28f94d95ef33d7220fb
    Signed-off-by: Duncan Laurie <dla...@chromium.org>
    Reviewed-on: https://chromium-review.googlesource.com/400035
    Reviewed-by: Mulin Chao <mlc...@nuvoton.com>
    Reviewed-by: Shawn N <sha...@chromium.org>
    Gerrit-MessageType: merged
    Gerrit-Change-Id: I64eb7a1acc58c07beba0d28f94d95ef33d7220fb
    Gerrit-PatchSet: 3
    Gerrit-Project: chromiumos/platform/ec
    Gerrit-Branch: master
    Gerrit-Owner: Duncan Laurie <dla...@chromium.org>
    Reply all
    Reply to author
    Forward
    0 new messages