summaryrefslogtreecommitdiff
path: root/cesar
diff options
context:
space:
mode:
authorlaranjeiro2009-03-19 15:57:14 +0000
committerlaranjeiro2009-03-19 15:57:14 +0000
commit57cc65e7fe13c2408a1e70b8ed0c2dfddd39abe4 (patch)
tree813d8aaa07af37addf170decbd2d7fca1e552f66 /cesar
parent1a40e3995a05be97c6e6de529705ccfdca5d9a1f (diff)
hal/phy: Fix the bridge DMA control functions.
* Soft/Hard: The chain of the jobs when the first is ended. git-svn-id: svn+ssh://pessac/svn/cesar/trunk@4261 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cesar')
-rw-r--r--cesar/hal/phy/src/bridgedma.c10
-rw-r--r--cesar/hal/phy/src/bridgedma_soft.c3
2 files changed, 11 insertions, 2 deletions
diff --git a/cesar/hal/phy/src/bridgedma.c b/cesar/hal/phy/src/bridgedma.c
index f666692f41..c74b9eac38 100644
--- a/cesar/hal/phy/src/bridgedma.c
+++ b/cesar/hal/phy/src/bridgedma.c
@@ -34,6 +34,7 @@ static cyg_uint32
_bridgedma_ecos_isr(cyg_vector_t vector, cyg_addrword_t data)
{
volatile u32* job_current = (u32 *) PHY_BRIDGEDMA_CURR_JOBD_PTR;
+ volatile u32 *control = (u32*) PHY_BRIDGEDMA_CONTROL;
/* nothing to do except calling the bridgedma callback */
phy_bridgedma_t *bridgedma_ctx;
@@ -43,6 +44,10 @@ _bridgedma_ecos_isr(cyg_vector_t vector, cyg_addrword_t data)
bridgedma_ctx = (phy_bridgedma_t *)data;
+ /* If the bridge DMA is not running. */
+ if (!((phy_bridgedma_ctrl_t *) control)->start)
+ bridgedma_ctx->job_first = NULL;
+
/* Remove the head of the bridgedma list. */
arch_write_buffer_flush ();
bridgedma_ctx->job_current = (phy_bridgedma_job_t *) *job_current;
@@ -141,14 +146,15 @@ void
phy_bridgedma_start (phy_bridgedma_t *ctx, phy_bridgedma_job_t *job_first,
phy_bridgedma_job_t *job_last)
{
- u32 *control = (u32*) PHY_BRIDGEDMA_CONTROL;
+ volatile u32 *control = (u32*) PHY_BRIDGEDMA_CONTROL;
dbg_assert (ctx);
dbg_assert (job_first);
dbg_assert (job_last);
/* Bridge context is empty. */
- if (ctx->job_first == NULL)
+ if ((ctx->job_first == NULL)
+ && (!((phy_bridgedma_ctrl_t *) control)->start))
{
volatile u32 *job_desc = (u32*) PHY_BRIDGEDMA_JOBD_PTR;
diff --git a/cesar/hal/phy/src/bridgedma_soft.c b/cesar/hal/phy/src/bridgedma_soft.c
index 3a64471a09..ed26f5af96 100644
--- a/cesar/hal/phy/src/bridgedma_soft.c
+++ b/cesar/hal/phy/src/bridgedma_soft.c
@@ -431,6 +431,9 @@ phy_bridgedma_proto_process (cyg_addrword_t data)
{
_job_process(bridgedma_ctx, bridgedma_ctx->job_current);
bridgedma_ctx->job_current = bridgedma_ctx->job_current->next;
+
+ if (bridgedma_ctx->job_current == NULL)
+ bridgedma_ctx->job_first = NULL;
}
else
{