From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NfITI-0006vg-2c for qemu-devel@nongnu.org; Wed, 10 Feb 2010 14:43:36 -0500 Received: from [199.232.76.173] (port=35229 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NfITH-0006vP-CS for qemu-devel@nongnu.org; Wed, 10 Feb 2010 14:43:35 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NfITF-0002J8-Kn for qemu-devel@nongnu.org; Wed, 10 Feb 2010 14:43:35 -0500 Received: from mail-iw0-f194.google.com ([209.85.223.194]:48869) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NfITF-0002J0-Bs for qemu-devel@nongnu.org; Wed, 10 Feb 2010 14:43:33 -0500 Received: by iwn32 with SMTP id 32so667084iwn.14 for ; Wed, 10 Feb 2010 11:43:32 -0800 (PST) Message-ID: <4B730C61.1000103@codemonkey.ws> Date: Wed, 10 Feb 2010 13:43:29 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 1/2] versatile_pci: convert to symbolic names References: <20100208214151.GB28285@redhat.com> In-Reply-To: <20100208214151.GB28285@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: qemu-devel@nongnu.org On 02/08/2010 03:41 PM, Michael S. Tsirkin wrote: > This converts versatile_pci to use symbolic > constants. Verified by comparing binary to > original one. > > Signed-off-by: Michael S. Tsirkin > Acked-by: Anthony Liguori Regards, Anthony Liguori > --- > 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 153c651..e58b7f4 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; > } > >