diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2010-02-08 23:33:33 +0200 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2010-02-14 16:10:54 +0200 |
commit | 01764fe045d19b2624afc8721d7f5ec798a085ce (patch) | |
tree | 1f14f07c34658a3647580df36744f11603ab0bc0 /hw/versatile_pci.c | |
parent | c6a94ba5f9b8240f90ac2bf5ae5249bf5590c438 (diff) |
versatile_pci: convert to symbolic names
This converts versatile_pci to use symbolic
constants. Verified by comparing binary to
original one.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/versatile_pci.c')
-rw-r--r-- | hw/versatile_pci.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/hw/versatile_pci.c b/hw/versatile_pci.c index 153c6514f7..e58b7f424d 100644 --- a/hw/versatile_pci.c +++ b/hw/versatile_pci.c @@ -147,14 +147,17 @@ static int versatile_pci_host_init(PCIDevice *d) 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, PCI_DEVICE_ID_XILINX_XC2VP30); - d->config[0x04] = 0x00; - d->config[0x05] = 0x00; - d->config[0x06] = 0x20; - d->config[0x07] = 0x02; - d->config[0x08] = 0x00; // revision - d->config[0x09] = 0x00; // programming i/f + /* TODO: no need to clear command */ + pci_set_byte(d->config + PCI_COMMAND, 0x00); + pci_set_byte(d->config + PCI_COMMAND + 1, 0x00); + /* TODO: convert to set_word */ + pci_set_byte(d->config + PCI_STATUS, PCI_STATUS_66MHZ); + pci_set_byte(d->config + PCI_STATUS + 1, PCI_STATUS_DEVSEL_MEDIUM >> 8); + /* TODO: no need to clear revision/prog ifc */ + pci_set_byte(d->config + PCI_REVISION_ID, 0x00); + pci_set_byte(d->config + PCI_CLASS_PROG, 0x00); pci_config_set_class(d->config, PCI_CLASS_PROCESSOR_CO); - d->config[0x0D] = 0x10; // latency_timer + pci_set_byte(d->config + PCI_LATENCY_TIMER, 0x10); return 0; } |