From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LRtPK-0004ED-UW for qemu-devel@nongnu.org; Tue, 27 Jan 2009 14:15:35 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LRtPK-0004DQ-8o for qemu-devel@nongnu.org; Tue, 27 Jan 2009 14:15:34 -0500 Received: from [199.232.76.173] (port=49894 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LRtPJ-0004DD-Vm for qemu-devel@nongnu.org; Tue, 27 Jan 2009 14:15:34 -0500 Received: from savannah.gnu.org ([199.232.41.3]:45346 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LRtPJ-0004fe-LY for qemu-devel@nongnu.org; Tue, 27 Jan 2009 14:15:33 -0500 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1LRtPI-0006IV-TV for qemu-devel@nongnu.org; Tue, 27 Jan 2009 19:15:33 +0000 Received: from blueswir1 by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1LRtPI-0006IQ-Eh for qemu-devel@nongnu.org; Tue, 27 Jan 2009 19:15:32 +0000 MIME-Version: 1.0 Errors-To: blueswir1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Blue Swirl Message-Id: Date: Tue, 27 Jan 2009 19:15:32 +0000 Subject: [Qemu-devel] [6465] Add Simba device ID 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 Revision: 6465 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6465 Author: blueswir1 Date: 2009-01-27 19:15:31 +0000 (Tue, 27 Jan 2009) Log Message: ----------- Add Simba device ID Modified Paths: -------------- trunk/hw/apb_pci.c trunk/hw/pci.c trunk/hw/pci.h Modified: trunk/hw/apb_pci.c =================================================================== --- trunk/hw/apb_pci.c 2009-01-27 14:29:15 UTC (rev 6464) +++ trunk/hw/apb_pci.c 2009-01-27 19:15:31 UTC (rev 6465) @@ -266,9 +266,11 @@ d->config[0x0E] = 0x00; // header_type /* APB secondary busses */ - *bus2 = pci_bridge_init(s->bus, 8, 0x108e5000, pci_apb_map_irq, + *bus2 = pci_bridge_init(s->bus, 8, PCI_VENDOR_ID_SUN, + PCI_DEVICE_ID_SUN_SIMBA, pci_apb_map_irq, "Advanced PCI Bus secondary bridge 1"); - *bus3 = pci_bridge_init(s->bus, 9, 0x108e5000, pci_apb_map_irq, + *bus3 = pci_bridge_init(s->bus, 9, PCI_VENDOR_ID_SUN, + PCI_DEVICE_ID_SUN_SIMBA, pci_apb_map_irq, "Advanced PCI Bus secondary bridge 2"); return s->bus; } Modified: trunk/hw/pci.c =================================================================== --- trunk/hw/pci.c 2009-01-27 14:29:15 UTC (rev 6464) +++ trunk/hw/pci.c 2009-01-27 19:15:31 UTC (rev 6465) @@ -713,16 +713,16 @@ pci_default_write_config(d, address, val, len); } -PCIBus *pci_bridge_init(PCIBus *bus, int devfn, uint32_t id, +PCIBus *pci_bridge_init(PCIBus *bus, int devfn, uint16_t vid, uint16_t did, pci_map_irq_fn map_irq, const char *name) { PCIBridge *s; s = (PCIBridge *)pci_register_device(bus, name, sizeof(PCIBridge), devfn, NULL, pci_bridge_write_config); - s->dev.config[0x00] = id >> 16; - s->dev.config[0x01] = id >> 24; - s->dev.config[0x02] = id; // device_id - s->dev.config[0x03] = id >> 8; + + pci_config_set_vendor_id(s->dev.config, vid); + pci_config_set_device_id(s->dev.config, did); + s->dev.config[0x04] = 0x06; // command = bus master, pci mem s->dev.config[0x05] = 0x00; s->dev.config[0x06] = 0xa0; // status = fast back-to-back, 66MHz, no error Modified: trunk/hw/pci.h =================================================================== --- trunk/hw/pci.h 2009-01-27 14:29:15 UTC (rev 6464) +++ trunk/hw/pci.h 2009-01-27 19:15:31 UTC (rev 6465) @@ -31,6 +31,7 @@ #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 #define PCI_VENDOR_ID_CMD 0x1095 @@ -183,7 +184,7 @@ void pci_for_each_device(int bus_num, void (*fn)(PCIDevice *d)); void pci_info(void); -PCIBus *pci_bridge_init(PCIBus *bus, int devfn, uint32_t id, +PCIBus *pci_bridge_init(PCIBus *bus, int devfn, uint16_t vid, uint16_t did, pci_map_irq_fn map_irq, const char *name); static inline void