Commit 480b9f24d75eb8fcd25ead73b6f0265b08218c5e

Authored by blueswir1
1 parent 378e2aea

Add Simba device ID

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6465 c046a42c-6fe2-441c-8c8c-71466251a162
hw/apb_pci.c
... ... @@ -266,9 +266,11 @@ PCIBus *pci_apb_init(target_phys_addr_t special_base,
266 266 d->config[0x0E] = 0x00; // header_type
267 267  
268 268 /* APB secondary busses */
269   - *bus2 = pci_bridge_init(s->bus, 8, 0x108e5000, pci_apb_map_irq,
  269 + *bus2 = pci_bridge_init(s->bus, 8, PCI_VENDOR_ID_SUN,
  270 + PCI_DEVICE_ID_SUN_SIMBA, pci_apb_map_irq,
270 271 "Advanced PCI Bus secondary bridge 1");
271   - *bus3 = pci_bridge_init(s->bus, 9, 0x108e5000, pci_apb_map_irq,
  272 + *bus3 = pci_bridge_init(s->bus, 9, PCI_VENDOR_ID_SUN,
  273 + PCI_DEVICE_ID_SUN_SIMBA, pci_apb_map_irq,
272 274 "Advanced PCI Bus secondary bridge 2");
273 275 return s->bus;
274 276 }
... ...
hw/pci.c
... ... @@ -713,16 +713,16 @@ static void pci_bridge_write_config(PCIDevice *d,
713 713 pci_default_write_config(d, address, val, len);
714 714 }
715 715  
716   -PCIBus *pci_bridge_init(PCIBus *bus, int devfn, uint32_t id,
  716 +PCIBus *pci_bridge_init(PCIBus *bus, int devfn, uint16_t vid, uint16_t did,
717 717 pci_map_irq_fn map_irq, const char *name)
718 718 {
719 719 PCIBridge *s;
720 720 s = (PCIBridge *)pci_register_device(bus, name, sizeof(PCIBridge),
721 721 devfn, NULL, pci_bridge_write_config);
722   - s->dev.config[0x00] = id >> 16;
723   - s->dev.config[0x01] = id >> 24;
724   - s->dev.config[0x02] = id; // device_id
725   - s->dev.config[0x03] = id >> 8;
  722 +
  723 + pci_config_set_vendor_id(s->dev.config, vid);
  724 + pci_config_set_device_id(s->dev.config, did);
  725 +
726 726 s->dev.config[0x04] = 0x06; // command = bus master, pci mem
727 727 s->dev.config[0x05] = 0x00;
728 728 s->dev.config[0x06] = 0xa0; // status = fast back-to-back, 66MHz, no error
... ...
hw/pci.h
... ... @@ -31,6 +31,7 @@ extern target_phys_addr_t pci_mem_base;
31 31  
32 32 #define PCI_VENDOR_ID_SUN 0x108e
33 33 #define PCI_DEVICE_ID_SUN_EBUS 0x1000
  34 +#define PCI_DEVICE_ID_SUN_SIMBA 0x5000
34 35 #define PCI_DEVICE_ID_SUN_SABRE 0xa000
35 36  
36 37 #define PCI_VENDOR_ID_CMD 0x1095
... ... @@ -183,7 +184,7 @@ int pci_bus_num(PCIBus *s);
183 184 void pci_for_each_device(int bus_num, void (*fn)(PCIDevice *d));
184 185  
185 186 void pci_info(void);
186   -PCIBus *pci_bridge_init(PCIBus *bus, int devfn, uint32_t id,
  187 +PCIBus *pci_bridge_init(PCIBus *bus, int devfn, uint16_t vid, uint16_t did,
187 188 pci_map_irq_fn map_irq, const char *name);
188 189  
189 190 static inline void
... ...