summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiana Z <dzigterman@chromium.org>2023-04-19 14:33:16 -0600
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-05-08 19:51:01 +0000
commit7834245c40904dafda75f5102b089aa201644171 (patch)
treeb295f9f409e93c4e54f056c4c483d3302ae88a65
parente107a850e01b762d2757a34936b19f961580fcca (diff)
downloadchrome-ec-7834245c40904dafda75f5102b089aa201644171.tar.gz
Frostflow: Always initialize retimer when enabled
The A1 retimer will be enabled anytime the board boots. Ensure that the tuning parameters are applied every time the retimer is enabled again since they clear when the retimer is disabled. BUG=b:273849234,b:280957965 TEST=on frostflow, run suspend stress test and verify retimer initialization always reports success talking to the chip, spot check tuning register contents Change-Id: I147e6e7ad09f3279a77fe3f0757cf6ed140b058c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4450966 Reviewed-by: Chao Gui <chaogui@google.com> Tested-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Diana Z <dzigterman@chromium.org> Reviewed-by: Robert Zieba <robertzieba@google.com>
-rw-r--r--zephyr/program/skyrim/frostflow/src/usb_mux_config.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/zephyr/program/skyrim/frostflow/src/usb_mux_config.c b/zephyr/program/skyrim/frostflow/src/usb_mux_config.c
index b73c6370b8..a46668b65c 100644
--- a/zephyr/program/skyrim/frostflow/src/usb_mux_config.c
+++ b/zephyr/program/skyrim/frostflow/src/usb_mux_config.c
@@ -5,6 +5,7 @@
/* Frostflow board-specific USB-C mux configuration */
+#include "ap_power/ap_power.h"
#include "chipset.h"
#include "common.h"
#include "console.h"
@@ -175,8 +176,26 @@ void baseboard_a1_retimer_setup(void)
}
DECLARE_DEFERRED(baseboard_a1_retimer_setup);
-void board_chipset_startup(void)
+test_export_static void board_resume_change(struct ap_power_ev_callback *cb,
+ struct ap_power_ev_data data)
{
- hook_call_deferred(&baseboard_a1_retimer_setup_data, 500 * MSEC);
+ switch (data.event) {
+ default:
+ return;
+
+ case AP_POWER_RESUME:
+ /* Any retimer tuning can be done after the retimer turns on */
+ hook_call_deferred(&baseboard_a1_retimer_setup_data, 20 * MSEC);
+ break;
+ }
+}
+
+void board_callback_init(void)
+{
+ static struct ap_power_ev_callback cb;
+
+ /* Setup a resume callback */
+ ap_power_ev_init_callback(&cb, board_resume_change, AP_POWER_RESUME);
+ ap_power_ev_add_callback(&cb);
}
-DECLARE_HOOK(HOOK_INIT, board_chipset_startup, HOOK_PRIO_DEFAULT);
+DECLARE_HOOK(HOOK_INIT, board_callback_init, HOOK_PRIO_DEFAULT);