本文整理汇总了C++中sbus_readl函数的典型用法代码示例。如果您正苦于以下问题:C++ sbus_readl函数的具体用法?C++ sbus_readl怎么用?C++ sbus_readl使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sbus_readl函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: bigmac_rx_reset
static void bigmac_rx_reset(void __iomem *bregs)
{
int tries = RX_RESET_TRIES;
sbus_writel(0, bregs + BMAC_RXCFG);
while (sbus_readl(bregs + BMAC_RXCFG) && --tries)
udelay(20);
if (!tries) {
printk(KERN_ERR "BIGMAC: Receiver will not reset.\n");
printk(KERN_ERR "BIGMAC: rx_cfg is %08x\n",
sbus_readl(bregs + BMAC_RXCFG));
}
}
开发者ID:0xroot,项目名称:Blackphone-BP1-Kernel,代码行数:14,代码来源:sunbmac.c
示例2: sun4m_nmi
void sun4m_nmi(struct pt_regs *regs)
{
unsigned long afsr, afar, si;
printk(KERN_ERR "Aieee: sun4m NMI received!\n");
/* XXX HyperSparc hack XXX */
__asm__ __volatile__("mov 0x500, %%g1\n\t"
"lda [%%g1] 0x4, %0\n\t"
"mov 0x600, %%g1\n\t"
"lda [%%g1] 0x4, %1\n\t" :
"=r" (afsr), "=r" (afar));
printk(KERN_ERR "afsr=%08lx afar=%08lx\n", afsr, afar);
si = sbus_readl(&sun4m_irq_global->pending);
printk(KERN_ERR "si=%08lx\n", si);
if (si & SUN4M_INT_MODULE_ERR)
printk(KERN_ERR "Module async error\n");
if (si & SUN4M_INT_M2S_WRITE_ERR)
printk(KERN_ERR "MBus/SBus async error\n");
if (si & SUN4M_INT_ECC_ERR)
printk(KERN_ERR "ECC memory error\n");
if (si & SUN4M_INT_VME_ERR)
printk(KERN_ERR "VME async error\n");
printk(KERN_ERR "you lose buddy boy...\n");
show_regs(regs);
prom_halt();
}
开发者ID:openube,项目名称:android_kernel_sony_c2305,代码行数:26,代码来源:sun4m_irq.c
示例3: leo_clear
static void leo_clear(struct vc_data *conp, struct display *p, int sy, int sx,
int height, int width)
{
struct fb_info_sbusfb *fb = (struct fb_info_sbusfb *)p->fb_info;
register struct leo_lc_ss0_usr *us = fb->s.leo.lc_ss0_usr;
register struct leo_ld *ss = (struct leo_ld *) fb->s.leo.ld_ss0;
unsigned long flags;
int x, y, w, h;
int i;
spin_lock_irqsave(&fb->lock, flags);
do {
i = sbus_readl(&us->csr);
} while (i & 0x20000000);
sbus_writel((attr_bgcol_ec(p,conp)<<24), &ss->fg);
if (fontheightlog(p)) {
y = sy << fontheightlog(p); h = height << fontheightlog(p);
} else {
y = sy * fontheight(p); h = height * fontheight(p);
}
if (fontwidthlog(p)) {
x = sx << fontwidthlog(p); w = width << fontwidthlog(p);
} else {
x = sx * fontwidth(p); w = width * fontwidth(p);
}
sbus_writel((w - 1) | ((h - 1) << 11), &us->extent);
sbus_writel((x + fb->x_margin) | ((y + fb->y_margin) << 11) | 0x80000000,
&us->fill);
spin_unlock_irqrestore(&fb->lock, flags);
}
开发者ID:SimonKagstrom,项目名称:mci500h-linux-2.4.27,代码行数:30,代码来源:leofb.c
示例4: leo_switch_from_graph
static void leo_switch_from_graph(struct fb_info *info)
{
struct leo_par *par = (struct leo_par *) info->par;
struct leo_ld __iomem *ss = (struct leo_ld __iomem *) par->ld_ss0;
unsigned long flags;
u32 val;
spin_lock_irqsave(&par->lock, flags);
par->extent = ((info->var.xres - 1) |
((info->var.yres - 1) << 16));
sbus_writel(0xffffffff, &ss->wid);
sbus_writel(0xffff, &ss->wmask);
sbus_writel(0, &ss->vclipmin);
sbus_writel(par->extent, &ss->vclipmax);
sbus_writel(0, &ss->fg);
sbus_writel(0xff000000, &ss->planemask);
sbus_writel(0x310850, &ss->rop);
sbus_writel(0, &ss->widclip);
sbus_writel((info->var.xres-1) | ((info->var.yres-1) << 11),
&par->lc_ss0_usr->extent);
sbus_writel(4, &par->lc_ss0_usr->addrspace);
sbus_writel(0x80000000, &par->lc_ss0_usr->fill);
sbus_writel(0, &par->lc_ss0_usr->fontt);
do {
val = sbus_readl(&par->lc_ss0_usr->csr);
} while (val & 0x20000000);
spin_unlock_irqrestore(&par->lock, flags);
}
开发者ID:PennPanda,项目名称:linux-repo,代码行数:31,代码来源:leo.c
示例5: leo_loadcmap
static void leo_loadcmap (struct fb_info_sbusfb *fb, struct display *p, int index, int count)
{
struct leo_lx_krn *lx_krn = fb->s.leo.lx_krn;
unsigned long flags;
u32 tmp;
int i;
spin_lock_irqsave(&fb->lock, flags);
sbus_writel(LEO_KRN_TYPE_CLUT0, &lx_krn->krn_type);
i = leo_wait (lx_krn);
if (i)
goto out;
sbus_writel(LEO_KRN_TYPE_CLUTDATA, &lx_krn->krn_type);
for (i = 0; i < 256; i++) {
u32 val;
val = fb->color_map CM(i,0) |
(fb->color_map CM(i,1) << 8) |
(fb->color_map CM(i,2) << 16);
sbus_writel(val, &lx_krn->krn_value); /* Throw colors there :)) */
}
sbus_writel(LEO_KRN_TYPE_CLUT0, &lx_krn->krn_type);
tmp = sbus_readl(&lx_krn->krn_csr);
tmp |= (LEO_KRN_CSR_UNK|LEO_KRN_CSR_UNK2);
sbus_writel(tmp, &lx_krn->krn_csr);
out:
spin_unlock_irqrestore(&fb->lock, flags);
}
开发者ID:SimonKagstrom,项目名称:mci500h-linux-2.4.27,代码行数:29,代码来源:leofb.c
示例6: myri_do_handshake
static int myri_do_handshake(struct myri_eth *mp)
{
struct myri_shmem __iomem *shmem = mp->shmem;
void __iomem *cregs = mp->cregs;
struct myri_channel __iomem *chan = &shmem->channel;
int tick = 0;
DET(("myri_do_handshake: "));
if (sbus_readl(&chan->state) == STATE_READY) {
DET(("Already STATE_READY, failed.\n"));
return -1; /* We're hosed... */
}
myri_disable_irq(mp->lregs, cregs);
while (tick++ < 25) {
u32 softstate;
/* Wake it up. */
DET(("shakedown, CONTROL_WON, "));
sbus_writel(1, &shmem->shakedown);
sbus_writel(CONTROL_WON, cregs + MYRICTRL_CTRL);
softstate = sbus_readl(&chan->state);
DET(("chanstate[%08x] ", softstate));
if (softstate == STATE_READY) {
DET(("wakeup successful, "));
break;
}
if (softstate != STATE_WFN) {
DET(("not WFN setting that, "));
sbus_writel(STATE_WFN, &chan->state);
}
udelay(20);
}
myri_enable_irq(mp->lregs, cregs);
if (tick > 25) {
DET(("25 ticks we lose, failure.\n"));
return -1;
}
DET(("success\n"));
return 0;
}
开发者ID:nos1609,项目名称:Chrono_Kernel-1,代码行数:47,代码来源:myri_sbus.c
示例7: parport_sunbpp_disable_irq
static void parport_sunbpp_disable_irq(struct parport *p)
{
struct bpp_regs *regs = (struct bpp_regs *)p->base;
u32 tmp;
tmp = sbus_readl(®s->p_csr);
tmp &= ~DMA_INT_ENAB;
sbus_writel(tmp, ®s->p_csr);
}
开发者ID:SimonKagstrom,项目名称:mci500h-linux-2.4.27,代码行数:9,代码来源:parport_sunbpp.c
示例8: leo_wait
static int leo_wait (struct leo_lx_krn *lx_krn)
{
int i;
for (i = 0; (sbus_readl(&lx_krn->krn_csr) & LEO_KRN_CSR_PROGRESS) && i < 300000; i++)
udelay (1); /* Busy wait at most 0.3 sec */
if (i == 300000)
return -EFAULT; /* Timed out - should we print some message? */
return 0;
}
开发者ID:SimonKagstrom,项目名称:mci500h-linux-2.4.27,代码行数:10,代码来源:leofb.c
示例9: bigmac_tx_reset
static void bigmac_tx_reset(void __iomem *bregs)
{
int tries = TX_RESET_TRIES;
sbus_writel(0, bregs + BMAC_TXCFG);
/* The fifo threshold bit is read-only and does
* not clear. -DaveM
*/
while ((sbus_readl(bregs + BMAC_TXCFG) & ~(BIGMAC_TXCFG_FIFO)) != 0 &&
--tries != 0)
udelay(20);
if (!tries) {
printk(KERN_ERR "BIGMAC: Transmitter will not reset.\n");
printk(KERN_ERR "BIGMAC: tx_cfg is %08x\n",
sbus_readl(bregs + BMAC_TXCFG));
}
}
开发者ID:119-org,项目名称:hi3518-osdrv,代码行数:19,代码来源:sunbmac.c
示例10: init_one_dvma
void __init init_one_dvma(struct sbus_dma *dma, int num_dma)
{
printk("dma%d: ", num_dma);
dma->next = 0;
dma->running = 0; /* No transfers going on as of yet */
dma->allocated = 0; /* No one has allocated us yet */
switch(sbus_readl(dma->regs + DMA_CSR)&DMA_DEVICE_ID) {
case DMA_VERS0:
dma->revision = dvmarev0;
printk("Revision 0 ");
break;
case DMA_ESCV1:
dma->revision = dvmaesc1;
printk("ESC Revision 1 ");
break;
case DMA_VERS1:
dma->revision = dvmarev1;
printk("Revision 1 ");
break;
case DMA_VERS2:
dma->revision = dvmarev2;
printk("Revision 2 ");
break;
case DMA_VERHME:
dma->revision = dvmahme;
printk("HME DVMA gate array ");
break;
case DMA_VERSPLUS:
dma->revision = dvmarevplus;
printk("Revision 1 PLUS ");
break;
default:
printk("unknown dma version %08x",
sbus_readl(dma->regs + DMA_CSR) & DMA_DEVICE_ID);
dma->allocated = 1;
break;
}
printk("\n");
#if 0 /* Clutters up the screen */
dump_dma_regs(dma->regs);
#endif
}
开发者ID:archith,项目名称:camera_project,代码行数:43,代码来源:dvma.c
示例11: leo_wait
static void leo_wait(struct leo_lx_krn __iomem *lx_krn)
{
int i;
for (i = 0;
(sbus_readl(&lx_krn->krn_csr) & LEO_KRN_CSR_PROGRESS) && i < 300000;
i++)
udelay (1); /* Busy wait at most 0.3 sec */
return;
}
开发者ID:PennPanda,项目名称:linux-repo,代码行数:10,代码来源:leo.c
示例12: qec_interrupt
/* Interrupts for all QE's get filtered out via the QEC master controller,
* so we just run through each qe and check to see who is signaling
* and thus needs to be serviced.
*/
static irqreturn_t qec_interrupt(int irq, void *dev_id)
{
struct sunqec *qecp = dev_id;
u32 qec_status;
int channel = 0;
/* Latch the status now. */
qec_status = sbus_readl(qecp->gregs + GLOB_STAT);
while (channel < 4) {
if (qec_status & 0xf) {
struct sunqe *qep = qecp->qes[channel];
u32 qe_status;
qe_status = sbus_readl(qep->qcregs + CREG_STAT);
if (qe_status & CREG_STAT_ERRORS) {
if (qe_is_bolixed(qep, qe_status))
goto next;
}
if (qe_status & CREG_STAT_RXIRQ)
qe_rx(qep);
if (netif_queue_stopped(qep->dev) &&
(qe_status & CREG_STAT_TXIRQ)) {
spin_lock(&qep->lock);
qe_tx_reclaim(qep);
if (TX_BUFFS_AVAIL(qep) > 0) {
/* Wake net queue and return to
* lazy tx reclaim.
*/
netif_wake_queue(qep->dev);
sbus_writel(1, qep->qcregs + CREG_TIMASK);
}
spin_unlock(&qep->lock);
}
next:
;
}
qec_status >>= 4;
channel++;
}
return IRQ_HANDLED;
}
开发者ID:Lyude,项目名称:linux,代码行数:46,代码来源:sunqe.c
示例13: leo_init_hw
static void leo_init_hw(struct fb_info *info)
{
struct leo_par *par = (struct leo_par *) info->par;
u32 val;
val = sbus_readl(&par->ld_ss1->ss1_misc);
val |= LEO_SS1_MISC_ENABLE;
sbus_writel(val, &par->ld_ss1->ss1_misc);
leo_switch_from_graph(info);
}
开发者ID:PennPanda,项目名称:linux-repo,代码行数:11,代码来源:leo.c
示例14: vfc_i2c_wait_for_bus
int vfc_i2c_wait_for_bus(struct vfc_dev *dev)
{
int timeout = 1000;
while(!(sbus_readl(&dev->regs->i2c_s1) & BB)) {
if(!(timeout--))
return -ETIMEDOUT;
vfc_i2c_delay(dev);
}
return 0;
}
开发者ID:kzlin129,项目名称:tt-gpl,代码行数:11,代码来源:vfc_i2c.c
示例15: leo_restore_palette
static void leo_restore_palette (struct fb_info_sbusfb *fb)
{
u32 tmp;
unsigned long flags;
spin_lock_irqsave(&fb->lock, flags);
tmp = sbus_readl(&fb->s.leo.ld_ss1->ss1_misc);
tmp &= ~(LEO_SS1_MISC_ENABLE);
sbus_writel(tmp, &fb->s.leo.ld_ss1->ss1_misc);
spin_unlock_irqrestore(&fb->lock, flags);
}
开发者ID:SimonKagstrom,项目名称:mci500h-linux-2.4.27,代码行数:11,代码来源:leofb.c
示例16: leo_switch_from_graph
static void leo_switch_from_graph(struct fb_info *info)
{
struct leo_par *par = (struct leo_par *) info->par;
struct leo_ld_ss0 __iomem *ss = par->ld_ss0;
struct leo_cursor __iomem *cursor = par->cursor;
unsigned long flags;
u32 val;
spin_lock_irqsave(&par->lock, flags);
par->extent = ((info->var.xres - 1) |
((info->var.yres - 1) << 16));
sbus_writel(0xffffffff, &ss->wid);
sbus_writel(0xffff, &ss->wmask);
sbus_writel(0, &ss->vclipmin);
sbus_writel(par->extent, &ss->vclipmax);
sbus_writel(0, &ss->fg);
sbus_writel(0xff000000, &ss->planemask);
sbus_writel(0x310850, &ss->rop);
sbus_writel(0, &ss->widclip);
sbus_writel((info->var.xres-1) | ((info->var.yres-1) << 11),
&par->lc_ss0_usr->extent);
sbus_writel(4, &par->lc_ss0_usr->addrspace);
sbus_writel(0x80000000, &par->lc_ss0_usr->fill);
sbus_writel(0, &par->lc_ss0_usr->fontt);
do {
val = sbus_readl(&par->lc_ss0_usr->csr);
} while (val & 0x20000000);
/* setup screen buffer for cfb_* functions */
sbus_writel(1, &ss->wid);
sbus_writel(0x00ffffff, &ss->planemask);
sbus_writel(0x310b90, &ss->rop);
sbus_writel(0, &par->lc_ss0_usr->addrspace);
/* hide cursor */
sbus_writel(sbus_readl(&cursor->cur_misc) & ~LEO_CUR_ENABLE, &cursor->cur_misc);
spin_unlock_irqrestore(&par->lock, flags);
}
开发者ID:CSCLOG,项目名称:beaglebone,代码行数:41,代码来源:leo.c
示例17: leo_blank
static void leo_blank (struct fb_info_sbusfb *fb)
{
unsigned long flags;
u32 tmp;
spin_lock_irqsave(&fb->lock, flags);
sbus_writel(LEO_KRN_TYPE_VIDEO, &fb->s.leo.lx_krn->krn_type);
tmp = sbus_readl(&fb->s.leo.lx_krn->krn_csr);
tmp &= ~LEO_KRN_CSR_ENABLE;
sbus_writel(tmp, &fb->s.leo.lx_krn->krn_csr);
spin_unlock_irqrestore(&fb->lock, flags);
}
开发者ID:SimonKagstrom,项目名称:mci500h-linux-2.4.27,代码行数:13,代码来源:leofb.c
示例18: myri_interrupt
static irqreturn_t myri_interrupt(int irq, void *dev_id)
{
struct net_device *dev = (struct net_device *) dev_id;
struct myri_eth *mp = netdev_priv(dev);
void __iomem *lregs = mp->lregs;
struct myri_channel __iomem *chan = &mp->shmem->channel;
unsigned long flags;
u32 status;
int handled = 0;
spin_lock_irqsave(&mp->irq_lock, flags);
status = sbus_readl(lregs + LANAI_ISTAT);
DIRQ(("myri_interrupt: status[%08x] ", status));
if (status & ISTAT_HOST) {
u32 softstate;
handled = 1;
DIRQ(("IRQ_DISAB "));
myri_disable_irq(lregs, mp->cregs);
softstate = sbus_readl(&chan->state);
DIRQ(("state[%08x] ", softstate));
if (softstate != STATE_READY) {
DIRQ(("myri_not_so_happy "));
myri_is_not_so_happy(mp);
}
DIRQ(("\nmyri_rx: "));
myri_rx(mp, dev);
DIRQ(("\nistat=ISTAT_HOST "));
sbus_writel(ISTAT_HOST, lregs + LANAI_ISTAT);
DIRQ(("IRQ_ENAB "));
myri_enable_irq(lregs, mp->cregs);
}
DIRQ(("\n"));
spin_unlock_irqrestore(&mp->irq_lock, flags);
return IRQ_RETVAL(handled);
}
开发者ID:nos1609,项目名称:Chrono_Kernel-1,代码行数:39,代码来源:myri_sbus.c
示例19: write_tcvr_bit
static void write_tcvr_bit(struct bigmac *bp, void __iomem *tregs, int bit)
{
if (bp->tcvr_type == internal) {
bit = (bit & 1) << 3;
sbus_writel(bit | (MGMT_PAL_OENAB | MGMT_PAL_EXT_MDIO),
tregs + TCVR_MPAL);
sbus_readl(tregs + TCVR_MPAL);
sbus_writel(bit | MGMT_PAL_OENAB | MGMT_PAL_EXT_MDIO | MGMT_PAL_DCLOCK,
tregs + TCVR_MPAL);
sbus_readl(tregs + TCVR_MPAL);
} else if (bp->tcvr_type == external) {
bit = (bit & 1) << 2;
sbus_writel(bit | MGMT_PAL_INT_MDIO | MGMT_PAL_OENAB,
tregs + TCVR_MPAL);
sbus_readl(tregs + TCVR_MPAL);
sbus_writel(bit | MGMT_PAL_INT_MDIO | MGMT_PAL_OENAB | MGMT_PAL_DCLOCK,
tregs + TCVR_MPAL);
sbus_readl(tregs + TCVR_MPAL);
} else {
printk(KERN_ERR "write_tcvr_bit: No transceiver type known!\n");
}
}
开发者ID:119-org,项目名称:hi3518-osdrv,代码行数:22,代码来源:sunbmac.c
示例20: myri_clean_rings
static void myri_clean_rings(struct myri_eth *mp)
{
struct sendq __iomem *sq = mp->sq;
struct recvq __iomem *rq = mp->rq;
int i;
sbus_writel(0, &rq->tail);
sbus_writel(0, &rq->head);
for (i = 0; i < (RX_RING_SIZE+1); i++) {
if (mp->rx_skbs[i] != NULL) {
struct myri_rxd __iomem *rxd = &rq->myri_rxd[i];
u32 dma_addr;
dma_addr = sbus_readl(&rxd->myri_scatters[0].addr);
dma_unmap_single(&mp->myri_op->dev, dma_addr,
RX_ALLOC_SIZE, DMA_FROM_DEVICE);
dev_kfree_skb(mp->rx_skbs[i]);
mp->rx_skbs[i] = NULL;
}
}
mp->tx_old = 0;
sbus_writel(0, &sq->tail);
sbus_writel(0, &sq->head);
for (i = 0; i < TX_RING_SIZE; i++) {
if (mp->tx_skbs[i] != NULL) {
struct sk_buff *skb = mp->tx_skbs[i];
struct myri_txd __iomem *txd = &sq->myri_txd[i];
u32 dma_addr;
dma_addr = sbus_readl(&txd->myri_gathers[0].addr);
dma_unmap_single(&mp->myri_op->dev, dma_addr,
(skb->len + 3) & ~3,
DMA_TO_DEVICE);
dev_kfree_skb(mp->tx_skbs[i]);
mp->tx_skbs[i] = NULL;
}
}
}
开发者ID:nos1609,项目名称:Chrono_Kernel-1,代码行数:39,代码来源:myri_sbus.c
注:本文中的sbus_readl函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论