本文整理汇总了C++中sbus_readl函数的典型用法代码示例。如果您正苦于以下问题:C++ sbus_readl函数的具体用法?C++ sbus_readl怎么用?C++ sbus_readl使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sbus_readl函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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));
}
}
示例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();
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}
示例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));
}
}
示例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
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}