os/linux-2.6-tag--devboard-R2_10-4/arch/cris/arch-v32/drivers/elphel/cxdma353.c File Reference

#include <linux/module.h>
#include <linux/mm.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/fs.h>
#include <linux/string.h>
#include <linux/init.h>
#include <linux/autoconf.h>
#include <linux/time.h>
#include <asm/system.h>
#include <asm/arch/memmap.h>
#include <asm/io.h>
#include <asm/arch/dma.h>
#include <asm/arch/hwregs/dma_defs.h>
#include <asm/arch/hwregs/dma.h>
#include <asm/arch/hwregs/reg_map.h>
#include <asm/arch/hwregs/bif_dma_defs.h>
#include <asm/irq.h>
#include <asm/atomic.h>
#include <asm/delay.h>
#include <asm/uaccess.h>
#include <asm/arch/cache.h>
#include <asm/elphel/c313a.h>
#include "fpgactrl.h"
#include "x3x3.h"
#include "framepars.h"
#include "cxdma.h"
#include "sensor_common.h"
#include "circbuf.h"
#include "exif.h"

Include dependency graph for cxdma353.c:

Go to the source code of this file.

Defines

#define MD1(x)
#define MD12(x)
#define MD13(x)
#define D(x)
#define D1(x)
#define MD2(x)   printk("%s:%d:",__FILE__,__LINE__);x
#define MD5(x)
#define MD6(x)
#define MD7(x)
#define D0(x)
#define MD8(x)
#define MD9(x)
#define MD10(x)
#define MD11(x)
 where jpeg_rp is modified?
#define EXT_DMA_0_START
#define EXT_DMA_0_STOP
#define DMA_CHUNK   0x4000
 TODO: it seems we could use a single data descriptor (in LX data segment was limited to 16KB), but let's have minimal changes.
#define CCAM_DESCR_DATA_NUM   (( CCAM_DMA_SIZE / DMA_CHUNK) +1 )

Functions

static dma_descr_data ccam_dma_descr_data[CCAM_DESCR_DATA_NUM] __attribute__ ((__aligned__(16)))
static dma_descr_context ccam_dma_descr_context __attribute__ ((__aligned__(32)))
int x313_setDMABuffer (void)
unsigned long x313_DMA_size (void)
int x313_is_dma_on (void)
 tests if ETRAX DMA (for the FPGA compressor) is running
int x313_dma_stop (void)
 Stop ETRAX DMA for the compressor.
void x313_dma_start (void)
 Start ETRAX DMA for the compressor.
unsigned long x313_dma_init (void)
 Using external dma 3 (input) with dma channel 9.

Variables

static int dma_on = 0


Define Documentation

#define CCAM_DESCR_DATA_NUM   (( CCAM_DMA_SIZE / DMA_CHUNK) +1 )

Definition at line 138 of file cxdma353.c.

#define D ( x   ) 

Definition at line 100 of file cxdma353.c.

#define D0 ( x   ) 

Definition at line 115 of file cxdma353.c.

#define D1 ( x   ) 

Definition at line 101 of file cxdma353.c.

#define DMA_CHUNK   0x4000

TODO: it seems we could use a single data descriptor (in LX data segment was limited to 16KB), but let's have minimal changes.

Definition at line 137 of file cxdma353.c.

#define EXT_DMA_0_START

Value:

do { reg_bif_dma_rw_ch3_start c = {.run=1};\
        REG_WR(bif_dma, regi_bif_dma, rw_ch3_start, (reg_bif_dma_rw_ch3_start) c); } while( 0 )

Definition at line 128 of file cxdma353.c.

#define EXT_DMA_0_STOP

Value:

do { reg_bif_dma_rw_ch3_start c = {.run=0};\
        REG_WR(bif_dma, regi_bif_dma, rw_ch3_start, (reg_bif_dma_rw_ch3_start) c); } while( 0 )

Definition at line 131 of file cxdma353.c.

#define MD1 ( x   ) 

*************************************************************************** ! FILE NAME : cxdma353.c ! DESCRIPTION: Handling ETRAX DMA in Elphel model 353 camera ! Copyright (C) 2002-2008 Elphel, Inc ! -----------------------------------------------------------------------------** ! ! This program is free software: you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation, either version 3 of the License, or ! (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program. If not, see <http://www.gnu.org/licenses/>. ! -----------------------------------------------------------------------------** !

Log
cxdma353.c,v
! Revision 1.1.1.1 2008/11/27 20:04:00 elphel ! ! ! Revision 1.12 2008/10/29 04:18:28 elphel ! v.8.0.alpha10 made a separate structure for global parameters (not related to particular frames in a frame queue) ! ! Revision 1.11 2008/09/16 00:49:30 elphel ! snapshot ! ! Revision 1.10 2008/09/12 00:23:58 elphel ! removed cc353.c, cc353.h ! ! Revision 1.9 2008/09/11 01:05:31 elphel ! snapshot ! ! Revision 1.8 2008/09/07 19:48:08 elphel ! snapshot !

Definition at line 93 of file cxdma353.c.

#define MD10 ( x   ) 

Definition at line 122 of file cxdma353.c.

#define MD11 ( x   ) 

where jpeg_rp is modified?

Definition at line 125 of file cxdma353.c.

#define MD12 ( x   ) 

Definition at line 94 of file cxdma353.c.

#define MD13 ( x   ) 

Definition at line 95 of file cxdma353.c.

#define MD2 ( x   )     printk("%s:%d:",__FILE__,__LINE__);x

Definition at line 104 of file cxdma353.c.

#define MD5 ( x   ) 

Definition at line 108 of file cxdma353.c.

#define MD6 ( x   ) 

Definition at line 110 of file cxdma353.c.

#define MD7 ( x   ) 

Definition at line 112 of file cxdma353.c.

#define MD8 ( x   ) 

Definition at line 118 of file cxdma353.c.

#define MD9 ( x   ) 

Definition at line 120 of file cxdma353.c.


Function Documentation

static dma_descr_context ccam_dma_descr_context __attribute__ ( (__aligned__(32))   )  [static]

static dma_descr_data ccam_dma_descr_data [CCAM_DESCR_DATA_NUM] __attribute__ ( (__aligned__(16))   )  [static]

unsigned long x313_dma_init ( void   ) 

Using external dma 3 (input) with dma channel 9.

dma channel 9 allocated for ext dma 3

setup source of hsh0, shs1

just in case - turn hsh0 off

make hsh1 DACK

Configure ext DMA 3

DMA configuration (bit 0 - enable, bit 1 - stop) - stopped

DMABufferLength = 0;

x313_dma_reset_jpeg();

Definition at line 207 of file cxdma353.c.

References ccam_dma_buf_ptr, D0, MD7, printk, udelay, and x313_setDMABuffer().

unsigned long x313_DMA_size ( void   ) 

void x313_dma_start ( void   ) 

Start ETRAX DMA for the compressor.

need to restore pointers after previous stop DMA - maybe later move there?

DMA_CHUNK==0x4000

last descriptor

not the last one

TODO: does flush here IS IT STILL NEEDED HERE?

NOTE: needs to be here (not in x313_dma_init) - word width is reset by channel reset !!!

32-bit transfers

point to the beginning of the buffer?

need this also?

updated

enable DMA in JPEG mode - now it is always JPEG (no raw DMA mode)

Definition at line 174 of file cxdma353.c.

References ccam_dma_buf_ptr, CCAM_DMA_SIZE, DMA_CHUNK, EXT_DMA_0_START, MD12, port_csp0_addr, printk, and X313_WA_DMACR.

int x313_dma_stop ( void   ) 

Stop ETRAX DMA for the compressor.

Returns:
0

for testing - no reset DMA after acquisition

Definition at line 158 of file cxdma353.c.

References EXT_DMA_0_STOP, MD12, port_csp0_addr, printk, udelay, and X313_WA_DMACR.

int x313_is_dma_on ( void   ) 

tests if ETRAX DMA (for the FPGA compressor) is running

Returns:
1 - DMA is on, 0 - DMA is off

Definition at line 150 of file cxdma353.c.

int x313_setDMABuffer ( void   ) 


Variable Documentation

int dma_on = 0 [static]

Definition at line 141 of file cxdma353.c.


Generated on Fri Nov 28 00:07:42 2008 for elphel by  doxygen 1.5.1