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.web10.4568.1612504369613385789 for ; Thu, 04 Feb 2021 21:52:49 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=nYJdBfdc; spf=pass (domain: intel.com, ip: 192.55.52.93, mailfrom: rangasai.v.chaganty@intel.com) IronPort-SDR: ej+WdrIVBdL35keptDlG0S7iQkpJj40GgIcAhGKKBNtEyeDIi9rviZzoUDi8hn6I5r3hzOvlks WzVArcWJpS0g== X-IronPort-AV: E=McAfee;i="6000,8403,9885"; a="177876847" X-IronPort-AV: E=Sophos;i="5.81,154,1610438400"; d="scan'208";a="177876847" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Feb 2021 21:52:48 -0800 IronPort-SDR: ddOTMV780FYR6jukQcgZwxTPYz9E7jIfC1KMwBVCF2ZTKnES5bgQiMFMOrDIbnS0hvhT+eMotU Z9+SZN6swh1A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,154,1610438400"; d="scan'208";a="373269633" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga002.jf.intel.com with ESMTP; 04 Feb 2021 21:52:47 -0800 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Thu, 4 Feb 2021 21:52:47 -0800 Received: from orsmsx602.amr.corp.intel.com (10.22.229.15) by ORSMSX607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Thu, 4 Feb 2021 21:52:46 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2 via Frontend Transport; Thu, 4 Feb 2021 21:52:46 -0800 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.174) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Thu, 4 Feb 2021 21:52:44 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FCChvxrxQDc9mdggUk3NtKuDHYDVFeAph3wQe3L+K35inFbOP/eaPeJTikLgRv5tUHfB7nGlc9klvDkGFEgAIm5kSX8cYJiqod3LOXYc+rFG/iKSUkfVzADLFtNoZ1ksFCntMEjo6P5KrSDUDTds3gwHlNTKGLrpMb5XG5JoH8mkCt0c4Np3M1AUbVF8JKIBk76Bl51U9HwpKJV3FjK8NzX/taITf24RqAniv25hVYAd/yyZv4DbRzo4AXaMRrFAm9J1439cbPHbbkXYm6BvMcsmIGKu6DQy3+Ri6aQf7ZZavHiPpzZyn7Ha0w/tv/6D3S7eqTVi9j4PjxuHxPmaoQ== 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=PymW6BDF3IzUSFZrcIhwttFEyCeCXZL25ggVk3ZRwiU=; b=Dw2t7lH6rbyZIvia6PJon22C0P8m0XjT2XuT18+6hdWo3+fCAW1GvNQ/nsvGAMyBczDBy4cWj5bpP25LYd0lSm1hh5RBtPa4PNYnehX0H6n9O7StIB6ydEwaiRrae9wBnRhqT0cuqVHsa8ZcOEFUb2o0jZgZdq9WVIa72qeDuEgr9ihvosVG7aEtRwrceSrlr6zIfiWNEVWDtI+yg3ZH2+iV8oMC1nerlNcJKDRybn3EDCtEq1gLZFimbSf2SIvcxd2FI0dStHGwONQKV3wwmo8yjRIUJwLGXF9oobI+E6dtXVFgDBMuydY2AXhfUIcipdNjZft8wskXdNSO1UJOJQ== 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=PymW6BDF3IzUSFZrcIhwttFEyCeCXZL25ggVk3ZRwiU=; b=nYJdBfdcKjMZOHwg2XZGHDljSsXeLAYr/TDxNxVXHitG+R2EzMHYUYYsPi6Snu4fzeF+rjtuwnJLwR/MtK/fCFuiPmWpFduAkctZI9jM1Zsi1jNE63zkpCFlayWLsYfeuK4F59rz4F9H7lDYmpDycacym443qROmNrzQOYz8GQk= Received: from DM6PR11MB4476.namprd11.prod.outlook.com (2603:10b6:5:201::24) by DM6PR11MB4380.namprd11.prod.outlook.com (2603:10b6:5:14e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3825.19; Fri, 5 Feb 2021 05:52:36 +0000 Received: from DM6PR11MB4476.namprd11.prod.outlook.com ([fe80::ccd3:477b:8451:b17d]) by DM6PR11MB4476.namprd11.prod.outlook.com ([fe80::ccd3:477b:8451:b17d%7]) with mapi id 15.20.3825.021; Fri, 5 Feb 2021 05:52:36 +0000 From: "Chaganty, Rangasai V" To: "Luo, Heng" , "devel@edk2.groups.io" CC: "Desimone, Nathaniel L" Subject: Re: [Patch V2 02/40] TigerlakeSiliconPkg/Include: Add Library, PPI and Protocol include headers Thread-Topic: [Patch V2 02/40] TigerlakeSiliconPkg/Include: Add Library, PPI and Protocol include headers Thread-Index: AQHW+tLdE+yna3RGWEeoQFIm3QmIjapJEIAQ Date: Fri, 5 Feb 2021 05:52:35 +0000 Message-ID: References: <20210204084919.3603-1-heng.luo@intel.com> <20210204084919.3603-2-heng.luo@intel.com> In-Reply-To: <20210204084919.3603-2-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.45.159.74] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 8e9700be-6c87-4a9b-37c5-08d8c99a3d26 x-ms-traffictypediagnostic: DM6PR11MB4380: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: A4NVVDbS+xFkonK312L79yGNGrxmOzrGqe8pnG9FtA9lVJR3aDMmZs+SYBjWRcHb0+t2ZpmbdfJmW4fqS71ty3+EgeD4i3kZygd9eC0nUL0gbanHG3uJ3UZC6hyjA1pzKXVlqZSVmsOMLcGubAK8KoWfEYtw1hJI0/0EjK2SOtsSClZtsXmeCssImTljD/93X88Jpla5GE3VTI6zoDLR7fVwSSIKqjl8dILgKyOwpiluYrrun0qxqb6+vcq3+UUion/xxLbN2+gP/MfoY64++5ojd9jk8x/ml0fl/9kAYpJABlYvdtTPAGseqiRlWu/Hu37rgDR/ONChARwmHd8EebN3AR6BtpsJPJJdgzwLWihH0BHq2LjC7i73uQrYYlfv54XmWTm0WOLXRzOa9EZFHksIttCYhApBB1ev3X9QpyRciXTSZPC6dea0Qz5roQQXLSrbVwlHl76r0oU/nuAD0zSpX2DFR6lqPP7IheFe7JWRMaJamWQlcJ8HoZWGYwOCMHLqRz1D+c74oJTB35RQ+Z1v+chIVXXnB7PSo9u582bDCHibQEP9doDQDfQeahrmF6bO9GyPoOOEv3siLadQ2J1FHQGzXw1IjHmXZIklA2SH7flxHoAN1r32rENpbPLdHu/QOZhbPYQooGbScqd21A== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR11MB4476.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(39860400002)(376002)(396003)(346002)(366004)(136003)(64756008)(66476007)(66556008)(86362001)(76116006)(66446008)(52536014)(5660300002)(55016002)(66946007)(33656002)(7696005)(2906002)(9686003)(8936002)(6506007)(83380400001)(110136005)(71200400001)(316002)(478600001)(53546011)(966005)(186003)(4326008)(19627235002)(8676002)(30864003)(26005)(107886003)(579004)(569008);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?EkFposGAD+80oTjlwVDnHjhcUoOacLZGMQHPLvZ+p4Xomi5EFXG/Br1iVKv9?= =?us-ascii?Q?QLVPx0eayn3kKFTTr6wEDBoYSKFEnPsf4c2CDBFfMEM15rXxRGDVYW2a0sUI?= =?us-ascii?Q?ZQ7D2gl2B7GBxGD2PfbWMEg87HaZwUUn3234UXfczbSpov+jtFDgkxDufFcp?= =?us-ascii?Q?3IHWA3GLmwc2GbgpVlg9+0MO3DWHOzF5EMgaxgIjWtgIayoyOat+dnVkR4Ua?= =?us-ascii?Q?fFAI9rUwd9Fq/AYTZzJLfWH1GDI6dsdeUDXRPjGIMs6c0PDJH/GPG5im5lM0?= =?us-ascii?Q?zfEZaM7mWSFoFRqIxoz/bInZ9Gv4pamtoEJuOH0Q3Jbv0KRdYTwScksQFJGd?= =?us-ascii?Q?G8MLIMtc2Gs58wx7wfpmZbWxR1/WfxImKqSoS7YS05nXcUg8fr+OQBb48A0S?= =?us-ascii?Q?NQSA2eCcmmZ6qv16qw88Tocff3H96u/jSj02MaXUPHuXLUD3nn1WNFyjgwqS?= =?us-ascii?Q?+LTSYCY+IKfplktBvo3zSOI9ZDsktHgriP1O4kUkRIkH6l4t/Y+bJxvSYTEj?= =?us-ascii?Q?9A+N/BGO7t/7MRUkPSKn/6lzW01DRfsJyxx4DPZ8fzHH8qaumnHfL2OeZNR3?= =?us-ascii?Q?q2HGqGtOK0XGR48hk4Ich/PgN9sacEVAyU6A7DBiCNYLSGA5iALh/ceeWXHw?= =?us-ascii?Q?B+7JauIi1EPdLG7BsAmbwGu5371dg8uNsZhjLfimHN7b+iyVpEhDdr4JgrqG?= =?us-ascii?Q?seihRFZ6pkRokSmmF2XLOGDXn5LGx0kOsDVkOF0QpKEx/FopjMCrklNhkbD/?= =?us-ascii?Q?K7A0QICjNVRuOA9808O58CIycIGILHeP0OEpSjYlZXKS/Rwqg6vUaW3xxYgo?= =?us-ascii?Q?FVD88UnExjvVszSLpDcAZYz7zbqAOvqtXbE3rjaODv5EdgesZLOGSiLmaf/F?= =?us-ascii?Q?bW77xGt93CvGZS0HnaCIkP4ib+7b9MCrH78WIazu4FPOEE7PhQMHPXr/Y4wN?= =?us-ascii?Q?2TB5QZFCXNb0OPXQOwNAg886GW0sDlFv5DeGKi99JY6s6+wv9Ko/hJw5yxDf?= =?us-ascii?Q?0mb+4KrlYKBDs1tMSLLAnkAbHQWKcvVqXxytfeugPK4whMttrJnF/KaCXyMl?= =?us-ascii?Q?ScnnDHYEVpR+vdvK7XW0lRseqNqnIMcPxhR6Jl3xQEsHJT1NjeQlr9K8ff9O?= =?us-ascii?Q?JrYSmJTnXX+zA8nLAjU+H8QkBbTCoAoxPV6fE+dQ7yaXoRUhDirZ/rDv5FIG?= =?us-ascii?Q?4cJoiu+MU+ItQQ+Ed2FvSWDF346n85/4c4X44y7n6r3HIM960ru8yB2O8M4D?= =?us-ascii?Q?TgDP8Wm5lE6zdXPsuZzI4GL4oYgXrS3v/CUDuO/vT9VisxPDDNxf+NcPLqfG?= =?us-ascii?Q?1HXQGDEJzlAK2O5rVgSq72QW?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB4476.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8e9700be-6c87-4a9b-37c5-08d8c99a3d26 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Feb 2021 05:52:35.8627 (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: B9qAroOZhL2ItGIHaFluXi8TLm7QTc999lba94zdEe+VK2RAqDkEvfsZX1vAvhRWm8wecJxbc7STKn5g+SDMypNmNi/xlVhy2S6EWpHIwyE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4380 Return-Path: rangasai.v.chaganty@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Sai Chaganty =20 -----Original Message----- From: Luo, Heng =20 Sent: Thursday, February 04, 2021 12:49 AM To: devel@edk2.groups.io Cc: Chaganty, Rangasai V ; Desimone, Nathani= el L Subject: [Patch V2 02/40] TigerlakeSiliconPkg/Include: Add Library, PPI and= Protocol include headers REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3171 Adds the following header files: * Include/Library * Include/Ppi * Include/Protocol Cc: Sai Chaganty Cc: Nate DeSimone Signed-off-by: Heng Luo --- Silicon/Intel/TigerlakeSiliconPkg/Include/Library/ConfigBlockLib.h |= 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Silicon/Intel/TigerlakeSiliconPkg/Include/Library/CpuRegbarAccessLib.h |= 332 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++ Silicon/Intel/TigerlakeSiliconPkg/Include/Library/DxeHdaNhltLib.h |= 153 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= ++++++++ Silicon/Intel/TigerlakeSiliconPkg/Include/Library/EspiLib.h |= 140 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Silicon/Intel/TigerlakeSiliconPkg/Include/Library/GbeLib.h |= 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Silicon/Intel/TigerlakeSiliconPkg/Include/Library/GpioConfig.h |= 342 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++ Silicon/Intel/TigerlakeSiliconPkg/Include/Library/GpioLib.h |= 720 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= ++++++++++++++++++++++++++++++++++++++++++++++++++ Silicon/Intel/TigerlakeSiliconPkg/Include/Library/GpioNativeLib.h |= 149 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= ++++ Silicon/Intel/TigerlakeSiliconPkg/Include/Library/MmPciLib.h |= 27 +++++++++++++++++++++++++++ Silicon/Intel/TigerlakeSiliconPkg/Include/Library/PchPcieRpLib.h |= 123 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++ Silicon/Intel/TigerlakeSiliconPkg/Include/Library/PchPcrLib.h |= 256 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= ++++++++++++++++++++++++++++++++++++ Silicon/Intel/TigerlakeSiliconPkg/Include/Library/PcieHelperLib.h |= 173 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= ++++++++++++++++++++++++++++ Silicon/Intel/TigerlakeSiliconPkg/Include/Library/PmcLib.h |= 355 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Silicon/Intel/TigerlakeSiliconPkg/Include/Library/ResetSystemLib.h |= 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++ Silicon/Intel/TigerlakeSiliconPkg/Include/Library/SataLib.h |= 112 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= ++++++++++++++++++++++++++++++++++++++++++ Silicon/Intel/TigerlakeSiliconPkg/Include/Library/SerialIoAccessLib.h |= 113 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++ Silicon/Intel/TigerlakeSiliconPkg/Include/Library/SiConfigBlockLib.h |= 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Silicon/Intel/TigerlakeSiliconPkg/Include/Library/SpiAccessLib.h |= 290 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Silicon/Intel/TigerlakeSiliconPkg/Include/Library/VtdInfoLib.h |= 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ Silicon/Intel/TigerlakeSiliconPkg/Include/Ppi/PeiPreMemSiDefaultPolicy.h |= 34 ++++++++++++++++++++++++++++++++++ Silicon/Intel/TigerlakeSiliconPkg/Include/Ppi/PeiSiDefaultPolicy.h |= 33 +++++++++++++++++++++++++++++++++ Silicon/Intel/TigerlakeSiliconPkg/Include/Ppi/SiPolicy.h |= 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++ Silicon/Intel/TigerlakeSiliconPkg/Include/Protocol/GopComponentName2.h |= 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Silicon/Intel/TigerlakeSiliconPkg/Include/Protocol/GopPolicy.h |= 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++ Silicon/Intel/TigerlakeSiliconPkg/Include/Protocol/IgdOpRegion.h |= 22 ++++++++++++++++++++++ Silicon/Intel/TigerlakeSiliconPkg/Include/Protocol/Spi.h |= 301 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= ++++++ 26 files changed, 4199 insertions(+) diff --git a/Silicon/Intel/TigerlakeSiliconPkg/Include/Library/ConfigBlockL= ib.h b/Silicon/Intel/TigerlakeSiliconPkg/Include/Library/ConfigBlockLib.h new file mode 100644 index 0000000000..dbf786ec9a --- /dev/null +++ b/Silicon/Intel/TigerlakeSiliconPkg/Include/Library/ConfigBlockLib.h @@ -0,0 +1,64 @@ +/** @file + Header file for Config Block Lib implementation + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#ifndef _CONFIG_BLOCK_LIB_H_ +#define _CONFIG_BLOCK_LIB_H_ + +/** + Create config block table + + @param[in] TotalSize - Max size to be allocated f= or the Config Block Table + @param[out] ConfigBlockTableAddress - On return, points to a poi= nter to the beginning of Config Block Table Address + + @retval EFI_INVALID_PARAMETER - Invalid Parameter + @retval EFI_OUT_OF_RESOURCES - Out of resources + @retval EFI_SUCCESS - Successfully created Config Block Table = at ConfigBlockTableAddress +**/ +EFI_STATUS +EFIAPI +CreateConfigBlockTable ( + IN UINT16 TotalSize, + OUT VOID **ConfigBlockTableAddress + ); + +/** + Add config block into config block table structure + + @param[in] ConfigBlockTableAddress - A pointer to the beginning= of Config Block Table Address + @param[out] ConfigBlockAddress - On return, points to a poi= nter to the beginning of Config Block Address + + @retval EFI_OUT_OF_RESOURCES - Config Block Table is full and cannot add= new Config Block or + Config Block Offset Table is full and can= not add new Config Block. + @retval EFI_SUCCESS - Successfully added Config Block +**/ +EFI_STATUS +EFIAPI +AddConfigBlock ( + IN VOID *ConfigBlockTableAddress, + OUT VOID **ConfigBlockAddress + ); + +/** + Retrieve a specific Config Block data by GUID + + @param[in] ConfigBlockTableAddress - A pointer to the beginnin= g of Config Block Table Address + @param[in] ConfigBlockGuid - A pointer to the GUID use= s to search specific Config Block + @param[out] ConfigBlockAddress - On return, points to a po= inter to the beginning of Config Block Address + + @retval EFI_NOT_FOUND - Could not find the Config Block + @retval EFI_SUCCESS - Config Block found and return +**/ +EFI_STATUS +EFIAPI +GetConfigBlock ( + IN VOID *ConfigBlockTableAddress, + IN EFI_GUID *ConfigBlockGuid, + OUT VOID **ConfigBlockAddress + ); + +#endif // _CONFIG_BLOCK_LIB_H_ + diff --git a/Silicon/Intel/TigerlakeSiliconPkg/Include/Library/CpuRegbarAcc= essLib.h b/Silicon/Intel/TigerlakeSiliconPkg/Include/Library/CpuRegbarAcces= sLib.h new file mode 100644 index 0000000000..564fcccb43 --- /dev/null +++ b/Silicon/Intel/TigerlakeSiliconPkg/Include/Library/CpuRegbarAccessLib.= h @@ -0,0 +1,332 @@ +/** @file + Header file for CPU REGBAR ACCESS library. + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ +#ifndef _CPU_REGBAR_ACCESS_LIB_H_ +#define _CPU_REGBAR_ACCESS_LIB_H_ + +#define INVALID_DATA_64 0xFFFFFFFFFFFFFFFF +#define INVALID_DATA_32 0xFFFFFFFF +#define INVALID_DATA_16 0xFFFF +#define INVALID_DATA_8 0xFF +#define INVALID_PID 0xFF + +typedef UINT8 CPU_SB_DEVICE_PID; + +/** + Read REGBAR register. + It returns REGBAR register and size in 8bytes. + The Offset should not exceed 0xFFFF and must be aligned with size. + + @param[in] CpuSbDevicePid CPU SB Device Port ID + @param[in] Offset Register offset of this Port ID + + @retval UINT64 REGBAR register value. +**/ +UINT64 +CpuRegbarRead64 ( + IN CPU_SB_DEVICE_PID CpuSbDevicePid, + IN UINT16 Offset + ); + + +/** + Read REGBAR register. + It returns REGBAR register and size in 4bytes. + The Offset should not exceed 0xFFFF and must be aligned with size. + + @param[in] CpuSbDevicePid CPU SB Device Port ID + @param[in] Offset Register offset of this Port ID + + @retval UINT32 REGBAR register value. +**/ +UINT32 +CpuRegbarRead32 ( + IN CPU_SB_DEVICE_PID CpuSbDevicePid, + IN UINT16 Offset + ); + +/** + Read REGBAR register. + It returns REGBAR register and size in 2bytes. + The Offset should not exceed 0xFFFF and must be aligned with size. + + @param[in] CpuSbDevicePid CPU SB Device Port ID + @param[in] Offset Register offset of this Port ID + + @retval UINT16 REGBAR register value. +**/ +UINT16 +CpuRegbarRead16 ( + IN CPU_SB_DEVICE_PID CpuSbDevicePid, + IN UINT16 Offset + ); + +/** + Read REGBAR register. + It returns REGBAR register and size in 1bytes. + The Offset should not exceed 0xFFFF and must be aligned with size. + + @param[in] CpuSbDevicePid CPU SB Device Port ID + @param[in] Offset Register offset of this Port ID + + @retval UINT8 REGBAR regsiter value +**/ +UINT8 +CpuRegbarRead8 ( + IN CPU_SB_DEVICE_PID CpuSbDevicePid, + IN UINT16 Offset + ); + +/** + Write REGBAR register. + It programs REGBAR register and size in 8bytes. + The Offset should not exceed 0xFFFF and must be aligned with size. + + @param[in] CpuSbDevicePid CPU SB Device Port ID + @param[in] Offset Register offset of Port ID. + @param[in] Data Input Data. Must be the same size as Size p= arameter. + + @retval UINT64 Value written to register +**/ +UINT64 +CpuRegbarWrite64 ( + IN CPU_SB_DEVICE_PID CpuSbDevicePid, + IN UINT16 Offset, + IN UINT64 Data + ); + + +/** + Write REGBAR register. + It programs REGBAR register and size in 4bytes. + The Offset should not exceed 0xFFFF and must be aligned with size. + + @param[in] CpuSbDevicePid CPU SB Device Port ID + @param[in] Offset Register offset of Port ID. + @param[in] Data Input Data. Must be the same size as Size p= arameter. + + @retval UINT32 Value written to register +**/ +UINT32 +CpuRegbarWrite32 ( + IN CPU_SB_DEVICE_PID CpuSbDevicePid, + IN UINT16 Offset, + IN UINT32 Data + ); + +/** + Write REGBAR register. + It programs REGBAR register and size in 2bytes. + The Offset should not exceed 0xFFFF and must be aligned with size. + + @param[in] CpuSbDevicePid CPU SB Device Port ID + @param[in] Offset Register offset of Port ID. + @param[in] Data Input Data. Must be the same size as Size p= arameter. + + @retval UINT16 Value written to register +**/ +UINT16 +CpuRegbarWrite16 ( + IN CPU_SB_DEVICE_PID CpuSbDevicePid, + IN UINT16 Offset, + IN UINT16 Data + ); + +/** + Write REGBAR register. + It programs REGBAR register and size in 1bytes. + The Offset should not exceed 0xFFFF and must be aligned with size. + + @param[in] CpuSbDevicePid CPU SB Device Port ID + @param[in] Offset Register offset of Port ID. + @param[in] Data Input Data. Must be the same size as Size p= arameter. + + @retval UINT8 Value written to register +**/ +UINT8 +CpuRegbarWrite8 ( + IN CPU_SB_DEVICE_PID CpuSbDevicePid, + IN UINT16 Offset, + IN UINT8 Data + ); + +/** + Write REGBAR register. + It programs REGBAR register and size in 4bytes. + The Offset should not exceed 0xFFFF and must be aligned with size. + + @param[in] CpuSbDevicePid CPU SB Device Port ID + @param[in] Offset Register offset of Port ID. + @param[in] OrData OR Data. Must be the same size as Size para= meter. + + @retval UINT32 Value written to register + +**/ +UINT32 +CpuRegbarOr32 ( + IN CPU_SB_DEVICE_PID CpuSbDevicePid, + IN UINT16 Offset, + IN UINT32 OrData + ); + +/** + Write REGBAR register. + It programs REGBAR register and size in 2bytes. + The Offset should not exceed 0xFFFF and must be aligned with size. + + @param[in] CpuSbDevicePid CPU SB Device Port ID + @param[in] Offset Register offset of Port ID. + @param[in] OrData OR Data. Must be the same size as Size para= meter. + + @retval UINT16 Value written to register + +**/ +UINT16 +CpuRegbarOr16 ( + IN CPU_SB_DEVICE_PID CpuSbDevicePid, + IN UINT16 Offset, + IN UINT16 OrData + ); + +/** + Write REGBAR register. + It programs REGBAR register and size in 1bytes. + The Offset should not exceed 0xFFFF and must be aligned with size. + + @param[in] CpuSbDevicePid CPU SB Device Port ID + @param[in] Offset Register offset of Port ID. + @param[in] OrData OR Data. Must be the same size as Size para= meter. + + @retval UINT8 Value written to register + +**/ +UINT8 +CpuRegbarOr8 ( + IN CPU_SB_DEVICE_PID CpuSbDevicePid, + IN UINT16 Offset, + IN UINT8 OrData + ); + +/** + Performs a bitwise AND of a 32-bit data. + It programs REGBAR register and size in 4bytes. + The Offset should not exceed 0xFFFF and must be aligned with size. + + @param[in] CpuSbDevice CPU SB Device + @param[in] Offset Register offset of Port ID. + @param[in] AndData And Data. Must be the same size as Size par= ameter. + + @retval UINT32 Value written to register + +**/ +UINT32 +CpuRegbarAnd32 ( + IN CPU_SB_DEVICE_PID CpuSbDevicePid, + IN UINT16 Offset, + IN UINT32 AndData + ); + +/** + Performs a bitwise AND of a 16-bit data. + It programs REGBAR register and size in 2bytes. + The Offset should not exceed 0xFFFF and must be aligned with size. + + @param[in] CpuSbDevice CPU SB Device + @param[in] Offset Register offset of Port ID. + @param[in] AndData And Data. Must be the same size as Size par= ameter. + + @retval UINT16 Value written to register + +**/ +UINT16 +CpuRegbarAnd16 ( + IN CPU_SB_DEVICE_PID CpuSbDevicePid, + IN UINT16 Offset, + IN UINT16 AndData + ); + +/** + Performs a bitwise AND of a 8-bit data. + It programs REGBAR register and size in 1byte. + The Offset should not exceed 0xFFFF and must be aligned with size. + + @param[in] CpuSbDevice CPU SB Device + @param[in] Offset Register offset of Port ID. + @param[in] AndData And Data. Must be the same size as Size par= ameter. + + @retval UINT8 Value written to register + +**/ +UINT8 +CpuRegbarAnd8 ( + IN CPU_SB_DEVICE_PID CpuSbDevicePid, + IN UINT16 Offset, + IN UINT8 AndData + ); +/** + Write REGBAR register. + It programs REGBAR register and size in 4bytes. + The Offset should not exceed 0xFFFF and must be aligned with size. + + @param[in] CpuSbDevicePid CPU SB Device Port ID + @param[in] Offset Register offset of Port ID. + @param[in] AndData AND Data. Must be the same size as Size par= ameter. + @param[in] OrData OR Data. Must be the same size as Size para= meter. + + @retval UINT32 Value written to register + +**/ +UINT32 +CpuRegbarAndThenOr32 ( + IN CPU_SB_DEVICE_PID CpuSbDevicePid, + IN UINT16 Offset, + IN UINT32 AndData, + IN UINT32 OrData + ); + +/** + Write REGBAR register. + It programs REGBAR register and size in 2bytes. + The Offset should not exceed 0xFFFF and must be aligned with size. + + @param[in] CpuSbDevicePid CPU SB Device Port ID + @param[in] Offset Register offset of Port ID. + @param[in] AndData AND Data. Must be the same size as Size par= ameter. + @param[in] OrData OR Data. Must be the same size as Size para= meter. + + @retval UINT16 Value written to register + +**/ +UINT16 +CpuRegbarAndThenOr16 ( + IN CPU_SB_DEVICE_PID CpuSbDevicePid, + IN UINT16 Offset, + IN UINT16 AndData, + IN UINT16 OrData + ); + +/** + Write REGBAR register. + It programs REGBAR register and size in 1bytes. + The Offset should not exceed 0xFFFF and must be aligned with size. + + @param[in] CpuSbDevicePid CPU SB Device Port ID + @param[in] Offset Register offset of Port ID. + @param[in] AndData AND Data. Must be the same size as Size par= ameter. + @param[in] OrData OR Data. Must be the same size as Size para= meter. + + @retval UINT8 Value written to register + +**/ +UINT8 +CpuRegbarAndThenOr8 ( + IN CPU_SB_DEVICE_PID CpuSbDevicePid, + IN UINT16 Offset, + IN UINT8 AndData, + IN UINT8 OrData + ); + +#endif diff --git a/Silicon/Intel/TigerlakeSiliconPkg/Include/Library/DxeHdaNhltLi= b.h b/Silicon/Intel/TigerlakeSiliconPkg/Include/Library/DxeHdaNhltLib.h new file mode 100644 index 0000000000..c48ea3667f --- /dev/null +++ b/Silicon/Intel/TigerlakeSiliconPkg/Include/Library/DxeHdaNhltLib.h @@ -0,0 +1,153 @@ +/** @file + Prototype of the DxePchHdaNhltLib library. + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#ifndef _DXE_HDA_NHLT_LIB_H_ +#define _DXE_HDA_NHLT_LIB_H_ + +#include + +/** + Returns pointer to Endpoint ENDPOINT_DESCRIPTOR structure. + + @param[in] *NhltTable Endpoint for which Format address is retrieved + @param[in] FormatIndex Index of Format to be retrieved + + @retval Pointer to ENDPOINT_DESCRIPTOR structure with g= iven index +**/ +ENDPOINT_DESCRIPTOR * +GetNhltEndpoint ( + IN CONST NHLT_ACPI_TABLE *NhltTable, + IN CONST UINT8 EndpointIndex + ); + +/** + Returns pointer to Endpoint Specific Configuration SPECIFIC_CONFIG struc= ture. + + @param[in] *Endpoint Endpoint for which config address is retrieved + + @retval Pointer to SPECIFIC_CONFIG structure with endpo= int's capabilities +**/ +SPECIFIC_CONFIG * +GetNhltEndpointDeviceCapabilities ( + IN CONST ENDPOINT_DESCRIPTOR *Endpoint + ); + +/** + Returns pointer to all Formats Configuration FORMATS_CONFIG structure. + + @param[in] *Endpoint Endpoint for which Formats address is retrieved + + @retval Pointer to FORMATS_CONFIG structure +**/ +FORMATS_CONFIG * +GetNhltEndpointFormatsConfig ( + IN CONST ENDPOINT_DESCRIPTOR *Endpoint + ); + +/** + Returns pointer to Format Configuration FORMAT_CONFIG structure. + + @param[in] *Endpoint Endpoint for which Format address is retrieved + @param[in] FormatIndex Index of Format to be retrieved + + @retval Pointer to FORMAT_CONFIG structure with given i= ndex +**/ +FORMAT_CONFIG * +GetNhltEndpointFormat ( + IN CONST ENDPOINT_DESCRIPTOR *Endpoint, + IN CONST UINT8 FormatIndex + ); + +/** + Returns pointer to all Device Information DEVICES_INFO structure. + + @param[in] *Endpoint Endpoint for which DevicesInfo address is retri= eved + + @retval Pointer to DEVICES_INFO structure +**/ +DEVICES_INFO * +GetNhltEndpointDevicesInfo ( + IN CONST ENDPOINT_DESCRIPTOR *Endpoint + ); + +/** + Returns pointer to Device Information DEVICES_INFO structure. + + @param[in] *Endpoint Endpoint for which Device Info address is ret= rieved + @param[in] DeviceInfoIndex Index of Device Info to be retrieved + + @retval Pointer to DEVICE_INFO structure with given i= ndex +**/ +DEVICE_INFO * +GetNhltEndpointDeviceInfo ( + IN CONST ENDPOINT_DESCRIPTOR *Endpoint, + IN CONST UINT8 DeviceInfoIndex + ); + + +/** + Returns pointer to OED Configuration SPECIFIC_CONFIG structure. + + @param[in] *NhltTable NHLT table for which OED address is retrieved + + @retval Pointer to SPECIFIC_CONFIG structure with NHLT = capabilities +**/ +SPECIFIC_CONFIG * +GetNhltOedConfig ( + IN CONST NHLT_ACPI_TABLE *NhltTable + ); + +/** + Prints Format configuration. + + @param[in] *Format Format to be printed + + @retval None +**/ +VOID +NhltFormatDump ( + IN CONST FORMAT_CONFIG *Format + ); + + +/** + Prints Endpoint configuration. + + @param[in] *Endpoint Endpoint to be printed + + @retval None +**/ +VOID +NhltEndpointDump ( + IN CONST ENDPOINT_DESCRIPTOR *Endpoint + ); + +/** + Prints OED (Offload Engine Driver) configuration. + + @param[in] *OedConfig OED to be printed + + @retval None +**/ +VOID +NhltOedConfigDump ( + IN CONST SPECIFIC_CONFIG *OedConfig + ); + +/** + Prints NHLT (Non HDA-Link Table) to be exposed via ACPI (aka. OED (Offlo= ad Engine Driver) Configuration Table). + + @param[in] *NhltTable The NHLT table to print + + @retval None +**/ +VOID +NhltAcpiTableDump ( + IN NHLT_ACPI_TABLE *NhltTable + ); + +#endif // _DXE_HDA_NHLT_LIB_H_ diff --git a/Silicon/Intel/TigerlakeSiliconPkg/Include/Library/EspiLib.h b/= Silicon/Intel/TigerlakeSiliconPkg/Include/Library/EspiLib.h new file mode 100644 index 0000000000..6d8466ab7a --- /dev/null +++ b/Silicon/Intel/TigerlakeSiliconPkg/Include/Library/EspiLib.h @@ -0,0 +1,140 @@ +/** @file + Header file for PchEspiLib. + All function in this library is available for PEI, DXE, and SMM, + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#ifndef _ESPI_LIB_H_ +#define _ESPI_LIB_H_ + +/** + Checks if there's second slave connected under CS#1 + + @retval TRUE There's second slave + @retval FALSE There's no second slave +**/ +BOOLEAN +IsEspiSecondSlaveSupported ( + VOID + ); + +/** + Checks in slave General Capabilities register if it supports channel wit= h requested number + + @param[in] SlaveId Id of slave to check + @param[in] ChannelNumber Number of channel of which to check + + @retval TRUE Channel with requested number is supported by slave de= vice + @retval FALSE Channel with requested number is not supported by slav= e device +**/ +BOOLEAN +IsEspiSlaveChannelSupported ( + UINT8 SlaveId, + UINT8 ChannelNumber + ); + +/** + Is eSPI enabled in strap. + + @retval TRUE Espi is enabled in strap + @retval FALSE Espi is disabled in strap +**/ +BOOLEAN +IsEspiEnabled ( + VOID + ); + +/** + Get configuration from eSPI slave + + @param[in] SlaveId eSPI slave ID + @param[in] SlaveAddress Slave Configuration Register Address + @param[out] OutData Configuration data read + + @retval EFI_SUCCESS Operation succeed + @retval EFI_INVALID_PARAMETER Slave ID is not supported + @retval EFI_INVALID_PARAMETER Slave ID is not supported or SlaveId 1 is = used in PchLp + @retval EFI_INVALID_PARAMETER Slave configuration register address excee= d maximum allowed + @retval EFI_INVALID_PARAMETER Slave configuration register address is no= t DWord aligned + @retval EFI_DEVICE_ERROR Error in SCRS during polling stage of oper= ation +**/ +EFI_STATUS +PchEspiSlaveGetConfig ( + IN UINT32 SlaveId, + IN UINT32 SlaveAddress, + OUT UINT32 *OutData + ); + +/** + Set eSPI slave configuration + + Note: A Set_Configuration must always be followed by a Get_Configuration= in order to ensure + that the internal state of the eSPI-MC is consistent with the Slave's re= gister settings. + + @param[in] SlaveId eSPI slave ID + @param[in] SlaveAddress Slave Configuration Register Address + @param[in] InData Configuration data to write + + @retval EFI_SUCCESS Operation succeed + @retval EFI_INVALID_PARAMETER Slave ID is not supported or SlaveId 1 is = used in PchLp + @retval EFI_INVALID_PARAMETER Slave configuration register address excee= d maximum allowed + @retval EFI_INVALID_PARAMETER Slave configuration register address is no= t DWord aligned + @retval EFI_ACCESS_DENIED eSPI Slave write to address range 0 to 0x7= FF has been locked + @retval EFI_DEVICE_ERROR Error in SCRS during polling stage of oper= ation +**/ +EFI_STATUS +PchEspiSlaveSetConfig ( + IN UINT32 SlaveId, + IN UINT32 SlaveAddress, + IN UINT32 InData + ); + +/** + Get status from eSPI slave + + @param[in] SlaveId eSPI slave ID + @param[out] OutData Configuration data read + + @retval EFI_SUCCESS Operation succeed + @retval EFI_INVALID_PARAMETER Slave ID is not supported or SlaveId 1 is = used in PchLp + @retval EFI_DEVICE_ERROR Error in SCRS during polling stage of oper= ation +**/ +EFI_STATUS +PchEspiSlaveGetStatus ( + IN UINT32 SlaveId, + OUT UINT16 *OutData + ); + +/** + eSPI slave in-band reset + + @param[in] SlaveId eSPI slave ID + + @retval EFI_SUCCESS Operation succeed + @retval EFI_INVALID_PARAMETER Slave ID is not supported or SlaveId 1 is = used in PchLp + @retval EFI_DEVICE_ERROR Error in SCRS during polling stage of oper= ation +**/ +EFI_STATUS +PchEspiSlaveInBandReset ( + IN UINT32 SlaveId + ); + +/** + eSPI Slave channel reset helper function + + @param[in] SlaveId eSPI slave ID + @param[in] ChannelNumber Number of channel to reset + + @retval EFI_SUCCESS Operation succeeded + @retval EFI_UNSUPPORTED Slave doesn't support that channel or inva= lid number specified + @retval EFI_TIMEOUT Operation has timeouted +**/ +EFI_STATUS +PchEspiSlaveChannelReset ( + IN UINT8 SlaveId, + IN UINT8 ChannelNumber + ); + +#endif // _ESPI_LIB_H_ diff --git a/Silicon/Intel/TigerlakeSiliconPkg/Include/Library/GbeLib.h b/S= ilicon/Intel/TigerlakeSiliconPkg/Include/Library/GbeLib.h new file mode 100644 index 0000000000..9d72b9ac7c --- /dev/null +++ b/Silicon/Intel/TigerlakeSiliconPkg/Include/Library/GbeLib.h @@ -0,0 +1,63 @@ +/** @file + Header file for GbeLib. + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ +#ifndef _GBE_LIB_H_ +#define _GBE_LIB_H_ + +/** + Check whether GbE region is valid + Check SPI region directly since GbE might be disabled in SW. + + @retval TRUE Gbe Region is valid + @retval FALSE Gbe Region is invalid +**/ +BOOLEAN +IsGbeRegionValid ( + VOID + ); + +/** + Check whether GBE controller is enabled in the platform. + + @retval TRUE GbE is enabled + @retval FALSE GbE is disabled +**/ +BOOLEAN +IsGbePresent ( + VOID + ); + +/** + Checks if Gbe is Enabled or Disabled + + @retval BOOLEAN TRUE if device is enabled, FALSE otherwise. +**/ +BOOLEAN +IsGbeEnabled ( + VOID + ); + +/** + Returns Gigabit Ethernet PCI Device Number + + @retval GbE device number +**/ +UINT8 +GbeDevNumber ( + VOID + ); + +/** + Returns Gigabit Ethernet PCI Function Number + + @retval GbE function number +**/ +UINT8 +GbeFuncNumber ( + VOID + ); + +#endif // _GBE_LIB_H_ diff --git a/Silicon/Intel/TigerlakeSiliconPkg/Include/Library/GpioConfig.h= b/Silicon/Intel/TigerlakeSiliconPkg/Include/Library/GpioConfig.h new file mode 100644 index 0000000000..88a21efb32 --- /dev/null +++ b/Silicon/Intel/TigerlakeSiliconPkg/Include/Library/GpioConfig.h @@ -0,0 +1,342 @@ +/** @file + Header file for GpioConfig structure used by GPIO library. + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ +#ifndef _GPIO_CONFIG_H_ +#define _GPIO_CONFIG_H_ + +#pragma pack(push, 1) + +/// +/// For any GpioPad usage in code use GPIO_PAD type +/// +typedef UINT32 GPIO_PAD; + +/// +/// GpioPad with additional native function information. +/// This type is used to represent signal muxing alternatives. Platform wi= ll provide such value to +/// identify muxing selection for given signal on a specific SOC. +/// Please refer to the board layout +/// +typedef UINT32 GPIO_NATIVE_PAD; + + +/// +/// For any GpioGroup usage in code use GPIO_GROUP type +/// +typedef UINT32 GPIO_GROUP; + +/** + GPIO configuration structure used for pin programming. + Structure contains fields that can be used to configure pad. +**/ +typedef struct { + /** + Pad Mode + Pad can be set as GPIO or one of its native functions. + When in native mode setting Direction (except Inversion), OutputState, + InterruptConfig, Host Software Pad Ownership and OutputStateLock are unn= ecessary. + Refer to definition of GPIO_PAD_MODE. + Refer to EDS for each native mode according to the pad. + **/ + UINT32 PadMode : 5; + /** + Host Software Pad Ownership + Set pad to ACPI mode or GPIO Driver Mode. + Refer to definition of GPIO_HOSTSW_OWN. + **/ + UINT32 HostSoftPadOwn : 2; + /** + GPIO Direction + Can choose between In, In with inversion, Out, both In and Out, both In = with inversion and out or disabling both. + Refer to definition of GPIO_DIRECTION for supported settings. + **/ + UINT32 Direction : 6; + /** + Output State + Set Pad output value. + Refer to definition of GPIO_OUTPUT_STATE for supported settings. + This setting takes place when output is enabled. + **/ + UINT32 OutputState : 2; + /** + GPIO Interrupt Configuration + Set Pad to cause one of interrupts (IOxAPIC/SCI/SMI/NMI). + This setting is applicable only if GPIO is in GpioMode with input enable= d. + Refer to definition of GPIO_INT_CONFIG for supported settings. + **/ + UINT32 InterruptConfig : 9; + /** + GPIO Power Configuration. + This setting controls Pad Reset Configuration. + Refer to definition of GPIO_RESET_CONFIG for supported settings. + **/ + UINT32 PowerConfig : 8; + /** + GPIO Electrical Configuration + This setting controls pads termination. + Refer to definition of GPIO_ELECTRICAL_CONFIG for supported settings. + **/ + UINT32 ElectricalConfig : 9; + /** + GPIO Lock Configuration + This setting controls pads lock. + Refer to definition of GPIO_LOCK_CONFIG for supported settings. + **/ + UINT32 LockConfig : 4; + /** + Additional GPIO configuration + Refer to definition of GPIO_OTHER_CONFIG for supported settings. + **/ + UINT32 OtherSettings : 9; + + UINT32 RsvdBits : 10; ///< Reserved bits for future extensi= on +} GPIO_CONFIG; + + +typedef enum { + GpioHardwareDefault =3D 0x0 ///< Leave setting unmodified +} GPIO_HARDWARE_DEFAULT; + +/** + GPIO Pad Mode + Refer to GPIO documentation on native functions available for certain pa= d. + If GPIO is set to one of NativeX modes then following settings are not a= pplicable + and can be skipped: + - Interrupt related settings + - Host Software Ownership + - Output/Input enabling/disabling + - Output lock +**/ +typedef enum { + GpioPadModeHwDefault =3D 0x0, + GpioPadModeGpio =3D 0x1, + GpioPadModeNative1 =3D 0x3, + GpioPadModeNative2 =3D 0x5, + GpioPadModeNative3 =3D 0x7, + GpioPadModeNative4 =3D 0x9, + GpioPadModeNative5 =3D 0xB, + GpioPadModeNative6 =3D 0xD, + GpioPadModeNative7 =3D 0xF +} GPIO_PAD_MODE; + +/** + Host Software Pad Ownership modes + This setting affects GPIO interrupt status registers. Depending on chose= n ownership + some GPIO Interrupt status register get updated and other masked. + Please refer to EDS for HOSTSW_OWN register description. +**/ +typedef enum { + GpioHostOwnDefault =3D 0x0, ///< Leave ownership value unmodified + /** + Set HOST ownership to ACPI. + Use this setting if pad is not going to be used by GPIO OS driver. + If GPIO is configured to generate SCI/SMI/NMI then this setting must be + used for interrupts to work + **/ + GpioHostOwnAcpi =3D 0x1, + /** + Set HOST ownership to GPIO Driver mode. + Use this setting only if GPIO pad should be controlled by GPIO OS Driver= . + GPIO OS Driver will be able to control the pad if appropriate entry in + ACPI exists (refer to ACPI specification for GpioIo and GpioInt descript= ors) + **/ + GpioHostOwnGpio =3D 0x3 +} GPIO_HOSTSW_OWN; + +/// +/// GPIO Direction +/// +typedef enum { + GpioDirDefault =3D 0x0, ///< Leave pad direction = setting unmodified + GpioDirInOut =3D (0x1 | (0x1 << 3)), ///< Set pad for both out= put and input + GpioDirInInvOut =3D (0x1 | (0x3 << 3)), ///< Set pad for both out= put and input with inversion + GpioDirIn =3D (0x3 | (0x1 << 3)), ///< Set pad for input on= ly + GpioDirInInv =3D (0x3 | (0x3 << 3)), ///< Set pad for input wi= th inversion + GpioDirOut =3D 0x5, ///< Set pad for output o= nly + GpioDirNone =3D 0x7 ///< Disable both output = and input +} GPIO_DIRECTION; + +/** + GPIO Output State + This field is relevant only if output is enabled +**/ +typedef enum { + GpioOutDefault =3D 0x0, ///< Leave output value unmodified + GpioOutLow =3D 0x1, ///< Set output to low + GpioOutHigh =3D 0x3 ///< Set output to high +} GPIO_OUTPUT_STATE; + +/** + GPIO interrupt configuration + This setting is applicable only if pad is in GPIO mode and has input ena= bled. + GPIO_INT_CONFIG allows to choose which interrupt is generated (IOxAPIC/S= CI/SMI/NMI) + and how it is triggered (edge or level). Refer to PADCFG_DW0 register de= scription in + EDS for details on this settings. + Field from GpioIntNmi to GpioIntApic can be OR'ed with GpioIntLevel to G= pioIntBothEdge + to describe an interrupt e.g. GpioIntApic | GpioIntLevel + If GPIO is set to cause an SCI then also GPI_GPE_EN is enabled for this = pad. + If GPIO is set to cause an NMI then also GPI_NMI_EN is enabled for this = pad. + Not all GPIO are capable of generating an SMI or NMI interrupt. + When routing GPIO to cause an IOxAPIC interrupt care must be taken, as t= his + interrupt cannot be shared and its IRQn number is not configurable. + Refer to EDS for GPIO pads IRQ numbers (PADCFG_DW1.IntSel) + If GPIO is under GPIO OS driver control and appropriate ACPI GpioInt des= criptor + exist then use only trigger type setting (from GpioIntLevel to GpioIntBo= thEdge). + This type of GPIO Driver interrupt doesn't have any additional routing s= etting + required to be set by BIOS. Interrupt is handled by GPIO OS Driver. +**/ + +typedef enum { + GpioIntDefault =3D 0x0, ///< Leave value of interrupt routing= unmodified + GpioIntDis =3D 0x1, ///< Disable IOxAPIC/SCI/SMI/NMI inte= rrupt generation + GpioIntNmi =3D 0x3, ///< Enable NMI interrupt only + GpioIntSmi =3D 0x5, ///< Enable SMI interrupt only + GpioIntSci =3D 0x9, ///< Enable SCI interrupt only + GpioIntApic =3D 0x11, ///< Enable IOxAPIC interrupt only + GpioIntLevel =3D (0x1 << 5), ///< Set interrupt as level triggered + GpioIntEdge =3D (0x3 << 5), ///< Set interrupt as edge triggered = (type of edge depends on input inversion) + GpioIntLvlEdgDis =3D (0x5 << 5), ///< Disable interrupt trigger + GpioIntBothEdge =3D (0x7 << 5) ///< Set interrupt as both edge trigg= ered +} GPIO_INT_CONFIG; + +#define B_GPIO_INT_CONFIG_INT_SOURCE_MASK 0x1F ///< Mask for GPIO_INT_CON= FIG for interrupt source +#define B_GPIO_INT_CONFIG_INT_TYPE_MASK 0xE0 ///< Mask for GPIO_INT_CON= FIG for interrupt type + +/** + GPIO Power Configuration + GPIO_RESET_CONFIG allows to set GPIO Reset type (PADCFG_DW0.PadRstCfg) w= hich will + be used to reset certain GPIO settings. + Refer to EDS for settings that are controllable by PadRstCfg. +**/ +typedef enum { + GpioResetDefault =3D 0x00, ///< Leave value of pad reset unmodi= fied + /** + Resume Reset (RSMRST) + GPP: PadRstCfg =3D 00b =3D "Powergood" + GPD: PadRstCfg =3D 11b =3D "Resume Reset" + Pad setting will reset on: + - DeepSx transition + - G3 + Pad settings will not reset on: + - S3/S4/S5 transition + - Warm/Cold/Global reset + **/ + GpioResumeReset =3D 0x01, + /** + Host Deep Reset + PadRstCfg =3D 01b =3D "Deep GPIO Reset" + Pad settings will reset on: + - Warm/Cold/Global reset + - DeepSx transition + - G3 + Pad settings will not reset on: + - S3/S4/S5 transition + **/ + GpioHostDeepReset =3D 0x03, + /** + Platform Reset (PLTRST) + PadRstCfg =3D 10b =3D "GPIO Reset" + Pad settings will reset on: + - S3/S4/S5 transition + - Warm/Cold/Global reset + - DeepSx transition + - G3 + **/ + GpioPlatformReset =3D 0x05, + /** + Deep Sleep Well Reset (DSW_PWROK) + GPP: not applicable + GPD: PadRstCfg =3D 00b =3D "Powergood" + Pad settings will reset on: + - G3 + Pad settings will not reset on: + - S3/S4/S5 transition + - Warm/Cold/Global reset + - DeepSx transition + **/ + GpioDswReset =3D 0x07 +} GPIO_RESET_CONFIG; + +/** + GPIO Electrical Configuration + Configuration options for GPIO termination setting +**/ +typedef enum { + GpioTermDefault =3D 0x0, ///< Leave termination setting unmodi= fied + GpioTermNone =3D 0x1, ///< none + GpioTermWpd5K =3D 0x5, ///< 5kOhm weak pull-down + GpioTermWpd20K =3D 0x9, ///< 20kOhm weak pull-down + GpioTermWpu1K =3D 0x13, ///< 1kOhm weak pull-up + GpioTermWpu2K =3D 0x17, ///< 2kOhm weak pull-up + GpioTermWpu5K =3D 0x15, ///< 5kOhm weak pull-up + GpioTermWpu20K =3D 0x19, ///< 20kOhm weak pull-up + GpioTermWpu1K2K =3D 0x1B, ///< 1kOhm & 2kOhm weak pull-up + /** + Native function controls pads termination + This setting is applicable only to some native modes. + Please check EDS to determine which native functionality + can control pads termination + **/ + GpioTermNative =3D 0x1F +} GPIO_ELECTRICAL_CONFIG; + +#define B_GPIO_ELECTRICAL_CONFIG_TERMINATION_MASK 0x1F ///< Mask for = GPIO_ELECTRICAL_CONFIG for termination value + +/** + GPIO LockConfiguration + Set GPIO configuration lock and output state lock. + GpioPadConfigUnlock/Lock and GpioOutputStateUnlock can be OR'ed. + By default GPIO pads will be locked unless GPIO lib is explicitly + informed that certain pad is to be left unlocked. + Lock settings reset is in Powergood domain. Care must be taken when usin= g this setting + as fields it locks may be reset by a different signal and can be control= led + by what is in GPIO_RESET_CONFIG (PADCFG_DW0.PadRstCfg). GPIO library pro= vides + functions which allow to unlock a GPIO pad. If possible each GPIO lib fu= nction will try to unlock + an already locked pad upon request for reconfiguration +**/ +typedef enum { + /** + Perform default action + - if pad is an GPO, lock configuration but leave output unlocked + - if pad is an GPI, lock everything + - if pad is in native, lock everything +**/ + GpioLockDefault =3D 0x0, + GpioPadConfigUnlock =3D 0x3, ///< Leave Pad configuration unlocked + GpioPadConfigLock =3D 0x1, ///< Lock Pad configuration + GpioOutputStateUnlock =3D 0xC, ///< Leave Pad output control unlocked + GpioPadUnlock =3D 0xF, ///< Leave both Pad configuration and = output control unlocked + GpioPadLock =3D 0x5, ///< Lock both Pad configuration and o= utput control + /** + Below statuses are used for + return from GpioGetPadConfig function + **/ + GpioLockTxLockCfgUnLock =3D 0x7, ///< Tx State locked, Pad Configuratio= n unlocked + GpioLockTxUnLockCfgLock =3D 0xD ///< Tx State unlocked, Pad Configurat= ion locked +} GPIO_LOCK_CONFIG; + +#define B_GPIO_LOCK_CONFIG_PAD_CONF_LOCK_MASK 0x3 ///< Mask for GPIO_LOC= K_CONFIG for Pad Configuration Lock +#define B_GPIO_LOCK_CONFIG_OUTPUT_LOCK_MASK 0xC ///< Mask for GPIO_LOC= K_CONFIG for Pad Output Lock + +/** + Other GPIO Configuration + GPIO_OTHER_CONFIG is used for less often settings and for future extensi= ons + Supported settings: + - RX raw override to '1' - allows to override input value to '1' + This setting is applicable only if in input mode (both in GPIO and n= ative usage). + The override takes place at the internal pad state directly from buf= fer and before the RXINV. +**/ +typedef enum { + GpioRxRaw1Default =3D 0x0, ///< Use default input override va= lue + GpioRxRaw1Dis =3D 0x1, ///< Don't override input + GpioRxRaw1En =3D 0x3 ///< Override input to '1' +} GPIO_OTHER_CONFIG; + +#define B_GPIO_OTHER_CONFIG_RXRAW_MASK 0x3 ///< Mask for GPIO_= OTHER_CONFIG for RxRaw1 setting + +#pragma pack(pop) + +#endif //_GPIO_CONFIG_H_ diff --git a/Silicon/Intel/TigerlakeSiliconPkg/Include/Library/GpioLib.h b/= Silicon/Intel/TigerlakeSiliconPkg/Include/Library/GpioLib.h new file mode 100644 index 0000000000..5b3cf502a0 --- /dev/null +++ b/Silicon/Intel/TigerlakeSiliconPkg/Include/Library/GpioLib.h @@ -0,0 +1,720 @@ +/** @file + Header file for GpioLib. + All function in this library is available for PEI, DXE, and SMM + + @note: When GPIO pads are owned by ME Firmware, BIOS/host should not + attempt to access these GPIO Pads registers, registers value + returned in this case will be 0xFF. + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ +#ifndef _GPIO_LIB_H_ +#define _GPIO_LIB_H_ + +#include + +#define GPIO_NAME_LENGTH_MAX 32 + +typedef struct { + GPIO_PAD GpioPad; + GPIO_CONFIG GpioConfig; +} GPIO_INIT_CONFIG; + +/** + This procedure will initialize multiple GPIO pins. Use GPIO_INIT_CONFIG = structure. + Structure contains fields that can be used to configure each pad. + Pad not configured using GPIO_INIT_CONFIG will be left with hardware def= ault values. + Separate fields could be set to hardware default if it does not matter, = except + GpioPad and PadMode. + Function will work in most efficient way if pads which belong to the sam= e group are + placed in adjacent records of the table. + Although function can enable pads for Native mode, such programming is d= one + by reference code when enabling related silicon feature. + + @param[in] NumberofItem Number of GPIO pads to be updated + @param[in] GpioInitTableAddress GPIO initialization table + + @retval EFI_SUCCESS The function completed successfull= y + @retval EFI_INVALID_PARAMETER Invalid group or pad number +**/ +EFI_STATUS +GpioConfigurePads ( + IN UINT32 NumberOfItems, + IN GPIO_INIT_CONFIG *GpioInitTableAddress + ); + +// +// Functions for setting/getting multiple GpioPad settings +// + +/** + This procedure will read multiple GPIO settings + + @param[in] GpioPad GPIO Pad + @param[out] GpioData GPIO data structure + + @retval EFI_SUCCESS The function completed successfull= y + @retval EFI_INVALID_PARAMETER Invalid GpioPad +**/ +EFI_STATUS +GpioGetPadConfig ( + IN GPIO_PAD GpioPad, + OUT GPIO_CONFIG *GpioData + ); + +/** + This procedure will configure multiple GPIO settings + + @param[in] GpioPad GPIO Pad + @param[in] GpioData GPIO data structure + + @retval EFI_SUCCESS The function completed successfull= y + @retval EFI_INVALID_PARAMETER Invalid GpioPad +**/ +EFI_STATUS +GpioSetPadConfig ( + IN GPIO_PAD GpioPad, + IN GPIO_CONFIG *GpioData + ); + +// +// Functions for setting/getting single GpioPad properties +// + +/** + This procedure will set GPIO output level + + @param[in] GpioPad GPIO pad + @param[in] Value Output value + 0: OutputLow, 1: OutputHigh + + @retval EFI_SUCCESS The function completed successfully + @retval EFI_INVALID_PARAMETER Invalid GpioPad +**/ +EFI_STATUS +GpioSetOutputValue ( + IN GPIO_PAD GpioPad, + IN UINT32 Value + ); + +/** + This procedure will get GPIO output level + + @param[in] GpioPad GPIO pad + @param[out] OutputVal GPIO Output value + 0: OutputLow, 1: OutputHigh + + @retval EFI_SUCCESS The function completed successfully + @retval EFI_INVALID_PARAMETER Invalid GpioPad +**/ +EFI_STATUS +GpioGetOutputValue ( + IN GPIO_PAD GpioPad, + OUT UINT32 *OutputVal + ); + +/** + This procedure will get GPIO input level + + @param[in] GpioPad GPIO pad + @param[out] InputVal GPIO Input value + 0: InputLow, 1: InputHigh + + @retval EFI_SUCCESS The function completed successfully + @retval EFI_INVALID_PARAMETER Invalid GpioPad +**/ +EFI_STATUS +GpioGetInputValue ( + IN GPIO_PAD GpioPad, + OUT UINT32 *InputVal + ); + +/** + This procedure will get GPIO IOxAPIC interrupt number + + @param[in] GpioPad GPIO pad + @param[out] IrqNum IRQ number + + @retval EFI_SUCCESS The function completed successfully + @retval EFI_INVALID_PARAMETER Invalid GpioPad +**/ +EFI_STATUS +GpioGetPadIoApicIrqNumber ( + IN GPIO_PAD GpioPad, + OUT UINT32 *IrqNum + ); + +/** + This procedure will configure GPIO input inversion + + @param[in] GpioPad GPIO pad + @param[in] Value Value for GPIO input inversion + 0: No input inversion, 1: Invert input + + @retval EFI_SUCCESS The function completed successfully + @retval EFI_INVALID_PARAMETER Invalid GpioPad +**/ +EFI_STATUS +GpioSetInputInversion ( + IN GPIO_PAD GpioPad, + IN UINT32 Value + ); + +/** + This procedure will get GPIO pad input inversion value + + @param[in] GpioPad GPIO pad + @param[out] InvertState GPIO inversion state + 0: No input inversion, 1: Inverted input + + @retval EFI_SUCCESS The function completed successfully + @retval EFI_INVALID_PARAMETER Invalid GpioPad +**/ +EFI_STATUS +GpioGetInputInversion ( + IN GPIO_PAD GpioPad, + OUT UINT32 *InvertState + ); + +/** + This procedure will set GPIO interrupt settings + + @param[in] GpioPad GPIO pad + @param[in] Value Value of Level/Edge + use GPIO_INT_CONFIG as argument + + @retval EFI_SUCCESS The function completed successfully + @retval EFI_INVALID_PARAMETER Invalid GpioPad +**/ +EFI_STATUS +GpioSetPadInterruptConfig ( + IN GPIO_PAD GpioPad, + IN GPIO_INT_CONFIG Value + ); + +/** + This procedure will set GPIO electrical settings + + @param[in] GpioPad GPIO pad + @param[in] Value Value of termination + use GPIO_ELECTRICAL_CONFIG as argument + + @retval EFI_SUCCESS The function completed successfully + @retval EFI_INVALID_PARAMETER Invalid GpioPad +**/ +EFI_STATUS +GpioSetPadElectricalConfig ( + IN GPIO_PAD GpioPad, + IN GPIO_ELECTRICAL_CONFIG Value + ); + +/** + This procedure will set GPIO Reset settings + + @param[in] GpioPad GPIO pad + @param[in] Value Value for Pad Reset Configuration + use GPIO_RESET_CONFIG as argument + + @retval EFI_SUCCESS The function completed successfully + @retval EFI_INVALID_PARAMETER Invalid GpioPad +**/ +EFI_STATUS +GpioSetPadResetConfig ( + IN GPIO_PAD GpioPad, + IN GPIO_RESET_CONFIG Value + ); + +/** + This procedure will get GPIO Reset settings + + @param[in] GpioPad GPIO pad + @param[in] Value Value of Pad Reset Configuration + based on GPIO_RESET_CONFIG + + @retval EFI_SUCCESS The function completed successfully + @retval EFI_INVALID_PARAMETER Invalid GpioPad +**/ +EFI_STATUS +GpioGetPadResetConfig ( + IN GPIO_PAD GpioPad, + IN GPIO_RESET_CONFIG *Value + ); + +/** + This procedure will get Gpio Pad Host Software Ownership + + @param[in] GpioPad GPIO pad + @param[out] PadHostSwOwn Value of Host Software Pad Owner + 0: ACPI Mode, 1: GPIO Driver mode + + @retval EFI_SUCCESS The function completed successfully + @retval EFI_INVALID_PARAMETER Invalid GpioPad +**/ +EFI_STATUS +GpioGetHostSwOwnershipForPad ( + IN GPIO_PAD GpioPad, + OUT UINT32 *PadHostSwOwn + ); + +/** + This procedure will set Gpio Pad Host Software Ownership + + @param[in] GpioPad GPIO pad + @param[in] PadHostSwOwn Pad Host Software Owner + 0: ACPI Mode, 1: GPIO Driver mode + + @retval EFI_SUCCESS The function completed successfully + @retval EFI_INVALID_PARAMETER Invalid GpioPad +**/ +EFI_STATUS +GpioSetHostSwOwnershipForPad ( + IN GPIO_PAD GpioPad, + IN UINT32 PadHostSwOwn + ); + +/// +/// Possible values of Pad Ownership +/// If Pad is not under Host ownership then GPIO registers +/// are not accessible by host (e.g. BIOS) and reading them +/// will return 0xFFs. +/// +typedef enum { + GpioPadOwnHost =3D 0x0, + GpioPadOwnCsme =3D 0x1, + GpioPadOwnIsh =3D 0x2, +} GPIO_PAD_OWN; + +/** + This procedure will get Gpio Pad Ownership + + @param[in] GpioPad GPIO pad + @param[out] PadOwnVal Value of Pad Ownership + + @retval EFI_SUCCESS The function completed successfully + @retval EFI_INVALID_PARAMETER Invalid GpioPad +**/ +EFI_STATUS +GpioGetPadOwnership ( + IN GPIO_PAD GpioPad, + OUT GPIO_PAD_OWN *PadOwnVal + ); + +/** + This procedure will check state of Pad Config Lock for pads within one g= roup + + @param[in] Group GPIO group + @param[in] DwNum PadCfgLock register number for current g= roup. + For group which has less then 32 pads pe= r group DwNum must be 0. + @param[out] PadCfgLockRegVal Value of PadCfgLock register + Bit position - PadNumber + Bit value - 0: NotLocked, 1: Locked + + @retval EFI_SUCCESS The function completed successfully + @retval EFI_INVALID_PARAMETER Invalid group or DwNum parameter number +**/ +EFI_STATUS +GpioGetPadCfgLockForGroupDw ( + IN GPIO_GROUP Group, + IN UINT32 DwNum, + OUT UINT32 *PadCfgLockRegVal + ); + +/** + This procedure will check state of Pad Config Lock for selected pad + + @param[in] GpioPad GPIO pad + @param[out] PadCfgLock PadCfgLock for selected pad + 0: NotLocked, 1: Locked + + @retval EFI_SUCCESS The function completed successfully + @retval EFI_INVALID_PARAMETER Invalid GpioPad +**/ +EFI_STATUS +GpioGetPadCfgLock ( + IN GPIO_PAD GpioPad, + OUT UINT32 *PadCfgLock + ); + +/** + This procedure will check state of Pad Config Tx Lock for pads within on= e group + + @param[in] Group GPIO group + @param[in] DwNum PadCfgLockTx register number for current= group. + For group which has less then 32 pads pe= r group DwNum must be 0. + @param[out] PadCfgLockTxRegVal Value of PadCfgLockTx register + Bit position - PadNumber + Bit value - 0: NotLockedTx, 1: LockedTx + + @retval EFI_SUCCESS The function completed successfully + @retval EFI_INVALID_PARAMETER Invalid group or DwNum parameter number +**/ +EFI_STATUS +GpioGetPadCfgLockTxForGroupDw ( + IN GPIO_GROUP Group, + IN UINT32 DwNum, + OUT UINT32 *PadCfgLockTxRegVal + ); + +/** + This procedure will check state of Pad Config Tx Lock for selected pad + + @param[in] GpioPad GPIO pad + @param[out] PadCfgLock PadCfgLockTx for selected pad + 0: NotLockedTx, 1: LockedTx + + @retval EFI_SUCCESS The function completed successfully + @retval EFI_INVALID_PARAMETER Invalid GpioPad +**/ +EFI_STATUS +GpioGetPadCfgLockTx ( + IN GPIO_PAD GpioPad, + OUT UINT32 *PadCfgLockTx + ); + +/** + This procedure will clear PadCfgLock for selected pads within one group. + Unlocking a pad will cause an SMI (if enabled) + + @param[in] Group GPIO group + @param[in] DwNum PadCfgLock register number for current g= roup. + For group which has less then 32 pads pe= r group DwNum must be 0. + @param[in] PadsToUnlock Bitmask for pads which are going to be u= nlocked, + Bit position - PadNumber + Bit value - 0: DoNotUnlock, 1: Unlock + + @retval EFI_SUCCESS The function completed successfully + @retval EFI_INVALID_PARAMETER Invalid group or pad number +**/ +EFI_STATUS +GpioUnlockPadCfgForGroupDw ( + IN GPIO_GROUP Group, + IN UINT32 DwNum, + IN UINT32 PadsToUnlock + ); + +/** + This procedure will clear PadCfgLock for selected pad. + Unlocking a pad will cause an SMI (if enabled) + + @param[in] GpioPad GPIO pad + + @retval EFI_SUCCESS The function completed successfully + @retval EFI_INVALID_PARAMETER Invalid GpioPad +**/ +EFI_STATUS +GpioUnlockPadCfg ( + IN GPIO_PAD GpioPad + ); + +/** + This procedure will set PadCfgLock for selected pads within one group + + @param[in] Group GPIO group + @param[in] DwNum PadCfgLock register number for current g= roup. + For group which has less then 32 pads pe= r group DwNum must be 0. + @param[in] PadsToLock Bitmask for pads which are going to be l= ocked, + Bit position - PadNumber + Bit value - 0: DoNotLock, 1: Lock + + @retval EFI_SUCCESS The function completed successfully + @retval EFI_INVALID_PARAMETER Invalid group or DwNum parameter number +**/ +EFI_STATUS +GpioLockPadCfgForGroupDw ( + IN GPIO_GROUP Group, + IN UINT32 DwNum, + IN UINT32 PadsToLock + ); + +/** + This procedure will set PadCfgLock for selected pad + + @param[in] GpioPad GPIO pad + + @retval EFI_SUCCESS The function completed successfully + @retval EFI_INVALID_PARAMETER Invalid GpioPad +**/ +EFI_STATUS +GpioLockPadCfg ( + IN GPIO_PAD GpioPad + ); + +/** + This procedure will clear PadCfgLockTx for selected pads within one grou= p. + Unlocking a pad will cause an SMI (if enabled) + + @param[in] Group GPIO group + @param[in] DwNum PadCfgLockTx register number for current= group. + For group which has less then 32 pads pe= r group DwNum must be 0. + @param[in] PadsToUnlockTx Bitmask for pads which are going to be u= nlocked, + Bit position - PadNumber + Bit value - 0: DoNotUnLockTx, 1: LockTx + + @retval EFI_SUCCESS The function completed successfully + @retval EFI_INVALID_PARAMETER Invalid group or pad number +**/ +EFI_STATUS +GpioUnlockPadCfgTxForGroupDw ( + IN GPIO_GROUP Group, + IN UINT32 DwNum, + IN UINT32 PadsToUnlockTx + ); + +/** + This procedure will clear PadCfgLockTx for selected pad. + Unlocking a pad will cause an SMI (if enabled) + + @param[in] GpioPad GPIO pad + + @retval EFI_SUCCESS The function completed successfully + @retval EFI_INVALID_PARAMETER Invalid GpioPad +**/ +EFI_STATUS +GpioUnlockPadCfgTx ( + IN GPIO_PAD GpioPad + ); + +/** + This procedure will set PadCfgLockTx for selected pads within one group + + @param[in] Group GPIO group + @param[in] DwNum PadCfgLock register number for current g= roup. + For group which has less then 32 pads pe= r group DwNum must be 0. + @param[in] PadsToLockTx Bitmask for pads which are going to be l= ocked, + Bit position - PadNumber + Bit value - 0: DoNotLockTx, 1: LockTx + + @retval EFI_SUCCESS The function completed successfully + @retval EFI_INVALID_PARAMETER Invalid group or DwNum parameter number +**/ +EFI_STATUS +GpioLockPadCfgTxForGroupDw ( + IN GPIO_GROUP Group, + IN UINT32 DwNum, + IN UINT32 PadsToLockTx + ); + +/** + This procedure will set PadCfgLockTx for selected pad + + @param[in] GpioPad GPIO pad + + @retval EFI_SUCCESS The function completed successfully + @retval EFI_INVALID_PARAMETER Invalid GpioPad +**/ +EFI_STATUS +GpioLockPadCfgTx ( + IN GPIO_PAD GpioPad + ); + +/** + This procedure will get Group to GPE mapping. + It will assume that only first 32 pads can be mapped to GPE. + To handle cases where groups have more than 32 pads and higher part of g= roup + can be mapped please refer to GpioGetGroupDwToGpeDwX() + + @param[out] GroupToGpeDw0 GPIO group to be mapped to GPE_DW0 + @param[out] GroupToGpeDw1 GPIO group to be mapped to GPE_DW1 + @param[out] GroupToGpeDw2 GPIO group to be mapped to GPE_DW2 + + @retval EFI_SUCCESS The function completed successfully + @retval EFI_INVALID_PARAMETER Invalid group or pad number +**/ +EFI_STATUS +GpioGetGroupToGpeDwX ( + IN GPIO_GROUP *GroupToGpeDw0, + IN GPIO_GROUP *GroupToGpeDw1, + IN GPIO_GROUP *GroupToGpeDw2 + ); + +/** + This procedure will get Group to GPE mapping. If group has more than 32 = bits + it is possible to map only single DW of pins (e.g. 0-31, 32-63) because + ACPI GPE_DWx register is 32 bits large. + + @param[out] GroupToGpeDw0 GPIO group mapped to GPE_DW0 + @param[out] GroupDwForGpeDw0 DW of pins mapped to GPE_DW0 + @param[out] GroupToGpeDw1 GPIO group mapped to GPE_DW1 + @param[out] GroupDwForGpeDw1 DW of pins mapped to GPE_DW1 + @param[out] GroupToGpeDw2 GPIO group mapped to GPE_DW2 + @param[out] GroupDwForGpeDw2 DW of pins mapped to GPE_DW2 + + @retval EFI_SUCCESS The function completed successfully + @retval EFI_INVALID_PARAMETER Invalid group or pad number +**/ +EFI_STATUS +GpioGetGroupDwToGpeDwX ( + OUT GPIO_GROUP *GroupToGpeDw0, + OUT UINT32 *GroupDwForGpeDw0, + OUT GPIO_GROUP *GroupToGpeDw1, + OUT UINT32 *GroupDwForGpeDw1, + OUT GPIO_GROUP *GroupToGpeDw2, + OUT UINT32 *GroupDwForGpeDw2 + ); + +/** + This procedure will get GPE number for provided GpioPad. + PCH allows to configure mapping between GPIO groups and related GPE (Gpi= oSetGroupToGpeDwX()) + what results in the fact that certain Pad can cause different General Pu= rpose Event. Only three + GPIO groups can be mapped to cause unique GPE (1-tier), all others group= s will be under one common + event (GPE_111 for 2-tier). + + 1-tier: + Returned GpeNumber is in range <0,95>. GpioGetGpeNumber() can be used + to determine what _LXX ACPI method would be called on event on selected = GPIO pad + + 2-tier: + Returned GpeNumber is 0x6F (111). All GPIO pads which are not mapped to = 1-tier GPE + will be under one master GPE_111 which is linked to _L6F ACPI method. If= it is needed to determine + what Pad from 2-tier has caused the event, _L6F method should check GPI_= GPE_STS and GPI_GPE_EN + registers for all GPIO groups not mapped to 1-tier GPE. + + @param[in] GpioPad GPIO pad + @param[out] GpeNumber GPE number + + @retval EFI_SUCCESS The function completed successfully + @retval EFI_INVALID_PARAMETER Invalid GpioPad +**/ +EFI_STATUS +GpioGetGpeNumber ( + IN GPIO_PAD GpioPad, + OUT UINT32 *GpeNumber + ); + +/** + This procedure is used to clear SMI STS for a specified Pad + + @param[in] GpioPad GPIO pad + + @retval EFI_SUCCESS The function completed successfully + @retval EFI_INVALID_PARAMETER Invalid GpioPad +**/ +EFI_STATUS +GpioClearGpiSmiSts ( + IN GPIO_PAD GpioPad + ); + +/** + This procedure is used by Smi Dispatcher and will clear + all GPI SMI Status bits + + @retval EFI_SUCCESS The function completed successfully +**/ +EFI_STATUS +GpioClearAllGpiSmiSts ( + VOID + ); + +/** + This procedure is used to disable all GPI SMI + + @retval EFI_SUCCESS The function completed successfully +**/ +EFI_STATUS +GpioDisableAllGpiSmi ( + VOID + ); + +/** + This procedure is used to register GPI SMI dispatch function. + + @param[in] GpioPad GPIO pad + @param[out] GpiNum GPI number + + @retval EFI_SUCCESS The function completed successfully + @retval EFI_INVALID_PARAMETER Invalid GpioPad +**/ +EFI_STATUS +GpioGetGpiSmiNum ( + IN GPIO_PAD GpioPad, + OUT UINTN *GpiNum + ); + +/** + This procedure is used to check GPIO inputs belongs to 2 tier or 1 tier = architecture + + @param[in] GpioPad GPIO pad + + @retval Data 0 means 1-tier, 1 means 2-tier +**/ +BOOLEAN +GpioCheckFor2Tier ( + IN GPIO_PAD GpioPad + ); + +/** + This procedure is used to clear GPE STS for a specified GpioPad + + @param[in] GpioPad GPIO pad + + @retval EFI_SUCCESS The function completed successfully + @retval EFI_INVALID_PARAMETER Invalid GpioPad +**/ +EFI_STATUS +GpioClearGpiGpeSts ( + IN GPIO_PAD GpioPad + ); + +/** + This procedure is used to read GPE STS for a specified Pad + + @param[in] GpioPad GPIO pad + @param[out] GpeSts Gpe status for given pad + The GpeSts is true if the status registe= r is set for given Pad number + + @retval EFI_SUCCESS The function completed successfully + @retval EFI_INVALID_PARAMETER Invalid GpioPad +**/ +EFI_STATUS +GpioGetGpiGpeSts ( + IN GPIO_PAD GpioPad, + OUT BOOLEAN *GpeSts + ); + +/** + This procedure is used to get SMI STS for a specified Pad + + @param[in] GpioPad GPIO pad + @param[out] SmiSts Smi status for given pad + The SmiSts is true if the status registe= r is set for given Pad number + + @retval EFI_SUCCESS The function completed successfully + @retval EFI_INVALID_PARAMETER Invalid GpioPad +**/ +EFI_STATUS +GpioGetGpiSmiSts ( + IN GPIO_PAD GpioPad, + OUT BOOLEAN *SmiSts + ); + +/** + Generates GPIO name from GpioPad + + @param[in] GpioPad GpioPad + @param[out] GpioNameBuffer Caller allocated buffer for GPIO name of= GPIO_NAME_LENGTH_MAX size + @param[in] GpioNameBufferSize Size of the buffer + + @retval CHAR8* Pointer to the GPIO name +**/ +CHAR8* +GpioGetPadName ( + IN GPIO_PAD GpioPad, + OUT CHAR8* GpioNameBuffer, + IN UINT32 GpioNameBufferSize + ); + +/** + Generates GPIO group name from GroupIndex + + @param[in] GroupIndex Gpio GroupIndex + + @retval CHAR8* Pointer to the GPIO group name +**/ +CONST +CHAR8* +GpioGetGroupName ( + IN UINT32 GroupIndex + ); + +#endif // _GPIO_LIB_H_ diff --git a/Silicon/Intel/TigerlakeSiliconPkg/Include/Library/GpioNativeLi= b.h b/Silicon/Intel/TigerlakeSiliconPkg/Include/Library/GpioNativeLib.h new file mode 100644 index 0000000000..b09600dd30 --- /dev/null +++ b/Silicon/Intel/TigerlakeSiliconPkg/Include/Library/GpioNativeLib.h @@ -0,0 +1,149 @@ +/** @file + Header file for GpioLib for native and Si specific usage. + All function in this library is available for PEI, DXE, and SMM, + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ +#ifndef _GPIO_NATIVE_LIB_H_ +#define _GPIO_NATIVE_LIB_H_ + +#include + +/** + This procedure will get number of pads for certain GPIO group + + @param[in] Group GPIO group number + + @retval Value Pad number for group + If illegal group number then return 0 +**/ +UINT32 +GpioGetPadPerGroup ( + IN GPIO_GROUP Group + ); + +/** + This procedure will get number of groups + + @param[in] none + + @retval Value Group number +**/ +UINT32 +GpioGetNumberOfGroups ( + VOID + ); +/** + This procedure will get lowest group + + @param[in] none + + @retval Value Lowest Group +**/ +GPIO_GROUP +GpioGetLowestGroup ( + VOID + ); + +/** + This procedure will get highest group + + @param[in] none + + @retval Value Highest Group +**/ +GPIO_GROUP +GpioGetHighestGroup ( + VOID + ); + +/** + This procedure will get group + + @param[in] GpioPad Gpio Pad + + @retval Value Group +**/ +GPIO_GROUP +GpioGetGroupFromGpioPad ( + IN GPIO_PAD GpioPad + ); + +/** + This procedure will get group index (0 based) from GpioPad + + @param[in] GpioPad Gpio Pad + + @retval Value Group Index +**/ +UINT32 +GpioGetGroupIndexFromGpioPad ( + IN GPIO_PAD GpioPad + ); + +/** + This procedure will get group index (0 based) from group + + @param[in] GpioGroup Gpio Group + + @retval Value Group Index +**/ +UINT32 +GpioGetGroupIndexFromGroup ( + IN GPIO_GROUP GpioGroup + ); + +/** + This procedure will get group from group index (0 based) + + @param[in] GroupIndex Group Index + + @retval GpioGroup Gpio Group +**/ +GPIO_GROUP +GpioGetGroupFromGroupIndex ( + IN UINT32 GroupIndex + ); + +/** + This procedure will get pad number (0 based) from Gpio Pad + + @param[in] GpioPad Gpio Pad + + @retval Value Pad Number +**/ +UINT32 +GpioGetPadNumberFromGpioPad ( + IN GPIO_PAD GpioPad + ); + +/** + This procedure will return GpioPad from Group and PadNumber + + @param[in] Group GPIO group + @param[in] PadNumber GPIO PadNumber + + @retval GpioPad GpioPad +**/ +GPIO_PAD +GpioGetGpioPadFromGroupAndPadNumber ( + IN GPIO_GROUP Group, + IN UINT32 PadNumber + ); + +/** + This procedure will return GpioPad from GroupIndex and PadNumber + + @param[in] GroupIndex GPIO GroupIndex + @param[in] PadNumber GPIO PadNumber + + @retval GpioPad GpioPad +**/ +GPIO_PAD +GpioGetGpioPadFromGroupIndexAndPadNumber ( + IN UINT32 GroupIndex, + IN UINT32 PadNumber + ); + +#endif // _GPIO_NATIVE_LIB_H_ diff --git a/Silicon/Intel/TigerlakeSiliconPkg/Include/Library/MmPciLib.h b= /Silicon/Intel/TigerlakeSiliconPkg/Include/Library/MmPciLib.h new file mode 100644 index 0000000000..a53887ffcb --- /dev/null +++ b/Silicon/Intel/TigerlakeSiliconPkg/Include/Library/MmPciLib.h @@ -0,0 +1,27 @@ +/** @file + Get Pci Express address library implementation. + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ +#ifndef _MM_PCI_LIB_H_ +#define _MM_PCI_LIB_H_ + +/** + This procedure will get PCIE address + + @param[in] Bus Pci Bus Number + @param[in] Device Pci Device Number + @param[in] Function Pci Function Number + + @retval PCIE address +**/ +UINTN +EFIAPI +MmPciBase ( + IN UINT32 Bus, + IN UINT32 Device, + IN UINT32 Function +); + +#endif // _PEI_DXE_SMM_MM_PCI_LIB_H_ diff --git a/Silicon/Intel/TigerlakeSiliconPkg/Include/Library/PchPcieRpLib= .h b/Silicon/Intel/TigerlakeSiliconPkg/Include/Library/PchPcieRpLib.h new file mode 100644 index 0000000000..3c46029b7f --- /dev/null +++ b/Silicon/Intel/TigerlakeSiliconPkg/Include/Library/PchPcieRpLib.h @@ -0,0 +1,123 @@ +/** @file + Header file for PchPcieRpLib. + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ +#ifndef _PCH_PCIERP_LIB_H_ +#define _PCH_PCIERP_LIB_H_ + +#include + +/** + PCIe controller bifurcation configuration. +**/ +typedef enum { + PcieBifurcationDefault =3D 0, + PcieBifurcation4x1, + PcieBifurcation1x2_2x1, + PcieBifurcation2x2, + PcieBifurcation1x4, + PcieBifurcation4x2, + PcieBifurcation1x4_2x2, + PcieBifurcation2x2_1x4, + PcieBifurcation2x4, + PcieBifurcation1x8, + PcieBifurcationUnknown, + PcieBifurcationMax +} PCIE_BIFURCATION_CONFIG; + +/** + This function returns PID according to PCIe controller index + + @param[in] ControllerIndex PCIe controller index + + @retval PCH_SBI_PID Returns PID for SBI Access +**/ +PCH_SBI_PID +PchGetPcieControllerSbiPid ( + IN UINT32 ControllerIndex + ); + +/** + This function returns PID according to Root Port Number + + @param[in] RpIndex Root Port Index (0-based) + + @retval PCH_SBI_PID Returns PID for SBI Access +**/ +PCH_SBI_PID +GetRpSbiPid ( + IN UINTN RpIndex + ); + +/** + Get Pch Pcie Root Port Device and Function Number by Root Port physical = Number + + @param[in] RpNumber Root port physical number. (0-based) + @param[out] RpDev Return corresponding root port device nu= mber. + @param[out] RpFun Return corresponding root port function = number. + + @retval EFI_SUCCESS +**/ +EFI_STATUS +EFIAPI +GetPchPcieRpDevFun ( + IN UINTN RpNumber, + OUT UINTN *RpDev, + OUT UINTN *RpFun + ); + +/** + Get Root Port physical Number by Pch Pcie Root Port Device and Function = Number + + @param[in] RpDev Root port device number. + @param[in] RpFun Root port function number. + @param[out] RpNumber Return corresponding physical Root Por= t index (0-based) + + @retval EFI_SUCCESS Physical root port is retrieved + @retval EFI_INVALID_PARAMETER RpDev and/or RpFun are invalid + @retval EFI_UNSUPPORTED Root port device and function is not a= ssigned to any physical root port +**/ +EFI_STATUS +EFIAPI +GetPchPcieRpNumber ( + IN UINTN RpDev, + IN UINTN RpFun, + OUT UINTN *RpNumber + ); + +/** + Gets pci segment base address of PCIe root port. + + @param RpIndex Root Port Index (0 based) + @return PCIe port base address. +**/ +UINT64 +PchPcieBase ( + IN UINT32 RpIndex + ); + +/** + Determines whether L0s is supported on current stepping. + + @return TRUE if L0s is supported, FALSE otherwise +**/ +BOOLEAN +PchIsPcieL0sSupported ( + VOID + ); + +/** + Some early PCH steppings require Native ASPM to be disabled due to hardw= are issues: + - RxL0s exit causes recovery + - Disabling PCIe L0s capability disables L1 + Use this function to determine affected steppings. + + @return TRUE if Native ASPM is supported, FALSE otherwise +**/ +BOOLEAN +PchIsPcieNativeAspmSupported ( + VOID + ); +#endif // _PCH_PCIERP_LIB_H_ diff --git a/Silicon/Intel/TigerlakeSiliconPkg/Include/Library/PchPcrLib.h = b/Silicon/Intel/TigerlakeSiliconPkg/Include/Library/PchPcrLib.h new file mode 100644 index 0000000000..f46c3da0e1 --- /dev/null +++ b/Silicon/Intel/TigerlakeSiliconPkg/Include/Library/PchPcrLib.h @@ -0,0 +1,256 @@ +/** @file + Header file for PchPcrLib. + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ +#ifndef _PCH_PCR_LIB_H_ +#define _PCH_PCR_LIB_H_ + +#include + +/** + Definition for PCR address + The PCR address is used to the PCR MMIO programming + + SBREG_BAR_20BITADDRESS is configured by SoC + + SBREG_BAR_20BITADDRESS=3D1, the format has included 16b addressing. + +-----------------------------------------------------------------------= ----------------------+ + | Addr[63:28] | Addr[27:24] | Addr[23:16] | Addr[15:2] = | Addr[1:0] | + +----------------+-----------------------+-----------------+------------= ----------------------+ + | REG_BAR[63:28] | TargetRegister[19:16] | TargetPort[7:0] | TargetRegis= ter[15:2] | + +-----------------------------------------------------------------------= ----------------------+ + + SBREG_BAR_20BITADDRESS=3D0 + +-----------------------------------------------------------------------= ----------------------+ + | Addr[63:24] | Addr[27:24] | Addr[23:16] | Addr[15:2] = | Addr[1:0] | + +----------------+-----------------------+-----------------+------------= ----------------------+ + | REG_BAR[63:24] | REG_BAR[27:24] | TargetPort[7:0] | TargetRegis= ter[15:2] | + +-----------------------------------------------------------------------= ----------------------+ +**/ +#define PCH_PCR_ADDRESS(Pid, Offset) (PCH_PCR_BASE_ADDRESS | (UINT32) (= ((Offset) & 0x0F0000) << 8) | ((UINT8)(Pid) << 16) | (UINT16) ((Offset) & 0= xFFFF)) + +/** + PCH PCR boot script accessing macro + Those macros are only available for DXE phase. +**/ +#define PCH_PCR_BOOT_SCRIPT_WRITE(Width, Pid, Offset, Count, Buffer) \ + S3BootScriptSaveMemWrite (Width, PCH_PCR_ADDRESS (Pid, Offset), = Count, Buffer); \ + +#define PCH_PCR_BOOT_SCRIPT_READ_WRITE(Width, Pid, Offset, DataOr, DataAnd= ) \ + S3BootScriptSaveMemReadWrite (Width, PCH_PCR_ADDRESS (Pid, Offse= t), DataOr, DataAnd); \ + +#define PCH_PCR_BOOT_SCRIPT_READ(Width, Pid, Offset, BitMask, BitValue) \ + S3BootScriptSaveMemPoll (Width, PCH_PCR_ADDRESS (Pid, Offset), B= itMask, BitValue, 1, 1); + +typedef UINT8 PCH_SBI_PID; + +/** + Read PCR register. + It returns PCR register and size in 4bytes. + The Offset should not exceed 0xFFFF and must be aligned with size. + + @param[in] Pid Port ID + @param[in] Offset Register offset of this Port ID + + @retval UINT32 PCR register value. +**/ +UINT32 +PchPcrRead32 ( + IN PCH_SBI_PID Pid, + IN UINT32 Offset + ); + +/** + Read PCR register. + It returns PCR register and size in 2bytes. + The Offset should not exceed 0xFFFF and must be aligned with size. + + @param[in] Pid Port ID + @param[in] Offset Register offset of this Port ID + + @retval UINT16 PCR register value. +**/ +UINT16 +PchPcrRead16 ( + IN PCH_SBI_PID Pid, + IN UINT32 Offset + ); + +/** + Read PCR register. + It returns PCR register and size in 1bytes. + The Offset should not exceed 0xFFFF and must be aligned with size. + + @param[in] Pid Port ID + @param[in] Offset Register offset of this Port ID + + @retval UINT8 PCR register value +**/ +UINT8 +PchPcrRead8 ( + IN PCH_SBI_PID Pid, + IN UINT32 Offset + ); + +/** + Write PCR register. + It programs PCR register and size in 4bytes. + The Offset should not exceed 0xFFFF and must be aligned with size. + + @param[in] Pid Port ID + @param[in] Offset Register offset of Port ID. + @param[in] Data Input Data. Must be the same size as Size parameter= . + + @retval UINT32 Value written to register +**/ +UINT32 +PchPcrWrite32 ( + IN PCH_SBI_PID Pid, + IN UINT32 Offset, + IN UINT32 InData + ); + +/** + Write PCR register. + It programs PCR register and size in 2bytes. + The Offset should not exceed 0xFFFF and must be aligned with size. + + @param[in] Pid Port ID + @param[in] Offset Register offset of Port ID. + @param[in] Data Input Data. Must be the same size as Size parameter= . + + @retval UINT16 Value written to register +**/ +UINT16 +PchPcrWrite16 ( + IN PCH_SBI_PID Pid, + IN UINT32 Offset, + IN UINT16 InData + ); + +/** + Write PCR register. + It programs PCR register and size in 1bytes. + The Offset should not exceed 0xFFFF and must be aligned with size. + + @param[in] Pid Port ID + @param[in] Offset Register offset of Port ID. + @param[in] Data Input Data. Must be the same size as Size parameter= . + + @retval UINT8 Value written to register +**/ +UINT8 +PchPcrWrite8 ( + IN PCH_SBI_PID Pid, + IN UINT32 Offset, + IN UINT8 InData + ); + +/** + Write PCR register. + It programs PCR register and size in 4bytes. + The Offset should not exceed 0xFFFF and must be aligned with size. + + @param[in] Pid Port ID + @param[in] Offset Register offset of Port ID. + @param[in] AndData AND Data. Must be the same size as Size parameter. + @param[in] OrData OR Data. Must be the same size as Size parameter. + + @retval UINT32 Value written to register + +**/ +UINT32 +PchPcrAndThenOr32 ( + IN PCH_SBI_PID Pid, + IN UINT32 Offset, + IN UINT32 AndData, + IN UINT32 OrData + ); + +/** + Write PCR register and read back. + The read back ensures the PCR cycle is completed before next operation. + It programs PCR register and size in 4bytes. + The Offset should not exceed 0xFFFF and must be aligned with size. + + @param[in] Pid Port ID + @param[in] Offset Register offset of Port ID. + @param[in] AndData AND Data. Must be the same size as Size parameter. + @param[in] OrData OR Data. Must be the same size as Size parameter. + + @retval UINT32 Value read back from the register +**/ +UINT32 +PchPcrAndThenOr32WithReadback ( + IN PCH_SBI_PID Pid, + IN UINT32 Offset, + IN UINT32 AndData, + IN UINT32 OrData + ); + +/** + Write PCR register. + It programs PCR register and size in 2bytes. + The Offset should not exceed 0xFFFF and must be aligned with size. + + @param[in] Pid Port ID + @param[in] Offset Register offset of Port ID. + @param[in] AndData AND Data. Must be the same size as Size parameter. + @param[in] OrData OR Data. Must be the same size as Size parameter. + + @retval UINT16 Value written to register + +**/ +UINT16 +PchPcrAndThenOr16 ( + IN PCH_SBI_PID Pid, + IN UINT32 Offset, + IN UINT16 AndData, + IN UINT16 OrData + ); + +/** + Write PCR register. + It programs PCR register and size in 1bytes. + The Offset should not exceed 0xFFFF and must be aligned with size. + + @param[in] Pid Port ID + @param[in] Offset Register offset of Port ID. + @param[in] AndData AND Data. Must be the same size as Size parameter. + @param[in] OrData OR Data. Must be the same size as Size parameter. + + @retval UINT8 Value written to register + +**/ +UINT8 +PchPcrAndThenOr8 ( + IN PCH_SBI_PID Pid, + IN UINT32 Offset, + IN UINT8 AndData, + IN UINT8 OrData + ); + + +typedef enum { + PchIpDmi =3D 1, + PchIpIclk, +} PCH_IP_PID_ENUM; + +#define PCH_INVALID_PID 0 + +/** + Get PCH IP PID number + + @param[in] IpEnum PCH IP in PCH_IP_PID_ENUM + + @retval 0 PID of this IP is not supported + !0 PID of the IP. +**/ +PCH_SBI_PID +PchPcrGetPid ( + PCH_IP_PID_ENUM IpEnum + ); + +#endif // _PCH_PCR_LIB_H_ diff --git a/Silicon/Intel/TigerlakeSiliconPkg/Include/Library/PcieHelperLi= b.h b/Silicon/Intel/TigerlakeSiliconPkg/Include/Library/PcieHelperLib.h new file mode 100644 index 0000000000..8ab20f0db7 --- /dev/null +++ b/Silicon/Intel/TigerlakeSiliconPkg/Include/Library/PcieHelperLib.h @@ -0,0 +1,173 @@ +/** @file + Header file for PCI Express helpers base library + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ +#ifndef _PCIE_HELPER_LIB_H_ +#define _PCIE_HELPER_LIB_H_ + +#include +#include +#include +#include +#include +#include + +/** + Find the Offset to a given Capabilities ID + CAPID list: + 0x01 =3D PCI Power Management Interface + 0x04 =3D Slot Identification + 0x05 =3D MSI Capability + 0x10 =3D PCI Express Capability + + @param[in] DeviceBase device's base address + @param[in] CapId CAPID to search for + + @retval 0 CAPID not found + @retval Other CAPID found, Offset of desired CAPID +**/ +UINT8 +PcieBaseFindCapId ( + IN UINT64 DeviceBase, + IN UINT8 CapId + ); + +/** + Find the Offset to a given Capabilities ID + CAPID list: + 0x01 =3D PCI Power Management Interface + 0x04 =3D Slot Identification + 0x05 =3D MSI Capability + 0x10 =3D PCI Express Capability + + @param[in] Segment Pci Segment Number + @param[in] Bus Pci Bus Number + @param[in] Device Pci Device Number + @param[in] Function Pci Function Number + @param[in] CapId CAPID to search for + + @retval 0 CAPID not found + @retval Other CAPID found, Offset of desired CAPID +**/ +UINT8 +PcieFindCapId ( + IN UINT8 Segment, + IN UINT8 Bus, + IN UINT8 Device, + IN UINT8 Function, + IN UINT8 CapId + ); + +/** + Search and return the offset of desired Pci Express Capability ID + CAPID list: + 0x0001 =3D Advanced Error Reporting Capability + 0x0002 =3D Virtual Channel Capability + 0x0003 =3D Device Serial Number Capability + 0x0004 =3D Power Budgeting Capability + + @param[in] DeviceBase device base address + @param[in] CapId Extended CAPID to search for + + @retval 0 CAPID not found, this includes situation= where device doesn't exist + @retval Other CAPID found, Offset of desired CAPID +**/ +UINT16 +PcieBaseFindExtendedCapId ( + IN UINT64 DeviceBase, + IN UINT16 CapId + ); + +/** + Search and return the offset of desired Pci Express Capability ID + CAPID list: + 0x0001 =3D Advanced Error Rreporting Capability + 0x0002 =3D Virtual Channel Capability + 0x0003 =3D Device Serial Number Capability + 0x0004 =3D Power Budgeting Capability + + @param[in] Segment Pci Segment Number + @param[in] Bus Pci Bus Number + @param[in] Device Pci Device Number + @param[in] Function Pci Function Number + @param[in] CapId Extended CAPID to search for + + @retval 0 CAPID not found + @retval Other CAPID found, Offset of desired CAPID +**/ +UINT16 +PcieFindExtendedCapId ( + IN UINT8 Segment, + IN UINT8 Bus, + IN UINT8 Device, + IN UINT8 Function, + IN UINT16 CapId + ); + +/* + Checks device's Slot Clock Configuration + + @param[in] Base device's base address + @param[in] PcieCapOffset devices Pci express capability list register = offset + + @retval TRUE when device device uses slot clock, FALSE otherwise +*/ +BOOLEAN +GetScc ( + UINT64 Base, + UINT8 PcieCapOffset + ); + +/* + Sets Common Clock Configuration bit for given device. + @param[in] PcieCapOffset devices Pci express capability list register = offset + @param[in] Base device's base address +*/ +VOID +EnableCcc ( + UINT64 Base, + UINT8 PcieCapOffset + ); + +/* + Retrains link behind given device. + It only makes sense to call it for downstream ports. + If called for upstream port nothing will happen, it won't enter infinite= loop. + + @param[in] Base device's base address + @param[in] PcieCapOffset devices Pci express capability list regi= ster offset + @param[boolean] WaitUnitlDone when TRUE, function waits until link has= retrained +*/ +VOID +RetrainLink ( + UINT64 Base, + UINT8 PcieCapOffset, + BOOLEAN WaitUntilDone + ); + +/* + Checks if device at given address exists + + @param[in] Base device's base address + + @retval TRUE when device exists; FALSE otherwise +*/ +BOOLEAN +IsDevicePresent ( + UINT64 Base + ); + +/* + Checks if device is a multifunction device + + @param[in] Base device's base address + + @retval TRUE if multifunction; FALSE otherwise +*/ +BOOLEAN +IsMultifunctionDevice ( + UINT64 Base + ); +#endif // _PCIE_HELPER_LIB_H_ diff --git a/Silicon/Intel/TigerlakeSiliconPkg/Include/Library/PmcLib.h b/S= ilicon/Intel/TigerlakeSiliconPkg/Include/Library/PmcLib.h new file mode 100644 index 0000000000..0b8ad7a182 --- /dev/null +++ b/Silicon/Intel/TigerlakeSiliconPkg/Include/Library/PmcLib.h @@ -0,0 +1,355 @@ +/** @file + Header file for PmcLib. + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ +#ifndef _PMC_LIB_H_ +#define _PMC_LIB_H_ + +#pragma pack(1) + +typedef enum { + PmcTPch25_10us =3D 0, + PmcTPch25_100us, + PmcTPch25_1ms, + PmcTPch25_10ms, +} PMC_TPCH25_TIMING; + +typedef enum { + PmcNotASleepState, + PmcInS0State, + PmcS1SleepState, + PmcS2SleepState, + PmcS3SleepState, + PmcS4SleepState, + PmcS5SleepState, + PmcUndefinedState, +} PMC_SLEEP_STATE; + +typedef struct { + UINT32 Buf0; + UINT32 Buf1; + UINT32 Buf2; + UINT32 Buf3; +} PMC_IPC_COMMAND_BUFFER; + +// +// Structure to Check different attributes for CrashLog supported by PMC. +// +typedef union { + struct { + UINT32 Avail : 1; ///< CrashLog feature availability bit + UINT32 Dis : 1; ///< CrasLog Disable bit + UINT32 Rsvd : 2; ///< Reserved + UINT32 Size : 12; ///< CrasLog data size. (If it is zero,= use default size 0xC00) + UINT32 BaseOffset : 16; ///< Start offset of CrashLog in PMC SS= RAM + } Bits; + struct { + UINT32 Avail : 1; ///< CrashLog feature availability bit + UINT32 Dis : 1; ///< CrasLog Disable bit + UINT32 Mech : 2; ///< CrashLog mechanism + UINT32 ManuTri : 1; ///< Manul trigger command. + UINT32 Clr : 1; ///< Clear Command + UINT32 AllReset : 1; ///< Trigger on all reset command + UINT32 ReArm : 1; ///< Re-arm command + UINT32 Rsvd : 20; ///< Pch Specific reserved + UINT32 CrashLogReq: 1; ///< Crash log requestor flow + UINT32 TriArmedSts: 1; ///< Trigger armed status, re-arm indic= ation bit. + UINT32 TriAllReset: 1; ///< Trigger on all resets status + UINT32 CrashDisSts: 1; ///< Crash log disabled status + UINT32 PchRsvd : 16; ///< Pch Specific reserved + UINT32 DesTableOffset: 16; ///< Descriptor Table offset + } Bits64; + UINT32 Uint32; + UINT64 Uint64; +} PMC_IPC_DISCOVERY_BUF; + +typedef union { + struct { + UINT32 Offset : 16; + UINT32 Size : 16; + } Info; + UINT32 Uint32; +} PMC_CRASHLOG_RECORDS; + +typedef struct PmcCrashLogLink { + PMC_CRASHLOG_RECORDS Record; + UINT64 AllocateAddress; + struct PmcCrashLogLink *Next; +} PMC_CRASHLOG_LINK; + +#pragma pack() + +/** + Get PCH ACPI base address. + + @retval Address Address of PWRM base address. +**/ +UINT16 +PmcGetAcpiBase ( + VOID + ); + +/** + Get PCH PWRM base address. + + @retval Address Address of PWRM base address. +**/ +UINT32 +PmcGetPwrmBase ( + VOID + ); + +/** + This function sets tPCH25 timing + + @param[in] TimingValue tPCH25 timing value (10us, 100us, 1ms, 10ms= ) +**/ +VOID +PmcSetTPch25Timing ( + IN PMC_TPCH25_TIMING TimingValue + ); + +/** + This function checks if RTC Power Failure occurred by + reading RTC_PWR_FLR bit + + @retval RTC Power Failure state: TRUE - Battery is always present. + FALSE - CMOS is cleared. +**/ +BOOLEAN +PmcIsRtcBatteryGood ( + VOID + ); + +/** + This function checks if Power Failure occurred by + reading PWR_FLR bit + + @retval Power Failure state +**/ +BOOLEAN +PmcIsPowerFailureDetected ( + VOID + ); + +/** + This function checks if Power Failure occurred by + reading SUS_PWR_FLR bit + + @retval SUS Power Failure state +**/ +BOOLEAN +PmcIsSusPowerFailureDetected ( + VOID + ); + +/** + This function clears Power Failure status (PWR_FLR) +**/ +VOID +PmcClearPowerFailureStatus ( + VOID + ); + +/** + This function clears Global Reset status (GBL_RST_STS) +**/ +VOID +PmcClearGlobalResetStatus ( + VOID + ); + +/** + This function clears Host Reset status (HOST_RST_STS) +**/ +VOID +PmcClearHostResetStatus ( + VOID + ); + +/** + This function clears SUS Power Failure status (SUS_PWR_FLR) +**/ +VOID +PmcClearSusPowerFailureStatus ( + VOID + ); + +/** + This function sets state to which platform will get after power is reapp= lied + + @param[in] PowerStateAfterG3 0: S0 state (boot) + 1: S5/S4 State +**/ +VOID +PmcSetPlatformStateAfterPowerFailure ( + IN UINT8 PowerStateAfterG3 + ); + +/** + This function enables Power Button SMI +**/ +VOID +PmcEnablePowerButtonSmi ( + VOID + ); + +/** + This function disables Power Button SMI +**/ +VOID +PmcDisablePowerButtonSmi ( + VOID + ); + +/** + This function reads PM Timer Count driven by 3.579545 MHz clock + + @retval PM Timer Count +**/ +UINT32 +PmcGetTimerCount ( + VOID + ); + +/** + Get Sleep Type that platform has waken from + + @retval SleepType Sleep Type +**/ +PMC_SLEEP_STATE +PmcGetSleepTypeAfterWake ( + VOID + ); + +/** + Clear PMC Wake Status +**/ +VOID +PmcClearWakeStatus ( + VOID + ); + +/** + Configure sleep state + + @param[in] SleepState S0/S1/S3/S4/S5, refer to PMC_SLEEP_STATE +**/ +VOID +PmcSetSleepState ( + PMC_SLEEP_STATE SleepState + ); + +/** + Check if platform boots after shutdown caused by power button override e= vent + + @retval TRUE Power Button Override occurred in last system boot + @retval FALSE Power Button Override didn't occur +**/ +BOOLEAN +PmcIsPowerButtonOverrideDetected ( + VOID + ); + +/** + This function will set the DISB - DRAM Initialization Scratchpad Bit. +**/ +VOID +PmcSetDramInitScratchpad ( + VOID + ); + +/** + Check global SMI enable is set + + @retval TRUE Global SMI enable is set + FALSE Global SMI enable is not set +**/ +BOOLEAN +PmcIsGblSmiEn ( + VOID + ); + +/** + This function checks if SMI Lock is set + + @retval SMI Lock state +**/ +BOOLEAN +PmcIsSmiLockSet ( + VOID + ); + +/** + This function checks if Debug Mode is locked + + @retval Debug Mode Lock state +**/ +BOOLEAN +PmcIsDebugModeLocked ( + VOID + ); + +/** + Check TCO second timeout status. + + @retval TRUE TCO reboot happened. + @retval FALSE TCO reboot didn't happen. +**/ +BOOLEAN +TcoSecondToHappened ( + VOID + ); + +/** + This function clears the Second TO status bit +**/ +VOID +TcoClearSecondToStatus ( + VOID + ); + +/** + Check TCO SMI ENABLE is locked + + @retval TRUE TCO SMI ENABLE is locked + FALSE TCO SMI ENABLE is not locked +**/ +BOOLEAN +TcoIsSmiLock ( + VOID + ); + +/** + Check if user wants to turn off in PEI phase + +**/ +VOID +CheckPowerOffNow( + VOID + ); + + +/** + Clear any SMI status or wake status left from boot. +**/ +VOID +ClearSmiAndWake ( + VOID + ); + +/** + Function to check if Dirty Warm Reset occurs + (Global Reset has been converted to Host Reset) + + @reval TRUE DWR occurs + @reval FALSE Normal boot flow +**/ +BOOLEAN +PmcIsDwrBootMode ( + VOID + ); + +#endif // _PMC_LIB_H_ diff --git a/Silicon/Intel/TigerlakeSiliconPkg/Include/Library/ResetSystemL= ib.h b/Silicon/Intel/TigerlakeSiliconPkg/Include/Library/ResetSystemLib.h new file mode 100644 index 0000000000..9ab55ad9d0 --- /dev/null +++ b/Silicon/Intel/TigerlakeSiliconPkg/Include/Library/ResetSystemLib.h @@ -0,0 +1,79 @@ +/** @file + System reset Library Services. This library class defines a set of + methods that reset the whole system. + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#ifndef __RESET_SYSTEM_LIB_H__ +#define __RESET_SYSTEM_LIB_H__ + +/** + This function causes a system-wide reset (cold reset), in which + all circuitry within the system returns to its initial state. This type = of reset + is asynchronous to system operation and operates without regard to + cycle boundaries. + + If this function returns, it means that the system does not support cold= reset. +**/ +VOID +EFIAPI +ResetCold ( + VOID + ); + +/** + This function causes a system-wide initialization (warm reset), in which= all processors + are set to their initial state. Pending cycles are not corrupted. + + If this function returns, it means that the system does not support warm= reset. +**/ +VOID +EFIAPI +ResetWarm ( + VOID + ); + +/** + This function causes the system to enter a power state equivalent + to the ACPI G2/S5 or G3 states. + + If this function returns, it means that the system does not support shut= down reset. +**/ +VOID +EFIAPI +ResetShutdown ( + VOID + ); + +/** + This function causes the system to enter S3 and then wake up immediately= . + + If this function returns, it means that the system does not support S3 f= eature. +**/ +VOID +EFIAPI +EnterS3WithImmediateWake ( + VOID + ); + +/** + This function causes a systemwide reset. The exact type of the reset is + defined by the EFI_GUID that follows the Null-terminated Unicode string = passed + into ResetData. If the platform does not recognize the EFI_GUID in Reset= Data + the platform must pick a supported reset type to perform.The platform ma= y + optionally log the parameters from any non-normal reset that occurs. + + @param[in] DataSize The size, in bytes, of ResetData. + @param[in] ResetData The data buffer starts with a Null-terminated str= ing, + followed by the EFI_GUID. +**/ +VOID +EFIAPI +ResetPlatformSpecific ( + IN UINTN DataSize, + IN VOID *ResetData + ); + +#endif diff --git a/Silicon/Intel/TigerlakeSiliconPkg/Include/Library/SataLib.h b/= Silicon/Intel/TigerlakeSiliconPkg/Include/Library/SataLib.h new file mode 100644 index 0000000000..bc1555ed19 --- /dev/null +++ b/Silicon/Intel/TigerlakeSiliconPkg/Include/Library/SataLib.h @@ -0,0 +1,112 @@ +/** @file + Header file for SataLib. + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ +#ifndef _SATA_LIB_H_ +#define _SATA_LIB_H_ + +#define SATA_1_CONTROLLER_INDEX 0 +#define SATA_2_CONTROLLER_INDEX 1 +#define SATA_3_CONTROLLER_INDEX 2 + +/** + Get Maximum Sata Port Number + + @param[in] SataCtrlIndex SATA controller index + + @retval Maximum Sata Port Number +**/ +UINT8 +MaxSataPortNum ( + IN UINT32 SataCtrlIndex + ); + +/** + Gets Maximum Sata Controller Number + + @retval Maximum Sata Controller Number +**/ +UINT8 +MaxSataControllerNum ( + VOID + ); + +/** + Get SATA controller's Port Present Status + + @param[in] SataCtrlIndex SATA controller index + + @retval Port Present Status +**/ +UINT8 +GetSataPortPresentStatus ( + IN UINT32 SataCtrlIndex + ); + +/** + Get SATA controller Function Disable Status + + @param[in] SataCtrlIndex SATA controller index + + @retval 0 SATA Controller is not Function Disabled + @retval 1 SATA Controller is Function Disabled +**/ +BOOLEAN +SataControllerFunctionDisableStatus ( + IN UINT32 SataCtrlIndex + ); + +/** + Get SATA controller ABAR size + + @param[in] SataCtrlIndex SATA controller index + + @retval SATA controller ABAR size +**/ +UINT32 +GetSataAbarSize ( + IN UINT32 SataCtrlIndex + ); + +/** + Get SATA controller AHCI base address + + @param[in] SataCtrlIndex SATA controller index + + @retval SATA controller AHCI base address +**/ +UINT32 +GetSataAhciBase ( + IN UINT32 SataCtrlIndex + ); + +/** + Check if SATA controller supports RST remapping + + @param[in] SataCtrlIndex SATA controller index + + @retval TRUE Controller supports remapping + @retval FALSE Controller does not support remapping +**/ +BOOLEAN +IsRemappingSupportedOnSata ( + IN UINT32 SataCtrlIndex + ); + +/** + Checks if SoC supports the SATA PGD power down on given + SATA controller. + + @param[in] SataCtrlIndex SATA controller index + + @retval TRUE SATA PGD power down supported + @retval FALSE SATA PGD power down not supported +**/ +BOOLEAN +IsSataPowerGatingSupported ( + IN UINT32 SataCtrlIndex + ); + +#endif // _SATA_LIB_H_ diff --git a/Silicon/Intel/TigerlakeSiliconPkg/Include/Library/SerialIoAcce= ssLib.h b/Silicon/Intel/TigerlakeSiliconPkg/Include/Library/SerialIoAccessL= ib.h new file mode 100644 index 0000000000..3c8aae6ac2 --- /dev/null +++ b/Silicon/Intel/TigerlakeSiliconPkg/Include/Library/SerialIoAccessLib.h @@ -0,0 +1,113 @@ +/** @file + Header file for Serial Io Common Lib + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ +#ifndef _SERIAL_IO_ACCESS_LIB_H_ +#define _SERIAL_IO_ACCESS_LIB_H_ + +/** + Returns BAR0 + + @param[in] PciCfgBase Pci Config Base + + @retval 64bit MMIO BAR Address +**/ +UINT64 +GetSerialIoBar ( + IN UINT64 PciCfgBase + ); + +/** + Returns I2C Pci Config Space + + @param[in] I2cNumber I2C Number + + @retval I2C Pci Config Space Address +**/ +UINT64 +GetSerialIoI2cPciCfg ( + IN UINT8 I2cNumber + ); + +/** + Returns SPI Pci Config Space + + @param[in] SpiNumber SPI Number + + @retval SPI Pci Config Space Address +**/ +UINT64 +GetSerialIoSpiPciCfg ( + IN UINT8 SpiNumber + ); + +/** + Returns UART Pci Config Space + + @param[in] UartNumber UART Number + + @retval UART Pci Config Space Address +**/ +UINT64 +GetSerialIoUartPciCfg ( + IN UINT8 UartNumber + ); + +/** + Checks if Device with given PciDeviceId is one of SerialIo I2C controlle= rs + If yes, its number is returned through I2cIndex parameter, otherwise I2c= Index is not updated + + @param[in] PciDevId Device ID + @param[out] I2cNumber Number of SerialIo I2C controller + + @retval TRUE yes it is a SerialIo I2C controlle= r + @retval FALSE no it isn't a SerialIo I2C control= ler +**/ +BOOLEAN +IsSerialIoI2cDeviceId ( + IN UINT16 PciDevId, + OUT UINT8 *I2cNumber + ); + +/** + Checks if I2c is Function 0 Enabled + + @param[in] I2cIndex Number of the SerialIo I2C control= ler + + @retval TRUE Enabled + @retval FALSE Disabled +**/ +BOOLEAN +IsSerialIoI2cFunction0Enabled ( + IN UINT8 I2cIndex + ); + +/** + Checks if Uart is Function 0 Enabled + + @param[in] UartIndex Number of the SerialIo Uart contr= oller + + @retval TRUE Enabled + @retval FALSE Disabled +**/ +BOOLEAN +IsSerialIoUartFunction0Enabled ( + IN UINT8 UartIndex + ); + +/** + Checks if Spi is Function 0 Enabled + + @param[in] SpiIndex Number of the SerialIo Spi control= ler + + @retval TRUE Enabled + @retval FALSE Disabled +**/ +BOOLEAN +IsSerialIoSpiFunction0Enabled ( + IN UINT8 SpiIndex + ); + +#endif // _SERIAL_IO_ACCESS_LIB_H_ diff --git a/Silicon/Intel/TigerlakeSiliconPkg/Include/Library/SiConfigBloc= kLib.h b/Silicon/Intel/TigerlakeSiliconPkg/Include/Library/SiConfigBlockLib= .h new file mode 100644 index 0000000000..7732ccf59e --- /dev/null +++ b/Silicon/Intel/TigerlakeSiliconPkg/Include/Library/SiConfigBlockLib.h @@ -0,0 +1,56 @@ +/** @file + Prototype of the SiConfigBlockLib library. + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ +#ifndef _SI_CONFIG_BLOCK_LIB_H_ +#define _SI_CONFIG_BLOCK_LIB_H_ + + +typedef +VOID +(*LOAD_DEFAULT_FUNCTION) ( + IN VOID *ConfigBlockPointer + ); + +typedef struct { + EFI_GUID *Guid; + UINT16 Size; + UINT8 Revision; + LOAD_DEFAULT_FUNCTION LoadDefault; +} COMPONENT_BLOCK_ENTRY; + +/** + GetComponentConfigBlockTotalSize get config block table total size. + + @param[in] ComponentBlocks Component blocks array + @param[in] TotalBlockCount Number of blocks + + @retval Size of config block table +**/ +UINT16 +EFIAPI +GetComponentConfigBlockTotalSize ( + IN COMPONENT_BLOCK_ENTRY *ComponentBlocks, + IN UINT16 TotalBlockCount + ); + +/** + AddComponentConfigBlocks add all config blocks. + + @param[in] ConfigBlockTableAddress The pointer to add config blocks + @param[in] ComponentBlocks Config blocks array + @param[in] TotalBlockCount Number of blocks + + @retval EFI_SUCCESS The policy default is initialized. + @retval EFI_OUT_OF_RESOURCES Insufficient resources to create b= uffer +**/ +EFI_STATUS +EFIAPI +AddComponentConfigBlocks ( + IN VOID *ConfigBlockTableAddress, + IN COMPONENT_BLOCK_ENTRY *ComponentBlocks, + IN UINT16 TotalBlockCount + ); +#endif // _SI_CONFIG_BLOCK_LIB_H_ diff --git a/Silicon/Intel/TigerlakeSiliconPkg/Include/Library/SpiAccessLib= .h b/Silicon/Intel/TigerlakeSiliconPkg/Include/Library/SpiAccessLib.h new file mode 100644 index 0000000000..50f9e048b3 --- /dev/null +++ b/Silicon/Intel/TigerlakeSiliconPkg/Include/Library/SpiAccessLib.h @@ -0,0 +1,290 @@ +/** @file + SPI library header for abstraction of SPI HW registers accesses + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ +#ifndef _SPI_ACCESS_LIB_H_ +#define _SPI_ACCESS_LIB_H_ + +/** + Returns SPI PCI Config Space base address + + @retval UINT64 SPI Config Space base address +**/ +UINT64 +SpiGetPciCfgAddress ( + VOID + ); + +/** + Returns SPI BAR0 value + + @retval UINT32 PCH SPI BAR0 value +**/ +UINT32 +SpiGetBar0 ( + VOID + ); + +/** + Returns SPI Device number + + @retval UINT8 PCH SPI Device number +**/ +UINT8 +SpiDeviceNumber ( + VOID + ); + +/** + Returns SPI Function number + + @retval UINT8 PCH SPI Function number +**/ +UINT8 +SpiFunctionNumber ( + VOID + ); + +/** + Returns descriptor signature + + @retval UINT32 Descriptor signature +**/ +UINT32 +SpiGetDescriptorSignature ( + VOID + ); + +/** + Returns supported features and R/W frequencies of Flash Component + + @retval UINT32 Flash Component features descriptor +**/ +UINT32 +SpiGetFlashComponentDescription ( + VOID + ); + +/** + Returns number of Flash Components + + @retval UINT32 Flash components number +**/ +UINT32 +SpiGetFlashComponentsNumber ( + VOID + ); + +/** + Returns total Flash size with regards to number of flash components + + @retval UINT32 Total Flash Memory size +**/ +UINT32 +SpiGetTotalFlashSize ( + VOID + ); + +/** + Checks if PCH SPI Controler is present and available + + @retval TRUE PCH SPI controller is avaialable + @retval FALSE PCH SPI controller is not available +**/ +BOOLEAN +SpiIsControllerAvailable ( + VOID + ); + +/** + Checks BIOS lock bits for proper value and checks if write protection is= enabled + Expected vales are: LE bit set, EISS bit set and WPD bit cleared + + @retval TRUE All protection bits are set correctly + @retval FALSE Not all protection bits had exepcted values +**/ +BOOLEAN +SpiIsWriteProtectionEnabled ( + VOID + ); + +/** + Returns Flash Descriptor Override Pin Strap status + + @retval TRUE Flash Descriptor override is enabled + @retval FALSE Flash Descriptor override is disabled +**/ +BOOLEAN +SpiIsFlashDescriptorOverrideEnabled ( + VOID + ); + +/** + Returns Flash Configuration Lock Down bit status + + @retval TRUE Flash Configuration Lock Down bit is set + @retval FALSE Flash Configuration Lock Down bit is not set +**/ +BOOLEAN +SpiIsFlashConfigurationLockDownEnabled ( + VOID + ); + +/** + Returns Top Swap functionality enable state + + @retval TRUE Top Swap is enabled + @retval FALSE Top Swap is disabled +**/ +BOOLEAN +SpiIsTopSwapEnabled ( + VOID + ); + +/** + Return Component Property Parameter Table for a given component number + + @param[in] ComponentNumber SPI Component number + @param[out] CppTable Component Poperty Parameter Table value + + @retval TRUE Vendor Specific Component Capabilities Register value was = read + @reval FALSE Vendor Specific Component Capabilities Register value was = not present +**/ +BOOLEAN +SpiGetComponentPropertyParameterTable ( + IN UINT8 ComponentNumber, + OUT UINT32 *CppTable + ); + +/** + Returns valid bit status in given Component Property Parameter Table + + @param[in] CppTable Component Poperty Parameter Table value + + @retval TRUE Valid bit is set + @reval FALSE Valid bit is not set +**/ +BOOLEAN +SpiIsCppValidBitSet ( + IN UINT32 CppTable + ); + +/** + Checks if Flash Descriptor is valid + + @retval TRUE Flash Descriptor is valid + @retval FALSE Flash Descriptor is invalid +**/ +BOOLEAN +SpiIsFlashDescriptorValid ( + VOID + ); + +/** + Returns masked BIOS Master Read Access + + @retval UINT32 Already masked BIOS Master Read Access +**/ +UINT32 +SpiGetMasterReadAccess ( + VOID + ); + +/** + Returns masked BIOS Master Write Access + + @retval UINT32 Already masked BIOS Master Write Access +**/ +UINT32 +SpiGetMasterWriteAccess ( + VOID + ); + +/** + Returns GbE Region Access rights + + @retval UINT32 GbE Region access rights +**/ +UINT32 +SpiGetGbeRegionAccess ( + VOID + ); + +/** + Returns CSME region access rights + + @retval UINT32 CSME Region Access rights +**/ +UINT32 +SpiGetCsmeRegionAccess ( + VOID + ); + +/** + Returns EC region access right + + @retval UINT32 EC Region access rights +**/ +UINT32 +SpiGetEcRegionAccess ( + VOID + ); + +/** + Checks if Slave Attached Flash (SAF) mode is active + + @retval TRUE SAF mode is active + @retval FALSE SAF mode is not active +**/ +BOOLEAN +SpiIsSafModeActive ( + VOID + ); + +/** + Checks validity of GbE region + + @retval TRUE GbE region is valid + @retval FALSE GbE regios in invalid +**/ +BOOLEAN +SpiIsGbeRegionValid ( + VOID + ); + +/** + Returns status of BIOS Interface Lockdown + + @retval TRUE BIOS Interface Lockdown is enabled + @retval FALSE BIOS Interface Lockdown is disabled +**/ +BOOLEAN +SpiIsBiosInterfaceLockdownEnabled ( + VOID + ); + +/** + Returns TRUE if BIOS Boot Strap is set to SPI + + @retval TRUE BIOS Boot strap is set to SPI + @retval FALSE BIOS Boot strap is set to LPC/eSPI +**/ +BOOLEAN +SpiIsBiosBootFromSpi ( + VOID + ); + +/** + Check SPI write status disable is set + + @retval TRUE Write status disable is set + @retval FALSE Write status disable is not set +**/ +BOOLEAN +SpiIsWriteStatusDisable ( + VOID + ); + +#endif // _SPI_ACCESS_LIB_H_ diff --git a/Silicon/Intel/TigerlakeSiliconPkg/Include/Library/VtdInfoLib.h= b/Silicon/Intel/TigerlakeSiliconPkg/Include/Library/VtdInfoLib.h new file mode 100644 index 0000000000..69eed8d32d --- /dev/null +++ b/Silicon/Intel/TigerlakeSiliconPkg/Include/Library/VtdInfoLib.h @@ -0,0 +1,53 @@ +/** @file + Header file for VtdInfoLib. + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ +#ifndef _VTD_INFO_LIB_H_ +#define _VTD_INFO_LIB_H_ + +#include +#include +#include + +#define VTD_ENGINE_NUMBER 7 + +#pragma pack(1) + +/** + Get VTD Engine Base Address from PCD values. + + @param[in] VtdEngineNumber - Engine number for which VTD Base Ad= deress is required. + + @retval VTD Engine Base Address +**/ +UINT32 +GetVtdBaseAddress ( + IN UINT8 VtdEngineNumber + ); + +/** + Read VTD Engine Base Address from VTD BAR Offsets. + + @param[in] VtdEngineNumber - Engine number for which VTD Base Ad= deress is required. + + @retval VTD Engine Base Address +**/ +UINT32 +ReadVtdBaseAddress ( + IN UINT8 VtdEngineNumber + ); + +/** + GetMaxVtdEngineNumber: Get Maximum Vtd Engine Number + + @retval Vtd Engine Number +**/ +UINT8 +GetMaxVtdEngineNumber( + VOID +); + +#pragma pack() +#endif // _VTD_INFO_LIB_H_ diff --git a/Silicon/Intel/TigerlakeSiliconPkg/Include/Ppi/PeiPreMemSiDefau= ltPolicy.h b/Silicon/Intel/TigerlakeSiliconPkg/Include/Ppi/PeiPreMemSiDefau= ltPolicy.h new file mode 100644 index 0000000000..3fd917c2b9 --- /dev/null +++ b/Silicon/Intel/TigerlakeSiliconPkg/Include/Ppi/PeiPreMemSiDefaultPolic= y.h @@ -0,0 +1,34 @@ +/** @file + This file defines the function to initialize default silicon policy PPI. + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#ifndef _PEI_PREMEM_SI_DEFAULT_POLICY_INIT_PPI_H_ +#define _PEI_PREMEM_SI_DEFAULT_POLICY_INIT_PPI_H_ + +// +// Forward declaration for the PEI_PREMEM_SI_DEFAULT_POLICY_INIT_PPI. +// +typedef struct _PEI_PREMEM_SI_DEFAULT_POLICY_INIT_PPI PEI_PREMEM_SI_DEFAUL= T_POLICY_INIT_PPI; + +/** + Initialize and install default silicon policy PPI +**/ +typedef +EFI_STATUS +(EFIAPI *PEI_PREMEM_POLICY_INIT) ( + VOID + ); + +/// +/// This PPI provides function to install default silicon policy +/// +struct _PEI_PREMEM_SI_DEFAULT_POLICY_INIT_PPI { + PEI_PREMEM_POLICY_INIT PeiPreMemPolicyInit; ///< PeiPreMemPolicyInit= () +}; + +extern EFI_GUID gSiPreMemDefaultPolicyInitPpiGuid; + +#endif // _PEI_PREMEM_SI_DEFAULT_POLICY_INIT_PPI_H_ diff --git a/Silicon/Intel/TigerlakeSiliconPkg/Include/Ppi/PeiSiDefaultPoli= cy.h b/Silicon/Intel/TigerlakeSiliconPkg/Include/Ppi/PeiSiDefaultPolicy.h new file mode 100644 index 0000000000..9cb34728cc --- /dev/null +++ b/Silicon/Intel/TigerlakeSiliconPkg/Include/Ppi/PeiSiDefaultPolicy.h @@ -0,0 +1,33 @@ +/** @file + This file defines the function to initialize default silicon policy PPI. + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ +#ifndef _PEI_SI_DEFAULT_POLICY_INIT_PPI_H_ +#define _PEI_SI_DEFAULT_POLICY_INIT_PPI_H_ + +// +// Forward declaration for the PEI_SI_DEFAULT_POLICY_INIT_PPI. +// +typedef struct _PEI_SI_DEFAULT_POLICY_INIT_PPI PEI_SI_DEFAULT_POLICY_INIT_= PPI; + +/** + Initialize and install default silicon policy PPI +**/ +typedef +EFI_STATUS +(EFIAPI *PEI_POLICY_INIT) ( + VOID + ); + +/// +/// This PPI provides function to install default silicon policy +/// +struct _PEI_SI_DEFAULT_POLICY_INIT_PPI { + PEI_POLICY_INIT PeiPolicyInit; ///< PeiPolicyInit() +}; + +extern EFI_GUID gSiDefaultPolicyInitPpiGuid; + +#endif // _PEI_SI_DEFAULT_POLICY_INIT_PPI_H_ diff --git a/Silicon/Intel/TigerlakeSiliconPkg/Include/Ppi/SiPolicy.h b/Sil= icon/Intel/TigerlakeSiliconPkg/Include/Ppi/SiPolicy.h new file mode 100644 index 0000000000..5f4d467439 --- /dev/null +++ b/Silicon/Intel/TigerlakeSiliconPkg/Include/Ppi/SiPolicy.h @@ -0,0 +1,75 @@ +/** @file + Silicon Policy PPI is used for specifying platform + related Intel silicon information and policy setting. + This PPI is consumed by the silicon PEI modules and carried + over to silicon DXE modules. + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#ifndef _SI_POLICY_PPI_H_ +#define _SI_POLICY_PPI_H_ + +#include +#include +#include +#include +#include +#include +#include + +#ifndef DISABLED +#define DISABLED 0 +#endif +#ifndef ENABLED +#define ENABLED 1 +#endif + +extern EFI_GUID gSiPreMemPolicyPpiGuid; +extern EFI_GUID gSiPolicyPpiGuid; + + +#include +extern EFI_GUID gGraphicsPeiPreMemConfigGuid; +extern EFI_GUID gGraphicsPeiConfigGuid; + +#include +extern EFI_GUID gVtdConfigGuid; + +#include +extern EFI_GUID gGnaConfigGuid; + +#include +extern EFI_GUID gCpuPciePeiPreMemConfigGuid; +extern EFI_GUID gCpuPcieRpConfigGuid; + +#include +extern EFI_GUID gHybridGraphicsConfigGuid; + +#include +#include +extern EFI_GUID gMemoryConfigGuid; +extern EFI_GUID gMemoryConfigNoCrcGuid; + +#include +extern EFI_GUID gSaMiscPeiPreMemConfigGuid; + +#include +extern EFI_GUID gSaMiscPeiConfigGuid; + + +#include +extern EFI_GUID gCpuTraceHubConfigGuid; + +#include +extern EFI_GUID gHostBridgePeiPreMemConfigGuid; +extern EFI_GUID gHostBridgePeiConfigGuid; + +#include +extern EFI_GUID gCpuDmiPreMemConfigGuid; + +typedef struct _SI_PREMEM_POLICY_STRUCT SI_PREMEM_POLICY_PPI; +typedef struct _SI_POLICY_STRUCT SI_POLICY_PPI; + +#endif // _SI_POLICY_PPI_H_ diff --git a/Silicon/Intel/TigerlakeSiliconPkg/Include/Protocol/GopComponen= tName2.h b/Silicon/Intel/TigerlakeSiliconPkg/Include/Protocol/GopComponentN= ame2.h new file mode 100644 index 0000000000..1d69ee0e8d --- /dev/null +++ b/Silicon/Intel/TigerlakeSiliconPkg/Include/Protocol/GopComponentName2.= h @@ -0,0 +1,61 @@ +/** @file + Protocol to retrieve the GOP driver version + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ +#ifndef _GOP_COMPONENT_NAME2_H_ +#define _GOP_COMPONENT_NAME2_H_ + + +typedef struct _GOP_COMPONENT_NAME2_PROTOCOL GOP_COMPONENT_NAME2_PROTOCOL= ; + +/// +/// GOP Component protocol for retrieving driver name +/// +typedef +EFI_STATUS +(EFIAPI *GOP_COMPONENT_NAME2_GET_DRIVER_NAME) ( + IN GOP_COMPONENT_NAME2_PROTOCOL * This, + IN CHAR8 *Language, + OUT CHAR16 **DriverName + ); + +/// +/// GOP Component protocol for retrieving controller name +/// +typedef +EFI_STATUS +(EFIAPI *GOP_COMPONENT_NAME2_GET_CONTROLLER_NAME) ( + IN GOP_COMPONENT_NAME2_PROTOCOL * This, + IN EFI_HANDLE ControllerHandle, + IN EFI_HANDLE ChildHandle OPTIONAL, + IN CHAR8 *Language, + OUT CHAR16 **ControllerName + ); + +/// +/// GOP Component protocol for retrieving driver version +/// +typedef +EFI_STATUS +(EFIAPI *GOP_COMPONENT_NAME2_GET_DRIVER_VERSION) ( + IN GOP_COMPONENT_NAME2_PROTOCOL * This, + IN CHAR8 *Language, + OUT CHAR16 **DriverVersion + ); + +/** + GOP Component protocol\n + This protocol will be installed by GOP driver and can be used to retriev= e GOP information. +**/ +struct _GOP_COMPONENT_NAME2_PROTOCOL { + GOP_COMPONENT_NAME2_GET_DRIVER_NAME GetDriverName; ///< Pr= otocol function to get driver name + GOP_COMPONENT_NAME2_GET_DRIVER_VERSION GetDriverVersion; ///< Pr= otocol function to get driver version + GOP_COMPONENT_NAME2_GET_CONTROLLER_NAME GetControllerName; ///< Pr= otocol function to get controller name + CHAR8 *SupportedLanguages; ///< Nu= mber of Supported languages. +}; + +extern EFI_GUID gGopComponentName2ProtocolGuid; + +#endif diff --git a/Silicon/Intel/TigerlakeSiliconPkg/Include/Protocol/GopPolicy.h= b/Silicon/Intel/TigerlakeSiliconPkg/Include/Protocol/GopPolicy.h new file mode 100644 index 0000000000..c8dc17008e --- /dev/null +++ b/Silicon/Intel/TigerlakeSiliconPkg/Include/Protocol/GopPolicy.h @@ -0,0 +1,73 @@ +/** @file + Interface definition for GopPolicy Protocol. + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ +#ifndef _GOP_POLICY_PROTOCOL_H_ +#define _GOP_POLICY_PROTOCOL_H_ + + +#define GOP_POLICY_PROTOCOL_REVISION_01 0x01 +#define GOP_POLICY_PROTOCOL_REVISION_03 0x03 + +typedef enum { + LidClosed, + LidOpen, + LidStatusMax +} LID_STATUS; + +typedef enum { + Docked, + UnDocked, + DockStatusMax +} DOCK_STATUS; + +/// +/// Function to retrieve LID status +/// +typedef +EFI_STATUS +(EFIAPI *GET_PLATFORM_LID_STATUS) ( + OUT LID_STATUS * CurrentLidStatus + ); + +/// +/// Function to retrieve Dock status +/// +typedef +EFI_STATUS +(EFIAPI *GET_PLATFORM_DOCK_STATUS) ( + OUT DOCK_STATUS CurrentDockStatus +); + +/// +/// Function to retrieve VBT table address and size +/// +typedef +EFI_STATUS +(EFIAPI *GET_VBT_DATA) ( + OUT EFI_PHYSICAL_ADDRESS * VbtAddress, + OUT UINT32 *VbtSize + ); + +/** + System Agent Graphics Output Protocol (GOP) - Policy Protocol\n + Graphics Output Protocol (GOP) is a UEFI API replacing legacy Video ROMs= for EFI boot\n + When GOP Driver is used this protocol can be consumed by GOP driver or p= latform code for GOP relevant initialization\n + All functions in this protocol should be initialized by platform code ba= sing on platform implementation\n +**/ +typedef struct { + UINT32 Revision; ///< Protocol revision + GET_PLATFORM_LID_STATUS GetPlatformLidStatus; ///< Protocol function = to get Lid Status. Platform code should provide this function basing on des= ign. + GET_VBT_DATA GetVbtData; ///< Protocol function = to get Vbt Data address and size. Platform code should provide this functio= n basing on design. + GET_PLATFORM_DOCK_STATUS GetPlatformDockStatus; ///< Function pointer = for get platform dock status. + EFI_GUID GopOverrideGuid; ///< A GUID provided b= y BIOS in case GOP is to be overridden. +} GOP_POLICY_PROTOCOL; + +extern EFI_GUID gGopPolicyProtocolGuid; +extern EFI_GUID gGen12PolicyProtocolGuid; +extern EFI_GUID gGen9PolicyProtocolGuid; +extern EFI_GUID gIntelGraphicsVbtGuid; + +#endif diff --git a/Silicon/Intel/TigerlakeSiliconPkg/Include/Protocol/IgdOpRegion= .h b/Silicon/Intel/TigerlakeSiliconPkg/Include/Protocol/IgdOpRegion.h new file mode 100644 index 0000000000..c030f771e3 --- /dev/null +++ b/Silicon/Intel/TigerlakeSiliconPkg/Include/Protocol/IgdOpRegion.h @@ -0,0 +1,22 @@ +/** @file + This file is part of the IGD OpRegion Implementation. The IGD OpRegion = is + an interface between system BIOS, ASL code, and Graphics drivers. + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ +#ifndef _IGD_OPREGION_PROTOCOL_H_ +#define _IGD_OPREGION_PROTOCOL_H_ + +#include + +extern EFI_GUID gIgdOpRegionProtocolGuid; + +/// +/// IGD OpRegion Protocol +/// +typedef struct { + IGD_OPREGION_STRUCTURE *OpRegion; ///< IGD Operation Region Structure +} IGD_OPREGION_PROTOCOL; + +#endif diff --git a/Silicon/Intel/TigerlakeSiliconPkg/Include/Protocol/Spi.h b/Sil= icon/Intel/TigerlakeSiliconPkg/Include/Protocol/Spi.h new file mode 100644 index 0000000000..c13dc5a5f5 --- /dev/null +++ b/Silicon/Intel/TigerlakeSiliconPkg/Include/Protocol/Spi.h @@ -0,0 +1,301 @@ +/** @file + This file defines the PCH SPI Protocol which implements the + Intel(R) PCH SPI Host Controller Compatibility Interface. + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ +#ifndef _PCH_SPI_PROTOCOL_H_ +#define _PCH_SPI_PROTOCOL_H_ + +// +// Extern the GUID for protocol users. +// +extern EFI_GUID gPchSpiProtocolGuid; +extern EFI_GUID gPchSmmSpiProtocolGuid; + +// +// Forward reference for ANSI C compatibility +// +typedef struct _PCH_SPI_PROTOCOL PCH_SPI_PROTOCOL; + +// +// SPI protocol data structures and definitions +// + +/** + Flash Region Type +**/ +typedef enum { + FlashRegionDescriptor, + FlashRegionBios, + FlashRegionMe, + FlashRegionGbE, + FlashRegionPlatformData, + FlashRegionDer, + FlashRegionSecondaryBios, + FlashRegionuCodePatch, + FlashRegionEC, + FlashRegionDeviceExpansion2, + FlashRegionIE, + FlashRegion10Gbe_A, + FlashRegion10Gbe_B, + FlashRegion13, + FlashRegion14, + FlashRegion15, + FlashRegionAll, + FlashRegionMax +} FLASH_REGION_TYPE; +// +// Protocol member functions +// + +/** + Read data from the flash part. + + @param[in] This Pointer to the PCH_SPI_PROTOCOL instance= . + @param[in] FlashRegionType The Flash Region type for flash cycle wh= ich is listed in the Descriptor. + @param[in] Address The Flash Linear Address must fall withi= n a region for which BIOS has access permissions. + @param[in] ByteCount Number of bytes in the data portion of t= he SPI cycle. + @param[out] Buffer The Pointer to caller-allocated buffer c= ontaining the dada received. + It is the caller's responsibility to mak= e sure Buffer is large enough for the total number of bytes read. + + @retval EFI_SUCCESS Command succeed. + @retval EFI_INVALID_PARAMETER The parameters specified are not valid. + @retval EFI_DEVICE_ERROR Device error, command aborts abnormally. +**/ +typedef +EFI_STATUS +(EFIAPI *PCH_SPI_FLASH_READ) ( + IN PCH_SPI_PROTOCOL *This, + IN FLASH_REGION_TYPE FlashRegionType, + IN UINT32 Address, + IN UINT32 ByteCount, + OUT UINT8 *Buffer + ); + +/** + Write data to the flash part. Remark: Erase may be needed before write t= o the flash part. + + @param[in] This Pointer to the PCH_SPI_PROTOCOL instance= . + @param[in] FlashRegionType The Flash Region type for flash cycle wh= ich is listed in the Descriptor. + @param[in] Address The Flash Linear Address must fall withi= n a region for which BIOS has access permissions. + @param[in] ByteCount Number of bytes in the data portion of t= he SPI cycle. + @param[in] Buffer Pointer to caller-allocated buffer conta= ining the data sent during the SPI cycle. + + @retval EFI_SUCCESS Command succeed. + @retval EFI_INVALID_PARAMETER The parameters specified are not valid. + @retval EFI_DEVICE_ERROR Device error, command aborts abnormally. +**/ +typedef +EFI_STATUS +(EFIAPI *PCH_SPI_FLASH_WRITE) ( + IN PCH_SPI_PROTOCOL *This, + IN FLASH_REGION_TYPE FlashRegionType, + IN UINT32 Address, + IN UINT32 ByteCount, + IN UINT8 *Buffer + ); + +/** + Erase some area on the flash part. + + @param[in] This Pointer to the PCH_SPI_PROTOCOL instance= . + @param[in] FlashRegionType The Flash Region type for flash cycle wh= ich is listed in the Descriptor. + @param[in] Address The Flash Linear Address must fall withi= n a region for which BIOS has access permissions. + @param[in] ByteCount Number of bytes in the data portion of t= he SPI cycle. + + @retval EFI_SUCCESS Command succeed. + @retval EFI_INVALID_PARAMETER The parameters specified are not valid. + @retval EFI_DEVICE_ERROR Device error, command aborts abnormally. +**/ +typedef +EFI_STATUS +(EFIAPI *PCH_SPI_FLASH_ERASE) ( + IN PCH_SPI_PROTOCOL *This, + IN FLASH_REGION_TYPE FlashRegionType, + IN UINT32 Address, + IN UINT32 ByteCount + ); + +/** + Read SFDP data from the flash part. + + @param[in] This Pointer to the PCH_SPI_PROTOCOL instance= . + @param[in] ComponentNumber The Componen Number for chip select + @param[in] Address The starting byte address for SFDP data = read. + @param[in] ByteCount Number of bytes in SFDP data portion of = the SPI cycle + @param[out] SfdpData The Pointer to caller-allocated buffer c= ontaining the SFDP data received + It is the caller's responsibility to mak= e sure Buffer is large enough for the total number of bytes read + + @retval EFI_SUCCESS Command succeed. + @retval EFI_INVALID_PARAMETER The parameters specified are not valid. + @retval EFI_DEVICE_ERROR Device error, command aborts abnormally. +**/ +typedef +EFI_STATUS +(EFIAPI *PCH_SPI_FLASH_READ_SFDP) ( + IN PCH_SPI_PROTOCOL *This, + IN UINT8 ComponentNumber, + IN UINT32 Address, + IN UINT32 ByteCount, + OUT UINT8 *SfdpData + ); + +/** + Read Jedec Id from the flash part. + + @param[in] This Pointer to the PCH_SPI_PROTOCOL instance= . + @param[in] ComponentNumber The Componen Number for chip select + @param[in] ByteCount Number of bytes in JedecId data portion = of the SPI cycle, the data size is 3 typically + @param[out] JedecId The Pointer to caller-allocated buffer c= ontaining JEDEC ID received + It is the caller's responsibility to mak= e sure Buffer is large enough for the total number of bytes read. + + @retval EFI_SUCCESS Command succeed. + @retval EFI_INVALID_PARAMETER The parameters specified are not valid. + @retval EFI_DEVICE_ERROR Device error, command aborts abnormally. +**/ +typedef +EFI_STATUS +(EFIAPI *PCH_SPI_FLASH_READ_JEDEC_ID) ( + IN PCH_SPI_PROTOCOL *This, + IN UINT8 ComponentNumber, + IN UINT32 ByteCount, + OUT UINT8 *JedecId + ); + +/** + Write the status register in the flash part. + + @param[in] This Pointer to the PCH_SPI_PROTOCOL instance= . + @param[in] ByteCount Number of bytes in Status data portion o= f the SPI cycle, the data size is 1 typically + @param[in] StatusValue The Pointer to caller-allocated buffer c= ontaining the value of Status register writing + + @retval EFI_SUCCESS Command succeed. + @retval EFI_INVALID_PARAMETER The parameters specified are not valid. + @retval EFI_DEVICE_ERROR Device error, command aborts abnormally. +**/ +typedef +EFI_STATUS +(EFIAPI *PCH_SPI_FLASH_WRITE_STATUS) ( + IN PCH_SPI_PROTOCOL *This, + IN UINT32 ByteCount, + IN UINT8 *StatusValue + ); + +/** + Read status register in the flash part. + + @param[in] This Pointer to the PCH_SPI_PROTOCOL instance= . + @param[in] ByteCount Number of bytes in Status data portion o= f the SPI cycle, the data size is 1 typically + @param[out] StatusValue The Pointer to caller-allocated buffer c= ontaining the value of Status register received. + + @retval EFI_SUCCESS Command succeed. + @retval EFI_INVALID_PARAMETER The parameters specified are not valid. + @retval EFI_DEVICE_ERROR Device error, command aborts abnormally. +**/ +typedef +EFI_STATUS +(EFIAPI *PCH_SPI_FLASH_READ_STATUS) ( + IN PCH_SPI_PROTOCOL *This, + IN UINT32 ByteCount, + OUT UINT8 *StatusValue + ); + +/** + Get the SPI region base and size, based on the enum type + + @param[in] This Pointer to the PCH_SPI_PROTOCOL instance= . + @param[in] FlashRegionType The Flash Region type for for the base a= ddress which is listed in the Descriptor. + @param[out] BaseAddress The Flash Linear Address for the Region = 'n' Base + @param[out] RegionSize The size for the Region 'n' + + @retval EFI_SUCCESS Read success + @retval EFI_INVALID_PARAMETER Invalid region type given + @retval EFI_DEVICE_ERROR The region is not used +**/ +typedef +EFI_STATUS +(EFIAPI *PCH_SPI_GET_REGION_ADDRESS) ( + IN PCH_SPI_PROTOCOL *This, + IN FLASH_REGION_TYPE FlashRegionType, + OUT UINT32 *BaseAddress, + OUT UINT32 *RegionSize + ); + +/** + Read PCH Soft Strap Values + + @param[in] This Pointer to the PCH_SPI_PROTOCOL instance= . + @param[in] SoftStrapAddr PCH Soft Strap address offset from FPSBA= . + @param[in] ByteCount Number of bytes in SoftStrap data portio= n of the SPI cycle + @param[out] SoftStrapValue The Pointer to caller-allocated buffer c= ontaining PCH Soft Strap Value. + If the value of ByteCount is 0, the data= type of SoftStrapValue should be UINT16 and SoftStrapValue will be PCH Sof= t Strap Length + It is the caller's responsibility to mak= e sure Buffer is large enough for the total number of bytes read. + + @retval EFI_SUCCESS Command succeed. + @retval EFI_INVALID_PARAMETER The parameters specified are not valid. + @retval EFI_DEVICE_ERROR Device error, command aborts abnormally. +**/ +typedef +EFI_STATUS +(EFIAPI *PCH_SPI_READ_PCH_SOFTSTRAP) ( + IN PCH_SPI_PROTOCOL *This, + IN UINT32 SoftStrapAddr, + IN UINT32 ByteCount, + OUT VOID *SoftStrapValue + ); + +/** + Read CPU Soft Strap Values + + @param[in] This Pointer to the PCH_SPI_PROTOCOL instance= . + @param[in] SoftStrapAddr CPU Soft Strap address offset from FCPUS= BA. + @param[in] ByteCount Number of bytes in SoftStrap data portio= n of the SPI cycle. + @param[out] SoftStrapValue The Pointer to caller-allocated buffer c= ontaining CPU Soft Strap Value. + If the value of ByteCount is 0, the data= type of SoftStrapValue should be UINT16 and SoftStrapValue will be PCH Sof= t Strap Length + It is the caller's responsibility to mak= e sure Buffer is large enough for the total number of bytes read. + + @retval EFI_SUCCESS Command succeed. + @retval EFI_INVALID_PARAMETER The parameters specified are not valid. + @retval EFI_DEVICE_ERROR Device error, command aborts abnormally. +**/ +typedef +EFI_STATUS +(EFIAPI *PCH_SPI_READ_CPU_SOFTSTRAP) ( + IN PCH_SPI_PROTOCOL *This, + IN UINT32 SoftStrapAddr, + IN UINT32 ByteCount, + OUT VOID *SoftStrapValue + ); + +/** + These protocols/PPI allows a platform module to perform SPI operations t= hrough the + Intel PCH SPI Host Controller Interface. +**/ +struct _PCH_SPI_PROTOCOL { + /** + This member specifies the revision of this structure. This field is us= ed to + indicate backwards compatible changes to the protocol. + **/ + UINT8 Revision; + PCH_SPI_FLASH_READ FlashRead; ///< Read data fro= m the flash part. + PCH_SPI_FLASH_WRITE FlashWrite; ///< Write data to= the flash part. Remark: Erase may be needed before write to the flash part= . + PCH_SPI_FLASH_ERASE FlashErase; ///< Erase some ar= ea on the flash part. + PCH_SPI_FLASH_READ_SFDP FlashReadSfdp; ///< Read SFDP dat= a from the flash part. + PCH_SPI_FLASH_READ_JEDEC_ID FlashReadJedecId; ///< Read Jedec Id= from the flash part. + PCH_SPI_FLASH_WRITE_STATUS FlashWriteStatus; ///< Write the sta= tus register in the flash part. + PCH_SPI_FLASH_READ_STATUS FlashReadStatus; ///< Read status r= egister in the flash part. + PCH_SPI_GET_REGION_ADDRESS GetRegionAddress; ///< Get the SPI r= egion base and size + PCH_SPI_READ_PCH_SOFTSTRAP ReadPchSoftStrap; ///< Read PCH Soft= Strap Values + PCH_SPI_READ_CPU_SOFTSTRAP ReadCpuSoftStrap; ///< Read CPU Soft= Strap Values +}; + +/** + PCH SPI PPI/PROTOCOL revision number + + Revision 1: Initial version +**/ +#define PCH_SPI_SERVICES_REVISION 1 + +#endif --=20 2.24.0.windows.2