From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (NAM02-DM3-obe.outbound.protection.outlook.com [40.107.95.107]) by mx.groups.io with SMTP id smtpd.web10.9944.1631721657928927201 for ; Wed, 15 Sep 2021 09:00:58 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@os.amperecomputing.com header.s=selector2 header.b=XyY/kPob; spf=pass (domain: os.amperecomputing.com, ip: 40.107.95.107, mailfrom: nhi@os.amperecomputing.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JIM7x+vV0HiI4DWaHFWjQcC3uuCPBjIrhDawsEgctiunj1OAaxw3ogR7Tp01z+lXxWZr4q/r5iANfzMpH9V2ZZmVAnElsp2tqHkVrrefJBclYzuGnHpae3UFbkYfDxpvuItm6BL7cEKq+kqci4I9QOFr2fIoyeQuR+vADPRK1T/xl2IbvFCbtbiaKeyV3xR4bJqdgrBCAF+Ymbh8g3Tp1sn8KlnzYPsmQNQMHjRCezuq7piGDsuYMBO86oESds2Ego9q6CqKHkoiH192xfSN6/ET578Si9xaidlryG+oqhN3jU2oUX/54f+WEN5hvbaJVuZ17jim90+ldVhcmA8qNQ== 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; bh=5hVaAV4W6tsVbxHAdlbZesU42pFbYwbwTwhETiA8v7Y=; b=Id9OGka2w9hcNKbsAlBR6CvuoZbuuNQpulhuSbDIiFqSE4/VcJWueegPBd7VtJgyde8roJz4+SxYj0shn/aS7GHmD6Zjc8UW866a6ZOSEQgG7Zhk+xRHaNp2HkR0WxUwjFyFi5aOaSLqGcuyvunb3vp0vtcNMLCFFEqTfMjYw/IbTtaB7yExGPJlhQsR998GUahAfc+Q8xu1ThPqf+ZeA6zMeFWbD1hTi8430aE5sQt7onR9lePI2Txx0yPtg5QkvZUHXR1osU4ZEWalizi8qpmLzmx0kadMLfarEvXzRvi6dd/gqeHU+rZK+XZYEFO+j1JtlCSf84ZFuSQitHpLMQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5hVaAV4W6tsVbxHAdlbZesU42pFbYwbwTwhETiA8v7Y=; b=XyY/kPobnxoswQuO8wvGFFxaCoSNsNvS6oleZPIsh4Yrnpiy5HdnyqZFlOyTd/wrwQiAT1u+h0DoRvfa+ORCxAv4DBWX2it1F85kxSzqfo1MoZUj+I415A3jS9NFrc4VuNRJZsL3Dbx6iodkTMwtgR1ATA1I+PSklOhnW23uG8Q= Authentication-Results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=os.amperecomputing.com; Received: from DM6PR01MB5849.prod.exchangelabs.com (2603:10b6:5:205::20) by DM5PR01MB2761.prod.exchangelabs.com (2603:10b6:3:fd::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.14; Wed, 15 Sep 2021 16:00:55 +0000 Received: from DM6PR01MB5849.prod.exchangelabs.com ([fe80::8eb:704f:2ba7:9bc3]) by DM6PR01MB5849.prod.exchangelabs.com ([fe80::8eb:704f:2ba7:9bc3%4]) with mapi id 15.20.4523.014; Wed, 15 Sep 2021 16:00:55 +0000 From: "Nhi Pham" To: devel@edk2.groups.io CC: patches@amperecomputing.com, nhi@os.amperecomputing.com, vunguyen@os.amperecomputing.com, Thang Nguyen , Chuong Tran , Phong Vo , Leif Lindholm , Michael D Kinney , Ard Biesheuvel , Nate DeSimone Subject: [PATCH v3 28/28] AmpereAltraPkg: Add configuration screen for Pcie Devices Date: Wed, 15 Sep 2021 22:55:27 +0700 Message-ID: <20210915155527.8176-29-nhi@os.amperecomputing.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210915155527.8176-1-nhi@os.amperecomputing.com> References: <20210915155527.8176-1-nhi@os.amperecomputing.com> X-ClientProxiedBy: HK2PR0302CA0012.apcprd03.prod.outlook.com (2603:1096:202::22) To DM6PR01MB5849.prod.exchangelabs.com (2603:10b6:5:205::20) Return-Path: nhi@os.amperecomputing.com MIME-Version: 1.0 Received: from sw004.amperecomputing.com (118.69.219.201) by HK2PR0302CA0012.apcprd03.prod.outlook.com (2603:1096:202::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.5 via Frontend Transport; Wed, 15 Sep 2021 16:00:52 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e72dbf64-18e4-45a9-51af-08d97862000c X-MS-TrafficTypeDiagnostic: DM5PR01MB2761: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4125; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4otFCHsgiu7A3QyOoJ8MEmWk2H0z/AiY5ek5pPXkq8AmgPrTRqEmGwOGT3+P4QYox/jZt1wblmxTxOebdGi9Z0ixzJR+j2EWm7HR/J1T1vm6FVBbaXOi9qiCwncmRuF++7EMt/H2kcgR/VztQbmVdLmGIG/XfIz/QQNZ3GFpgdHnTJPERn5gcJYM/Nkt3xCWkFKi8aKUrExVjW7SdEl5I5QrB4afJYwftH8J2LVScUZulDS7N6b9dGk6J8WGaFQwyx6eXTbltTXFtmd6Asz5in70PN+Iw0oAf1TyxyDmeTLbEC2UXuxJnNesqoj96CPnneinoOMYOV8B9fq2F7pqytZUIrVlo0FR3cVrva9h5vyptcD61hJWPEd8MrxVRn0IsZbPj5nKS5ulzqlQB7qM+uyK2LttP7PEiBfjv3kKi5TN2NyqPmBbbU1avJdwDv0qv344y3RmlHoI3wHNw7uNUB+S0g6hssT16YjEqMnF7mlGHyqlhRiRNgKfNBQA6YhYIT4R1qt0sEQHfyE0gTH99+/x4RtnzuwB6aatQPiD/w9L/hgd2LpKsXh6hEC+uciCl4SHyPeEXH3XadOveVIcpOAvSOj83YKMLgbwi8Wsgvw7z/lwIWfv0muueJqQ8ziKI070/Q1+sLyHZD1Cr5pJEX/Ro7NdmiRjFfsPancJzbOblAYgZTKV71YC6dtgrDCAFHIAi8WBOHodD26SZUMLrRAPW1TZWREEPr7HL8FtV1ABNAXitWCQt7VQuE+xe7Vf X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR01MB5849.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(66946007)(956004)(66476007)(66556008)(6666004)(4326008)(8936002)(30864003)(8676002)(316002)(38100700002)(38350700002)(5660300002)(6512007)(508600001)(186003)(52116002)(86362001)(6506007)(6916009)(1076003)(54906003)(2906002)(2616005)(83380400001)(66574015)(26005)(6486002)(290074003)(559001)(579004)(44824005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?uqJEjRxEwGNtDMB4T5Mc5XX+DzsK/BMC1jlQejlN00aFLgr1JV57tbhRohcY?= =?us-ascii?Q?hCQNi+xH/X1cz1NcW3jUGdR9VPvaTsL3pzyYqOOQTS4Km9z1i0sUJqbnYrNI?= =?us-ascii?Q?k862o1U2LORit13C1madbTAjZzY/Z4+UcotZObM9PxOvkmQVOKpYFX/rTKPt?= =?us-ascii?Q?meqIoXdP+LYQEij3Pb9u1pIZCebO1odj+pTATzvT0Dyuu7Fr0JrRpHfqSlYf?= =?us-ascii?Q?JqS9l8brV2cZYZVM+OVebcV0BRfepha2f/nugjJ69NOA52xB9SY+AS0moo29?= =?us-ascii?Q?bLJbhIi6ODotIzmfxmWvtkz5G+++3sC//zZOkx1SB/Pnx8FWadTHGtaK0fVu?= =?us-ascii?Q?6YOwjBNRVneWgSdLXtlxYLkVznLzO1qRNh/PI6/ixQCTvexph7OKVrPUuhYm?= =?us-ascii?Q?bmogo7M8onG89icu91ddaFTAXq/ufLRd9XgKhT8CzsVjF2UUrS1KkITUDH1P?= =?us-ascii?Q?1SddsDcpTQe32IAu0e8gcchJg7AOIThm8mPBJo9ibID3DBJxEuF1AL+121xz?= =?us-ascii?Q?8grYwvz8uDv48WVB+OJR80TKtChQdfexOGY2MJtUY4nMLyQeAnmFNHGAty3m?= =?us-ascii?Q?JO0/wxghwKxY51sAOy/KFpiPrsRHOFQEsNffmy6j/ZY7oqYuM1ZjIXNJi6fH?= =?us-ascii?Q?q/emxB02kM4Ej/EHHKoUyXOXNbQ/cKN5auCwvJjFAGRCPradYT42Lv8yi/SK?= =?us-ascii?Q?JmkInMkJuRNoDKqEUsO+AeStqG24NbwNyWpTa63JpAdIuxaAWhEnePoYdGEz?= =?us-ascii?Q?5p74QDtLEJox7KdOQFSK3M7NbMvK6oZHmFkvyGU5PfrvMC2FrG7l5QNtVui9?= =?us-ascii?Q?89Xu5dw2ikwatEN/vjCm/xp/MAwAuYjbNxX5RFy/eRvu64bD7oG7dvNpnKWa?= =?us-ascii?Q?9jpnMbY1JwL02VWnznHVLdaWKMf/ulgbMcFx9WPXwN+e1kQ0ir7rFawuIvnt?= =?us-ascii?Q?N4hY6rgJPMpa16VKE6/307zGWVwZLpJ+S68U+M6nNev+9Jq9XIn4McyU9Vwf?= =?us-ascii?Q?+aHFS093Ccog6cz8z0nhIwPzZ6NqFh99DbRWM+W8SEKNdgiCJLml4j+M++K/?= =?us-ascii?Q?nWjWVr00Pyl2eGnUXLVjBGk8ph18IsTDpunomZ/36SaYra11vToYSl7JJ2Z2?= =?us-ascii?Q?bJ8yCr5UxScgMtmAoZfXmwJTGqsh/d+hLfg6jeKS4QZZokoLwweiR/uIoDoo?= =?us-ascii?Q?Np0ZAz7RkP8KrPQuY+/Tbp1d3ejlOPACYDKdPbddSFkNck8EamShi5zBTISG?= =?us-ascii?Q?Jk3Kz82sFHZhsxqjmme+SOIp6UtJDmHsO9Q7apCkhrObBNQvdLB3Shkfwmav?= =?us-ascii?Q?K4fL1iBZsWb3Tj20TF7g9Tb5?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: e72dbf64-18e4-45a9-51af-08d97862000c X-MS-Exchange-CrossTenant-AuthSource: DM6PR01MB5849.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Sep 2021 16:00:55.7218 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: braeafe9KUnfW97XmsXVyFfLk0FlOc3i06ZVuL0GTh6h5Dg1Ciq/xyvpYgWML61WHuxihQ9rf6TaPEK3IxZrw80KsyBoNSqEFQPqc8at+p0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR01MB2761 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable From: Vu Nguyen This screen provide menu options to configure Max Payload and Max Read Request size for each PCIe device under Root Port. PCIe devices which attach to external switch are not supported yet. Cc: Thang Nguyen Cc: Chuong Tran Cc: Phong Vo Cc: Leif Lindholm Cc: Michael D Kinney Cc: Ard Biesheuvel Cc: Nate DeSimone Signed-off-by: Vu Nguyen --- Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dec = | 3 + Platform/Ampere/JadePkg/Jade.dsc = | 1 + Platform/Ampere/JadePkg/Jade.fdf = | 1 + Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformPcieDeviceConfigDxe/Platform= PcieDeviceConfigDxe.inf | 59 ++ Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformPcieDeviceConfigDxe/Platform= PcieDeviceConfigDxe.h | 78 ++ Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformPcieDeviceConfigDxe/Platform= PcieDeviceConfigVfr.h | 56 ++ Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformPcieDeviceConfigDxe/Platform= PcieHelper.h | 58 ++ Silicon/Ampere/AmpereAltraPkg/Include/Guid/PlatformPcieDeviceConfigHii.h = | 19 + Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformPcieDeviceConfigDxe/Platform= PcieDeviceConfigVfr.vfr | 50 + Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformPcieDeviceConfigDxe/Platform= PcieDeviceConfigDxe.c | 1045 ++++++++++++++++++++ Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformPcieDeviceConfigDxe/Platform= PcieHelper.c | 191 ++++ Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformPcieDeviceConfigDxe/Platform= PcieDeviceConfigDxe.uni | 24 + 12 files changed, 1585 insertions(+) diff --git a/Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dec b/Silicon/Amp= ere/AmpereAltraPkg/AmpereAltraPkg.dec index b0e1f3ec6f2a..6ce545fda8dd 100644 --- a/Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dec +++ b/Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dec @@ -59,6 +59,9 @@ [Guids] # GUID for the Watchdog HII configuration form gWatchdogConfigFormSetGuid =3D { 0xC3F8EC6E, 0x95EE, 0x460C, { 0xA4, 0= x8D, 0xEA, 0x54, 0x2F, 0xFF, 0x01, 0x61 } } =20 + # GUID for the Pcie Device HII configuration form + gPlatformPcieDeviceConfigFormSetGuid =3D { 0xEC7B1D21, 0x9167, 0x4B9D, {= 0xF7, 0x94, 0xCD, 0x1A, 0xEB, 0xBC, 0xB7, 0x59 } } + ## NVParam MM GUID gNVParamMmGuid =3D { 0xE4AC5024, 0x29BE, 0x4ADC, { 0x93, 0= x36, 0x87, 0xB5, 0xA0, 0x76, 0x23, 0x2D } } =20 diff --git a/Platform/Ampere/JadePkg/Jade.dsc b/Platform/Ampere/JadePkg/Jad= e.dsc index b752ea3e5264..9db1cf316249 100644 --- a/Platform/Ampere/JadePkg/Jade.dsc +++ b/Platform/Ampere/JadePkg/Jade.dsc @@ -202,3 +202,4 @@ [Components.common] Silicon/Ampere/AmpereAltraPkg/Drivers/AcpiConfigDxe/AcpiConfigDxe.inf Silicon/Ampere/AmpereAltraPkg/Drivers/RasConfigDxe/RasConfigDxe.inf Silicon/Ampere/AmpereAltraPkg/Drivers/WatchdogConfigDxe/WatchdogConfigDx= e.inf + Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformPcieDeviceConfigDxe/Platfo= rmPcieDeviceConfigDxe.inf diff --git a/Platform/Ampere/JadePkg/Jade.fdf b/Platform/Ampere/JadePkg/Jad= e.fdf index 8f3df6ccf01b..ae444d702bbe 100644 --- a/Platform/Ampere/JadePkg/Jade.fdf +++ b/Platform/Ampere/JadePkg/Jade.fdf @@ -360,5 +360,6 @@ [FV.FvMain] INF Silicon/Ampere/AmpereAltraPkg/Drivers/AcpiConfigDxe/AcpiConfigDxe.in= f INF Silicon/Ampere/AmpereAltraPkg/Drivers/RasConfigDxe/RasConfigDxe.inf INF Silicon/Ampere/AmpereAltraPkg/Drivers/WatchdogConfigDxe/WatchdogConf= igDxe.inf + INF Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformPcieDeviceConfigDxe/Pl= atformPcieDeviceConfigDxe.inf =20 !include Platform/Ampere/AmperePlatformPkg/FvRules.fdf.inc diff --git a/Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformPcieDeviceConfig= Dxe/PlatformPcieDeviceConfigDxe.inf b/Silicon/Ampere/AmpereAltraPkg/Drivers= /PlatformPcieDeviceConfigDxe/PlatformPcieDeviceConfigDxe.inf new file mode 100644 index 000000000000..79d7bd185b7d --- /dev/null +++ b/Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformPcieDeviceConfigDxe/Pla= tformPcieDeviceConfigDxe.inf @@ -0,0 +1,59 @@ +## @file +# +# Copyright (c) 2021, Ampere Computing LLC. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION =3D 0x0001001B + BASE_NAME =3D PlatformPcieDeviceConfigDxe + FILE_GUID =3D 17E9369D-0A1B-45F4-A286-B1DED6D85D33 + MODULE_TYPE =3D DXE_DRIVER + VERSION_STRING =3D 1.0 + ENTRY_POINT =3D PlatformPcieDeviceConfigEntryPoint + +[Sources.common] + PlatformPcieDeviceConfigDxe.c + PlatformPcieDeviceConfigDxe.h + PlatformPcieDeviceConfigDxe.uni + PlatformPcieDeviceConfigVfr.h + PlatformPcieDeviceConfigVfr.vfr + PlatformPcieHelper.c + PlatformPcieHelper.h + +[Packages] + MdeModulePkg/MdeModulePkg.dec + MdePkg/MdePkg.dec + Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dec + Silicon/Ampere/AmpereSiliconPkg/AmpereSiliconPkg.dec + +[LibraryClasses] + BaseLib + BaseMemoryLib + DebugLib + DevicePathLib + HiiLib + MemoryAllocationLib + PrintLib + UefiBootServicesTableLib + UefiDriverEntryPoint + UefiLib + UefiRuntimeServicesTableLib + +[Protocols] + gEfiPciIoProtocolGuid + gEfiDevicePathProtocolGuid ## CONSUMES + gEfiHiiConfigRoutingProtocolGuid ## CONSUMES + gEfiHiiConfigAccessProtocolGuid ## PRODUCES + gEfiDevicePathToTextProtocolGuid + +[Guids] + gEfiIfrTianoGuid + gPlatformPcieDeviceConfigFormSetGuid + gPlatformManagerFormsetGuid + gPlatformManagerEntryEventGuid + +[Depex] + TRUE diff --git a/Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformPcieDeviceConfig= Dxe/PlatformPcieDeviceConfigDxe.h b/Silicon/Ampere/AmpereAltraPkg/Drivers/P= latformPcieDeviceConfigDxe/PlatformPcieDeviceConfigDxe.h new file mode 100644 index 000000000000..a39257da06ba --- /dev/null +++ b/Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformPcieDeviceConfigDxe/Pla= tformPcieDeviceConfigDxe.h @@ -0,0 +1,78 @@ +/** @file + + Copyright (c) 2021, Ampere Computing LLC. All rights reserved.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef PLATFORM_PCIE_DEVICE_CONFIG_H_ +#define PLATFORM_PCIE_DEVICE_CONFIG_H_ + +#include + +#include +#include +#include +#include +#include +#include + +#include "PlatformPcieDeviceConfigVfr.h" + +#define MAX_STRING_SIZE 100 + +#define PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('P', 'E', 'D', 'C') +#define PRIVATE_DATA_FROM_THIS(a) \ + CR (a, PRIVATE_DATA, ConfigAccess, PRIVATE_DATA_SIGNATURE) + +#pragma pack(1) + +/// +/// HII specific Vendor Device Path definition. +/// +typedef struct { + VENDOR_DEVICE_PATH VendorDevicePath; + EFI_DEVICE_PATH_PROTOCOL End; +} HII_VENDOR_DEVICE_PATH; + +#pragma pack() + +// +// This is the generated IFR binary data for each formset defined in VFR. +// This data array is ready to be used as input of HiiAddPackages() to +// create a packagelist (which contains Form packages, String packages, et= c). +// +extern UINT8 PlatformPcieDeviceConfigVfrBin[]; + +// +// This is the generated String package data for all .UNI files. +// This data array is ready to be used as input of HiiAddPackages() to +// create a packagelist (which contains Form packages, String packages, et= c). +// +extern UINT8 PlatformPcieDeviceConfigDxeStrings[]; + +typedef struct { + UINTN Signature; + + EFI_HANDLE DriverHandle; + EFI_HII_HANDLE HiiHandle; + VARSTORE_DATA LastVarStoreConfig; + VARSTORE_DATA VarStoreConfig; + + // + // Consumed protocol + // + EFI_HII_DATABASE_PROTOCOL *HiiDatabase; + EFI_HII_STRING_PROTOCOL *HiiString; + EFI_HII_CONFIG_ROUTING_PROTOCOL *HiiConfigRouting; + EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL *HiiKeywordHandler; + EFI_FORM_BROWSER2_PROTOCOL *FormBrowser2; + + // + // Produced protocol + // + EFI_HII_CONFIG_ACCESS_PROTOCOL ConfigAccess; +} PRIVATE_DATA; + +#endif // PLATFORM_PCIE_DEVICE_CONFIG_H_ diff --git a/Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformPcieDeviceConfig= Dxe/PlatformPcieDeviceConfigVfr.h b/Silicon/Ampere/AmpereAltraPkg/Drivers/P= latformPcieDeviceConfigDxe/PlatformPcieDeviceConfigVfr.h new file mode 100644 index 000000000000..ee4469ea5a2a --- /dev/null +++ b/Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformPcieDeviceConfigDxe/Pla= tformPcieDeviceConfigVfr.h @@ -0,0 +1,56 @@ +/** @file + + Copyright (c) 2021, Ampere Computing LLC. All rights reserved.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef PLATFORM_PCIE_DEVICE_CONFIG_VFR_H_ +#define PLATFORM_PCIE_DEVICE_CONFIG_VFR_H_ + +#include + +#define VARSTORE_NAME L"PlatformPcieDeviceConfigNVData" + +#define MAIN_FORM_ID 0x01 +#define DEVICE_FORM_ID 0x02 +#define VARSTORE_ID 0x03 + +#define MAIN_LABEL_UPDATE 0x21 +#define MAIN_LABEL_END 0x22 +#define DEVICE_LABEL_UPDATE 0x31 +#define DEVICE_LABEL_END 0x32 + +#define DEVICE_KEY 0x6000 +#define MPS_ONE_OF_KEY 0x7000 +#define MRR_ONE_OF_KEY 0x8000 + +#define MAX_DEVICE 40 + +#define DEFAULT_MPS 0x00 // Section 7.5.3.4 +#define DEFAULT_MRR 0x02 // Section 7.5.3.4 + +#define PCIE_ADD(Vid, Did, Seg, Bus, Dev) \ + (UINT64)(Vid) << 40 | (UINT64)(Did) << 24 | Seg << 16 | Bus << 8 |= Dev; + +#pragma pack(1) + +typedef struct { + UINT8 DEV; + UINT8 BUS; + UINT8 SEG; + UINT16 DID; + UINT16 VID; + UINT8 SlotId; +} SLOT_INFO; + +typedef struct { + UINT8 MPS[MAX_DEVICE]; + UINT8 MRR[MAX_DEVICE]; + UINT64 SlotInfo[MAX_DEVICE]; +} VARSTORE_DATA; + +#pragma pack() + +#endif /* PLATFORM_PCIE_DEVICE_CONFIG_VFR_H_ */ diff --git a/Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformPcieDeviceConfig= Dxe/PlatformPcieHelper.h b/Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformPc= ieDeviceConfigDxe/PlatformPcieHelper.h new file mode 100644 index 000000000000..56aed0379539 --- /dev/null +++ b/Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformPcieDeviceConfigDxe/Pla= tformPcieHelper.h @@ -0,0 +1,58 @@ +/** @file + + Copyright (c) 2021, Ampere Computing LLC. All rights reserved.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef PLATFORM_PCIE_HELPER_H_ +#define PLATFORM_PCIE_HELPER_H_ + +#define PCIE_MAX_PAYLOAD_MASK 0x07 +#define PCIE_CONTROL_MAX_PAYLOAD_OFF 5 +#define PCIE_MAX_READ_REQUEST_MASK 0x07 +#define PCIE_CONTROL_READ_REQUEST_OFF 12 + +#define PCI_EXPRESS_CAPABILITY_DEVICE_CAPABILITIES_REG 0x04 +#define PCI_EXPRESS_CAPABILITY_DEVICE_CONTROL_REG 0x08 + +#define FOR_EACH(Node, Tail, Type) \ + for (Node =3D Tail->Type; Node !=3D NULL; Node =3D Node->Type) + +struct _PCIE_NODE { + EFI_PCI_IO_PROTOCOL *PciIo; + UINT8 MaxMps; + UINT8 PcieCapOffset; + UINT16 Vid; + UINT16 Did; + UINT8 Seg; + UINT8 Bus; + UINT8 Dev; + UINT8 Fun; + struct _PCIE_NODE *Parent; + struct _PCIE_NODE *Brother; +}; + +typedef struct _PCIE_NODE PCIE_NODE; + +EFI_STATUS +WriteMps ( + PCIE_NODE *Node, + UINT8 Value + ); + +EFI_STATUS +WriteMrr ( + PCIE_NODE *Node, + UINT8 Value + ); + +EFI_STATUS +FindCapabilityPtr ( + IN EFI_PCI_IO_PROTOCOL *PciIo, + IN UINT8 CapabilityId, + OUT UINT8 *CapabilityPtr + ); + +#endif // PLATFORM_PCIE_HELPER_H_ diff --git a/Silicon/Ampere/AmpereAltraPkg/Include/Guid/PlatformPcieDeviceC= onfigHii.h b/Silicon/Ampere/AmpereAltraPkg/Include/Guid/PlatformPcieDeviceC= onfigHii.h new file mode 100644 index 000000000000..ed592a0027ed --- /dev/null +++ b/Silicon/Ampere/AmpereAltraPkg/Include/Guid/PlatformPcieDeviceConfigHi= i.h @@ -0,0 +1,19 @@ +/** @file + + Copyright (c) 2020 - 2021, Ampere Computing LLC. All rights reserved. + + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef PLATFORM_PCIE_DEVICE_CONFIG_HII_H_ +#define PLATFORM_PCIE_DEVICE_CONFIG_HII_H_ + +#define PLATFORM_PCIE_DEVICE_CONFIG_FORMSET_GUID \ + { \ + 0xEC7B1D21, 0x9167, 0x4B9D, { 0xF7, 0x94, 0xCD, 0x1A, 0xEB, 0xBC, 0xB7= , 0x59 } \ + } + +extern EFI_GUID gPlatformPcieDeviceConfigFormSetGuid; + +#endif /* PLATFORM_PCIE_DEVICE_CONFIG_HII_H_ */ diff --git a/Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformPcieDeviceConfig= Dxe/PlatformPcieDeviceConfigVfr.vfr b/Silicon/Ampere/AmpereAltraPkg/Drivers= /PlatformPcieDeviceConfigDxe/PlatformPcieDeviceConfigVfr.vfr new file mode 100644 index 000000000000..27ca33164e23 --- /dev/null +++ b/Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformPcieDeviceConfigDxe/Pla= tformPcieDeviceConfigVfr.vfr @@ -0,0 +1,50 @@ +/** @file + + Copyright (c) 2021, Ampere Computing LLC. All rights reserved.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include "PlatformPcieDeviceConfigVfr.h" + +formset + guid =3D PLATFORM_PCIE_DEVICE_CONFIG_FORMSET_GUID, + title =3D STRING_TOKEN(STR_DEVICE_CONFIG_FORM), + help =3D STRING_TOKEN(STR_DEVICE_CONFIG_HELP), + classguid =3D gPlatformManagerFormsetGuid, + + // + // Define a variable Storage + // + varstore VARSTORE_DATA, + varid =3D VARSTORE_ID, + name =3D PlatformPcieDeviceConfigNVData, + guid =3D PLATFORM_PCIE_DEVICE_CONFIG_FORMSET_GUID; + + form + formid =3D MAIN_FORM_ID, + title =3D STRING_TOKEN(STR_DEVICE_CONFIG_FORM); + + subtitle text =3D STRING_TOKEN(STR_DEVICE_CONFIG_FORM); + + label MAIN_LABEL_UPDATE; + // dynamic content here + label MAIN_LABEL_END; + + endform; + + form + formid =3D DEVICE_FORM_ID, + title =3D STRING_TOKEN(STR_DEVICE_FORM); + + subtitle text =3D STRING_TOKEN(STR_DEVICE_FORM); + + label DEVICE_LABEL_UPDATE; + // dynamic content here + label DEVICE_LABEL_END; + + endform; + +endformset; diff --git a/Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformPcieDeviceConfig= Dxe/PlatformPcieDeviceConfigDxe.c b/Silicon/Ampere/AmpereAltraPkg/Drivers/P= latformPcieDeviceConfigDxe/PlatformPcieDeviceConfigDxe.c new file mode 100644 index 000000000000..b06014529c7b --- /dev/null +++ b/Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformPcieDeviceConfigDxe/Pla= tformPcieDeviceConfigDxe.c @@ -0,0 +1,1045 @@ +/** @file + + Copyright (c) 2021, Ampere Computing LLC. All rights reserved.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "PlatformPcieDeviceConfigDxe.h" +#include "PlatformPcieHelper.h" + +VOID *mPciProtocolNotifyRegistration; +CHAR16 *mVariableName =3D VARSTORE_NAME; +PCIE_NODE *mDeviceBuf[MAX_DEVICE] =3D {NULL}; + +HII_VENDOR_DEVICE_PATH mHiiVendorDevicePath =3D { + { + { + HARDWARE_DEVICE_PATH, + HW_VENDOR_DP, + { + (UINT8)(sizeof (VENDOR_DEVICE_PATH)), + (UINT8)((sizeof (VENDOR_DEVICE_PATH)) >> 8) + } + }, + PLATFORM_PCIE_DEVICE_CONFIG_FORMSET_GUID + }, + { + END_DEVICE_PATH_TYPE, + END_ENTIRE_DEVICE_PATH_SUBTYPE, + { + (UINT8)(END_DEVICE_PATH_LENGTH), + (UINT8)((END_DEVICE_PATH_LENGTH) >> 8) + } + } +}; + +VOID +FlushDeviceData ( + IN EFI_EVENT Event, + IN VOID *Context + ) +{ + EFI_STATUS Status; + PCIE_NODE *Node; + PRIVATE_DATA *PrivateData; + UINT8 Index; + VARSTORE_DATA *LastVarStoreConfig; + VARSTORE_DATA *VarStoreConfig; + + PrivateData =3D (PRIVATE_DATA *)Context; + LastVarStoreConfig =3D &PrivateData->LastVarStoreConfig; + VarStoreConfig =3D &PrivateData->VarStoreConfig; + + // + // If config has changed, update NVRAM + // + if (CompareMem (VarStoreConfig, LastVarStoreConfig, sizeof (VARSTORE_DAT= A)) !=3D 0) { + DEBUG ((DEBUG_INFO, "%a Update Device Config Variable\n", __FUNCTION__= )); + Status =3D gRT->SetVariable ( + mVariableName, + &gPlatformPcieDeviceConfigFormSetGuid, + EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_A= CCESS, + sizeof (VARSTORE_DATA), + VarStoreConfig + ); + if (EFI_ERROR (Status)) { + DEBUG (( + DEBUG_ERROR, + "%a: Failed to set variable status %r", + __FUNCTION__, + Status + )); + return; + } + } + + // Iterate through the list, then write corresponding MPS MRR + for (Index =3D 0; Index < MAX_DEVICE; Index++) { + if (mDeviceBuf[Index] =3D=3D NULL) { + continue; + } + + // Write MPS value + WriteMps (mDeviceBuf[Index], VarStoreConfig->MPS[Index]); + + FOR_EACH (Node, mDeviceBuf[Index], Parent) { + WriteMps (Node, VarStoreConfig->MPS[Index]); + } + + FOR_EACH (Node, mDeviceBuf[Index], Brother) { + WriteMps (Node, VarStoreConfig->MPS[Index]); + } + + // Write MRR value + // No need to update MRR of parent node + WriteMrr (mDeviceBuf[Index], VarStoreConfig->MRR[Index]); + + FOR_EACH (Node, mDeviceBuf[Index], Brother) { + WriteMrr (Node, VarStoreConfig->MRR[Index]); + } + } + + gBS->CloseEvent (Event); +} + +EFI_STATUS +UpdateDeviceForm ( + UINT8 Index, + PRIVATE_DATA *PrivateData + ) +{ + CHAR16 Str[MAX_STRING_SIZE]; + UINT8 MaxMps; + + VOID *StartOpCodeHandle; + EFI_IFR_GUID_LABEL *StartLabel; + VOID *EndOpCodeHandle; + EFI_IFR_GUID_LABEL *EndLabel; + VOID *MpsOpCodeHandle; + VOID *MrrOpCodeHandle; + PCIE_NODE *Node; + + if (mDeviceBuf[Index] =3D=3D NULL) { + return EFI_INVALID_PARAMETER; + } + + MaxMps =3D mDeviceBuf[Index]->MaxMps; + FOR_EACH (Node, mDeviceBuf[Index], Parent) { + if (Node->MaxMps < MaxMps) { + MaxMps =3D Node->MaxMps; + } + } + + UnicodeSPrint ( + Str, + sizeof (Str), + L"PCIe Device 0x%04x:0x%04x", + mDeviceBuf[Index]->Vid, + mDeviceBuf[Index]->Did + ); + + HiiSetString ( + PrivateData->HiiHandle, + STRING_TOKEN (STR_DEVICE_FORM), + Str, + NULL + ); + + // + // Initialize the container for dynamic opcodes + // + StartOpCodeHandle =3D HiiAllocateOpCodeHandle (); + ASSERT (StartOpCodeHandle !=3D NULL); + + EndOpCodeHandle =3D HiiAllocateOpCodeHandle (); + ASSERT (EndOpCodeHandle !=3D NULL); + + // + // Create Hii Extend Label OpCode as the start opcode + // + StartLabel =3D (EFI_IFR_GUID_LABEL *)HiiCreateGuidOpCode ( + StartOpCodeHandle, + &gEfiIfrTianoGuid, + NULL, + sizeof (EFI_IFR_GUID_LABEL) + ); + StartLabel->ExtendOpCode =3D EFI_IFR_EXTEND_OP_LABEL; + StartLabel->Number =3D DEVICE_LABEL_UPDATE; + + // + // Create Hii Extend Label OpCode as the end opcode + // + EndLabel =3D (EFI_IFR_GUID_LABEL *)HiiCreateGuidOpCode ( + EndOpCodeHandle, + &gEfiIfrTianoGuid, + NULL, + sizeof (EFI_IFR_GUID_LABEL) + ); + EndLabel->ExtendOpCode =3D EFI_IFR_EXTEND_OP_LABEL; + EndLabel->Number =3D DEVICE_LABEL_END; + + // Create Option OpCode for MPS selection + MpsOpCodeHandle =3D HiiAllocateOpCodeHandle (); + ASSERT (MpsOpCodeHandle !=3D NULL); + + switch (MaxMps) { + case 5: + HiiCreateOneOfOptionOpCode ( + MpsOpCodeHandle, + STRING_TOKEN (STR_4096), + 0, + EFI_IFR_NUMERIC_SIZE_1, + 5 + ); + + case 4: + HiiCreateOneOfOptionOpCode ( + MpsOpCodeHandle, + STRING_TOKEN (STR_2048), + 0, + EFI_IFR_NUMERIC_SIZE_1, + 4 + ); + + case 3: + HiiCreateOneOfOptionOpCode ( + MpsOpCodeHandle, + STRING_TOKEN (STR_1024), + 0, + EFI_IFR_NUMERIC_SIZE_1, + 3 + ); + + case 2: + HiiCreateOneOfOptionOpCode ( + MpsOpCodeHandle, + STRING_TOKEN (STR_512), + 0, + EFI_IFR_NUMERIC_SIZE_1, + 2 + ); + + case 1: + HiiCreateOneOfOptionOpCode ( + MpsOpCodeHandle, + STRING_TOKEN (STR_256), + 0, + EFI_IFR_NUMERIC_SIZE_1, + 1 + ); + + case 0: + HiiCreateOneOfOptionOpCode ( + MpsOpCodeHandle, + STRING_TOKEN (STR_128), + 0, + EFI_IFR_NUMERIC_SIZE_1, + 0 + ); + } + + // Create MPS OneOf + HiiCreateOneOfOpCode ( + StartOpCodeHandle, // Container for dynamic created opc= odes + (MPS_ONE_OF_KEY + Index), // Question ID (or call it "key") + VARSTORE_ID, // VarStore ID + Index, // Offset in Buffer Storage + STRING_TOKEN (STR_PCIE_MPS), // Question prompt text + STRING_TOKEN (STR_PCIE_MPS_HELP), // Question help text + EFI_IFR_FLAG_CALLBACK, // Question flag + EFI_IFR_NUMERIC_SIZE_1, // Data type of Question Value + MpsOpCodeHandle, // Option Opcode list + NULL // Default Opcode is NULl + ); + + // Create Option OpCode for MRR selection + MrrOpCodeHandle =3D HiiAllocateOpCodeHandle (); + ASSERT (MrrOpCodeHandle !=3D NULL); + + HiiCreateOneOfOptionOpCode ( + MrrOpCodeHandle, + STRING_TOKEN (STR_4096), + 0, + EFI_IFR_NUMERIC_SIZE_1, + 5 + ); + + HiiCreateOneOfOptionOpCode ( + MrrOpCodeHandle, + STRING_TOKEN (STR_2048), + 0, + EFI_IFR_NUMERIC_SIZE_1, + 4 + ); + + HiiCreateOneOfOptionOpCode ( + MrrOpCodeHandle, + STRING_TOKEN (STR_1024), + 0, + EFI_IFR_NUMERIC_SIZE_1, + 3 + ); + + HiiCreateOneOfOptionOpCode ( + MrrOpCodeHandle, + STRING_TOKEN (STR_512), + 0, + EFI_IFR_NUMERIC_SIZE_1, + 2 + ); + + HiiCreateOneOfOptionOpCode ( + MrrOpCodeHandle, + STRING_TOKEN (STR_256), + 0, + EFI_IFR_NUMERIC_SIZE_1, + 1 + ); + + HiiCreateOneOfOptionOpCode ( + MrrOpCodeHandle, + STRING_TOKEN (STR_128), + 0, + EFI_IFR_NUMERIC_SIZE_1, + 0 + ); + + // Create MRR OneOf + HiiCreateOneOfOpCode ( + StartOpCodeHandle, // Container for dynamic created opc= odes + (MRR_ONE_OF_KEY + Index), // Question ID (or call it "key") + VARSTORE_ID, // VarStore ID + MAX_DEVICE + Index, // Offset in Buffer Storage + STRING_TOKEN (STR_PCIE_MRR), // Question prompt text + STRING_TOKEN (STR_PCIE_MRR_HELP), // Question help text + EFI_IFR_FLAG_CALLBACK, // Question flag + EFI_IFR_NUMERIC_SIZE_1, // Data type of Question Value + MrrOpCodeHandle, // Option Opcode list + NULL // Default Opcode is NULl + ); + + HiiUpdateForm ( + PrivateData->HiiHandle, // HII handle + &gPlatformPcieDeviceConfigFormSetGuid, // Formset GUID + DEVICE_FORM_ID, // Form ID + StartOpCodeHandle, // Label for where to insert opcodes + EndOpCodeHandle // Insert data + ); + + HiiFreeOpCodeHandle (StartOpCodeHandle); + HiiFreeOpCodeHandle (EndOpCodeHandle); + HiiFreeOpCodeHandle (MpsOpCodeHandle); + HiiFreeOpCodeHandle (MrrOpCodeHandle); + return EFI_SUCCESS; +} + +VOID +OnPciIoProtocolNotify ( + IN EFI_EVENT Event, + IN VOID *Context + ) +{ + EFI_PCI_IO_PROTOCOL *PciIo; + EFI_STATUS Status; + EFI_HANDLE HandleBuffer; + PCI_TYPE00 Pci; + + UINTN BufferSize; + UINTN PciBusNumber; + UINTN PciDeviceNumber; + UINTN PciFunctionNumber; + UINTN PciSegment; + + UINT8 Idx; + UINT8 CapabilityPtr; + UINT16 TmpValue; + UINT64 SlotInfo; + + PCIE_NODE *Node; + PRIVATE_DATA *PrivateData; + STATIC PCIE_NODE *LastNode; + STATIC UINT8 Index; + STATIC UINT8 LastBus; + + VARSTORE_DATA *LastVarStoreConfig; + VARSTORE_DATA *VarStoreConfig; + + PrivateData =3D (PRIVATE_DATA *)Context; + LastVarStoreConfig =3D &PrivateData->LastVarStoreConfig; + VarStoreConfig =3D &PrivateData->VarStoreConfig; + + while (TRUE) { + BufferSize =3D sizeof (EFI_HANDLE); + Status =3D gBS->LocateHandle ( + ByRegisterNotify, + NULL, + mPciProtocolNotifyRegistration, + &BufferSize, + &HandleBuffer + ); + if (EFI_ERROR (Status)) { + break; + } + + Status =3D gBS->HandleProtocol ( + HandleBuffer, + &gEfiPciIoProtocolGuid, + (VOID **)&PciIo + ); + if (EFI_ERROR (Status)) { + break; + } + + // Get device bus location + Status =3D PciIo->GetLocation ( + PciIo, + &PciSegment, + &PciBusNumber, + &PciDeviceNumber, + &PciFunctionNumber + ); + if (EFI_ERROR (Status) || + ((PciBusNumber =3D=3D 0) && (PciDeviceNumber =3D=3D 0))) + { + // Filter out Host Bridge + DEBUG ((DEBUG_INFO, "Filter out Host Bridge %x\n", PciSegment)); + continue; + } + + DEBUG (( + DEBUG_INFO, + ">> Dev 0x%04x:0x%02x:0x%02x:0x%02x\n", + PciSegment, + PciBusNumber, + PciDeviceNumber, + PciFunctionNumber + )); + + Status =3D FindCapabilityPtr (PciIo, EFI_PCI_CAPABILITY_ID_PCIEXP, &Ca= pabilityPtr); + if (EFI_ERROR (Status)) { + DEBUG (( + DEBUG_ERROR, + "%a: PCI Express Capability not found\n", + __FUNCTION__ + )); + continue; + } + + // Get Device's max MPS support + Status =3D PciIo->Pci.Read ( + PciIo, + EfiPciIoWidthUint16, + CapabilityPtr + PCI_EXPRESS_CAPABILITY_DEVICE_CA= PABILITIES_REG, + 1, + &TmpValue + ); + if (EFI_ERROR (Status)) { + continue; + } + + // Read device's VID:PID + Status =3D PciIo->Pci.Read ( + PciIo, + EfiPciIoWidthUint32, + 0, + sizeof (Pci) / sizeof (UINT32), + &Pci + ); + if (EFI_ERROR (Status)) { + continue; + } + DEBUG (( + DEBUG_INFO, + "VendorId 0x%04x - DeviceId 0x%04x\n", + Pci.Hdr.VendorId, + Pci.Hdr.DeviceId + )); + + Node =3D AllocateZeroPool (sizeof (*Node)); + Node->MaxMps =3D TmpValue & PCIE_MAX_PAYLOAD_MASK; + Node->PcieCapOffset =3D CapabilityPtr; + Node->PciIo =3D PciIo; + Node->Seg =3D PciSegment; + Node->Bus =3D PciBusNumber; + Node->Dev =3D PciDeviceNumber; + Node->Fun =3D PciFunctionNumber; + Node->Vid =3D Pci.Hdr.VendorId; + Node->Did =3D Pci.Hdr.DeviceId; + SlotInfo =3D PCIE_ADD (Node->Vid, Node->Did, Node->Seg, Node->Bus, Nod= e->Dev); + + // Presume child devices were registered follow root port + if (PciBusNumber !=3D 0) { + if (LastBus =3D=3D 0) { + Node->Parent =3D LastNode; + mDeviceBuf[Index] =3D Node; + + VarStoreConfig->MPS[Index] =3D DEFAULT_MPS; + VarStoreConfig->MRR[Index] =3D DEFAULT_MRR; + VarStoreConfig->SlotInfo[Index] =3D SlotInfo; + + // Retrieve setting from previous variable + for (Idx =3D 0; Idx < MAX_DEVICE; Idx++) { + if (SlotInfo =3D=3D LastVarStoreConfig->SlotInfo[Idx]) { + VarStoreConfig->MPS[Index] =3D LastVarStoreConfig->MPS[Idx]; + VarStoreConfig->MRR[Index] =3D LastVarStoreConfig->MRR[Idx]; + break; + } + } + + Index++; + } else if (PciBusNumber =3D=3D LastBus) { + LastNode->Brother =3D Node; + } else { + // Ignore devices don't stay under root port + continue; + } + } + + LastBus =3D PciBusNumber; + LastNode =3D Node; + } +} + +VOID +UpdateMainForm ( + IN EFI_EVENT Event, + IN VOID *Context + ) +{ + UINTN Index; + EFI_STRING_ID StrId; + CHAR16 Str[MAX_STRING_SIZE]; + VOID *StartOpCodeHandle; + EFI_IFR_GUID_LABEL *StartLabel; + VOID *EndOpCodeHandle; + EFI_IFR_GUID_LABEL *EndLabel; + PRIVATE_DATA *PrivateData; + + DEBUG ((DEBUG_INFO, "%a Entry ...\n", __FUNCTION__)); + + PrivateData =3D (PRIVATE_DATA *)Context; + + // + // Initialize the container for dynamic opcodes + // + StartOpCodeHandle =3D HiiAllocateOpCodeHandle (); + ASSERT (StartOpCodeHandle !=3D NULL); + + EndOpCodeHandle =3D HiiAllocateOpCodeHandle (); + ASSERT (EndOpCodeHandle !=3D NULL); + + // + // Create Hii Extend Label OpCode as the start opcode + // + StartLabel =3D (EFI_IFR_GUID_LABEL *)HiiCreateGuidOpCode ( + StartOpCodeHandle, + &gEfiIfrTianoGuid, + NULL, + sizeof (EFI_IFR_GUID_LABEL) + ); + StartLabel->ExtendOpCode =3D EFI_IFR_EXTEND_OP_LABEL; + StartLabel->Number =3D MAIN_LABEL_UPDATE; + + // + // Create Hii Extend Label OpCode as the end opcode + // + EndLabel =3D (EFI_IFR_GUID_LABEL *)HiiCreateGuidOpCode ( + EndOpCodeHandle, + &gEfiIfrTianoGuid, + NULL, + sizeof (EFI_IFR_GUID_LABEL) + ); + EndLabel->ExtendOpCode =3D EFI_IFR_EXTEND_OP_LABEL; + EndLabel->Number =3D MAIN_LABEL_END; + + for (Index =3D 0; Index < MAX_DEVICE; Index++) { + if (mDeviceBuf[Index] =3D=3D NULL) { + break; + } + DEBUG ((DEBUG_INFO, ">> Add item %d\n", Index)); + + UnicodeSPrint ( + Str, + sizeof (Str), + L"PCIe Device 0x%04x:0x%04x - %04x:%02x:%02x", + mDeviceBuf[Index]->Vid, + mDeviceBuf[Index]->Did, + mDeviceBuf[Index]->Seg, + mDeviceBuf[Index]->Bus, + mDeviceBuf[Index]->Dev + ); + + StrId =3D HiiSetString (PrivateData->HiiHandle, 0, Str, NULL); + + // + // Create a Goto OpCode to device configuration + // + HiiCreateGotoOpCode ( + StartOpCodeHandle, // Container for dynamic create= d opcodes + DEVICE_FORM_ID, // Target Form ID + StrId, // Prompt text + STRING_TOKEN (STR_DEVICE_GOTO_HELP), // Help text + EFI_IFR_FLAG_CALLBACK, // Question flag + (DEVICE_KEY + Index) // Question ID + ); + } + + HiiUpdateForm ( + PrivateData->HiiHandle, // HII handle + &gPlatformPcieDeviceConfigFormSetGuid, // Formset GUID + MAIN_FORM_ID, // Form ID + StartOpCodeHandle, // Label for where to insert opcodes + EndOpCodeHandle // Insert data + ); + + HiiFreeOpCodeHandle (StartOpCodeHandle); + HiiFreeOpCodeHandle (EndOpCodeHandle); + + gBS->CloseEvent (Event); +} + +EFI_STATUS +EFIAPI +ExtractConfig ( + IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, + IN CONST EFI_STRING Request, + OUT EFI_STRING *Progress, + OUT EFI_STRING *Results + ) +{ + EFI_STATUS Status; + UINTN BufferSize; + PRIVATE_DATA *PrivateData; + EFI_HII_CONFIG_ROUTING_PROTOCOL *HiiConfigRouting; + EFI_STRING ConfigRequest; + EFI_STRING ConfigRequestHdr; + UINTN Size; + CHAR16 *StrPointer; + BOOLEAN AllocatedRequest; + VARSTORE_DATA *VarStoreConfig; + + if (Progress =3D=3D NULL || Results =3D=3D NULL) { + return EFI_INVALID_PARAMETER; + } + // + // Initialize the local variables. + // + ConfigRequestHdr =3D NULL; + ConfigRequest =3D NULL; + Size =3D 0; + *Progress =3D Request; + AllocatedRequest =3D FALSE; + + PrivateData =3D PRIVATE_DATA_FROM_THIS (This); + HiiConfigRouting =3D PrivateData->HiiConfigRouting; + VarStoreConfig =3D &PrivateData->VarStoreConfig; + ASSERT (VarStoreConfig !=3D NULL); + + BufferSize =3D sizeof (VARSTORE_DATA); + + if (Request =3D=3D NULL) { + // + // Request is set to NULL, construct full request string. + // + + // + // Allocate and fill a buffer large enough to hold the tem= plate + // followed by "&OFFSET=3D0&WIDTH=3DWWWWWWWWWWWWWWWW" followed by a + // Null-terminator + // + ConfigRequestHdr =3D HiiConstructConfigHdr ( + &gPlatformPcieDeviceConfigFormSetGuid, + mVariableName, + PrivateData->DriverHandle + ); + if (ConfigRequestHdr =3D=3D NULL) { + return EFI_OUT_OF_RESOURCES; + } + Size =3D (StrLen (ConfigRequestHdr) + 32 + 1) * sizeof (CHAR16); + ConfigRequest =3D AllocateZeroPool (Size); + ASSERT (ConfigRequest !=3D NULL); + AllocatedRequest =3D TRUE; + UnicodeSPrint ( + ConfigRequest, + Size, + L"%s&OFFSET=3D0&WIDTH=3D%016LX", + ConfigRequestHdr, + (UINT64)BufferSize + ); + FreePool (ConfigRequestHdr); + ConfigRequestHdr =3D NULL; + } else { + // + // Check routing data in . + // Note: if only one Storage is used, then this checking could be skip= ped. + // + if (!HiiIsConfigHdrMatch (Request, &gPlatformPcieDeviceConfigFormSetGu= id, NULL)) { + return EFI_NOT_FOUND; + } + // + // Set Request to the unified request string. + // + ConfigRequest =3D Request; + + // + // Check whether Request includes Request Element. + // + if (StrStr (Request, L"OFFSET") =3D=3D NULL) { + // + // Check Request Element does exist in Request String + // + StrPointer =3D StrStr (Request, L"PATH"); + if (StrPointer =3D=3D NULL) { + return EFI_INVALID_PARAMETER; + } + if (StrStr (StrPointer, L"&") =3D=3D NULL) { + Size =3D (StrLen (Request) + 32 + 1) * sizeof (CHAR16); + ConfigRequest =3D AllocateZeroPool (Size); + ASSERT (ConfigRequest !=3D NULL); + AllocatedRequest =3D TRUE; + UnicodeSPrint ( + ConfigRequest, + Size, + L"%s&OFFSET=3D0&WIDTH=3D%016LX", + Request, + (UINT64)BufferSize + ); + } + } + } + // + // Check if requesting Name/Value storage + // + if (StrStr (ConfigRequest, L"OFFSET") =3D=3D NULL) { + // + // Don't have any Name/Value storage names + // + Status =3D EFI_SUCCESS; + } else { + // + // Convert buffer data to by helper function BlockToConfi= g() + // + Status =3D HiiConfigRouting->BlockToConfig ( + HiiConfigRouting, + ConfigRequest, + (UINT8 *)VarStoreConfig, + BufferSize, + Results, + Progress + ); + } + // + // Free the allocated config request string. + // + if (AllocatedRequest) { + FreePool (ConfigRequest); + } + if (ConfigRequestHdr !=3D NULL) { + FreePool (ConfigRequestHdr); + } + // + // Set Progress string to the original request string. + // + if (Request =3D=3D NULL) { + *Progress =3D NULL; + } else if (StrStr (Request, L"OFFSET") =3D=3D NULL) { + *Progress =3D Request + StrLen (Request); + } + return Status; +} + +/** + This function processes the results of changes in configuration. + @param This Points to the EFI_HII_CONFIG_ACCESS_PROTO= COL. + @param Configuration A null-terminated Unicode string in + format. + @param Progress A pointer to a string filled in with the = offset of + the most recent '&' before the first fail= ing + name/value pair (or the beginning of the = string if + the failure is in the first name/value pa= ir) or + the terminating NULL if all was successfu= l. + @retval EFI_SUCCESS The Results is processed successfully. + @retval EFI_INVALID_PARAMETER Configuration is NULL. + @retval EFI_NOT_FOUND Routing data doesn't match any storage in= this + driver. +**/ +EFI_STATUS +EFIAPI +RouteConfig ( + IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, + IN CONST EFI_STRING Configuration, + OUT EFI_STRING *Progress + ) +{ + EFI_STATUS Status; + UINTN BufferSize; + PRIVATE_DATA *PrivateData; + EFI_HII_CONFIG_ROUTING_PROTOCOL *HiiConfigRouting; + VARSTORE_DATA *VarStoreConfig; + + if (Configuration =3D=3D NULL || Progress =3D=3D NULL) { + return EFI_INVALID_PARAMETER; + } + PrivateData =3D PRIVATE_DATA_FROM_THIS (This); + HiiConfigRouting =3D PrivateData->HiiConfigRouting; + *Progress =3D Configuration; + VarStoreConfig =3D &PrivateData->VarStoreConfig; + ASSERT (VarStoreConfig !=3D NULL); + + // + // Check routing data in . + // Note: if only one Storage is used, then this checking could be skippe= d. + // + if (!HiiIsConfigHdrMatch ( + Configuration, + &gPlatformPcieDeviceConfigFormSetGuid, + NULL + )) + { + return EFI_NOT_FOUND; + } + + // + // Check if configuring Name/Value storage + // + if (StrStr (Configuration, L"OFFSET") =3D=3D NULL) { + // + // Don't have any Name/Value storage names + // + return EFI_SUCCESS; + } + // + // Convert to buffer data by helper function ConfigToBlock(= ) + // + BufferSize =3D sizeof (VARSTORE_DATA); + Status =3D HiiConfigRouting->ConfigToBlock ( + HiiConfigRouting, + Configuration, + (UINT8 *)VarStoreConfig, + &BufferSize, + Progress + ); + + return Status; +} + +/** + This function processes the results of changes in configuration. + @param This Points to the EFI_HII_CONFIG_ACCESS_PROTO= COL. + @param Action Specifies the type of action taken by the= browser. + @param QuestionId A unique value which is sent to the origi= nal + exporting driver so that it can identify = the type + of data to expect. + @param Type The type of value for the question. + @param Value A pointer to the data being sent to the o= riginal + exporting driver. + @param ActionRequest On return, points to the action requested= by the + callback function. + @retval EFI_SUCCESS The callback successfully handled the act= ion. + @retval EFI_INVALID_PARAMETER Configuration is NULL. + @retval EFI_UNSUPPORTED The specified Action is not supported by = the + callback. +**/ +EFI_STATUS +EFIAPI +DriverCallback ( + IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, + IN EFI_BROWSER_ACTION Action, + IN EFI_QUESTION_ID QuestionId, + IN UINT8 Type, + IN EFI_IFR_TYPE_VALUE *Value, + OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest + ) +{ + EFI_STATUS Status; + PRIVATE_DATA *PrivateData; + + if (((Value =3D=3D NULL) && + (Action !=3D EFI_BROWSER_ACTION_FORM_OPEN) && + (Action !=3D EFI_BROWSER_ACTION_FORM_CLOSE)) || + (ActionRequest =3D=3D NULL)) + { + return EFI_INVALID_PARAMETER; + } + + PrivateData =3D PRIVATE_DATA_FROM_THIS (This); + + switch (Action) { + case EFI_BROWSER_ACTION_CHANGING: + if ((QuestionId >=3D DEVICE_KEY) + & (QuestionId <=3D (DEVICE_KEY + MAX_DEVICE))) + { + Status =3D UpdateDeviceForm (QuestionId - DEVICE_KEY, PrivateData); + if (EFI_ERROR (Status)) { + return Status; + } + } + break; + + case EFI_BROWSER_ACTION_DEFAULT_STANDARD: + case EFI_BROWSER_ACTION_DEFAULT_MANUFACTURING: + if ((QuestionId >=3D MPS_ONE_OF_KEY) + & (QuestionId <=3D (MPS_ONE_OF_KEY + MAX_DEVICE))) + { + Value->u8 =3D DEFAULT_MPS; + } + + if ((QuestionId >=3D MRR_ONE_OF_KEY) + & (QuestionId <=3D (MRR_ONE_OF_KEY + MAX_DEVICE))) + { + Value->u8 =3D DEFAULT_MRR; + } + break; + + case EFI_BROWSER_ACTION_SUBMITTED: + break; + } + + return EFI_SUCCESS; +} + +EFI_STATUS +EFIAPI +PlatformPcieDeviceConfigEntryPoint ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + EFI_HANDLE DriverHandle; + EFI_HII_CONFIG_ROUTING_PROTOCOL *HiiConfigRouting; + EFI_HII_HANDLE HiiHandle; + EFI_STATUS Status; + EFI_EVENT PlatformUiEntryEvent; + EFI_EVENT FlushDeviceEvent; + EFI_EVENT PciProtocolNotifyEvent; + PRIVATE_DATA *PrivateData; + UINTN BufferSize; + + DriverHandle =3D NULL; + PrivateData =3D AllocateZeroPool (sizeof (*PrivateData)); + if (PrivateData =3D=3D NULL) { + return EFI_OUT_OF_RESOURCES; + } + PrivateData->Signature =3D PRIVATE_DATA_SIGNATURE; + + PrivateData->ConfigAccess.ExtractConfig =3D ExtractConfig; + PrivateData->ConfigAccess.RouteConfig =3D RouteConfig; + PrivateData->ConfigAccess.Callback =3D DriverCallback; + + // + // Locate ConfigRouting protocol + // + Status =3D gBS->LocateProtocol ( + &gEfiHiiConfigRoutingProtocolGuid, + NULL, + (VOID **)&HiiConfigRouting + ); + if (EFI_ERROR (Status)) { + goto Exit; + } + PrivateData->HiiConfigRouting =3D HiiConfigRouting; + + Status =3D gBS->InstallMultipleProtocolInterfaces ( + &DriverHandle, + &gEfiDevicePathProtocolGuid, + &mHiiVendorDevicePath, + &gEfiHiiConfigAccessProtocolGuid, + &PrivateData->ConfigAccess, + NULL + ); + if (EFI_ERROR (Status)) { + goto Exit; + } + + PrivateData->DriverHandle =3D DriverHandle; + + // + // Publish our HII data + // + HiiHandle =3D HiiAddPackages ( + &gPlatformPcieDeviceConfigFormSetGuid, + DriverHandle, + PlatformPcieDeviceConfigDxeStrings, + PlatformPcieDeviceConfigVfrBin, + NULL + ); + if (HiiHandle =3D=3D NULL) { + Status =3D EFI_OUT_OF_RESOURCES; + goto Exit; + } + PrivateData->HiiHandle =3D HiiHandle; + + // Event to fixup screen + Status =3D gBS->CreateEventEx ( + EVT_NOTIFY_SIGNAL, + TPL_CALLBACK, + UpdateMainForm, + (VOID *)PrivateData, + &gPlatformManagerEntryEventGuid, + &PlatformUiEntryEvent + ); + if (EFI_ERROR (Status)) { + goto Exit; + } + + // Event to collect PciIo + PciProtocolNotifyEvent =3D EfiCreateProtocolNotifyEvent ( + &gEfiPciIoProtocolGuid, + TPL_CALLBACK, + OnPciIoProtocolNotify, + (VOID *)PrivateData, + &mPciProtocolNotifyRegistration + ); + ASSERT (PciProtocolNotifyEvent !=3D NULL); + + // Event to flush device data + Status =3D gBS->CreateEventEx ( + EVT_NOTIFY_SIGNAL, + TPL_CALLBACK, + FlushDeviceData, + (VOID *)PrivateData, + &gEfiEventReadyToBootGuid, + &FlushDeviceEvent + ); + if (EFI_ERROR (Status)) { + goto Exit; + } + + // Verify varstore + BufferSize =3D sizeof (VARSTORE_DATA); + Status =3D gRT->GetVariable ( + mVariableName, + &gPlatformPcieDeviceConfigFormSetGuid, + NULL, + &BufferSize, + &PrivateData->LastVarStoreConfig + ); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a: Last config is not found\n", __FUNCTION__)); + } + + return EFI_SUCCESS; + +Exit: + FreePool (PrivateData); + return Status; +} diff --git a/Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformPcieDeviceConfig= Dxe/PlatformPcieHelper.c b/Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformPc= ieDeviceConfigDxe/PlatformPcieHelper.c new file mode 100644 index 000000000000..6bd753ef327f --- /dev/null +++ b/Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformPcieDeviceConfigDxe/Pla= tformPcieHelper.c @@ -0,0 +1,191 @@ +/** @file + + Copyright (c) 2021, Ampere Computing LLC. All rights reserved.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include + +#include +#include +#include +#include + +#include "PlatformPcieDeviceConfigDxe.h" +#include "PlatformPcieHelper.h" + +EFI_STATUS +FindCapabilityPtr ( + IN EFI_PCI_IO_PROTOCOL *PciIo, + IN UINT8 CapabilityId, + OUT UINT8 *CapabilityPtr + ) +{ + EFI_STATUS Status; + UINT8 NextPtr; + UINT16 TmpValue; + + ASSERT (PciIo !=3D NULL); + + // + // Get pointer to first PCI Capability header + // + Status =3D PciIo->Pci.Read ( + PciIo, + EfiPciIoWidthUint8, + PCI_CAPBILITY_POINTER_OFFSET, + 1, + &NextPtr + ); + if (EFI_ERROR (Status)) { + goto Exit; + } + + while (TRUE) { + if (NextPtr =3D=3D 0x00) { + Status =3D EFI_NOT_FOUND; + goto Exit; + } + + // + // Retrieve PCI Capability header + // + Status =3D PciIo->Pci.Read ( + PciIo, + EfiPciIoWidthUint16, + NextPtr, + 1, + &TmpValue + ); + if (EFI_ERROR (Status)) { + goto Exit; + } + + if ((TmpValue & 0xFF) =3D=3D CapabilityId) { + *CapabilityPtr =3D NextPtr; + Status =3D EFI_SUCCESS; + goto Exit; + } + + NextPtr =3D (TmpValue >> 8) & 0xFF; + } + +Exit: + return Status; +} + +EFI_STATUS +WriteMps ( + PCIE_NODE *Node, + UINT8 Value + ) +{ + EFI_PCI_IO_PROTOCOL *PciIo; + EFI_STATUS Status; + UINT16 TmpValue; + UINT8 PcieCapOffset; + + if (Node =3D=3D NULL) { + return EFI_INVALID_PARAMETER; + } + + PciIo =3D Node->PciIo; + PcieCapOffset =3D Node->PcieCapOffset; + + // Get current device control reg + Status =3D PciIo->Pci.Read ( + PciIo, + EfiPciIoWidthUint16, + PcieCapOffset + PCI_EXPRESS_CAPABILITY_DEVICE_CONT= ROL_REG, + 1, + &TmpValue + ); + if (EFI_ERROR (Status)) { + return Status; + } + + // Update value and write to device + TmpValue =3D (TmpValue & ~(PCIE_MAX_PAYLOAD_MASK << PCIE_CONTROL_MAX_PAY= LOAD_OFF)) + | Value << PCIE_CONTROL_MAX_PAYLOAD_OFF; + Status =3D PciIo->Pci.Write ( + PciIo, + EfiPciIoWidthUint16, + PcieCapOffset + PCI_EXPRESS_CAPABILITY_DEVICE_CONT= ROL_REG, + 1, + &TmpValue + ); + if (EFI_ERROR (Status)) { + return Status; + } + DEBUG (( + DEBUG_INFO, + "%a: Write MPS %d to device 0x%04x:0x%02x:0x%02x:0x%02x\n", + __FUNCTION__, + Value, + Node->Seg, + Node->Bus, + Node->Dev, + Node->Fun + )); + + return EFI_SUCCESS; +} + +EFI_STATUS +WriteMrr ( + PCIE_NODE *Node, + UINT8 Value + ) +{ + EFI_PCI_IO_PROTOCOL *PciIo; + EFI_STATUS Status; + UINT16 TmpValue; + UINT8 PcieCapOffset; + + if (Node =3D=3D NULL) { + return EFI_INVALID_PARAMETER; + } + + PciIo =3D Node->PciIo; + PcieCapOffset =3D Node->PcieCapOffset; + + // Get current device control reg + Status =3D PciIo->Pci.Read ( + PciIo, + EfiPciIoWidthUint16, + PcieCapOffset + PCI_EXPRESS_CAPABILITY_DEVICE_CONT= ROL_REG, + 1, + &TmpValue + ); + if (EFI_ERROR (Status)) { + return Status; + } + + // Update value and write to device + TmpValue =3D (TmpValue & ~(PCIE_MAX_READ_REQUEST_MASK << PCIE_CONTROL_RE= AD_REQUEST_OFF)) + | Value << PCIE_CONTROL_READ_REQUEST_OFF; + Status =3D PciIo->Pci.Write ( + PciIo, + EfiPciIoWidthUint16, + PcieCapOffset + PCI_EXPRESS_CAPABILITY_DEVICE_CONT= ROL_REG, + 1, + &TmpValue + ); + if (EFI_ERROR (Status)) { + return Status; + } + DEBUG (( + DEBUG_INFO, + "%a: Write MRR %d to device 0x%04x:0x%02x:0x%02x:0x%02x\n", + __FUNCTION__, + Value, + Node->Seg, + Node->Bus, + Node->Dev, + Node->Fun + )); + + return EFI_SUCCESS; +} diff --git a/Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformPcieDeviceConfig= Dxe/PlatformPcieDeviceConfigDxe.uni b/Silicon/Ampere/AmpereAltraPkg/Drivers= /PlatformPcieDeviceConfigDxe/PlatformPcieDeviceConfigDxe.uni new file mode 100644 index 000000000000..f6cd94ffee36 --- /dev/null +++ b/Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformPcieDeviceConfigDxe/Pla= tformPcieDeviceConfigDxe.uni @@ -0,0 +1,24 @@ +=EF=BB=BF// +// Copyright (c) 2021, Ampere Computing LLC. All rights reserved.
+// +// SPDX-License-Identifier: BSD-2-Clause-Patent +// + +#langdef en-US "English" // English + +#string STR_DEVICE_CONFIG_FORM #language en-US "PCIE Device Configuration= " +#string STR_DEVICE_CONFIG_HELP #language en-US "PCIE Device Configuration= " + +#string STR_DEVICE_FORM #language en-US "PCIE Device Form" +#string STR_DEVICE_GOTO_HELP #language en-US "PCIE Device Configuration= " + +#string STR_PCIE_MPS #language en-US "Max Payload Size" +#string STR_PCIE_MPS_HELP #language en-US "Max Payload Size" +#string STR_PCIE_MRR #language en-US "Max Read Request Size" +#string STR_PCIE_MRR_HELP #language en-US "Max Read Request Size" +#string STR_128 #language en-US "128 bytes" +#string STR_256 #language en-US "256 bytes" +#string STR_512 #language en-US "512 bytes" +#string STR_1024 #language en-US "1024 bytes" +#string STR_2048 #language en-US "2048 bytes" +#string STR_4096 #language en-US "4096 bytes" --=20 2.17.1