summaryrefslogtreecommitdiff
path: root/board/zinger
diff options
context:
space:
mode:
authorVincent Palatin <vpalatin@chromium.org>2015-01-06 11:00:36 -0800
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-01-15 01:07:02 +0000
commit4e75e20f4ec5cecda6742d821b1a4484952fd07e (patch)
tree210a7f79055092da7b180a27a67f7d3331b339ee /board/zinger
parent389ef0f90ff9318ced905d7a1ed8c025953aebc3 (diff)
downloadchrome-ec-4e75e20f4ec5cecda6742d821b1a4484952fd07e.tar.gz
Add PD events logging
Add a FIFO to log important events on the PD MCU and coming from the PD accessories. The retrieval of the accessories log from the accessories by the PD MCU is not implemented yet. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=samus BUG=chrome-os-partner:32785 TEST=execute "ectool --name=cros_pd pdlog" before and after plugging Zinger charger. Change-Id: If96d73e711ff6ad64cfb99bd3e4d2d8f2643f19a Reviewed-on: https://chromium-review.googlesource.com/238854 Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Alec Berg <alecaberg@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org> Trybot-Ready: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'board/zinger')
-rw-r--r--board/zinger/board.h2
-rw-r--r--board/zinger/runtime.c10
-rw-r--r--board/zinger/usb_pd_policy.c3
3 files changed, 15 insertions, 0 deletions
diff --git a/board/zinger/board.h b/board/zinger/board.h
index e307c6ff27..8eba23e214 100644
--- a/board/zinger/board.h
+++ b/board/zinger/board.h
@@ -51,6 +51,8 @@
#define CONFIG_USB_PD_CUSTOM_VDM
#undef CONFIG_USB_PD_DUAL_ROLE
#undef CONFIG_USB_PD_INTERNAL_COMP
+#define CONFIG_USB_PD_LOGGING
+#define CONFIG_USB_PD_LOG_SIZE 256
#undef CONFIG_USB_PD_RX_COMP_IRQ
#define CONFIG_USB_PD_SIMPLE_DFP
#undef CONFIG_WATCHDOG_HELP
diff --git a/board/zinger/runtime.c b/board/zinger/runtime.c
index 9d644e763a..0dfb51aed4 100644
--- a/board/zinger/runtime.c
+++ b/board/zinger/runtime.c
@@ -56,6 +56,16 @@ void task_clear_pending_irq(int irq)
CPU_NVIC_UNPEND(0) = 1 << irq;
}
+void interrupt_disable(void)
+{
+ asm("cpsid i");
+}
+
+void interrupt_enable(void)
+{
+ asm("cpsie i");
+}
+
uint32_t task_set_event(task_id_t tskid, uint32_t event, int wait)
{
last_event = event;
diff --git a/board/zinger/usb_pd_policy.c b/board/zinger/usb_pd_policy.c
index 59c49012d3..a228712290 100644
--- a/board/zinger/usb_pd_policy.c
+++ b/board/zinger/usb_pd_policy.c
@@ -554,6 +554,9 @@ int pd_custom_vdm(int port, int cnt, uint32_t *payload,
payload[1] = ADC_TO_CURR_MA(vbus_amp);
rsize = 2;
break;
+ case VDO_CMD_GET_LOG:
+ rsize = pd_vdm_get_log_entry(payload);
+ break;
default:
/* Unknown : do not answer */
return 0;