[BACK]Return to pci_machdep.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / arch / x86 / pci

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/sys/arch/x86/pci/pci_machdep.c between version 1.54.8.1 and 1.55

version 1.54.8.1, 2013/10/20 13:18:50 version 1.55, 2012/02/28 18:14:47
Line 69 
Line 69 
  *   *
  * The configuration method can be hard-coded in the config file by   * The configuration method can be hard-coded in the config file by
  * using `options PCI_CONF_MODE=N', where `N' is the configuration mode   * using `options PCI_CONF_MODE=N', where `N' is the configuration mode
  * as defined section 3.6.4.1, `Generating Configuration Cycles'.   * as defined in section 3.6.4.1, `Generating Configuration Cycles'.
  */   */
   
 #include <sys/cdefs.h>  #include <sys/cdefs.h>
Line 163  static void pci_conf_select(uint32_t);
Line 163  static void pci_conf_select(uint32_t);
 static void pci_conf_lock(struct pci_conf_lock *, uint32_t);  static void pci_conf_lock(struct pci_conf_lock *, uint32_t);
 static void pci_bridge_hook(pci_chipset_tag_t, pcitag_t, void *);  static void pci_bridge_hook(pci_chipset_tag_t, pcitag_t, void *);
 struct pci_bridge_hook_arg {  struct pci_bridge_hook_arg {
         void (*func)(pci_chipset_tag_t, pcitag_t, void *);          void (*func)(pci_chipset_tag_t, pcitag_t, void *);
         void *arg;          void *arg;
 };  };
   
 #define PCI_MODE1_ENABLE        0x80000000UL  #define PCI_MODE1_ENABLE        0x80000000UL
 #define PCI_MODE1_ADDRESS_REG   0x0cf8  #define PCI_MODE1_ADDRESS_REG   0x0cf8
Line 522  pci_mode_detect(void)
Line 522  pci_mode_detect(void)
         uint32_t sav, val;          uint32_t sav, val;
         int i;          int i;
         pcireg_t idreg;          pcireg_t idreg;
         extern char cpu_brand_string[];  
   
         if (pci_mode != -1)          if (pci_mode != -1)
                 return pci_mode;                  return pci_mode;
Line 552  pci_mode_detect(void)
Line 551  pci_mode_detect(void)
                         return (pci_mode);                          return (pci_mode);
                 }                  }
         }          }
         if (memcmp(cpu_brand_string, "QEMU", 4) == 0) {  
                 /* PR 45671, https://bugs.launchpad.net/qemu/+bug/897771 */  
 #ifdef DEBUG  
                 printf("forcing PCI mode 1 for QEMU\n");  
 #endif  
                 return (pci_mode);  
         }  
   
         /*          /*
          * Strong check for standard compliant mode 1:           * Strong check for standard compliant mode 1:
Line 684  pci_device_foreach_min(pci_chipset_tag_t
Line 676  pci_device_foreach_min(pci_chipset_tag_t
                         bhlcr = pci_conf_read(pc, tag, PCI_BHLC_REG);                          bhlcr = pci_conf_read(pc, tag, PCI_BHLC_REG);
                         if (PCI_HDRTYPE_MULTIFN(bhlcr) ||                          if (PCI_HDRTYPE_MULTIFN(bhlcr) ||
                              (qd != NULL &&                               (qd != NULL &&
                              (qd->quirks & PCI_QUIRK_MULTIFUNCTION) != 0))                               (qd->quirks & PCI_QUIRK_MULTIFUNCTION) != 0))
                                 nfuncs = 8;                                  nfuncs = 8;
                         else                          else
                                 nfuncs = 1;                                  nfuncs = 1;
Line 715  pci_bridge_foreach(pci_chipset_tag_t pc,
Line 707  pci_bridge_foreach(pci_chipset_tag_t pc,
         struct pci_bridge_hook_arg bridge_hook;          struct pci_bridge_hook_arg bridge_hook;
   
         bridge_hook.func = func;          bridge_hook.func = func;
         bridge_hook.arg = ctx;          bridge_hook.arg = ctx;
   
         pci_device_foreach_min(pc, minbus, maxbus, pci_bridge_hook,          pci_device_foreach_min(pc, minbus, maxbus, pci_bridge_hook,
                 &bridge_hook);                  &bridge_hook);
 }  }
   
 static void  static void
Line 729  pci_bridge_hook(pci_chipset_tag_t pc, pc
Line 721  pci_bridge_hook(pci_chipset_tag_t pc, pc
   
         reg = pci_conf_read(pc, tag, PCI_CLASS_REG);          reg = pci_conf_read(pc, tag, PCI_CLASS_REG);
         if (PCI_CLASS(reg) == PCI_CLASS_BRIDGE &&          if (PCI_CLASS(reg) == PCI_CLASS_BRIDGE &&
              (PCI_SUBCLASS(reg) == PCI_SUBCLASS_BRIDGE_PCI ||              (PCI_SUBCLASS(reg) == PCI_SUBCLASS_BRIDGE_PCI ||
                 PCI_SUBCLASS(reg) == PCI_SUBCLASS_BRIDGE_CARDBUS)) {                  PCI_SUBCLASS(reg) == PCI_SUBCLASS_BRIDGE_CARDBUS)) {
                 (*bridge_hook->func)(pc, tag, bridge_hook->arg);                  (*bridge_hook->func)(pc, tag, bridge_hook->arg);
         }          }
Line 892  device_pci_register(device_t dev, void *
Line 884  device_pci_register(device_t dev, void *
                  * passed by the boot ROM.  The ROM should stay usable if                   * passed by the boot ROM.  The ROM should stay usable if
                  * the driver becomes obsolete.  The physical attachment                   * the driver becomes obsolete.  The physical attachment
                  * information (checked below) must be sufficient to                   * information (checked below) must be sufficient to
                  * idenfity the device.                   * identify the device.
                  */                   */
                 if (bin->bus == BI_BUS_PCI &&                  if (bin->bus == BI_BUS_PCI &&
                     device_is_a(device_parent(dev), "pci")) {                      device_is_a(device_parent(dev), "pci")) {
Line 959  device_pci_register(device_t dev, void *
Line 951  device_pci_register(device_t dev, void *
 #endif  #endif
                                 if (fbinfo->depth == 8) {                                  if (fbinfo->depth == 8) {
                                         gfb_cb.gcc_cookie = NULL;                                          gfb_cb.gcc_cookie = NULL;
                                         gfb_cb.gcc_set_mapreg =                                          gfb_cb.gcc_set_mapreg =
                                             x86_genfb_set_mapreg;                                              x86_genfb_set_mapreg;
                                         prop_dictionary_set_uint64(dict,                                          prop_dictionary_set_uint64(dict,
                                             "cmap_callback",                                              "cmap_callback",

Legend:
Removed from v.1.54.8.1  
changed lines
  Added in v.1.55

CVSweb <webmaster@jp.NetBSD.org>