diff options
author | Daisuke Nojiri <dnojiri@chromium.org> | 2020-06-25 11:51:03 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-06-26 04:07:10 +0000 |
commit | d4c7f30feeab294406e2643183c6bd7e3095edfe (patch) | |
tree | e35d30993df605e2076630be17f137f5d5bc48b3 | |
parent | 62c32d5010d8d12ca53ac9205d7172300f9f22ea (diff) | |
download | chrome-ec-stabilize-quickfix-13310.91.B-master.tar.gz |
Swap system_jumped_to_this_image with system_jumped_latestabilize-quickfix-13310.91.B-masterstabilize-quickfix-13310.76.B-masterstabilize-quickfix-13310.73.B-masterstabilize-13310.99.B-masterstabilize-13310.94.B-masterstabilize-13310.83.B-masterstabilize-13310.74.B-masterstabilize-13310.72.B-masterrelease-R85-13310.B-master
EFS2 boards need to call system_jumped_late in HOOK_INIT to avoid
running init code twice per boot.
system_jumped_to_this_image and system_jumped_late are functionally
equivalent for non EFS2 boards.
This patch will prevent system_jumped_to_this_image from being used
for EFS2 boards when code is copied from a past project.
BUG=chromium:1072743
BRANCH=none
TEST=buildall
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Change-Id: I73fb5cedc5325d1c80825f9346954013046ee1df
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2267685
Reviewed-by: Keith Short <keithshort@chromium.org>
33 files changed, 42 insertions, 42 deletions
diff --git a/baseboard/grunt/baseboard.c b/baseboard/grunt/baseboard.c index acc9d19855..26b9ac5bae 100644 --- a/baseboard/grunt/baseboard.c +++ b/baseboard/grunt/baseboard.c @@ -136,7 +136,7 @@ void tcpc_alert_event(enum gpio_signal signal) void board_tcpc_init(void) { /* Only reset TCPC if not sysjump */ - if (!system_jumped_to_this_image()) + if (!system_jumped_late()) board_reset_pd_mcu(); /* Enable PPC interrupts. */ diff --git a/baseboard/hatch/baseboard.c b/baseboard/hatch/baseboard.c index 813ff11b31..07b018443e 100644 --- a/baseboard/hatch/baseboard.c +++ b/baseboard/hatch/baseboard.c @@ -178,7 +178,7 @@ unsigned int ppc_cnt = ARRAY_SIZE(ppc_chips); void baseboard_tcpc_init(void) { /* Only reset TCPC if not sysjump */ - if (!system_jumped_to_this_image()) + if (!system_jumped_late()) board_reset_pd_mcu(); /* Enable PPC interrupts. */ diff --git a/baseboard/intelrvp/chg_usb_pd.c b/baseboard/intelrvp/chg_usb_pd.c index 7c8834806a..c15ee886eb 100644 --- a/baseboard/intelrvp/chg_usb_pd.c +++ b/baseboard/intelrvp/chg_usb_pd.c @@ -89,7 +89,7 @@ void board_tcpc_init(void) int i; /* Only reset TCPC if not sysjump */ - if (!system_jumped_to_this_image()) + if (!system_jumped_late()) board_reset_pd_mcu(); /* Enable TCPCx interrupt */ diff --git a/baseboard/octopus/baseboard.c b/baseboard/octopus/baseboard.c index e2c4eb30f4..bea8447ef3 100644 --- a/baseboard/octopus/baseboard.c +++ b/baseboard/octopus/baseboard.c @@ -231,7 +231,7 @@ enum adc_channel board_get_vbus_adc(int port) void baseboard_tcpc_init(void) { /* Only reset TCPC if not sysjump */ - if (!system_jumped_to_this_image()) + if (!system_jumped_late()) board_reset_pd_mcu(); /* diff --git a/board/atlas/board.c b/board/atlas/board.c index 8948207c24..64bd8f1171 100644 --- a/board/atlas/board.c +++ b/board/atlas/board.c @@ -212,7 +212,7 @@ void board_reset_pd_mcu(void) void board_tcpc_init(void) { /* Only reset TCPC if not sysjump */ - if (!system_jumped_to_this_image()) + if (!system_jumped_late()) board_reset_pd_mcu(); gpio_enable_interrupt(GPIO_USB_C0_PD_INT_ODL); @@ -394,7 +394,7 @@ static void board_pmic_init(void) i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS, BD99992GW_REG_PBCONFIG, 0x00); - if (system_jumped_to_this_image()) + if (system_jumped_late()) return; /* DISCHGCNT1 - enable 100 ohm discharge on VCCIO */ diff --git a/board/bobba/board.c b/board/bobba/board.c index ed869faefd..7f20c820fd 100644 --- a/board/bobba/board.c +++ b/board/bobba/board.c @@ -335,7 +335,7 @@ static void board_usb_charge_mode_init(void) * Only overriding the USB_DISALLOW_SUSPEND_CHARGE in RO is enough because * USB_SYSJUMP_TAG preserves the settings to RW. And we should honor to it. */ - if (system_jumped_to_this_image()) + if (system_jumped_late()) return; /* Currently only blorb and droid support this feature. */ diff --git a/board/chell/board.c b/board/chell/board.c index 1315235f8d..1f8390fdd9 100644 --- a/board/chell/board.c +++ b/board/chell/board.c @@ -232,7 +232,7 @@ static void board_pmic_init(void) * No need to re-init below settings since they are present on all MP * ROs and PMIC settings are sticky across sysjump */ - if (system_jumped_to_this_image()) + if (system_jumped_late()) return; /* Set CSDECAYEN / VCCIO decays to 0V at assertion of SLP_S0# */ @@ -412,7 +412,7 @@ static void board_handle_reboot(void) { int flags; - if (system_jumped_to_this_image()) + if (system_jumped_late()) return; /* Interrogate current reset flags from previous reboot. */ diff --git a/board/cheza/board.c b/board/cheza/board.c index e4abd22d2f..ed9282523f 100644 --- a/board/cheza/board.c +++ b/board/cheza/board.c @@ -409,7 +409,7 @@ DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT); void board_tcpc_init(void) { /* Only reset TCPC if not sysjump */ - if (!system_jumped_to_this_image()) { + if (!system_jumped_late()) { /* TODO(crosbug.com/p/61098): How long do we need to wait? */ board_reset_pd_mcu(); } diff --git a/board/coral/board.c b/board/coral/board.c index 5fcb40d603..ccb686451e 100644 --- a/board/coral/board.c +++ b/board/coral/board.c @@ -372,7 +372,7 @@ static void board_tcpc_init(void) } /* Only reset TCPC if not sysjump */ - if (!system_jumped_to_this_image()) + if (!system_jumped_late()) board_reset_pd_mcu(); /* diff --git a/board/eve/board.c b/board/eve/board.c index c703619e71..d8329d27ea 100644 --- a/board/eve/board.c +++ b/board/eve/board.c @@ -302,7 +302,7 @@ void board_reset_pd_mcu(void) void board_tcpc_init(void) { /* Only reset TCPC if not sysjump */ - if (!system_jumped_to_this_image()) + if (!system_jumped_late()) board_reset_pd_mcu(); /* Enable TCPC interrupts */ @@ -405,7 +405,7 @@ static void board_pmic_init(void) { board_report_pmic_fault("SYSJUMP"); - if (system_jumped_to_this_image()) + if (system_jumped_late()) return; /* DISCHGCNT2 - enable 100 ohm discharge on V3.3A and V1.8A */ diff --git a/board/glados/board.c b/board/glados/board.c index 43cfad06cf..a72b43d765 100644 --- a/board/glados/board.c +++ b/board/glados/board.c @@ -213,7 +213,7 @@ BUILD_ASSERT(ARRAY_SIZE(als) == ALS_COUNT); static void board_pmic_init(void) { /* No need to re-init PMIC since settings are sticky across sysjump */ - if (system_jumped_to_this_image()) + if (system_jumped_late()) return; /* Set CSDECAYEN / VCCIO decays to 0V at assertion of SLP_S0# */ @@ -410,7 +410,7 @@ static void board_handle_reboot(void) { int flags; - if (system_jumped_to_this_image()) + if (system_jumped_late()) return; if (system_get_board_version() < BOARD_MIN_ID_LOD_EN) diff --git a/board/glados_pd/board.c b/board/glados_pd/board.c index b0c4ddbff9..13fa2a16ef 100644 --- a/board/glados_pd/board.c +++ b/board/glados_pd/board.c @@ -57,7 +57,7 @@ static void board_init(void) gpio_enable_interrupt(GPIO_USB_C1_VBUS_WAKE_L); /* Set PD MCU system status bits */ - if (system_jumped_to_this_image()) + if (system_jumped_late()) pd_status_flags |= PD_STATUS_JUMPED_TO_IMAGE; if (system_is_in_rw()) pd_status_flags |= PD_STATUS_IN_RW; diff --git a/board/glkrvp/board.c b/board/glkrvp/board.c index fc54697fb4..6c3a734f89 100644 --- a/board/glkrvp/board.c +++ b/board/glkrvp/board.c @@ -166,7 +166,7 @@ int board_get_version(void) static void pmic_init(void) { /* No need to re-init PMIC since settings are sticky across sysjump. */ - if (system_jumped_to_this_image()) + if (system_jumped_late()) return; /* diff --git a/board/glkrvp/chg_usb_pd.c b/board/glkrvp/chg_usb_pd.c index ff6aefbf97..f8e8520b72 100644 --- a/board/glkrvp/chg_usb_pd.c +++ b/board/glkrvp/chg_usb_pd.c @@ -123,7 +123,7 @@ void tcpc_alert_event(enum gpio_signal signal) void board_tcpc_init(void) { /* Only reset TCPC if not sysjump */ - if (!system_jumped_to_this_image()) + if (!system_jumped_late()) board_reset_pd_mcu(); /* Enable TCPC0/1 interrupt */ diff --git a/board/glkrvp_ite/board.c b/board/glkrvp_ite/board.c index cb2da54a0d..e86d1083b7 100644 --- a/board/glkrvp_ite/board.c +++ b/board/glkrvp_ite/board.c @@ -171,7 +171,7 @@ int board_get_version(void) static void pmic_init(void) { /* No need to re-init PMIC since settings are sticky across sysjump. */ - if (system_jumped_to_this_image()) + if (system_jumped_late()) return; /* diff --git a/board/glkrvp_ite/chg_usb_pd.c b/board/glkrvp_ite/chg_usb_pd.c index 2e8d237e64..7bc60fd5c8 100644 --- a/board/glkrvp_ite/chg_usb_pd.c +++ b/board/glkrvp_ite/chg_usb_pd.c @@ -117,7 +117,7 @@ void tcpc_alert_event(enum gpio_signal signal) void board_tcpc_init(void) { /* Only reset TCPC if not sysjump */ - if (!system_jumped_to_this_image()) + if (!system_jumped_late()) board_reset_pd_mcu(); /* Enable TCPC0/1 interrupt */ diff --git a/board/hatch/board.c b/board/hatch/board.c index 704014d65f..a5715d2cfa 100644 --- a/board/hatch/board.c +++ b/board/hatch/board.c @@ -442,7 +442,7 @@ static void reset_gpio_flags(enum gpio_signal signal, int flags) * may change the value from the previous image which could cause a * brownout. */ - if (system_is_reboot_warm() || system_jumped_to_this_image()) + if (system_is_reboot_warm() || system_jumped_late()) flags &= ~(GPIO_LOW | GPIO_HIGH); gpio_set_flags(signal, flags); diff --git a/board/kindred/board.c b/board/kindred/board.c index c573822851..c3c802136b 100644 --- a/board/kindred/board.c +++ b/board/kindred/board.c @@ -384,7 +384,7 @@ static void reset_gpio_flags(enum gpio_signal signal, int flags) * may change the value from the previous image which could cause a * brownout. */ - if (system_is_reboot_warm() || system_jumped_to_this_image()) + if (system_is_reboot_warm() || system_jumped_late()) flags &= ~(GPIO_LOW | GPIO_HIGH); gpio_set_flags(signal, flags); diff --git a/board/lazor/board.c b/board/lazor/board.c index 1df3ab4b6b..fcec96169e 100644 --- a/board/lazor/board.c +++ b/board/lazor/board.c @@ -242,7 +242,7 @@ DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT); void board_tcpc_init(void) { /* Only reset TCPC if not sysjump */ - if (!system_jumped_to_this_image()) { + if (!system_jumped_late()) { /* TODO(crosbug.com/p/61098): How long do we need to wait? */ board_reset_pd_mcu(); } diff --git a/board/mchpevb1/board.c b/board/mchpevb1/board.c index c8dc130821..79f104ff55 100644 --- a/board/mchpevb1/board.c +++ b/board/mchpevb1/board.c @@ -485,7 +485,7 @@ static void board_pmic_init(void) int rv, cfg; /* No need to re-init PMIC since settings are sticky across sysjump */ - if (system_jumped_to_this_image()) + if (system_jumped_late()) return; #if 0 /* BD99992GW PMIC on a real Chromebook */ @@ -562,7 +562,7 @@ static void board_init(void) gpio_set_level(GPIO_PCH_ACOK, extpower_is_present()); #ifdef HAS_TASK_MOTIONSENSE - if (system_jumped_to_this_image() && + if (system_jumped_late() && chipset_in_state(CHIPSET_STATE_ON)) { trace0(0, BRD, 0, "board_init: S0 call board_spi_enable"); board_spi_enable(); @@ -781,7 +781,7 @@ static void board_handle_reboot(void) CPRINTS("MEC HOOK_INIT - called board_handle_reboot"); trace0(0, HOOK, 0, "HOOK_INIT - board_handle_reboot"); - if (system_jumped_to_this_image()) + if (system_jumped_late()) return; if (system_get_board_version() < BOARD_MIN_ID_LOD_EN) diff --git a/board/mushu/board.c b/board/mushu/board.c index 5c3aabe2ec..c4186e4be5 100644 --- a/board/mushu/board.c +++ b/board/mushu/board.c @@ -504,7 +504,7 @@ static void reset_gpio_flags(enum gpio_signal signal, int flags) * may change the value from the previous image which could cause a * brownout. */ - if (system_is_reboot_warm() || system_jumped_to_this_image()) + if (system_is_reboot_warm() || system_jumped_late()) flags &= ~(GPIO_LOW | GPIO_HIGH); gpio_set_flags(signal, flags); diff --git a/board/nami/board.c b/board/nami/board.c index b3aa7f91cd..5e3f75fbd3 100644 --- a/board/nami/board.c +++ b/board/nami/board.c @@ -317,7 +317,7 @@ void board_reset_pd_mcu(void) void board_tcpc_init(void) { /* Only reset TCPC if not sysjump */ - if (!system_jumped_to_this_image()) + if (!system_jumped_late()) board_reset_pd_mcu(); /* Enable TCPC interrupts */ diff --git a/board/nautilus/board.c b/board/nautilus/board.c index 30fc388e57..9b191cbd70 100644 --- a/board/nautilus/board.c +++ b/board/nautilus/board.c @@ -219,7 +219,7 @@ void board_reset_pd_mcu(void) void board_tcpc_init(void) { /* Only reset TCPC if not sysjump */ - if (!system_jumped_to_this_image()) { + if (!system_jumped_late()) { board_reset_pd_mcu(); } @@ -399,7 +399,7 @@ static void board_pmic_init(void) { board_report_pmic_fault("SYSJUMP"); - if (system_jumped_to_this_image()) + if (system_jumped_late()) return; /* DISCHGCNT3 - enable 100 ohm discharge on V1.00A */ diff --git a/board/poppy/base_detect_poppy.c b/board/poppy/base_detect_poppy.c index dc4341d51a..358461896e 100644 --- a/board/poppy/base_detect_poppy.c +++ b/board/poppy/base_detect_poppy.c @@ -241,7 +241,7 @@ static void base_init(void) * If we jumped to this image and chipset is already in S0, enable * base. */ - if (system_jumped_to_this_image() && chipset_in_state(CHIPSET_STATE_ON)) + if (system_jumped_late() && chipset_in_state(CHIPSET_STATE_ON)) base_enable(); } DECLARE_HOOK(HOOK_INIT, base_init, HOOK_PRIO_DEFAULT+1); diff --git a/board/poppy/board.c b/board/poppy/board.c index ddd0721591..dccf04a3cd 100644 --- a/board/poppy/board.c +++ b/board/poppy/board.c @@ -289,7 +289,7 @@ void board_tcpc_init(void) int reg; /* Only reset TCPC if not sysjump */ - if (!system_jumped_to_this_image()) { + if (!system_jumped_late()) { gpio_set_level(GPIO_PP3300_USB_PD, 1); /* TODO(crosbug.com/p/61098): How long do we need to wait? */ msleep(10); @@ -492,7 +492,7 @@ static void board_pmic_init(void) { board_report_pmic_fault("SYSJUMP"); - if (system_jumped_to_this_image()) + if (system_jumped_late()) return; /* DISCHGCNT3 - enable 100 ohm discharge on V1.00A */ diff --git a/board/rainier/board.c b/board/rainier/board.c index 88f334c827..fa852a5a90 100644 --- a/board/rainier/board.c +++ b/board/rainier/board.c @@ -236,7 +236,7 @@ static void board_init(void) STM32_GPIO_OSPEEDR(GPIO_D) |= 0x000003cf; /* Sensor Init */ - if (system_jumped_to_this_image() && chipset_in_state(CHIPSET_STATE_ON)) + if (system_jumped_late() && chipset_in_state(CHIPSET_STATE_ON)) board_spi_enable(); } DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT); diff --git a/board/rammus/board.c b/board/rammus/board.c index ea6751032a..b46aece2a9 100644 --- a/board/rammus/board.c +++ b/board/rammus/board.c @@ -247,7 +247,7 @@ void board_tcpc_init(void) ps8751_i2c_remap(); /* Only reset TCPC if not sysjump */ - if (!system_jumped_to_this_image()) { + if (!system_jumped_late()) { board_reset_pd_mcu(); } @@ -413,7 +413,7 @@ static void board_pmic_init(void) { board_report_pmic_fault("SYSJUMP"); - if (system_jumped_to_this_image()) + if (system_jumped_late()) return; /* diff --git a/board/reef/board.c b/board/reef/board.c index 29b6ca0bdc..72decd3c40 100644 --- a/board/reef/board.c +++ b/board/reef/board.c @@ -366,7 +366,7 @@ void board_tcpc_init(void) int reg; /* Only reset TCPC if not sysjump */ - if (!system_jumped_to_this_image()) + if (!system_jumped_late()) board_reset_pd_mcu(); /* diff --git a/board/reef_mchp/board.c b/board/reef_mchp/board.c index 3540cf334c..373668b195 100644 --- a/board/reef_mchp/board.c +++ b/board/reef_mchp/board.c @@ -506,7 +506,7 @@ void board_tcpc_init(void) int reg; /* Only reset TCPC if not sysjump */ - if (!system_jumped_to_this_image()) + if (!system_jumped_late()) board_reset_pd_mcu(); /* diff --git a/board/scarlet/board.c b/board/scarlet/board.c index cb70a7c163..ca4c7eb13d 100644 --- a/board/scarlet/board.c +++ b/board/scarlet/board.c @@ -282,7 +282,7 @@ static void board_init(void) STM32_GPIO_OSPEEDR(GPIO_D) |= 0x000003cf; /* Sensor Init */ - if (system_jumped_to_this_image() && chipset_in_state(CHIPSET_STATE_ON)) + if (system_jumped_late() && chipset_in_state(CHIPSET_STATE_ON)) board_spi_enable(); } DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT); diff --git a/board/stryke/board.c b/board/stryke/board.c index a60f11699f..a6396ced52 100644 --- a/board/stryke/board.c +++ b/board/stryke/board.c @@ -360,7 +360,7 @@ static void reset_gpio_flags(enum gpio_signal signal, int flags) * may change the value from the previous image which could cause a * brownout. */ - if (system_is_reboot_warm() || system_jumped_to_this_image()) + if (system_is_reboot_warm() || system_jumped_late()) flags &= ~(GPIO_LOW | GPIO_HIGH); gpio_set_flags(signal, flags); diff --git a/board/sushi/board.c b/board/sushi/board.c index 36d312f330..dea90102f0 100644 --- a/board/sushi/board.c +++ b/board/sushi/board.c @@ -442,7 +442,7 @@ static void reset_gpio_flags(enum gpio_signal signal, int flags) * may change the value from the previous image which could cause a * brownout. */ - if (system_is_reboot_warm() || system_jumped_to_this_image()) + if (system_is_reboot_warm() || system_jumped_late()) flags &= ~(GPIO_LOW | GPIO_HIGH); gpio_set_flags(signal, flags); diff --git a/board/trogdor/board.c b/board/trogdor/board.c index 76b66be6f0..4ada5e7945 100644 --- a/board/trogdor/board.c +++ b/board/trogdor/board.c @@ -256,7 +256,7 @@ DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT); void board_tcpc_init(void) { /* Only reset TCPC if not sysjump */ - if (!system_jumped_to_this_image()) { + if (!system_jumped_late()) { /* TODO(crosbug.com/p/61098): How long do we need to wait? */ board_reset_pd_mcu(); } |