From nobody Tue Dec 16 11:48:21 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1527292866395789.4179728236878; Fri, 25 May 2018 17:01:06 -0700 (PDT) Received: from localhost ([::1]:47115 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMMdt-0002A3-Jq for importer@patchew.org; Fri, 25 May 2018 20:01:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52505) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMMYM-0006O3-SW for qemu-devel@nongnu.org; Fri, 25 May 2018 19:55:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fMMYJ-0007xp-44 for qemu-devel@nongnu.org; Fri, 25 May 2018 19:55:22 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:56694 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fMMYF-0007nL-Ao; Fri, 25 May 2018 19:55:15 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D6D73805A52F; Fri, 25 May 2018 23:55:14 +0000 (UTC) Received: from probe.bos.redhat.com (dhcp-17-177.bos.redhat.com [10.18.17.177]) by smtp.corp.redhat.com (Postfix) with ESMTP id 98762111AF18; Fri, 25 May 2018 23:55:14 +0000 (UTC) From: John Snow To: qemu-devel@nongnu.org, qemu-block@nongnu.org Date: Fri, 25 May 2018 19:55:02 -0400 Message-Id: <20180525235509.11282-10-jsnow@redhat.com> In-Reply-To: <20180525235509.11282-1-jsnow@redhat.com> References: <20180525235509.11282-1-jsnow@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Fri, 25 May 2018 23:55:14 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Fri, 25 May 2018 23:55:14 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jsnow@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH 09/16] ahci: add host register enumeration X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: John Snow --- hw/ide/ahci.c | 15 +++++++++++++++ hw/ide/ahci_internal.h | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index 61ac8e46c8..674e06853e 100644 --- a/hw/ide/ahci.c +++ b/hw/ide/ahci.c @@ -46,6 +46,21 @@ static bool ahci_map_fis_address(AHCIDevice *ad); static void ahci_unmap_clb_address(AHCIDevice *ad); static void ahci_unmap_fis_address(AHCIDevice *ad); =20 +__attribute__((__unused__)) /* TODO */ +static const char *AHCIHostReg_lookup[AHCI_HOST_REG__COUNT] =3D { + [AHCI_HOST_REG_CAP] =3D "CAP", + [AHCI_HOST_REG_CTL] =3D "GHC", + [AHCI_HOST_REG_IRQ_STAT] =3D "IS", + [AHCI_HOST_REG_PORTS_IMPL] =3D "PI", + [AHCI_HOST_REG_VERSION] =3D "VS", + [AHCI_HOST_REG_CCC_CTL] =3D "CCC_CTL", + [AHCI_HOST_REG_CCC_PORTS] =3D "CCC_PORTS", + [AHCI_HOST_REG_EM_LOC] =3D "EM_LOC", + [AHCI_HOST_REG_EM_CTL] =3D "EM_CTL", + [AHCI_HOST_REG_CAP2] =3D "CAP2", + [AHCI_HOST_REG_BOHC] =3D "BOHC", +}; + static const char *AHCIPortReg_lookup[AHCI_PORT_REG__COUNT] =3D { [AHCI_PORT_REG_LST_ADDR] =3D "PxCLB", [AHCI_PORT_REG_LST_ADDR_HI] =3D "PxCLBU", diff --git a/hw/ide/ahci_internal.h b/hw/ide/ahci_internal.h index db00c9aa39..af366db6f3 100644 --- a/hw/ide/ahci_internal.h +++ b/hw/ide/ahci_internal.h @@ -61,6 +61,21 @@ #define HOST_PORTS_IMPL 0x0c /* bitmap of implemented ports */ #define HOST_VERSION 0x10 /* AHCI spec. version compliancy */ =20 +enum AHCIHostReg { + AHCI_HOST_REG_CAP =3D 0, /* CAP: host capabilities */ + AHCI_HOST_REG_CTL =3D 1, /* GHC: global host control */ + AHCI_HOST_REG_IRQ_STAT =3D 2, /* IS: interrupt status */ + AHCI_HOST_REG_PORTS_IMPL =3D 3, /* PI: bitmap of implemented ports */ + AHCI_HOST_REG_VERSION =3D 4, /* VS: AHCI spec. version compliancy = */ + AHCI_HOST_REG_CCC_CTL =3D 5, /* CCC_CTL: CCC Control */ + AHCI_HOST_REG_CCC_PORTS =3D 6, /* CCC_PORTS: CCC Ports */ + AHCI_HOST_REG_EM_LOC =3D 7, /* EM_LOC: Enclosure Mgmt Location */ + AHCI_HOST_REG_EM_CTL =3D 8, /* EM_CTL: Enclosure Mgmt Control */ + AHCI_HOST_REG_CAP2 =3D 9, /* CAP2: host capabilities, extended = */ + AHCI_HOST_REG_BOHC =3D 10, /* BOHC: firmare/os handoff ctrl & st= atus */ + AHCI_HOST_REG__COUNT =3D 11 +}; + /* HOST_CTL bits */ #define HOST_CTL_RESET (1 << 0) /* reset controller; self-clea= r */ #define HOST_CTL_IRQ_EN (1 << 1) /* global IRQ enable */ --=20 2.14.3