From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LiA4g-0008QF-9p for qemu-devel@nongnu.org; Fri, 13 Mar 2009 12:17:30 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LiA4b-0008Oq-1d for qemu-devel@nongnu.org; Fri, 13 Mar 2009 12:17:29 -0400 Received: from [199.232.76.173] (port=36212 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LiA4a-0008Of-Mv for qemu-devel@nongnu.org; Fri, 13 Mar 2009 12:17:24 -0400 Received: from moutng.kundenserver.de ([212.227.126.171]:59069) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LiA4Y-0001uC-UX for qemu-devel@nongnu.org; Fri, 13 Mar 2009 12:17:24 -0400 Message-ID: <49BA8707.9050603@mail.berlios.de> Date: Fri, 13 Mar 2009 17:17:11 +0100 From: Stefan Weil MIME-Version: 1.0 Subject: Re: [Qemu-devel] [6841] Add and use remaining #defines for PCI device IDs (Stuart Brady) References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, Anthony Liguori Anthony Liguori schrieb: > Revision: 6841 > http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6841 > Author: aliguori > Date: 2009-03-13 15:02:23 +0000 (Fri, 13 Mar 2009) > Log Message: > ----------- > Add and use remaining #defines for PCI device IDs (Stuart Brady) > > This patch adds and uses #defines for the remaining hardcoded PCI > device IDs. It also moves definitions taken from linux/pci_ids.h > into a separate header (hw/pci_ids.h), removes the 'RTL' from > PCI_DEVICE_ID_REALTEK_RTL8029, and renames PCI_DEVICE_ID_FSL_E500 > to PCI_DEVICE_ID_MPC8533E to match Linux's definition. > > Changes in v2: > * Don't use C99-style comments > * Move definitions from linux/pci_ids.h into a separate header > * Rename PCI_DEVICE_ID_FSL_E500 to PCI_DEVICE_ID_MPC8533E > > Signed-off-by: Stuart Brady > Signed-off-by: Anthony Liguori > > Modified Paths: > -------------- > trunk/hw/eepro100.c > trunk/hw/gt64xxx.c > trunk/hw/ne2000.c > trunk/hw/pci.h > trunk/hw/ppc4xx_pci.c > trunk/hw/ppce500_pci.c > trunk/hw/sh_pci.c > trunk/hw/usb-ohci.c > trunk/hw/versatile_pci.c > > Modified: trunk/hw/eepro100.c > =================================================================== > --- trunk/hw/eepro100.c 2009-03-13 15:02:18 UTC (rev 6840) > +++ trunk/hw/eepro100.c 2009-03-13 15:02:23 UTC (rev 6841) > @@ -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 */ > > Modified: trunk/hw/gt64xxx.c > =================================================================== > --- trunk/hw/gt64xxx.c 2009-03-13 15:02:18 UTC (rev 6840) > +++ trunk/hw/gt64xxx.c 2009-03-13 15:02:23 UTC (rev 6841) > @@ -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; > > Modified: trunk/hw/ne2000.c > =================================================================== > --- trunk/hw/ne2000.c 2009-03-13 15:02:18 UTC (rev 6840) > +++ trunk/hw/ne2000.c 2009-03-13 15:02:23 UTC (rev 6841) > @@ -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 > > Modified: trunk/hw/pci.h > =================================================================== > --- trunk/hw/pci.h 2009-03-13 15:02:18 UTC (rev 6840) > +++ trunk/hw/pci.h 2009-03-13 15:02:23 UTC (rev 6841) > @@ -14,89 +14,40 @@ > #define PCI_SLOT(devfn) (((devfn) >> 3) & 0x1f) > #define PCI_FUNC(devfn) ((devfn) & 0x07) > > -/* Device classes and subclasses */ > +/* Class, Vendor and Device IDs from Linux's pci_ids.h */ > +#include "pci_ids.h" > > -#define PCI_BASE_CLASS_STORAGE 0x01 > -#define PCI_BASE_CLASS_NETWORK 0x02 > +/* QEMU-specific Vendor and Device ID definitions */ > > -#define PCI_CLASS_STORAGE_SCSI 0x0100 > -#define PCI_CLASS_STORAGE_IDE 0x0101 > -#define PCI_CLASS_STORAGE_OTHER 0x0180 > - > -#define PCI_CLASS_NETWORK_ETHERNET 0x0200 > - > -#define PCI_CLASS_DISPLAY_VGA 0x0300 > -#define PCI_CLASS_DISPLAY_OTHER 0x0380 > - > -#define PCI_CLASS_MULTIMEDIA_AUDIO 0x0401 > - > -#define PCI_CLASS_MEMORY_RAM 0x0500 > - > -#define PCI_CLASS_SYSTEM_OTHER 0x0880 > - > -#define PCI_CLASS_SERIAL_USB 0x0c03 > - > -#define PCI_CLASS_BRIDGE_HOST 0x0600 > -#define PCI_CLASS_BRIDGE_ISA 0x0601 > -#define PCI_CLASS_BRIDGE_PCI 0x0604 > -#define PCI_CLASS_BRIDGE_OTHER 0x0680 > - > -#define PCI_CLASS_PROCESSOR_CO 0x0b40 > -#define PCI_CLASS_PROCESSOR_POWERPC 0x0b20 > - > -#define PCI_CLASS_OTHERS 0xff > - > -/* Vendors and devices. */ > - > -#define PCI_VENDOR_ID_LSI_LOGIC 0x1000 > -#define PCI_DEVICE_ID_LSI_53C895A 0x0012 > - > -#define PCI_VENDOR_ID_DEC 0x1011 > -#define PCI_DEVICE_ID_DEC_21154 0x0026 > - > -#define PCI_VENDOR_ID_CIRRUS 0x1013 > - > -#define PCI_VENDOR_ID_IBM 0x1014 > +/* IBM (0x1014) */ > +#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 > - > +/* 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 > +/* 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_UNI_N_AGP 0x0020 > #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 > -#define PCI_DEVICE_ID_SUN_SIMBA 0x5000 > -#define PCI_DEVICE_ID_SUN_SABRE 0xa000 > +/* Realtek (0x10ec) */ > +#define PCI_DEVICE_ID_REALTEK_8029 0x8029 > > -#define PCI_VENDOR_ID_CMD 0x1095 > -#define PCI_DEVICE_ID_CMD_646 0x0646 > +/* Xilinx (0x10ee) */ > +#define PCI_DEVICE_ID_XILINX_XC2VP30 0x0300 > > -#define PCI_VENDOR_ID_REALTEK 0x10ec > -#define PCI_DEVICE_ID_REALTEK_RTL8029 0x8029 > -#define PCI_DEVICE_ID_REALTEK_8139 0x8139 > +/* Marvell (0x11ab) */ > +#define PCI_DEVICE_ID_MARVELL_GT6412X 0x4620 > > -#define PCI_VENDOR_ID_XILINX 0x10ee > - > -#define PCI_VENDOR_ID_MARVELL 0x11ab > - > +/* QEMU/Bochs VGA (0x1234) */ > #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 > - > +/* VMWare (0x15ad) */ > #define PCI_VENDOR_ID_VMWARE 0x15ad > #define PCI_DEVICE_ID_VMWARE_SVGA2 0x0405 > #define PCI_DEVICE_ID_VMWARE_SVGA 0x0710 > @@ -105,19 +56,8 @@ > #define PCI_DEVICE_ID_VMWARE_IDE 0x1729 > > #define PCI_VENDOR_ID_INTEL 0x8086 > -#define PCI_DEVICE_ID_INTEL_82441 0x1237 > -#define PCI_DEVICE_ID_INTEL_82801AA_5 0x2415 > -#define PCI_DEVICE_ID_INTEL_82371SB_0 0x7000 > -#define PCI_DEVICE_ID_INTEL_82371SB_1 0x7010 > -#define PCI_DEVICE_ID_INTEL_82371SB_2 0x7020 > -#define PCI_DEVICE_ID_INTEL_82371AB_0 0x7110 > -#define PCI_DEVICE_ID_INTEL_82371AB 0x7111 > -#define PCI_DEVICE_ID_INTEL_82371AB_2 0x7112 > -#define PCI_DEVICE_ID_INTEL_82371AB_3 0x7113 > +#define PCI_DEVICE_ID_INTEL_82551IT 0x1209 > > -#define PCI_VENDOR_ID_FSL 0x1957 > -#define PCI_DEVICE_ID_FSL_E500 0x0030 > - > /* Red Hat / Qumranet (for QEMU) -- see pci-ids.txt */ > #define PCI_VENDOR_ID_REDHAT_QUMRANET 0x1af4 > #define PCI_SUBVENDOR_ID_REDHAT_QUMRANET 0x1af4 > > Modified: trunk/hw/ppc4xx_pci.c > =================================================================== > --- trunk/hw/ppc4xx_pci.c 2009-03-13 15:02:18 UTC (rev 6840) > +++ trunk/hw/ppc4xx_pci.c 2009-03-13 15:02:23 UTC (rev 6841) > @@ -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 */ > > Modified: trunk/hw/ppce500_pci.c > =================================================================== > --- trunk/hw/ppce500_pci.c 2009-03-13 15:02:18 UTC (rev 6840) > +++ trunk/hw/ppce500_pci.c 2009-03-13 15:02:23 UTC (rev 6841) > @@ -324,8 +324,8 @@ > "host bridge", sizeof(PCIDevice), > 0, NULL, NULL); > > - pci_config_set_vendor_id(d->config, PCI_VENDOR_ID_FSL); > - pci_config_set_device_id(d->config, PCI_DEVICE_ID_FSL_E500); > + pci_config_set_vendor_id(d->config, PCI_VENDOR_ID_FREESCALE); > + pci_config_set_device_id(d->config, PCI_DEVICE_ID_MPC8533E); > pci_config_set_class(d->config, PCI_CLASS_PROCESSOR_POWERPC); > > controller->pci_dev = d; > > Modified: trunk/hw/sh_pci.c > =================================================================== > --- trunk/hw/sh_pci.c 2009-03-13 15:02:18 UTC (rev 6840) > +++ trunk/hw/sh_pci.c 2009-03-13 15:02:23 UTC (rev 6841) > @@ -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; > > Modified: trunk/hw/usb-ohci.c > =================================================================== > --- trunk/hw/usb-ohci.c 2009-03-13 15:02:18 UTC (rev 6840) > +++ trunk/hw/usb-ohci.c 2009-03-13 15:02:23 UTC (rev 6841) > @@ -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 */ > > Modified: trunk/hw/versatile_pci.c > =================================================================== > --- trunk/hw/versatile_pci.c 2009-03-13 15:02:18 UTC (rev 6840) > +++ trunk/hw/versatile_pci.c 2009-03-13 15:02:23 UTC (rev 6841) > @@ -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; > > > pci_ids.h is missing. Regards Stefan Weil