Commit c0138240 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Linus Torvalds

[PATCH] M68k update (part 7)

Atari frame buffer device updates
  - Move static function definition before usage
  - Fix breakage caused by recent fbdev changes
  - Make some setup parameter parsing separate routines (strsep() must be able
    to modify the passed pointers)
  - On Atari the ATI Mach64 registers are memory mapped, but it's not on
    the PCI bus, so we cannot use writel() and friends.
  - Kill warnings by protecting unused data with the appropriate #ifdef
  - On Atari the ATI Mach64 registers are memory mapped, but it's not on the
    PCI bus, so we cannot use writel() and friends.
  - Fix assignment of addresses for Atari
parent cff1a4f5
This diff is collapsed.
...@@ -174,10 +174,10 @@ static inline u32 aty_ld_le32(int regindex, ...@@ -174,10 +174,10 @@ static inline u32 aty_ld_le32(int regindex,
{ {
/* Hack for bloc 1, should be cleanly optimized by compiler */ /* Hack for bloc 1, should be cleanly optimized by compiler */
if (regindex >= 0x400) if (regindex >= 0x400)
regindex -= 0x800; regindex -= 0x800;
#if defined(__mc68000__) #ifdef CONFIG_ATARI
return le32_to_cpu(*((volatile u32 *)(info->ati_regbase+regindex))); return in_le32((volatile u32 *)(info->ati_regbase+regindex));
#else #else
return readl (info->ati_regbase + regindex); return readl (info->ati_regbase + regindex);
#endif #endif
...@@ -188,10 +188,10 @@ static inline void aty_st_le32(int regindex, u32 val, ...@@ -188,10 +188,10 @@ static inline void aty_st_le32(int regindex, u32 val,
{ {
/* Hack for bloc 1, should be cleanly optimized by compiler */ /* Hack for bloc 1, should be cleanly optimized by compiler */
if (regindex >= 0x400) if (regindex >= 0x400)
regindex -= 0x800; regindex -= 0x800;
#if defined(__mc68000__) #ifdef CONFIG_ATARI
*((volatile u32 *)(info->ati_regbase+regindex)) = cpu_to_le32(val); out_le32 (info->ati_regbase+regindex, val);
#else #else
writel (val, info->ati_regbase + regindex); writel (val, info->ati_regbase + regindex);
#endif #endif
...@@ -202,9 +202,13 @@ static inline u8 aty_ld_8(int regindex, ...@@ -202,9 +202,13 @@ static inline u8 aty_ld_8(int regindex,
{ {
/* Hack for bloc 1, should be cleanly optimized by compiler */ /* Hack for bloc 1, should be cleanly optimized by compiler */
if (regindex >= 0x400) if (regindex >= 0x400)
regindex -= 0x800; regindex -= 0x800;
#ifdef CONFIG_ATARI
return in_8 (info->ati_regbase + regindex);
#else
return readb (info->ati_regbase + regindex); return readb (info->ati_regbase + regindex);
#endif
} }
static inline void aty_st_8(int regindex, u8 val, static inline void aty_st_8(int regindex, u8 val,
...@@ -212,9 +216,13 @@ static inline void aty_st_8(int regindex, u8 val, ...@@ -212,9 +216,13 @@ static inline void aty_st_8(int regindex, u8 val,
{ {
/* Hack for bloc 1, should be cleanly optimized by compiler */ /* Hack for bloc 1, should be cleanly optimized by compiler */
if (regindex >= 0x400) if (regindex >= 0x400)
regindex -= 0x800; regindex -= 0x800;
#ifdef CONFIG_ATARI
out_8 (info->ati_regbase + regindex, val);
#else
writeb (val, info->ati_regbase + regindex); writeb (val, info->ati_regbase + regindex);
#endif
} }
static inline u8 aty_ld_pll(int offset, const struct fb_info_aty *info) static inline u8 aty_ld_pll(int offset, const struct fb_info_aty *info)
......
...@@ -270,8 +270,11 @@ static unsigned long phys_size[FB_MAX] __initdata = { 0, }; ...@@ -270,8 +270,11 @@ static unsigned long phys_size[FB_MAX] __initdata = { 0, };
static unsigned long phys_guiregbase[FB_MAX] __initdata = { 0, }; static unsigned long phys_guiregbase[FB_MAX] __initdata = { 0, };
#endif #endif
#ifdef CONFIG_FB_ATY_GX
static char m64n_gx[] __initdata = "mach64GX (ATI888GX00)"; static char m64n_gx[] __initdata = "mach64GX (ATI888GX00)";
static char m64n_cx[] __initdata = "mach64CX (ATI888CX00)"; 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_ct[] __initdata = "mach64CT (ATI264CT)";
static char m64n_et[] __initdata = "mach64ET (ATI264ET)"; static char m64n_et[] __initdata = "mach64ET (ATI264ET)";
static char m64n_vta3[] __initdata = "mach64VTA3 (ATI264VT)"; static char m64n_vta3[] __initdata = "mach64VTA3 (ATI264VT)";
...@@ -294,6 +297,7 @@ static char m64n_ltp_a[] __initdata = "3D RAGE LT PRO (AGP)"; ...@@ -294,6 +297,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_ltp_p[] __initdata = "3D RAGE LT PRO (PCI)";
static char m64n_mob_p[] __initdata = "3D RAGE Mobility (PCI)"; static char m64n_mob_p[] __initdata = "3D RAGE Mobility (PCI)";
static char m64n_mob_a[] __initdata = "3D RAGE Mobility (AGP)"; static char m64n_mob_a[] __initdata = "3D RAGE Mobility (AGP)";
#endif /* CONFIG_FB_ATY_CT */
static struct { static struct {
...@@ -357,12 +361,16 @@ static struct { ...@@ -357,12 +361,16 @@ static struct {
}; };
static char ram_dram[] __initdata = "DRAM"; static char ram_dram[] __initdata = "DRAM";
#ifdef CONFIG_FB_ATY_GX
static char ram_vram[] __initdata = "VRAM"; 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_edo[] __initdata = "EDO";
static char ram_sdram[] __initdata = "SDRAM"; static char ram_sdram[] __initdata = "SDRAM";
static char ram_sgram[] __initdata = "SGRAM"; static char ram_sgram[] __initdata = "SGRAM";
static char ram_wram[] __initdata = "WRAM"; static char ram_wram[] __initdata = "WRAM";
static char ram_off[] __initdata = "OFF"; static char ram_off[] __initdata = "OFF";
#endif /* CONFIG_FB_ATY_CT */
static char ram_resv[] __initdata = "RESV"; static char ram_resv[] __initdata = "RESV";
#ifdef CONFIG_FB_ATY_GX #ifdef CONFIG_FB_ATY_GX
...@@ -2486,9 +2494,11 @@ int __init atyfb_init(void) ...@@ -2486,9 +2494,11 @@ int __init atyfb_init(void)
* Map the video memory (physical address given) to somewhere in the * Map the video memory (physical address given) to somewhere in the
* kernel address space. * kernel address space.
*/ */
info->frame_buffer = ioremap(phys_vmembase[m64_num], phys_size[m64_num]); info->frame_buffer = (unsigned long)ioremap(phys_vmembase[m64_num],
phys_size[m64_num]);
info->frame_buffer_phys = info->frame_buffer; /* Fake! */ info->frame_buffer_phys = info->frame_buffer; /* Fake! */
info->ati_regbase = ioremap(phys_guiregbase[m64_num], 0x10000)+0xFC00ul; info->ati_regbase = (unsigned long)ioremap(phys_guiregbase[m64_num],
0x10000)+0xFC00ul;
info->ati_regbase_phys = info->ati_regbase; /* Fake! */ info->ati_regbase_phys = info->ati_regbase; /* Fake! */
aty_st_le32(CLOCK_CNTL, 0x12345678, info); aty_st_le32(CLOCK_CNTL, 0x12345678, info);
...@@ -2748,10 +2758,17 @@ static int atyfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, ...@@ -2748,10 +2758,17 @@ static int atyfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
aty_st_8(DAC_CNTL, i, info); aty_st_8(DAC_CNTL, i, info);
aty_st_8(DAC_MASK, 0xff, info); aty_st_8(DAC_MASK, 0xff, info);
scale = (M64_HAS(INTEGRATED) && info->current_par.crtc.bpp == 16) ? 3 : 0; scale = (M64_HAS(INTEGRATED) && info->current_par.crtc.bpp == 16) ? 3 : 0;
#ifdef CONFIG_ATARI
out_8(&info->aty_cmap_regs->windex, regno << scale);
out_8(&info->aty_cmap_regs->lut, red);
out_8(&info->aty_cmap_regs->lut, green);
out_8(&info->aty_cmap_regs->lut, blue);
#else
writeb(regno << scale, &info->aty_cmap_regs->windex); writeb(regno << scale, &info->aty_cmap_regs->windex);
writeb(red, &info->aty_cmap_regs->lut); writeb(red, &info->aty_cmap_regs->lut);
writeb(green, &info->aty_cmap_regs->lut); writeb(green, &info->aty_cmap_regs->lut);
writeb(blue, &info->aty_cmap_regs->lut); writeb(blue, &info->aty_cmap_regs->lut);
#endif
if (regno < 16) if (regno < 16)
switch (info->current_par.crtc.bpp) { switch (info->current_par.crtc.bpp) {
#ifdef FBCON_HAS_CFB16 #ifdef FBCON_HAS_CFB16
......
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