From 77d5cb358ee406012bb9a30a30d8634624805e5c Mon Sep 17 00:00:00 2001 From: Jayvik Desai Date: Tue, 3 Feb 2026 18:31:06 +0530 Subject: [PATCH] mb/google/bluey: Add support to enable charging for debug access port When the system is in a low-power boot state or early charging mode, it is necessary to enable charging even when a debug access port is connected. This ensures that developers can charge the device while using the servov4.1 with the charger. This patch updates the charging configuration to enable the debug access sink by writing to the TYPE_C_TYPE_C_DEBUG_ACCESS_SNK_CFG register. BUG=b:474297115 TEST=Build Google/quartz Change-Id: I155b071e678c8bc0ff0d719ac924b5026b21b37a Signed-off-by: Jayvik Desai Reviewed-on: https://review.coreboot.org/c/coreboot/+/91077 Reviewed-by: Subrata Banik Tested-by: build bot (Jenkins) Reviewed-by: Kapil Porwal --- src/mainboard/google/bluey/Kconfig | 6 ++++++ src/mainboard/google/bluey/charging.c | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/src/mainboard/google/bluey/Kconfig b/src/mainboard/google/bluey/Kconfig index 2021787699..6dc2325465 100644 --- a/src/mainboard/google/bluey/Kconfig +++ b/src/mainboard/google/bluey/Kconfig @@ -123,6 +123,12 @@ config MAINBOARD_SUPPORTS_PARALLEL_CHARGING help Enable this option if your mainboard supports parallel charging. +config HAVE_CHARGING_DEBUG_ACCESS_PORT + bool + default n + help + Enable this option to allow charging on the debug access port. + config MAINBOARD_HAS_GOOGLE_TPM bool default n diff --git a/src/mainboard/google/bluey/charging.c b/src/mainboard/google/bluey/charging.c index 6027dc3c6b..5252a1e531 100644 --- a/src/mainboard/google/bluey/charging.c +++ b/src/mainboard/google/bluey/charging.c @@ -11,11 +11,15 @@ #define SMB1_CHGR_MAX_FCC_CFG ((SMB1_SLAVE_ID << 16) | SCHG_CHGR_MAX_FAST_CHARGE_CURRENT_CFG) #define SMB2_CHGR_MAX_FCC_CFG ((SMB2_SLAVE_ID << 16) | SCHG_CHGR_MAX_FAST_CHARGE_CURRENT_CFG) #define SCHG_CHGR_CHARGING_ENABLE_CMD 0x2642 +#define SCHG_TYPE_C_TYPE_C_DEBUG_ACCESS_SNK_CFG 0x2B4A #define SMB1_CHGR_CHRG_EN_CMD ((SMB1_SLAVE_ID << 16) | SCHG_CHGR_CHARGING_ENABLE_CMD) #define SMB2_CHGR_CHRG_EN_CMD ((SMB2_SLAVE_ID << 16) | SCHG_CHGR_CHARGING_ENABLE_CMD) +#define SMB1_SCHG_TYPE_C_TYPE_C_DEBUG_ACCESS_SNK_CFG \ +((SMB1_SLAVE_ID << 16) | SCHG_TYPE_C_TYPE_C_DEBUG_ACCESS_SNK_CFG) #define FCC_1A_STEP_50MA 0x14 #define FCC_DISABLE 0x8c +#define EN_DEBUG_ACCESS_SNK 0x1B enum charging_status { CHRG_DISABLE, @@ -75,6 +79,9 @@ void enable_slow_battery_charging(void) spmi_write8(SMB2_CHGR_MAX_FCC_CFG, FCC_1A_STEP_50MA); spmi_write8(SMB1_CHGR_CHRG_EN_CMD, CHRG_ENABLE); spmi_write8(SMB2_CHGR_CHRG_EN_CMD, CHRG_ENABLE); + + if (CONFIG(HAVE_CHARGING_DEBUG_ACCESS_PORT)) + spmi_write8(SMB1_SCHG_TYPE_C_TYPE_C_DEBUG_ACCESS_SNK_CFG, EN_DEBUG_ACCESS_SNK); } /*