Port-xen archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

PCI_ADDR_FIXUP



hi,

I'm using Dell PowerEdge T105 with netbsd-5/amd64. with GENERIC kernel,
wd at viaide0 is not attached. (viaide0: couldn't map sata regs)
"options PCI_ADDR_FIXUP" (and PCI_BUS_FIXUP) fixes this problem.

now, I'm try to set up xen33 environment on T105. XEN3_DOM0 kernel has
same problem, but "options PCI_ADDR_FIXUP" has no effect.

following changes fix my problem. is it correct fix?

Index: sys/arch/xen/conf/files.xen
===================================================================
RCS file: /home/fun/cvsroot/NetBSD/src/sys/arch/xen/conf/files.xen,v
retrieving revision 1.88
diff -u -p -r1.88 files.xen
--- sys/arch/xen/conf/files.xen 3 Aug 2008 19:32:03 -0000       1.88
+++ sys/arch/xen/conf/files.xen 2 Jan 2009 17:15:06 -0000
@@ -254,10 +254,8 @@ file       arch/x86/x86/i8259.c            xen3
 # MP configuration using Intel SMP specification 1.4
 file   arch/x86/x86/mpbios.c           mpbios
 
-ifdef i386
-file   arch/i386/pci/pci_bus_fixup.c   pci_bus_fixup
-file   arch/i386/pci/pci_addr_fixup.c  pci_addr_fixup
-endif
+file   arch/x86/pci/pci_bus_fixup.c    pci_bus_fixup
+file   arch/x86/pci/pci_addr_fixup.c   pci_addr_fixup
 
 file   arch/x86/x86/apic.c             ioapic
 
Index: sys/arch/xen/x86/mainbus.c
===================================================================
RCS file: /home/fun/cvsroot/NetBSD/src/sys/arch/xen/x86/mainbus.c,v
retrieving revision 1.5
diff -u -p -r1.5 mainbus.c
--- sys/arch/xen/x86/mainbus.c  21 Oct 2008 15:46:32 -0000      1.5
+++ sys/arch/xen/x86/mainbus.c  2 Jan 2009 17:21:42 -0000
@@ -45,6 +45,7 @@ __KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 
 
 #include "opt_xen.h"
 #include "opt_mpbios.h"
+#include "opt_pcifixup.h"
 
 #include "acpi.h"
 #include "ioapic.h"
@@ -71,6 +72,12 @@ __KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 
 #ifdef MPBIOS
 #include <machine/mpbiosvar.h>       
 #endif /* MPBIOS */
+#ifdef PCI_BUS_FIXUP
+#include <arch/x86/pci/pci_bus_fixup.h>
+#ifdef PCI_ADDR_FIXUP
+#include <arch/x86/pci/pci_addr_fixup.h>
+#endif  
+#endif
 
 #if defined(MPBIOS) || NACPI > 0
 struct mp_bus *mp_busses;
@@ -136,6 +143,9 @@ mainbus_attach(device_t parent, device_t
 #if NACPI > 0 || defined(MPBIOS)
        int numioapics = 0;     
 #endif
+#ifdef PCI_BUS_FIXUP
+       int pci_maxbus = 0;
+#endif
 #endif /* defined(DOM0OPS) && defined(XEN3) */
 
        aprint_naive("\n");
@@ -157,14 +167,16 @@ mainbus_attach(device_t parent, device_t
                /* ACPI needs to be able to access PCI configuration space. */
                pci_mode = pci_mode_detect();
 #ifdef PCI_BUS_FIXUP
-               pci_maxbus = pci_bus_fixup(NULL, 0);
-               aprint_debug_dev(self, "PCI bus max, after pci_bus_fixup: %i\n",
-                   pci_maxbus);
+               if (pci_mode != 0) {
+                       pci_maxbus = pci_bus_fixup(NULL, 0);
+                       aprint_debug_dev(self, "PCI bus max, after "
+                           "pci_bus_fixup: %i\n", pci_maxbus);
 #ifdef PCI_ADDR_FIXUP
-               pciaddr.extent_port = NULL;
-               pciaddr.extent_mem = NULL;
-               pci_addr_fixup(NULL, pci_maxbus);
+                       pciaddr.extent_port = NULL;
+                       pciaddr.extent_mem = NULL;
+                       pci_addr_fixup(NULL, pci_maxbus);
 #endif /* PCI_ADDR_FIXUP */
+               }
 #endif /* PCI_BUS_FIXUP */
 #if NACPI > 0
                acpi_present = acpi_probe();
Index: sys/arch/xen/xen/hypervisor.c
===================================================================
RCS file: /home/fun/cvsroot/NetBSD/src/sys/arch/xen/xen/hypervisor.c,v
retrieving revision 1.42
diff -u -p -r1.42 hypervisor.c
--- sys/arch/xen/xen/hypervisor.c       24 Oct 2008 21:09:24 -0000      1.42
+++ sys/arch/xen/xen/hypervisor.c       2 Jan 2009 17:15:06 -0000
@@ -125,12 +125,6 @@ __KERNEL_RCSID(0, "$NetBSD: hypervisor.c
 #ifdef MPBIOS
 #include <machine/mpbiosvar.h>       
 #endif
-#ifdef PCI_BUS_FIXUP
-#include <arch/i386/pci/pci_bus_fixup.h>
-#ifdef PCI_ADDR_FIXUP
-#include <arch/i386/pci/pci_addr_fixup.h>
-#endif  
-#endif
 #endif /* NPCI */
 
 #if NXENBUS > 0
@@ -243,9 +237,6 @@ hypervisor_attach(device_t parent, devic
        int i, j, busnum;
 #endif
 
-#ifdef PCI_BUS_FIXUP
-       int pci_maxbus = 0;
-#endif
 #endif /* NPCI */
        union hypervisor_attach_cookie hac;
 

--
FUKAUMI Naoki


Home | Main Index | Thread Index | Old Index