summaryrefslogtreecommitdiff
path: root/baseboard/honeybuns
diff options
context:
space:
mode:
authorScott Collyer <scollyer@google.com>2021-06-22 13:04:01 -0700
committerCommit Bot <commit-bot@chromium.org>2021-07-09 19:27:42 +0000
commit54207d9ee79bd58fb8ba0cab8e7b164f08ba93e2 (patch)
tree5c32e9becb7f0c5819801eb93e14c4a71f757e06 /baseboard/honeybuns
parentafc5702f258b1a4cd88f46145f30cfa0de9f4bc9 (diff)
downloadchrome-ec-54207d9ee79bd58fb8ba0cab8e7b164f08ba93e2.tar.gz
gingerbread: Account for port C1 1.5A current limit
This CL adds an override function for typec_get_default_current_limit_rp() for gingerbread. This allows port C0 to have a 3.0A current limit as desired, and still limit C1 to 1.5A. A new macro BOARD_C1_1A5_LIMIT was added to allow this feature to be used for honeybuns variants. This macro is also used to adjust the USB-PD SRC CAP current limit to 1.5A BUG=b:191793195 BRANCH=quiche TEST=verfied on Gingerbread that Rp = 3.0A is selected for C0 and Rp = 1.5A is selected for port C1. C0: > ucpd info cc1 = Rp cc2 = Open Rp = Rp_3.0 cc1_v = 2 cc2_v = 0 rx_en = 1 pol = 0 C1: > tcpc 1 dump ROLE_CTRL (0x1a) = 0x15 Signed-off-by: Scott Collyer <scollyer@google.com> Change-Id: I2853ddcbc7b1d76320e480bd4c11ad555dd52bad Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2980440 Commit-Queue: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
Diffstat (limited to 'baseboard/honeybuns')
-rw-r--r--baseboard/honeybuns/baseboard.h10
-rw-r--r--baseboard/honeybuns/usb_pd_policy.c20
2 files changed, 30 insertions, 0 deletions
diff --git a/baseboard/honeybuns/baseboard.h b/baseboard/honeybuns/baseboard.h
index 9608e4ebd3..d3f3eb9408 100644
--- a/baseboard/honeybuns/baseboard.h
+++ b/baseboard/honeybuns/baseboard.h
@@ -132,8 +132,18 @@ enum usb_strings {
#define CONFIG_USB_PD_ALT_MODE_UFP_DP
#define CONFIG_USB_PD_DUAL_ROLE
#define CONFIG_USB_PD_REV30
+/*
+ * Source current limit pull options. Honeybuns always wants TYPEC_RP_3A0
+ * current limits for the usbc host port (C0). For port C1, some variants are
+ * designed with a 1.5A current limit. This variation is handled via
+ * BOARD_C1_1A5_LIMIT which would be set in a variant's board.h file.
+ *
+ * CONFIG_USB_PD_3A_PORTS should be left at 0 as this will disable DPM from
+ * doing any dynamic current limit management.
+ */
#undef CONFIG_USB_PD_PULLUP
#define CONFIG_USB_PD_PULLUP TYPEC_RP_3A0
+#define CONFIG_USB_PD_3A_PORTS 0
#define CONFIG_USB_PD_TCPM_MUX
#define CONFIG_USB_PD_TCPM_PS8805
#define CONFIG_USB_PD_TCPM_STM32GX
diff --git a/baseboard/honeybuns/usb_pd_policy.c b/baseboard/honeybuns/usb_pd_policy.c
index e78e759b84..51512cb518 100644
--- a/baseboard/honeybuns/usb_pd_policy.c
+++ b/baseboard/honeybuns/usb_pd_policy.c
@@ -47,9 +47,15 @@ const uint32_t pd_src_host_pdo[] = {
};
BUILD_ASSERT(ARRAY_SIZE(pd_src_host_pdo) == PDO_IDX_COUNT);
+#ifdef BOARD_C1_1A5_LIMIT
+const uint32_t pd_src_display_pdo[] = {
+ [PDO_IDX_5V] = PDO_FIXED(5000, 1500, PDO_FIXED_FLAGS),
+};
+#else
const uint32_t pd_src_display_pdo[] = {
[PDO_IDX_5V] = PDO_FIXED(5000, 3000, PDO_FIXED_FLAGS),
};
+#endif
const uint32_t pd_snk_pdo[] = {
[PDO_IDX_5V] = PDO_FIXED(5000, 0, PDO_FIXED_FLAGS),
@@ -348,6 +354,20 @@ int pd_check_power_swap(int port)
return 0;
}
+#ifdef BOARD_C1_1A5_LIMIT
+__override int typec_get_default_current_limit_rp(int port)
+{
+ int rp = TYPEC_RP_USB;
+
+ if (port == USB_PD_PORT_HOST)
+ rp = TYPEC_RP_3A0;
+ else if (port == USB_PD_PORT_DP)
+ rp = TYPEC_RP_1A5;
+
+ return rp;
+}
+#endif
+
static void usb_tc_connect(void)
{
int port = TASK_ID_TO_PD_PORT(task_get_current());