summaryrefslogtreecommitdiff
path: root/include/task.h
diff options
context:
space:
mode:
authorAlec Berg <alecaberg@chromium.org>2015-01-07 12:40:24 -0800
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-01-09 05:40:18 +0000
commit49d2682b724aa49f53344dcc2768f8ac1af41dda (patch)
tree47979b64f10ebc20cb43c9c8b8fbeca6f260d683 /include/task.h
parenta2720a0f68bbadfabdacfad3411175733c0c4098 (diff)
downloadchrome-ec-49d2682b724aa49f53344dcc2768f8ac1af41dda.tar.gz
samus: pd: fix potential junk at end of tx transmissionstabilize-6670.B
Fix potential junk at end of PD TX transmit by adding to the DMA transmit complete interrupt a blocking wait for SPI to finish and then immediately disable SPI clock. This means we block in an interrupt function for approximately 45us at the end of every transmit. But, this is the highest priority thing going on anyway. Note, there is still a potential for junk if both ports are transmitting at the same time and finish very close to the same time. BUG=chrome-os-partner:34600 BRANCH=samus TEST=load onto samus and test communications with zinger. tested specifically with an old zinger CL, https://chromium-review.googlesource.com/#/c/226118/11, which watchdogs when samus has junk at end of transmit. Tested without this CL and verified we could never successfully flash zinger over PD due to this watchdog and verified on scope presence of junk. Then tested with this change and was able to successfully flash zinger using ectool on both ports in both polarities. Change-Id: If0cd9ab0551d36a7d7dc10232b6476dd56735972 Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/239244 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'include/task.h')
-rw-r--r--include/task.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/task.h b/include/task.h
index 1ec546fdb1..0c71e804ba 100644
--- a/include/task.h
+++ b/include/task.h
@@ -13,7 +13,9 @@
/* Task event bitmasks */
/* Tasks may use the bits in TASK_EVENT_CUSTOM for their own events */
-#define TASK_EVENT_CUSTOM(x) (x & 0x07ffffff)
+#define TASK_EVENT_CUSTOM(x) (x & 0x03ffffff)
+/* DMA transmit complete event */
+#define TASK_EVENT_DMA_TC (1 << 26)
/* ADC interrupt handler event */
#define TASK_EVENT_ADC_DONE (1 << 27)
/* I2C interrupt handler event */