linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <syrjala@sci.fi>
To: linux-fbdev-devel@lists.sourceforge.net
Subject: [PATCH] atyfb: disable linear aperture register access
Date: Sun, 15 Feb 2004 01:47:25 +0200	[thread overview]
Message-ID: <20040214234725.GA6430@sci.fi> (raw)

[-- Attachment #1: Type: text/plain, Size: 250 bytes --]

This atyfb patch disables register access through the linear aperture if 
the auxiliary aperture is used. This allows access to the full 8 MB of 
memory. Tested on 3D Rage LT Pro.

-- 
Ville Syrjälä
syrjala@sci.fi
http://www.sci.fi/~syrjala/

[-- Attachment #2: atyfb_reg_aperture.patch --]
[-- Type: text/plain, Size: 3860 bytes --]

diff -urN linux-2.4.24/drivers/video/aty/atyfb.h linux-2.4.24/drivers/video/aty/atyfb.h
--- linux-2.4.24/drivers/video/aty/atyfb.h	2004-02-15 01:25:31.000000000 +0200
+++ linux-2.4.24/drivers/video/aty/atyfb.h	2004-02-15 01:23:19.000000000 +0200
@@ -179,6 +179,7 @@
     unsigned char *save_framebuffer;
     unsigned long save_pll[64];
 #endif
+    int aux_app;
 };
 
 
diff -urN linux-2.4.24/drivers/video/aty/atyfb_base.c linux-2.4.24/drivers/video/aty/atyfb_base.c
--- linux-2.4.24/drivers/video/aty/atyfb_base.c	2004-02-15 01:25:52.000000000 +0200
+++ linux-2.4.24/drivers/video/aty/atyfb_base.c	2004-02-15 01:24:18.000000000 +0200
@@ -1006,11 +1006,13 @@
             aty_st_le32(BUS_CNTL, 0x680000f9, info);
         }  else if (M64_HAS(MOBIL_BUS)) {
             aty_st_le32(DAC_CNTL, 0x80010102, info);
-            aty_st_le32(BUS_CNTL, 0x7b33a040, info);
+            aty_st_le32(BUS_CNTL, 0x7b33a040 |
+                        (info->aux_app ? BUS_APER_REG_DIS : 0), info);
         } else {
             /* GT */
             aty_st_le32(DAC_CNTL, 0x86010102, info);
-            aty_st_le32(BUS_CNTL, 0x7b23a040, info);
+            aty_st_le32(BUS_CNTL, 0x7b23a040 |
+                        (info->aux_app ? BUS_APER_REG_DIS : 0), info);
             aty_st_le32(EXT_MEM_CNTL,
                         aty_ld_le32(EXT_MEM_CNTL, info) | 0x5000001, info);
         }
@@ -2263,13 +2265,20 @@
 
     /*
      *  Last page of 8 MB (4 MB on ISA) aperture is MMIO
-     *  FIXME: we should use the auxiliary aperture instead so we can access
-     *  the full 8 MB of video RAM on 8 MB boards
      */
-    if (info->total_vram == 0x800000 ||
+    if ((!info->aux_app && info->total_vram == 0x800000) ||
         (info->bus_type == ISA && info->total_vram == 0x400000))
             info->total_vram -= GUI_RESERVE;
 
+    /*
+     *  Disable register access through the linear aperture
+     *  if the auxiliary aperture is used so we can access
+     *  the full 8 MB of video RAM on 8 MB boards.
+     */
+    if (info->aux_app)
+        aty_st_le32(BUS_CNTL, aty_ld_le32(BUS_CNTL, info) |
+                    BUS_APER_REG_DIS, info);
+
     /* Clear the video memory */
     fb_memset((void *)info->frame_buffer, 0, info->total_vram);
 
@@ -2439,7 +2448,6 @@
         return -ENXIO;
 #else
     u16 tmp;
-    int aux_app;
     unsigned long raddr;
 #endif
 #if defined(CONFIG_FB_ATY_GENERIC_LCD)
@@ -2687,13 +2695,12 @@
 
 #else /* __sparc__ */
 
-            aux_app = 0;
             raddr = addr + 0x7ff000UL;
             rrp = &pdev->resource[2];
             if ((rrp->flags & IORESOURCE_MEM)
                 && request_mem_region(rrp->start, rrp->end - rrp->start + 1,
                                       "atyfb")) {
-                    aux_app = 1;
+                    info->aux_app = 1;
                     raddr = rrp->start;
                     printk(KERN_INFO "atyfb: using auxiliary register aperture\n");
             }
@@ -2707,8 +2714,8 @@
                     return -ENOMEM;
             }
 
-            info->ati_regbase_phys += aux_app? 0x400: 0xc00;
-            info->ati_regbase += aux_app? 0x400: 0xc00;
+            info->ati_regbase_phys += info->aux_app ? 0x400 : 0xc00;
+            info->ati_regbase += info->aux_app ? 0x400 : 0xc00;
 
             /*
              * Enable memory-space accesses using config-space
diff -urN linux-2.4.24/drivers/video/aty/mach64.h linux-2.4.24/drivers/video/aty/mach64.h
--- linux-2.4.24/drivers/video/aty/mach64.h	2004-02-15 01:25:31.000000000 +0200
+++ linux-2.4.24/drivers/video/aty/mach64.h	2004-02-15 01:13:09.000000000 +0200
@@ -635,6 +635,7 @@
 /* Mach64 engine bit constants - these are typically ORed together */
 
 /* BUS_CNTL register constants */
+#define BUS_APER_REG_DIS	0x00000010
 #define BUS_FIFO_ERR_ACK	0x00200000
 #define BUS_HOST_ERR_ACK	0x00800000
 

                 reply	other threads:[~2004-02-14 23:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040214234725.GA6430@sci.fi \
    --to=syrjala@sci.fi \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).