From 0da04cf6754925d47ef98e402c9fdacd0a9babd7 Mon Sep 17 00:00:00 2001 From: Subrata Banik Date: Wed, 4 Feb 2026 19:11:36 +0000 Subject: [PATCH] mb/google/bluey: Consider vboot modes for PD negotiation This change introduces a check to ensure Power Delivery (PD) negotiation is enabled when the device is in a specific vboot state. PD negotiation will now be enabled if: 1. It is explicitly required by the hardware sync logic. 2. The device is in Developer Mode. 3. The device is in Recovery Mode. 4. A recovery request is pending. This ensures that charging and PD sync are prioritized during critical recovery and development paths. This patch ensures the factory process remains powered by enabling early charging based on the specific vboot mode. In normal user scenarios, early charging is bypassed to allow higher -level software to manage power negotiation according to standard policy. BUG=b:481546101 TEST=Build and boot on google/quartz. Verified PD negotiation is active in developer/recovery mode. Change-Id: I44b2ebd4fe3eec78a6df235df6282264dd97341f Signed-off-by: Subrata Banik Reviewed-on: https://review.coreboot.org/c/coreboot/+/91096 Reviewed-by: Kapil Porwal Tested-by: build bot (Jenkins) Reviewed-by: Jayvik Desai Reviewed-by: Pranava Y N --- src/mainboard/google/bluey/romstage.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/mainboard/google/bluey/romstage.c b/src/mainboard/google/bluey/romstage.c index 33878069c6..a357f6d3d5 100644 --- a/src/mainboard/google/bluey/romstage.c +++ b/src/mainboard/google/bluey/romstage.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -74,12 +75,27 @@ static bool is_pd_sync_required(void) return false; } +/* Check if it is okay to enable PD sync. */ +static bool vboot_can_enable_pd_sync(void) +{ + if (!CONFIG(VBOOT)) + return false; + + /* Always enable if in developer or recovery mode */ + if (vboot_developer_mode_enabled() || vboot_recovery_mode_enabled() || + vboot_check_recovery_request()) + return true; + + /* Otherwise disable */ + return false; +} + int qclib_mainboard_override(struct qclib_cb_if_table *table) { if (!CONFIG(EC_GOOGLE_CHROMEEC)) return 0; - if (is_pd_sync_required()) + if (is_pd_sync_required() || vboot_can_enable_pd_sync()) table->global_attributes |= QCLIB_GA_ENABLE_PD_NEGOTIATION; else table->global_attributes &= ~QCLIB_GA_ENABLE_PD_NEGOTIATION;