本文整理汇总了C++中dma_rdreg函数的典型用法代码示例。如果您正苦于以下问题:C++ dma_rdreg函数的具体用法?C++ dma_rdreg怎么用?C++ dma_rdreg使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dma_rdreg函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: s3c2410_dma_dostop
static int s3c2410_dma_dostop(struct s3c2410_dma_chan *chan)
{
unsigned long flags;
unsigned long tmp;
pr_debug("%s:\n", __func__);
dbg_showchan(chan);
local_irq_save(flags);
s3c2410_dma_call_op(chan, S3C2410_DMAOP_STOP);
tmp = dma_rdreg(chan, S3C2410_DMA_DMASKTRIG);
tmp |= S3C2410_DMASKTRIG_STOP;
//tmp &= ~S3C2410_DMASKTRIG_ON;
dma_wrreg(chan, S3C2410_DMA_DMASKTRIG, tmp);
#if 0
/* should also clear interrupts, according to WinCE BSP */
tmp = dma_rdreg(chan, S3C2410_DMA_DCON);
tmp |= S3C2410_DCON_NORELOAD;
dma_wrreg(chan, S3C2410_DMA_DCON, tmp);
#endif
/* should stop do this, or should we wait for flush? */
chan->state = S3C2410_DMA_IDLE;
chan->load_state = S3C2410_DMALOAD_NONE;
local_irq_restore(flags);
return 0;
}
开发者ID:Lord-Devices,项目名称:cm_kernel_samsung_hlte,代码行数:33,代码来源:dma.c
示例2: s3c_dma_dump
void s3c_dma_dump(int dcon_num, int channel)
{
unsigned long tmp;
s3c_dma_controller_t *dma_controller = &s3c_dma_cntlrs[dcon_num];
tmp = dma_rdreg(dma_controller, S3C_DMAC_INT_STATUS);
printk("%d dcon_num %d subchnnel INT_STATUS %lx\n", dcon_num, channel, tmp);
tmp = dma_rdreg(dma_controller, S3C_DMAC_INT_TCSTATUS);
printk("%d dcon_num %d subchnnel INT_TCSTATUS %lx\n", dcon_num, channel, tmp);
tmp = dma_rdreg(dma_controller, S3C_DMAC_ENBLD_CHANNELS);
printk("%d dcon_num %d subchnnel ENBLD_CHANNELS %lx\n", dcon_num, channel, tmp);
tmp = dma_rdreg(dma_controller, S3C_DMAC_CONFIGURATION);
printk("%d dcon_num %d subchnnel DMAC_CONFIGUARATION %lx\n", dcon_num, channel, tmp);
tmp = dma_rdreg(dma_controller, S3C_DMAC_CSRCADDR(channel));
printk("%d dcon_num %d subchnnel SRCADDRESS %lx\n", dcon_num, channel, tmp);
tmp = dma_rdreg(dma_controller, S3C_DMAC_CDESTADDR(channel));
printk("%d dcon_num %d subchnnel DESTADDRESS %lx\n", dcon_num, channel, tmp);
tmp = dma_rdreg(dma_controller, S3C_DMAC_CLLI(channel));
printk("%d dcon_num %d subchnnel LLI %lx\n", dcon_num, channel, tmp);
tmp = dma_rdreg(dma_controller, S3C_DMAC_CCONTROL0(channel));
printk("%d dcon_num %d subchnnel CCONTROL0 %lx\n", dcon_num, channel, tmp);
tmp = dma_rdreg(dma_controller, S3C_DMAC_CCONTROL1(channel));
printk("%d dcon_num %d subchnnel CCONTROL1 %lx\n", dcon_num, channel, tmp);
tmp = dma_rdreg(dma_controller, S3C_DMAC_CCONFIGURATION(channel));
printk("%d dcon_num %d subchnnel CH CONFIGUARATION %lx\n", dcon_num, channel, tmp);
}
开发者ID:alsdpf,项目名称:o2droid,代码行数:34,代码来源:dma-pl080.c
示例3: dmadbg_capture
static void
dmadbg_capture(struct s3c2410_dma_chan *chan, struct s3c2410_dma_regstate *regs)
{
regs->dcsrc = dma_rdreg(chan, S3C2410_DMA_DCSRC);
regs->disrc = dma_rdreg(chan, S3C2410_DMA_DISRC);
regs->dstat = dma_rdreg(chan, S3C2410_DMA_DSTAT);
regs->dcon = dma_rdreg(chan, S3C2410_DMA_DCON);
regs->dmsktrig = dma_rdreg(chan, S3C2410_DMA_DMASKTRIG);
}
开发者ID:antonywcl,项目名称:AR-5315u_PLD,代码行数:9,代码来源:dma.c
示例4: s3c_clear_interrupts
void s3c_clear_interrupts (int dcon_num, int channel)
{
unsigned long tmp;
s3c_dma_controller_t *dma_controller = &s3c_dma_cntlrs[dcon_num];
tmp = dma_rdreg(dma_controller, S3C_DMAC_INT_TCCLEAR);
tmp |= (1 << channel);
dma_wrreg(dma_controller, S3C_DMAC_INT_TCCLEAR, tmp);
tmp = dma_rdreg(dma_controller, S3C_DMAC_INT_ERRORCLEAR);
tmp |= (1 << channel);
dma_wrreg(dma_controller, S3C_DMAC_INT_ERRORCLEAR, tmp);
}
开发者ID:Asrake,项目名称:m8_android_kernel,代码行数:13,代码来源:dma-pl080.c
示例5: s3c2410_dma_getposition
int s3c2410_dma_getposition(dmach_t channel, dma_addr_t *src, dma_addr_t *dst)
{
s3c2410_dma_chan_t *chan = &s3c2410_chans[channel];
check_channel(channel);
if (src != NULL)
*src = dma_rdreg(chan, S3C2410_DMA_DCSRC);
if (dst != NULL)
*dst = dma_rdreg(chan, S3C2410_DMA_DCDST);
return 0;
}
开发者ID:Dronevery,项目名称:JetsonTK1-kernel,代码行数:14,代码来源:dma.c
示例6: s3c2410_dma_getposition
/*
* s3c2410_dma_getposition
* returns the current transfer points for the dma source and destination
*/
int s3c2410_dma_getposition(dmach_t channel, dma_addr_t *src, dma_addr_t *dst)
{
struct s3c2410_dma_chan *chan = lookup_dma_channel(channel);
if (chan == NULL)
return -EINVAL;
if (src != NULL)
*src = dma_rdreg(chan->dma_con, S3C_DMAC_SA(chan->number));
if (dst != NULL)
*dst = dma_rdreg(chan->dma_con, S3C_DMAC_DA(chan->number));
return 0;
}
开发者ID:illyah,项目名称:samsung_kernel_volans,代码行数:19,代码来源:dma-pl330.c
示例7: s3c2410_dma_getposition
/*
* s3c_dma_getposition
* returns the current transfer points for the dma source and destination
*/
int s3c2410_dma_getposition(dmach_t channel, dma_addr_t *src, dma_addr_t *dst)
{
struct s3c2410_dma_chan *chan = lookup_dma_channel(channel);
if (chan == NULL)
return -EINVAL;
if (src != NULL)
*src = dma_rdreg(chan, S3C_DMAC_CxSRCADDR);
if (dst != NULL)
*dst = dma_rdreg(chan, S3C_DMAC_CxDESTADDR);
return 0;
}
开发者ID:Asrake,项目名称:m8_android_kernel,代码行数:19,代码来源:dma-pl080.c
示例8: s3c2410_dma_getposition
int s3c2410_dma_getposition(unsigned int channel, dma_addr_t *src, dma_addr_t *dst)
{
struct s3c2410_dma_chan *chan = lookup_dma_channel(channel);
if (chan == NULL)
return -EINVAL;
if (src != NULL)
*src = dma_rdreg(chan, S3C2410_DMA_DCSRC);
if (dst != NULL)
*dst = dma_rdreg(chan, S3C2410_DMA_DCDST);
return 0;
}
开发者ID:antonywcl,项目名称:AR-5315u_PLD,代码行数:15,代码来源:dma.c
示例9: s3c_dma_flush_fifo
/*actively polling for the A bit can block the cpu*/
void s3c_dma_flush_fifo(struct s3c2410_dma_chan *chan)
{
unsigned long tmp;
tmp = dma_rdreg(chan, S3C_DMAC_CxCONFIGURATION);
tmp |= S3C_DMACONFIG_HALT;
dma_wrreg(chan, S3C_DMAC_CxCONFIGURATION, tmp);
tmp = dma_rdreg(chan, S3C_DMAC_CxCONFIGURATION);
/*this while loop can be very dangerous..may be put the process to sleep rather than waiting till fifo is drained */
while (tmp & S3C_DMACONFIG_ACTIVE) {
tmp = dma_rdreg(chan, S3C_DMAC_CxCONFIGURATION);
}
}
开发者ID:Asrake,项目名称:m8_android_kernel,代码行数:16,代码来源:dma-pl080.c
示例10: s3c_dma_dostop
static int s3c_dma_dostop(struct s3c2410_dma_chan *chan)
{
unsigned long tmp;
unsigned long flags;
pr_debug("%s: DMA Channel No : %d\n", __FUNCTION__, chan->number);
dbg_showchan(chan);
local_irq_save(flags);
s3c_dma_flush_fifo(chan);
s3c_dma_call_op(chan, S3C2410_DMAOP_STOP);
tmp = dma_rdreg(chan, S3C_DMAC_CxCONFIGURATION);
tmp &= ~S3C_DMACONFIG_CHANNEL_ENABLE;
dma_wrreg(chan, S3C_DMAC_CxCONFIGURATION, tmp);
pr_debug("%s: S3C_DMAC_CxCONFIGURATION : %08x\n", __FUNCTION__, tmp);
chan->state = S3C_DMA_IDLE;
chan->load_state = S3C_DMALOAD_NONE;
local_irq_restore(flags);
return 0;
}
开发者ID:Asrake,项目名称:m8_android_kernel,代码行数:29,代码来源:dma-pl080.c
示例11: s3c_dma_dostop
static int s3c_dma_dostop(struct s3c2410_dma_chan *chan)
{
unsigned long tmp;
unsigned long flags;
pr_debug("%s: DMA Channel No : %d\n", __FUNCTION__, chan->number);
dbg_showchan(chan);
local_irq_save(flags);
//Commenting out this function call(as its causing freeze) and even without this it adheres to
//ARM Primecell 080's disabling a DMA channel and losing data in the FIFO method
//s3c_dma_flush_fifo(chan);
s3c_dma_call_op(chan, S3C2410_DMAOP_STOP);
tmp = dma_rdreg(chan, S3C_DMAC_CxCONFIGURATION);
tmp &= ~S3C_DMACONFIG_CHANNEL_ENABLE;
dma_wrreg(chan, S3C_DMAC_CxCONFIGURATION, tmp);
pr_debug("%s: S3C_DMAC_CxCONFIGURATION : %08x\n", __FUNCTION__, tmp);
chan->state = S3C_DMA_IDLE;
chan->load_state = S3C_DMALOAD_NONE;
local_irq_restore(flags);
return 0;
}
开发者ID:antibyte,项目名称:Samdroid-Turbo-Kernel,代码行数:31,代码来源:dma-pl080.c
示例12: s3c_disable_dmac
void s3c_disable_dmac(unsigned int dcon_num)
{
unsigned long tmp;
s3c_dma_controller_t *dma_controller = &s3c_dma_cntlrs[dcon_num];
tmp = dma_rdreg(dma_controller, S3C_DMAC_CONFIGURATION);
tmp &= ~S3C_DMA_CONTROLLER_ENABLE;
dma_wrreg(dma_controller, S3C_DMAC_CONFIGURATION, tmp);
}
开发者ID:Asrake,项目名称:m8_android_kernel,代码行数:8,代码来源:dma-pl080.c
示例13: dma_test
void dma_test (int dcon_num, int channel)
{
int tmp;
s3c_dma_controller_t *dma_controller = &s3c_dma_cntlrs[dcon_num];
dma_wrreg(dma_controller, S3C_DMAC_CONFIGURATION, S3C_DMA_CONTROLLER_ENABLE);
tmp = dma_rdreg(dma_controller, S3C_DMAC_CONFIGURATION);
printk("reg val %d\n", tmp);
dma_wrreg(dma_controller, S3C_DMAC_CCONFIGURATION(channel), 0x01);
tmp = dma_rdreg(dma_controller, S3C_DMAC_CCONFIGURATION(channel));
printk("reg conf %x\n", tmp);
dma_wrreg(dma_controller, S3C_DMAC_CCONTROL0(channel), 0x8ff02064);
tmp = dma_rdreg(dma_controller, S3C_DMAC_CCONTROL0(channel));
printk("reg ctrl %x\n", tmp);
}
开发者ID:Asrake,项目名称:m8_android_kernel,代码行数:18,代码来源:dma-pl080.c
示例14: s3c2410_dma_flush
static int s3c2410_dma_flush(struct s3c2410_dma_chan *chan)
{
struct s3c2410_dma_buf *buf, *next;
unsigned long flags;
pr_debug("%s: chan %p (%d)\n", __func__, chan, chan->number);
dbg_showchan(chan);
local_irq_save(flags);
if (chan->state != S3C2410_DMA_IDLE) {
pr_debug("%s: stopping channel...\n", __func__ );
s3c2410_dma_ctrl(chan->number, S3C2410_DMAOP_STOP);
}
buf = chan->curr;
if (buf == NULL)
buf = chan->next;
chan->curr = chan->next = chan->end = NULL;
if (buf != NULL) {
for ( ; buf != NULL; buf = next) {
next = buf->next;
pr_debug("%s: free buffer %p, next %p\n",
__func__, buf, buf->next);
s3c2410_dma_buffdone(chan, buf, S3C2410_RES_ABORT);
s3c2410_dma_freebuf(buf);
}
}
dbg_showregs(chan);
s3c2410_dma_waitforstop(chan);
#if 0
/* should also clear interrupts, according to WinCE BSP */
{
unsigned long tmp;
tmp = dma_rdreg(chan, S3C2410_DMA_DCON);
tmp |= S3C2410_DCON_NORELOAD;
dma_wrreg(chan, S3C2410_DMA_DCON, tmp);
}
#endif
dbg_showregs(chan);
local_irq_restore(flags);
return 0;
}
开发者ID:antonywcl,项目名称:AR-5315u_PLD,代码行数:55,代码来源:dma.c
示例15: s3c2410_dma_waitforstop
static void s3c2410_dma_waitforstop(struct s3c2410_dma_chan *chan)
{
unsigned long tmp;
unsigned int timeout = 0x10000;
while (timeout-- > 0) {
tmp = dma_rdreg(chan, S3C2410_DMA_DMASKTRIG);
if (!(tmp & S3C2410_DMASKTRIG_ON))
return;
}
pr_debug("dma%d: failed to stop?\n", chan->number);
}
开发者ID:antonywcl,项目名称:AR-5315u_PLD,代码行数:14,代码来源:dma.c
示例16: s3c2410_dma_suspend_chan
static void s3c2410_dma_suspend_chan(struct s3c2410_dma_chan *cp)
{
printk(KERN_DEBUG "suspending dma channel %d\n", cp->number);
if (dma_rdreg(cp, S3C2410_DMA_DMASKTRIG) & S3C2410_DMASKTRIG_ON) {
/* the dma channel is still working, which is probably
* a bad thing to do over suspend/resume. We stop the
* channel and assume that the client is either going to
* retry after resume, or that it is broken.
*/
printk(KERN_INFO "dma: stopping channel %d due to suspend\n",
cp->number);
s3c2410_dma_dostop(cp);
}
}
开发者ID:1111saeid,项目名称:jb_kernel_3.0.16_htc_golfu,代码行数:17,代码来源:dma.c
示例17: s3c_dma_waitforload
/* s3c_dma_waitforload
*
* wait for the DMA engine to load a buffer, and update the state accordingly
*/
static int s3c_dma_waitforload(struct s3c2410_dma_chan *chan, int line)
{
int timeout = chan->load_timeout;
int took;
pr_debug("%s channel number : %d\n", __FUNCTION__, chan->number);
if (chan->load_state != S3C_DMALOAD_1LOADED) {
printk(KERN_ERR
"dma%d: s3c_dma_waitforload() called in loadstate %d from line %d\n",
chan->number, chan->load_state, line);
return 0;
}
if (chan->stats != NULL)
chan->stats->loads++;
while (--timeout > 0) {
if ((dma_rdreg(chan->dma_con, S3C_DMAC_ENBLD_CHANNELS)) & (0x1 << chan->number)) {
took = chan->load_timeout - timeout;
s3c_dma_stats_timeout(chan->stats, took);
switch (chan->load_state) {
case S3C_DMALOAD_1LOADED:
chan->load_state = S3C_DMALOAD_1RUNNING;
break;
default:
printk(KERN_ERR
"dma%d: unknown load_state in s3c_dma_waitforload() %d\n",
chan->number, chan->load_state);
}
return 1;
}
}
if (chan->stats != NULL) {
chan->stats->timeout_failed++;
}
return 0;
}
开发者ID:Asrake,项目名称:m8_android_kernel,代码行数:47,代码来源:dma-pl080.c
示例18: s3c2410_dma_suspend
static int s3c2410_dma_suspend(struct sys_device *dev, pm_message_t state)
{
s3c2410_dma_chan_t *cp = container_of(dev, s3c2410_dma_chan_t, dev);
printk(KERN_DEBUG "suspending dma channel %d\n", cp->number);
if (dma_rdreg(cp, S3C2410_DMA_DMASKTRIG) & S3C2410_DMASKTRIG_ON) {
/* the dma channel is still working, which is probably
* a bad thing to do over suspend/resume. We stop the
* channel and assume that the client is either going to
* retry after resume, or that it is broken.
*/
printk(KERN_INFO "dma: stopping channel %d due to suspend\n",
cp->number);
s3c2410_dma_dostop(cp);
}
return 0;
}
开发者ID:Dronevery,项目名称:JetsonTK1-kernel,代码行数:21,代码来源:dma.c
示例19: s3c2410_dma_waitforload
static int
s3c2410_dma_waitforload(struct s3c2410_dma_chan *chan, int line)
{
int timeout = chan->load_timeout;
int took;
if (chan->load_state != S3C2410_DMALOAD_1LOADED) {
printk(KERN_ERR "dma%d: s3c2410_dma_waitforload() called in loadstate %d from line %d\n", chan->number, chan->load_state, line);
return 0;
}
if (chan->stats != NULL)
chan->stats->loads++;
while (--timeout > 0) {
if ((dma_rdreg(chan, S3C2410_DMA_DSTAT) << (32-20)) != 0) {
took = chan->load_timeout - timeout;
s3c2410_dma_stats_timeout(chan->stats, took);
switch (chan->load_state) {
case S3C2410_DMALOAD_1LOADED:
chan->load_state = S3C2410_DMALOAD_1RUNNING;
break;
default:
printk(KERN_ERR "dma%d: unknown load_state in s3c2410_dma_waitforload() %d\n", chan->number, chan->load_state);
}
return 1;
}
}
if (chan->stats != NULL) {
chan->stats->timeout_failed++;
}
return 0;
}
开发者ID:antonywcl,项目名称:AR-5315u_PLD,代码行数:39,代码来源:dma.c
示例20: s3c_dma_loadbuffer
/* s3c_dma_loadbuffer
*
* load a buffer, and update the channel state
*/
static inline int s3c_dma_loadbuffer(struct s3c2410_dma_chan *chan,
struct s3c_dma_buf *buf)
{
unsigned long tmp;
pl330_DMA_parameters_t dma_param;
struct s3c_dma_buf *firstbuf;
int bwJump = 0;
memset(&dma_param, 0, sizeof(pl330_DMA_parameters_t));
pr_debug("s3c_chan_loadbuffer: loading buffer %p (0x%08lx,0x%06x)\n",
buf, (unsigned long) buf->data, buf->size);
if (buf == NULL) {
dmawarn("buffer is NULL\n");
return -EINVAL;
}
pr_debug("%s: DMA CCR - %08x\n", __FUNCTION__, chan->dcon);
pr_debug("%s: DMA Loop count - %08x\n", __FUNCTION__, (buf->size / chan->xfer_unit));
firstbuf = buf;
do {
dma_param.mPeriNum = chan->config_flags;
dma_param.mDirection = chan->source;
switch (dma_param.mDirection) {
case S3C2410_DMASRC_MEM: /* source is Memory : Mem-to-Peri (Write into FIFO) */
dma_param.mSrcAddr = buf->data;
dma_param.mDstAddr = chan->dev_addr;
break;
case S3C2410_DMASRC_HW: /* source is peripheral : Peri-to-Mem (Read from FIFO) */
dma_param.mSrcAddr = chan->dev_addr;
dma_param.mDstAddr = buf->data;
break;
case S3C_DMA_MEM2MEM: /* source & Destination : Mem-to-Mem */
dma_param.mSrcAddr = chan->dev_addr;
dma_param.mDstAddr = buf->data;
break;
case S3C_DMA_MEM2MEM_SET: /* source & Destination : Mem-to-Mem */
dma_param.mDirection = S3C_DMA_MEM2MEM;
dma_param.mSrcAddr = chan->dev_addr;
dma_param.mDstAddr = buf->data;
break;
case S3C_DMA_PER2PER:
default:
printk("Peripheral-to-Peripheral DMA NOT YET implemented !! \n");
return -EINVAL;
}
dma_param.mTrSize = buf->size;
dma_param.mLoop = 0;
dma_param.mControl = *(pl330_DMA_control_t *) &chan->dcon;
chan->next = buf->next;
buf = chan->next;
if(buf==NULL) {
firstbuf->next = NULL;
dma_param.mLastReq = 1;
dma_param.mIrqEnable = 1;
}
else {
dma_param.mLastReq = 0;
dma_param.mIrqEnable = 0;
}
bwJump += setup_DMA_channel(((u8 *)firstbuf->mcptr_cpu)+bwJump, dma_param, chan->number);
pr_debug("%s: DMA bwJump - %d\n", __FUNCTION__, bwJump);
}while(buf != NULL);
if(dma_param.mIrqEnable) {
tmp = dma_rdreg(chan->dma_con, S3C_DMAC_INTEN);
tmp |= (1 << chan->number);
dma_wrreg(chan->dma_con, S3C_DMAC_INTEN, tmp);
}
/* update the state of the channel */
switch (chan->load_state) {
case S3C_DMALOAD_NONE:
chan->load_state = S3C_DMALOAD_1LOADED;
break;
case S3C_DMALOAD_1RUNNING:
chan->load_state = S3C_DMALOAD_1LOADED_1RUNNING;
break;
default:
dmawarn("dmaload: unknown state %d in loadbuffer\n", chan->load_state);
//.........这里部分代码省略.........
开发者ID:illyah,项目名称:samsung_kernel_volans,代码行数:101,代码来源:dma-pl330.c
注:本文中的dma_rdreg函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论