Since some people disapprove of white space cleanups mixed in regular commits
[coreboot.git] / src / drivers / ati / ragexl / atyfb.h
index 31092e2e1678cde775aceb92e1f8132d0c70e574..99a87b33711d7a78bc9057f8270c1422b7bfbbf3 100644 (file)
@@ -1,25 +1,14 @@
-
 /*
  *  ATI Frame Buffer Device Driver Core Definitions
  */
-#define u32 uint32_t
-#define u16 uint16_t
-#define u8 uint8_t
 
-#define u_int uint32_t
+#define PLL_CRTC_DECODE 0
 
 #define EINVAL -1
 
-#define readb(addr) (*(volatile unsigned char *) (addr))
-#define readw(addr) (*(volatile unsigned short *) (addr))
-#define readl(addr) (*(volatile unsigned int *) (addr))
-
-#define writeb(b,addr) (*(volatile unsigned char *) (addr) = (b))
-#define writew(b,addr) (*(volatile unsigned short *) (addr) = (b))
-#define writel(b,addr) (*(volatile unsigned int *) (addr) = (b))
-
-
 #define max(x,y) (x>=y)?x:y
+
+#if CONFIG_CONSOLE_BTEXT==1
     /*
      *  Elements of the hardware specific atyfb_par structure
      */
@@ -38,6 +27,7 @@ struct crtc {
     u32 dp_pix_width;  /* acceleration */
     u32 dp_chain_mask; /* acceleration */
 };
+#endif /* CONFIG_CONSOLE_BTEXT */
 #if 0
 struct pll_514 {
     u8 m;
@@ -83,7 +73,9 @@ union aty_pll {
      *  The hardware parameters for each card
      */
 struct atyfb_par {
+#if CONFIG_CONSOLE_BTEXT==1
     struct crtc crtc;
+#endif
     union aty_pll pll;
     u32 accel_flags;
 };
@@ -105,7 +97,11 @@ struct aty_cursor {
 };
 #endif
 struct fb_info_aty {
+#if CONFIG_CONSOLE_BTEXT==1
+#if PLL_CRTC_DECODE==1
     struct fb_info fb_info;
+#endif
+#endif
 #if 0
     struct fb_info_aty *next;
     unsigned long ati_regbase_phys;
@@ -125,7 +121,7 @@ struct fb_info_aty {
     struct { u8 red, green, blue, pad; } palette[256];
 #endif
     struct atyfb_par default_par;
-#if 0
+#if PLL_CRTC_DECODE==1
     struct atyfb_par current_par;
 #endif
 
@@ -214,10 +210,10 @@ static inline u32 aty_ld_le32(int regindex,
     if (regindex >= 0x400)
        regindex -= 0x800;
 
-#ifdef CONFIG_ATARI
+#ifdef ATARI
     return in_le32((volatile u32 *)(info->ati_regbase+regindex));
 #else
-    return readl (info->ati_regbase + regindex);
+    return read32 (info->ati_regbase + regindex);
 #endif
 }
 
@@ -228,10 +224,10 @@ static inline void aty_st_le32(int regindex, u32 val,
     if (regindex >= 0x400)
        regindex -= 0x800;
 
-#ifdef CONFIG_ATARI
+#ifdef ATARI
     out_le32 (info->ati_regbase+regindex, val);
 #else
-    writel (val, info->ati_regbase + regindex);
+    write32 (info->ati_regbase + regindex, val);
 #endif
 }
 
@@ -245,7 +241,7 @@ static inline u16 aty_ld_le16(int regindex,
 #if defined(__mc68000__)
     return le16_to_cpu(*((volatile u16 *)(info->ati_regbase+regindex)));
 #else
-    return readw (info->ati_regbase + regindex);
+    return read16 (info->ati_regbase + regindex);
 #endif
 }
 
@@ -259,7 +255,7 @@ static inline void aty_st_le16(int regindex, u16 val,
 #if defined(__mc68000__)
     *((volatile u16 *)(info->ati_regbase+regindex)) = cpu_to_le16(val);
 #else
-    writew (val, info->ati_regbase + regindex);
+    write16 (info->ati_regbase + regindex, val);
 #endif
 }
 
@@ -270,10 +266,10 @@ static inline u8 aty_ld_8(int regindex,
     if (regindex >= 0x400)
        regindex -= 0x800;
 
-#ifdef CONFIG_ATARI
+#ifdef ATARI
     return in_8 (info->ati_regbase + regindex);
 #else
-    return readb (info->ati_regbase + regindex);
+    return read8 (info->ati_regbase + regindex);
 #endif
 }
 
@@ -284,10 +280,10 @@ static inline void aty_st_8(int regindex, u8 val,
     if (regindex >= 0x400)
        regindex -= 0x800;
 
-#ifdef CONFIG_ATARI
+#ifdef ATARI
     out_8 (info->ati_regbase + regindex, val);
 #else
-    writeb (val, info->ati_regbase + regindex);
+    write8 (info->ati_regbase + regindex, val);
 #endif
 }
 
@@ -398,8 +394,8 @@ static inline void wait_for_idle(struct fb_info_aty *info)
 extern void aty_reset_engine(const struct fb_info_aty *info);
 extern void aty_init_engine(const struct atyfb_par *par,
                            struct fb_info_aty *info);
-extern void aty_rectfill(int dstx, int dsty, u_int width, u_int height,
-                        u_int color, struct fb_info_aty *info);
+extern void aty_rectfill(int dstx, int dsty, u32 width, u32 height,
+                        u32 color, struct fb_info_aty *info);
 
 
     /*