summaryrefslogtreecommitdiff
path: root/chip/stm32/usb_pd_phy.c
diff options
context:
space:
mode:
authorAlec Berg <alecaberg@chromium.org>2014-05-30 18:46:12 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-06-03 04:26:53 +0000
commit2ae05ecbf37865d8247f14b1b0942a489b817e60 (patch)
tree3c2824c028bb29879c1ccce2e4100b79a8f8243c /chip/stm32/usb_pd_phy.c
parentbbee5e137ee44e7bca9fa0cc8cc4ed16b068071f (diff)
downloadchrome-ec-2ae05ecbf37865d8247f14b1b0942a489b817e60.tar.gz
pd: support bist carrier mode 2
Support bist carrier mode 2 - continuously transmit alternating 1's and 0's, and check for bit errors on receive side. note that once the test is started the only way to stop is to hard reboot the devices involved. BUG=none BRANCH=none TEST=connect two fruitpies together. set one to be source: > pd charger and then start the bist > pd bist start receiving data: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa - incorrect bits: 0 / 0 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 - incorrect bits: 0 / 0 Change-Id: Id920f6b7177a418a80e1ce325042243cd633cec6 Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/202187 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'chip/stm32/usb_pd_phy.c')
-rw-r--r--chip/stm32/usb_pd_phy.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/chip/stm32/usb_pd_phy.c b/chip/stm32/usb_pd_phy.c
index 44888163c1..051d2f0710 100644
--- a/chip/stm32/usb_pd_phy.c
+++ b/chip/stm32/usb_pd_phy.c
@@ -133,7 +133,7 @@ int pd_dequeue_bits(void *ctxt, int off, int len, uint32_t *val)
return -1;
}
stream_err:
- CPRINTS("PD Invalid %d @%d", cnt, off);
+ /* CPRINTS("PD Invalid %d @%d", cnt, off); */
return -1;
}
@@ -252,11 +252,16 @@ void pd_dump_packet(void *ctxt, const char *msg)
/* --- SPI TX operation --- */
-static const struct dma_option dma_tx_option = {
+static struct dma_option dma_tx_option = {
DMAC_SPI_TX, (void *)&SPI_REGS->dr,
STM32_DMA_CCR_MSIZE_8_BIT | STM32_DMA_CCR_PSIZE_8_BIT
};
+void pd_tx_set_circular_mode(void)
+{
+ dma_tx_option.flags |= STM32_DMA_CCR_CIRC;
+}
+
void pd_start_tx(void *ctxt, int polarity, int bit_len)
{
stm32_dma_chan_t *tx = dma_get_channel(DMAC_SPI_TX);