mb/google/bluey: Enable source mode on debug access port

The current implementation only supports sink mode on the debug access
port, which is used for charging. To enhance debugging capabilities,
expand the support to include source mode.

Refactor the Kconfig option to HAVE_DEBUG_ACCESS_PORT_SOURCE_SINK and
update the initialization logic to configure both SRC and SNK modes
via the PMIC's SCHG_TYPE_C_DEBUG_ACCESS registers. This allows the
debug port to serve as a power source or sink as required by the
attached debug hardware.

BUG=none
TEST=Verify debug port modes on Google/Quartz.

Change-Id: I3ec45d9cdc0ec6e723d10792f4e347462cecd2ed
Signed-off-by: Kapil Porwal <kapilporwal@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/91670
Reviewed-by: Subrata Banik <subratabanik@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jayvik Desai <jayvik@google.com>
This commit is contained in:
Kapil Porwal 2026-03-13 23:31:20 +05:30 committed by Subrata Banik
commit dc7bf7e3f9
4 changed files with 14 additions and 9 deletions

View file

@ -58,7 +58,7 @@ config BOARD_GOOGLE_QUENBIH
config BOARD_GOOGLE_QUARTZ
select BOARD_GOOGLE_MODEL_QUARTZ
select HAVE_CHARGING_DEBUG_ACCESS_PORT
select HAVE_DEBUG_ACCESS_PORT_SOURCE_SINK
select SOC_QUALCOMM_HAMOA
select MAINBOARD_HAS_PS8820_RETIMER
select MAINBOARD_NO_USB_A_PORT
@ -131,11 +131,11 @@ config MAINBOARD_SUPPORTS_PARALLEL_CHARGING
help
Enable this option if your mainboard supports parallel charging.
config HAVE_CHARGING_DEBUG_ACCESS_PORT
config HAVE_DEBUG_ACCESS_PORT_SOURCE_SINK
bool
default n
help
Enable this option to allow charging on the debug access port.
Enable this option to allow source and sink modes on the debug access port.
config MAINBOARD_HAS_GOOGLE_TPM
bool

View file

@ -61,7 +61,7 @@ void setup_chromeos_gpios(void);
bool is_off_mode(void);
void configure_parallel_charging(void);
void configure_parallel_charging_late(void);
void configure_charging_debug_access(void);
void configure_debug_access_port(void);
void enable_slow_battery_charging(void);
void disable_slow_battery_charging(void);
void launch_charger_applet(void);

View file

@ -21,6 +21,9 @@
#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 SCHG_TYPE_C_TYPE_C_DEBUG_ACCESS_SRC_CFG 0x2B4C
#define SMB1_SCHG_TYPE_C_TYPE_C_DEBUG_ACCESS_SRC_CFG \
((SMB1_SLAVE_ID << 16) | SCHG_TYPE_C_TYPE_C_DEBUG_ACCESS_SRC_CFG)
#define SCHG_CHGR_CHARGING_FCC 0x260A
#define SMB1_CHGR_CHARGING_FCC ((SMB1_SLAVE_ID << 16) | SCHG_CHGR_CHARGING_FCC)
#define SMB2_CHGR_CHARGING_FCC ((SMB2_SLAVE_ID << 16) | SCHG_CHGR_CHARGING_FCC)
@ -28,6 +31,7 @@
#define FCC_1A_STEP_50MA 0x14
#define FCC_DISABLE 0x8c
#define EN_DEBUG_ACCESS_SNK 0x1B
#define EN_DEBUG_ACCESS_SRC 0x01
#define PMC8380F_SLAVE_ID 0x05
#define GPIO07_MODE_CTL 0x8E40
@ -205,14 +209,15 @@ void configure_parallel_charging(void)
}
/*
* Enable SMB1 charging debug access port.
* Configure debug access port to support source and sink modes.
*/
void configure_charging_debug_access(void)
void configure_debug_access_port(void)
{
if (!CONFIG(HAVE_CHARGING_DEBUG_ACCESS_PORT))
if (!CONFIG(HAVE_DEBUG_ACCESS_PORT_SOURCE_SINK))
return;
printk(BIOS_INFO, "Enable charging debug access port support\n");
printk(BIOS_INFO, "Enable support of source and sink modes for debug access port\n");
spmi_write8(SMB1_SCHG_TYPE_C_TYPE_C_DEBUG_ACCESS_SRC_CFG, EN_DEBUG_ACCESS_SRC);
spmi_write8(SMB1_SCHG_TYPE_C_TYPE_C_DEBUG_ACCESS_SNK_CFG, EN_DEBUG_ACCESS_SNK);
}

View file

@ -204,7 +204,7 @@ static void handle_low_power_charging_boot(void)
static void mainboard_init(struct device *dev)
{
configure_parallel_charging();
configure_charging_debug_access();
configure_debug_access_port();
display_startup();