diff options
author | Namyoon Woo <namyoon@chromium.org> | 2020-01-23 18:47:51 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-02-19 20:40:15 +0000 |
commit | 88025bd9551eb73e21221279df415a39444d076c (patch) | |
tree | 67a3424f5fffe5bbd70083ac7378dd9bbbbccf70 /chip/g/usart.h | |
parent | ecef6be26f54aba46569b4a578442565cc2ffcba (diff) | |
download | chrome-ec-88025bd9551eb73e21221279df415a39444d076c.tar.gz |
control EC USB-UART bridge
This CL separates the control on USB-UART bridge of EC device from
EC UART control. USB-UART bridge shall be enabled if CCD connection
is detected and the CCD capability is enabled. Otherwise, EC USB-UART
shall be disabled. By doing so, CCD capability can be observed even
when EC-CR50 communication enables EC UART.
This patch increases the flash usage by 204 bytes
BUG=b:148247228
BRANCH=cr50, cr50_mp
TEST=ran firmware_Cr50CCDServoCap on Helios.
> ccd
State: Locked
Password: none
Flags: 0x000001
Capabilities: 0000000000000000
...
> ccdstate
AP: on
AP UART: on
EC: on
Rdd: connected
Servo: connected
CCD EXT: enabled
State flags: UARTAP UARTEC I2C USBEC
> ccdstate
AP: on
AP UART: on
EC: on
Rdd: connected
Servo: disconnected
CCD EXT: enabled
State flags: UARTAP+TX UARTEC USBEC
CCD ports blocked: (none)
> ccd
State: Opened
Password: none
Flags: 0x800001
Capabilities: 5555454115000000
...
> ccdstate
AP: on
AP UART: on
EC: on
Rdd: connected
Servo: connected
CCD EXT: enabled
State flags: UARTAP UARTEC I2C USBEC+TX
CCD ports blocked: (none)
> ccdstate
AP: on
AP UART: on
EC: on
Rdd: connected
Servo: undetectable
CCD EXT: enabled
State flags: UARTAP+TX UARTEC+TX I2C SPI USBEC+TX
CCD ports blocked: (none)
Change-Id: I6bb560a05831105ff68a9e13e4b28b002ed98096
Signed-off-by: Namyoon Woo <namyoon@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2018061
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
Diffstat (limited to 'chip/g/usart.h')
-rw-r--r-- | chip/g/usart.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/chip/g/usart.h b/chip/g/usart.h index cd3a9cfe40..2d9f04974f 100644 --- a/chip/g/usart.h +++ b/chip/g/usart.h @@ -74,4 +74,13 @@ void get_data_from_usb(struct usart_config const *config); /* Helper for UART bitbang mode. */ extern struct usart_config const ec_uart; +/* Change EC UART-USB Bridge status */ +void uart_ec_bridge_enable(int enabled, int write); + +/* Return non-zero if EC UART-USB Bridge is enabled, or 0 otherwise */ +int uart_ec_bridge_is_enabled(void); + +/* Return non-zero if EC UART-USB Bridge is readwritable, or 0 otherwise */ +int uart_ec_bridge_tx_is_enabled(void); + #endif /* __CROS_FORWARD_UART_H */ |