diff options
author | Devin Lu <Devin.Lu@quantatw.com> | 2021-08-03 20:27:49 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-08-13 05:25:09 +0000 |
commit | c425ace909b134095698dd604eb685cd2f620256 (patch) | |
tree | b5e888f6b7a16e9acbbde5e89b595cc0a9580796 | |
parent | a388377c7699bcbca57bb495a0e55ea7543b394d (diff) | |
download | chrome-ec-c425ace909b134095698dd604eb685cd2f620256.tar.gz |
nct38xx: Split after-reset timestabilize-14151.B-main
Split after-reset time for NCT3807 and NCT3808, since the after-reset
time is not the same.
From the datasheet (section 4.4.2 Reset Timing) as following:
* | Min | Max |
* ----------------------+-------+-------+
* NCT3807 (single port) | x | 1.5ms |
* ----------------------+-------+-------+
* NCT3808 (dual port) | x | 3ms |
* ----------------------+-------+-------+
Currently the after-reset time for NCT3807 is zero. Change to 2ms to
fit specification as well.
BUG=none
BRANCH=none
TEST=On Redrix. Initial success with NCT3807.
TEST=On Dirinboz. Initial success with NCT3807.
TEST=make buildall.
Signed-off-by: Devin Lu <Devin.Lu@quantatw.com>
Change-Id: I1f47f57c0d8955946b1c2522e1a1736739217f41
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3068492
Reviewed-by: caveh jalali <caveh@chromium.org>
-rw-r--r-- | baseboard/guybrush/baseboard.c | 4 | ||||
-rw-r--r-- | baseboard/mancomb/baseboard.c | 4 | ||||
-rw-r--r-- | baseboard/zork/variant_trembyle.c | 4 | ||||
-rw-r--r-- | board/dalboz/board.c | 4 | ||||
-rw-r--r-- | board/dirinboz/board.c | 4 | ||||
-rw-r--r-- | board/gumboz/board.c | 4 | ||||
-rw-r--r-- | board/redrix/usbc_config.c | 4 | ||||
-rw-r--r-- | board/shuboz/board.c | 4 | ||||
-rw-r--r-- | board/vilboz/board.c | 4 | ||||
-rw-r--r-- | driver/tcpm/nct38xx.h | 13 |
10 files changed, 30 insertions, 19 deletions
diff --git a/baseboard/guybrush/baseboard.c b/baseboard/guybrush/baseboard.c index dcf56b1a78..4383598ff6 100644 --- a/baseboard/guybrush/baseboard.c +++ b/baseboard/guybrush/baseboard.c @@ -741,8 +741,8 @@ static void reset_nct38xx_port(int port) msleep(NCT38XX_RESET_HOLD_DELAY_MS); gpio_set_level(reset_gpio_l, 1); nct38xx_reset_notify(port); - if (NCT38XX_RESET_POST_DELAY_MS != 0) - msleep(NCT38XX_RESET_POST_DELAY_MS); + if (NCT3807_RESET_POST_DELAY_MS != 0) + msleep(NCT3807_RESET_POST_DELAY_MS); } diff --git a/baseboard/mancomb/baseboard.c b/baseboard/mancomb/baseboard.c index 7a7a2c1e3e..041b2512dd 100644 --- a/baseboard/mancomb/baseboard.c +++ b/baseboard/mancomb/baseboard.c @@ -689,12 +689,12 @@ void board_reset_pd_mcu(void) /* Reset TCPC0 */ reset_pd_port(USBC_PORT_C0, GPIO_USB_C0_TCPC_RST_L, NCT38XX_RESET_HOLD_DELAY_MS, - NCT38XX_RESET_POST_DELAY_MS); + NCT3807_RESET_POST_DELAY_MS); /* Reset TCPC1 */ reset_pd_port(USBC_PORT_C1, GPIO_USB_C1_TCPC_RST_L, NCT38XX_RESET_HOLD_DELAY_MS, - NCT38XX_RESET_POST_DELAY_MS); + NCT3807_RESET_POST_DELAY_MS); } uint16_t tcpc_get_alert_status(void) diff --git a/baseboard/zork/variant_trembyle.c b/baseboard/zork/variant_trembyle.c index bcde458553..b39380db59 100644 --- a/baseboard/zork/variant_trembyle.c +++ b/baseboard/zork/variant_trembyle.c @@ -280,8 +280,8 @@ static void reset_nct38xx_port(int port) msleep(NCT38XX_RESET_HOLD_DELAY_MS); gpio_set_level(reset_gpio_l, 1); nct38xx_reset_notify(port); - if (NCT38XX_RESET_POST_DELAY_MS != 0) - msleep(NCT38XX_RESET_POST_DELAY_MS); + if (NCT3807_RESET_POST_DELAY_MS != 0) + msleep(NCT3807_RESET_POST_DELAY_MS); } diff --git a/board/dalboz/board.c b/board/dalboz/board.c index 44015110cf..f049ef55d4 100644 --- a/board/dalboz/board.c +++ b/board/dalboz/board.c @@ -463,8 +463,8 @@ static void reset_nct38xx_port(int port) msleep(NCT38XX_RESET_HOLD_DELAY_MS); gpio_set_level(reset_gpio_l, 1); nct38xx_reset_notify(port); - if (NCT38XX_RESET_POST_DELAY_MS != 0) - msleep(NCT38XX_RESET_POST_DELAY_MS); + if (NCT3807_RESET_POST_DELAY_MS != 0) + msleep(NCT3807_RESET_POST_DELAY_MS); } diff --git a/board/dirinboz/board.c b/board/dirinboz/board.c index d7b3446197..36d3d13a04 100644 --- a/board/dirinboz/board.c +++ b/board/dirinboz/board.c @@ -384,8 +384,8 @@ static void reset_nct38xx_port(int port) msleep(NCT38XX_RESET_HOLD_DELAY_MS); gpio_set_level(reset_gpio_l, 1); nct38xx_reset_notify(port); - if (NCT38XX_RESET_POST_DELAY_MS != 0) - msleep(NCT38XX_RESET_POST_DELAY_MS); + if (NCT3807_RESET_POST_DELAY_MS != 0) + msleep(NCT3807_RESET_POST_DELAY_MS); } diff --git a/board/gumboz/board.c b/board/gumboz/board.c index b04a09f0f5..ee255ad47b 100644 --- a/board/gumboz/board.c +++ b/board/gumboz/board.c @@ -388,8 +388,8 @@ static void reset_nct38xx_port(int port) msleep(NCT38XX_RESET_HOLD_DELAY_MS); gpio_set_level(reset_gpio_l, 1); nct38xx_reset_notify(port); - if (NCT38XX_RESET_POST_DELAY_MS != 0) - msleep(NCT38XX_RESET_POST_DELAY_MS); + if (NCT3807_RESET_POST_DELAY_MS != 0) + msleep(NCT3807_RESET_POST_DELAY_MS); } diff --git a/board/redrix/usbc_config.c b/board/redrix/usbc_config.c index 906147a696..f0f39b6d87 100644 --- a/board/redrix/usbc_config.c +++ b/board/redrix/usbc_config.c @@ -197,8 +197,8 @@ void board_reset_pd_mcu(void) nct38xx_reset_notify(USBC_PORT_C1); /* wait for chips to come up */ - if (NCT38XX_RESET_POST_DELAY_MS != 0) - msleep(NCT38XX_RESET_POST_DELAY_MS); + if (NCT3807_RESET_POST_DELAY_MS != 0) + msleep(NCT3807_RESET_POST_DELAY_MS); } static void board_tcpc_init(void) diff --git a/board/shuboz/board.c b/board/shuboz/board.c index 114bae6ac8..f5483841dc 100644 --- a/board/shuboz/board.c +++ b/board/shuboz/board.c @@ -467,8 +467,8 @@ static void reset_nct38xx_port(int port) msleep(NCT38XX_RESET_HOLD_DELAY_MS); gpio_set_level(reset_gpio_l, 1); nct38xx_reset_notify(port); - if (NCT38XX_RESET_POST_DELAY_MS != 0) - msleep(NCT38XX_RESET_POST_DELAY_MS); + if (NCT3807_RESET_POST_DELAY_MS != 0) + msleep(NCT3807_RESET_POST_DELAY_MS); } diff --git a/board/vilboz/board.c b/board/vilboz/board.c index 8351834b78..d280081e82 100644 --- a/board/vilboz/board.c +++ b/board/vilboz/board.c @@ -319,8 +319,8 @@ static void reset_nct38xx_port(int port) msleep(NCT38XX_RESET_HOLD_DELAY_MS); gpio_set_level(reset_gpio_l, 1); nct38xx_reset_notify(port); - if (NCT38XX_RESET_POST_DELAY_MS != 0) - msleep(NCT38XX_RESET_POST_DELAY_MS); + if (NCT3807_RESET_POST_DELAY_MS != 0) + msleep(NCT3807_RESET_POST_DELAY_MS); } diff --git a/driver/tcpm/nct38xx.h b/driver/tcpm/nct38xx.h index f4923b700d..714a2f8d46 100644 --- a/driver/tcpm/nct38xx.h +++ b/driver/tcpm/nct38xx.h @@ -75,7 +75,18 @@ #define NCT38XX_REG_VBC_FAULT_CTL_VC_OVP_OFF (1 << 5) #define NCT38XX_RESET_HOLD_DELAY_MS 1 -#define NCT38XX_RESET_POST_DELAY_MS 0 + +/* + * From the datasheet (section 4.4.2 Reset Timing) as following: + * | Min | Max | + * ----------------------+-------+-------+ + * NCT3807 (single port) | x | 1.5ms | + * ----------------------+-------+-------+ + * NCT3808 (dual port) | x | 3ms | + * ----------------------+-------+-------+ + */ +#define NCT3807_RESET_POST_DELAY_MS 2 +#define NCT3808_RESET_POST_DELAY_MS 3 extern const struct tcpm_drv nct38xx_tcpm_drv; |