summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAseda Aboagye <aaboagye@google.com>2017-08-24 14:19:25 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-08-28 15:24:10 -0700
commit88abd3ee7284862fd7b76d251aabc4d79a735831 (patch)
tree16966d53a7baf9e1b377a9d90a212328a9bccd29
parent52789bd7fd6307e2d48add81a325c1582303ea1b (diff)
downloadchrome-ec-88abd3ee7284862fd7b76d251aabc4d79a735831.tar.gz
zoombini: Add USB-A charge control support.
BUG=None BRANCH=None TEST=make -j buildall Change-Id: I8ee0ec01d06343a158f4271e1f9ecdb3d8895659 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/634275 Commit-Ready: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
-rw-r--r--board/zoombini/board.c5
-rw-r--r--board/zoombini/board.h7
-rw-r--r--board/zoombini/gpio.inc3
3 files changed, 14 insertions, 1 deletions
diff --git a/board/zoombini/board.c b/board/zoombini/board.c
index 71055e0e48..47fc04e149 100644
--- a/board/zoombini/board.c
+++ b/board/zoombini/board.c
@@ -100,6 +100,11 @@ const struct i2c_port_t i2c_ports[] = {
};
const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports);
+/* GPIO to enable/disable the USB Type-A port. */
+const int usb_port_enable[CONFIG_USB_PORT_POWER_SMART_PORT_COUNT] = {
+ GPIO_USB_A_5V_EN,
+};
+
/* Keyboard scan setting */
struct keyboard_scan_config keyscan_config = {
/* Extra delay when KSO2 is tied to Cr50. */
diff --git a/board/zoombini/board.h b/board/zoombini/board.h
index 219f1111ce..da020be4c0 100644
--- a/board/zoombini/board.h
+++ b/board/zoombini/board.h
@@ -79,6 +79,13 @@
#define CONFIG_USBC_VCONN
#define CONFIG_USBC_VCONN_SWAP
+/* USB Type-A Port BC1.2 support */
+#define CONFIG_USB_PORT_POWER_SMART
+#undef CONFIG_USB_PORT_POWER_SMART_PORT_COUNT
+#define CONFIG_USB_PORT_POWER_SMART_PORT_COUNT 1
+#define CONFIG_USB_PORT_POWER_SMART_CDP_SDP_ONLY
+#define GPIO_USB1_ILIM_SEL GPIO_USB_A_HIGH_POWER_EN
+
/* Define typical operating power and max power. */
#define PD_MAX_VOLTAGE_MV 20000
#define PD_MAX_CURRENT_MA 3000
diff --git a/board/zoombini/gpio.inc b/board/zoombini/gpio.inc
index 7aeeeee5d3..daf558164f 100644
--- a/board/zoombini/gpio.inc
+++ b/board/zoombini/gpio.inc
@@ -63,7 +63,8 @@ GPIO(I2C5_SDA, PIN(3, 6), GPIO_INPUT)
GPIO(BAT_PRESENT_L, PIN(E, 5), GPIO_INPUT)
GPIO(USB_PD_RST_L, PIN(F, 1), GPIO_ODR_HIGH)
-GPIO(USB1_ENABLE, PIN(A, 0), GPIO_OUT_LOW)
+GPIO(USB_A_5V_EN, PIN(A, 0), GPIO_OUT_LOW)
+GPIO(USB_A_HIGH_POWER_EN, PIN(A, 2), GPIO_OUT_LOW)
GPIO(USB_C0_5V_EN, PIN(6, 7), GPIO_OUT_LOW)
GPIO(USB_C1_5V_EN, PIN(7, 0), GPIO_OUT_LOW)