|
@@ -7,6 +7,7 @@
|
|
|
|
|
|
#include "cppi_dma.h"
|
|
#include "cppi_dma.h"
|
|
#include "musb_core.h"
|
|
#include "musb_core.h"
|
|
|
|
+#include "musb_trace.h"
|
|
|
|
|
|
#define RNDIS_REG(x) (0x80 + ((x - 1) * 4))
|
|
#define RNDIS_REG(x) (0x80 + ((x - 1) * 4))
|
|
|
|
|
|
@@ -126,6 +127,8 @@ static void cppi41_trans_done(struct cppi41_dma_channel *cppi41_channel)
|
|
csr = MUSB_TXCSR_MODE | MUSB_TXCSR_TXPKTRDY;
|
|
csr = MUSB_TXCSR_MODE | MUSB_TXCSR_TXPKTRDY;
|
|
musb_writew(epio, MUSB_TXCSR, csr);
|
|
musb_writew(epio, MUSB_TXCSR, csr);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ trace_musb_cppi41_done(cppi41_channel);
|
|
musb_dma_completion(musb, hw_ep->epnum, cppi41_channel->is_tx);
|
|
musb_dma_completion(musb, hw_ep->epnum, cppi41_channel->is_tx);
|
|
} else {
|
|
} else {
|
|
/* next iteration, reload */
|
|
/* next iteration, reload */
|
|
@@ -154,6 +157,7 @@ static void cppi41_trans_done(struct cppi41_dma_channel *cppi41_channel)
|
|
dma_desc->callback = cppi41_dma_callback;
|
|
dma_desc->callback = cppi41_dma_callback;
|
|
dma_desc->callback_param = &cppi41_channel->channel;
|
|
dma_desc->callback_param = &cppi41_channel->channel;
|
|
cppi41_channel->cookie = dma_desc->tx_submit(dma_desc);
|
|
cppi41_channel->cookie = dma_desc->tx_submit(dma_desc);
|
|
|
|
+ trace_musb_cppi41_cont(cppi41_channel);
|
|
dma_async_issue_pending(dc);
|
|
dma_async_issue_pending(dc);
|
|
|
|
|
|
if (!cppi41_channel->is_tx) {
|
|
if (!cppi41_channel->is_tx) {
|
|
@@ -221,10 +225,7 @@ static void cppi41_dma_callback(void *private_data)
|
|
transferred = cppi41_channel->prog_len - txstate.residue;
|
|
transferred = cppi41_channel->prog_len - txstate.residue;
|
|
cppi41_channel->transferred += transferred;
|
|
cppi41_channel->transferred += transferred;
|
|
|
|
|
|
- musb_dbg(musb, "DMA transfer done on hw_ep=%d bytes=%d/%d",
|
|
|
|
- hw_ep->epnum, cppi41_channel->transferred,
|
|
|
|
- cppi41_channel->total_len);
|
|
|
|
-
|
|
|
|
|
|
+ trace_musb_cppi41_gb(cppi41_channel);
|
|
update_rx_toggle(cppi41_channel);
|
|
update_rx_toggle(cppi41_channel);
|
|
|
|
|
|
if (cppi41_channel->transferred == cppi41_channel->total_len ||
|
|
if (cppi41_channel->transferred == cppi41_channel->total_len ||
|
|
@@ -355,12 +356,6 @@ static bool cppi41_configure_channel(struct dma_channel *channel,
|
|
struct musb *musb = cppi41_channel->controller->musb;
|
|
struct musb *musb = cppi41_channel->controller->musb;
|
|
unsigned use_gen_rndis = 0;
|
|
unsigned use_gen_rndis = 0;
|
|
|
|
|
|
- musb_dbg(musb,
|
|
|
|
- "configure ep%d/%x packet_sz=%d, mode=%d, dma_addr=0x%llx, len=%d is_tx=%d",
|
|
|
|
- cppi41_channel->port_num, RNDIS_REG(cppi41_channel->port_num),
|
|
|
|
- packet_sz, mode, (unsigned long long) dma_addr,
|
|
|
|
- len, cppi41_channel->is_tx);
|
|
|
|
-
|
|
|
|
cppi41_channel->buf_addr = dma_addr;
|
|
cppi41_channel->buf_addr = dma_addr;
|
|
cppi41_channel->total_len = len;
|
|
cppi41_channel->total_len = len;
|
|
cppi41_channel->transferred = 0;
|
|
cppi41_channel->transferred = 0;
|
|
@@ -412,6 +407,8 @@ static bool cppi41_configure_channel(struct dma_channel *channel,
|
|
cppi41_channel->cookie = dma_desc->tx_submit(dma_desc);
|
|
cppi41_channel->cookie = dma_desc->tx_submit(dma_desc);
|
|
cppi41_channel->channel.rx_packet_done = false;
|
|
cppi41_channel->channel.rx_packet_done = false;
|
|
|
|
|
|
|
|
+ trace_musb_cppi41_config(cppi41_channel);
|
|
|
|
+
|
|
save_rx_toggle(cppi41_channel);
|
|
save_rx_toggle(cppi41_channel);
|
|
dma_async_issue_pending(dc);
|
|
dma_async_issue_pending(dc);
|
|
return true;
|
|
return true;
|
|
@@ -442,6 +439,7 @@ static struct dma_channel *cppi41_dma_channel_allocate(struct dma_controller *c,
|
|
cppi41_channel->hw_ep = hw_ep;
|
|
cppi41_channel->hw_ep = hw_ep;
|
|
cppi41_channel->is_allocated = 1;
|
|
cppi41_channel->is_allocated = 1;
|
|
|
|
|
|
|
|
+ trace_musb_cppi41_alloc(cppi41_channel);
|
|
return &cppi41_channel->channel;
|
|
return &cppi41_channel->channel;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -449,6 +447,7 @@ static void cppi41_dma_channel_release(struct dma_channel *channel)
|
|
{
|
|
{
|
|
struct cppi41_dma_channel *cppi41_channel = channel->private_data;
|
|
struct cppi41_dma_channel *cppi41_channel = channel->private_data;
|
|
|
|
|
|
|
|
+ trace_musb_cppi41_free(cppi41_channel);
|
|
if (cppi41_channel->is_allocated) {
|
|
if (cppi41_channel->is_allocated) {
|
|
cppi41_channel->is_allocated = 0;
|
|
cppi41_channel->is_allocated = 0;
|
|
channel->status = MUSB_DMA_STATUS_FREE;
|
|
channel->status = MUSB_DMA_STATUS_FREE;
|
|
@@ -518,8 +517,7 @@ static int cppi41_dma_channel_abort(struct dma_channel *channel)
|
|
u16 csr;
|
|
u16 csr;
|
|
|
|
|
|
is_tx = cppi41_channel->is_tx;
|
|
is_tx = cppi41_channel->is_tx;
|
|
- musb_dbg(musb, "abort channel=%d, is_tx=%d",
|
|
|
|
- cppi41_channel->port_num, is_tx);
|
|
|
|
|
|
+ trace_musb_cppi41_abort(cppi41_channel);
|
|
|
|
|
|
if (cppi41_channel->channel.status == MUSB_DMA_STATUS_FREE)
|
|
if (cppi41_channel->channel.status == MUSB_DMA_STATUS_FREE)
|
|
return 0;
|
|
return 0;
|