mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Petr Vandrovec <vandrove@vc.cvut.cz>
To: marcelo@conectiva.com.br
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] Support for matroxfb on HP Vectra
Date: Fri, 14 Mar 2003 21:33:01 +0100	[thread overview]
Message-ID: <20030314203301.GA19437@vana.vc.cvut.cz> (raw)
In-Reply-To: <3E71B8AE.4060903@mersin.edu.tr>

Hi Marcelo,
  please apply this patch...

Matrox chips soldered to the HP Vectra's mainboard do not have EEPROM connected to
them, instead of that system BIOS contains VGA BIOS image which is extracted only 
to the legacy VGA BIOS region at 0xC0000, and nowhere else. And in addition to this 
they decided to use 14.318MHz XTAL instead of recommended 27.000MHz. These two events
together made matroxfb a bit unhappy on such motherboard, as all frequencies were
only 53% of expected value :-(

With this patch matroxfb tries to use legacy BIOS if there is no EEPROM and it
is ia32 architecture (and it was confirmed to fix a problem).

Patch applies to both 2.4 and 2.5, but in 2.5 it is a bit useless...

						Thanks,
							Petr Vandrovec
							vandrove@vc.cvut.cz
				

--- a/drivers/video/matrox/matroxfb_misc.c	2003-02-13 03:57:39.000000000 +0100
+++ b/drivers/video/matrox/matroxfb_misc.c	2003-03-14 14:33:01.000000000 +0100
@@ -994,6 +994,27 @@
 	parse_bios(vaddr_va(ACCESS_FBINFO(video).vbase), &ACCESS_FBINFO(bios));
 	pci_write_config_dword(pdev, PCI_ROM_ADDRESS, biosbase);
 	pci_write_config_dword(pdev, PCI_OPTION_REG, opt);
+#ifdef CONFIG_X86
+	if (!ACCESS_FBINFO(bios).bios_valid) {
+		unsigned char* b;
+		
+		b = ioremap(0x000C0000, 65536);
+		if (!b) {
+			printk(KERN_INFO "matroxfb: Unable to map legacy BIOS\n");
+		} else {
+			unsigned int ven = readb(b+0x64+0) | (readb(b+0x64+1) << 8);
+			unsigned int dev = readb(b+0x64+2) | (readb(b+0x64+3) << 8);
+			
+			if (ven != pdev->vendor || dev != pdev->device) {
+				printk(KERN_INFO "matroxfb: Legacy BIOS is for %04X:%04X, while this device is %04X:%04X\n",
+					ven, dev, pdev->vendor, pdev->device);
+			} else {
+				parse_bios(b, &ACCESS_FBINFO(bios));
+			}
+			iounmap(b);
+		}
+	}
+#endif
 	matroxfb_set_limits(PMINFO &ACCESS_FBINFO(bios));
 }
 

           reply	other threads:[~2003-03-14 20:22 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <3E71B8AE.4060903@mersin.edu.tr>]

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=20030314203301.GA19437@vana.vc.cvut.cz \
    --to=vandrove@vc.cvut.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@conectiva.com.br \
    /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

all inboxes | Powered by JetHome®