Changeset 2d43f2d in rtems


Ignore:
Timestamp:
Mar 29, 2012, 8:58:37 AM (9 years ago)
Author:
Christian Mauderer <christian.mauderer@…>
Branches:
4.11, 5, master
Children:
356c928
Parents:
c838ca2d
git-author:
Christian Mauderer <christian.mauderer@…> (03/29/12 08:58:37)
git-committer:
Sebastian Huber <sebastian.huber@…> (07/18/12 07:46:13)
Message:

bsp/mpc55xx: Support re-initialization of eDMA

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libcpu/powerpc/mpc55xx/edma/edma.c

    rc838ca2d r2d43f2d  
    88
    99/*
    10  * Copyright (c) 2008-2011 embedded brains GmbH.  All rights reserved.
     10 * Copyright (c) 2008-2012 embedded brains GmbH.  All rights reserved.
    1111 *
    1212 *  embedded brains GmbH
     
    2626
    2727#include <assert.h>
    28 #include <string.h>
    2928
    3029#include <bsp/irq.h>
     
    6665static RTEMS_CHAIN_DEFINE_EMPTY(edma_channel_chain);
    6766
    68 volatile struct EDMA_tag *edma_get_regs_by_channel(unsigned channel)
     67static volatile struct EDMA_tag *edma_get_regs_by_channel(unsigned channel)
    6968{
    7069#if EDMA_MODULE_COUNT == 1
     
    7776}
    7877
    79 volatile struct EDMA_tag *edma_get_regs_by_module(unsigned module)
     78static volatile struct EDMA_tag *edma_get_regs_by_module(unsigned module)
    8079{
    8180#if EDMA_MODULE_COUNT == 1
     
    212211    channel_remaining -= channel_count;
    213212
     213    /* Disable requests */
     214    edma->CERQR.B.CERQ = 0x40;
     215
    214216    /* Arbitration mode: group round robin, channel fixed */
    215217    edma->CR.B.ERGA = 1;
    216218    edma->CR.B.ERCA = 0;
    217219    for (channel = 0; channel < channel_count; ++channel) {
     220      volatile struct tcd_t *tcd = &edma->TCD [channel];
    218221      edma->CPR [channel].R = 0x80U | (channel & 0xfU);
     222
     223      /* Initialize TCD, stop channel first */
     224      tcd->BMF.R = 0;
     225      tcd->SADDR = 0;
     226      tcd->SDF.R = 0;
     227      tcd->NBYTES = 0;
     228      tcd->SLAST = 0;
     229      tcd->DADDR = 0;
     230      tcd->CDF.R = 0;
     231      tcd->DLAST_SGA = 0;
    219232    }
    220233
    221     /* Clear TCDs */
    222     memset((void *) &edma->TCD [0], 0, channel_count * sizeof(edma->TCD [0]));
     234    /* Clear interrupt requests */
     235    edma->CIRQR.B.CINT = 0x40;
     236    edma->CER.B.CERR = 0x40;
    223237  }
    224238
Note: See TracChangeset for help on using the changeset viewer.