diff options
Diffstat (limited to 'chip/npcx/system.c')
-rw-r--r-- | chip/npcx/system.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/chip/npcx/system.c b/chip/npcx/system.c index a81c3cd383..012a508208 100644 --- a/chip/npcx/system.c +++ b/chip/npcx/system.c @@ -632,6 +632,27 @@ void system_hibernate(uint32_t seconds, uint32_t microseconds) #endif } +void chip_pre_init(void) +{ + /* Setting for fixing JTAG issue */ + NPCX_DBGCTRL = 0x04; + /* Enable automatic freeze mode */ + CLEAR_BIT(NPCX_DBGFRZEN3, NPCX_DBGFRZEN3_GLBL_FRZ_DIS); + + /* + * Enable JTAG functionality by SW without pulling down strap-pin + * nJEN0 or nJEN1 during ec POWERON or VCCRST reset occurs. + * Please notice it will change pinmux to JTAG directly. + */ +#ifdef NPCX_ENABLE_JTAG +#if NPCX_JTAG_MODULE2 + CLEAR_BIT(NPCX_DEVALT(ALT_GROUP_5), NPCX_DEVALT5_NJEN1_EN); +#else + CLEAR_BIT(NPCX_DEVALT(ALT_GROUP_5), NPCX_DEVALT5_NJEN0_EN); +#endif +#endif +} + void system_pre_init(void) { /* |