From 57cc65e7fe13c2408a1e70b8ed0c2dfddd39abe4 Mon Sep 17 00:00:00 2001 From: laranjeiro Date: Thu, 19 Mar 2009 15:57:14 +0000 Subject: 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 --- cesar/hal/phy/src/bridgedma.c | 10 ++++++++-- cesar/hal/phy/src/bridgedma_soft.c | 3 +++ 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'cesar/hal/phy') 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 { -- cgit v1.2.3