summaryrefslogtreecommitdiff
path: root/board/ryu
diff options
context:
space:
mode:
authorVincent Palatin <vpalatin@chromium.org>2015-09-02 14:45:14 -0700
committerchrome-bot <chrome-bot@chromium.org>2015-09-08 13:49:09 -0700
commit96093145cb6549a6058627a7aa196e86ac3911f4 (patch)
tree8e027d656391fb277e4c22d9dfb63389e53741de /board/ryu
parent15fcbc95967b79157dc892f547206f2a0967d2ff (diff)
downloadchrome-ec-96093145cb6549a6058627a7aa196e86ac3911f4.tar.gz
update case closed debugging partial mode policy
When a debug accessory is connected to the type-C port while the write protection is enabled, put the case closed debugging in "partial" mode rather than "full". Update the "partial" mode to provide read-only access to the AP and EC consoles. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=smaug BUG=chrome-os-partner:44700 TEST=check the EC console input/output over USB is still working with SuzyQ on a write-protected system, verify that the console input is disabled. Change-Id: I5baa03d6e738d06437c45469f46b286e76a755a4 Reviewed-on: https://chromium-review.googlesource.com/297141 Commit-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Anton Staaf <robotboy@chromium.org> Reviewed-by: Alec Berg <alecaberg@chromium.org>
Diffstat (limited to 'board/ryu')
-rw-r--r--board/ryu/board.c4
-rw-r--r--board/ryu/usb_pd_policy.c3
2 files changed, 6 insertions, 1 deletions
diff --git a/board/ryu/board.c b/board/ryu/board.c
index 49a7e1bf0a..24402d42fc 100644
--- a/board/ryu/board.c
+++ b/board/ryu/board.c
@@ -30,6 +30,7 @@
#include "queue_policies.h"
#include "registers.h"
#include "spi.h"
+#include "system.h"
#include "task.h"
#include "usb.h"
#include "usb_charge.h"
@@ -144,6 +145,9 @@ static void board_init(void)
queue_init(&ap_usart_to_usb);
queue_init(&ap_usb_to_usart);
usart_init(&ap_usart);
+ /* Disable UART input when the Write Protect is enabled */
+ if (system_is_locked())
+ ap_usb.state->rx_disabled = 1;
/*
* Enable CC lines after all GPIO have been initialized. Note, it is
diff --git a/board/ryu/usb_pd_policy.c b/board/ryu/usb_pd_policy.c
index 14e5828f17..ea709a3b53 100644
--- a/board/ryu/usb_pd_policy.c
+++ b/board/ryu/usb_pd_policy.c
@@ -255,7 +255,8 @@ int pd_custom_vdm(int port, int cnt, uint32_t *payload,
#endif /* CONFIG_USB_PD_LOGGING */
#ifdef CONFIG_CASE_CLOSED_DEBUG
case VDO_CMD_CCD_EN:
- ccd_set_mode(CCD_MODE_ENABLED);
+ ccd_set_mode(system_is_locked() ? CCD_MODE_PARTIAL
+ : CCD_MODE_ENABLED);
break;
#endif
}