From patchwork Mon Feb 8 21:41:51 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 44864 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 44925B7CF3 for ; Tue, 9 Feb 2010 08:47:11 +1100 (EST) Received: from localhost ([127.0.0.1]:50243 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NebRk-0007Zs-DK for incoming@patchwork.ozlabs.org; Mon, 08 Feb 2010 16:47:08 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NebPl-00077B-Ns for qemu-devel@nongnu.org; Mon, 08 Feb 2010 16:45:05 -0500 Received: from [199.232.76.173] (port=53709 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NebPl-00076t-BN for qemu-devel@nongnu.org; Mon, 08 Feb 2010 16:45:05 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NebPk-0006IB-0N for qemu-devel@nongnu.org; Mon, 08 Feb 2010 16:45:05 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40195) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NebPj-0006Hy-IR for qemu-devel@nongnu.org; Mon, 08 Feb 2010 16:45:03 -0500 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o18Lj2AR013842 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 8 Feb 2010 16:45:02 -0500 Received: from redhat.com (vpn-6-214.tlv.redhat.com [10.35.6.214]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with SMTP id o18Lj1c2010801 for ; Mon, 8 Feb 2010 16:45:01 -0500 Date: Mon, 8 Feb 2010 23:41:51 +0200 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Message-ID: <20100208214151.GB28285@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.19 (2009-01-05) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: [Qemu-devel] [PATCH 1/2] versatile_pci: convert to symbolic names X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- 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; }