From patchwork Thu Dec 10 18:11:25 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 40864 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 96A44B6F07 for ; Fri, 11 Dec 2009 05:42:02 +1100 (EST) Received: from localhost ([127.0.0.1]:37897 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NInxf-0007gQ-Tk for incoming@patchwork.ozlabs.org; Thu, 10 Dec 2009 13:41:59 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NInWp-0005Xg-KG for qemu-devel@nongnu.org; Thu, 10 Dec 2009 13:14:15 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NInWl-0005Sa-OU for qemu-devel@nongnu.org; Thu, 10 Dec 2009 13:14:15 -0500 Received: from [199.232.76.173] (port=41858 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NInWl-0005SI-G5 for qemu-devel@nongnu.org; Thu, 10 Dec 2009 13:14:11 -0500 Received: from mx1.redhat.com ([209.132.183.28]:62717) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NInWl-0003jh-Vs for qemu-devel@nongnu.org; Thu, 10 Dec 2009 13:14:12 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nBAIE9P5014469 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 10 Dec 2009 13:14:09 -0500 Received: from redhat.com (vpn-6-118.tlv.redhat.com [10.35.6.118]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with SMTP id nBAIE7Tk015366; Thu, 10 Dec 2009 13:14:08 -0500 Date: Thu, 10 Dec 2009 20:11:25 +0200 From: "Michael S. Tsirkin" To: Anthony Liguori , qemu-devel@nongnu.org Message-ID: <20091210181125.GO25707@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.12 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Subject: [Qemu-devel] [PATCH 14/17] ac97: symbolic names for pci registers 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 No functional changes. I verified that the generated binary does not change. Signed-off-by: Michael S. Tsirkin --- hw/ac97.c | 57 +++++++++++++++++++++++++++++++-------------------------- 1 files changed, 31 insertions(+), 26 deletions(-) diff --git a/hw/ac97.c b/hw/ac97.c index 62e349a..4319bc8 100644 --- a/hw/ac97.c +++ b/hw/ac97.c @@ -1284,37 +1284,42 @@ static int ac97_initfn (PCIDevice *dev) pci_config_set_vendor_id (c, PCI_VENDOR_ID_INTEL); /* ro */ pci_config_set_device_id (c, PCI_DEVICE_ID_INTEL_82801AA_5); /* ro */ - c[0x04] = 0x00; /* pcicmd pci command rw, ro */ - c[0x05] = 0x00; + /* TODO: no need to override */ + c[PCI_COMMAND] = 0x00; /* pcicmd pci command rw, ro */ + c[PCI_COMMAND + 1] = 0x00; - c[0x06] = 0x80; /* pcists pci status rwc, ro */ - c[0x07] = 0x02; + /* TODO: */ + c[PCI_STATUS] = PCI_STATUS_FAST_BACK; /* pcists pci status rwc, ro */ + c[PCI_STATUS + 1] = PCI_STATUS_DEVSEL_MEDIUM >> 8; - c[0x08] = 0x01; /* rid revision ro */ - c[0x09] = 0x00; /* pi programming interface ro */ + c[PCI_REVISION_ID] = 0x01; /* rid revision ro */ + c[PCI_CLASS_PROG] = 0x00; /* pi programming interface ro */ pci_config_set_class (c, PCI_CLASS_MULTIMEDIA_AUDIO); /* ro */ c[PCI_HEADER_TYPE] = PCI_HEADER_TYPE_NORMAL; /* headtyp header type ro */ - c[0x10] = 0x01; /* nabmar native audio mixer base - address rw */ - c[0x11] = 0x00; - c[0x12] = 0x00; - c[0x13] = 0x00; - - c[0x14] = 0x01; /* nabmbar native audio bus mastering - base address rw */ - c[0x15] = 0x00; - c[0x16] = 0x00; - c[0x17] = 0x00; - - c[0x2c] = 0x86; /* svid subsystem vendor id rwo */ - c[0x2d] = 0x80; - - c[0x2e] = 0x00; /* sid subsystem id rwo */ - c[0x2f] = 0x00; - - c[0x3c] = 0x00; /* intr_ln interrupt line rw */ - c[0x3d] = 0x01; /* intr_pn interrupt pin ro */ + /* TODO set when bar is registered. no need to override. */ + /* nabmar native audio mixer base address rw */ + c[PCI_BASE_ADDRESS_0] = PCI_BASE_ADDRESS_SPACE_IO; + c[PCI_BASE_ADDRESS_0 + 1] = 0x00; + c[PCI_BASE_ADDRESS_0 + 2] = 0x00; + c[PCI_BASE_ADDRESS_0 + 3] = 0x00; + + /* TODO set when bar is registered. no need to override. */ + /* nabmbar native audio bus mastering base address rw */ + c[PCI_BASE_ADDRESS_0 + 4] = PCI_BASE_ADDRESS_SPACE_IO; + c[PCI_BASE_ADDRESS_0 + 5] = 0x00; + c[PCI_BASE_ADDRESS_0 + 6] = 0x00; + c[PCI_BASE_ADDRESS_0 + 7] = 0x00; + + c[PCI_SUBSYSTEM_VENDOR_ID] = 0x86; /* svid subsystem vendor id rwo */ + c[PCI_SUBSYSTEM_VENDOR_ID + 1] = 0x80; + + c[PCI_SUBSYSTEM_ID] = 0x00; /* sid subsystem id rwo */ + c[PCI_SUBSYSTEM_ID + 1] = 0x00; + + c[PCI_INTERRUPT_LINE] = 0x00; /* intr_ln interrupt line rw */ + /* TODO: RST# value should be 0. */ + c[PCI_INTERRUPT_PIN] = 0x01; /* intr_pn interrupt pin ro */ pci_register_bar (&s->dev, 0, 256 * 4, PCI_BASE_ADDRESS_SPACE_IO, ac97_map);