From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web12.2878.1612410881132361711 for ; Wed, 03 Feb 2021 19:54:41 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=XI4d6H/U; spf=pass (domain: intel.com, ip: 192.55.52.93, mailfrom: nathaniel.l.desimone@intel.com) IronPort-SDR: AmU5hSJauaBMAPKTbzLDqfSAFMKZflPznnSp6TgY7k9rrExNvywYwEdwG2axGT2ayKUOp8ct9j xXSTt/BJ8WrA== X-IronPort-AV: E=McAfee;i="6000,8403,9884"; a="177660703" X-IronPort-AV: E=Sophos;i="5.79,400,1602572400"; d="scan'208";a="177660703" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Feb 2021 19:54:37 -0800 IronPort-SDR: e0jYc/7k+J/TNRSbUNH5wFS+nEa8KEMEAsacv6HqAY4e6l7fGHV0X1iapk35Oze1dWz/hMrO2U hizqQRzzX1JQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.79,400,1602572400"; d="scan'208";a="392967946" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga008.jf.intel.com with ESMTP; 03 Feb 2021 19:54:36 -0800 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Wed, 3 Feb 2021 19:54:35 -0800 Received: from fmsmsx605.amr.corp.intel.com (10.18.126.85) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Wed, 3 Feb 2021 19:54:35 -0800 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2 via Frontend Transport; Wed, 3 Feb 2021 19:54:35 -0800 Received: from NAM02-CY1-obe.outbound.protection.outlook.com (104.47.37.58) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Wed, 3 Feb 2021 19:54:35 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=amYOdVnc8U9yYCW15WNBWJB0gsN0d38nbMvT1mSUzq5PdymO31XKM7zY14YBcG3pjKDAo4gWDDFGUvfOqmcLG4bIN46kit4qIzy+czG27DXPaLK26oaQP1MxoUQ6Cncl0q2mfXN1SqefMUqZk+X3j2BO/PW5h8odSAdNaM+1VdpZc/E/ojB48giV2V/mCwWnm6waleTSZpubiCSULEfSFUhdeEySR13ffJ6CpN7ckySWHCzdrt54DN2dlsjbZ7InVpsrrA9AYDwu1n1y/ztU5SmdVaQeD/mD1JsdFHcBmqRb0peblU6Rb/uO71lnJ7uFBkuZN6LLCww7cveTyH3J7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aKp0vKYJEtxcPbuzAErskb2LH0cMCPa0gtOEiaayD/M=; b=Pxg1OXsDsH4XOTi8NIMNvZ3iX592d2D444Ol7lOPhsUmtauXAeBvTZmMfuhysIsrpiEVL9EgSEM/fRRRRhEeBH6IE1a2PqHlRdVw8njpU+kcnShX9I0/BgTPidxEdGLWbNA+b5cwItM33zp7LSJIKxmKll5PaXyut/BGN0TFgkCsyUTb8qKV9hoEQH8i7aOVXA8azYLQ9f7a1DotbhNTt542dZ5IUk4LdvfMf6A1228ieGMyaKcWFHT/e/l5LPZxB7uzZnArl0fut8gcAiPMKnxZlhMs38XBN5hfNRuGezFCHhtRAY9tNnFJF7MBUhY04DPgAG+TmFvh2WzqhqokPg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aKp0vKYJEtxcPbuzAErskb2LH0cMCPa0gtOEiaayD/M=; b=XI4d6H/UIincKfzzliuBiItKhmmflV6ZLnsjePMXyGwIGC2SjRZAFEvjx3fXcIwpKc07nU/HQ/LUMnUJ3flRNWSjK9aKgzTkz5gopwX1hTkVp5NKebByCnuMhZqN1DasyR7qpdj3xjCD+ASMxUUOUFsZa8IuTPMayfshzte7rQ4= Received: from BN6PR1101MB2147.namprd11.prod.outlook.com (2603:10b6:405:57::23) by BN6PR11MB1329.namprd11.prod.outlook.com (2603:10b6:404:47::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3805.19; Thu, 4 Feb 2021 03:54:33 +0000 Received: from BN6PR1101MB2147.namprd11.prod.outlook.com ([fe80::203e:ed6b:a572:6453]) by BN6PR1101MB2147.namprd11.prod.outlook.com ([fe80::203e:ed6b:a572:6453%3]) with mapi id 15.20.3805.024; Thu, 4 Feb 2021 03:54:33 +0000 From: "Nate DeSimone" To: "Luo, Heng" , "devel@edk2.groups.io" CC: "Chaganty, Rangasai V" Subject: Re: [PATCH 19/40] TigerlakeSiliconPkg/IpBlock: Add Hda component Thread-Topic: [PATCH 19/40] TigerlakeSiliconPkg/IpBlock: Add Hda component Thread-Index: AQHW+DrchkAwA2zxW0uhu/aloJVysapHYmvQ Date: Thu, 4 Feb 2021 03:54:33 +0000 Message-ID: References: <20210201013657.1833-1-heng.luo@intel.com> <20210201013657.1833-19-heng.luo@intel.com> In-Reply-To: <20210201013657.1833-19-heng.luo@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.5.1.3 dlp-product: dlpe-windows authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [50.53.190.176] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e4d8d792-550a-471e-363a-08d8c8c09568 x-ms-traffictypediagnostic: BN6PR11MB1329: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2803; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: X/dFnBQQQ3GTDJwvAKidW5EBto4At8OFHZw0EcRuIarPP2Q4oNgO1wfa4ORvJJBZfeYC4lCLULWgPkkFO0lXTaSXscqxJMxYadx9Ooa5bhCtdr2jsg9xe9fsp64TLxDchmiiW+1vTLUBo9vocaMxedBE/ijpdjYBTljb4q496qq3ZN+ZVUbuM3fyPw3zEJZR5dxU5xqlOCor8qFlln9nabm3DyTUs0ZoxA89c77K5sRQKqDxnrqizM0MVMkAuE7sNqpHBVsc+MOyTNcdMNCJ3UaM/uuzLgHH+MMOCbqKyyQGmneUIUwTEQmnQWYciOzP8Jrmv6eCyf9MFp8Tn4wp4Kqarxw+tFbT6pE82PGGTb0bzL3jPabnzQC0oLJLWEwsuZ9fpWy8V5fSc7Wyl7ypP/QrQBkTH/9UwoRzHc2RPkhLLadVDpgQWzVZDBQjhVhMeGsRlD5ao+8ihC7q66CL3jEF7MFyChdMtOqvpD1mZbogx4CUq7Uqf7/FW47KlGPGxDS9wJ7KakNdEODpP/DlDYSdrnFLbk0Bz7BQUSU/WeztuenAxu5HhsI8HYuD0YOYskVseUaWLfq4eIDlbjQw1OC/heN12Wmgh5R52L5vjOo= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN6PR1101MB2147.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(6029001)(396003)(346002)(136003)(366004)(376002)(39860400002)(7696005)(966005)(52536014)(86362001)(83380400001)(76116006)(66476007)(9686003)(66446008)(8936002)(26005)(107886003)(478600001)(5660300002)(64756008)(4326008)(186003)(110136005)(55016002)(71200400001)(66946007)(8676002)(53546011)(33656002)(2906002)(30864003)(66556008)(316002)(6506007)(579004)(559001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?zsQOPrwKPRdFbyFCl7KZ+tC7Ztz2pBKi97RhjRuupi9Jmw7FhWOvjUqnDnag?= =?us-ascii?Q?y35P6qLvP2rcBXyabzeacF7l36XTu/9HSiirNu2pLG/dAWBpHCqaL4drdlbD?= =?us-ascii?Q?rT+ey6L/gBoIJCsICjXnbY/Bnloubf8/jE4vb1b8UO4I7O+wccrNRyH8NeXB?= =?us-ascii?Q?Id9z2GIZyzcywyHTshHLSHnNMRZzEd5CETUbLXiVjKMimBjqeFT3FajvWijB?= =?us-ascii?Q?ykzWcPTgedqBdkWJeL2jqYTpIKULjOdKKhiI9LMipCPFA53YTnHjdZCKNcVO?= =?us-ascii?Q?yFL4BSLfr/Xu4sB07FPaN292hUOoxFZZojN3QJL+myDNtiCp3Xwpjza8YUFm?= =?us-ascii?Q?OntVqbkGrp5QB0SuyouiA0CUTUiAkY6steTjHHNmra3O36jkXVcBcE52YOG8?= =?us-ascii?Q?gX3xPccqt3X0sQPPpZos2rcWmEdv+7V4XPxMTPonxZD/b0OHav8k/uEsvUQ/?= =?us-ascii?Q?INAsc64FAOWS/vzw+KnTx49PrYu+qG6m+/ZQji3EwvhfW6weZk98D2HuHEDB?= =?us-ascii?Q?CaxRUgvF7z99Gu+kRN58NSGE2eJ9/yXbZJ2ScH7k2XTFS6GfCRZaqZN8meHa?= =?us-ascii?Q?ct9DMZ7OedQfG0lMWhUM5dVw01ELyZAR+yDatIDvz2XP/Ufs4hYraXnRZdyS?= =?us-ascii?Q?rpF8LDD2b5iMU4GVvvW3pv7j4GBWgofqCGR10y3YzaxYaDAz9oLJY7+hlE7U?= =?us-ascii?Q?2Db60+o7qH9iUGV9OA3IQ9wkoOqgoCU+bRo92spTq17ZGeqPXQMK1jxbhk5d?= =?us-ascii?Q?KVUq+bhnoAKEjTep3TEtNspkAokocmOGvPJmrdFebQRUHY8UtNYKDGOobjAk?= =?us-ascii?Q?LgLZG2F18Ei7zhzmneDfJ6PQnyUhTAgCkcBmogoVxeo51pT4DslLnvIukbiz?= =?us-ascii?Q?C0/sTrQ7P1eddctmamsTlcnm1KW+V7kybIfrTCLJpGSHBzKwYMrTxL0fObnl?= =?us-ascii?Q?EqCFBfAlaTBDA5bIspe7Y6BtGXvqbHVjGSdQfyk5xRtIPJfg/lBQfMcRX2YS?= =?us-ascii?Q?aIom+tQL2AVDaYO8iLCpU4BL0vMAtARWMw6Cw8mVDWh3q+7NIaFnXcjsk7II?= =?us-ascii?Q?0Axu1Al0JZsccFQtkR/xcgZXCkysSbYNnI2NxhCvjN8ZRFZFqmCfj2+Q2Qyr?= =?us-ascii?Q?5f76u8GQEOMxC4yy8mUSQFvCOjpmZKkPVONtlCy3pc6p+da8ebj08NwqOVUE?= =?us-ascii?Q?1f7Sto2a5e2BRhSiXvubKMYh8rVkbYNlVx4qKyiPce3bJ90tZlxixTHSbhlU?= =?us-ascii?Q?VKL3uFmOJJ5s0khKdsynj6NEHad6i2FhWvHuPt3nM6boBYKrmMA7w4gztSqs?= =?us-ascii?Q?x33VKrGeTtFw2Hs8v3eB6gKn?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN6PR1101MB2147.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e4d8d792-550a-471e-363a-08d8c8c09568 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Feb 2021 03:54:33.7286 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: X4mcCzEBEJ6KHBMjp1RoqvubXNVW1mJxp8O8O6Eh9lqRF6uAhGtQcLT3PLgGGnPG85Y+m5gORGANuLM6mCJnQzTnIU7fEqKwhoG8l58hNw0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1329 Return-Path: nathaniel.l.desimone@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Nate DeSimone > -----Original Message----- > From: Luo, Heng > Sent: Sunday, January 31, 2021 5:37 PM > To: devel@edk2.groups.io > Cc: Chaganty, Rangasai V ; Desimone, > Nathaniel L > Subject: [PATCH 19/40] TigerlakeSiliconPkg/IpBlock: Add Hda component >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3171 >=20 > Adds the following files: > * IpBlock/Hda/IncludePrivate > * IpBlock/Hda/Library > * IpBlock/Hda/LibraryPrivate >=20 > Cc: Sai Chaganty > Cc: Nate DeSimone > Signed-off-by: Heng Luo > --- >=20 > Silicon/Intel/TigerlakeSiliconPkg/IpBlock/Hda/IncludePrivate/Library/DxeH= da > PolicyLib.h | 55 > +++++++++++++++++++++++++++++++++++++++++++++++++++++++ >=20 > Silicon/Intel/TigerlakeSiliconPkg/IpBlock/Hda/IncludePrivate/Register/Hda= Re > gs.h | 46 > ++++++++++++++++++++++++++++++++++++++++++++++ >=20 > Silicon/Intel/TigerlakeSiliconPkg/IpBlock/Hda/Library/DxeHdaNhltLib/DxeHd > aNhltLib.c | 383 > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > +++++++++++++++++++++++++++++++++++ >=20 > Silicon/Intel/TigerlakeSiliconPkg/IpBlock/Hda/Library/DxeHdaNhltLib/DxeHd > aNhltLib.inf | 31 +++++++++++++++++++++++++++++++ >=20 > Silicon/Intel/TigerlakeSiliconPkg/IpBlock/Hda/LibraryPrivate/DxeHdaPolicy= Lib > /DxeHdaPolicyLib.c | 92 > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > ++++++++++++++++++++++++++++++++++ >=20 > Silicon/Intel/TigerlakeSiliconPkg/IpBlock/Hda/LibraryPrivate/DxeHdaPolicy= Lib > /DxeHdaPolicyLib.inf | 31 +++++++++++++++++++++++++++++++ > 6 files changed, 638 insertions(+) >=20 > diff --git > a/Silicon/Intel/TigerlakeSiliconPkg/IpBlock/Hda/IncludePrivate/Library/Dx= eH > daPolicyLib.h > b/Silicon/Intel/TigerlakeSiliconPkg/IpBlock/Hda/IncludePrivate/Library/Dx= eH > daPolicyLib.h > new file mode 100644 > index 0000000000..9c42bf5611 > --- /dev/null > +++ > b/Silicon/Intel/TigerlakeSiliconPkg/IpBlock/Hda/IncludePrivate/Library/Dx= eH > daPolicyLib.h > @@ -0,0 +1,55 @@ > +/** @file >=20 > + DXE Hda policy library. >=20 > + >=20 > + Copyright (c) 2021, Intel Corporation. All rights reserved.
>=20 > + SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > +**/ >=20 > +#ifndef _DXE_HDA_POLICY_LIB_H_ >=20 > +#define _DXE_HDA_POLICY_LIB_H_ >=20 > + >=20 > +#include >=20 > + >=20 > +/** >=20 > + Print HDAUDIO_DXE_CONFIG and serial out. >=20 > + >=20 > + @param[in] PchPolicy Pointer to a PCH_POLICY_PROTOCOL >=20 > +**/ >=20 > +VOID >=20 > +HdaDxePrintConfig ( >=20 > + IN PCH_POLICY_PROTOCOL *PchPolicy >=20 > + ); >=20 > + >=20 > +/** >=20 > + Load Config block default >=20 > + >=20 > + @param[in] ConfigBlockPointer Pointer to config block >=20 > +**/ >=20 > +VOID >=20 > +HdaDxeLoadConfigDefault ( >=20 > + IN VOID *ConfigBlockPointer >=20 > + ); >=20 > + >=20 > +/** >=20 > + Get Hda config block table size. >=20 > + >=20 > + @retval Size of config block >=20 > +**/ >=20 > +UINT16 >=20 > +HdaDxeGetConfigBlockTotalSize ( >=20 > + VOID >=20 > + ); >=20 > + >=20 > +/** >=20 > + Add Hda ConfigBlock. >=20 > + >=20 > + @param[in] ConfigBlockTableAddress The pointer to config block tabl= e >=20 > + >=20 > + @retval EFI_SUCCESS The policy default is initialize= d. >=20 > + @retval EFI_OUT_OF_RESOURCES Insufficient resources to create > buffer >=20 > +**/ >=20 > +EFI_STATUS >=20 > +HdaDxeAddConfigBlock ( >=20 > + IN VOID *ConfigBlockTableAddress >=20 > + ); >=20 > + >=20 > +#endif // _DXE_HDA_POLICY_LIB_H_ >=20 > diff --git > a/Silicon/Intel/TigerlakeSiliconPkg/IpBlock/Hda/IncludePrivate/Register/H= da > Regs.h > b/Silicon/Intel/TigerlakeSiliconPkg/IpBlock/Hda/IncludePrivate/Register/H= da > Regs.h > new file mode 100644 > index 0000000000..b165e7bb22 > --- /dev/null > +++ > b/Silicon/Intel/TigerlakeSiliconPkg/IpBlock/Hda/IncludePrivate/Register/H= da > Regs.h > @@ -0,0 +1,46 @@ > +/** @file >=20 > + Register names for High Definition Audio device. >=20 > + >=20 > + Conventions: >=20 > + >=20 > + - Register definition format: >=20 > + > Prefix_[GenerationName]_[ComponentName]_SubsystemName_RegisterS > pace_RegisterName >=20 > + - Prefix: >=20 > + Definitions beginning with "R_" are registers >=20 > + Definitions beginning with "B_" are bits within registers >=20 > + Definitions beginning with "V_" are meaningful values within the bit= s >=20 > + Definitions beginning with "S_" are register size >=20 > + Definitions beginning with "N_" are the bit position >=20 > + - [GenerationName]: >=20 > + Three letter acronym of the generation is used (e.g. SKL,KBL,CNL etc= .). >=20 > + Register name without GenerationName applies to all generations. >=20 > + - [ComponentName]: >=20 > + This field indicates the component name that the register belongs to= (e.g. > PCH, SA etc.) >=20 > + Register name without ComponentName applies to all components. >=20 > + Register that is specific to -LP denoted by "_PCH_LP_" in component > name. >=20 > + - SubsystemName: >=20 > + This field indicates the subsystem name of the component that the > register belongs to >=20 > + (e.g. PCIE, USB, SATA, GPIO, PMC etc.). >=20 > + - RegisterSpace: >=20 > + MEM - MMIO space register of subsystem. >=20 > + IO - IO space register of subsystem. >=20 > + PCR - Private configuration register of subsystem. >=20 > + CFG - PCI configuration space register of subsystem. >=20 > + - RegisterName: >=20 > + Full register name. >=20 > + >=20 > + Copyright (c) 2021, Intel Corporation. All rights reserved.
>=20 > + SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > +**/ >=20 > +#ifndef _HDA_REGS_H_ >=20 > +#define _HDA_REGS_H_ >=20 > + >=20 > +// >=20 > +// HD-A Controller Registers >=20 > +// >=20 > +// PCI Configuration Space Registers >=20 > +// >=20 > +#define R_HDA_CFG_PCS 0x54 >=20 > +#define B_HDA_CFG_PCS_PMEE BIT8 >=20 > + >=20 > +#endif >=20 > diff --git > a/Silicon/Intel/TigerlakeSiliconPkg/IpBlock/Hda/Library/DxeHdaNhltLib/Dxe= H > daNhltLib.c > b/Silicon/Intel/TigerlakeSiliconPkg/IpBlock/Hda/Library/DxeHdaNhltLib/Dxe= H > daNhltLib.c > new file mode 100644 > index 0000000000..71388934e6 > --- /dev/null > +++ > b/Silicon/Intel/TigerlakeSiliconPkg/IpBlock/Hda/Library/DxeHdaNhltLib/Dxe= H > daNhltLib.c > @@ -0,0 +1,383 @@ > +/** @file >=20 > + HD Audio NHLT Library implementation. >=20 > + >=20 > + Copyright (c) 2021, Intel Corporation. All rights reserved.
>=20 > + SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > +**/ >=20 > + >=20 > +#include >=20 > +#include >=20 > +#include >=20 > +#include >=20 > +#include >=20 > +#include >=20 > +#include >=20 > +#include >=20 > +#include >=20 > + >=20 > +/** >=20 > + Returns pointer to Endpoint ENDPOINT_DESCRIPTOR structure. >=20 > + >=20 > + @param[in] *NhltTable Endpoint for which Format address is retrieve= d >=20 > + @param[in] FormatIndex Index of Format to be retrieved >=20 > + >=20 > + @retval Pointer to ENDPOINT_DESCRIPTOR structure with= given > index >=20 > +**/ >=20 > +ENDPOINT_DESCRIPTOR * >=20 > +GetNhltEndpoint ( >=20 > + IN CONST NHLT_ACPI_TABLE *NhltTable, >=20 > + IN CONST UINT8 EndpointIndex >=20 > + ) >=20 > +{ >=20 > + UINT8 Index; >=20 > + ENDPOINT_DESCRIPTOR *Endpoint; >=20 > + Endpoint =3D (ENDPOINT_DESCRIPTOR*) (NhltTable->EndpointDescriptors); >=20 > + >=20 > + if (EndpointIndex > NhltTable->EndpointCount) { >=20 > + return NULL; >=20 > + } >=20 > + >=20 > + for (Index =3D 0; Index < EndpointIndex; Index++) { >=20 > + Endpoint =3D (ENDPOINT_DESCRIPTOR*) ((UINT8*) (Endpoint) + Endpoint- > >EndpointDescriptorLength); >=20 > + } >=20 > + >=20 > + return Endpoint; >=20 > +} >=20 > + >=20 > +/** >=20 > + Returns pointer to Endpoint Specific Configuration SPECIFIC_CONFIG > structure. >=20 > + >=20 > + @param[in] *Endpoint Endpoint for which config address is retrieve= d >=20 > + >=20 > + @retval Pointer to SPECIFIC_CONFIG structure with end= point's > capabilities >=20 > +**/ >=20 > +SPECIFIC_CONFIG * >=20 > +GetNhltEndpointDeviceCapabilities ( >=20 > + IN CONST ENDPOINT_DESCRIPTOR *Endpoint >=20 > + ) >=20 > +{ >=20 > + return (SPECIFIC_CONFIG*) (&Endpoint->EndpointConfig); >=20 > +} >=20 > + >=20 > +/** >=20 > + Returns pointer to all Formats Configuration FORMATS_CONFIG structure. >=20 > + >=20 > + @param[in] *Endpoint Endpoint for which Formats address is retriev= ed >=20 > + >=20 > + @retval Pointer to FORMATS_CONFIG structure >=20 > +**/ >=20 > +FORMATS_CONFIG * >=20 > +GetNhltEndpointFormatsConfig ( >=20 > + IN CONST ENDPOINT_DESCRIPTOR *Endpoint >=20 > + ) >=20 > +{ >=20 > + FORMATS_CONFIG *FormatsConfig; >=20 > + FormatsConfig =3D (FORMATS_CONFIG*) ((UINT8*) (&Endpoint- > >EndpointConfig) >=20 > + + sizeof (Endpoint->EndpointConfig.= CapabilitiesSize) >=20 > + + Endpoint->EndpointConfig.Capabili= tiesSize); >=20 > + >=20 > + return FormatsConfig; >=20 > +} >=20 > + >=20 > +/** >=20 > + Returns pointer to Format Configuration FORMAT_CONFIG structure. >=20 > + >=20 > + @param[in] *Endpoint Endpoint for which Format address is retrieve= d >=20 > + @param[in] FormatIndex Index of Format to be retrieved >=20 > + >=20 > + @retval Pointer to FORMAT_CONFIG structure with given= index >=20 > +**/ >=20 > +FORMAT_CONFIG * >=20 > +GetNhltEndpointFormat ( >=20 > + IN CONST ENDPOINT_DESCRIPTOR *Endpoint, >=20 > + IN CONST UINT8 FormatIndex >=20 > + ) >=20 > +{ >=20 > + UINT8 Index; >=20 > + UINT32 Length; >=20 > + FORMATS_CONFIG *FormatsConfig; >=20 > + FORMAT_CONFIG *Format; >=20 > + >=20 > + Length =3D 0; >=20 > + FormatsConfig =3D GetNhltEndpointFormatsConfig (Endpoint); >=20 > + Format =3D FormatsConfig->FormatsConfiguration; >=20 > + >=20 > + if (FormatIndex > FormatsConfig->FormatsCount) { >=20 > + return NULL; >=20 > + } >=20 > + >=20 > + for (Index =3D 0; Index < FormatIndex; Index++) { >=20 > + Length =3D sizeof (Format->Format) + Format- > >FormatConfiguration.CapabilitiesSize >=20 > + + sizeof (Format->FormatConfiguration.CapabilitiesSize); >=20 > + Format =3D (FORMAT_CONFIG*) ((UINT8*) (Format) + Length); >=20 > + } >=20 > + >=20 > + return Format; >=20 > +} >=20 > + >=20 > +/** >=20 > + Returns pointer to all Device Information DEVICES_INFO structure. >=20 > + >=20 > + @param[in] *Endpoint Endpoint for which DevicesInfo address is > retrieved >=20 > + >=20 > + @retval Pointer to DEVICES_INFO structure >=20 > +**/ >=20 > +DEVICES_INFO * >=20 > +GetNhltEndpointDevicesInfo ( >=20 > + IN CONST ENDPOINT_DESCRIPTOR *Endpoint >=20 > + ) >=20 > +{ >=20 > + DEVICES_INFO *DevicesInfo; >=20 > + FORMATS_CONFIG *FormatsConfig; >=20 > + FORMAT_CONFIG *Format; >=20 > + >=20 > + FormatsConfig =3D GetNhltEndpointFormatsConfig (Endpoint); >=20 > + Format =3D GetNhltEndpointFormat (Endpoint, FormatsConfig- > >FormatsCount); >=20 > + DevicesInfo =3D (DEVICES_INFO*) ((UINT8*) Format); >=20 > + >=20 > + return DevicesInfo; >=20 > +} >=20 > + >=20 > +/** >=20 > + Returns pointer to Device Information DEVICES_INFO structure. >=20 > + >=20 > + @param[in] *Endpoint Endpoint for which Device Info address is > retrieved >=20 > + @param[in] DeviceInfoIndex Index of Device Info to be retrieved >=20 > + >=20 > + @retval Pointer to DEVICE_INFO structure with given= index >=20 > +**/ >=20 > +DEVICE_INFO * >=20 > +GetNhltEndpointDeviceInfo ( >=20 > + IN CONST ENDPOINT_DESCRIPTOR *Endpoint, >=20 > + IN CONST UINT8 DeviceInfoIndex >=20 > + ) >=20 > +{ >=20 > + DEVICES_INFO *DevicesInfo; >=20 > + DEVICE_INFO *DeviceInfo; >=20 > + >=20 > + DevicesInfo =3D GetNhltEndpointDevicesInfo (Endpoint); >=20 > + DeviceInfo =3D DevicesInfo->DeviceInformation; >=20 > + >=20 > + if (DevicesInfo =3D=3D NULL || DeviceInfoIndex >=3D DevicesInfo- > >DeviceInfoCount) { >=20 > + return NULL; >=20 > + } >=20 > + >=20 > + DeviceInfo =3D (DEVICE_INFO*) ((UINT8*) (DeviceInfo) + sizeof > (*DeviceInfo) * DeviceInfoIndex); >=20 > + >=20 > + return DeviceInfo; >=20 > +} >=20 > + >=20 > +/** >=20 > + Returns pointer to OED Configuration SPECIFIC_CONFIG structure. >=20 > + >=20 > + @param[in] *NhltTable NHLT table for which OED address is retrieved >=20 > + >=20 > + @retval Pointer to SPECIFIC_CONFIG structure with NHL= T > capabilities >=20 > +**/ >=20 > +SPECIFIC_CONFIG * >=20 > +GetNhltOedConfig ( >=20 > + IN CONST NHLT_ACPI_TABLE *NhltTable >=20 > + ) >=20 > +{ >=20 > + ENDPOINT_DESCRIPTOR *Endpoint; >=20 > + SPECIFIC_CONFIG *OedConfig; >=20 > + >=20 > + Endpoint =3D GetNhltEndpoint (NhltTable, (NhltTable->EndpointCount)); >=20 > + OedConfig =3D (SPECIFIC_CONFIG*) ((UINT8*) (Endpoint)); >=20 > + >=20 > + return OedConfig; >=20 > +} >=20 > + >=20 > +/** >=20 > + Prints Format configuration. >=20 > + >=20 > + @param[in] *Format Format to be printed >=20 > + >=20 > + @retval None >=20 > +**/ >=20 > +VOID >=20 > +NhltFormatDump ( >=20 > + IN CONST FORMAT_CONFIG *Format >=20 > + ) >=20 > +{ >=20 > + UINT32 Index; >=20 > + >=20 > + DEBUG ((DEBUG_INFO, "------------------------------- FORMAT ----------= ------- > --------------\n")); >=20 > + DEBUG ((DEBUG_INFO, " Format->Format.Format.wFormatTag =3D > 0x%x\n", Format->Format.Format.wFormatTag)); >=20 > + DEBUG ((DEBUG_INFO, " Format->Format.Format.nChannels =3D %d\n", > Format->Format.Format.nChannels)); >=20 > + DEBUG ((DEBUG_INFO, " Format->Format.Format.nSamplesPerSec =3D > %d\n", Format->Format.Format.nSamplesPerSec)); >=20 > + DEBUG ((DEBUG_INFO, " Format->Format.Format.nAvgBytesPerSec =3D > %d\n", Format->Format.Format.nAvgBytesPerSec)); >=20 > + DEBUG ((DEBUG_INFO, " Format->Format.Format.nBlockAlign =3D %d\n", > Format->Format.Format.nBlockAlign)); >=20 > + DEBUG ((DEBUG_INFO, " Format->Format.Format.wBitsPerSample =3D > %d\n", Format->Format.Format.wBitsPerSample)); >=20 > + DEBUG ((DEBUG_INFO, " Format->Format.Format.cbSize =3D %d\n", > Format->Format.Format.cbSize)); >=20 > + DEBUG ((DEBUG_INFO, " Format->Format.Samples =3D %d\n", > Format->Format.Samples)); >=20 > + DEBUG ((DEBUG_INFO, " Format->Format.dwChannelMask =3D > 0x%x\n", Format->Format.dwChannelMask)); >=20 > + DEBUG ((DEBUG_INFO, " Format->Format.SubFormat =3D %g\n", > Format->Format.SubFormat)); >=20 > + >=20 > + >=20 > + DEBUG ((DEBUG_INFO, " Format->FormatConfiguration.CapabilitiesSize =3D > %d B\n", Format->FormatConfiguration.CapabilitiesSize)); >=20 > + DEBUG ((DEBUG_VERBOSE, " Format- > >FormatConfiguration.Capabilities:")); >=20 > + for (Index =3D 0; Index < ( Format->FormatConfiguration.CapabilitiesS= ize ) ; > Index++) { >=20 > + if (Index % 16 =3D=3D 0) { >=20 > + DEBUG ((DEBUG_VERBOSE, "\n")); >=20 > + } >=20 > + DEBUG ((DEBUG_VERBOSE, "0x%02x, ", Format- > >FormatConfiguration.Capabilities[Index])); >=20 > + } >=20 > + DEBUG ((DEBUG_VERBOSE, "\n")); >=20 > +} >=20 > + >=20 > +/** >=20 > + Prints Device Information. >=20 > + >=20 > + @param[in] *DeviceInfo DeviceInfo to be printed >=20 > + >=20 > + @retval None >=20 > +**/ >=20 > +VOID >=20 > +NhltDeviceInfoDump ( >=20 > + IN CONST DEVICE_INFO *DeviceInfo >=20 > + ) >=20 > +{ >=20 > + DEBUG ((DEBUG_INFO, "----------------------------- DEVICE INFO -------= ------- > --------------\n")); >=20 > + DEBUG ((DEBUG_INFO, " DeviceInfo->DeviceId =3D %a\n", Device= Info- > >DeviceId)); >=20 > + DEBUG ((DEBUG_INFO, " DeviceInfo->DeviceInstanceId =3D 0x%x\n", > DeviceInfo->DeviceInstanceId)); >=20 > + DEBUG ((DEBUG_INFO, " DeviceInfo->DevicePortId =3D 0x%x\n", > DeviceInfo->DevicePortId)); >=20 > +} >=20 > + >=20 > +/** >=20 > + Prints Endpoint configuration. >=20 > + >=20 > + @param[in] *Endpoint Endpoint to be printed >=20 > + >=20 > + @retval None >=20 > +**/ >=20 > +VOID >=20 > +NhltEndpointDump ( >=20 > + IN CONST ENDPOINT_DESCRIPTOR *Endpoint >=20 > + ) >=20 > +{ >=20 > + UINT8 Index; >=20 > + FORMATS_CONFIG *FormatsConfigs; >=20 > + FORMAT_CONFIG *Format; >=20 > + DEVICES_INFO *DevicesInfo; >=20 > + DEVICE_INFO *DeviceInfo; >=20 > + >=20 > + DEBUG ((DEBUG_INFO, "------------------------------ ENDPOINT ---------= ------- > --------------\n")); >=20 > + DEBUG ((DEBUG_INFO, " Endpoint->DeviceDescriptorLength =3D %d B\n", > Endpoint->EndpointDescriptorLength)); >=20 > + DEBUG ((DEBUG_INFO, " Endpoint->LinkType =3D 0x%x\n", En= dpoint- > >LinkType)); >=20 > + DEBUG ((DEBUG_INFO, " Endpoint->InstanceId =3D 0x%x\n", > Endpoint->InstanceId)); >=20 > + DEBUG ((DEBUG_INFO, " Endpoint->HwVendorId =3D 0x%x\n", > Endpoint->HwVendorId)); >=20 > + DEBUG ((DEBUG_INFO, " Endpoint->HwDeviceId =3D 0x%x\n", > Endpoint->HwDeviceId)); >=20 > + DEBUG ((DEBUG_INFO, " Endpoint->HwRevisionId =3D 0x%x\n", > Endpoint->HwRevisionId)); >=20 > + DEBUG ((DEBUG_INFO, " Endpoint->HwSubsystemId =3D 0x%x\n", > Endpoint->HwSubsystemId)); >=20 > + DEBUG ((DEBUG_INFO, " Endpoint->DeviceType =3D 0x%x\n", > Endpoint->DeviceType)); >=20 > + DEBUG ((DEBUG_INFO, " Endpoint->Direction =3D 0x%x\n", En= dpoint- > >Direction)); >=20 > + DEBUG ((DEBUG_INFO, " Endpoint->VirtualBusId =3D 0x%x\n", > Endpoint->VirtualBusId)); >=20 > + >=20 > + DEBUG ((DEBUG_INFO, " Endpoint->EndpointConfig.CapabilitiesSize =3D %d > B\n", Endpoint->EndpointConfig.CapabilitiesSize)); >=20 > + DEBUG ((DEBUG_VERBOSE, " Endpoint->EndpointConfig.Capabilities:")); >=20 > + for (Index =3D 0; Index < (Endpoint->EndpointConfig.CapabilitiesSize )= ; > Index++) { >=20 > + if (Index % 16 =3D=3D 0) DEBUG ((DEBUG_VERBOSE, "\n")); >=20 > + DEBUG ((DEBUG_VERBOSE, "0x%02x, ", Endpoint- > >EndpointConfig.Capabilities[Index])); >=20 > + } >=20 > + >=20 > + FormatsConfigs =3D GetNhltEndpointFormatsConfig (Endpoint); >=20 > + >=20 > + DEBUG ((DEBUG_INFO, "\n")); >=20 > + DEBUG ((DEBUG_INFO, " Endpoint->FormatsConfig.FormatsCount =3D > %d\n", FormatsConfigs->FormatsCount)); >=20 > + for (Index =3D 0; Index < FormatsConfigs->FormatsCount; Index++) { >=20 > + Format =3D GetNhltEndpointFormat (Endpoint, Index); >=20 > + if (Format !=3D NULL) { >=20 > + NhltFormatDump (Format); >=20 > + } >=20 > + } >=20 > + >=20 > + DevicesInfo =3D GetNhltEndpointDevicesInfo (Endpoint); >=20 > + if (DevicesInfo !=3D NULL) { >=20 > + DEBUG ((DEBUG_INFO, "\n")); >=20 > + DEBUG ((DEBUG_INFO, " Endpoint->DevicesInfo.DeviceInfoCount =3D > %d\n", DevicesInfo->DeviceInfoCount)); >=20 > + for (Index =3D 0; Index < DevicesInfo->DeviceInfoCount; Index++) { >=20 > + DeviceInfo =3D GetNhltEndpointDeviceInfo (Endpoint, Index); >=20 > + if (DeviceInfo !=3D NULL) { >=20 > + NhltDeviceInfoDump (DeviceInfo); >=20 > + } >=20 > + } >=20 > + } >=20 > + DEBUG ((DEBUG_VERBOSE, "\n")); >=20 > +} >=20 > + >=20 > +/** >=20 > + Prints OED (Offload Engine Driver) configuration. >=20 > + >=20 > + @param[in] *OedConfig OED to be printed >=20 > + >=20 > + @retval None >=20 > +**/ >=20 > +VOID >=20 > +NhltOedConfigDump ( >=20 > + IN CONST SPECIFIC_CONFIG *OedConfig >=20 > + ) >=20 > +{ >=20 > + UINT8 Index; >=20 > + >=20 > + DEBUG ((DEBUG_INFO, "-------------------------- OED CONFIGURATION ----= -- > -------------------\n")); >=20 > + DEBUG ((DEBUG_INFO, " OedConfig->CapabilitiesSize =3D %d B\n", > OedConfig->CapabilitiesSize)); >=20 > + DEBUG ((DEBUG_VERBOSE, " OedConfig->Capabilities:")); >=20 > + for (Index =3D 0; Index < (OedConfig->CapabilitiesSize) ; Index++) { >=20 > + if (Index % 16 =3D=3D 0) DEBUG ((DEBUG_VERBOSE, "\n")); >=20 > + DEBUG ((DEBUG_VERBOSE, "0x%02x, ", OedConfig->Capabilities[Index])); >=20 > + } >=20 > + >=20 > + DEBUG ((DEBUG_VERBOSE, "\n")); >=20 > +} >=20 > + >=20 > +/** >=20 > + Prints NHLT (Non HDA-Link Table) to be exposed via ACPI (aka. OED > (Offload Engine Driver) Configuration Table). >=20 > + >=20 > + @param[in] *NhltTable The NHLT table to print >=20 > + >=20 > + @retval None >=20 > +**/ >=20 > +VOID >=20 > +NhltAcpiTableDump ( >=20 > + IN NHLT_ACPI_TABLE *NhltTable >=20 > + ) >=20 > +{ >=20 > + DEBUG_CODE_BEGIN (); >=20 > + UINT8 Index; >=20 > + >=20 > + DEBUG ((DEBUG_INFO, "\n")); >=20 > + DEBUG ((DEBUG_INFO, "--- NHLT ACPI Table Dump [OED (Offload Engine > Driver) Configuration] ---\n")); >=20 > + >=20 > + DEBUG ((DEBUG_INFO, "sizeof NHLT_ACPI_TABLE =3D %d B\n", sizeof > (NHLT_ACPI_TABLE))); >=20 > + DEBUG ((DEBUG_INFO, "sizeof EFI_ACPI_DESCRIPTION_HEADER =3D %d > B\n", sizeof (EFI_ACPI_DESCRIPTION_HEADER))); >=20 > + DEBUG ((DEBUG_INFO, "sizeof ENDPOINT_DESCRIPTOR =3D %d B\n", sizeof > (ENDPOINT_DESCRIPTOR))); >=20 > + DEBUG ((DEBUG_INFO, "sizeof SPECIFIC_CONFIG =3D %d B\n", sizeof > (SPECIFIC_CONFIG))); >=20 > + DEBUG ((DEBUG_INFO, "sizeof FORMATS_CONFIG =3D %d B\n", sizeof > (FORMATS_CONFIG))); >=20 > + DEBUG ((DEBUG_INFO, "sizeof FORMAT_CONFIG =3D %d B\n", sizeof > (FORMAT_CONFIG))); >=20 > + DEBUG ((DEBUG_INFO, "sizeof WAVEFORMATEXTENSIBLE =3D %d B\n", > sizeof (WAVEFORMATEXTENSIBLE))); >=20 > + DEBUG ((DEBUG_INFO, "sizeof DEVICES_INFO =3D %d B\n", sizeof > (DEVICES_INFO))); >=20 > + DEBUG ((DEBUG_INFO, "sizeof DEVICE_INFO =3D %d B\n", sizeof > (DEVICE_INFO))); >=20 > + >=20 > + DEBUG ((DEBUG_INFO, " NHLT_ACPI_TABLE Header.Signature =3D > 0x%08x\n", NhltTable->Header.Signature)); >=20 > + DEBUG ((DEBUG_INFO, " NHLT_ACPI_TABLE Header.Length =3D > 0x%08x\n", NhltTable->Header.Length)); >=20 > + DEBUG ((DEBUG_INFO, " NHLT_ACPI_TABLE Header.Revision =3D > 0x%02x\n", NhltTable->Header.Revision)); >=20 > + DEBUG ((DEBUG_INFO, " NHLT_ACPI_TABLE Header.Checksum =3D > 0x%02x\n", NhltTable->Header.Checksum)); >=20 > + DEBUG ((DEBUG_INFO, " NHLT_ACPI_TABLE Header.OemId =3D %a\n"= , > NhltTable->Header.OemId)); >=20 > + DEBUG ((DEBUG_INFO, " NHLT_ACPI_TABLE Header.OemTableId =3D > 0x%lx\n", NhltTable->Header.OemTableId)); >=20 > + DEBUG ((DEBUG_INFO, " NHLT_ACPI_TABLE Header.OemRevision =3D > 0x%08x\n", NhltTable->Header.OemRevision)); >=20 > + DEBUG ((DEBUG_INFO, " NHLT_ACPI_TABLE Header.CreatorId =3D > 0x%08x\n", NhltTable->Header.CreatorId)); >=20 > + DEBUG ((DEBUG_INFO, " NHLT_ACPI_TABLE Header.CreatorRevision =3D > 0x%08x\n", NhltTable->Header.CreatorRevision)); >=20 > + DEBUG ((DEBUG_INFO, "\n")); >=20 > + >=20 > + DEBUG ((DEBUG_INFO, " NHLT_ACPI_TABLE EndpointCount =3D %d\n", > NhltTable->EndpointCount)); >=20 > + for (Index =3D 0; Index < NhltTable->EndpointCount; Index++) { >=20 > + NhltEndpointDump (GetNhltEndpoint (NhltTable, Index)); >=20 > + } >=20 > + >=20 > + NhltOedConfigDump (GetNhltOedConfig (NhltTable)); >=20 > + DEBUG ((DEBUG_INFO, "-------------------------------------------------= ----------- > ----------\n")); >=20 > + >=20 > + DEBUG_CODE_END (); >=20 > +} >=20 > + >=20 > diff --git > a/Silicon/Intel/TigerlakeSiliconPkg/IpBlock/Hda/Library/DxeHdaNhltLib/Dxe= H > daNhltLib.inf > b/Silicon/Intel/TigerlakeSiliconPkg/IpBlock/Hda/Library/DxeHdaNhltLib/Dxe= H > daNhltLib.inf > new file mode 100644 > index 0000000000..a1574c3ab1 > --- /dev/null > +++ > b/Silicon/Intel/TigerlakeSiliconPkg/IpBlock/Hda/Library/DxeHdaNhltLib/Dxe= H > daNhltLib.inf > @@ -0,0 +1,31 @@ > +## @file >=20 > +# Component information file for HD Audio NHLT Library >=20 > +# >=20 > +# Copyright (c) 2021, Intel Corporation. All rights reserved.
>=20 > +# SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > +# >=20 > +## >=20 > + >=20 > +[Defines] >=20 > +INF_VERSION =3D 0x00010017 >=20 > +BASE_NAME =3D DxeHdaNhltLib >=20 > +FILE_GUID =3D DA915B7F-EE08-4C1D-B3D0-DE7C52AB155A >=20 > +VERSION_STRING =3D 1.0 >=20 > +MODULE_TYPE =3D BASE >=20 > +LIBRARY_CLASS =3D DxeHdaNhltLib >=20 > + >=20 > +[LibraryClasses] >=20 > +BaseLib >=20 > +DebugLib >=20 > +MemoryAllocationLib >=20 > +BaseMemoryLib >=20 > +PchInfoLib >=20 > +ConfigBlockLib >=20 > + >=20 > +[Packages] >=20 > +MdePkg/MdePkg.dec >=20 > +TigerlakeSiliconPkg/SiPkg.dec >=20 > + >=20 > +[Sources] >=20 > +DxeHdaNhltLib.c >=20 > + >=20 > diff --git > a/Silicon/Intel/TigerlakeSiliconPkg/IpBlock/Hda/LibraryPrivate/DxeHdaPoli= cy > Lib/DxeHdaPolicyLib.c > b/Silicon/Intel/TigerlakeSiliconPkg/IpBlock/Hda/LibraryPrivate/DxeHdaPoli= cy > Lib/DxeHdaPolicyLib.c > new file mode 100644 > index 0000000000..30843fab39 > --- /dev/null > +++ > b/Silicon/Intel/TigerlakeSiliconPkg/IpBlock/Hda/LibraryPrivate/DxeHdaPoli= cy > Lib/DxeHdaPolicyLib.c > @@ -0,0 +1,92 @@ > +/** @file >=20 > + This file provides services for Hda policy function >=20 > + >=20 > + Copyright (c) 2021, Intel Corporation. All rights reserved.
>=20 > + SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > +**/ >=20 > +#include >=20 > +#include >=20 > +#include >=20 > +#include >=20 > +#include >=20 > +#include >=20 > + >=20 > +/** >=20 > + Print HDAUDIO_DXE_CONFIG and serial out. >=20 > + >=20 > + @param[in] PchPolicy Pointer to a PCH_POLICY_PROTOCOL >=20 > +**/ >=20 > +VOID >=20 > +HdaDxePrintConfig ( >=20 > + IN PCH_POLICY_PROTOCOL *PchPolicy >=20 > + ) >=20 > +{ >=20 > + EFI_STATUS Status; >=20 > + HDAUDIO_DXE_CONFIG *HdaDxeConfig; >=20 > + UINT32 Index; >=20 > + >=20 > + Status =3D GetConfigBlock ((VOID *) PchPolicy, &gHdAudioDxeConfigGuid, > (VOID *) &HdaDxeConfig); >=20 > + ASSERT_EFI_ERROR (Status); >=20 > + >=20 > + DEBUG ((DEBUG_INFO, "------------------ HD-Audio DXE Config ----------= ----- > ---\n")); >=20 > + >=20 > + for (Index =3D 0; Index < PCH_MAX_HDA_SNDW_LINK_NUM; Index++) { >=20 > + DEBUG ((DEBUG_INFO, " SNDW%d AutonomousClockStop : %d\n", > Index, HdaDxeConfig->SndwConfig[Index].AutonomousClockStop)); >=20 > + DEBUG ((DEBUG_INFO, " SNDW%d DODS : %d\n", Index, > HdaDxeConfig->SndwConfig[Index].DataOnDelaySelect)); >=20 > + DEBUG ((DEBUG_INFO, " SNDW%d DOAS : %d\n", Index, > HdaDxeConfig->SndwConfig[Index].DataOnActiveIntervalSelect)); >=20 > + } >=20 > + DEBUG ((DEBUG_INFO, " DSP Feature Mask : 0x%x\n", > HdaDxeConfig->DspFeatureMask)); >=20 > +} >=20 > + >=20 > +/** >=20 > + Load Config block default >=20 > + >=20 > + @param[in] ConfigBlockPointer Pointer to config block >=20 > +**/ >=20 > +VOID >=20 > +HdaDxeLoadConfigDefault ( >=20 > + IN VOID *ConfigBlockPointer >=20 > + ) >=20 > +{ >=20 > + HDAUDIO_DXE_CONFIG *HdAudioDxeConfig; >=20 > + HdAudioDxeConfig =3D ConfigBlockPointer; >=20 > + >=20 > + DEBUG ((DEBUG_INFO, "HdaDxeConfig->Header.GuidHob.Name =3D %g\n", > &HdAudioDxeConfig->Header.GuidHob.Name)); >=20 > + DEBUG ((DEBUG_INFO, "HdaDxeConfig- > >Header.GuidHob.Header.HobLength =3D 0x%x\n", HdAudioDxeConfig- > >Header.GuidHob.Header.HobLength)); >=20 > +} >=20 > + >=20 > +STATIC COMPONENT_BLOCK_ENTRY mHdaBlocks =3D { >=20 > + &gHdAudioDxeConfigGuid, >=20 > + sizeof (HDAUDIO_DXE_CONFIG), >=20 > + HDAUDIO_DXE_CONFIG_REVISION, >=20 > + HdaDxeLoadConfigDefault >=20 > +}; >=20 > + >=20 > +/** >=20 > + Get Hda config block table size. >=20 > + >=20 > + @retval Size of config block >=20 > +**/ >=20 > +UINT16 >=20 > +HdaDxeGetConfigBlockTotalSize ( >=20 > + VOID >=20 > + ) >=20 > +{ >=20 > + return mHdaBlocks.Size; >=20 > +} >=20 > + >=20 > +/** >=20 > + Add Hda ConfigBlock. >=20 > + >=20 > + @param[in] ConfigBlockTableAddress The pointer to config block tabl= e >=20 > + >=20 > + @retval EFI_SUCCESS The policy default is initialize= d. >=20 > + @retval EFI_OUT_OF_RESOURCES Insufficient resources to create > buffer >=20 > +**/ >=20 > +EFI_STATUS >=20 > +HdaDxeAddConfigBlock ( >=20 > + IN VOID *ConfigBlockTableAddress >=20 > + ) >=20 > +{ >=20 > + return AddComponentConfigBlocks (ConfigBlockTableAddress, > &mHdaBlocks, 1); >=20 > +} >=20 > diff --git > a/Silicon/Intel/TigerlakeSiliconPkg/IpBlock/Hda/LibraryPrivate/DxeHdaPoli= cy > Lib/DxeHdaPolicyLib.inf > b/Silicon/Intel/TigerlakeSiliconPkg/IpBlock/Hda/LibraryPrivate/DxeHdaPoli= cy > Lib/DxeHdaPolicyLib.inf > new file mode 100644 > index 0000000000..758499b95e > --- /dev/null > +++ > b/Silicon/Intel/TigerlakeSiliconPkg/IpBlock/Hda/LibraryPrivate/DxeHdaPoli= cy > Lib/DxeHdaPolicyLib.inf > @@ -0,0 +1,31 @@ > +## @file >=20 > +# Component description file for the Hda policy library >=20 > +# >=20 > +# Copyright (c) 2021, Intel Corporation. All rights reserved.
>=20 > +# SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > +# >=20 > +## >=20 > + >=20 > + >=20 > +[Defines] >=20 > +INF_VERSION =3D 0x00010017 >=20 > +BASE_NAME =3D DxeHdaPolicyLib >=20 > +FILE_GUID =3D B053EFE4-0868-4510-A71D-96A85CD16C77 >=20 > +VERSION_STRING =3D 1.0 >=20 > +MODULE_TYPE =3D BASE >=20 > +LIBRARY_CLASS =3D DxeHdaPolicyLib >=20 > + >=20 > +[LibraryClasses] >=20 > +DebugLib >=20 > +ConfigBlockLib >=20 > +SiConfigBlockLib >=20 > + >=20 > +[Packages] >=20 > +MdePkg/MdePkg.dec >=20 > +TigerlakeSiliconPkg/SiPkg.dec >=20 > + >=20 > +[Sources] >=20 > +DxeHdaPolicyLib.c >=20 > + >=20 > +[Guids] >=20 > +gHdAudioDxeConfigGuid ## CONSUMES >=20 > -- > 2.24.0.windows.2