Commit 88bafb42 authored by David Brownell's avatar David Brownell Committed by Kevin Hilman

EDMA: cleanup after preceding patches

More cleanup:

 - We don't actually need "dma_chan[X].param_no", since we can
   always write "X" instead.  Remove "param_no".

 - That means dma_chan[] itself can go.  Yay!

 - A few more arrays can be __initconst.

 - Comment updates:  make the top look normal, add section markers.

 - Stop using that typedef internally.

 - Sanity checked #defines for edmacc_param.opt:  remove three bits
   that are reserved/zero in documentation, line up the others.

Except for the "in use" bitmask and the IRQ callback data, there
doesn't need to be much DMA driver state outside of EDMA registers
and parameter RAM.

Saves about 700 bytes of space, mostly data.
Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarKevin Hilman <khilman@deeprootsystems.com>
parent f6910f17
This diff is collapsed.
...@@ -55,13 +55,8 @@ ...@@ -55,13 +55,8 @@
#ifndef EDMA_H_ #ifndef EDMA_H_
#define EDMA_H_ #define EDMA_H_
/*Used by driver*/ /* PaRAM slots are laid out like this */
struct edmacc_param {
/**************************************************************************\
* Register Overlay Structure for PARAMENTRY
\**************************************************************************/
typedef struct {
unsigned int opt; unsigned int opt;
unsigned int src; unsigned int src;
unsigned int a_b_cnt; unsigned int a_b_cnt;
...@@ -70,7 +65,10 @@ typedef struct { ...@@ -70,7 +65,10 @@ typedef struct {
unsigned int link_bcntrld; unsigned int link_bcntrld;
unsigned int src_dst_cidx; unsigned int src_dst_cidx;
unsigned int ccnt; unsigned int ccnt;
} edmacc_paramentry_regs; };
/* don't use this typedef any more; it will be removed */
typedef struct edmacc_param edmacc_paramentry_regs;
#define CCINT0_INTERRUPT 16 #define CCINT0_INTERRUPT 16
...@@ -78,25 +76,22 @@ typedef struct { ...@@ -78,25 +76,22 @@ typedef struct {
#define TCERRINT0_INTERRUPT 18 #define TCERRINT0_INTERRUPT 18
#define TCERRINT1_INTERRUPT 19 #define TCERRINT1_INTERRUPT 19
#define SAM (1) /* fields in edmacc_param.opt */
#define DAM (1<<1) #define SAM BIT(0)
#define SYNCDIM (1<<2) #define DAM BIT(1)
#define STATIC (1<<3) #define SYNCDIM BIT(2)
#define EDMA_FWID (0x7<<8) #define STATIC BIT(3)
#define TCCMODE (0x1<<11) #define EDMA_FWID (0x07 << 8)
#define TCC (0x3f<<12) #define TCCMODE BIT(11)
#define WIMODE (0x1<<19) #define TCC (0x3f << 12)
#define TCINTEN (0x1<<20) #define TCINTEN BIT(20)
#define ITCINTEN (0x1<<21) #define ITCINTEN BIT(21)
#define TCCHEN (0x1<<22) #define TCCHEN BIT(22)
#define ITCCHEN (0x1<<23) #define ITCCHEN BIT(23)
#define SECURE (0x1<<30)
#define PRIV (0x1<<31)
#define TRWORD (0x7<<2) #define TRWORD (0x7<<2)
#define PAENTRY (0x1ff<<5) #define PAENTRY (0x1ff<<5)
/*Used by driver*/
#define DAVINCI_EDMA_NUM_DMACH 64 #define DAVINCI_EDMA_NUM_DMACH 64
...@@ -273,7 +268,7 @@ void davinci_set_dma_transfer_params(int lch, unsigned short acnt, ...@@ -273,7 +268,7 @@ void davinci_set_dma_transfer_params(int lch, unsigned short acnt,
* lch - logical channel number * lch - logical channel number
* *
*****************************************************************************/ *****************************************************************************/
void davinci_set_dma_params(int lch, edmacc_paramentry_regs * temp); void davinci_set_dma_params(int lch, struct edmacc_param *params);
/****************************************************************************** /******************************************************************************
* *
...@@ -282,7 +277,7 @@ void davinci_set_dma_params(int lch, edmacc_paramentry_regs * temp); ...@@ -282,7 +277,7 @@ void davinci_set_dma_params(int lch, edmacc_paramentry_regs * temp);
* lch - logical channel number * lch - logical channel number
* *
*****************************************************************************/ *****************************************************************************/
void davinci_get_dma_params(int lch, edmacc_paramentry_regs * temp); void davinci_get_dma_params(int lch, struct edmacc_param *params);
/****************************************************************************** /******************************************************************************
* davinci_start_dma - Starts the dma on the channel passed * davinci_start_dma - Starts the dma on the channel passed
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment