LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 2.6.18] PCI: Turn pci_fixup_video into generic for embedded VGA
@ 2006-09-28 4:55 eiichiro.oiwa.nm
2006-09-28 11:18 ` Alan Cox
2006-09-28 16:36 ` Jesse Barnes
0 siblings, 2 replies; 7+ messages in thread
From: eiichiro.oiwa.nm @ 2006-09-28 4:55 UTC (permalink / raw)
To: akpm, tony.luck, greg, Alan Cox; +Cc: Jesse Barnes, linux-ia64, linux-kernel
pci_fixup_video turns into generic code because there are many platforms need this fixup
for embedded VGA as well as x86. The Video BIOS integrates into System BIOS on a machine
has embedded VGA although embedded VGA generally don't have PCI ROM. As a result,
embedded VGA need the way that the sysfs rom points to the Video BIOS of System
RAM (0xC0000). PCI-to-PCI Bridge Architecture specification describes the condition whether
or not PCI ROM forwards VGA compatible memory address. fixup_video suits this specification.
Although the Video ROM generally implements in x86 code regardless of platform, some
application such as X Window System can run this code by dosemu86. Therefore,
pci_fixup_video should turn into generic code.
Signed-off-by: Eiichiro Oiwa <eiichiro.oiwa.nm@hitachi.com>
---
diff -dupNr linux-2.6.18.orig/arch/i386/pci/fixup.c linux-2.6.18/arch/i386/pci/fixup.c
--- linux-2.6.18.orig/arch/i386/pci/fixup.c 2006-09-20 12:42:06.000000000 +0900
+++ linux-2.6.18/arch/i386/pci/fixup.c 2006-09-27 14:18:55.000000000 +0900
@@ -343,51 +343,6 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_IN
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_MCH_PC1, pcie_rootport_aspm_quirk );
/*
- * 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);
-
-/*
* Some Toshiba laptops need extra code to enable their TI TSB43AB22/A.
*
* We pretend to bring them out of full D3 state, and restore the proper
diff -dupNr linux-2.6.18.orig/drivers/pci/quirks.c linux-2.6.18/drivers/pci/quirks.c
--- linux-2.6.18.orig/drivers/pci/quirks.c 2006-09-20 12:42:06.000000000 +0900
+++ linux-2.6.18/drivers/pci/quirks.c 2006-09-27 14:46:40.000000000 +0900
@@ -1590,6 +1590,51 @@ static void __devinit fixup_rev1_53c810(
}
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NCR, PCI_DEVICE_ID_NCR_53C810, fixup_rev1_53c810);
+/*
+ * 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 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, fixup_video);
+
static void pci_do_fixups(struct pci_dev *dev, struct pci_fixup *f, struct pci_fixup *end)
{
diff -dupNr linux-2.6.18.orig/drivers/pci/rom.c linux-2.6.18/drivers/pci/rom.c
--- linux-2.6.18.orig/drivers/pci/rom.c 2006-09-20 12:42:06.000000000 +0900
+++ linux-2.6.18/drivers/pci/rom.c 2006-09-28 12:30:24.000000000 +0900
@@ -71,7 +71,10 @@ void __iomem *pci_map_rom(struct pci_dev
void __iomem *image;
int last_image;
- /* IORESOURCE_ROM_SHADOW only set on x86 */
+ /*
+ * IORESOURCE_ROM_SHADOW set if the VGA enable bit of the Bridge Control
+ * register is set for embedded VGA.
+ */
if (res->flags & IORESOURCE_ROM_SHADOW) {
/* primary video rom always starts here */
start = (loff_t)0xC0000;
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2.6.18] PCI: Turn pci_fixup_video into generic for embedded VGA
2006-09-28 4:55 [PATCH 2.6.18] PCI: Turn pci_fixup_video into generic for embedded VGA eiichiro.oiwa.nm
@ 2006-09-28 11:18 ` Alan Cox
2006-09-28 16:36 ` Jesse Barnes
1 sibling, 0 replies; 7+ messages in thread
From: Alan Cox @ 2006-09-28 11:18 UTC (permalink / raw)
To: eiichiro.oiwa.nm
Cc: akpm, tony.luck, greg, Jesse Barnes, linux-ia64, linux-kernel
Ar Iau, 2006-09-28 am 13:55 +0900, ysgrifennodd
eiichiro.oiwa.nm@hitachi.com:
> pci_fixup_video turns into generic code because there are many platforms need this fixup
> for embedded VGA as well as x86. The Video BIOS integrates into System BIOS on a machine
> has embedded VGA although embedded VGA generally don't have PCI ROM. As a result,
> embedded VGA need the way that the sysfs rom points to the Video BIOS of System
> RAM (0xC0000). PCI-to-PCI Bridge Architecture specification describes the condition whether
> or not PCI ROM forwards VGA compatible memory address. fixup_video suits this specification.
> Although the Video ROM generally implements in x86 code regardless of platform, some
> application such as X Window System can run this code by dosemu86. Therefore,
> pci_fixup_video should turn into generic code.
>
>
> Signed-off-by: Eiichiro Oiwa <eiichiro.oiwa.nm@hitachi.com>
Acked-by: Alan Cox <alan@redhat.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2.6.18] PCI: Turn pci_fixup_video into generic for embedded VGA
2006-09-28 4:55 [PATCH 2.6.18] PCI: Turn pci_fixup_video into generic for embedded VGA eiichiro.oiwa.nm
2006-09-28 11:18 ` Alan Cox
@ 2006-09-28 16:36 ` Jesse Barnes
2006-09-29 2:33 ` eiichiro.oiwa.nm
2007-03-16 17:20 ` Bjorn Helgaas
1 sibling, 2 replies; 7+ messages in thread
From: Jesse Barnes @ 2006-09-28 16:36 UTC (permalink / raw)
To: eiichiro.oiwa.nm
Cc: akpm, tony.luck, greg, Alan Cox, linux-ia64, linux-kernel
On Wednesday, September 27, 2006 9:55 pm, eiichiro.oiwa.nm@hitachi.com
wrote:
> pci_fixup_video turns into generic code because there are many platforms
> need this fixup for embedded VGA as well as x86. The Video BIOS
> integrates into System BIOS on a machine has embedded VGA although
> embedded VGA generally don't have PCI ROM. As a result, embedded VGA
> need the way that the sysfs rom points to the Video BIOS of System RAM
> (0xC0000). PCI-to-PCI Bridge Architecture specification describes the
> condition whether or not PCI ROM forwards VGA compatible memory address.
> fixup_video suits this specification. Although the Video ROM generally
> implements in x86 code regardless of platform, some application such as
> X Window System can run this code by dosemu86. Therefore,
> pci_fixup_video should turn into generic code.
>
>
> Signed-off-by: Eiichiro Oiwa <eiichiro.oiwa.nm@hitachi.com>
> ---
Acked-by: Jesse Barnes <jesse.barnes@intel.com>
Thanks a lot, Eiichiro, this patch has been needed for awhile.
Jesse
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2.6.18] PCI: Turn pci_fixup_video into generic for embedded VGA
2006-09-28 16:36 ` Jesse Barnes
@ 2006-09-29 2:33 ` eiichiro.oiwa.nm
2007-03-16 17:20 ` Bjorn Helgaas
1 sibling, 0 replies; 7+ messages in thread
From: eiichiro.oiwa.nm @ 2006-09-29 2:33 UTC (permalink / raw)
To: Jesse Barnes; +Cc: akpm, tony.luck, greg, Alan Cox, linux-ia64, linux-kernel
>Thanks a lot, Eiichiro, this patch has been needed for awhile.
>
>Jesse
Thank you for advises.
I will close a following defect.
https://bugs.freedesktop.org/show_bug.cgi?id=8221
Thanks,
Eiichiro
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2.6.18] PCI: Turn pci_fixup_video into generic for embedded VGA
2006-09-28 16:36 ` Jesse Barnes
2006-09-29 2:33 ` eiichiro.oiwa.nm
@ 2007-03-16 17:20 ` Bjorn Helgaas
2007-03-16 18:42 ` Jesse Barnes
1 sibling, 1 reply; 7+ messages in thread
From: Bjorn Helgaas @ 2007-03-16 17:20 UTC (permalink / raw)
To: Jesse Barnes
Cc: eiichiro.oiwa.nm, akpm, tony.luck, greg, Alan Cox, linux-ia64,
linux-kernel
On Thursday 28 September 2006 10:36, Jesse Barnes wrote:
> On Wednesday, September 27, 2006 9:55 pm, eiichiro.oiwa.nm@hitachi.com
> wrote:
> > pci_fixup_video turns into generic code because there are many platforms
> > need this fixup for embedded VGA as well as x86. The Video BIOS
> > integrates into System BIOS on a machine has embedded VGA although
> > embedded VGA generally don't have PCI ROM. As a result, embedded VGA
> > need the way that the sysfs rom points to the Video BIOS of System RAM
> > (0xC0000). PCI-to-PCI Bridge Architecture specification describes the
> > condition whether or not PCI ROM forwards VGA compatible memory address.
> > fixup_video suits this specification. Although the Video ROM generally
> > implements in x86 code regardless of platform, some application such as
> > X Window System can run this code by dosemu86. Therefore,
> > pci_fixup_video should turn into generic code.
> ...
> Thanks a lot, Eiichiro, this patch has been needed for awhile.
Are there really ia64 machines where we need to use the option ROM
copy at 0xC0000? If so, is this documented somewhere? I couldn't
find any mention in DIG64, EFI, or internal HP architecture specs.
If we do need to use it, ia64 has a bit of a problem because on some
boxes, the 0xC0000 memory supports only cacheable access, the VGA
frame buffer at 0xA0000 supports only uncacheable access, and the
usual ia64 ioremap mapping is a 16MB page that covers both.
Bjorn
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2.6.18] PCI: Turn pci_fixup_video into generic for embedded VGA
2007-03-16 17:20 ` Bjorn Helgaas
@ 2007-03-16 18:42 ` Jesse Barnes
2007-03-19 3:12 ` eiichiro.oiwa.nm
0 siblings, 1 reply; 7+ messages in thread
From: Jesse Barnes @ 2007-03-16 18:42 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: eiichiro.oiwa.nm, akpm, tony.luck, greg, Alan Cox, linux-ia64,
linux-kernel
On Friday, March 16, 2007 10:20 am Bjorn Helgaas wrote:
> Are there really ia64 machines where we need to use the option ROM
> copy at 0xC0000? If so, is this documented somewhere? I couldn't
> find any mention in DIG64, EFI, or internal HP architecture specs.
>
> If we do need to use it, ia64 has a bit of a problem because on some
> boxes, the 0xC0000 memory supports only cacheable access, the VGA
> frame buffer at 0xA0000 supports only uncacheable access, and the
> usual ia64 ioremap mapping is a 16MB page that covers both.
Apparently Eichiro's machine needs it, and of course there are i386 and
x86_64 machines that need it to, so it makes sense that it be generic.
Jesse
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2.6.18] PCI: Turn pci_fixup_video into generic for embedded VGA
2007-03-16 18:42 ` Jesse Barnes
@ 2007-03-19 3:12 ` eiichiro.oiwa.nm
0 siblings, 0 replies; 7+ messages in thread
From: eiichiro.oiwa.nm @ 2007-03-19 3:12 UTC (permalink / raw)
To: Jesse Barnes
Cc: Bjorn Helgaas, akpm, tony.luck, greg, Alan Cox, linux-ia64, linux-kernel
>On Friday, March 16, 2007 10:20 am Bjorn Helgaas wrote:
>> Are there really ia64 machines where we need to use the option ROM
>> copy at 0xC0000? If so, is this documented somewhere? I couldn't
>> find any mention in DIG64, EFI, or internal HP architecture specs.
>>
>> If we do need to use it, ia64 has a bit of a problem because on some
>> boxes, the 0xC0000 memory supports only cacheable access, the VGA
>> frame buffer at 0xA0000 supports only uncacheable access, and the
>> usual ia64 ioremap mapping is a 16MB page that covers both.
>
>Apparently Eichiro's machine needs it, and of course there are i386 and
>x86_64 machines that need it to, so it makes sense that it be generic.
>
>Jesse
>
Yes, our machine need it.
>> Are there really ia64 machines where we need to use the option ROM
>> copy at 0xC0000? If so, is this documented somewhere? I couldn't
>> find any mention in DIG64, EFI, or internal HP architecture specs.
"System Abstraction Layer Specification" describes it in section 2.6.
Eiichiro
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2007-03-19 3:17 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-28 4:55 [PATCH 2.6.18] PCI: Turn pci_fixup_video into generic for embedded VGA eiichiro.oiwa.nm
2006-09-28 11:18 ` Alan Cox
2006-09-28 16:36 ` Jesse Barnes
2006-09-29 2:33 ` eiichiro.oiwa.nm
2007-03-16 17:20 ` Bjorn Helgaas
2007-03-16 18:42 ` Jesse Barnes
2007-03-19 3:12 ` eiichiro.oiwa.nm
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).