#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 cxdma.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 CCAM_DESCR_DATA_NUM (( CCAM_DMA_SIZE / DMA_CHUNK) +1 ) |
#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 cxdma.c.
Referenced by x313_dma_start(), and x313_setDMABuffer().
#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 cxdma.c.
Referenced by x313_dma_start().
#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 cxdma.c.
Referenced by x313_dma_stop(), and x313_setDMABuffer().
#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/>. ! -----------------------------------------------------------------------------** !
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 cxdma.c.
Referenced by framepars_lseek(), and image_acq_init().
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 cxdma.c.
Referenced by framepars_lseek(), and pgm_compctl().
int x313_dma_stop | ( | void | ) |
Stop ETRAX DMA for the compressor.
for testing - no reset DMA after acquisition
Definition at line 158 of file cxdma.c.
Referenced by framepars_lseek().
int x313_is_dma_on | ( | void | ) |
tests if ETRAX DMA (for the FPGA compressor) is running
Definition at line 150 of file cxdma.c.
Referenced by pgm_compctl().
int x313_setDMABuffer | ( | void | ) |
Definition at line 271 of file cxdma.c.
References buf, ccam_dma_buf_ptr, CCAM_DMA_SIZE, DMA_CHUNK, EXT_DMA_0_STOP, G_CIRCBUFSIZE, MD8, printk, and set_globalParam().
Referenced by x313_dma_init().