static int inline
readreg_io(struct net_device *dev, int portno)
{
- writew(swab16(portno), dev->base_addr + ADD_PORT);
- return swab16(readw(dev->base_addr + DATA_PORT));
+ nubus_writew(swab16(portno), dev->base_addr + ADD_PORT);
+ return swab16(nubus_readw(dev->base_addr + DATA_PORT));
}
static void inline
writereg_io(struct net_device *dev, int portno, int value)
{
- writew(swab16(portno), dev->base_addr + ADD_PORT);
- writew(swab16(value), dev->base_addr + DATA_PORT);
+ nubus_writew(swab16(portno), dev->base_addr + ADD_PORT);
+ nubus_writew(swab16(value), dev->base_addr + DATA_PORT);
}
/* These are for reading/writing registers in shared memory */
static int inline
readreg(struct net_device *dev, int portno)
{
- return swab16(readw(dev->mem_start + portno));
+ return swab16(nubus_readw(dev->mem_start + portno));
}
static void inline
writereg(struct net_device *dev, int portno, int value)
{
- writew(swab16(value), dev->mem_start + portno);
+ nubus_writew(swab16(value), dev->mem_start + portno);
}
/* Probe for the CS8900 card in slot E. We won't bother looking
return -ENODEV;
}
- writew(0, ioaddr + ADD_PORT);
- sig = readw(ioaddr + DATA_PORT);
+ nubus_writew(0, ioaddr + ADD_PORT);
+ sig = nubus_readw(ioaddr + DATA_PORT);
if (sig != swab16(CHIP_EISA_ID_SIG))
return -ENODEV;
course, if you're on a slow machine, and packets are arriving
faster than you can read them off, you're screwed. Hasta la
vista, baby! */
- while ((status = swab16(readw(dev->base_addr + ISQ_PORT)))) {
+ while ((status = swab16(nubus_readw(dev->base_addr + ISQ_PORT)))) {
if (net_debug > 4)printk("%s: event=%04x\n", dev->name, status);
switch(status & ISQ_EVENT_MASK) {
case ISQ_RECEIVER_EVENT:
#endif
#ifdef MODULE
- writew(0, dev_cs89x0.base_addr + ADD_PORT);
+ nubus_writew(0, dev_cs89x0.base_addr + ADD_PORT);
#endif
#ifdef MODULE
#define PIXEL_TO_MM(a) (((a)*10)/28) /* width in mm at 72 dpi */
-static char* video_base;
+static unsigned long video_base;
static int video_size;
static char* video_vbase; /* mapped */
cli();
/* tell clut which address to fill */
- writeb(regno, &valkyrie_cmap_regs->addr);
+ nubus_writeb(regno, &valkyrie_cmap_regs->addr);
nop();
/* send one color channel at a time */
- writeb(red, &valkyrie_cmap_regs->lut);
+ nubus_writeb(red, &valkyrie_cmap_regs->lut);
nop();
- writeb(green, &valkyrie_cmap_regs->lut);
+ nubus_writeb(green, &valkyrie_cmap_regs->lut);
nop();
- writeb(blue, &valkyrie_cmap_regs->lut);
+ nubus_writeb(blue, &valkyrie_cmap_regs->lut);
restore_flags(flags);
int i;
/* Stab in the dark trying to reset the CLUT pointer */
- writel(0, &dafb_cmap_regs->reset);
+ nubus_writel(0, &dafb_cmap_regs->reset);
nop();
/* Loop until we get to the register we want */
for (i = 0; i < regno; i++) {
- writeb(palette[i].red >> 8, &dafb_cmap_regs->lut);
+ nubus_writeb(palette[i].red >> 8, &dafb_cmap_regs->lut);
nop();
- writeb(palette[i].green >> 8, &dafb_cmap_regs->lut);
+ nubus_writeb(palette[i].green >> 8, &dafb_cmap_regs->lut);
nop();
- writeb(palette[i].blue >> 8, &dafb_cmap_regs->lut);
+ nubus_writeb(palette[i].blue >> 8, &dafb_cmap_regs->lut);
nop();
}
}
- writeb(red, &dafb_cmap_regs->lut);
+ nubus_writeb(red, &dafb_cmap_regs->lut);
nop();
- writeb(green, &dafb_cmap_regs->lut);
+ nubus_writeb(green, &dafb_cmap_regs->lut);
nop();
- writeb(blue, &dafb_cmap_regs->lut);
+ nubus_writeb(blue, &dafb_cmap_regs->lut);
restore_flags(flags);
In 2bpp, the regnos are 0x3f, 0x7f, 0xbf, 0xff */
_regno = (regno<<(8-video_bpp)) | (0xFF>>video_bpp);
- writeb(_regno, &v8_brazil_cmap_regs->addr); nop();
+ nubus_writeb(_regno, &v8_brazil_cmap_regs->addr); nop();
/* send one color channel at a time */
- writeb(_red, &v8_brazil_cmap_regs->lut); nop();
- writeb(_green, &v8_brazil_cmap_regs->lut); nop();
- writeb(_blue, &v8_brazil_cmap_regs->lut);
+ nubus_writeb(_red, &v8_brazil_cmap_regs->lut); nop();
+ nubus_writeb(_green, &v8_brazil_cmap_regs->lut); nop();
+ nubus_writeb(_blue, &v8_brazil_cmap_regs->lut);
restore_flags(flags);
_regno = regno + (256-(1<<video_bpp));
/* reset clut? (VideoToolbox sez "not necessary") */
- writeb(0xFF, &rbv_cmap_regs->cntl); nop();
+ nubus_writeb(0xFF, &rbv_cmap_regs->cntl); nop();
/* tell clut which address to use. */
- writeb(_regno, &rbv_cmap_regs->addr); nop();
+ nubus_writeb(_regno, &rbv_cmap_regs->addr); nop();
/* send one color channel at a time. */
- writeb(_red, &rbv_cmap_regs->lut); nop();
- writeb(_green, &rbv_cmap_regs->lut); nop();
- writeb(_blue, &rbv_cmap_regs->lut);
+ nubus_writeb(_red, &rbv_cmap_regs->lut); nop();
+ nubus_writeb(_green, &rbv_cmap_regs->lut); nop();
+ nubus_writeb(_blue, &rbv_cmap_regs->lut);
restore_flags(flags);
/* done. */
cli();
/* the nop's are there to order writes. */
- writeb(_regno, &cmap_regs->addr); nop();
- writeb(_red, &cmap_regs->lut); nop();
- writeb(_green, &cmap_regs->lut); nop();
- writeb(_blue, &cmap_regs->lut);
+ nubus_writeb(_regno, &cmap_regs->addr); nop();
+ nubus_writeb(_red, &cmap_regs->lut); nop();
+ nubus_writeb(_green, &cmap_regs->lut); nop();
+ nubus_writeb(_blue, &cmap_regs->lut);
restore_flags(flags);
return 0;
save_flags(flags);
cli();
- writeb(_regno, &cmap_regs->addr); nop();
- writeb(_red, &cmap_regs->lut); nop();
- writeb(_green, &cmap_regs->lut); nop();
- writeb(_blue, &cmap_regs->lut);
+ nubus_writeb(_regno, &cmap_regs->addr); nop();
+ nubus_writeb(_red, &cmap_regs->lut); nop();
+ nubus_writeb(_green, &cmap_regs->lut); nop();
+ nubus_writeb(_blue, &cmap_regs->lut);
restore_flags(flags);
return 0;
save_flags(flags);
cli();
- writeb(regno, &cmap_regs->addr); nop();
- writeb(_red, &cmap_regs->lut); nop();
- writeb(_green, &cmap_regs->lut); nop();
- writeb(_blue, &cmap_regs->lut);
+ nubus_writeb(regno, &cmap_regs->addr); nop();
+ nubus_writeb(_red, &cmap_regs->lut); nop();
+ nubus_writeb(_green, &cmap_regs->lut); nop();
+ nubus_writeb(_blue, &cmap_regs->lut);
restore_flags(flags);
return 0;
/*
* Set the register address
*/
- writeb(regno, &civic_cmap_regs->addr); nop();
+ nubus_writeb(regno, &civic_cmap_regs->addr); nop();
/*
* Wait for VBL interrupt here;
#if 0
{
#define CIVIC_VBL_OFFSET 0x120
- volatile unsigned long *vbl = readl(civic_cmap_regs->vbl_addr + CIVIC_VBL_OFFSET);
+ volatile unsigned long *vbl = nubus_readl(civic_cmap_regs->vbl_addr + CIVIC_VBL_OFFSET);
/* do interrupt setup stuff here? */
*vbl = 0L; nop(); /* clear */
*vbl = 1L; nop(); /* set */
* Grab a status word and do some checking;
* Then finally write the clut!
*/
- clut_status = readb(&civic_cmap_regs->status2);
+ clut_status = nubus_readb(&civic_cmap_regs->status2);
if ((clut_status & 0x0008) == 0)
{
#if 0
if ((clut_status & 0x000D) != 0)
{
- writeb(0x00, &civic_cmap_regs->lut); nop();
- writeb(0x00, &civic_cmap_regs->lut); nop();
+ nubus_writeb(0x00, &civic_cmap_regs->lut); nop();
+ nubus_writeb(0x00, &civic_cmap_regs->lut); nop();
}
#endif
- writeb( red, &civic_cmap_regs->lut); nop();
- writeb(green, &civic_cmap_regs->lut); nop();
- writeb( blue, &civic_cmap_regs->lut); nop();
- writeb( 0x00, &civic_cmap_regs->lut); nop();
+ nubus_writeb( red, &civic_cmap_regs->lut); nop();
+ nubus_writeb(green, &civic_cmap_regs->lut); nop();
+ nubus_writeb( blue, &civic_cmap_regs->lut); nop();
+ nubus_writeb( 0x00, &civic_cmap_regs->lut); nop();
}
else
{
unsigned char junk;
- junk = readb(&civic_cmap_regs->lut); nop();
- junk = readb(&civic_cmap_regs->lut); nop();
- junk = readb(&civic_cmap_regs->lut); nop();
- junk = readb(&civic_cmap_regs->lut); nop();
+ junk = nubus_readb(&civic_cmap_regs->lut); nop();
+ junk = nubus_readb(&civic_cmap_regs->lut); nop();
+ junk = nubus_readb(&civic_cmap_regs->lut); nop();
+ junk = nubus_readb(&civic_cmap_regs->lut); nop();
if ((clut_status & 0x000D) != 0)
{
- writeb(0x00, &civic_cmap_regs->lut); nop();
- writeb(0x00, &civic_cmap_regs->lut); nop();
+ nubus_writeb(0x00, &civic_cmap_regs->lut); nop();
+ nubus_writeb(0x00, &civic_cmap_regs->lut); nop();
}
- writeb( red, &civic_cmap_regs->lut); nop();
- writeb(green, &civic_cmap_regs->lut); nop();
- writeb( blue, &civic_cmap_regs->lut); nop();
- writeb( junk, &civic_cmap_regs->lut); nop();
+ nubus_writeb( red, &civic_cmap_regs->lut); nop();
+ nubus_writeb(green, &civic_cmap_regs->lut); nop();
+ nubus_writeb( blue, &civic_cmap_regs->lut); nop();
+ nubus_writeb( junk, &civic_cmap_regs->lut); nop();
}
restore_flags(flags);
video_linelength = mac_bi_data.videorow;
video_size = video_linelength * video_height;
/* Note: physical address (since 2.1.127) */
- video_base = (void*) mac_bi_data.videoaddr;
+ video_base = mac_bi_data.videoaddr;
/* This is actually redundant with the initial mappings.
However, there are some non-obvious aspects to the way
those mappings are set up, so this is in fact the safest
Mac */
video_vbase = ioremap(mac_bi_data.videoaddr, video_size);
- printk("macfb: framebuffer at 0x%p, mapped to 0x%p, size %dk\n",
+ printk("macfb: framebuffer at 0x%08lx, mapped to 0x%p, size %dk\n",
video_base, video_vbase, video_size/1024);
printk("macfb: mode is %dx%dx%d, linelength=%d\n",
video_width, video_height, video_bpp, video_linelength);