All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stuart Brady <sdbrady@ntlworld.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] Add and use remaining #defines for PCI device IDs
Date: Sun, 1 Mar 2009 17:01:20 +0000	[thread overview]
Message-ID: <20090301170120.GA666@miranda.arrow> (raw)

This patch adds and uses #defines for the remaining hardcoded PCI
device IDs.  It also marks in hw/pci.h those IDs that have not been
taken from linux/pci_ids.h, and removes the 'RTL' from
PCI_DEVICE_ID_REALTEK_RTL8029.

Signed-off-by: Stuart Brady <stuart.brady@gmail.com>

Index: hw/sh_pci.c
===================================================================
--- hw/sh_pci.c	(revision 6657)
+++ hw/sh_pci.c	(working copy)
@@ -189,7 +189,7 @@
     cpu_register_physical_memory(0xfd000000, 0x1000000, mem);
 
     pci_config_set_vendor_id(p->dev->config, PCI_VENDOR_ID_HITACHI);
-    pci_config_set_device_id(p->dev->config, 0x350e); // SH7751R
+    pci_config_set_device_id(p->dev->config, PCI_DEVICE_ID_HITACHI_SH7751R);
     p->dev->config[0x04] = 0x80;
     p->dev->config[0x05] = 0x00;
     p->dev->config[0x06] = 0x90;
Index: hw/usb-ohci.c
===================================================================
--- hw/usb-ohci.c	(revision 6657)
+++ hw/usb-ohci.c	(working copy)
@@ -1680,7 +1680,8 @@
     }
 
     pci_config_set_vendor_id(ohci->pci_dev.config, PCI_VENDOR_ID_APPLE);
-    pci_config_set_device_id(ohci->pci_dev.config, 0x003f); // device_id
+    pci_config_set_device_id(ohci->pci_dev.config,
+                             PCI_DEVICE_ID_APPLE_IPID_USB);
     ohci->pci_dev.config[0x09] = 0x10; /* OHCI */
     pci_config_set_class(ohci->pci_dev.config, PCI_CLASS_SERIAL_USB);
     ohci->pci_dev.config[0x3d] = 0x01; /* interrupt pin 1 */
Index: hw/pci.h
===================================================================
--- hw/pci.h	(revision 6657)
+++ hw/pci.h	(working copy)
@@ -54,23 +54,26 @@
 #define PCI_VENDOR_ID_CIRRUS             0x1013
 
 #define PCI_VENDOR_ID_IBM                0x1014
-#define PCI_DEVICE_ID_IBM_OPENPIC2       0xffff
+#define PCI_DEVICE_ID_IBM_440GX          0x027f // *
+#define PCI_DEVICE_ID_IBM_OPENPIC2       0xffff // *
 
 #define PCI_VENDOR_ID_AMD                0x1022
 #define PCI_DEVICE_ID_AMD_LANCE          0x2000
 
-#define PCI_VENDOR_ID_HITACHI            0x1054
+#define PCI_VENDOR_ID_HITACHI            0x1054 // *
+#define PCI_DEVICE_ID_HITACHI_SH7751R    0x350e // *
 
 #define PCI_VENDOR_ID_MOTOROLA           0x1057
 #define PCI_DEVICE_ID_MOTOROLA_MPC106    0x0002
 #define PCI_DEVICE_ID_MOTOROLA_RAVEN     0x4801
 
 #define PCI_VENDOR_ID_APPLE              0x106b
-#define PCI_DEVICE_ID_APPLE_343S1201     0x0010
-#define PCI_DEVICE_ID_APPLE_UNI_N_I_PCI  0x001e
-#define PCI_DEVICE_ID_APPLE_UNI_N_PCI    0x001f
+#define PCI_DEVICE_ID_APPLE_343S1201     0x0010 // *
+#define PCI_DEVICE_ID_APPLE_UNI_N_I_PCI  0x001e // *
+#define PCI_DEVICE_ID_APPLE_UNI_N_PCI    0x001f // *
 #define PCI_DEVICE_ID_APPLE_UNI_N_AGP    0x0020
-#define PCI_DEVICE_ID_APPLE_UNI_N_KEYL   0x0022
+#define PCI_DEVICE_ID_APPLE_UNI_N_KEYL   0x0022 // *
+#define PCI_DEVICE_ID_APPLE_IPID_USB     0x003f // *
 
 #define PCI_VENDOR_ID_SUN                0x108e
 #define PCI_DEVICE_ID_SUN_EBUS           0x1000
@@ -81,27 +84,30 @@
 #define PCI_DEVICE_ID_CMD_646            0x0646
 
 #define PCI_VENDOR_ID_REALTEK            0x10ec
-#define PCI_DEVICE_ID_REALTEK_RTL8029    0x8029
+#define PCI_DEVICE_ID_REALTEK_8029       0x8029 // *
 #define PCI_DEVICE_ID_REALTEK_8139       0x8139
 
 #define PCI_VENDOR_ID_XILINX             0x10ee
+#define PCI_DEVICE_ID_XILINX_XC2VP30     0x0300 // *
 
 #define PCI_VENDOR_ID_MARVELL            0x11ab
+#define PCI_DEVICE_ID_MARVELL_GT6412X    0x4620 // *
 
-#define PCI_VENDOR_ID_QEMU               0x1234
-#define PCI_DEVICE_ID_QEMU_VGA           0x1111
+#define PCI_VENDOR_ID_QEMU               0x1234 // *
+#define PCI_DEVICE_ID_QEMU_VGA           0x1111 // *
 
 #define PCI_VENDOR_ID_ENSONIQ            0x1274
 #define PCI_DEVICE_ID_ENSONIQ_ES1370     0x5000
 
-#define PCI_VENDOR_ID_VMWARE             0x15ad
-#define PCI_DEVICE_ID_VMWARE_SVGA2       0x0405
-#define PCI_DEVICE_ID_VMWARE_SVGA        0x0710
-#define PCI_DEVICE_ID_VMWARE_NET         0x0720
-#define PCI_DEVICE_ID_VMWARE_SCSI        0x0730
-#define PCI_DEVICE_ID_VMWARE_IDE         0x1729
+#define PCI_VENDOR_ID_VMWARE             0x15ad // *
+#define PCI_DEVICE_ID_VMWARE_SVGA2       0x0405 // *
+#define PCI_DEVICE_ID_VMWARE_SVGA        0x0710 // *
+#define PCI_DEVICE_ID_VMWARE_NET         0x0720 // *
+#define PCI_DEVICE_ID_VMWARE_SCSI        0x0730 // *
+#define PCI_DEVICE_ID_VMWARE_IDE         0x1729 // *
 
 #define PCI_VENDOR_ID_INTEL              0x8086
+#define PCI_DEVICE_ID_INTEL_82551IT      0x1209 // *
 #define PCI_DEVICE_ID_INTEL_82441        0x1237
 #define PCI_DEVICE_ID_INTEL_82801AA_5    0x2415
 #define PCI_DEVICE_ID_INTEL_82371SB_0    0x7000
@@ -112,6 +118,8 @@
 #define PCI_DEVICE_ID_INTEL_82371AB_2    0x7112
 #define PCI_DEVICE_ID_INTEL_82371AB_3    0x7113
 
+// * = not in linux/pci_ids.h
+
 /* Red Hat / Qumranet (for QEMU) -- see pci-ids.txt */
 #define PCI_VENDOR_ID_REDHAT_QUMRANET    0x1af4
 #define PCI_SUBVENDOR_ID_REDHAT_QUMRANET 0x1af4
Index: hw/eepro100.c
===================================================================
--- hw/eepro100.c	(revision 6657)
+++ hw/eepro100.c	(working copy)
@@ -424,7 +424,7 @@
     /* PCI Vendor ID */
     pci_config_set_vendor_id(pci_conf, PCI_VENDOR_ID_INTEL);
     /* PCI Device ID */
-    pci_config_set_device_id(pci_conf, 0x1209);
+    pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_INTEL_82551IT);
     /* PCI Command */
     PCI_CONFIG_16(PCI_COMMAND, 0x0000);
     /* PCI Status */
Index: hw/ne2000.c
===================================================================
--- hw/ne2000.c	(revision 6657)
+++ hw/ne2000.c	(working copy)
@@ -789,7 +789,7 @@
                                               NULL, NULL);
     pci_conf = d->dev.config;
     pci_config_set_vendor_id(pci_conf, PCI_VENDOR_ID_REALTEK);
-    pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_REALTEK_RTL8029);
+    pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_REALTEK_8029);
     pci_config_set_class(pci_conf, PCI_CLASS_NETWORK_ETHERNET);
     pci_conf[0x0e] = 0x00; // header_type
     pci_conf[0x3d] = 1; // interrupt pin 0
Index: hw/versatile_pci.c
===================================================================
--- hw/versatile_pci.c	(revision 6657)
+++ hw/versatile_pci.c	(working copy)
@@ -126,7 +126,7 @@
 
     pci_config_set_vendor_id(d->config, PCI_VENDOR_ID_XILINX);
     /* Both boards have the same device ID.  Oh well.  */
-    pci_config_set_device_id(d->config, 0x0300); // device_id
+    pci_config_set_device_id(d->config, PCI_DEVICE_ID_XILINX_XC2VP30);
     d->config[0x04] = 0x00;
     d->config[0x05] = 0x00;
     d->config[0x06] = 0x20;
Index: hw/ppc4xx_pci.c
===================================================================
--- hw/ppc4xx_pci.c	(revision 6657)
+++ hw/ppc4xx_pci.c	(working copy)
@@ -379,7 +379,7 @@
                                               0, NULL, NULL);
     pci_conf = controller->pci_dev->config;
     pci_config_set_vendor_id(pci_conf, PCI_VENDOR_ID_IBM);
-    pci_config_set_device_id(pci_conf, 0x027f); // device_id
+    pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_IBM_440GX);
     pci_config_set_class(pci_conf, PCI_CLASS_BRIDGE_OTHER);
 
     /* CFGADDR */
Index: hw/gt64xxx.c
===================================================================
--- hw/gt64xxx.c	(revision 6657)
+++ hw/gt64xxx.c	(working copy)
@@ -1137,7 +1137,7 @@
     /* FIXME: Malta specific hw assumptions ahead */
 
     pci_config_set_vendor_id(d->config, PCI_VENDOR_ID_MARVELL);
-    pci_config_set_device_id(d->config, 0x4620); /* device_id */
+    pci_config_set_device_id(d->config, PCI_DEVICE_ID_MARVELL_GT6412X);
 
     d->config[0x04] = 0x00;
     d->config[0x05] = 0x00;
-- 
Stuart Brady

             reply	other threads:[~2009-03-01 17:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-01 17:01 Stuart Brady [this message]
2009-03-01 20:28 ` [Qemu-devel] [PATCH] Add and use remaining #defines for PCI device IDs Paul Brook
2009-03-06 20:38 ` Anthony Liguori
2009-03-07 13:39   ` Stuart Brady

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=20090301170120.GA666@miranda.arrow \
    --to=sdbrady@ntlworld.com \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.