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 <jayvik@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/91077 Reviewed-by: Subrata Banik <subratabanik@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Kapil Porwal <kapilporwal@google.com>
This commit is contained in:
parent
93c52ed340
commit
77d5cb358e
2 changed files with 13 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue