Commit 0fec01ba authored by James Simmons's avatar James Simmons

Synced up to m68k changes

parent 89863ff4
......@@ -146,9 +146,8 @@ static inline u32 aty_ld_le32(int regindex, const struct atyfb_par *par)
if (regindex >= 0x400)
regindex -= 0x800;
#if defined(__mc68000__)
return
le32_to_cpu(*((volatile u32 *) (par->ati_regbase + regindex)));
#ifdef CONFIG_ATARI
return in_le32((volatile u32 *)(par->ati_regbase + regindex));
#else
return readl(par->ati_regbase + regindex);
#endif
......@@ -161,9 +160,8 @@ static inline void aty_st_le32(int regindex, u32 val,
if (regindex >= 0x400)
regindex -= 0x800;
#if defined(__mc68000__)
*((volatile u32 *) (par->ati_regbase + regindex)) =
cpu_to_le32(val);
#ifdef CONFIG_ATARI
out_le32((volatile u32 *)(par->ati_regbase + regindex));
#else
writel(val, par->ati_regbase + regindex);
#endif
......@@ -174,8 +172,11 @@ static inline u8 aty_ld_8(int regindex, const struct atyfb_par *par)
/* Hack for bloc 1, should be cleanly optimized by compiler */
if (regindex >= 0x400)
regindex -= 0x800;
#ifdef CONFIG_ATARI
return in_8(par->ati_regbase + regindex);
#else
return readb(par->ati_regbase + regindex);
#endif
}
static inline void aty_st_8(int regindex, u8 val,
......@@ -185,7 +186,11 @@ static inline void aty_st_8(int regindex, u8 val,
if (regindex >= 0x400)
regindex -= 0x800;
#ifdef CONFIG_ATARI
out_8(par->ati_regbase + regindex, val);
#else
writeb(val, par->ati_regbase + regindex);
#endif
}
static inline u8 aty_ld_pll(int offset, const struct atyfb_par *par)
......
......@@ -267,8 +267,11 @@ static unsigned long phys_size[FB_MAX] __initdata = { 0, };
static unsigned long phys_guiregbase[FB_MAX] __initdata = { 0, };
#endif
#ifdef CONFIG_FB_ATY_GX
static char m64n_gx[] __initdata = "mach64GX (ATI888GX00)";
static char m64n_cx[] __initdata = "mach64CX (ATI888CX00)";
#endif /* CONFIG_FB_ATY_GX */
#ifdef CONFIG_FB_ATY_CT
static char m64n_ct[] __initdata = "mach64CT (ATI264CT)";
static char m64n_et[] __initdata = "mach64ET (ATI264ET)";
static char m64n_vta3[] __initdata = "mach64VTA3 (ATI264VT)";
......@@ -292,7 +295,7 @@ static char m64n_ltp_a[] __initdata = "3D RAGE LT PRO (AGP)";
static char m64n_ltp_p[] __initdata = "3D RAGE LT PRO (PCI)";
static char m64n_mob_p[] __initdata = "3D RAGE Mobility (PCI)";
static char m64n_mob_a[] __initdata = "3D RAGE Mobility (AGP)";
#endif /* CONFIG_FB_ATY_CT */
static struct {
u16 pci_id, chip_type;
......@@ -424,12 +427,16 @@ static struct {
};
static char ram_dram[] __initdata = "DRAM";
#ifdef CONFIG_FB_ATY_GX
static char ram_vram[] __initdata = "VRAM";
#endif /* CONFIG_FB_ATY_GX */
#ifdef CONFIG_FB_ATY_CT
static char ram_edo[] __initdata = "EDO";
static char ram_sdram[] __initdata = "SDRAM";
static char ram_sgram[] __initdata = "SGRAM";
static char ram_wram[] __initdata = "WRAM";
static char ram_off[] __initdata = "OFF";
#endif /* CONFIG_FB_ATY_CT */
static char ram_resv[] __initdata = "RESV";
static u32 pseudo_palette[17];
......@@ -2600,11 +2607,11 @@ int __init atyfb_init(void)
* Map the video memory (physical address given) to somewhere in the
* kernel address space.
*/
info->screen_base =
ioremap(phys_vmembase[m64_num], phys_size[m64_num]);
info->screen_base = (unsigned long)ioremap(phys_vmembase[m64_num],
phys_size[m64_num]);
info->fix.smem_start = info->screen_base; /* Fake! */
par->ati_regbase =
ioremap(phys_guiregbase[m64_num], 0x10000) + 0xFC00ul;
par->ati_regbase = (unsigned long)ioremap(phys_guiregbase[m64_num],
0x10000) + 0xFC00ul;
info->fix.mmio_start = par->ati_regbase; /* Fake! */
aty_st_le32(CLOCK_CNTL, 0x12345678, info);
......@@ -2825,10 +2832,17 @@ static int atyfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
aty_st_8(DAC_CNTL, i, par);
aty_st_8(DAC_MASK, 0xff, par);
scale = (M64_HAS(INTEGRATED) && par->crtc.bpp == 16) ? 3 : 0;
#ifdef CONFIG_ATARI
out_8(&par->aty_cmap_regs->windex, regno << scale);
out_8(&par->aty_cmap_regs->lut, red);
out_8(&par->aty_cmap_regs->lut, green);
out_8(&par->aty_cmap_regs->lut, blue);
#else
writeb(regno << scale, &par->aty_cmap_regs->windex);
writeb(red, &par->aty_cmap_regs->lut);
writeb(green, &par->aty_cmap_regs->lut);
writeb(blue, &par->aty_cmap_regs->lut);
#endif
if (regno < 16)
switch (par->crtc.bpp) {
case 16:
......
......@@ -184,15 +184,15 @@ static int valkyrie_setpalette (unsigned int regno, unsigned int red,
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);
......@@ -224,25 +224,25 @@ static int dafb_setpalette (unsigned int regno, unsigned int red,
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);
......@@ -274,12 +274,12 @@ static int v8_brazil_setpalette (unsigned int regno, unsigned int red,
In 2bpp, the regnos are 0x3f, 0x7f, 0xbf, 0xff */
_regno = (regno<<(8 - info->var.bits_per_pixel)) | (0xFF >> info->var.vits_per_pixel);
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);
......@@ -308,15 +308,15 @@ static int rbv_setpalette (unsigned int regno, unsigned int red,
_regno = regno + (256-(1 << info->var.bits_per_pixel));
/* 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. */
......@@ -340,10 +340,10 @@ static int mdc_setpalette(unsigned int regno, unsigned int red,
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;
......@@ -365,10 +365,10 @@ static int toby_setpalette(unsigned int regno, unsigned int red,
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;
......@@ -389,10 +389,10 @@ static int jet_setpalette(unsigned int regno, unsigned int red,
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;
......@@ -428,7 +428,7 @@ static int civic_setpalette (unsigned int regno, unsigned int red,
/*
* Set the register address
*/
writeb(regno, &civic_cmap_regs->addr); nop();
nubus_writeb(regno, &civic_cmap_regs->addr); nop();
/*
* Wait for VBL interrupt here;
......@@ -453,42 +453,42 @@ static int civic_setpalette (unsigned int regno, unsigned int red,
* 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);
......@@ -641,7 +641,7 @@ void __init macfb_init(void)
macfb_fix.line_length = mac_bi_data.videorow;
macfb_fix.smem_len = macfb_fix.line_length * macfb_defined.yres;
/* Note: physical address (since 2.1.127) */
macfb_fix.smem_start = (void*) mac_bi_data.videoaddr;
macfb_fix.smem_start = 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
......@@ -649,7 +649,7 @@ void __init macfb_init(void)
Mac */
fb_info.screen_base = ioremap(mac_bi_data.videoaddr, macfb_fix.smem_len);
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",
macfb_fix.smem_start, fb_info.screen_base, macfb_fix.smem_len/1024);
printk("macfb: mode is %dx%dx%d, linelength=%d\n",
macfb_defined.xres, macfb_defined.yres/, macfb_defined.bits_per_pixel, macfb_fix.line_length);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment