[6229b2a7] | 1 | /*===============================================================*\ |
---|
| 2 | | Project: RTEMS generic MFC548x BSP | |
---|
| 3 | +-----------------------------------------------------------------+ |
---|
| 4 | | Copyright (c) 2004-2009 | |
---|
[099dda2] | 5 | | embedded brains GmbH | |
---|
[6229b2a7] | 6 | | Obere Lagerstr. 30 | |
---|
[099dda2] | 7 | | 82178 Puchheim | |
---|
[6229b2a7] | 8 | | Germany | |
---|
| 9 | | rtems@embedded-brains.de | |
---|
| 10 | +-----------------------------------------------------------------+ |
---|
| 11 | | The license and distribution terms for this file may be | |
---|
| 12 | | found in the file LICENSE in this distribution or at | |
---|
| 13 | | | |
---|
[c499856] | 14 | | http://www.rtems.org/license/LICENSE. | |
---|
[6229b2a7] | 15 | | | |
---|
| 16 | +-----------------------------------------------------------------+ |
---|
| 17 | | this file declares glue functions to the Freescale Mcdma API | |
---|
| 18 | \*===============================================================*/ |
---|
| 19 | #ifndef _MCDMA_GLUE_H |
---|
| 20 | #define _MCDMA_GLUE_H |
---|
| 21 | |
---|
| 22 | #include <rtems.h> |
---|
[4d22b554] | 23 | #include <rtems/irq.h> |
---|
[6229b2a7] | 24 | #include <mcf548x/mcf548x.h> |
---|
| 25 | |
---|
| 26 | #define MCDMA_CLR_PENDING(chan) (MCF548X_DMA_DIPR = (1 << (chan))) |
---|
| 27 | #define MCDMA_GET_PENDING(chan) (MCF548X_DMA_DIPR & (1 << (chan))) |
---|
| 28 | |
---|
| 29 | /*=========================================================================*\ |
---|
| 30 | | Function: | |
---|
| 31 | \*-------------------------------------------------------------------------*/ |
---|
| 32 | void mcdma_glue_irq_enable |
---|
| 33 | ( |
---|
| 34 | /*-------------------------------------------------------------------------*\ |
---|
| 35 | | Purpose: | |
---|
| 36 | | enable interrupt for given task number | |
---|
| 37 | +---------------------------------------------------------------------------+ |
---|
| 38 | | Input Parameters: | |
---|
| 39 | \*-------------------------------------------------------------------------*/ |
---|
| 40 | int mcdma_taskno /* task number to enable */ |
---|
| 41 | ); |
---|
| 42 | /*-------------------------------------------------------------------------*\ |
---|
| 43 | | Return Value: | |
---|
| 44 | | none | |
---|
| 45 | \*=========================================================================*/ |
---|
| 46 | |
---|
| 47 | /*=========================================================================*\ |
---|
| 48 | | Function: | |
---|
| 49 | \*-------------------------------------------------------------------------*/ |
---|
| 50 | void mcdma_glue_irq_disable |
---|
| 51 | ( |
---|
| 52 | /*-------------------------------------------------------------------------*\ |
---|
| 53 | | Purpose: | |
---|
| 54 | | disable interrupt for given task number | |
---|
| 55 | +---------------------------------------------------------------------------+ |
---|
| 56 | | Input Parameters: | |
---|
| 57 | \*-------------------------------------------------------------------------*/ |
---|
| 58 | int mcdma_taskno /* task number to disable */ |
---|
| 59 | ); |
---|
| 60 | /*-------------------------------------------------------------------------*\ |
---|
| 61 | | Return Value: | |
---|
| 62 | | none | |
---|
| 63 | \*=========================================================================*/ |
---|
| 64 | |
---|
| 65 | /*=========================================================================*\ |
---|
| 66 | | Function: | |
---|
| 67 | \*-------------------------------------------------------------------------*/ |
---|
| 68 | void mcdma_glue_irq_install |
---|
| 69 | ( |
---|
| 70 | /*-------------------------------------------------------------------------*\ |
---|
| 71 | | Purpose: | |
---|
| 72 | | install given function as mcdma interrupt handler | |
---|
| 73 | +---------------------------------------------------------------------------+ |
---|
| 74 | | Input Parameters: | |
---|
| 75 | \*-------------------------------------------------------------------------*/ |
---|
| 76 | int mcdma_taskno, /* task number for handler */ |
---|
| 77 | void (*the_handler)(rtems_irq_hdl_param), /* function to call */ |
---|
| 78 | void *the_param |
---|
| 79 | ); |
---|
| 80 | /*-------------------------------------------------------------------------*\ |
---|
| 81 | | Return Value: | |
---|
| 82 | | none | |
---|
| 83 | \*=========================================================================*/ |
---|
| 84 | |
---|
| 85 | /*=========================================================================*\ |
---|
| 86 | | Function: | |
---|
| 87 | \*-------------------------------------------------------------------------*/ |
---|
| 88 | void mcdma_glue_init |
---|
| 89 | ( |
---|
| 90 | /*-------------------------------------------------------------------------*\ |
---|
| 91 | | Purpose: | |
---|
| 92 | | initialize the mcdma module (if not yet done): | |
---|
| 93 | | - load code | |
---|
| 94 | | - initialize registers | |
---|
| 95 | | - initialize bus arbiter | |
---|
| 96 | | - initialize interrupt control | |
---|
| 97 | +---------------------------------------------------------------------------+ |
---|
| 98 | | Input Parameters: | |
---|
| 99 | \*-------------------------------------------------------------------------*/ |
---|
| 100 | void *sram_base /* base address for SRAM, to be used for DMA task */ |
---|
| 101 | ); |
---|
| 102 | /*-------------------------------------------------------------------------*\ |
---|
| 103 | | Return Value: | |
---|
| 104 | | none | |
---|
| 105 | \*=========================================================================*/ |
---|
| 106 | |
---|
| 107 | #endif /* _MCDMA_GLUE_H */ |
---|