public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: <eiichiro.oiwa.nm@hitachi.com>
To: akpm@osdl.org, tony.luck@intel.ocm, greg@kroah.com,
	linux-ia64@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 2.6.18] IA64: Add pci_fixup_video into IA64 kernel for
Date: Tue, 26 Sep 2006 07:35:54 +0000	[thread overview]
Message-ID: <XNM1$9$0$4$$3$3$7$A$9002680U4518d84f@hitachi.com> (raw)
In-Reply-To: 200609260605.k8Q65dAc005670@fire-2.osdl.org

To be compatible with Xorg's handling of PCI, we need pci_fixup_video on IA64
platform like x86 platform. There are also machines, which have VGA embedded
into main board, among IA64 platform. Embedded VGA generally don't have PCI ROM,
and there are VGA ROM image in System BIOS. Therefore, these machines need
pci_fixup_video for the sysfs rom. pci_fixup_video already exists in x86 Linux
kernel. However since this function doesn't exist in IA64 kernel, we could not
run X server on IA64 box has embedded-VGA.

I tested pci_fixup_video on IA64 box has embedded-VGA. I confirmed we can read
VGA BIOS from the sysfs rom regardless of embedded-VGA.

Signed-off-by: Eiichiro Oiwa <eiichiro.oiwa.nm@hitachi.com>
---

diff -dupNr linux-2.6.18.orig/arch/ia64/pci/Makefile linux-2.6.18/arch/ia64/pci/Makefile
--- linux-2.6.18.orig/arch/ia64/pci/Makefile	2006-09-20 12:42:06.000000000 +0900
+++ linux-2.6.18/arch/ia64/pci/Makefile	2006-09-25 18:36:50.000000000 +0900
@@ -1,4 +1,4 @@
 #
 # Makefile for the ia64-specific parts of the pci bus
 #
-obj-y		:= pci.o
+obj-y		:= pci.o fixup.o
diff -dupNr linux-2.6.18.orig/arch/ia64/pci/fixup.c linux-2.6.18/arch/ia64/pci/fixup.c
--- linux-2.6.18.orig/arch/ia64/pci/fixup.c	1970-01-01 09:00:00.000000000 +0900
+++ linux-2.6.18/arch/ia64/pci/fixup.c	2006-09-25 18:35:12.000000000 +0900
@@ -0,0 +1,56 @@
+/*
+ * Exceptions for specific devices. Usually work-arounds for fatal design flaws.
+ *
+ * Derived from fixup.c of i386 tree.
+ */
+
+#include <linux/delay.h>
+#include <linux/dmi.h>
+#include <linux/pci.h>
+#include <linux/init.h>
+
+
+/*
+ * Fixup to mark boot BIOS video selected by BIOS before it changes
+ *
+ * From information provided by "Jon Smirl" <jonsmirl@gmail.com>
+ *
+ * The standard boot ROM sequence for an x86 machine uses the BIOS
+ * to select an initial video card for boot display. This boot video
+ * card will have it's BIOS copied to C0000 in system RAM.
+ * IORESOURCE_ROM_SHADOW is used to associate the boot video
+ * card with this copy. On laptops this copy has to be used since
+ * the main ROM may be compressed or combined with another image.
+ * See pci_map_rom() for use of this flag. IORESOURCE_ROM_SHADOW
+ * is marked here since the boot video device will be the only enabled
+ * video device at this point.
+ */
+
+static void __devinit pci_fixup_video(struct pci_dev *pdev)
+{
+	struct pci_dev *bridge;
+	struct pci_bus *bus;
+	u16 config;
+
+	if ((pdev->class >> 8) != PCI_CLASS_DISPLAY_VGA)
+		return;
+
+	/* Is VGA routed to us? */
+	bus = pdev->bus;
+	while (bus) {
+		bridge = bus->self;
+		if (bridge) {
+			pci_read_config_word(bridge, PCI_BRIDGE_CONTROL,
+						&config);
+			if (!(config & PCI_BRIDGE_CTL_VGA))
+				return;
+		}
+		bus = bus->parent;
+	}
+	pci_read_config_word(pdev, PCI_COMMAND, &config);
+	if (config & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) {
+		pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW;
+		printk(KERN_DEBUG "Boot video device is %s\n", pci_name(pdev));
+	}
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, pci_fixup_video);


       reply	other threads:[~2006-09-26  7:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200609260605.k8Q65dAc005670@fire-2.osdl.org>
2006-09-26  7:35 ` eiichiro.oiwa.nm [this message]
2006-09-26  7:42   ` [PATCH 2.6.18] IA64: Add pci_fixup_video into IA64 kernel for eiichiro.oiwa.nm
2006-09-26 15:09     ` [PATCH 2.6.18] IA64: Add pci_fixup_video into IA64 kernel for embedded VGA Bjorn Helgaas
2006-09-26 15:48       ` Jesse Barnes
2006-09-26 15:50     ` Jesse Barnes
2006-09-27  4:17       ` Re[2]: [PATCH 2.6.18] IA64: Add pci_fixup_video into IA64 kernel for eiichiro.oiwa.nm
2006-09-27 11:23   ` eiichiro.oiwa.nm
2006-09-27 11:48     ` Alan Cox
2006-09-28  5:03       ` Re[2]: [PATCH 2.6.18] IA64: Add pci_fixup_video into IA64 kernel eiichiro.oiwa.nm

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='XNM1$9$0$4$$3$3$7$A$9002680U4518d84f@hitachi.com' \
    --to=eiichiro.oiwa.nm@hitachi.com \
    --cc=akpm@osdl.org \
    --cc=greg@kroah.com \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tony.luck@intel.ocm \
    /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