From nobody Sun May 19 11:06:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+104715+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+104715+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1683823636949198.61352597194048; Thu, 11 May 2023 09:47:16 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id KhGcYY1788612x70dLaMS5xH; Thu, 11 May 2023 09:47:16 -0700 X-Received: from NAM10-BN7-obe.outbound.protection.outlook.com (NAM10-BN7-obe.outbound.protection.outlook.com [40.107.92.121]) by mx.groups.io with SMTP id smtpd.web11.53794.1683792645235590947 for ; Thu, 11 May 2023 01:10:45 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FBWIjA8mruxN07v9W2ueYNTQezKCojUD9noFzu1zeKeXHeP3UXkCTbotgZpU3Tjl/hxXWlfCd+bgH/p2q6E3hE5huqdR/Rn558thPpc0ydbq9lwWBY/e5kSBuDLbmNdn6lz80kbGf1oEsOFBi5+0FaSQEFuOkTl8jw6wd60LYrdV+t4ci/CYycece5NtRg3p159vBQgpRYKbUp9QSh/E2m4I9DBVdp9TiP8ZAhYhpuhaYpnOAOxJEnBilGeR0K/oO6k+TVnR1c4SdS41irOd1aU/b/rEpxfi09k5Ip5ebg/nEygzw7sjX7bIvynUdQdIbsjBFHSlYXDx8necD7CpsA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=oFG0QoFDhZTyKFyzJeunlECJs4vlHckJSNOR/RI0go4=; b=T8Q/FpWlASNy+txioXWchA5v4E2vSv5ld7LEQjWuiyPyj6+v0MWRYW82PaOgHNX6A8ZeZdg+MDacHEnCySVwbkUkW3q18M/OYr5f8YOzBBnFh7EgWIgTSxlLxFF2gL0QdXDZyb27xcfV/KW2xTZBxxpqi9qffqC1lfyVe7gLQuKOIXl/L2E9VB6IJhpQGwEYWoQeJgbEZ0vnsLA4yUH37aC3IqO9nRP8Av1gIj07RIGopJN5Ha1HzguCsnkW/6WjJKp55ABgfZmbKfRRCRmGeiynC8atxqA+d7UoKkpUzdwE33UKb9dipvr0U5zbauH12OuDv8tOtCXJ0ouZrZgG3A== 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 X-Received: from PH0PR01MB8048.prod.exchangelabs.com (2603:10b6:510:280::7) by CY4PR0101MB3144.prod.exchangelabs.com (2603:10b6:910:49::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6340.19; Thu, 11 May 2023 08:10:40 +0000 X-Received: from PH0PR01MB8048.prod.exchangelabs.com ([fe80::bbdb:b58c:140e:c4e1]) by PH0PR01MB8048.prod.exchangelabs.com ([fe80::bbdb:b58c:140e:c4e1%6]) with mapi id 15.20.6387.019; Thu, 11 May 2023 08:10:40 +0000 From: "Minh Nguyen via groups.io" To: devel@edk2.groups.io CC: patches@amperecomputing.com, quic_llindhol@quicinc.com, ardb+tianocore@kernel.org, nhi@os.amperecomputing.com, tinhnguyen@os.amperecomputing.com, Vu Nguyen , Minh Nguyen Subject: [edk2-devel] [edk2-platforms][PATCH 1/6] AmpereAltraPkg: Add PCIe Hot Plug library Date: Thu, 11 May 2023 15:10:06 +0700 Message-ID: <20230511081011.2692963-2-minhnguyen1@os.amperecomputing.com> In-Reply-To: <20230511081011.2692963-1-minhnguyen1@os.amperecomputing.com> References: <20230511081011.2692963-1-minhnguyen1@os.amperecomputing.com> X-ClientProxiedBy: SI2P153CA0033.APCP153.PROD.OUTLOOK.COM (2603:1096:4:190::21) To PH0PR01MB8048.prod.exchangelabs.com (2603:10b6:510:280::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR01MB8048:EE_|CY4PR0101MB3144:EE_ X-MS-Office365-Filtering-Correlation-Id: 52b39f19-219a-4c2c-71bf-08db51f735bc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: e+/z4lS1zKh9SvHzjBfuaMajwdVTpE0Xvcxb3+aV7Dw0fDlvoWP4LYL2aDdhmqCWRC48Uxufqtx9m4gGkYv37I7yyOUwcw34SG6QrUVVB8BZE+ze/YdLKDqcWMTGNutgpX9zyD87vJIEQoJpV1W/CUN1Q3I09SI1MoWwngvbWzY2X4MIah2rGotA9Uroo8BsFGNL/Tt2wPEoyxdHz+gXcmKT+CTanmAkQgEptmEN2GVnQUlXesqTZsP++2aMyJ5+2sxI1mb3LREdKwphbkK7ZuV8stqzlKKbbOWu2DTkKs80PEYKbKX5+xWamK+39tFXhb5f48qhN7MCD+hGXNM3+OJ46C7bbDPrZ07Oc0XPupKGH0q2N29HPiImXXGLIlrf+uBc+L/yFy02Su2lE6dWoAkCSd9FH6ygXTtJsHP3kjrCmRJIu44MmCAbkTjJy3R86Lc00ELsGj3C8cZFs0VdIwUdJdD0CsecaqX67HdAD1QBDoxbvbtZO5FFWHM21UQnulVcHH8CRHbBNirN+WBgL60Gk/BlexDcoo12ay3dTcdRfHasiTCIuPbd2gB91XYS8eZwe2Bz1Zuy02/kVPwCKXzyBTBzUvkUgwNFpidL5zo17eBaRbyl1hyhA+d+DO+B X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?3a7hS651/+5H32TeskwcsJ+QWjT0vk+65Fxb1Zm5uIXZoTIMdlHVa3ZnZlyw?= =?us-ascii?Q?nDebf8ctO29YsAWKG7zwKK2+0T9jMaaAXPSmqTyXvJPrm65EQazNG2qqlQIl?= =?us-ascii?Q?1D8it6/MTh37R8vFqXN52EGSs3eF9YimN7Kl6mwdA+/ndyOcCbE84PsRJtCJ?= =?us-ascii?Q?DeW/dh/K+K7WQSKPkFV4AqABaanw5H+B6JRVcRCFbrqqwbRX4RXZMMIVN1Ua?= =?us-ascii?Q?3cQiSg+TGt/wljrkmCbqZrlr8ZVc22laUO4PYd2LrQGpZrJXKRKSZ4fxUL77?= =?us-ascii?Q?K7eXOZbaAS4vpuIWZLF2ra4iSDoi+OwTfMLw6Qo8RYwmk/XQh8/TRoDIHJ+2?= =?us-ascii?Q?lFSvorzGPQhfeuxIhnvzX8MEg1FVGCHxl0sKi3MgKdsjAJEg8Bkgtv/SOMhY?= =?us-ascii?Q?x4VJ9dXj/4Ip04xgLWzefmBBkehD0/bXAVFFhoMUPl0qD7EqNha3kGBTXPaO?= =?us-ascii?Q?nHdVXNrk0Y1K7pqsJmVfGTcJDNWcOI9Osljf7ieY7I23eTTMyOKREGfKvQyE?= =?us-ascii?Q?x1USK4vzbqItyQ7mDowzVT3uxfKEF7TJ7TBJG4zI+NAjuIzuB5dmO9KGDpnw?= =?us-ascii?Q?n0YSMWF0F0Sxe8lzoOjlMOM0G9IYLNbDVltt5240qcHfdr7tJL2k/6FeEhR6?= =?us-ascii?Q?X1kn6oxo1Ury5cPx2WQ1sgF4Ruz7hXjq1AdErhQs0S0tLlSi7VxqLkHQupMH?= =?us-ascii?Q?2ron3Hi6AAHqHdqxejSIkHJcgyZZNFwC+QLuSCEYifErrecy41x5ZxXGgTeO?= =?us-ascii?Q?BdH4HaLoX73/pOo6+ktVSKRGw/2fsI//Hjb0BuIyfDihUgK7CXf87p0MGbOZ?= =?us-ascii?Q?b7LGw25EmBX+fsbt8GvlV7Feq1g+LufJFKdWF2BbazJuHbEu6WOBQCRSxoyP?= =?us-ascii?Q?26EHAeyJr2MqIxNmVifSkn7/5cJqkNCTbLsRAgO+nZKrxAtRzVNq4f3Lex/3?= =?us-ascii?Q?eoI2fHb3FXHG2bfnmllITJvkO1hpgiMrVRCKtmuCuk/yFtyaU9x3bdMYW6c2?= =?us-ascii?Q?erPwNW06U5SmV7d6BQskoq1rn/C1ugwGKFymayf1YNLxSAX49+B8iD44gAEb?= =?us-ascii?Q?UdCngSB9EprNNavRrJ7XvwNV3vCLwxdgGypKXczr98bCF2UUkO9ft5603eRs?= =?us-ascii?Q?RaNw3HKgUNL1d450gjdoYLxsXzeMEmpmu9WRDdvJnboJgFiSrHTyHFIvGar0?= =?us-ascii?Q?k83d7u2JLqeq/g2Ypgt8tbbGBXE/zaxMyUFGsJhQCHv5vMQiIGtgkkjT/0ii?= =?us-ascii?Q?FZc/XNTct57o7EcrTa0yuOQHb0DUHtctnafnVs2W33F+EC0v++HKY01au005?= =?us-ascii?Q?9xHKzTijAs0Txp/jWwHYOCcEHhr3GX2dwSFjNmxVPcMnblGXaPLEl2pYL3IY?= =?us-ascii?Q?7MhKpCEUWTH+Hrr8up/85k02NcGFNUYhtKHv/BO+CGCPIcfn/mAIOi9WmzWy?= =?us-ascii?Q?bsCP//pqUg8LJf7k6vg+OepxS/B0HPxSOOLxwyedZrXkngLVrMZGqa+4LsXp?= =?us-ascii?Q?un/jBEWkh8x4LA3ZuQYvZUYEa3XJWtyMohR3SBP6XT4Ua6C55KIO+JUeNMjm?= =?us-ascii?Q?xd3FluIFrWlibb2pW2C7xyYTXiPOcPieS2IJnCga9H6RQytlf2qQcxSU7POX?= =?us-ascii?Q?r9A5D3xuVFADCf4ddEmntQ19TVfR6OG029iXpVsLgOuw?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 52b39f19-219a-4c2c-71bf-08db51f735bc X-MS-Exchange-CrossTenant-AuthSource: PH0PR01MB8048.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 May 2023 08:10:40.7989 (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: 0yxDdKpths85H3FVNUvQ/5v198985jrUAQ9LN5LdsR5d06sua5bCQ1BDIhRJnmyPdbOpBIW6sjs+P2hAMdX+vq79lCisbVLZFwBVwV8b+nZWTaVYXR2tQaMvd+I5DCMt X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR0101MB3144 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,minhnguyen1@os.amperecomputing.com X-Gm-Message-State: TRxY7mr5E7v7D6ZFputPVXfLx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1683823636; bh=JBxM71oyR/+XD9FO6Y8s8tX2sfx+jk8KuBGaNcgGspg=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=uLzoJ2jQaVY37LX0EEiUtgz6/IpZ6HmTev1TQtXtDMuj7mPX8wsfsolRacwBuI3zobZ Cj906igAf7YRWPgUQPRR17BVRQOJ+emnyoH/DXKPYNH/wqXGlm+SyAiWUecPgQBcFmauW r4nOM2RTNz0yW0HeCOOj6UxqR9QvPaWAPV0= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1683823638217100034 Content-Type: text/plain; charset="utf-8" From: Vu Nguyen This adds PCIe Hot Plug library to support Hot Plug feature and specific procedures for setting different Portmap tables (GPIO pins used for PCIe reset). Signed-off-by: Minh Nguyen --- Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dec | = 8 +- Silicon/Ampere/AmpereSiliconPkg/AmpereSiliconPkg.dec | = 13 + Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dsc.inc | = 1 + Platform/Ampere/JadePkg/Jade.dsc | = 66 ++++ Silicon/Ampere/AmpereAltraPkg/Library/PcieHotPlugLib/PcieHotPlugLib.inf | = 37 ++ Silicon/Ampere/AmpereAltraPkg/Include/Library/PcieHotPlugLib.h | = 162 ++++++++ Silicon/Ampere/AmpereSiliconPkg/Include/Library/PcieHotPlugPortMapLib.h | = 81 ++++ Silicon/Ampere/AmpereAltraPkg/Library/PcieHotPlugLib/PcieHotPlugLib.c | = 397 ++++++++++++++++++++ 8 files changed, 764 insertions(+), 1 deletion(-) diff --git a/Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dec b/Silicon/Amp= ere/AmpereAltraPkg/AmpereAltraPkg.dec index d795c9229691..d4881eaed692 100644 --- a/Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dec +++ b/Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dec @@ -1,6 +1,6 @@ ## @file # -# Copyright (c) 2020-2021, Ampere Computing LLC. All rights reserved.
+# Copyright (c) 2020-2023, Ampere Computing LLC. All rights reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -49,6 +49,9 @@ [LibraryClasses] ## @libraryclass Defines a set of methods to initialize Pcie Ac01PcieLib|Silicon/Ampere/AmpereAltraPkg/Include/Library/Ac01PcieLib.h =20 + ## @libraryclass Defines a set of methods to start Hot plug feature + PcieHotPlugLib|Silicon/Ampere/AmpereAltraPkg/Include/Library/PcieHotPlug= Lib.h + [Guids] ## NVParam MM GUID gNVParamMmGuid =3D { 0xE4AC5024, 0x29BE, 0x4ADC, { 0x93, 0= x36, 0x87, 0xB5, 0xA0, 0x76, 0x23, 0x2D } } @@ -70,3 +73,6 @@ [Guids] =20 ## Include/Guid/AcpiConfigHii.h gAcpiConfigFormSetGuid =3D { 0x0ceb6764, 0xd415, 0x4b01, { 0xa8, 0x43, 0= xd1, 0x01, 0xbc, 0xb0, 0xd8, 0x29 } } + + ## PCIe Hot Plug GUID + gPcieHotPlugGuid =3D { 0x5598273c, 0x11ea, 0xa496, { 0x42, 0x02, 0x37, 0= xbb, 0x02, 0x00, 0x13, 0xac } } diff --git a/Silicon/Ampere/AmpereSiliconPkg/AmpereSiliconPkg.dec b/Silicon= /Ampere/AmpereSiliconPkg/AmpereSiliconPkg.dec index 625a9b2b1e89..9259956c7caa 100644 --- a/Silicon/Ampere/AmpereSiliconPkg/AmpereSiliconPkg.dec +++ b/Silicon/Ampere/AmpereSiliconPkg/AmpereSiliconPkg.dec @@ -80,3 +80,16 @@ [PcdsFixedAtBuild, PcdsDynamic, PcdsDynamicEx] # # SMBIOS Type 0 - BIOS Information gAmpereTokenSpaceGuid.PcdSmbiosTables0BiosReleaseDate|"MM/DD/YYYY"|VOID*= |0xB0000002 # Must follow this MM/DD/YYYY SMBIOS date format + + # Pcie HotPlug reset map + gAmpereTokenSpaceGuid.PcdPcieHotPlugGpioResetMap|0x0|UINT8|0xB000000A + + # + # Pcie HotPlug Port Map table + # + gAmpereTokenSpaceGuid.PcdPcieHotPlugPortMapTable|{0x00}|PCIE_HOT_PLUG_PO= RT_MAP_TABLE|0xB000000B { + + Library/PcieHotPlugPortMapLib.h + + Silicon/Ampere/AmpereSiliconPkg/AmpereSiliconPkg.dec + } diff --git a/Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dsc.inc b/Silicon= /Ampere/AmpereAltraPkg/AmpereAltraPkg.dsc.inc index 9275e0053af6..8cb2a3fe6422 100644 --- a/Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dsc.inc +++ b/Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dsc.inc @@ -81,6 +81,7 @@ [LibraryClasses.common] NVParamLib|Silicon/Ampere/AmpereAltraPkg/Library/NVParamLib/NVParamLib.i= nf MailboxInterfaceLib|Silicon/Ampere/AmpereAltraPkg/Library/MailboxInterfa= ceLib/MailboxInterfaceLib.inf SystemFirmwareInterfaceLib|Silicon/Ampere/AmpereAltraPkg/Library/SystemF= irmwareInterfaceLib/SystemFirmwareInterfaceLib.inf + PcieHotPlugLib|Silicon/Ampere/AmpereAltraPkg/Library/PcieHotPlugLib/Pcie= HotPlugLib.inf PciePhyLib|Silicon/Ampere/AmpereAltraBinPkg/Library/PciePhyLib/PciePhyLi= b.inf Ac01PcieLib|Silicon/Ampere/AmpereAltraPkg/Library/Ac01PcieLib/Ac01PcieLi= b.inf AmpereCpuLib|Silicon/Ampere/AmpereAltraPkg/Library/AmpereCpuLib/AmpereCp= uLib.inf diff --git a/Platform/Ampere/JadePkg/Jade.dsc b/Platform/Ampere/JadePkg/Jad= e.dsc index f14d286cdfb8..a6b5fa3ca2d3 100644 --- a/Platform/Ampere/JadePkg/Jade.dsc +++ b/Platform/Ampere/JadePkg/Jade.dsc @@ -100,7 +100,73 @@ [PcdsFeatureFlag.common] # gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol|TRUE =20 + # + # Flag to indicate option of using default or specific platform Port Map= table + # + gAmpereTokenSpaceGuid.PcdPcieHotPlugPortMapTable.UseDefaultConfig|TRUE + [PcdsFixedAtBuild] + gAmpereTokenSpaceGuid.PcdPcieHotPlugGpioResetMap|0x3F + + # + # Setting Portmap table + # + # * Elements of array: + # - 0: Index of Portmap entry in Portmap table structure (Vport). + # - 1: Socket number (Socket). + # - 2: Root complex port for each Portmap entry (RcaPort). + # - 3: Root complex sub-port for each Portmap entry (RcaSubPort). + # - 4: Select output port of IO expander (PinPort). + # - 5: I2C address of IO expander that CPLD backplane simulates (I2= cAddress). + # - 6: Address of I2C switch between CPU and CPLD backplane (MuxAdd= ress). + # - 7: Channel of I2C switch (MuxChannel). + # - 8: It is set from PcieHotPlugSetGPIOMapCmd () function to selec= t GPIO[16:21] (PcdPcieHotPlugGpioResetMap) or I2C for PCIe reset purpose. + # - 9: Segment of root complex (Segment). + # - 10: SSD slot index on the front panel of backplane (DriveIndex). + # + # * Caution: + # - The last array ({ 0xFF, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xFF }) requi= re if no fully structured used. + # - Size of Portmap table: PortMap[MAX_PORT_MAP_ENTRY][sizeof(PCIE_H= OT_PLUG_PORTMAP_ENTRY)] <=3D> PortMap[96][11]. + # * Example: Bellow configuration is the configuration for Portmap tab= le of Mt. Jade 2U platform. + # + gAmpereTokenSpaceGuid.PcdPcieHotPlugPortMapTable.PortMap[0]|{ 0, 0, 2, 0= , 0, 0x00, 0x00, 0x0, 0, 1, 0xFF } # S0 RCA2.0 + gAmpereTokenSpaceGuid.PcdPcieHotPlugPortMapTable.PortMap[1]|{ 1, 0, 3, 0= , 1, 0x00, 0x00, 0x0, 0, 0, 0xFF } # S0 RCA3.0 + gAmpereTokenSpaceGuid.PcdPcieHotPlugPortMapTable.PortMap[2]|{ 2, 0, 4, 0= , 2, 0x27, 0x70, 0x1, 0, 2, 6 } # S0 RCB0.0 - SSD6 + gAmpereTokenSpaceGuid.PcdPcieHotPlugPortMapTable.PortMap[3]|{ 3, 0, 4, 2= , 3, 0x27, 0x70, 0x1, 0, 2, 7 } # S0 RCB0.2 - SSD7 + gAmpereTokenSpaceGuid.PcdPcieHotPlugPortMapTable.PortMap[4]|{ 4, 0, 4, 4= , 0, 0x25, 0x70, 0x1, 0, 2, 2 } # S0 RCB0.4 - SSD2 + gAmpereTokenSpaceGuid.PcdPcieHotPlugPortMapTable.PortMap[5]|{ 5, 0, 4, 6= , 1, 0x25, 0x70, 0x1, 0, 2, 3 } # S0 RCB0.6 - SSD3 + gAmpereTokenSpaceGuid.PcdPcieHotPlugPortMapTable.PortMap[6]|{ 6, 0, 5, 0= , 0, 0x24, 0x70, 0x1, 0, 3, 0 } # S0 RCB1.0 - SSD0 + gAmpereTokenSpaceGuid.PcdPcieHotPlugPortMapTable.PortMap[7]|{ 7, 0, 5, 2= , 1, 0x24, 0x70, 0x1, 0, 3, 1 } # S0 RCB1.2 - SSD1 + gAmpereTokenSpaceGuid.PcdPcieHotPlugPortMapTable.PortMap[8]|{ 8, 0, 5, 4= , 2, 0x26, 0x70, 0x1, 0, 3, 4 } # S0 RCB1.4 - SSD4 + gAmpereTokenSpaceGuid.PcdPcieHotPlugPortMapTable.PortMap[9]|{ 9, 0, 5, 6= , 3, 0x26, 0x70, 0x1, 0, 3, 5 } # S0 RCB1.6 - SSD5 + gAmpereTokenSpaceGuid.PcdPcieHotPlugPortMapTable.PortMap[10]|{ 10, 0, 6,= 0, 2, 0x00, 0x00, 0x0, 0, 4, 0xFF } # S0 RCB2.0 + gAmpereTokenSpaceGuid.PcdPcieHotPlugPortMapTable.PortMap[11]|{ 11, 0, 6,= 2, 3, 0x00, 0x00, 0x0, 0, 4, 0xFF } # S0 RCB2.2 + gAmpereTokenSpaceGuid.PcdPcieHotPlugPortMapTable.PortMap[12]|{ 12, 0, 6,= 4, 0, 0x00, 0x00, 0x0, 0, 4, 0xFF } # S0 RCB2.4 + gAmpereTokenSpaceGuid.PcdPcieHotPlugPortMapTable.PortMap[13]|{ 13, 0, 7,= 0, 1, 0x00, 0x00, 0x0, 0, 5, 0xFF } # S0 RCB3.0 + gAmpereTokenSpaceGuid.PcdPcieHotPlugPortMapTable.PortMap[14]|{ 14, 0, 7,= 4, 2, 0x00, 0x00, 0x0, 0, 5, 0xFF } # S0 RCB3.4 + gAmpereTokenSpaceGuid.PcdPcieHotPlugPortMapTable.PortMap[15]|{ 15, 0, 7,= 6, 3, 0x00, 0x00, 0x0, 0, 5, 0xFF } # S0 RCB3.6 + gAmpereTokenSpaceGuid.PcdPcieHotPlugPortMapTable.PortMap[16]|{ 16, 1, 2,= 0, 0, 0x26, 0x70, 0x2, 0, 6, 20 } # S1 RCA2.0 - SSD20 + gAmpereTokenSpaceGuid.PcdPcieHotPlugPortMapTable.PortMap[17]|{ 17, 1, 2,= 1, 1, 0x26, 0x70, 0x2, 0, 6, 21 } # S1 RCA2.1 - SSD21 + gAmpereTokenSpaceGuid.PcdPcieHotPlugPortMapTable.PortMap[18]|{ 18, 1, 2,= 2, 2, 0x27, 0x70, 0x2, 0, 6, 22 } # S1 RCA2.2 - SSD22 + gAmpereTokenSpaceGuid.PcdPcieHotPlugPortMapTable.PortMap[19]|{ 19, 1, 2,= 3, 3, 0x27, 0x70, 0x2, 0, 6, 23 } # S1 RCA2.3 - SSD23 + gAmpereTokenSpaceGuid.PcdPcieHotPlugPortMapTable.PortMap[20]|{ 20, 1, 3,= 0, 0, 0x00, 0x00, 0x0, 0, 7, 0xFF } # S1 RCA3.0 + gAmpereTokenSpaceGuid.PcdPcieHotPlugPortMapTable.PortMap[21]|{ 21, 1, 3,= 2, 1, 0x00, 0x00, 0x0, 0, 7, 0xFF } # S1 RCA3.2 + gAmpereTokenSpaceGuid.PcdPcieHotPlugPortMapTable.PortMap[22]|{ 22, 1, 4,= 0, 0, 0x00, 0x00, 0x0, 0, 8, 0xFF } # S1 RCB0.0 + gAmpereTokenSpaceGuid.PcdPcieHotPlugPortMapTable.PortMap[23]|{ 23, 1, 4,= 4, 2, 0x25, 0x70, 0x2, 0, 8, 18 } # S1 RCB0.4 - SSD18 + gAmpereTokenSpaceGuid.PcdPcieHotPlugPortMapTable.PortMap[24]|{ 24, 1, 4,= 6, 3, 0x25, 0x70, 0x2, 0, 8, 19 } # S1 RCB0.6 - SSD19 + gAmpereTokenSpaceGuid.PcdPcieHotPlugPortMapTable.PortMap[25]|{ 25, 1, 5,= 0, 0, 0x24, 0x70, 0x2, 0, 9, 16 } # S1 RCB1.0 - SSD16 + gAmpereTokenSpaceGuid.PcdPcieHotPlugPortMapTable.PortMap[26]|{ 26, 1, 5,= 2, 1, 0x24, 0x70, 0x2, 0, 9, 17 } # S1 RCB1.2 - SSD17 + gAmpereTokenSpaceGuid.PcdPcieHotPlugPortMapTable.PortMap[27]|{ 27, 1, 5,= 4, 2, 0x00, 0x00, 0x0, 0, 9, 0xFF } # S1 RCB1.4 + gAmpereTokenSpaceGuid.PcdPcieHotPlugPortMapTable.PortMap[28]|{ 28, 1, 6,= 0, 3, 0x25, 0x70, 0x4, 0, 10, 11 } # S1 RCB2.0 - SSD11 + gAmpereTokenSpaceGuid.PcdPcieHotPlugPortMapTable.PortMap[29]|{ 29, 1, 6,= 2, 2, 0x25, 0x70, 0x4, 0, 10, 10 } # S1 RCB2.2 - SSD10 + gAmpereTokenSpaceGuid.PcdPcieHotPlugPortMapTable.PortMap[30]|{ 30, 1, 6,= 4, 1, 0x27, 0x70, 0x4, 0, 10, 15 } # S1 RCB2.4 - SSD15 + gAmpereTokenSpaceGuid.PcdPcieHotPlugPortMapTable.PortMap[31]|{ 31, 1, 6,= 6, 0, 0x27, 0x70, 0x4, 0, 10, 14 } # S1 RCB2.6 - SSD14 + gAmpereTokenSpaceGuid.PcdPcieHotPlugPortMapTable.PortMap[32]|{ 32, 1, 7,= 0, 3, 0x26, 0x70, 0x4, 0, 11, 13 } # S1 RCB3.0 - SSD13 + gAmpereTokenSpaceGuid.PcdPcieHotPlugPortMapTable.PortMap[33]|{ 33, 1, 7,= 2, 2, 0x26, 0x70, 0x4, 0, 11, 12 } # S1 RCB3.2 - SSD12 + gAmpereTokenSpaceGuid.PcdPcieHotPlugPortMapTable.PortMap[34]|{ 34, 1, 7,= 4, 1, 0x24, 0x70, 0x4, 0, 11, 9 } # S1 RCB3.4 - SSD9 + gAmpereTokenSpaceGuid.PcdPcieHotPlugPortMapTable.PortMap[35]|{ 35, 1, 7,= 6, 0, 0x24, 0x70, 0x4, 0, 11, 8 } # S1 RCB3.6 - SSD8 + gAmpereTokenSpaceGuid.PcdPcieHotPlugPortMapTable.PortMap[36]|{ 0xFF, 0, = 0, 0, 0, 0, 0, 0, 0, 0, 0xFF } # Require if no fully structure used + !ifdef $(FIRMWARE_VER) gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString|L"$(FIRMWARE_VER= )" !endif diff --git a/Silicon/Ampere/AmpereAltraPkg/Library/PcieHotPlugLib/PcieHotPl= ugLib.inf b/Silicon/Ampere/AmpereAltraPkg/Library/PcieHotPlugLib/PcieHotPlu= gLib.inf new file mode 100644 index 000000000000..faeb74ecc0bf --- /dev/null +++ b/Silicon/Ampere/AmpereAltraPkg/Library/PcieHotPlugLib/PcieHotPlugLib.i= nf @@ -0,0 +1,37 @@ +## @file +# +# Copyright (c) 2023, Ampere Computing LLC. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION =3D 0x0001001B + BASE_NAME =3D PcieHotPlugLib + FILE_GUID =3D 6C0C1D32-CB51-4236-AC33-A7A6D4B638E2 + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D PcieHotPlugLib + +[Sources] + PcieHotPlugLib.c + +[Packages] + ArmPkg/ArmPkg.dec + MdePkg/MdePkg.dec + Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dec + Silicon/Ampere/AmpereSiliconPkg/AmpereSiliconPkg.dec + +[LibraryClasses] + ArmSmcLib + BaseMemoryLib + DebugLib + PcdLib + +[Pcd] + gAmpereTokenSpaceGuid.PcdPcieHotPlugGpioResetMap + gAmpereTokenSpaceGuid.PcdPcieHotPlugPortMapTable + +[Guids] + gPcieHotPlugGuid diff --git a/Silicon/Ampere/AmpereAltraPkg/Include/Library/PcieHotPlugLib.h= b/Silicon/Ampere/AmpereAltraPkg/Include/Library/PcieHotPlugLib.h new file mode 100644 index 000000000000..e2f17d366a58 --- /dev/null +++ b/Silicon/Ampere/AmpereAltraPkg/Include/Library/PcieHotPlugLib.h @@ -0,0 +1,162 @@ +/** @file + + Copyright (c) 2023, Ampere Computing LLC. All rights reserved.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + + **/ + +#ifndef PCIE_HOT_PLUG_H_ +#define PCIE_HOT_PLUG_H_ + +#define PCIE_HOT_PLUG_SPCI_CMD_ALERT_IRQ 1 // Alert IRQ +#define PCIE_HOT_PLUG_SPCI_CMD_START 2 // Stat monitor event +#define PCIE_HOT_PLUG_SPCI_CMD_CHG 3 // Indicate PCIE port ch= ange state explicitly +#define PCIE_HOT_PLUG_SPCI_CMD_LED 4 // Control LED state +#define PCIE_HOT_PLUG_SPCI_CMD_PORT_MAP_CLR 5 // Clear all port map +#define PCIE_HOT_PLUG_SPCI_CMD_PORT_MAP_SET 6 // Set port map +#define PCIE_HOT_PLUG_SPCI_CMD_PORT_MAP_LOCK 7 // Lock port map +#define PCIE_HOT_PLUG_SPCI_CMD_GPIO_MAP 8 // Set GPIO reset map + +#define LED_FAULT 1 // LED_CMD: LED type - Fault +#define LED_ATT 2 // LED_CMD: LED type - Attention + +#define LED_SET_ON 1 +#define LED_SET_OFF 2 +#define LED_SET_BLINK 3 + +// DEN0077A Arm Secure Partition Client Interface Specification 1.0 Beta_0= _0 + +// Client ID used for SPCI calls +#define SPCI_CLIENT_ID 0x0000ACAC + +// SPCI error codes. +#define SPCI_SUCCESS 0 +#define SPCI_NOT_SUPPORTED -1 +#define SPCI_INVALID_PARAMETER -2 +#define SPCI_NO_MEMORY -3 +#define SPCI_BUSY -4 +#define SPCI_QUEUED -5 +#define SPCI_DENIED -6 +#define SPCI_NOT_PRESENT -7 + +// Bit definitions inside the function id as per the SMC calling convention +#define FUNCID_CC_SHIFT 30 +#define FUNCID_OEN_SHIFT 24 + +#define SMC_64 1 +#define SMC_32 0 + +// Definitions to build the complete SMC ID +#define SPCI_FID_MISC_FLAG (0 << 27) +#define SPCI_FID_MISC_SHIFT 20 +#define SPCI_FID_TUN_FLAG (1 << 27) +#define SPCI_FID_TUN_SHIFT 24 + +#define OEN_SPCI_START 0x30 +#define OEN_SPCI_END 0x3F + +#define SPCI_SMC(spci_fid) ((OEN_SPCI_START << FUNCID_OEN_SHIFT) | \ + (1U << 31) | (spci_fid)) +#define SPCI_MISC_32(misc_fid) ((SMC_32 << FUNCID_CC_SHIFT) | \ + SPCI_FID_MISC_FLAG | \ + SPCI_SMC ((misc_fid) << SPCI_FID_MISC_SHI= FT)) +#define SPCI_MISC_64(misc_fid) ((SMC_64 << FUNCID_CC_SHIFT) | \ + SPCI_FID_MISC_FLAG | \ + SPCI_SMC ((misc_fid) << SPCI_FID_MISC_SHI= FT)) +#define SPCI_TUN_64(tun_fid) ((SMC_64 << FUNCID_CC_SHIFT) | \ + SPCI_FID_TUN_FLAG | \ + SPCI_SMC ((tun_fid) << SPCI_FID_TUN_SHIFT= )) + +// SPCI miscellaneous functions +#define SPCI_FID_SERVICE_HANDLE_OPEN 0x2 +#define SPCI_FID_SERVICE_HANDLE_CLOSE 0x3 +#define SPCI_FID_SERVICE_REQUEST_BLOCKING 0x7 +#define SPCI_FID_SERVICE_REQUEST_START 0x8 + +// SPCI tunneling functions +#define SPCI_FID_SERVICE_TUN_REQUEST_BLOCKING 0x2 + +// Complete SMC IDs and associated values +#define SPCI_SERVICE_HANDLE_OPEN \ + SPCI_MISC_32 (SPCI_FID_SERVICE_HANDLE_OPEN) +#define SPCI_SERVICE_HANDLE_CLOSE \ + SPCI_MISC_32 (SPCI_FID_SERVICE_HANDLE_CLOSE) +#define SPCI_SERVICE_REQUEST_BLOCKING_AARCH64 \ + SPCI_MISC_64 (SPCI_FID_SERVICE_REQUEST_BLOCKIN= G) +#define SPCI_SERVICE_REQUEST_START_AARCH64 \ + SPCI_MISC_64 (SPCI_FID_SERVICE_REQUEST_START) +#define SPCI_SERVICE_TUN_REQUEST_BLOCKING_AARCH64 \ + SPCI_TUN_64 (SPCI_FID_SERVICE_TUN_REQUEST_BLOC= KING) + +#pragma pack(1) + +typedef struct { + UINT64 Token; + UINT32 HandleId; + UINT64 SpciCommand; + UINT64 SpciParam1; + UINT64 SpciParam2; + UINT64 SpciParam3; + UINT64 SpciParam4; + UINT64 SpciParam5; +} AMPERE_SPCI_ARGS; + +#pragma pack() + +/** + Set GPIO pins used for PCIe reset. This command + limits the number of GPIO[16:21] for reset purpose. +**/ +VOID +PcieHotPlugSetGpioMap ( + VOID + ); + +/** + Lock current Portmap table. +**/ +VOID +PcieHotPlugSetLockPortMap ( + VOID + ); + +/** + Start Hot plug service. +**/ +VOID +PcieHotPlugSetStart ( + VOID + ); + +/** + Clear current configuration of Portmap table. +**/ +VOID +PcieHotPlugSetClear ( + VOID + ); + +/** + Set configuration for Portmap table. +**/ +VOID +PcieHotPlugSetPortMap ( + VOID + ); + +/** + This function will start Hotplug service after following steps: + - Open handle to make a SPCI call. + - Set GPIO pins for PCIe reset. + - Set configuration for Portmap table. + - Lock current Portmap table. + - Start Hot plug service. + - Close handle. +**/ +VOID +PcieHotPlugStart ( + VOID + ); + +#endif diff --git a/Silicon/Ampere/AmpereSiliconPkg/Include/Library/PcieHotPlugPor= tMapLib.h b/Silicon/Ampere/AmpereSiliconPkg/Include/Library/PcieHotPlugPort= MapLib.h new file mode 100644 index 000000000000..4889f0891c47 --- /dev/null +++ b/Silicon/Ampere/AmpereSiliconPkg/Include/Library/PcieHotPlugPortMapLib= .h @@ -0,0 +1,81 @@ +/** @file + + Copyright (c) 2023, Ampere Computing LLC. All rights reserved.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef PCIE_HOT_PLUG_PORT_MAP_H_ +#define PCIE_HOT_PLUG_PORT_MAP_H_ + +// "PCIe Bifurcation Mapping" spec just reserve 24x48 bytes (48 ports) +#define MAX_NUMBER_PROCESSORS 2 +#define NUMBER_OF_PCIE_PORTS 48 +#define MAX_PORT_MAP_ENTRY (NUMBER_OF_PCIE_PORTS * MAX_NUMBER_PROCESSO= RS) + +// +// - Macro to create value for PCIe Hot Plug configuration from PcieHotPlu= gPortMapEntry structure. +// - Value structure: +// Bit [0:7]: Vport +// Bit [8:11]: Socket +// Bit [12:15]: RcaPort +// Bit [16:19]: RcaSubPort +// Bit [20:23]: PinPort +// Bit [24:31]: I2cAddress +// Bit [32:39]: MuxAddress +// Bit [40:43]: MuxChannel +// Bit [44:51]: GpioResetNumber +// Bit [52:55]: Segment +// Bit [56: 63]: DriveIndexGpioResetNumber +// +#define PCIE_HOT_PLUG_DECODE_VPORT(Value) ((((UINTN)(Value).V= port) & 0xFF) << 0) +#define PCIE_HOT_PLUG_DECODE_SOCKET(Value) ((((UINTN)(Value).S= ocket) & 0x0F) << 8) +#define PCIE_HOT_PLUG_DECODE_RCA_PORT(Value) ((((UINTN)(Value).R= caPort) & 0x0F) << 12) +#define PCIE_HOT_PLUG_DECODE_RCA_SUB_PORT(Value) ((((UINTN)(Value).R= caSubPort) & 0x0F) << 16) +#define PCIE_HOT_PLUG_DECODE_PIN_PORT(Value) ((((UINTN)(Value).P= inPort) & 0x0F) << 20) +#define PCIE_HOT_PLUG_DECODE_I2C_ADDRESS(Value) ((((UINTN)(Value).I= 2cAddress) & 0xFF) << 24) +#define PCIE_HOT_PLUG_DECODE_MUX_ADDRESS(Value) ((((UINTN)(Value).M= uxAddress) & 0xFF) << 32) +#define PCIE_HOT_PLUG_DECODE_MUX_CHANNEL(Value) ((((UINTN)(Value).M= uxChannel) & 0x0F) << 40) +#define PCIE_HOT_PLUG_DECODE_GPIO_RESET_NUMBER(Value) ((((UINTN)(Value).G= pioResetNumber) & 0xFF) << 44) +#define PCIE_HOT_PLUG_DECODE_SEGMENT(Value) ((((UINTN)(Value).S= egment) & 0x0F) << 52) +#define PCIE_HOT_PLUG_DECODE_DRIVE_INDEX(Value) ((((UINTN)(Value).D= riveIndex) & 0xFF) << 56) + +#define PCIE_HOT_PLUG_GET_CONFIG_VALUE(Value) ( \ + PCIE_HOT_PLUG_DECODE_VPORT(Value) | \ + PCIE_HOT_PLUG_DECODE_SOCKET(Value) | \ + PCIE_HOT_PLUG_DECODE_RCA_PORT(Value) | \ + PCIE_HOT_PLUG_DECODE_RCA_SUB_PORT(Value) | \ + PCIE_HOT_PLUG_DECODE_PIN_PORT(Value) | \ + PCIE_HOT_PLUG_DECODE_I2C_ADDRESS(Value) | \ + PCIE_HOT_PLUG_DECODE_MUX_ADDRESS(Value) | \ + PCIE_HOT_PLUG_DECODE_MUX_CHANNEL(Value) | \ + PCIE_HOT_PLUG_DECODE_GPIO_RESET_NUMBER(Value) | \ + PCIE_HOT_PLUG_DECODE_SEGMENT(Value) | \ + PCIE_HOT_PLUG_DECODE_DRIVE_INDEX(Value) \ +) + +#pragma pack(1) + +typedef struct { + UINT8 Vport; + UINT8 Socket; + UINT8 RcaPort; + UINT8 RcaSubPort; + UINT8 PinPort; + UINT8 I2cAddress; + UINT8 MuxAddress; + UINT8 MuxChannel; + UINT8 GpioResetNumber; + UINT8 Segment; + UINT8 DriveIndex; +} PCIE_HOT_PLUG_PORT_MAP_ENTRY; + +typedef struct { + BOOLEAN UseDefaultConfig; + UINT8 PortMap[MAX_PORT_MAP_ENTRY][sizeof (PCIE_HOT_PLUG_PORT_MAP_EN= TRY)]; +} PCIE_HOT_PLUG_PORT_MAP_TABLE; + +#pragma pack() + +#endif diff --git a/Silicon/Ampere/AmpereAltraPkg/Library/PcieHotPlugLib/PcieHotPl= ugLib.c b/Silicon/Ampere/AmpereAltraPkg/Library/PcieHotPlugLib/PcieHotPlugL= ib.c new file mode 100644 index 000000000000..10de5d17d2b9 --- /dev/null +++ b/Silicon/Ampere/AmpereAltraPkg/Library/PcieHotPlugLib/PcieHotPlugLib.c @@ -0,0 +1,397 @@ +/** @file + + Copyright (c) 2023, Ampere Computing LLC. All rights reserved.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + + **/ + +#include + +#include +#include +#include +#include +#include +#include + +#define END_PORT_MAP_ENTRY 0xFF + +// SPM takes up to 4 arguments as value for SPCI call (Args.SpciParam1->Ar= gs.SpciParam4). +#define MAX_MSG_CMD_ARGS 4 + +UINT32 HandleId; + +STATIC +EFI_STATUS +SpciStatusMap ( + UINTN SpciStatus + ) +{ + switch (SpciStatus) { + case SPCI_SUCCESS: + return EFI_SUCCESS; + + case SPCI_NOT_SUPPORTED: + return EFI_UNSUPPORTED; + + case SPCI_INVALID_PARAMETER: + return EFI_INVALID_PARAMETER; + + case SPCI_NO_MEMORY: + return EFI_OUT_OF_RESOURCES; + + case SPCI_BUSY: + case SPCI_QUEUED: + return EFI_NOT_READY; + + case SPCI_DENIED: + return EFI_ACCESS_DENIED; + + case SPCI_NOT_PRESENT: + return EFI_NOT_FOUND; + + default: + return EFI_DEVICE_ERROR; + } +} + +EFI_STATUS +EFIAPI +SpciServiceHandleOpen ( + UINT16 ClientId, + UINT32 *HandleId, + EFI_GUID Guid + ) +{ + ARM_SMC_ARGS SmcArgs; + EFI_STATUS Status; + UINT32 X1; + UINT64 Uuid1, Uuid2, Uuid3, Uuid4; + + if (HandleId =3D=3D NULL) { + DEBUG ((DEBUG_ERROR, "%a HandleId is NULL \n", __func__)); + return EFI_INVALID_PARAMETER; + } + + Uuid1 =3D Guid.Data1; + Uuid2 =3D Guid.Data3 << 16 | Guid.Data2; + Uuid3 =3D Guid.Data4[3] << 24 | Guid.Data4[2] << 16 | Guid.Data4[1] << 8= | Guid.Data4[0]; + Uuid4 =3D Guid.Data4[7] << 24 | Guid.Data4[6] << 16 | Guid.Data4[5] << 8= | Guid.Data4[4]; + + SmcArgs.Arg0 =3D SPCI_SERVICE_HANDLE_OPEN; + SmcArgs.Arg1 =3D Uuid1; + SmcArgs.Arg2 =3D Uuid2; + SmcArgs.Arg3 =3D Uuid3; + SmcArgs.Arg4 =3D Uuid4; + SmcArgs.Arg5 =3D 0; + SmcArgs.Arg6 =3D 0; + SmcArgs.Arg7 =3D ClientId; + ArmCallSmc (&SmcArgs); + + Status =3D SpciStatusMap (SmcArgs.Arg0); + if (EFI_ERROR (Status)) { + return Status; + } + + X1 =3D SmcArgs.Arg1; + + if ((X1 & 0x0000FFFF) !=3D 0) { + DEBUG (( + DEBUG_ERROR, + "%a: SpciServiceHandleOpen returned X1 =3D 0x%08x\n", + __func__, + X1 + )); + return EFI_DEVICE_ERROR; + } + + // Combine of returned handle and clientid + *HandleId =3D (UINT32)X1 | ClientId; + + return EFI_SUCCESS; +} + +EFI_STATUS +EFIAPI +SpciServiceHandleClose ( + UINT32 HandleId + ) +{ + ARM_SMC_ARGS SmcArgs; + EFI_STATUS Status; + + SmcArgs.Arg0 =3D SPCI_SERVICE_HANDLE_CLOSE; + SmcArgs.Arg1 =3D HandleId; + ArmCallSmc (&SmcArgs); + + Status =3D SpciStatusMap (SmcArgs.Arg0); + if (EFI_ERROR (Status)) { + return Status; + } + + return EFI_SUCCESS; +} + +EFI_STATUS +EFIAPI +SpciServiceRequestStart ( + AMPERE_SPCI_ARGS *Args + ) +{ + ARM_SMC_ARGS SmcArgs; + EFI_STATUS Status; + + if (Args =3D=3D NULL) { + DEBUG ((DEBUG_ERROR, "%a: Invalid parameter\n", __func__)); + return EFI_INVALID_PARAMETER; + } + + SmcArgs.Arg0 =3D SPCI_SERVICE_REQUEST_START_AARCH64; + SmcArgs.Arg1 =3D Args->SpciCommand; + SmcArgs.Arg2 =3D Args->SpciParam1; + SmcArgs.Arg3 =3D Args->SpciParam2; + SmcArgs.Arg4 =3D Args->SpciParam3; + SmcArgs.Arg5 =3D Args->SpciParam4; + SmcArgs.Arg6 =3D Args->SpciParam5; + SmcArgs.Arg7 =3D (UINT64)Args->HandleId; + ArmCallSmc (&SmcArgs); + + Status =3D SpciStatusMap (SmcArgs.Arg0); + if (EFI_ERROR (Status)) { + return Status; + } + + // Return Token + Args->Token =3D SmcArgs.Arg1; + + return EFI_SUCCESS; +} + +EFI_STATUS +EFIAPI +SpciServiceRequestBlocking ( + AMPERE_SPCI_ARGS *Args + ) +{ + ARM_SMC_ARGS SmcArgs; + EFI_STATUS Status; + + if (Args =3D=3D NULL) { + DEBUG ((DEBUG_ERROR, "%a: Invalid parameter\n", __func__)); + return EFI_INVALID_PARAMETER; + } + + SmcArgs.Arg0 =3D SPCI_SERVICE_REQUEST_BLOCKING_AARCH64; + SmcArgs.Arg1 =3D Args->SpciCommand; + SmcArgs.Arg2 =3D Args->SpciParam1; + SmcArgs.Arg3 =3D Args->SpciParam2; + SmcArgs.Arg4 =3D Args->SpciParam3; + SmcArgs.Arg5 =3D Args->SpciParam4; + SmcArgs.Arg6 =3D Args->SpciParam5; + SmcArgs.Arg7 =3D (UINT64)Args->HandleId; + ArmCallSmc (&SmcArgs); + + Status =3D SpciStatusMap (SmcArgs.Arg0); + if (EFI_ERROR (Status)) { + return Status; + } + + Args->SpciCommand =3D SmcArgs.Arg1; + Args->SpciParam1 =3D SmcArgs.Arg2; + Args->SpciParam2 =3D SmcArgs.Arg3; + + return EFI_SUCCESS; +} + +/** + Set GPIO pins used for PCIe reset. This command + limits the number of GPIO[16:21] for reset purpose. +**/ +VOID +PcieHotPlugSetGpioMap ( + VOID + ) +{ + AMPERE_SPCI_ARGS Args; + EFI_STATUS Status; + + Args.HandleId =3D HandleId; + Args.SpciCommand =3D PCIE_HOT_PLUG_SPCI_CMD_GPIO_MAP; + Args.SpciParam1 =3D (UINTN)PcdGet8 (PcdPcieHotPlugGpioResetMap); + + Status =3D SpciServiceRequestBlocking (&Args); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "SPM HotPlug GPIO reset map failed. Returned: %r\= n", Status)); + } +} + +/** + Lock current Portmap table. +**/ +VOID +PcieHotPlugSetLockPortMap ( + VOID + ) +{ + AMPERE_SPCI_ARGS Args; + EFI_STATUS Status; + + Args.HandleId =3D HandleId; + Args.SpciCommand =3D PCIE_HOT_PLUG_SPCI_CMD_PORT_MAP_LOCK; + + Status =3D SpciServiceRequestBlocking (&Args); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "SPM HotPlug port map lock failed. Returned: %r\n= ", Status)); + } +} + +/** + Start Hot plug service. +**/ +VOID +PcieHotPlugSetStart ( + VOID + ) +{ + AMPERE_SPCI_ARGS Args; + EFI_STATUS Status; + + Args.HandleId =3D HandleId; + Args.SpciCommand =3D PCIE_HOT_PLUG_SPCI_CMD_START; + + Status =3D SpciServiceRequestBlocking (&Args); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "SPM HotPlug start failed. Returned: %r\n", Statu= s)); + } +} + +/** + Clear current configuration of Portmap table. +**/ +VOID +PcieHotPlugSetClear ( + VOID + ) +{ + AMPERE_SPCI_ARGS Args; + EFI_STATUS Status; + + Args.HandleId =3D HandleId; + Args.SpciCommand =3D PCIE_HOT_PLUG_SPCI_CMD_PORT_MAP_CLR; + + Status =3D SpciServiceRequestBlocking (&Args); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "SPM HotPlug clear port map failed. Returned: %r\= n", Status)); + } +} + +/** + Set configuration for Portmap table. +**/ +VOID +PcieHotPlugSetPortMap ( + VOID + ) +{ + AMPERE_SPCI_ARGS Args; + EFI_STATUS Status; + + PCIE_HOT_PLUG_PORT_MAP_TABLE *PortMapTable; + PCIE_HOT_PLUG_PORT_MAP_ENTRY PortMapEntry; + UINT8 Index; + UINT8 PortMapEntryIndex; + BOOLEAN IsEndPortMapEntry; + UINTN ConfigValue; + UINTN *ConfigLegacy; + + // Retrieves PCD of Portmap table. + PortMapTable =3D (PCIE_HOT_PLUG_PORT_MAP_TABLE *)PcdGetPtr (PcdPcieHotPl= ugPortMapTable); + + // + // Check whether specific platform configuration is used? + // Otherwise, keep default configuration (Mt. Jade 2U). + // + if (!PortMapTable->UseDefaultConfig) { + IsEndPortMapEntry =3D FALSE; + PortMapEntryIndex =3D 0; + + // Clear old Port Map table first. + PcieHotPlugSetClear (); + + while (!IsEndPortMapEntry) { + ZeroMem (&Args, sizeof (Args)); + Args.HandleId =3D HandleId; + Args.SpciCommand =3D PCIE_HOT_PLUG_SPCI_CMD_PORT_MAP_SET; + + // Pointer will get configuration value for Args.SpciParam1->Args.Sp= ciParam5 + ConfigLegacy =3D &Args.SpciParam1; + + for (Index =3D 0; Index < MAX_MSG_CMD_ARGS; Index++) { + PortMapEntry =3D *((PCIE_HOT_PLUG_PORT_MAP_ENTRY *)PortMapTable->= PortMap[PortMapEntryIndex]); + ConfigValue =3D PCIE_HOT_PLUG_GET_CONFIG_VALUE (PortMapEntry); + *ConfigLegacy =3D ConfigValue; + + if (PortMapTable->PortMap[PortMapEntryIndex][0] =3D=3D END_PORT_MA= P_ENTRY) { + IsEndPortMapEntry =3D TRUE; + break; + } + + PortMapEntryIndex++; + ConfigLegacy++; + } + + Status =3D SpciServiceRequestBlocking (&Args); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "SPM HotPlug set port map failed. Returned: %= r\n", Status)); + } + } + } +} + +/** + This function will start Hotplug service after following steps: + - Open handle to make a SPCI call. + - Set GPIO pins for PCIe reset. + - Set configuration for Portmap table. + - Lock current Portmap table. + - Start Hot plug service. + - Close handle. +**/ +VOID +PcieHotPlugStart ( + VOID + ) +{ + EFI_STATUS Status; + + // Open handle + Status =3D SpciServiceHandleOpen (SPCI_CLIENT_ID, &HandleId, gPcieHotPlu= gGuid); + if (EFI_ERROR (Status)) { + DEBUG (( + DEBUG_ERROR, + "SPM failed to return invalid handle. Returned: %r\n", + Status + )); + + return; + } + + // Set GPIO pins for PCIe reset + PcieHotPlugSetGpioMap (); + + // Set Portmap table + PcieHotPlugSetPortMap (); + + // Lock current Portmap table + PcieHotPlugSetLockPortMap (); + + // Start Hot plug service + PcieHotPlugSetStart (); + + // Close handle + Status =3D SpciServiceHandleClose (HandleId); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "SPM HotPlug close handle failed. Returned: %r\n"= , Status)); + } +} --=20 2.39.0 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#104715): https://edk2.groups.io/g/devel/message/104715 Mute This Topic: https://groups.io/mt/98831767/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sun May 19 11:06:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+104716+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+104716+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1683823635317856.4922268355854; Thu, 11 May 2023 09:47:15 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id TVWtYY1788612xkY6nlb4Vgb; Thu, 11 May 2023 09:47:14 -0700 X-Received: from NAM10-BN7-obe.outbound.protection.outlook.com (NAM10-BN7-obe.outbound.protection.outlook.com [40.107.92.107]) by mx.groups.io with SMTP id smtpd.web10.54051.1683792646683036987 for ; Thu, 11 May 2023 01:10:46 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nzQIJs3/1GbokpVqAXenwP9fsY13VHFQDE1K9pPlHZb8WA/BD4xJC/z/XgqbOiZ9GZhePWvCjU4rbbJNNgg6XzHkgQ0kwzcepsY6ZLuh0ak91sY+Dn8u84sA70a5BqlAiTKGtG8OrPEqOpteQe6l6PuFW6IoJgeRy1CPi1VClg+6Zjz9P/XSRMf3q5iikRa6wMI6pmnVoMlxoYBPhlQqPG20qiYvKPDg7goE46udRHv+us84reMfyEB+10J/XVWJnv8dMT6tPKOd5SCWl1Vt4HFEf5YSSTCLEjKaS2AG5PEf3PgznMIYDMrKXLNn18h9BJvN/IIdM++6EQ31nyi/Kg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=hurJoKFOMPNtf+rpMFnBh0GJB+lrOiO3hQFZ00zcp6A=; b=LbyBLJU9W1nzOzzSRF/WSRAi0oEeJXKJ4unN/Rzfsle41tbdvxC+9ytEs07BPyiNvJEKBY1eDCwjqLkNDZIxqYbhwoKBCfGwUKxQzeJJ2uHHhcaMqLF4z3IYwUj3mjzqUCYXmEDcEuAf5gvt2zBT+QdbUekYCF2ci5/XDmQWTrO8ktX7w7wSAQRNQSsf473rNaasXKjDB8vElLGlaWeNgMefui4gtgLXp52GHzkHNoD9OxIeJCS2tgWq4vngqqB6AEA4yhqMV+4eI78+e+n6wUmOU7XIneb5fwfo3n/6SAbeYAR8i+tLAYTKybQPO2yKcHuthPt9CRAAA4YrVFoJ9A== 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 X-Received: from PH0PR01MB8048.prod.exchangelabs.com (2603:10b6:510:280::7) by CY4PR0101MB3144.prod.exchangelabs.com (2603:10b6:910:49::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6340.19; Thu, 11 May 2023 08:10:43 +0000 X-Received: from PH0PR01MB8048.prod.exchangelabs.com ([fe80::bbdb:b58c:140e:c4e1]) by PH0PR01MB8048.prod.exchangelabs.com ([fe80::bbdb:b58c:140e:c4e1%6]) with mapi id 15.20.6387.019; Thu, 11 May 2023 08:10:43 +0000 From: "Minh Nguyen via groups.io" To: devel@edk2.groups.io CC: patches@amperecomputing.com, quic_llindhol@quicinc.com, ardb+tianocore@kernel.org, nhi@os.amperecomputing.com, tinhnguyen@os.amperecomputing.com, Minh Nguyen Subject: [edk2-devel] [edk2-platforms][PATCH 2/6] AmpereAltraPkg: Add Hot Plug Slot Capable during PCIe port initialization Date: Thu, 11 May 2023 15:10:07 +0700 Message-ID: <20230511081011.2692963-3-minhnguyen1@os.amperecomputing.com> In-Reply-To: <20230511081011.2692963-1-minhnguyen1@os.amperecomputing.com> References: <20230511081011.2692963-1-minhnguyen1@os.amperecomputing.com> X-ClientProxiedBy: SI2P153CA0033.APCP153.PROD.OUTLOOK.COM (2603:1096:4:190::21) To PH0PR01MB8048.prod.exchangelabs.com (2603:10b6:510:280::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR01MB8048:EE_|CY4PR0101MB3144:EE_ X-MS-Office365-Filtering-Correlation-Id: 3843cc0b-c27f-4345-6205-08db51f73743 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: 6cBzsFz107svEk4NF1KMoibKIhNa7BLb1VEvXocVh1xZAhfJqpsAM+dgANUs0t0ZX++CbS0/5+wuEYtRtraM5zW5oshe0cx7ib6yaN5Zgoe09WxJl7h8E0W7s5+qEbzpzyVP37tAcuhFlRo4xDvM9+xSSfAg+cSGrSUXJ9Ji/zxhsfOJK8nvkoyZZi5Xx2WzbWerVo8hsDYRMo1ghL5FoMuPaH9fErXQTUhL2fykWSuprKglH6X+JxDW9L3C7XfDfHHVm/YN9rMOOysFpyx4zTpzsKnwXJGlNMEer7CKLb58VJWBZGQm4epFGq6ESmPKjLNTNYQ59lxinVItuxko9VXpj6NP0uWpWhVdjMRlqYEpinlqplPNvjbdN6UT5N4yhIE5tDEXTveXAATw9l2SkyZCSADvzM4D26Fkm7VVeH2WTtr0iQFwV0NC2eZzGDqu5SZlnCww8UHSOuYFAhVQIbdyUswAXNpItvEexFACZambPG5nnsZFFuwP0HCGCgH2ikDfYP29DVK9oTDymop0vsDxDYKA+21oFixtOZsoMjcjoaGYfZ8Uc70EKTSthYhhUg9bmHaPHGwu5CFlCy1gBVpg4vBaX1+M8jXuX3bLAHzPLwr60JpDJryTS0ZWxXnc X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?v8RO+t27XzFXLFUjeorXMHJTSnTMJkqDw9hPcy8gsEWI3Ks5tqY1RDp+EY0D?= =?us-ascii?Q?Hfc1RGz7v2rJ7kfDFmUYZF+gBPVZc3lFgENf/94uLE6/xlr8c2RZ8Whkqudd?= =?us-ascii?Q?thHx7y84SfdJWDkfWmchPBJbf9gPGP+8otmffIZDAvwPXDenb+wY33iCZN9S?= =?us-ascii?Q?MiUXHvJN4oZCnIDyGK6ri7SVeQsNvVaWHOZ8RFSJ967QlPvhtsmBdefK93GW?= =?us-ascii?Q?ZF3qzglIaFA2UzdcBelVRphSuF9bQ7IhG+w/K7qab8FEJZeCj3wF2OWeUTSq?= =?us-ascii?Q?1qrfkcrEuILZtrpN7ySuRfa+ysbZ9JiB9ED883pJLfH8tsmADLLb1UAQk8mA?= =?us-ascii?Q?yftpMfk7x+4F+Ht08vwAKQgCBjPEoJ/6DyVEHLq4jqVi3g/HJYThFb2/vBUa?= =?us-ascii?Q?nBAsROspNFFmGIgMdZBdjfgX01CNes8pBe/4zACjPrJ0xSGpC9OIkoDTxBbX?= =?us-ascii?Q?0DBy1z9r/mGk8LMQx0sd8BpJb5IFCHQU/+vEQf43PJGHgBzqCsYCMWqI/VOa?= =?us-ascii?Q?MggpacMQUDQvUR8L685nJIINb7XRuq3WrrKU0ahkRqTKtMRi+LcpCmkOsvYK?= =?us-ascii?Q?p9mNMgRs+x7h2lPZy6N1V4Gqq/XMV7H4RAg3gyjcCRE/MjnPZF/pRYLk/F8N?= =?us-ascii?Q?NyLXKOM/9fos+Bk3+4BEncZ8Oz8X3iwBmrc+UikIlN8HwLuKc7OaYDTDVKMk?= =?us-ascii?Q?iN0KRe88wq4u7YFetcixuJhxhNpEW6g7H4b/kNvohs/POHrwObw18fvYczwm?= =?us-ascii?Q?OVj1hIlYdz/vlIJUx9ZduA0a27xwBSyXGC09PSn6K2Ifoqsdcxph9p77YadP?= =?us-ascii?Q?9bBPJgeJ9zmzo9OhZ7kQl9uBJlZXyMYjK9DCW01xiAoOepBMeCkfocmDZA9u?= =?us-ascii?Q?vP76uFZLw7bex9Lt4PxAdzHDmiGb6td2ZR2EXEY5o+giLV7aURcOGeiubY5G?= =?us-ascii?Q?13wrVhUdYk4m/O5qu6NrTFjSyqy7olpdJgYEBWMWQlmAZTPV+wyI7NaEaCNz?= =?us-ascii?Q?P53WILsDkbtpeSEVRqxN28nhjQ4rj8lRD/h8iT9U7syxoE5nUKkeh5Lkb6Xh?= =?us-ascii?Q?3iekbBGJh2F0Rsrgqmc3wt/D0VEVc0lG+Gux378FB3LXnb3/74sXXR2wRtZI?= =?us-ascii?Q?7lbGN9lt0FpRJG3rVzWNwE2eQiASyrlyqGLTCrYzvoaXFIjBOC6w38Ql4/7w?= =?us-ascii?Q?Jp0HIMb3K2JIZd6fEpUw32qgWToSo1U2vtc52KxZsZzUzzwkAXyVIw39LZ/f?= =?us-ascii?Q?nYDxP9BO/h3hlJqqxYUoazBRc5OcEkPcY3oAoZ+Z9sxxHowO8IvlAErwU+LP?= =?us-ascii?Q?QIu5oOLNdl4aBOVCK+7+mjYc2jZf3NbYLd2p1dnS+m1iSZs1T8MOE22v5ZOy?= =?us-ascii?Q?MrqRMFpnlCXZ6Jotc1hRDn9CG9dSxdneQpo9MTSP304EUMXl6csPOupQB9t9?= =?us-ascii?Q?wgXM9SPkKlM3WbdHT9K11TtdEkjEAAJ95aEu9OtKUeDzFyJH1qnZXG/zsg4S?= =?us-ascii?Q?t33Mc+snHNCsn8uAw/IC4HRhL7YImRQ+cR3rWZOs+QjZEwEviPRB3rN3ARiQ?= =?us-ascii?Q?hbYA9agHVWVluR3/moYZPN6nhMknNX+ttSu7+6UB0caENtH+4o54TLpfRHd+?= =?us-ascii?Q?47DySwAa5LGczIRoUntdlUeRAEb7skvqXc8nq1a2mLeg?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3843cc0b-c27f-4345-6205-08db51f73743 X-MS-Exchange-CrossTenant-AuthSource: PH0PR01MB8048.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 May 2023 08:10:43.3045 (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: 9Q6TLozgJIebFr3K+51EfnE4n7B/O5kMY83Q0D/cYvm5uJ/CvO+5etJwzDrjZGm3AUJiyAm5d6I3J+q8NIXOfF8mCMDIbENBH7oRV4ap+4QO9WfAryc96hB2j5W4LVRQ X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR0101MB3144 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,minhnguyen1@os.amperecomputing.com X-Gm-Message-State: tZR3u3Hw74djTjHncnbKPVNSx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1683823634; bh=V7LTfbZfTZTF6gg7VHfc7hcHUzxYvdmuaxpBYMrQqlY=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=t6skdGC/REJ8CVN9C/L8dvnhTTpPcB6aM+Cjm1gNyGGMm+k+VHgsfoWeX5jCr+o1B6e tuUy23iimUrrvMlVYzCiMNfU41gXAfJzIDqQxsPB/xt6Ppot+HiYJGYrQdTLfOAUEk/fD RHY73aZk/wSIWgtRQUPEK81IXIpXJxcdnYk= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1683823635603100004 Content-Type: text/plain; charset="utf-8" In order to detect the NVMe after OS boots successfully but that NVMe's not present previously. Hot Plug Slot Capable will help PCI Linux driver to initialize its slot iomem resource which is used for detecting the disk when it's inserted. Signed-off-by: Minh Nguyen --- Silicon/Ampere/AmpereAltraPkg/Library/Ac01PcieLib/PcieCore.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Silicon/Ampere/AmpereAltraPkg/Library/Ac01PcieLib/PcieCore.c b= /Silicon/Ampere/AmpereAltraPkg/Library/Ac01PcieLib/PcieCore.c index f7c8defc1906..c5a299cca6c5 100644 --- a/Silicon/Ampere/AmpereAltraPkg/Library/Ac01PcieLib/PcieCore.c +++ b/Silicon/Ampere/AmpereAltraPkg/Library/Ac01PcieLib/PcieCore.c @@ -1093,6 +1093,11 @@ Ac01PcieCoreSetupRC ( // Program the power limit TargetAddress =3D CfgBase + PCIE_CAPABILITY_BASE + SLOT_CAPABILITIES_R= EG; Val =3D MmioRead32 (TargetAddress); + // In order to detect the NVMe after OS boots successfully but + // that NVMe's not present previously. Hot Plug Slot Capable + // will help PCI Linux driver to initialize its slot iomem resource + // which is used for detecting the disk when it's inserted. + Val =3D SLOT_HPC_SET(Val, 1); Val =3D SLOT_CAP_SLOT_POWER_LIMIT_VALUE_SET (Val, SLOT_POWER_LIMIT_75W= ); MmioWrite32 (TargetAddress, Val); =20 --=20 2.39.0 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#104716): https://edk2.groups.io/g/devel/message/104716 Mute This Topic: https://groups.io/mt/98831768/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sun May 19 11:06:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+104717+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+104717+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 16838236373261020.3233770121275; Thu, 11 May 2023 09:47:17 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id LWxjYY1788612x5c31nzPOnS; Thu, 11 May 2023 09:47:17 -0700 X-Received: from NAM10-BN7-obe.outbound.protection.outlook.com (NAM10-BN7-obe.outbound.protection.outlook.com [40.107.92.138]) by mx.groups.io with SMTP id smtpd.web11.53795.1683792648081336523 for ; Thu, 11 May 2023 01:10:48 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EGBl7TQ3gzjU6+fOlVhEfvnqqcdE0NxpOD2LX2kegXYYJkg1tA2igSQNaJPcvTaEthFQJO5K3WOG+q4sYlfACWeIHp8dX0VhLD2dcCwMwYoCdq/i7BjHwajwGTZjU/yRAISoaih01eg50fJQW/DWNHChQVRKG+MDzrA+XU0c/cH2R2ALKef5XbAMYTNY+U27dtyJxVzGcy0/nqid9xHnkLZhs+lIrHaiOtRSlDLK+3mUwG7kkgplB/nvNdjOwb1tl0eO3EXjD2dyqgteRqkLmxbQHbqiBqb2gh9D6fSzUasDa5AJaEO0StQvDhAYiv6gZWzuy8vCqCRkRMDZo+DJhw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=XFj3rEkwriYe/4lRLCQXuuxm/K1LPDZ85s8shr7ZsMk=; b=bTnHSQCA/IWrOwWoW8/Vek7N+HCnyEEnEsYBdFXG/XxWFUWEY6Brf3UjqsmgBTXXtueMqlrJj2EMdW6Wf9mMttvHYTx117j+0XyQKGpZTX2Kxd05gjCm45eW1IT/sI05XhW0QetoyrecjMCxvqKjCNLkD47zuWZUK6Os7tO+GgObqzLno/6KRC4DRoosJipzo5w2rscWU9U9Qvev86HUQqYYhwMD8EG59tGyA193khg0Gubsy48WVIcrijadCQnep2X/0u9Nz2UGyrAMof5MyOMtNQUyYuJmRSVI3Li2hUVSNiFEmOX7XsVf/btgjxHTNTt2DMPiAWRwNlP8GRtVGw== 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 X-Received: from PH0PR01MB8048.prod.exchangelabs.com (2603:10b6:510:280::7) by CY4PR0101MB3144.prod.exchangelabs.com (2603:10b6:910:49::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6340.19; Thu, 11 May 2023 08:10:45 +0000 X-Received: from PH0PR01MB8048.prod.exchangelabs.com ([fe80::bbdb:b58c:140e:c4e1]) by PH0PR01MB8048.prod.exchangelabs.com ([fe80::bbdb:b58c:140e:c4e1%6]) with mapi id 15.20.6387.019; Thu, 11 May 2023 08:10:45 +0000 From: "Minh Nguyen via groups.io" To: devel@edk2.groups.io CC: patches@amperecomputing.com, quic_llindhol@quicinc.com, ardb+tianocore@kernel.org, nhi@os.amperecomputing.com, tinhnguyen@os.amperecomputing.com, Minh Nguyen Subject: [edk2-devel] [edk2-platforms][PATCH 3/6] AmpereAltraPkg: Change PCIe Amba Link Timeout value Date: Thu, 11 May 2023 15:10:08 +0700 Message-ID: <20230511081011.2692963-4-minhnguyen1@os.amperecomputing.com> In-Reply-To: <20230511081011.2692963-1-minhnguyen1@os.amperecomputing.com> References: <20230511081011.2692963-1-minhnguyen1@os.amperecomputing.com> X-ClientProxiedBy: SI2P153CA0033.APCP153.PROD.OUTLOOK.COM (2603:1096:4:190::21) To PH0PR01MB8048.prod.exchangelabs.com (2603:10b6:510:280::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR01MB8048:EE_|CY4PR0101MB3144:EE_ X-MS-Office365-Filtering-Correlation-Id: 4aba050f-248a-4b1e-c5e5-08db51f738c0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: /zv7wLcyWHzRgj8Slxd2t/2FH5aBslhzDH+NJFcirxiFzbU01NbM3UbPZFbIl/0ccwph9TDPPxUgrCHLxIEYrYTn+bZMEOIUQKFzjvRemKC38/fNkK6AnHTI4Lru1nIaPZx/3Cl0HQGcbFYIu4AzNSLGHf61nVhabHVRgMdHAhEEDZ+kRW8Lv95GIsvS5yWKmeh95mqcmQDFOb1Y+oMwFc2sBL6nbcHpqRssIAfw8WxbTlU5lA0Xwed14WeGvKK4Zi7tenj2wmfo1P2RIdrxOtrx/b7WKPSVnI1an87Tg6MIhHQfolOubZlicK/drx2cJ2sMPJk7QIhQ8lnmjrtxOoGzg4v6bJ93XPTj4LwWhqeRq6Pt3VfsSnqTGjbwnXqMePWmxo463h/TbI+ZHneLy2h5u0Yd6ojqK8E/vDjBEm6rn4CXG6DwWK1G4LBwclSXtydYTAhQTtAEDz3hZLRlI5GsFmmd+//adQ/WmlFaI8/V9IrrNOq0uuQVZ7CXGyU1LMUvnFI052WBSqp3S0LiYwOetwDeMNHAcmQGYiqy+aruBoqKj3XhtrNJkKBna8HWZxQ6b9zdEzxu2zUlkjpmtD+yPklRc0XzzwDCIebfWMezItJ25f03sXFF7LazcH3n X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?UwfXWkW/q6gP7y0O8k8VaN6M2Eq0qAFHya+57BwP+wuVH6Jhq47YIrZzsLfT?= =?us-ascii?Q?t1slE17i4506vQrwz1mceBM/wHKmT40iFth/XggJ4TGMrVWNbLFtqy3wgCdS?= =?us-ascii?Q?VZqCD2rhQBU6QqDKHb8RGvIkHCLSIgIzUpSTlH51VpZcuHLAfQknbcNAVfjA?= =?us-ascii?Q?MDzvkfGj3R8Zghk2miBKv80TmuWmiDQQj6QKJeUrhWLxDpsQf5LPt3nmkjo/?= =?us-ascii?Q?npJ3Sw6lE+u8bRKs9acG/IKq7UvDvGJAWo+U0zERyM1/CQaiO5hdHhi/3pj6?= =?us-ascii?Q?IQhMUdCFaJuTYZS6m4ZCA34GZyG2eeuQI2T8udCl8Tz0KpGsk23kl1IBx09r?= =?us-ascii?Q?V1GiLk5FsgljXKvFw2AmhKGod/crNLcxbmSt9+7ujhy2fHxpC3AxkuRCFwN9?= =?us-ascii?Q?Z/82Bbn77Ruk+1p7CJt0Ci92mynr5/6O7mJMiBHGoPU6yWWMHYNk63YZI7bg?= =?us-ascii?Q?gKCSWKUrBcZ//CniPMPxwj3VqNPYuVAK4E7UJU060GedDC9QvcZbsw/clG71?= =?us-ascii?Q?9nrkc17MbM+2smYLVorDLitS3+50hEaiigKbiI/qi5N01DDzCuPBSfhgSp6O?= =?us-ascii?Q?FsBn/ohDhSu5LXgFIg4AdbN0Onj43QG7ZEqoDdidn1IOD0AqDY04RzuB28Xn?= =?us-ascii?Q?UcAvtW0lfMaaDtWAXaTQyzH+EezTn9ZMEi/PWNiWQ61VltPye9+bEfIQ0S5n?= =?us-ascii?Q?mhaU9Qs9DY95fZ72wn4DX/OmeUQZiQRbcZmzK8Gl+tlRjrVrozX/ZshiJZ1t?= =?us-ascii?Q?d0rNjhCFW56LytmlKso9XVpI7Oxe3gdDH4n6xxTu7ayFpeXrSEaT3Danu6TM?= =?us-ascii?Q?9PJULKd5pupoTPgaesmgR0nLJ/O6LlvJheRrtpjKzAFIOuu7outCtiaUvQYY?= =?us-ascii?Q?JNJMgB/LK5Qv54ge6cdWB2eprbHuVBARLbpklxV0PowJDrEER02TFE9VFeAX?= =?us-ascii?Q?1cDHLRw0ZkNzL0Z62uSUTJjH35aUCiTxjBI2M2VkgwYKhfaa3mEbXjjCeiB8?= =?us-ascii?Q?VjUikboIbijiWby6fRwK6ULZGBpsdcTapONRolfhPCnS4WzduaaeQQlrAj2t?= =?us-ascii?Q?WahFueD1USV4CAnvPf8H4fLVOIkUOwh2IZXOS9+hAfLXxXHlHBTFIzrqjp0D?= =?us-ascii?Q?o2Kt/IHPE2VJ1aHV5VIbMIDbenoZIVJtuCJ0kgtxs7e+uHzjdK+LoZ8+DSqx?= =?us-ascii?Q?ueGJ2It/kI372jjEYQYzsxSf0D2wgapDpUKEntBMEvgWOkXl9h2pX1rxDXR1?= =?us-ascii?Q?OAzYDs2LJE0exLbzXrClT3Tzo/nGS7lhtp8b5tyCWi8inRwGNi7CM1hKAecr?= =?us-ascii?Q?GC98NJQS9j6hOAS/ouaY2+8Wy/M2xz6o2sFn+QS+Vni/q5ODo/hFsodWc63w?= =?us-ascii?Q?f2/Elz/uDiyEUDuUM1gXJwX6rFLGN8t0kDq3Qqgp8yx+ElufekoIglkQ488B?= =?us-ascii?Q?1F2lVWtF7hoptUB1XRWGUV3YZfS+4hWpZOW/9eeAWhqU+QOo6j8Xg96NrafR?= =?us-ascii?Q?4uN6S00ir7W/WCnMOIPHmaUKWJsXbnQ4lJP3scqufwrdqUehVHtwVcqTtc4S?= =?us-ascii?Q?04zPrpNbCzxu6Xr5xPiZR19tFEAPURSNmhx1gktU9+ZxX5gl5GdBoC7Z2T1c?= =?us-ascii?Q?++wUxYeE58u0E67D3xQj4s4zP+Q2rZlNlQCrKGqFvQln?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4aba050f-248a-4b1e-c5e5-08db51f738c0 X-MS-Exchange-CrossTenant-AuthSource: PH0PR01MB8048.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 May 2023 08:10:45.8084 (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: dC3trXGZC4piOwyGs+5BJTTMcwC5KvtcxUl+7YyiDOkB92oLTThQbjbR+uIv8Lzm6LG3cQJtZSbiK5N3kGihh57lumk5C1oKXg/DW6tXv7+f1GyFf7cFw4Wk9k6isj34 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR0101MB3144 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,minhnguyen1@os.amperecomputing.com X-Gm-Message-State: u0axJK3yThlige8oOQ4cdebEx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1683823637; bh=GsG1g8cnnAIJpT0My4s9bv77jSjDyOLcJmG1SQ8/R90=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=FCGVXLvuqu5FT+Q5WZUGe5eV8Cniqp7C9WK1OzLRhU1VPtKr9RJ2rEYzarTJmT1m+pA Of2uNGpmGswKqZI6bArd3YqT+mxPES2Gp7XW8oXv+im7kbZeHejX+uWMq7Xky4rr6iT5h 3pnrsa5Ok1qsiVgUYsBcMwTxKqiDSdavnqc= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1683823637580100025 Content-Type: text/plain; charset="utf-8" As AMBA_LINK_TIMEOUT_OFF spec, it impacts OS Hot Plug removal delay. The greater value the longer delay it is. Per experiments, set it 2 from beginning of Root Port initialization for stable operation. Signed-off-by: Minh Nguyen --- Silicon/Ampere/AmpereAltraPkg/Library/Ac01PcieLib/PcieCore.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Silicon/Ampere/AmpereAltraPkg/Library/Ac01PcieLib/PcieCore.c b= /Silicon/Ampere/AmpereAltraPkg/Library/Ac01PcieLib/PcieCore.c index c5a299cca6c5..d71f56d5fcf1 100644 --- a/Silicon/Ampere/AmpereAltraPkg/Library/Ac01PcieLib/PcieCore.c +++ b/Silicon/Ampere/AmpereAltraPkg/Library/Ac01PcieLib/PcieCore.c @@ -1159,8 +1159,12 @@ Ac01PcieCoreSetupRC ( } } =20 - // Link timeout after 1ms - SetLinkTimeout (RootComplex, PcieIndex, 1); + // + // As AMBA_LINK_TIMEOUT_OFF spec, it impacts OS HP removal delay. + // The greater value the longer delay it is. Per discussion, + // set it 2 from beginning of RP initialization. + // + SetLinkTimeout (RootComplex, PcieIndex, 2); =20 DisableCompletionTimeOut (RootComplex, PcieIndex, TRUE); =20 --=20 2.39.0 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#104717): https://edk2.groups.io/g/devel/message/104717 Mute This Topic: https://groups.io/mt/98831769/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sun May 19 11:06:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+104718+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+104718+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 168382363652984.54772055243643; Thu, 11 May 2023 09:47:16 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id d4SBYY1788612x3TTaO22zue; Thu, 11 May 2023 09:47:16 -0700 X-Received: from NAM12-DM6-obe.outbound.protection.outlook.com (NAM12-DM6-obe.outbound.protection.outlook.com [40.107.243.126]) by mx.groups.io with SMTP id smtpd.web10.54052.1683792653716213923 for ; Thu, 11 May 2023 01:10:54 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gn0U6q66HexwtFVdVZdDUU7okD8J+hZ6Sj4dfjB7Hw+nwYiKoYF+jMUwhou2g6+aIhjha3uIlHLBY9lGHybF3ciyEnXrh7DNtcxKUC63OrLZZM+ELew/Z2GqRgpQ1rxxwUdRF3jX9zfBLHaZrmmlcdD8RPWlf3rcVyGP5TjLZ5aN279w0H3BsdDIIcDyZem+CexHVvtjyitvhtqDeqHZnPfbi77pl0MQ0RbfIbBmVN8dLJyS3KPQ+NVAoLuWvNooz0Kqlp41/GqWJ9wljyKjj4h85a7UYHZp1MFEVH5QZz0NXJG5GTMXQLdM0Ny8Rf+yaz2SPj7Ub04JF8v4azSdaQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=is7W9/6fK126QGO9flYvbZoSpWPAjn7JRDhxHJQSqsg=; b=Aph6eAS5IkzsIOr5gjjAVtfPtT8hEG2xYOxHn2dSQ2N1Go0bk1ONRFsSZECQ84zhBvlWhT/26VDDy9iq23QfUKyrRRQU82qML1kUWbEiz+xWuNa4K5Sh4UBkyRoTZdRsL8aOzwj/Rt4+NxAe8RqnjWHh7Z8mpem8+oEu85+f1VrdItf4WIiQKUaE8VRnPJZ5JcpOQJixj1NbPsv90467KSCHTVQNdlbiY8qINt3OlXWLKK00hqJ3FxUSRoRh1xrEbeiI9sRQ0O8jiNxMb3ENSdCYR+rFAwrsEv5yX1x9GVWpd50VlPFjADwUTXesLrsfjD4HI0aT/CtqzxHAcnd/cw== 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 X-Received: from PH0PR01MB8048.prod.exchangelabs.com (2603:10b6:510:280::7) by CY4PR0101MB3144.prod.exchangelabs.com (2603:10b6:910:49::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6340.19; Thu, 11 May 2023 08:10:48 +0000 X-Received: from PH0PR01MB8048.prod.exchangelabs.com ([fe80::bbdb:b58c:140e:c4e1]) by PH0PR01MB8048.prod.exchangelabs.com ([fe80::bbdb:b58c:140e:c4e1%6]) with mapi id 15.20.6387.019; Thu, 11 May 2023 08:10:48 +0000 From: "Minh Nguyen via groups.io" To: devel@edk2.groups.io CC: patches@amperecomputing.com, quic_llindhol@quicinc.com, ardb+tianocore@kernel.org, nhi@os.amperecomputing.com, tinhnguyen@os.amperecomputing.com, Vu Nguyen , Minh Nguyen Subject: [edk2-devel] [edk2-platforms][PATCH 4/6] JadePkg: Support ACPI tables for Hot Plug of Ampere Altra Date: Thu, 11 May 2023 15:10:09 +0700 Message-ID: <20230511081011.2692963-5-minhnguyen1@os.amperecomputing.com> In-Reply-To: <20230511081011.2692963-1-minhnguyen1@os.amperecomputing.com> References: <20230511081011.2692963-1-minhnguyen1@os.amperecomputing.com> X-ClientProxiedBy: SI2P153CA0033.APCP153.PROD.OUTLOOK.COM (2603:1096:4:190::21) To PH0PR01MB8048.prod.exchangelabs.com (2603:10b6:510:280::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR01MB8048:EE_|CY4PR0101MB3144:EE_ X-MS-Office365-Filtering-Correlation-Id: 17a432c6-ceee-464e-2a37-08db51f73a5d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: RDtQB5Lxm5xPeY09kD3ubanLx/ATgQvD4NsjBAoRi8yI3JWVVPrh/k61VVcjxb+tfKYdLm8z7sLNgTBMYLcuHGah9rTlF3GgICCI7c3Ju9U1vn4lhZguZxRcqa6jc4A97gLR1RSkJwQ+hfYwt7npEsO1YTW/2qvHguLSUhaArxq9MKGOOCLFoBwhEmpAwm7Q/PPHmOJBgMXAzgYz4+OYdqHo1qGsmP+yJ7/lc7Tqrl4JPyYZTtOraDtCmdeTZwMUQDVmJblWIH67PEEetjQsZgWbKhe6aNWC8SJd0MuNlgYvWm389+CVe3RDOe8feRdQ+AJGYXPqMY60EWv3wbH4b3t6MIEYSiYRORQ/RLr7Lkhmjp7Y+8rJW0q60jYXsP+9Ddd8G/OPEcmaiG6ZvdPMw4GobDrknyIr8PcV0qMtRUjS5bVeHcO3oS6FwfgmGs7ylXHJJPW+gTn6bp0sD5kwYrnqvnhE4prrBW5SSfrrKCDCbyGgmvkfemWCytbiq7ntFd0A515dojHA87GPg9bXalPba7Eyt2tK9Nkwcso2zGBkPDp7AKX13FKwrimCMb13MZZr4pn6UAOFyhPyRBTULzrkQ9LlDqtpkz5Xe+HLtX/CCGbPqogy2evABsCYzGB+ X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?aa6klWTXx2Icw+B+aN8OWsrtbUocpZPJGkT1G6thB4MjsF0bzYFfSBZsLL/G?= =?us-ascii?Q?GZ/RoOeOqeIF8BkFsV+kZyFWHgrZLXSVweXYFx1+q+Nrujt6DnjkMicJvdK/?= =?us-ascii?Q?xkVIfrdAsNd7bf/CMibH6mzfjK4WC+CAgynSSiNM9whPNZgGVOnQhmC5T9pW?= =?us-ascii?Q?U92DsmZn+2ataIImWta5VrDEKuRhHokl8blHLuv9cj5GIS1izBUzO0g2T//p?= =?us-ascii?Q?JyBILOROq+1sZbA2tEPu7Xfju1xvUjY7Nn3IryY24RY7k72j21pxz2zhuir4?= =?us-ascii?Q?IZei7pGbfe2MEaltt5oD0LgxXowlyqlRK4+d8xCvH53qyfE2yC1FvSyAOMjF?= =?us-ascii?Q?yDkR/J7CDJAgePNtlcAztDnGkX9F/KYBgyLGlqkm2J8NSk3DyOcCgazhcw59?= =?us-ascii?Q?k3ZKa9BhPdWg4KEgtMlZIcG9YbG5VoNcsThcGMv0MinepKGYEXoM/RfDnd45?= =?us-ascii?Q?6bArl7ssgyAhuNNKDIamCko+mXyEThekIVxAPa6a2OwIn2S8p4STb8fsjW+M?= =?us-ascii?Q?pKYt0ps0vcKDcfIWVeLzQhd/oGeTb78JEIuyZ3N6OGgjUAVLS2UuGwK47UEt?= =?us-ascii?Q?hCLvu6sb7mFO9zuC+RgQFIcmguTwlCrwQFftqfp61ZcmvnsFNg8H1nPtQlHi?= =?us-ascii?Q?3KudT0lh5+tVuHXjBd9H38Lv24724cqCFD0TM/iEn7ot2zLzO9VqoblU7rqo?= =?us-ascii?Q?+zPhGhLrSLPag6zPj4e/GlXjCueIpoePcJr6W8AKsABlNhSDznj0LpIVqlCN?= =?us-ascii?Q?8MZkxy7fY+1CRR8beJHKh5vM8799WEZhc4b21SBvgvATlFdqrXc0ahuB7Qkp?= =?us-ascii?Q?MJiV6YvhtwM9mpiEHk9m1bb+G5weBzgEVsh7J0AzrZaGcotOk2sTnCjW/LbJ?= =?us-ascii?Q?+8X2ZJ4TdONKwUBMjCU6c5A17sl0QEcLDPUkjLc8Zs4SVUB+n6FO6qyPfHB/?= =?us-ascii?Q?Ob6F6Ssj8xs/4nn3y72DgYipwoqqKJ1hzs9yGiC9VYucM73JNBwonMdZ35LF?= =?us-ascii?Q?lH0cT5JWmFyB3Nvy5cXWN1CKn/DYafwkNXNEjAdRbo8nz6EyCFx7UV9Btt2r?= =?us-ascii?Q?b/YfFbqogLcyy7bl6AQB70XIi/TyZkFJYA+8H5yHk+c37jvg3jm6t1Pqs4fp?= =?us-ascii?Q?Hkwdkk8q18n5sZPD6sTiGQofFtLjXqu+0ct8t9wX+Xoj3Ym87Nij1U1O6kKl?= =?us-ascii?Q?Kwq2e9y2hiDWmMeX4pwXjWp1LZklcldCCReitfqJCwHMSenaIcFeUGqYCKNf?= =?us-ascii?Q?ZjTjKxVnLZ1FyBRmPQ58x8qLIJMiyvmtyn0lKOosVbZ36/B3zVJKcAN4pfa4?= =?us-ascii?Q?IU6KXcXDrRpAfBZqJDJjDgb/YyGIaKEGgj4uN2SOLa/xsoMz7RQJt4eO+1O3?= =?us-ascii?Q?kyPpUyHCNaEqy5EqZ3UMkTNsEiSH+zLGSR2qryixJv4H/gO3dozfa2CYgvQj?= =?us-ascii?Q?+tSMfOoaH5FakCSIGkqNEm7gZLKR8b1dfFExpVNslfnfRsASmxN8VuLSWRHi?= =?us-ascii?Q?GBfYF2qeJ1Th/8noodCUyAvOPppV8Uov6dzaq4KMuZVRN4AeBzFMhLCcvSF4?= =?us-ascii?Q?lxYsuDZGKVHeK7BpWLbJnG1+ySixAOFfkLop954dyr4WhwJtltdho2xgNnhU?= =?us-ascii?Q?8R4EXYQex/2b7TvSK1BTQpB5NREXlYPRx0HaXwHwA0w+?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 17a432c6-ceee-464e-2a37-08db51f73a5d X-MS-Exchange-CrossTenant-AuthSource: PH0PR01MB8048.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 May 2023 08:10:48.5577 (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: UKOGbkd9oVnNFlzZRwfs7wXt4l8J/1CDeLdNIqFT+R3UvrynIRUGArbPtz+zcvbVL4RvwJ9pGiS/DPD8OYb/GrlBbwG9o/xvq7h4pQAglaIMB5yWuRjsPWSTQdq/RUS/ X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR0101MB3144 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,minhnguyen1@os.amperecomputing.com X-Gm-Message-State: hfdLmRKbRzYyTucPWwRE4yKhx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1683823636; bh=I+IpancKQHpSdNJpR2iKUZH2Gh5FjvL8Y7IAT5VO3iQ=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=pRrMUkbWp+hcThSUwoau7mIswPi60zp26seJGwM2+/hGYqhrxjg5aS3mzdHvnExZfVT yH0SDjHwow402CCGwvPS3Af5dsaNfJ2PSAZi+btku0JsiV8GzOuRWPYkLgEld3Ck1TbGY EyWQR3dzArnMxBoE1Zt6i7veTmKeI/k4dHc= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1683823637409100023 Content-Type: text/plain; charset="utf-8" From: Vu Nguyen This adds necessary changes of ACPI tables and defines the memory region between OS and Trusted Firmware-A for supporting Hot Plug of Ampere Altra. Signed-off-by: Minh Nguyen --- Platform/Ampere/JadePkg/AcpiTables/Dsdt.asl | 499 ++++++++- Platform/Ampere/JadePkg/AcpiTables/MHPP.asi | 127 +++ Platform/Ampere/JadePkg/AcpiTables/PCI-S0.asi | 548 +++++++++- Platform/Ampere/JadePkg/AcpiTables/PCI-S1.asi | 1074 +++++++++++++++++++- 4 files changed, 2245 insertions(+), 3 deletions(-) diff --git a/Platform/Ampere/JadePkg/AcpiTables/Dsdt.asl b/Platform/Ampere/= JadePkg/AcpiTables/Dsdt.asl index d7d2df8c3dce..9ee215a26a09 100644 --- a/Platform/Ampere/JadePkg/AcpiTables/Dsdt.asl +++ b/Platform/Ampere/JadePkg/AcpiTables/Dsdt.asl @@ -1,6 +1,6 @@ /** @file =20 - Copyright (c) 2020 - 2021, Ampere Computing LLC. All rights reserved.
+ Copyright (c) 2020 - 2023, Ampere Computing LLC. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -11,6 +11,9 @@ DefinitionBlock("Dsdt.aml", "DSDT", 0x02, "Ampere", "Jade= ", 1) { // Board Model Name(\BDMD, "Jade Board") Name(AERF, 0) // PCIe AER Firmware-First + + Include ("MHPP.asi") + Scope(\_SB) { =20 // @@ -181,12 +184,506 @@ DefinitionBlock("Dsdt.aml", "DSDT", 0x02, "Ampere", = "Jade", 1) { } Name(_CRS, ResourceTemplate () { Interrupt(ResourceConsumer, Level, ActiveHigh, Exclusive) { 84 }= // GHES + Interrupt(ResourceConsumer, Level, ActiveHigh, Exclusive) { 44 }= // PCIe Hot Plug Doorbell Insertion & Ejection (DBNS4 -> GIC-IRQS44) }) + + // @DBN4 agent base address for HP PCIe insertion/ejection event: = 0x1000.0054.4000 + OperationRegion(DBN4, SystemMemory, 0x100000544010, 20) + Field (DBN4, DWordAcc, NoLock, Preserve) { + DOUT, 32, // event and PCIe port information at offset 0x10 + offset (0x10), + STA4, 32, // interrupt status at offset 0x20 + } + Method(_EVT, 1, Serialized) { Switch (ToInteger(Arg0)) { Case (84) { // GHES interrupt Notify (HED0, 0x80) } + + Case (44) { // doorbell notification (Insertion/ejection) + local0 =3D DOUT & 0x00FF0000 + if (local0 =3D=3D 0x00010000) { + local0 =3D STA4 & 0xFFFFFFFF + if (local0) { + Store(local0, STA4) // clear interrupt + } + local0 =3D A120 & 0xFF000000 + if ((local0 =3D=3D 0x01000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIA.P2P1, 1) // insertion action + } + local0 =3D A121 & 0xFF000000 + if ((local0 =3D=3D 0x01000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIA.P2P2, 1) // insertion action + } + local0 =3D A122 & 0xFF000000 + if ((local0 =3D=3D 0x01000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIA.P2P3, 1) // insertion action + } + local0 =3D A123 & 0xFF000000 + if ((local0 =3D=3D 0x01000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIA.P2P4, 1) // insertion action + } + local0 =3D B000 & 0xFF000000 + if ((local0 =3D=3D 0x01000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCI4.P2P1, 1) // insertion action + } + local0 =3D B002 & 0xFF000000 + if ((local0 =3D=3D 0x01000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCI4.P2P3, 1) // insertion action + } + local0 =3D B004 & 0xFF000000 + if ((local0 =3D=3D 0x01000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCI4.P2P5, 1) // insertion action + } + local0 =3D B006 & 0xFF000000 + if ((local0 =3D=3D 0x01000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCI4.P2P7, 1) // insertion action + } + local0 =3D B010 & 0xFF000000 + if ((local0 =3D=3D 0x01000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCI5.P2P1, 1) // insertion action + } + local0 =3D B012 & 0xFF000000 + if ((local0 =3D=3D 0x01000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCI5.P2P3, 1) // insertion action + } + local0 =3D B014 & 0xFF000000 + if ((local0 =3D=3D 0x01000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCI5.P2P5, 1) // insertion action + } + local0 =3D B016 & 0xFF000000 + if ((local0 =3D=3D 0x01000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCI5.P2P7, 1) // insertion action + } + local0 =3D B104 & 0xFF000000 + if ((local0 =3D=3D 0x01000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIC.P2P5, 1) // insertion action + } + local0 =3D B106 & 0xFF000000 + if ((local0 =3D=3D 0x01000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIC.P2P7, 1) // insertion action + } + local0 =3D B110 & 0xFF000000 + if ((local0 =3D=3D 0x01000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCID.P2P1, 1) // insertion action + } + local0 =3D B112 & 0xFF000000 + if ((local0 =3D=3D 0x01000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCID.P2P3, 1) // insertion action + } + local0 =3D B120 & 0xFF000000 + if ((local0 =3D=3D 0x01000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIE.P2P1, 1) // insertion action + } + local0 =3D B122 & 0xFF000000 + if ((local0 =3D=3D 0x01000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIE.P2P3, 1) // insertion action + } + local0 =3D B124 & 0xFF000000 + if ((local0 =3D=3D 0x01000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIE.P2P5, 1) // insertion action + } + local0 =3D B126 & 0xFF000000 + if ((local0 =3D=3D 0x01000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIE.P2P7, 1) // insertion action + } + local0 =3D B130 & 0xFF000000 + if ((local0 =3D=3D 0x01000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIF.P2P1, 1) // insertion action + } + local0 =3D B132 & 0xFF000000 + if ((local0 =3D=3D 0x01000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIF.P2P3, 1) // insertion action + } + local0 =3D B134 & 0xFF000000 + if ((local0 =3D=3D 0x01000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIF.P2P5, 1) // insertion action + } + local0 =3D B136 & 0xFF000000 + if ((local0 =3D=3D 0x01000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIF.P2P7, 1) // insertion action + } + } + elseif (local0 =3D=3D 0x00000000) { + local0 =3D STA4 & 0xFFFFFFFF + if (local0) { + Store(local0, STA4) // clear interrupt + } + local0 =3D A120 & 0xFF000000 + if (local0 =3D=3D 0x00000000) { + Notify (\_SB.PCIA.P2P1, 1) // ejection action + A120 =3D 0x10000201 // inprogress remove + } + local0 =3D A121 & 0xFF000000 + if (local0 =3D=3D 0x00000000) { + Notify (\_SB.PCIA.P2P2, 1) // ejection action + A121 =3D 0x10010201 // inprogress remove + } + local0 =3D A122 & 0xFF000000 + if (local0 =3D=3D 0x00000000) { + Notify (\_SB.PCIA.P2P3, 1) // ejection action + A122 =3D 0x10020201 // inprogress remove + } + local0 =3D A123 & 0xFF000000 + if (local0 =3D=3D 0x00000000) { + Notify (\_SB.PCIA.P2P4, 1) // ejection action + A123 =3D 0x10030201 // inprogress remove + } + local0 =3D B000 & 0xFF000000 + if (local0 =3D=3D 0x00000000) { + Notify (\_SB.PCI4.P2P1, 1) // ejection action + B000 =3D 0x10000400 // inprogress remove + } + local0 =3D B002 & 0xFF000000 + if (local0 =3D=3D 0x00000000) { + Notify (\_SB.PCI4.P2P3, 1) // ejection action + B002 =3D 0x10020400 // inprogress remove + } + local0 =3D B004 & 0xFF000000 + if (local0 =3D=3D 0x00000000) { + Notify (\_SB.PCI4.P2P5, 1) // ejection action + B004 =3D 0x10040400 // inprogress remove + } + local0 =3D B006 & 0xFF000000 + if (local0 =3D=3D 0x00000000) { + Notify (\_SB.PCI4.P2P7, 1) // ejection action + B006 =3D 0x10060400 // inprogress remove + } + local0 =3D B010 & 0xFF000000 + if (local0 =3D=3D 0x00000000) { + Notify (\_SB.PCI5.P2P1, 1) // ejection action + B010 =3D 0x10000500 // inprogress remove + } + local0 =3D B012 & 0xFF000000 + if (local0 =3D=3D 0x00000000) { + Notify (\_SB.PCI5.P2P3, 1) // ejection action + B012 =3D 0x10020500 // inprogress remove + } + local0 =3D B014 & 0xFF000000 + if (local0 =3D=3D 0x00000000) { + Notify (\_SB.PCI5.P2P5, 1) // ejection action + B014 =3D 0x10040500 // inprogress remove + } + local0 =3D B016 & 0xFF000000 + if (local0 =3D=3D 0x00000000) { + Notify (\_SB.PCI5.P2P7, 1) // ejection action + B016 =3D 0x10060500 // inprogress remove + } + local0 =3D B104 & 0xFF000000 + if (local0 =3D=3D 0x00000000) { + Notify (\_SB.PCIC.P2P5, 1) // ejection action + B104 =3D 0x10040401 // inprogress remove + } + local0 =3D B106 & 0xFF000000 + if (local0 =3D=3D 0x00000000) { + Notify (\_SB.PCIC.P2P7, 1) // ejection action + B106 =3D 0x10060401 // inprogress remove + } + local0 =3D B110 & 0xFF000000 + if (local0 =3D=3D 0x00000000) { + Notify (\_SB.PCID.P2P1, 1) // ejection action + B110 =3D 0x10000501 // inprogress remove + } + local0 =3D B112 & 0xFF000000 + if (local0 =3D=3D 0x00000000) { + Notify (\_SB.PCID.P2P3, 1) // ejection action + B112 =3D 0x10020501 // inprogress remove + } + local0 =3D B120 & 0xFF000000 + if (local0 =3D=3D 0x00000000) { + Notify (\_SB.PCIE.P2P1, 1) // ejection action + B120 =3D 0x10000601 // inprogress remove + } + local0 =3D B122 & 0xFF000000 + if (local0 =3D=3D 0x00000000) { + Notify (\_SB.PCIE.P2P3, 1) // ejection action + B122 =3D 0x10020601 // inprogress remove + } + local0 =3D B124 & 0xFF000000 + if (local0 =3D=3D 0x00000000) { + Notify (\_SB.PCIE.P2P5, 1) // ejection action + B124 =3D 0x10040601 // inprogress remove + } + local0 =3D B126 & 0xFF000000 + if (local0 =3D=3D 0x00000000) { + Notify (\_SB.PCIE.P2P7, 1) // ejection action + B126 =3D 0x10060601 // inprogress remove + } + local0 =3D B130 & 0xFF000000 + if (local0 =3D=3D 0x00000000) { + Notify (\_SB.PCIF.P2P1, 1) // ejection action + B130 =3D 0x10000701 // inprogress remove + } + local0 =3D B132 & 0xFF000000 + if (local0 =3D=3D 0x00000000) { + Notify (\_SB.PCIF.P2P3, 1) // ejection action + B132 =3D 0x10020701 // inprogress remove + } + local0 =3D B134 & 0xFF000000 + if (local0 =3D=3D 0x00000000) { + Notify (\_SB.PCIF.P2P5, 1) // ejection action + B134 =3D 0x10040701 // inprogress remove + } + local0 =3D B136 & 0xFF000000 + if (local0 =3D=3D 0x00000000) { + Notify (\_SB.PCIF.P2P7, 1) // ejection action + B136 =3D 0x10060701 // inprogress remove + } + } + elseif (local0 =3D=3D 0x00020000) { // is either unstable li= nk or too fast insertion? + local0 =3D STA4 & 0xFFFFFFFF + if (local0) { + Store(local0, STA4) // clear interrupt + } + local0 =3D A120 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIA.P2P1, 3) // force remove bridge port a= nd port itself + Notify (\_SB.PCIA.P2P1, 1) // insertion action + } + local0 =3D A121 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIA.P2P2, 3) // force remove bridge port a= nd port itself + Notify (\_SB.PCIA.P2P2, 1) // insertion action + } + local0 =3D A122 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIA.P2P3, 3) // force remove bridge port a= nd port itself + Notify (\_SB.PCIA.P2P3, 1) // insertion action + } + local0 =3D A123 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIA.P2P4, 3) // force remove bridge port a= nd port itself + Notify (\_SB.PCIA.P2P4, 1) // insertion action + } + local0 =3D B000 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCI4.P2P1, 3) // force remove bridge port a= nd port itself + Notify (\_SB.PCI4.P2P1, 1) // insertion action + } + local0 =3D B002 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCI4.P2P3, 3) // force remove bridge port a= nd port itself + Notify (\_SB.PCI4.P2P3, 1) // insertion action + } + local0 =3D B004 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCI4.P2P5, 3) // force remove bridge port a= nd port itself + Notify (\_SB.PCI4.P2P5, 1) // insertion action + } + local0 =3D B006 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCI4.P2P7, 3) // force remove bridge port a= nd port itself + Notify (\_SB.PCI4.P2P7, 1) // insertion action + } + local0 =3D B010 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCI5.P2P1, 3) // force remove bridge port a= nd port itself + Notify (\_SB.PCI5.P2P1, 1) // insertion action + } + local0 =3D B012 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCI5.P2P3, 3) // force remove bridge port a= nd port itself + Notify (\_SB.PCI5.P2P3, 1) // insertion action + } + local0 =3D B014 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCI5.P2P5, 3) // force remove bridge port a= nd port itself + Notify (\_SB.PCI5.P2P5, 1) // insertion action + } + local0 =3D B016 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCI5.P2P7, 3) // force remove bridge port a= nd port itself + Notify (\_SB.PCI5.P2P7, 1) // insertion action + } + local0 =3D B104 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIC.P2P5, 3) // force remove bridge port a= nd port itself + Notify (\_SB.PCIC.P2P5, 1) // insertion action + } + local0 =3D B106 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIC.P2P7, 3) // force remove bridge port a= nd port itself + Notify (\_SB.PCIC.P2P7, 1) // insertion action + } + local0 =3D B110 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCID.P2P1, 3) // force remove bridge port a= nd port itself + Notify (\_SB.PCID.P2P1, 1) // insertion action + } + local0 =3D B112 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCID.P2P3, 3) // force remove bridge port a= nd port itself + Notify (\_SB.PCID.P2P3, 1) // insertion action + } + local0 =3D B120 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIE.P2P1, 3) // force remove bridge port a= nd port itself + Notify (\_SB.PCIE.P2P1, 1) // insertion action + } + local0 =3D B122 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIE.P2P3, 3) // force remove bridge port a= nd port itself + Notify (\_SB.PCIE.P2P3, 1) // insertion action + } + local0 =3D B124 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIE.P2P5, 3) // force remove bridge port a= nd port itself + Notify (\_SB.PCIE.P2P5, 1) // insertion action + } + local0 =3D B126 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIE.P2P7, 3) // force remove bridge port a= nd port itself + Notify (\_SB.PCIE.P2P7, 1) // insertion action + } + local0 =3D B130 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIF.P2P1, 3) // force remove bridge port a= nd port itself + Notify (\_SB.PCIF.P2P1, 1) // insertion action + } + local0 =3D B132 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIF.P2P3, 3) // force remove bridge port a= nd port itself + Notify (\_SB.PCIF.P2P3, 1) // insertion action + } + local0 =3D B134 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIF.P2P5, 3) // force remove bridge port a= nd port itself + Notify (\_SB.PCIF.P2P5, 1) // insertion action + } + local0 =3D B136 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIF.P2P7, 3) // force remove bridge port a= nd port itself + Notify (\_SB.PCIF.P2P7, 1) // insertion action + } + } + elseif (local0 =3D=3D 0x00030000) { // got incomplete remove= before? + local0 =3D STA4 & 0xFFFFFFFF + if (local0) { + Store(local0, STA4) // clear interrupt + } + local0 =3D A120 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIA.P2P1.S0F0, 3) // remove port itself + Notify (\_SB.PCIA.P2P1, 1) // insertion action + } + local0 =3D A121 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIA.P2P2.S0F0, 3) // remove port itself + Notify (\_SB.PCIA.P2P2, 1) // insertion action + } + local0 =3D A122 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIA.P2P3.S0F0, 3) // remove port itself + Notify (\_SB.PCIA.P2P3, 1) // insertion action + } + local0 =3D A123 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIA.P2P4.S0F0, 3) // remove port itself + Notify (\_SB.PCIA.P2P4, 1) // insertion action + } + local0 =3D B000 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCI4.P2P1.S0F0, 3) // remove port itself + Notify (\_SB.PCI4.P2P1, 1) // insertion action + } + local0 =3D B002 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCI4.P2P3.S0F0, 3) // remove port itself + Notify (\_SB.PCI4.P2P3, 1) // insertion action + } + local0 =3D B004 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCI4.P2P5.S0F0, 3) // remove port itself + Notify (\_SB.PCI4.P2P5, 1) // insertion action + } + local0 =3D B006 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCI4.P2P7.S0F0, 3) // remove port itself + Notify (\_SB.PCI4.P2P7, 1) // insertion action + } + local0 =3D B010 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCI5.P2P1.S0F0, 3) // remove port itself + Notify (\_SB.PCI5.P2P1, 1) // insertion action + } + local0 =3D B012 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCI5.P2P3.S0F0, 3) // remove port itself + Notify (\_SB.PCI5.P2P3, 1) // insertion action + } + local0 =3D B014 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCI5.P2P5.S0F0, 3) // remove port itself + Notify (\_SB.PCI5.P2P5, 1) // insertion action + } + local0 =3D B016 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCI5.P2P7.S0F0, 3) // remove port itself + Notify (\_SB.PCI5.P2P7, 1) // insertion action + } + local0 =3D B104 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIC.P2P5.S0F0, 3) // remove port itself + Notify (\_SB.PCIC.P2P5, 1) // insertion action + } + local0 =3D B106 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIC.P2P7.S0F0, 3) // remove port itself + Notify (\_SB.PCIC.P2P7, 1) // insertion action + } + local0 =3D B110 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCID.P2P1.S0F0, 3) // remove port itself + Notify (\_SB.PCID.P2P1, 1) // insertion action + } + local0 =3D B112 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCID.P2P3.S0F0, 3) // remove port itself + Notify (\_SB.PCID.P2P3, 1) // insertion action + } + local0 =3D B120 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIE.P2P1.S0F0, 3) // remove port itself + Notify (\_SB.PCIE.P2P1, 1) // insertion action + } + local0 =3D B122 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIE.P2P3.S0F0, 3) // remove port itself + Notify (\_SB.PCIE.P2P3, 1) // insertion action + } + local0 =3D B124 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIE.P2P5.S0F0, 3) // remove port itself + Notify (\_SB.PCIE.P2P5, 1) // insertion action + } + local0 =3D B126 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIE.P2P7.S0F0, 3) // remove port itself + Notify (\_SB.PCIE.P2P7, 1) // insertion action + } + local0 =3D B130 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIF.P2P1.S0F0, 3) // remove port itself + Notify (\_SB.PCIF.P2P1, 1) // insertion action + } + local0 =3D B132 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIF.P2P3.S0F0, 3) // remove port itself + Notify (\_SB.PCIF.P2P3, 1) // insertion action + } + local0 =3D B134 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIF.P2P5.S0F0, 3) // remove port itself + Notify (\_SB.PCIF.P2P5, 1) // insertion action + } + local0 =3D B136 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIF.P2P7.S0F0, 3) // remove port itself + Notify (\_SB.PCIF.P2P7, 1) // insertion action + } + } + } } } } diff --git a/Platform/Ampere/JadePkg/AcpiTables/MHPP.asi b/Platform/Ampere/= JadePkg/AcpiTables/MHPP.asi new file mode 100644 index 000000000000..27987b7c7489 --- /dev/null +++ b/Platform/Ampere/JadePkg/AcpiTables/MHPP.asi @@ -0,0 +1,127 @@ +/** @file + + Copyright (c) 2023, Ampere Computing LLC. All rights reserved.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +// @DRAM base address 0x88970000 +// Regarding updating the status of hotplug PCIe ports, a shared DRAM +// memory region between Arm Trusted Firmware and UEFI is used to indicate +// PCIe hotplug event action. An item of MHPP table is used to reflect hot= plug +// event of each PCIe port. There is a maximum of 48 PCIe hotplug ports in= Altra +// Family processor, the definition in this table should be aligned with h= otplug +// port map of a specific platform. For example, in Ampere Mt. Jade platfo= rm, +// there are 40 PCIe hotplug ports. Hence, this table defines 36 entries c= orresponding +// to Ampere Mt. Jade PCIe hotplug port map. +OperationRegion(MHPP, SystemMemory, 0x88970000, 960) +Field (MHPP, DWordAcc, NoLock, Preserve) { + A020, 32, // 0. S0 RCA2.0 + A00I, 8, // incomplete remove + offset (24), + A030, 32, // 1. S0 RCA3.0 + A01I, 8, // incomplete remove + offset (48), + B000, 32, // 2. S0 RCB0.0 + B02I, 8, // incomplete remove + offset (72), + B002, 32, // 3. S0 RCB0.2 + B03I, 8, // incomplete remove + offset (96), + B004, 32, // 4. S0 RCB0.4 + B04I, 8, // incomplete remove + offset (120), + B006, 32, // 5. S0 RCB0.6 + B05I, 8, // incomplete remove + offset (144), + B010, 32, // 6. S0 RCB1.0 + B06I, 8, // incomplete remove + offset (168), + B012, 32, // 7. S0 RCB1.2 + B07I, 8, // incomplete remove + offset (192), + B014, 32, // 8. S0 RCB1.4 + B08I, 8, // incomplete remove + offset (216), + B016, 32, // 9. S0 RCB1.6 + B09I, 8, // incomplete remove + offset (240), + B020, 32, // 10. S0 RCB2.0 + B10I, 8, // incomplete remove + offset (264), + B022, 32, // 11. S0 RCB2.2 + B11I, 8, // incomplete remove + offset (288), + B024, 32, // 12. S0 RCB2.4 + B12I, 8, // incomplete remove + offset (312), + B030, 32, // 13. S0 RCB3.0 + B13I, 8, // incomplete remove + offset (336), + B034, 32, // 14. S0 RCB3.4 + B14I, 8, // incomplete remove + offset (360), + B036, 32, // 15. S0 RCB3.6 + B15I, 8, // incomplete remove + offset (384), + A120, 32, // 16. S1 RCA2.0 + A16I, 8, // incomplete remove + offset (408), + A121, 32, // 17. S1 RCA2.1 + A17I, 8, // incomplete remove + offset (432), + A122, 32, // 18. S1 RCA2.2 + A18I, 8, // incomplete remove + offset (456), + A123, 32, // 19. S1 RCA2.3 + A19I, 8, // incomplete remove + offset (480), + A130, 32, // 20. S1 RCA3.0 + A20I, 8, // incomplete remove + offset (504), + A132, 32, // 21. S1 RCA3.2 + A21I, 8, // incomplete remove + offset (528), + B100, 32, // 22. S1 RCB0.0 + B22I, 8, // incomplete remove + offset (552), + B104, 32, // 23. S1 RCB0.4 + B23I, 8, // incomplete remove + offset (576), + B106, 32, // 24. S1 RCB0.6 + B24I, 8, // incomplete remove + offset (600), + B110, 32, // 25. S1 RCB1.0 + B25I, 8, // incomplete remove + offset (624), + B112, 32, // 26. S1 RCB1.2 + B26I, 8, // incomplete remove + offset (648), + B114, 32, // 27. S1 RCB1.4 + B27I, 8, // incomplete remove + offset (672), + B120, 32, // 28. S1 RCB2.0 + B28I, 8, // incomplete remove + offset (696), + B122, 32, // 29. S1 RCB2.2 + B29I, 8, // incomplete remove + offset (720), + B124, 32, // 30. S1 RCB2.4 + B30I, 8, // incomplete remove + offset (744), + B126, 32, // 31. S1 RCB2.6 + B31I, 8, // incomplete remove + offset (768), + B130, 32, // 32. S1 RCB3.0 + B32I, 8, // incomplete remove + offset (792), + B132, 32, // 33. S1 RCB3.2 + B33I, 8, // incomplete remove + offset (816), + B134, 32, // 34. S1 RCB3.4 + B34I, 8, // incomplete remove + offset (840), + B136, 32, // 35. S1 RCB3.6 + B35I, 8 // incomplete remove +} diff --git a/Platform/Ampere/JadePkg/AcpiTables/PCI-S0.asi b/Platform/Amper= e/JadePkg/AcpiTables/PCI-S0.asi index f6d788cd99b0..452baf18e720 100644 --- a/Platform/Ampere/JadePkg/AcpiTables/PCI-S0.asi +++ b/Platform/Ampere/JadePkg/AcpiTables/PCI-S0.asi @@ -1,11 +1,21 @@ /** @file =20 - Copyright (c) 2020 - 2021, Ampere Computing LLC. All rights reserved.
+ Copyright (c) 2020 - 2023, Ampere Computing LLC. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ =20 + Include("MHPP.asi") + + // @DoorBellNS1 0x1000.0054.1000. Out-Offset: 0x10 + OperationRegion(DNS1, SystemMemory, 0x100000541010 , 8) + + Field (DNS1, DWordAcc, NoLock, Preserve) { + OUTV, 32, + DIN0, 32, + } + // PCI2 RCA2 Device (PCI2) { // @@ -1016,6 +1026,274 @@ Name (_ADR, 0x00000000) } =20 + // + // Root Port 1 + // + Device (P2P1) { + // + // Device 1, Function 0 (Bus 0). + // + + Name (_ADR, 0x00010000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 1 ([01]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (B000 =3D=3D 0xF0000400) { // SW ejected ? + Store(0x02000400, B000) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CH= G_CMD =3D 3 + Store(0x68000212, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000212 to DBNS1_10 + Return(0xF) + } + elseif (B000 =3D=3D 0x10000400) { // ejected complete ? + Store(0x02000400, B000) // clear action value + Return(0x0) + } + elseif ((B000 =3D=3D 0x01000400) || (B000 =3D=3D 0x0F000400)) { = // inserted ? + if (B02I =3D=3D 0x00) { + Store(0x02000400, B000) // clear action value + } + Return(0xF) + } + elseif ((B000 =3D=3D 0x0E000400) || (B000 =3D=3D 0x0F000400)) { = // inprogress inserted ? + if (B02I =3D=3D 0x00) { + Store(0x02000400, B000) // clear action value + } + Return(0xF) + } + else { + Return(0xF) + } + } + + Method (_EJ0, 1) { + if (B000 =3D=3D 0x02000400) { // really sw ejection call? + Store(0xF0000400, B000) // set SW ejection action + Store(0x680000B4, DIN0) // Blink RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CH= G_CMD =3D 3 + Store(0x68000212, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000212 to DBNS1_10 + } + } + + Name(_SUN, 0x00000001) + } + } + + // + // Root Port 3 + // + Device (P2P3) { + // + // Device 3, Function 0 (Bus 0). + // + + Name (_ADR, 0x00030000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 2 ([02]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (B002 =3D=3D 0xF0020400) { // SW ejected ? + Store(0x02020400, B002) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CH= G_CMD =3D 3 + Store(0x68000232, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000232 to DBNS1_10 + Return(0xF) + } + elseif (B002 =3D=3D 0x10020400) { // ejected complete ? + Store(0x02020400, B002) // clear action value + Return(0x0) + } + elseif ((B002 =3D=3D 0x01020400) || (B002 =3D=3D 0x0F020400)) { = // inserted ? + if (B03I =3D=3D 0x00) { + Store(0x02020400, B002) // clear action value + } + Return(0xF) + } + elseif ((B002 =3D=3D 0x0E020400) || (B002 =3D=3D 0x0F020400)) { = // inprogress inserted ? + if (B03I =3D=3D 0x00) { + Store(0x02020400, B002) // clear action value + } + Return(0xF) + } + else { + Return(0xF) + } + } + + Method (_EJ0, 1) { + if (B002 =3D=3D 0x02020400) { // really sw ejection call? + Store(0xF0020400, B002) // set SW ejection action + Store(0x680000B4, DIN0) // Blink RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CH= G_CMD =3D 3 + Store(0x68000232, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000232 to DBNS1_10 + } + } + + Name(_SUN, 0x00000002) + } + } + + // + // Root Port 5 + // + Device (P2P5) { + // + // Device 5, Function 0 (Bus 0). + // + + Name (_ADR, 0x00050000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 3 [03]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (B004 =3D=3D 0xF0040400) { // SW ejected ? + Store(0x02040400, B004) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CH= G_CMD =3D 3 + Store(0x68000252, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000252 to DBNS1_10 + Return(0xF) + } + elseif (B004 =3D=3D 0x10040400) { // ejected complete ? + Store(0x02040400, B004) // clear action value + Return(0x0) + } + elseif ((B004 =3D=3D 0x01040400) || (B004 =3D=3D 0x0F040400)) { = // inserted? + if (B04I =3D=3D 0x00) { + Store(0x02040400, B004) // clear action value + } + Return(0xF) + } + elseif ((B004 =3D=3D 0x0E040400) || (B004 =3D=3D 0x0F040400)) { = // inprogress inserted? + if (B04I =3D=3D 0x00) { + Store(0x02040400, B004) // clear action value + } + Return(0xF) + } + else { + Return(0xF) + } + } + + Method (_EJ0, 1) { + if (B004 =3D=3D 0x02040400) { // really sw ejection call? + Store(0xF0040400, B004) // set SW ejection action + Store(0x680000B4, DIN0) // Blink RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CH= G_CMD =3D 3 + Store(0x68000252, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000252 to DBNS1_10 + } + } + + Name(_SUN, 0x00000003) + } + } + + // + // Root Port 7 + // + Device (P2P7) { + // + // Device 7, Function 0 (Bus 0). + // + + Name (_ADR, 0x00070000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 4 ([04]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (B006 =3D=3D 0xF0060400) { // SW ejected ? + Store(0x02060400, B006) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CH= G_CMD =3D 3 + Store(0x68000272, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000272 to DBNS1_10 + Return(0xF) + } + elseif(B006 =3D=3D 0x10060400) { // ejected complete ? + Store(0x02060400, B006) // clear action value + Return(0x0) + } + elseif((B006 =3D=3D 0x01060400) || (B006 =3D=3D 0x0F060400)) { /= / inserted ? + if (B05I =3D=3D 0x00) { + Store(0x02060400, B006) // clear action value + } + Return(0xF) + } + elseif((B006 =3D=3D 0x0E060400) || (B006 =3D=3D 0x0F060400)) { /= / inprogress inserted ? + if (B05I =3D=3D 0x00) { + Store(0x02060400, B006) // clear action value + } + Return(0xF) + } + else { + Return(0xF) + } + } + + Method (_EJ0, 1) { + if (B006 =3D=3D 0x02060400) { // really sw ejection call? + Store(0xF0060400, B006) // set SW ejection value + Store(0x680000B4, DIN0) // Blink RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CH= G_CMD =3D 3 + Store(0x68000272, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000272 to DBNS1_10 + } + } + + Name(_SUN, 0x00000004) + } + } + Method (_PXM, 0, NotSerialized) { // Patch by code Return(0xFF) @@ -1366,6 +1644,274 @@ Name (_ADR, 0x00000000) } =20 + // + // Root Port 1 + // + Device (P2P1) { + // + // Device 1, Function 0 (Bus 0). + // + + Name (_ADR, 0x00010000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 1 ([01]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (B010 =3D=3D 0xF0000500) { // SW ejected before ? + Store(0x02000500, B010) // Set back action event + Store(0x680000A4, DIN0) // Off RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CH= G_CMD =3D 3 + Store(0x68000213, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000213 to DBNS1_10 + Return(0xF) + } + elseif (B010 =3D=3D 0x10000500) { // ejected complete ? + Store(0x02000500, B010) // Set back action event + Return (0x0) + } + elseif ((B010 =3D=3D 0x01000500) || (B010 =3D=3D 0x0F000500)) { = // inserted ? + if (B06I =3D=3D 0x00) { + Store(0x02000500, B010) // Set back action event + } + Return (0xF) + } + elseif ((B010 =3D=3D 0x0E000500) || (B010 =3D=3D 0x0F000500)) { = // inprogress inserted ? + if (B06I =3D=3D 0x00) { + Store(0x02000500, B010) // Set back action event + } + Return (0xF) + } + else { + Return (0xF) + } + } + + Method (_EJ0, 1) { + if (B010 =3D=3D 0x02000500) { // really sw ejection call? + Store(0xF0000500, B010) // Set SW ejection event + Store(0x680000B4, DIN0) // Blink RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CH= G_CMD =3D 3 + Store(0x68000213, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000213 to DBNS1_10 + } + } + + Name(_SUN, 0x00000001) + } + } + + // + // Root Port 3 + // + Device (P2P3) { + // + // Device 3, Function 0 (Bus 0). + // + + Name (_ADR, 0x00030000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 2 ([02]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (B012 =3D=3D 0xF0020500) { // SW ejected before ? + Store(0x02020500, B012) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CH= G_CMD =3D 3 + Store(0x68000233, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000233 to DBNS1_10 + Return(0xF) + } + elseif (B012 =3D=3D 0x10020500) { // ejected complete ? + Store(0x02020500, B012) // clear action value + Return (0x0) + } + elseif ((B012 =3D=3D 0x01020500) || (B012 =3D=3D 0x0F020500)) { = // inserted ? + if (B07I =3D=3D 0x00) { + Store(0x02020500, B012) // clear action value + } + Return (0xF) + } + elseif ((B012 =3D=3D 0x0E020500) || (B012 =3D=3D 0x0F020500)) { = // inprogress inserted ? + if (B07I =3D=3D 0x00) { + Store(0x02020500, B012) // clear action value + } + Return (0xF) + } + else { + Return (0xF) + } + } + + Method (_EJ0, 1) { + if (B012 =3D=3D 0x02020500) { // really sw ejection call? + Store(0xF0020500, B012) // set SW ejection event + Store(0x680000B4, DIN0) // Blink RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CH= G_CMD =3D 3 + Store(0x68000233, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000233 to DBNS1_10 + } + } + + Name(_SUN, 0x00000002) + } + } + + // + // Root Port 5 + // + Device (P2P5) { + // + // Device 5, Function 0 (Bus 0). + // + + Name (_ADR, 0x00050000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 3 [03]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (B014 =3D=3D 0xF0040500) { // SW ejected before ? + Store(0x02040500, B014) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CH= G_CMD =3D 3 + Store(0x68000253, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000253 to DBNS1_10 + Return (0xF) + } + elseif (B014 =3D=3D 0x10040500) { // ejected complete ? + Store(0x02040500, B014) // clear action value + Return (0x0) + } + elseif ((B014 =3D=3D 0x01040500) || (B014 =3D=3D 0x0F040500)){ /= / inserted ? + if (B08I =3D=3D 0x00) { + Store(0x02040500, B014) // clear action value + } + Return (0xF) + } + elseif ((B014 =3D=3D 0x0E040500) || (B014 =3D=3D 0x0F040500)) { = // inprogress inserted ? + if (B08I =3D=3D 0x00) { + Store(0x02040500, B014) // clear action value + } + Return (0xF) + } + else { + Return (0xF) + } + } + + Method (_EJ0, 1) { + if (B014 =3D=3D 0x02040500) { // really sw ejection call? + Store(0xF0040500, B014) // set SW ejection event + Store(0x680000B4, DIN0) // Blink RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CH= G_CMD =3D 3 + Store(0x68000253, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000253 to DBNS1_10 + } + } + + Name(_SUN, 0x00000003) + } + } + + // + // Root Port 7 + // + Device (P2P7) { + // + // Device 7, Function 0 (Bus 0). + // + + Name (_ADR, 0x00070000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 4 ([04]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (B016 =3D=3D 0xF0060500) { // SW ejected before ? + Store(0x02060500, B016) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CH= G_CMD =3D 3 + Store(0x68000273, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000273 to DBNS1_10 + Return(0xF) + } + elseif (B016 =3D=3D 0x10060500) { // ejected complete ? + Store(0x02060500, B016) // clear action value + Return (0x0) + } + elseif ((B016 =3D=3D 0x01060500) || (B016 =3D=3D 0x0F060500)) { = // inserted ? + if (B09I =3D=3D 0x00) { + Store(0x02060500, B016) // clear action value + } + Return (0xF) + } + elseif ((B016 =3D=3D 0x0E060500) || (B016 =3D=3D 0x0F060500)) { = // inprogress inserted ? + if (B09I =3D=3D 0x00) { + Store(0x02060500, B016) // clear action value + } + Return (0xF) + } + else { + Return (0xF) + } + } + + Method (_EJ0, 1) { + if (B016 =3D=3D 0x02060500) { // really sw ejection call? + Store(0xF0060500, B016) // set SW ejection event + Store(0x680000B4, DIN0) // Blink RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CH= G_CMD =3D 3 + Store(0x68000273, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000273 to DBNS1_10 + } + } + + Name(_SUN, 0x00000004) + } + } + Method (_PXM, 0, NotSerialized) { // Patch by code Return(0xFF) diff --git a/Platform/Ampere/JadePkg/AcpiTables/PCI-S1.asi b/Platform/Amper= e/JadePkg/AcpiTables/PCI-S1.asi index 2757f3124b83..49dec357abfb 100644 --- a/Platform/Ampere/JadePkg/AcpiTables/PCI-S1.asi +++ b/Platform/Ampere/JadePkg/AcpiTables/PCI-S1.asi @@ -1,6 +1,6 @@ /** @file =20 - Copyright (c) 2020 - 2021, Ampere Computing LLC. All rights reserved.
+ Copyright (c) 2020 - 2023, Ampere Computing LLC. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -336,6 +336,274 @@ Name (_ADR, 0x00000000) } =20 + // + // Root Port 1 + // + Device (P2P1) { + // + // Device 1, Function 0 (Bus 0). + // + + Name (_ADR, 0x00010000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 1 ([01]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A120 =3D=3D 0xF0000201) { // SW ejected before ? + Store(0x02000201, A120) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CH= G_CMD =3D 3 + Store(0x68000216, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000216 to DBNS1_10 + Return (0xF) + } + elseif (A120 =3D=3D 0x10000201) { // ejected completed ? + Store(0x02000201, A120) // clear action value + Return (0x0) + } + elseif ((A120 =3D=3D 0x01000201) || (A120 =3D=3D 0x0F000201)) { = // inserted ? + if (A16I =3D=3D 0x00) { + Store(0x02000201, A120) // clear action value + } + Return (0xF) + } + elseif ((A120 =3D=3D 0x0E000201) || (A120 =3D=3D 0x0F000201)) { = // inprogress inserted ? + if (A16I =3D=3D 0x00) { + Store(0x02000201, A120) // clear action value + } + Return (0xF) + } + else { + Return (0xF) + } + } + + Method (_EJ0, 1) { + if (A120 =3D=3D 0x02000201) { // is sw ejection? + Store(0xF0000201, A120) // set SW ejection event + Store(0x680000B4, DIN0) // Blink RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CH= G_CMD =3D 3 + Store(0x68000216, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000216 to DBNS1_10 + } + } + + Name(_SUN, 0x00000001) + } + } + + // + // Root Port 2 + // + Device (P2P2) { + // + // Device 2, Function 0 (Bus 0). + // + + Name (_ADR, 0x00020000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 2 ([02]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A121 =3D=3D 0xF0010201) { // SW ejected before ? + Store(0x02010201, A121) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CH= G_CMD =3D 3 + Store(0x68000226, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000226 to DBNS1_10 + Return(0xF) + } + elseif (A121 =3D=3D 0x10010201) { // ejected completed ? + Store(0x02010201, A121) // clear action value + Return(0x0) + } + elseif ((A121 =3D=3D 0x01010201) || (A121 =3D=3D 0x0F010201)) { = // inserted ? + if (A17I =3D=3D 0x00) { + Store(0x02010201, A121) // clear action value + } + Return(0xF) + } + elseif ((A121 =3D=3D 0x0E010201) || (A121 =3D=3D 0x0F010201)) { = // inprogress inserted ? + if (A17I =3D=3D 0x00) { + Store(0x02010201, A121) // clear action value + } + Return(0xF) + } + else { + Return (0xF) + } + } + + Method (_EJ0, 1) { + if (A121 =3D=3D 0x02010201) { // is sw ejection? + Store(0xF0010201, A121) // set SW ejection event + Store(0x680000B4, DIN0) // Blink RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CH= G_CMD =3D 3 + Store(0x68000226, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000226 to DBNS1_10 + } + } + + Name(_SUN, 0x00000002) + } + } + + // + // Root Port 3 + // + Device (P2P3) { + // + // Device 3, Function 0 (Bus 0). + // + + Name (_ADR, 0x00030000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 3 [03]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A122 =3D=3D 0xF0020201) { // SW ejected before ? + Store(0x02020201, A122) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CH= G_CMD =3D 3 + Store(0x68000236, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000236 to DBNS1_10 + Return(0xF) + } + elseif (A122 =3D=3D 0x10020201) { // ejected complete ? + Store(0x02020201, A122) // clear action value + Return (0x0) + } + elseif ((A122 =3D=3D 0x01020201) || (A122 =3D=3D 0x0F020201)) { = // inserted ? + if (A18I =3D=3D 0x00) { + Store(0x02020201, A122) // clear action value + } + Return (0xF) + } + elseif ((A122 =3D=3D 0x0E020201) || (A122 =3D=3D 0x0F020201)) { = // inprogess inserted ? + if (A18I =3D=3D 0x00) { + Store(0x02020201, A122) // clear action value + } + Return (0xF) + } + else { + Return (0xF) + } + } + + Method (_EJ0, 1) { + if (A122 =3D=3D 0x02020201) { // is sw ejection? + Store(0xF0020201, A122) // set SW ejection event + Store(0x680000B4, DIN0) // Blink RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CH= G_CMD =3D 3 + Store(0x68000236, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000236 to DBNS1_10 + } + } + + Name(_SUN, 0x00000003) + } + } + + // + // Root Port 4 + // + Device (P2P4) { + // + // Device 4, Function 0 (Bus 0). + // + + Name (_ADR, 0x00040000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 4 [04]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A123 =3D=3D 0xF0030201) { // SW ejected before ? + Store(0x02030201, A123) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CH= G_CMD =3D 3 + Store(0x68000246, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000246 to DBNS1_10 + Return(0xF) + } + elseif (A123 =3D=3D 0x10030201) { // ejected complete ? + Store(0x02030201, A123) // clear action value + Return (0x0) + } + elseif ((A123 =3D=3D 0x01030201) || (A123 =3D=3D 0x0F030201)) { = // inserted ? + if (A19I =3D=3D 0x00) { + Store(0x02030201, A123) // clear action value + } + Return (0xF) + } + elseif ((A123 =3D=3D 0x0E030201) || (A123 =3D=3D 0x0F030201)) { = // inprogress inserted ? + if (A19I =3D=3D 0x00) { + Store(0x02030201, A123) // clear action value + } + Return (0xF) + } + else { + Return (0xF) + } + } + + Method (_EJ0, 1) { + if (A123 =3D=3D 0x02030201) { // is sw ejection? + Store(0xF0030201, A123) // set ejection event + Store(0x680000B4, DIN0) // Blink RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CH= G_CMD =3D 3 + Store(0x68000246, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000246 to DBNS1_10 + } + } + + Name(_SUN, 0x00000004) + } + } + Method (_PXM, 0, NotSerialized) { // Patch by code Return(0xFF) @@ -1021,6 +1289,140 @@ Name (_ADR, 0x00000000) } =20 + // + // Root Port 5 + // + Device (P2P5) { + // + // Device 5, Function 0 (Bus 0). + // + + Name (_ADR, 0x00050000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 2 [02]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (B104 =3D=3D 0xF0040401) { // SW ejected before ? + Store(0x02040401, B104) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CH= G_CMD =3D 3 + Store(0x68000258, OUTV) // > + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000258 to DBNS1_10 + Return(0xF) + } + elseif (B104 =3D=3D 0x10040401) { // ejected complete ? + Store(0x02040401, B104) // clear action value + Return (0x0) + } + elseif ((B104 =3D=3D 0x01040401) || (B104 =3D=3D 0x0F040401)) { = // inserted ? + if (B23I =3D=3D 0x00) { + Store(0x02040401, B104) // clear action value + } + Return (0xF) + } + elseif ((B104 =3D=3D 0x0E040401) || (B104 =3D=3D 0x0F040401)) { = // inprogress inserted ? + if (B23I =3D=3D 0x00) { + Store(0x02040401, B104) // clear action value + } + Return (0xF) + } + else { + Return (0xF) + } + } + + Method (_EJ0, 1) { + if (B104 =3D=3D 0x02040401) { // is sw ejection? + Store(0xF0040401, B104) // set SW ejection event + Store(0x680000B4, DIN0) // Blink RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CH= G_CMD =3D 3 + Store(0x68000258, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000258 to DBNS1_10 + } + } + + Name(_SUN, 0x00000002) + } + } + + // + // Root Port 7 + // + Device (P2P7) { + // + // Device 7, Function 0 (Bus 0). + // + + Name (_ADR, 0x00070000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 3 ([03]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (B106 =3D=3D 0xF0060401) { // SW ejected before ? + Store(0x02060401, B106) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CH= G_CMD =3D 3 + Store(0x68000278, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000278 to DBNS1_10 + Return(0xF) + } + elseif (B106 =3D=3D 0x10060401) { // ejected complete ? + Store(0x02060401, B106) // clear action value + Return (0x0) + } + elseif ((B106 =3D=3D 0x01060401) || (B106 =3D=3D 0x0F060401)) { = // inserted ? + if (B24I =3D=3D 0x00) { + Store(0x02060401, B106) // clear action value + } + Return (0xF) + } + elseif ((B106 =3D=3D 0x0E060401) || (B106 =3D=3D 0x0F060401)) { = // inprogress inserted ? + if (B24I =3D=3D 0x00) { + Store(0x02060401, B106) // clear action value + } + Return (0xF) + } + else { + Return (0xF) + } + } + + Method (_EJ0, 1) { + if (B106 =3D=3D 0x02060401) { // is sw ejection? + Store(0xF0060401, B106) // set SW ejection event + Store(0x680000B4, DIN0) // Blink RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CH= G_CMD =3D 3 + Store(0x68000278, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000278 to DBNS1_10 + } + } + + Name(_SUN, 0x00000003) + } + } + Method (_PXM, 0, NotSerialized) { // Patch by code Return(0xFF) @@ -1374,6 +1776,140 @@ Name (_ADR, 0x00000000) } =20 + // + // Root Port 1 + // + Device (P2P1) { + // + // Device 1, Function 0 (Bus 0). + // + + Name (_ADR, 0x00010000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 1 ([01]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (B110 =3D=3D 0xF0000501) { // SW ejected before? + Store(0x02000501, B110) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CH= G_CMD =3D 3 + Store(0x68000219, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000219 to DBNS1_10 + Return(0xF) + } + elseif (B110 =3D=3D 0x10000501) { // ejected complete ? + Store(0x02000501, B110) // clear action value + Return (0x0) + } + elseif ((B110 =3D=3D 0x01000501) || (B110 =3D=3D 0x0F000501)) { = // inserted ? + if (B25I =3D=3D 0x00) { + Store(0x02000501, B110) // clear action value + } + Return (0xF) + } + elseif ((B110 =3D=3D 0x0E000501) || (B110 =3D=3D 0x0F000501)) { = // inprogress inserted ? + if (B25I =3D=3D 0x00) { + Store(0x02000501, B110) // clear action value + } + Return (0xF) + } + else { + Return (0xF) + } + } + + Method (_EJ0, 1) { + if (B110 =3D=3D 0x02000501) { // is sw ejection? + Store(0xF0000501, B110) // set SW ejection event + Store(0x680000B4, DIN0) // Blink RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CH= G_CMD =3D 3 + Store(0x68000219, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000219 to DBNS1_10 + } + } + + Name(_SUN, 0x00000001) + } + } + + // + // Root Port 3 + // + Device (P2P3) { + // + // Device 3, Function 0 (Bus 0). + // + + Name (_ADR, 0x00030000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 2 [02]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (B112 =3D=3D 0xF0020501) { // SW ejected before ? + Store(0x02020501, B112) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CH= G_CMD =3D 3 + Store(0x68000239, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000239 to DBNS1_10 + Return(0xF) + } + elseif (B112 =3D=3D 0x10020501) { // ejected complete ? + Store(0x02020501, B112) // clear action value + Return (0x0) + } + elseif ((B112 =3D=3D 0x01020501) || (B112 =3D=3D 0x0F020501)) { = // inserted ? + if (B26I =3D=3D 0x00) { + Store(0x02020501, B112) // clear action value + } + Return (0xF) + } + elseif ((B112 =3D=3D 0x0E020501) || (B112 =3D=3D 0x0F020501)) { = // inprogress inserted ? + if (B26I =3D=3D 0x00) { + Store(0x02020501, B112) // clear action value + } + Return (0xF) + } + else { + Return (0xF) + } + } + + Method (_EJ0, 1) { + if (B112 =3D=3D 0x02020501) { // is sw ejection? + Store(0xF0020501, B112) // set SW ejection event + Store(0x680000B4, DIN0) // Blink RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CH= G_CMD =3D 3 + Store(0x68000239, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000239 to DBNS1_10 + } + } + + Name(_SUN, 0x00000002) + } + } + Method (_PXM, 0, NotSerialized) { // Patch by code Return(0xFF) @@ -1727,6 +2263,274 @@ Name (_ADR, 0x00000000) } =20 + // + // Root Port 1 + // + Device (P2P1) { + // + // Device 1, Function 0 (Bus 0). + // + + Name (_ADR, 0x00010000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 1 ([01]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (B120 =3D=3D 0xF0000601) { // SW ejected before ? + Store(0x02000601, B120) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CH= G_CMD =3D 3 + Store(0x6800021A, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x6800021A to DBNS1_10 + Return(0xF) + } + elseif (B120 =3D=3D 0x10000601) { // ejected complete ? + Store(0x02000601, B120) // clear action value + Return (0x0) + } + elseif ((B120 =3D=3D 0x01000601) || (B120 =3D=3D 0x0F000601)){ /= / inserted ? + if (B28I =3D=3D 0x00) { + Store(0x02000601, B120) // clear action value + } + Return (0xF) + } + elseif ((B120 =3D=3D 0x0E000601) || (B120 =3D=3D 0x0F000601)) { = // inprogress inserted ? + if (B28I =3D=3D 0x00) { + Store(0x02000601, B120) // clear action value + } + Return (0xF) + } + else { + Return (0xF) + } + } + + Method (_EJ0, 1) { + if (B120 =3D=3D 0x02000601) { // is sw ejection? + Store(0xF0000601, B120) // set SW ejection event + Store(0x680000B4, DIN0) // Blink RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CH= G_CMD =3D 3 + Store(0x6800021A, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x6800021A to DBNS1_10 + } + } + + Name(_SUN, 0x00000001) + } + } + + // + // Root Port 3 + // + Device (P2P3) { + // + // Device 3, Function 0 (Bus 0). + // + + Name (_ADR, 0x00030000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 2 [02]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (B122 =3D=3D 0xF0020601) { // SW ejected before ? + Store(0x02020601, B122) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CH= G_CMD =3D 3 + Store(0x6800023A, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x6800023A to DBNS1_10 + Return(0xF) + } + elseif (B122 =3D=3D 0x10020601) { // ejected completed ? + Store(0x02020601, B122) // clear action value + Return (0x0) + } + elseif ((B122 =3D=3D 0x01020601) || (B122 =3D=3D 0x0F020601)){ /= / inserted ? + if (B29I =3D=3D 0x00) { + Store(0x02020601, B122) // clear action value + } + Return (0xF) + } + elseif ((B122 =3D=3D 0x0E020601) || (B122 =3D=3D 0x0F020601)) { = // inprogress inserted ? + if (B29I =3D=3D 0x00) { + Store(0x02020601, B122) // clear action value + } + Return (0xF) + } + else { + Return (0xF) + } + } + + Method (_EJ0, 1) { + if (B122 =3D=3D 0x02020601) { // is sw ejection? + Store(0xF0020601, B122) // set SW ejection event + Store(0x680000B4, DIN0) // Blink RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CH= G_CMD =3D 3 + Store(0x6800023A, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x6800023A to DBNS1_10 + } + } + + Name(_SUN, 0x00000002) + } + } + + // + // Root Port 5 + // + Device (P2P5) { + // + // Device 5, Function 0 (Bus 0). + // + + Name (_ADR, 0x00050000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 3 [03]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (B124 =3D=3D 0xF0040601) { // SW ejected before ? + Store(0x02040601, B124) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CH= G_CMD =3D 3 + Store(0x6800025A, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x6800025A to DBNS1_10 + Return(0xF) + } + elseif (B124 =3D=3D 0x10040601) { // ejected complete ? + Store(0x02040601, B124) // clear action value + Return (0x0) + } + elseif ((B124 =3D=3D 0x01040601) || (B124 =3D=3D 0x0F040601)) { = // inserted ? + if (B30I =3D=3D 0x00) { + Store(0x02040601, B124) // clear action value + } + Return (0xF) + } + elseif ((B124 =3D=3D 0x0E040601) || (B124 =3D=3D 0x0F040601)) { = // inprogress inserted ? + if (B30I =3D=3D 0x00) { + Store(0x02040601, B124) // clear action value + } + Return (0xF) + } + else { + Return (0xF) + } + } + + Method (_EJ0, 1) { + if (B124 =3D=3D 0x02040601) { // is sw ejection? + Store(0xF0040601, B124) // set SW ejection event + Store(0x680000B4, DIN0) // Blink RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CH= G_CMD =3D 3 + Store(0x6800025A, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x6800025A to DBNS1_10 + } + } + + Name(_SUN, 0x00000003) + } + } + + // + // Root Port 7 + // + Device (P2P7) { + // + // Device 7, Function 0 (Bus 0). + // + + Name (_ADR, 0x00070000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 4 ([04]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (B126 =3D=3D 0xF0060601) { // SW ejected before ? + Store(0x02060601, B126) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CH= G_CMD =3D 3 + Store(0x6800027A, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x6800027A to DBNS1_10 + Return(0xF) + } + elseif (B126 =3D=3D 0x10060601) { // ejected complete ? + Store(0x02060601, B126) // clear action value + Return (0x0) + } + elseif ((B126 =3D=3D 0x01060601) || (B126 =3D=3D 0x0F060601)) { = // inserted ? + if (B31I =3D=3D 0x00) { + Store(0x02060601, B126) // clear action value + } + Return (0xF) + } + elseif ((B126 =3D=3D 0x0E060601) || (B126 =3D=3D 0x0F060601)) { = // inprogress inserted ? + if (B31I =3D=3D 0x00) { + Store(0x02060601, B126) // clear action value + } + Return (0xF) + } + else { + Return (0xF) + } + } + + Method (_EJ0, 1) { + if (B126 =3D=3D 0x02060601) { // is sw ejection? + Store(0xF0060601, B126) // set SW ejection event + Store(0x680000B4, DIN0) // Blink RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CH= G_CMD =3D 3 + Store(0x6800027A, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x6800027A to DBNS1_10 + } + } + + Name(_SUN, 0x00000004) + } + } + Method (_PXM, 0, NotSerialized) { // Patch by code Return(0xFF) @@ -2080,6 +2884,274 @@ Name (_ADR, 0x00000000) } =20 + // + // Root Port 1 + // + Device (P2P1) { + // + // Device 1, Function 0 (Bus 0). + // + + Name (_ADR, 0x00010000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 1 ([01]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (B130 =3D=3D 0xF0000701) { // SW ejected before ? + Store(0x02000701, B130) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CH= G_CMD =3D 3 + Store(0x6800021B, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x6800021B to DBNS1_10 + Return (0xF) + } + elseif (B130 =3D=3D 0x10000701) { // ejected complete ? + Store(0x02000701, B130) // clear action value + Return (0x0) + } + elseif ((B130 =3D=3D 0x01000701) || (B130 =3D=3D 0x0F000701)) { = // inserted ? + if (B32I =3D=3D 0x00) { + Store(0x02000701, B130) // clear action value + } + Return (0xF) + } + elseif ((B130 =3D=3D 0x0E000701) || (B130 =3D=3D 0x0F000701)) { = // inprogress inserted ? + if (B32I =3D=3D 0x00) { + Store(0x02000701, B130) // clear action value + } + Return (0xF) + } + else { + Return (0xF) + } + } + + Method (_EJ0, 1) { + if (B130 =3D=3D 0x02000701) { // is sw ejection? + Store(0xF0000701, B130) // set SW ejection event + Store(0x680000B4, DIN0) // Blink RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CH= G_CMD =3D 3 + Store(0x6800021B, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x6800021B to DBNS1_10 + } + } + + Name(_SUN, 0x00000001) + } + } + + // + // Root Port 3 + // + Device (P2P3) { + // + // Device 3, Function 0 (Bus 0). + // + + Name (_ADR, 0x00030000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 2 [02]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (B132 =3D=3D 0xF0020701) { // SW ejected before ? + Store(0x02020701, B132) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CH= G_CMD =3D 3 + Store(0x6800023B, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x6800023B to DBNS1_10 + Return (0xF) + } + elseif (B132 =3D=3D 0x10020701) { // ejected complete ? + Store(0x02020701, B132) // clear action value + Return (0x0) + } + elseif ((B132 =3D=3D 0x01020701) || (B132 =3D=3D 0x0F020701)) { = // inserted ? + if (B33I =3D=3D 0x00) { + Store(0x02020701, B132) // clear action value + } + Return (0xF) + } + elseif ((B132 =3D=3D 0x0E020701) || (B132 =3D=3D 0x0F020701)) { = // inprogress inserted ? + if (B33I =3D=3D 0x00) { + Store(0x02020701, B132) // clear action value + } + Return (0xF) + } + else { + Return (0xF) + } + } + + Method (_EJ0, 1) { + if (B132 =3D=3D 0x02020701) { // is sw ejection? + Store(0xF0020701, B132) // set SW ejection event + Store(0x680000B4, DIN0) // Blink RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CH= G_CMD =3D 3 + Store(0x6800023B, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x6800023B to DBNS1_10 + } + } + + Name(_SUN, 0x00000002) + } + } + + // + // Root Port 5 + // + Device (P2P5) { + // + // Device 5, Function 0 (Bus 0). + // + + Name (_ADR, 0x00050000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 3 [03]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (B134 =3D=3D 0xF0040701) { // SW ejected before ? + Store(0x02040701, B134) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CH= G_CMD =3D 3 + Store(0x6800025B, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x6800025B to DBNS1_10 + Return (0xF) + } + elseif (B134 =3D=3D 0x10040701) { // ejected completed ? + Store(0x02040701, B134) // clear action value + Return (0x0) + } + elseif ((B134 =3D=3D 0x01040701) || (B134 =3D=3D 0x0F040701)) { = // inserted ? + if (B34I =3D=3D 0x00) { + Store(0x02040701, B134) // clear action value + } + Return (0xF) + } + elseif ((B134 =3D=3D 0x0E040701) || (B134 =3D=3D 0x0F040701)) { = // inprogress inserted ? + if (B34I =3D=3D 0x00) { + Store(0x02040701, B134) // clear action value + } + Return (0xF) + } + else { + Return (0xF) + } + } + + Method (_EJ0, 1) { + if (B134 =3D=3D 0x02040701) { // is sw ejection? + Store(0xF0040701, B134) // set SW ejection event + Store(0x680000B4, DIN0) // Blink RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CH= G_CMD =3D 3 + Store(0x6800025B, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x6800025B to DBNS1_10 + } + } + + Name(_SUN, 0x00000003) + } + } + + // + // Root Port 7 + // + Device (P2P7) { + // + // Device 7, Function 0 (Bus 0). + // + + Name (_ADR, 0x00070000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 4 ([04]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (B136 =3D=3D 0xF0060701) { // SW ejected before ? + Store(0x02060701, B136) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CH= G_CMD =3D 3 + Store(0x6800027B, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x6800027B to DBNS1_10 + Return (0xF) + } + elseif (B136 =3D=3D 0x10060701) { // ejected completed ? + Store(0x02060701, B136) // clear action value + Return (0x0) + } + elseif ((B136 =3D=3D 0x01060701) || (B136 =3D=3D 0x0F060701)) { = // inserted ? + if (B35I =3D=3D 0x00) { + Store(0x02060701, B136) // clear action value + } + Return (0xF) + } + elseif ((B136 =3D=3D 0x0E060701) || (B136 =3D=3D 0x0F060701)) { = // inprogress inserted ? + if (B35I =3D=3D 0x00) { + Store(0x02060701, B136) // clear action value + } + Return (0xF) + } + else { + Return (0xF) + } + } + + Method (_EJ0, 1) { + if (B136 =3D=3D 0x02060701) { // is sw ejection? + Store(0xF0060701, B136) // set SW ejection event + Store(0x680000B4, DIN0) // Blink RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CH= G_CMD =3D 3 + Store(0x6800027B, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x6800027B to DBNS1_10 + } + } + + Name(_SUN, 0x00000004) + } + } + Method (_PXM, 0, NotSerialized) { // Patch by code Return(0xFF) --=20 2.39.0 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#104718): https://edk2.groups.io/g/devel/message/104718 Mute This Topic: https://groups.io/mt/98831770/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sun May 19 11:06:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+104719+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+104719+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1683823638162647.6294120184276; Thu, 11 May 2023 09:47:18 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 7rnrYY1788612xjquc9UD6dv; Thu, 11 May 2023 09:47:17 -0700 X-Received: from NAM12-DM6-obe.outbound.protection.outlook.com (NAM12-DM6-obe.outbound.protection.outlook.com [40.107.243.92]) by mx.groups.io with SMTP id smtpd.web10.54053.1683792656470925001 for ; Thu, 11 May 2023 01:10:56 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Nt4HieDWzADcVzzRxW3bx2JJjStFXmiX2pBGDk+pRqVNk0idawa5X0kZiPXgHqriRiFh2an+HR6klIOGvftYBfn72X/24t+8xLaOe6ly3Dt2SRqn4fx4hMQJygJ0pjaWUCLhq3oQyAfJeTiZedDMcCFeQF5Dt/uZbJhvM0/6Rk7/eIkqtVLU4sW2XTzBO46Wje/bDej/T8gIi9d3I1Drkc0c6qgMdPGyUlUL6DGKSuNXq5rFqVyQim9ixhSGaP7/96HbQ/1SMZBBfN8TrVl2s3e7GORwPCjQKiUwh17+v8HMaI78GvTfIxhT2jhOYUHn8jotGYZNJ9Aj5sZy9POeqw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=t3+joc7ua8sPz0IAWCIfw2aVPt44UNHobPCDqyyI4ME=; b=k2RPmfpFwgfeJMfHP8kcLKKtU3O4vMN0GyhN8mRggGzGJ/dfxDuSUpnGJ80Mfih4qiXi3pF9Dm/Cuw7/EA/xamgDsHEUlvJXk/csyWTLTUNo603uWbg7p8GBoOXkvt/J9jgsVddigBSt1L9pZ4wTWb1O0kJGUaJFZldZKOM2KQDWah/wV7vysIvkG7l6chQ+Ep9ZZ2ZUxbdkDD0/JHwMR6nSpeLeW3vXrgEYSZnrG+09gMmLa9TUe2M1BAIMlYP5ovJ6OxfUKupYls1jqNEiZm/8GGPjpL4d2uArNLO63L17iESw9txhSFn7l0qsZxB5nUyCG+I1414sCEgI8y620g== 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 X-Received: from PH0PR01MB8048.prod.exchangelabs.com (2603:10b6:510:280::7) by CY4PR0101MB3144.prod.exchangelabs.com (2603:10b6:910:49::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6340.19; Thu, 11 May 2023 08:10:51 +0000 X-Received: from PH0PR01MB8048.prod.exchangelabs.com ([fe80::bbdb:b58c:140e:c4e1]) by PH0PR01MB8048.prod.exchangelabs.com ([fe80::bbdb:b58c:140e:c4e1%6]) with mapi id 15.20.6387.019; Thu, 11 May 2023 08:10:51 +0000 From: "Minh Nguyen via groups.io" To: devel@edk2.groups.io CC: patches@amperecomputing.com, quic_llindhol@quicinc.com, ardb+tianocore@kernel.org, nhi@os.amperecomputing.com, tinhnguyen@os.amperecomputing.com, Vu Nguyen , Minh Nguyen Subject: [edk2-devel] [edk2-platforms][PATCH 5/6] JadePkg: Support ACPI tables for Hot Plug of Ampere Altra Max Date: Thu, 11 May 2023 15:10:10 +0700 Message-ID: <20230511081011.2692963-6-minhnguyen1@os.amperecomputing.com> In-Reply-To: <20230511081011.2692963-1-minhnguyen1@os.amperecomputing.com> References: <20230511081011.2692963-1-minhnguyen1@os.amperecomputing.com> X-ClientProxiedBy: SI2P153CA0033.APCP153.PROD.OUTLOOK.COM (2603:1096:4:190::21) To PH0PR01MB8048.prod.exchangelabs.com (2603:10b6:510:280::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR01MB8048:EE_|CY4PR0101MB3144:EE_ X-MS-Office365-Filtering-Correlation-Id: 3da26ec1-2131-4f8e-b1e2-08db51f73c00 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: yuAUAZ4ee9ihI4VQS/q+8p1WKS5RLRg8v2ON4QzYh+5a4IoE2twW97t4O644teMJRp5ozWXL4wLl9kom9gSfENcc4R1RB+hlI30PGL7rwuGqEVEUqoedAYKAatHYX/NhpSWuZbaLmI7SorAjKPjBpICn029HdAolMd8otmw9AOdYgZTOlUKUQdhaaOM4H+KIjc48+djYXTAX+PXvSxHBqUoH7ktLK6RWukDguCLibQPcOLTO3mKgk0OAXgjBEZ/f48zIQ65gOc/dRBnGNXcdXt8h8l2ybqSj0peS3QODPW3OKaykuWtpQGw+UupeTCCv2hu9QgdzG0NB7pGaFxH5oh7eLpppevmkKe26lYuuYYNJ0Ob+8F/fvbrrTjQECxlkFdHh6SGhmQG5rLIi6vFQuF+ruEP7idMENM53e3LJCrA2eGDgw1ZIaB9Wv5tS7gWUpMK7PBoST2CMwqz/0zVuqiXN7m1pafYBOLp6vtlvxcqSf785HLDDSpv4vdRt70n+fGS+Y3O44Oi9AIykl7ybWrTJ7YGNbaUay9mJ1+u4HkVc48NS33brL/yS+H//NjDyu45efEMPgMtplkyk9JBKLIO0yhCRh6RzaJ2UHuIYu2o3P0N73/2m340hmmXhPRgF X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?z6Y+vAKBnbvMp2P/TC5srVlKFEVDDDwFkqUgcUblPfR9SylP0WS82IoFxBrL?= =?us-ascii?Q?EXvTrMvis+S9fAw7T6nvLlpxHdnf9cIcpYAiKhkkndgIA8oaVYMjTyb9RC7p?= =?us-ascii?Q?IPjNnGW9mekGp4k06LKVgRcMRFci3DHddvkqIXZ8jvxYmRRXShfXYH9thIcG?= =?us-ascii?Q?wsNd9KAH1rRIAmsAskiSC+l7qpatDZapCmALwggQbFBeBgJBbcVmnFyOrl1F?= =?us-ascii?Q?0wFr0KD8BhIMYSE9usBG3wQs0fXNU0rBmKnpeEAV7zZ7eSpi6TajRK/pIbL5?= =?us-ascii?Q?cZDacwCQr8iCMmlCgsXbcGaVtpdm+KMiGePpA5gWTRuUxCVskdRxzpHanb5j?= =?us-ascii?Q?YR4bQlRte+DgIhJ+NBIvyPm/DyuqpbUrxyuZG4AlabvZ9gnhLoo1i9bYWLPc?= =?us-ascii?Q?s4k70Ehf6B8fKN+YTeN3mf774BdJNIuxZiPgQNGJfdErHM7a+L2zKNA/Yg3f?= =?us-ascii?Q?VdVVfRMKGwEAtE+znNjHJn3oy7x+nUS8ITQb6ESwmppCwAI0TCY8ntKu/fCN?= =?us-ascii?Q?futIUdCs9QnogVmQhT+Fzr5D2/h12cdNXZMle9HUbKhbisDK4fwqkXSCK24s?= =?us-ascii?Q?f/6cpVWDf5SnfKSjTzwko4CRmUDXrsQAHUS4yU0gePPtFIFEXxcYBUSZpFaa?= =?us-ascii?Q?FJ5lh7g3gU17pA9HwviEgvFp15PnWZ0Q/sCoVkwMqsoDmyE3gGscq+ROl1xA?= =?us-ascii?Q?p7rC3sLp9l98hbYRIii+KdlJS2FtIVbDp4pXnmk/tzk3EaflZfthZ0zpyP+5?= =?us-ascii?Q?12MqVGAXI07ZBExiSs5ojwhQ4bw7C4h+XlkJ0FeYw+rGX9lP8kxtz5y/bZ/2?= =?us-ascii?Q?MRzK3q+Er1f07m/J4ofTRq2upDVDMO9AhTRGwFlrL7EQsARHRqhih+VLE1Ix?= =?us-ascii?Q?NZO6duKTvTXVHwc/mti0FI/zPzFUMxXDBA3JBOounDe4Qdwa+qtdyLiytOVv?= =?us-ascii?Q?7S6IwugopfviAQLXemSg9e6uuOvJELXcNQMWUbAJSDDhc4wya9kimEw1E1+A?= =?us-ascii?Q?Xd4XzMrQFUyxPvW86uk7Q/my0T4v6cHHcJt65eS4pUVnvK3Bxn0j1aNOLnId?= =?us-ascii?Q?x+4tRpvDdNo91C+vFg5NRXGmGWba2S/nAi+R10iZM7ugXwDZcnRfYptwoNrO?= =?us-ascii?Q?xIe6+bxyG3Q+NVr4WZj2a2xywJwVwR80JuG4jcTTdZtq1jGrTsLNxaG/QBsY?= =?us-ascii?Q?K6JeuEAl1PPZVgk8f75g4hJj7uC6nDKhH1gxSThoDmLhAS6NxgJWRy6myckv?= =?us-ascii?Q?iYpwvpi7P4gHDl08w8kroOwvm8WTt67Syn3YBGX7BTsgwZvtzgctpvTVwRnS?= =?us-ascii?Q?aXTQHR9rNmJlf070aAhoNfx92jR7LXXEcOofw/Qx12H2QiP1odqjstFSG2/b?= =?us-ascii?Q?HORPWt47EL5cmibqUswU071riv48dB7klwuBd8YCqC1CvvWVWrEeg3+fu1Hr?= =?us-ascii?Q?VKMgP+yV+Zd9jUuWPQ83zPx80LrL6fwCh+BfcY5WL8Zfu1psYqYomYtRD6XK?= =?us-ascii?Q?l9RMUgnx7CH2yhGLEAdBn+4XxxQ52I5s8w5wLEnp8uPiOe32GRTwcxqjj+7t?= =?us-ascii?Q?4BYoI9MiEo+7hegL6o3iDhX3kFAX+dCrqm5NiFN3VtXN6cwTYD8IpY3TxoKo?= =?us-ascii?Q?SGMLehXuq0Ei8A6mRUxDvJSd6DC9IcMr1CNzISCmNYuO?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3da26ec1-2131-4f8e-b1e2-08db51f73c00 X-MS-Exchange-CrossTenant-AuthSource: PH0PR01MB8048.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 May 2023 08:10:51.1775 (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: JY0H2OyQ9VlCSGSSAsyLv86XhxVXhYCuli8emwA2jvTlCrB60Ws9k4MLCEvDuZFdnQjaiXKW8ZrOT4SMEWA5HIqkYZN4RFGvKokoT+q/9pEoU5OEyh+S93QzHwoZOmqg X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR0101MB3144 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,minhnguyen1@os.amperecomputing.com X-Gm-Message-State: uO68NdHpBkKJwA42hpCnSJQEx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1683823637; bh=fS3XAI/U3M7S5qjHI56L/kwrUekHs9patW52yx689nU=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=UnewtD6RgkCnYkyE6PCteB1h2jAnSb2voJwfrRmsaxU30ZPx+L9qQD8/B8tSC4Tbj2R BuMYbjLQKltN3qCLwLTmhYPx1yM+/nv9cUOyggJHVkw/bb7HHxvVzQXtqghRxVF9utHQU rptr5Okx5WjptmDk8fexhfwHV+jmRVSOxkM= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1683823640306100047 Content-Type: text/plain; charset="utf-8" From: Vu Nguyen This adds necessary changes of ACPI tables and defines the memory region between OS and Trusted Firmware-A for supporting Hot Plug of Ampere Altra Max. Signed-off-by: Minh Nguyen --- Platform/Ampere/JadePkg/Ac02AcpiTables/CommonDevices.asi | 24 + Platform/Ampere/JadePkg/Ac02AcpiTables/Dsdt.asl | 511 ++++++++++ Platform/Ampere/JadePkg/Ac02AcpiTables/MHPP.asi | 92 ++ Platform/Ampere/JadePkg/Ac02AcpiTables/PCI-S0.asi | 545 ++++++++++ Platform/Ampere/JadePkg/Ac02AcpiTables/PCI-S1.asi | 1072 ++++++++++= ++++++++++ 5 files changed, 2244 insertions(+) diff --git a/Platform/Ampere/JadePkg/Ac02AcpiTables/CommonDevices.asi b/Pla= tform/Ampere/JadePkg/Ac02AcpiTables/CommonDevices.asi index 17ecd52a553f..73804cab81b5 100644 --- a/Platform/Ampere/JadePkg/Ac02AcpiTables/CommonDevices.asi +++ b/Platform/Ampere/JadePkg/Ac02AcpiTables/CommonDevices.asi @@ -174,7 +174,16 @@ Device(GED0) { } Name(_CRS, ResourceTemplate () { Interrupt(ResourceConsumer, Level, ActiveHigh, Exclusive) { 84 } /= / GHES + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 44 } = // PCIe Hot Plug Doorbell Insertion & Ejection (DBNS4 -> GIC-IRQS44) }) + + // @DBN4 agent base address for HP PCIe insertion/ejection event: 0x10= 00.0054.4000 + OperationRegion(DBN4, SystemMemory, 0x100000544010, 20) + Field (DBN4, DWordAcc, NoLock, Preserve) { + DOUT, 32, // event and PCIe port information at offset 0x10 + offset (0x10), + STA4, 32, // interrupt status at offset 0x20 + } } =20 // Shutdown button using GED. @@ -511,3 +520,18 @@ Device(NVDR) { } } } + +// +// LED Device +Device(LED) { + Name(_HID, "AMPC0008") + Name(_CCA, ONE) + Name(_STR, Unicode("Altra LED Device")) + + Name (_DSD, Package () { + ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), + Package () { + Package () { "uuid", Package (4) { 0x5598273c, 0xa49611ea, 0xbb37024= 2, 0xac130002 }}, + } + }) +} diff --git a/Platform/Ampere/JadePkg/Ac02AcpiTables/Dsdt.asl b/Platform/Amp= ere/JadePkg/Ac02AcpiTables/Dsdt.asl index ce12272f961d..f2977d4e58a8 100644 --- a/Platform/Ampere/JadePkg/Ac02AcpiTables/Dsdt.asl +++ b/Platform/Ampere/JadePkg/Ac02AcpiTables/Dsdt.asl @@ -12,8 +12,519 @@ DefinitionBlock("Dsdt.aml", "DSDT", 0x02, "Ampere", "Ja= de", 1) { Name(\BDMD, "Altra Max Jade Board") Name(AERF, 0) // PCIe AER Firmware-First =20 + Include ("MHPP.asi") + Scope(\_SB) { + Include ("CommonDevices.asi") + + Scope(\_SB.GED0) { + Method(_EVT, 1, Serialized) { + Switch (ToInteger(Arg0)) { + Case (84) { // GHES interrupt + Notify (HED0, 0x80) + } + + Case (44) { // doorbell notification (Insertion/ejection) + local0 =3D DOUT & 0x00FF0000 + if (local0 =3D=3D 0x00010000) { + local0 =3D STA4 & 0xFFFFFFFF + if (local0) { + Store(local0, STA4) // clear interrupt + } + local0 =3D A050 & 0xFF000000 + if ((local0 =3D=3D 0x01000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCI5.P2P1, 1) // insertion action + } + local0 =3D A051 & 0xFF000000 + if ((local0 =3D=3D 0x01000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCI5.P2P2, 1) // insertion action + } + local0 =3D A052 & 0xFF000000 + if ((local0 =3D=3D 0x01000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCI5.P2P3, 1) // insertion action + } + local0 =3D A053 & 0xFF000000 + if ((local0 =3D=3D 0x01000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCI5.P2P4, 1) // insertion action + } + local0 =3D A040 & 0xFF000000 + if ((local0 =3D=3D 0x01000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCI4.P2P1, 1) // insertion action + } + local0 =3D A041 & 0xFF000000 + if ((local0 =3D=3D 0x01000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCI4.P2P2, 1) // insertion action + } + local0 =3D A042 & 0xFF000000 + if ((local0 =3D=3D 0x01000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCI4.P2P3, 1) // insertion action + } + local0 =3D A043 & 0xFF000000 + if ((local0 =3D=3D 0x01000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCI4.P2P4, 1) // insertion action + } + local0 =3D A160 & 0xFF000000 + if ((local0 =3D=3D 0x01000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIE.P2P1, 1) // insertion action + } + local0 =3D A161 & 0xFF000000 + if ((local0 =3D=3D 0x01000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIE.P2P2, 1) // insertion action + } + local0 =3D A162 & 0xFF000000 + if ((local0 =3D=3D 0x01000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIE.P2P3, 1) // insertion action + } + local0 =3D A163 & 0xFF000000 + if ((local0 =3D=3D 0x01000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIE.P2P4, 1) // insertion action + } + + local0 =3D A170 & 0xFF000000 + if ((local0 =3D=3D 0x01000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIF.P2P1, 1) // insertion action + } + local0 =3D A171 & 0xFF000000 + if ((local0 =3D=3D 0x01000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIF.P2P2, 1) // insertion action + } + local0 =3D A172 & 0xFF000000 + if ((local0 =3D=3D 0x01000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIF.P2P3, 1) // insertion action + } + local0 =3D A173 & 0xFF000000 + if ((local0 =3D=3D 0x01000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIF.P2P4, 1) // insertion action + } + + local0 =3D A150 & 0xFF000000 + if ((local0 =3D=3D 0x01000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCID.P2P1, 1) // insertion action + } + local0 =3D A151 & 0xFF000000 + if ((local0 =3D=3D 0x01000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCID.P2P2, 1) // insertion action + } + local0 =3D A152 & 0xFF000000 + if ((local0 =3D=3D 0x01000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCID.P2P3, 1) // insertion action + } + local0 =3D A153 & 0xFF000000 + if ((local0 =3D=3D 0x01000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCID.P2P4, 1) // insertion action + } + + + local0 =3D A120 & 0xFF000000 + if ((local0 =3D=3D 0x01000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIA.P2P1, 1) // insertion action + } + local0 =3D A121 & 0xFF000000 + if ((local0 =3D=3D 0x01000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIA.P2P2, 1) // insertion action + } + local0 =3D A122 & 0xFF000000 + if ((local0 =3D=3D 0x01000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIA.P2P3, 1) // insertion action + } + local0 =3D A123 & 0xFF000000 + if ((local0 =3D=3D 0x01000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIA.P2P4, 1) // insertion action + } + } + elseif (local0 =3D=3D 0x00000000) { + local0 =3D STA4 & 0xFFFFFFFF + if (local0) { + Store(local0, STA4) // clear interrupt + } + local0 =3D A050 & 0xFF000000 + if (local0 =3D=3D 0x00000000) { + Notify (\_SB.PCI5.P2P1, 1) // ejection action + A050 =3D 0x10000500 // inprogress remove + } + local0 =3D A051 & 0xFF000000 + if (local0 =3D=3D 0x00000000) { + Notify (\_SB.PCI5.P2P2, 1) // ejection action + A051 =3D 0x10010500 // inprogress remove + } + local0 =3D A052 & 0xFF000000 + if (local0 =3D=3D 0x00000000) { + Notify (\_SB.PCI5.P2P3, 1) // ejection action + A052 =3D 0x10020500 // inprogress remove + } + local0 =3D A053 & 0xFF000000 + if (local0 =3D=3D 0x00000000) { + Notify (\_SB.PCI5.P2P4, 1) // ejection action + A053 =3D 0x10030500 // inprogress remove + } + local0 =3D A040 & 0xFF000000 + if (local0 =3D=3D 0x00000000) { + Notify (\_SB.PCI4.P2P1, 1) // ejection action + A040 =3D 0x10000400 // inprogress remove + } + local0 =3D A041 & 0xFF000000 + if (local0 =3D=3D 0x00000000) { + Notify (\_SB.PCI4.P2P2, 1) // ejection action + A041 =3D 0x10010400 // inprogress remove + } + local0 =3D A042 & 0xFF000000 + if (local0 =3D=3D 0x00000000) { + Notify (\_SB.PCI4.P2P3, 1) // ejection action + A042 =3D 0x10020400 // inprogress remove + } + local0 =3D A043 & 0xFF000000 + if (local0 =3D=3D 0x00000000) { + Notify (\_SB.PCI4.P2P4, 1) // ejection action + A043 =3D 0x10030400 // inprogress remove + } + local0 =3D A160 & 0xFF000000 + if (local0 =3D=3D 0x00000000) { + Notify (\_SB.PCIE.P2P1, 1) // ejection action + A160 =3D 0x10000601 // inprogress remove + } + local0 =3D A161 & 0xFF000000 + if (local0 =3D=3D 0x00000000) { + Notify (\_SB.PCIE.P2P2, 1) // ejection action + A161 =3D 0x10010601 // inprogress remove + } + local0 =3D A162 & 0xFF000000 + if (local0 =3D=3D 0x00000000) { + Notify (\_SB.PCIE.P2P3, 1) // ejection action + A162 =3D 0x10020601 // inprogress remove + } + local0 =3D A163 & 0xFF000000 + if (local0 =3D=3D 0x00000000) { + Notify (\_SB.PCIE.P2P4, 1) // ejection action + A163 =3D 0x10030601 // inprogress remove + } + + local0 =3D A170 & 0xFF000000 + if (local0 =3D=3D 0x00000000) { + Notify (\_SB.PCIF.P2P1, 1) // ejection action + A170 =3D 0x10000701 // inprogress remove + } + local0 =3D A171 & 0xFF000000 + if (local0 =3D=3D 0x00000000) { + Notify (\_SB.PCIF.P2P2, 1) // ejection action + A171 =3D 0x10010701 // inprogress remove + } + local0 =3D A172 & 0xFF000000 + if (local0 =3D=3D 0x00000000) { + Notify (\_SB.PCIF.P2P3, 1) // ejection action + A172 =3D 0x10020701 // inprogress remove + } + local0 =3D A173 & 0xFF000000 + if (local0 =3D=3D 0x00000000) { + Notify (\_SB.PCIF.P2P4, 1) // ejection action + A173 =3D 0x10030701 // inprogress remove + } + + local0 =3D A150 & 0xFF000000 + if (local0 =3D=3D 0x00000000) { + Notify (\_SB.PCID.P2P1, 1) // ejection action + A150 =3D 0x10000501 // inprogress remove + } + local0 =3D A151 & 0xFF000000 + if (local0 =3D=3D 0x00000000) { + Notify (\_SB.PCID.P2P2, 1) // ejection action + A151 =3D 0x10010501 // inprogress remove + } + local0 =3D A152 & 0xFF000000 + if (local0 =3D=3D 0x00000000) { + Notify (\_SB.PCID.P2P3, 1) // ejection action + A152 =3D 0x10020501 // inprogress remove + } + local0 =3D A153 & 0xFF000000 + if (local0 =3D=3D 0x00000000) { + Notify (\_SB.PCID.P2P4, 1) // ejection action + A153 =3D 0x10030501 // inprogress remove + } + + local0 =3D A120 & 0xFF000000 + if (local0 =3D=3D 0x00000000) { + Notify (\_SB.PCIA.P2P1, 1) // ejection action + A120 =3D 0x10000201 // inprogress remove + } + local0 =3D A121 & 0xFF000000 + if (local0 =3D=3D 0x00000000) { + Notify (\_SB.PCIA.P2P2, 1) // ejection action + A121 =3D 0x10010201 // inprogress remove + } + local0 =3D A122 & 0xFF000000 + if (local0 =3D=3D 0x00000000) { + Notify (\_SB.PCIA.P2P3, 1) // ejection action + A122 =3D 0x10020201 // inprogress remove + } + local0 =3D A123 & 0xFF000000 + if (local0 =3D=3D 0x00000000) { + Notify (\_SB.PCIA.P2P4, 1) // ejection action + A123 =3D 0x10030201 // inprogress remove + } + } + elseif (local0 =3D=3D 0x00020000) { // is either unstable li= nk or too fast insertion? + local0 =3D STA4 & 0xFFFFFFFF + if (local0) { + Store(local0, STA4) // clear interrupt + } + local0 =3D A050 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCI5.P2P1, 3) // force remove bridge port a= nd port itself + Notify (\_SB.PCI5.P2P1, 1) // insertion action + } + local0 =3D A051 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCI5.P2P2, 3) // force remove bridge port a= nd port itself + Notify (\_SB.PCI5.P2P2, 1) // insertion action + } + local0 =3D A052 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCI5.P2P3, 3) // force remove bridge port a= nd port itself + Notify (\_SB.PCI5.P2P3, 1) // insertion action + } + local0 =3D A053 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCI5.P2P4, 3) // force remove bridge port a= nd port itself + Notify (\_SB.PCI5.P2P4, 1) // insertion action + } + local0 =3D A040 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCI4.P2P1, 3) // force remove bridge port a= nd port itself + Notify (\_SB.PCI4.P2P1, 1) // insertion action + } + local0 =3D A041 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCI4.P2P2, 3) // force remove bridge port a= nd port itself + Notify (\_SB.PCI4.P2P2, 1) // insertion action + } + local0 =3D A042 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCI4.P2P3, 3) // force remove bridge port a= nd port itself + Notify (\_SB.PCI4.P2P3, 1) // insertion action + } + local0 =3D A043 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCI4.P2P4, 3) // force remove bridge port a= nd port itself + Notify (\_SB.PCI4.P2P4, 1) // insertion action + } + local0 =3D A160 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIE.P2P1, 3) // force remove bridge port a= nd port itself + Notify (\_SB.PCIE.P2P1, 1) // insertion action + } + local0 =3D A161 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIE.P2P2, 3) // force remove bridge port a= nd port itself + Notify (\_SB.PCIE.P2P2, 1) // insertion action + } + local0 =3D A162 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIE.P2P3, 3) // force remove bridge port a= nd port itself + Notify (\_SB.PCIE.P2P3, 1) // insertion action + } + local0 =3D A163 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIE.P2P4, 3) // force remove bridge port a= nd port itself + Notify (\_SB.PCIE.P2P4, 1) // insertion action + } + + local0 =3D A170 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIF.P2P1, 3) // force remove bridge port a= nd port itself + Notify (\_SB.PCIF.P2P1, 1) // insertion action + } + local0 =3D A171 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIF.P2P2, 3) // force remove bridge port a= nd port itself + Notify (\_SB.PCIF.P2P2, 1) // insertion action + } + local0 =3D A172 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIF.P2P3, 3) // force remove bridge port a= nd port itself + Notify (\_SB.PCIF.P2P3, 1) // insertion action + } + local0 =3D A173 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIF.P2P4, 3) // force remove bridge port a= nd port itself + Notify (\_SB.PCIF.P2P4, 1) // insertion action + } + + local0 =3D A150 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCID.P2P1, 3) // force remove bridge port a= nd port itself + Notify (\_SB.PCID.P2P1, 1) // insertion action + } + local0 =3D A151 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCID.P2P2, 3) // force remove bridge port a= nd port itself + Notify (\_SB.PCID.P2P2, 1) // insertion action + } + local0 =3D A152 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCID.P2P3, 3) // force remove bridge port a= nd port itself + Notify (\_SB.PCID.P2P3, 1) // insertion action + } + local0 =3D A153 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCID.P2P4, 3) // force remove bridge port a= nd port itself + Notify (\_SB.PCID.P2P4, 1) // insertion action + } + + local0 =3D A120 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIA.P2P1, 3) // force remove bridge port a= nd port itself + Notify (\_SB.PCIA.P2P1, 1) // insertion action + } + local0 =3D A121 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIA.P2P2, 3) // force remove bridge port a= nd port itself + Notify (\_SB.PCIA.P2P2, 1) // insertion action + } + local0 =3D A122 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIA.P2P3, 3) // force remove bridge port a= nd port itself + Notify (\_SB.PCIA.P2P3, 1) // insertion action + } + local0 =3D A123 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIA.P2P4, 3) // force remove bridge port a= nd port itself + Notify (\_SB.PCIA.P2P4, 1) // insertion action + } + } + elseif (local0 =3D=3D 0x00030000) { // got incomplete remove= before? + local0 =3D STA4 & 0xFFFFFFFF + if (local0) { + Store(local0, STA4) // clear interrupt + } + local0 =3D A050 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCI5.P2P1.S0F0, 3) // remove port itself + Notify (\_SB.PCI5.P2P1, 1) // insertion action + } + local0 =3D A051 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCI5.P2P2.S0F0, 3) // remove port itself + Notify (\_SB.PCI5.P2P2, 1) // insertion action + } + local0 =3D A052 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCI5.P2P3.S0F0, 3) // remove port itself + Notify (\_SB.PCI5.P2P3, 1) // insertion action + } + local0 =3D A053 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCI5.P2P4.S0F0, 3) // remove port itself + Notify (\_SB.PCI5.P2P4, 1) // insertion action + } + local0 =3D A040 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCI4.P2P1.S0F0, 3) // remove port itself + Notify (\_SB.PCI4.P2P1, 1) // insertion action + } + local0 =3D A041 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCI4.P2P2.S0F0, 3) // remove port itself + Notify (\_SB.PCI4.P2P2, 1) // insertion action + } + local0 =3D A042 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCI4.P2P3.S0F0, 3) // remove port itself + Notify (\_SB.PCI4.P2P3, 1) // insertion action + } + local0 =3D A043 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCI4.P2P4.S0F0, 3) // remove port itself + Notify (\_SB.PCI4.P2P4, 1) // insertion action + } + local0 =3D A160 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIE.P2P1.S0F0, 3) // remove port itself + Notify (\_SB.PCIE.P2P1, 1) // insertion action + } + local0 =3D A161 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIE.P2P2.S0F0, 3) // remove port itself + Notify (\_SB.PCIE.P2P2, 1) // insertion action + } + local0 =3D A162 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIE.P2P3.S0F0, 3) // remove port itself + Notify (\_SB.PCIE.P2P3, 1) // insertion action + } + local0 =3D A163 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIE.P2P4.S0F0, 3) // remove port itself + Notify (\_SB.PCIE.P2P4, 1) // insertion action + } + + local0 =3D A170 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIF.P2P1.S0F0, 3) // remove port itself + Notify (\_SB.PCIF.P2P1, 1) // insertion action + } + local0 =3D A171 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIF.P2P2.S0F0, 3) // remove port itself + Notify (\_SB.PCIF.P2P2, 1) // insertion action + } + local0 =3D A172 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIF.P2P3.S0F0, 3) // remove port itself + Notify (\_SB.PCIF.P2P3, 1) // insertion action + } + local0 =3D A173 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIF.P2P4.S0F0, 3) // remove port itself + Notify (\_SB.PCIF.P2P4, 1) // insertion action + } + + local0 =3D A150 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCID.P2P1.S0F0, 3) // remove port itself + Notify (\_SB.PCID.P2P1, 1) // insertion action + } + local0 =3D A151 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCID.P2P2.S0F0, 3) // remove port itself + Notify (\_SB.PCID.P2P2, 1) // insertion action + } + local0 =3D A152 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCID.P2P3.S0F0, 3) // remove port itself + Notify (\_SB.PCID.P2P3, 1) // insertion action + } + local0 =3D A153 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCID.P2P4.S0F0, 3) // remove port itself + Notify (\_SB.PCID.P2P4, 1) // insertion action + } + + local0 =3D A120 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIA.P2P1.S0F0, 3) // remove port itself + Notify (\_SB.PCIA.P2P1, 1) // insertion action + } + local0 =3D A121 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIA.P2P2.S0F0, 3) // remove port itself + Notify (\_SB.PCIA.P2P2, 1) // insertion action + } + local0 =3D A122 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIA.P2P3.S0F0, 3) // remove port itself + Notify (\_SB.PCIA.P2P3, 1) // insertion action + } + local0 =3D A123 & 0xFF000000 + if ((local0 =3D=3D 0x0E000000) || (local0 =3D=3D 0x0F00000= 0)) { + Notify (\_SB.PCIA.P2P4.S0F0, 3) // remove port itself + Notify (\_SB.PCIA.P2P4, 1) // insertion action + } + } + } + } + } + } + Include ("PCI-S0.Rca01.asi") Include ("PCI-S0.asi") Include ("PCI-S1.asi") diff --git a/Platform/Ampere/JadePkg/Ac02AcpiTables/MHPP.asi b/Platform/Amp= ere/JadePkg/Ac02AcpiTables/MHPP.asi new file mode 100644 index 000000000000..ae166fd33a92 --- /dev/null +++ b/Platform/Ampere/JadePkg/Ac02AcpiTables/MHPP.asi @@ -0,0 +1,92 @@ +/** @file + + Copyright (c) 2023, Ampere Computing LLC. All rights reserved.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +// @DRAM base address 0x88970000 +// Regarding updating the status of hotplug PCIe ports, a shared DRAM +// memory region between Arm Trusted Firmware and UEFI is used to indicate +// PCIe hotplug event action. An item of MHPP table is used to reflect hot= plug +// event of each PCIe port. There is a maximum of 48 PCIe hotplug ports in= Altra +// Family processor, the definition in this table should be aligned with h= otplug +// port map of a specific platform. For example, in Ampere Mt. Jade platfo= rm, +// there are 36 PCIe hotplug ports. Hence, this table defines 40 entries c= orresponding +// to Ampere Mt. Jade PCIe hotplug port map. +OperationRegion(MHPP, SystemMemory, 0x88970000, 960) +Field (MHPP, DWordAcc, NoLock, Preserve) { + A050, 32, // 0. S0 RCA5.0 + A00I, 8, // incomplete remove + offset (24), + A051, 32, // 1. S0 RCA5.1 + A01I, 8, // incomplete remove + offset (48), + A052, 32, // 2. S0 RCA5.2 + A02I, 8, // incomplete remove + offset (72), + A053, 32, // 3. S0 RCA5.3 + A03I, 8, // incomplete remove + offset (96), + A040, 32, // 4. S0 RCA4.0 + A04I, 8, // incomplete remove + offset (120), + A041, 32, // 5. S0 RCA4.1 + A05I, 8, // incomplete remove + offset (144), + A042, 32, // 6. S0 RCA4.0 + A06I, 8, // incomplete remove + offset (168), + A043, 32, // 7. S0 RCA4.1 + A07I, 8, // incomplete remove + offset (192), + A163, 32, // 8. S1 RCA6.3 + A08I, 8, // incomplete remove + offset (216), + A162, 32, // 9 S1 RCA6.2 + A09I, 8, // incomplete remove + offset (240), + A161, 32, // 10. S1 RCA6.1 + A10I, 8, // incomplete remove + offset (264), + A160, 32, // 11. S1 RCA6.0 + A11I, 8, // incomplete remove + offset (288), + A173, 32, // 12. S1 RCA7.3 + A12I, 8, // incomplete remove + offset (312), + A172, 32, // 13. S1 RCA7.2 + A13I, 8, // incomplete remove + offset (336), + A171, 32, // 14. S1 RCA7.1 + A14I, 8, // incomplete remove + offset (360), + A170, 32, // 15. S1 RCA7.0 + A15I, 8, // incomplete remove + offset (384), + A150, 32, // 16. S1 RCA5.0 + A16I, 8, // incomplete remove + offset (408), + A151, 32, // 17. S1 RCA5.1 + A17I, 8, // incomplete remove + offset (432), + A152, 32, // 18. S1 RCA5.2 + A18I, 8, // incomplete remove + offset (456), + A153, 32, // 19. S1 RCA5.3 + A19I, 8, // incomplete remove + offset (480), + A120, 32, // 20. S1 RCA2.0 + A20I, 8, // incomplete remove + offset (504), + A121, 32, // 21 S1 RCA2.1 + A21I, 8, // incomplete remove + offset (528), + A122, 32, // 22. S1 RCA2.2 + A22I, 8, // incomplete remove + offset (552), + A123, 32, // 23. S1 RCA2.3 + A23I, 8, // incomplete remove + offset (576) + } diff --git a/Platform/Ampere/JadePkg/Ac02AcpiTables/PCI-S0.asi b/Platform/A= mpere/JadePkg/Ac02AcpiTables/PCI-S0.asi index b6cf18fb2218..e57a2a9ffd63 100644 --- a/Platform/Ampere/JadePkg/Ac02AcpiTables/PCI-S0.asi +++ b/Platform/Ampere/JadePkg/Ac02AcpiTables/PCI-S0.asi @@ -6,6 +6,15 @@ =20 **/ =20 +Include ("MHPP.asi") + +// @DoorBellNS1 0x1000.0054.1000. Out-Offset: 0x10 +OperationRegion(DNS1, SystemMemory, 0x100000541010 , 8) +Field (DNS1, DWordAcc, NoLock, Preserve) { + OUTV, 32, + DIN0, 32, +} + // PCI2 RCA2 Device (PCI2) { // @@ -997,6 +1006,274 @@ Device (PCI4) { Name (_ADR, 0x00000000) } =20 + // + // Root Port 1 + // + Device (P2P1) { + // + // Device 1, Function 0 (Bus 0). + // + + Name (_ADR, 0x00010000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 1 [01]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A040 =3D=3D 0xF0000400) { // SW ejected ? + Store(0x02000400, A040) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CHG_= CMD =3D 3 + Store(0x68000212, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000212 to DBNS1_10 + Return(0xF) + } + elseif (A040 =3D=3D 0x10000400) { // ejected complete ? + Store(0x02000400, A040) // clear action value + Return(0x0) + } + elseif ((A040 =3D=3D 0x01000400) || (A040 =3D=3D 0x0F000400)) { //= inserted? + if (A04I =3D=3D 0x00) { + Store(0x02000400, A040) // clear action value + } + Return(0xF) + } + elseif ((A040 =3D=3D 0x0E000400) || (A040 =3D=3D 0x0F000400)) { //= inprogress inserted? + if (A04I =3D=3D 0x00) { + Store(0x02000400, A040) // clear action value + } + Return(0xF) + } + else { + Return(0xF) + } + } + + Method (_EJ0, 1) { + if (A040 =3D=3D 0x02000400) { // really sw ejection call? + Store(0xF0000400, A040) // set SW ejection action + Store(0x680000B4, DIN0) // Blink RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CHG_= CMD =3D 3 + Store(0x68000212, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000212 to DBNS1_10 + } + } + + Name(_SUN, 0x00000001) + } + } + + // + // Root Port 2 + // + Device (P2P2) { + // + // Device 2, Function 0 (Bus 0). + // + + Name (_ADR, 0x00020000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 2 [02]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A041 =3D=3D 0xF0010400) { // SW ejected ? + Store(0x02010400, A041) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CHG_= CMD =3D 3 + Store(0x68000222, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000222 to DBNS1_10 + Return(0xF) + } + elseif (A041 =3D=3D 0x10010400) { // ejected complete ? + Store(0x02010400, A041) // clear action value + Return(0x0) + } + elseif ((A041 =3D=3D 0x01010400) || (A041 =3D=3D 0x0F010400)) { //= inserted? + if (A04I =3D=3D 0x00) { + Store(0x02010400, A041) // clear action value + } + Return(0xF) + } + elseif ((A041 =3D=3D 0x0E010400) || (A041 =3D=3D 0x0F010400)) { //= inprogress inserted? + if (A04I =3D=3D 0x00) { + Store(0x02010400, A041) // clear action value + } + Return(0xF) + } + else { + Return(0xF) + } + } + + Method (_EJ0, 1) { + if (A041 =3D=3D 0x02010400) { // really sw ejection call? + Store(0xF0010400, A041) // set SW ejection action + Store(0x680000B4, DIN0) // Blink RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CHG_= CMD =3D 3 + Store(0x68000222, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000222 to DBNS1_10 + } + } + + Name(_SUN, 0x00000002) + } + } + + // + // Root Port 3 + // + Device (P2P3) { + // + // Device 3, Function 0 (Bus 0). + // + + Name (_ADR, 0x00030000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 3 [03]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A042 =3D=3D 0xF0020400) { // SW ejected ? + Store(0x02020400, A042) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CHG_= CMD =3D 3 + Store(0x68000232, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000232 to DBNS1_10 + Return(0xF) + } + elseif (A042 =3D=3D 0x10020400) { // ejected complete ? + Store(0x02020400, A042) // clear action value + Return(0x0) + } + elseif ((A042 =3D=3D 0x01020400) || (A042 =3D=3D 0x0F020400)) { //= inserted? + if (A06I =3D=3D 0x00) { + Store(0x02020400, A042) // clear action value + } + Return(0xF) + } + elseif ((A042 =3D=3D 0x0E020400) || (A042 =3D=3D 0x0F020400)) { //= inprogress inserted? + if (A06I =3D=3D 0x00) { + Store(0x02020400, A042) // clear action value + } + Return(0xF) + } + else { + Return(0xF) + } + } + + Method (_EJ0, 1) { + if (A042 =3D=3D 0x02020400) { // really sw ejection call? + Store(0xF0020400, A042) // set SW ejection action + Store(0x680000B4, DIN0) // Blink RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CHG_= CMD =3D 3 + Store(0x68000232, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000232 to DBNS1_10 + } + } + + Name(_SUN, 0x00000003) + } + } + + // + // Root Port 4 + // + Device (P2P4) { + // + // Device 4, Function 0 (Bus 0). + // + + Name (_ADR, 0x00040000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 4 ([04]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A043 =3D=3D 0xF0030400) { // SW ejected ? + Store(0x02030400, A043) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CHG_= CMD =3D 3 + Store(0x68000242, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000242 to DBNS1_10 + Return(0xF) + } + elseif(A043 =3D=3D 0x10030400) { // ejected complete ? + Store(0x02030400, A043) // clear action value + Return(0x0) + } + elseif((A043 =3D=3D 0x01030400) || (A043 =3D=3D 0x0F030400)) { // = inserted ? + if (A07I =3D=3D 0x00) { + Store(0x02030400, A043) // clear action value + } + Return(0xF) + } + elseif((A043 =3D=3D 0x0E030400) || (A043 =3D=3D 0x0F030400)) { // = inprogress inserted ? + if (A07I =3D=3D 0x00) { + Store(0x02030400, A043) // clear action value + } + Return(0xF) + } + else { + Return(0xF) + } + } + + Method (_EJ0, 1) { + if (A043 =3D=3D 0x02030400) { // really sw ejection call? + Store(0xF0030400, A043) // set SW ejection value + Store(0x680000B4, DIN0) // Blink RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CHG_= CMD =3D 3 + Store(0x68000242, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000242 to DBNS1_10 + } + } + + Name(_SUN, 0x00000004) + } + } + Method (_PXM, 0, NotSerialized) { // Patch by code Return(0xFF) @@ -1341,6 +1618,274 @@ Device (PCI5) { Name (_ADR, 0x00000000) } =20 + // + // Root Port 1 + // + Device (P2P1) { + // + // Device 1, Function 0 (Bus 0). + // + + Name (_ADR, 0x00010000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 1 [01]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A050 =3D=3D 0xF0000500) { // SW ejected ? + Store(0x02000500, A050) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CHG_= CMD =3D 3 + Store(0x68000213, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000213 to DBNS1_10 + Return(0xF) + } + elseif (A050 =3D=3D 0x10000500) { // ejected complete ? + Store(0x02000500, A050) // clear action value + Return(0x0) + } + elseif ((A050 =3D=3D 0x01000500) || (A050 =3D=3D 0x0F000500)) { //= inserted? + if (A00I =3D=3D 0x00) { + Store(0x02000500, A050) // clear action value + } + Return(0xF) + } + elseif ((A050 =3D=3D 0x0E000500) || (A050 =3D=3D 0x0F000500)) { //= inprogress inserted? + if (A00I =3D=3D 0x00) { + Store(0x02000500, A050) // clear action value + } + Return(0xF) + } + else { + Return(0xF) + } + } + + Method (_EJ0, 1) { + if (A050 =3D=3D 0x02000500) { // really sw ejection call? + Store(0xF0000500, A050) // set SW ejection action + Store(0x680000B4, DIN0) // Blink RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CHG_= CMD =3D 3 + Store(0x68000213, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000213 to DBNS1_10 + } + } + + Name(_SUN, 0x00000001) + } + } + + // + // Root Port 2 + // + Device (P2P2) { + // + // Device 2, Function 0 (Bus 0). + // + + Name (_ADR, 0x00020000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 2 [02]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A051 =3D=3D 0xF0010500) { // SW ejected ? + Store(0x02010500, A051) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CHG_= CMD =3D 3 + Store(0x68000223, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000223 to DBNS1_10 + Return(0xF) + } + elseif (A051 =3D=3D 0x10010500) { // ejected complete ? + Store(0x02010500, A051) // clear action value + Return(0x0) + } + elseif ((A051 =3D=3D 0x01010500) || (A051 =3D=3D 0x0F010500)) { //= inserted? + if (A01I =3D=3D 0x00) { + Store(0x02010500, A051) // clear action value + } + Return(0xF) + } + elseif ((A051 =3D=3D 0x0E010500) || (A051 =3D=3D 0x0F010500)) { //= inprogress inserted? + if (A01I =3D=3D 0x00) { + Store(0x02010500, A051) // clear action value + } + Return(0xF) + } + else { + Return(0xF) + } + } + + Method (_EJ0, 1) { + if (A051 =3D=3D 0x02010500) { // really sw ejection call? + Store(0xF0010500, A051) // set SW ejection action + Store(0x680000B4, DIN0) // Blink RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CHG_= CMD =3D 3 + Store(0x68000223, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000223 to DBNS1_10 + } + } + + Name(_SUN, 0x00000002) + } + } + + // + // Root Port 3 + // + Device (P2P3) { + // + // Device 3, Function 0 (Bus 0). + // + + Name (_ADR, 0x00030000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 3 [03]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A052 =3D=3D 0xF0020500) { // SW ejected ? + Store(0x02020500, A052) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CHG_= CMD =3D 3 + Store(0x68000233, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000233 to DBNS1_10 + Return(0xF) + } + elseif (A052 =3D=3D 0x10020500) { // ejected complete ? + Store(0x02020500, A052) // clear action value + Return(0x0) + } + elseif ((A052 =3D=3D 0x01020500) || (A052 =3D=3D 0x0F020500)) { //= inserted? + if (A02I =3D=3D 0x00) { + Store(0x02020500, A052) // clear action value + } + Return(0xF) + } + elseif ((A052 =3D=3D 0x0E020500) || (A052 =3D=3D 0x0F020500)) { //= inprogress inserted? + if (A02I =3D=3D 0x00) { + Store(0x02020500, A052) // clear action value + } + Return(0xF) + } + else { + Return(0xF) + } + } + + Method (_EJ0, 1) { + if (A052 =3D=3D 0x02020500) { // really sw ejection call? + Store(0xF0020500, A052) // set SW ejection action + Store(0x680000B4, DIN0) // Blink RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CHG_= CMD =3D 3 + Store(0x68000233, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000233 to DBNS1_10 + } + } + + Name(_SUN, 0x00000003) + } + } + + // + // Root Port 4 + // + Device (P2P4) { + // + // Device 4, Function 0 (Bus 0). + // + + Name (_ADR, 0x00040000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 4 ([04]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A053 =3D=3D 0xF0030500) { // SW ejected ? + Store(0x02030500, A053) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CHG_= CMD =3D 3 + Store(0x68000243, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000243 to DBNS1_10 + Return(0xF) + } + elseif(A053 =3D=3D 0x10030500) { // ejected complete ? + Store(0x02030500, A053) // clear action value + Return(0x0) + } + elseif((A053 =3D=3D 0x01030500) || (A053 =3D=3D 0x0F030500)) { // = inserted ? + if (A03I =3D=3D 0x00) { + Store(0x02030500, A053) // clear action value + } + Return(0xF) + } + elseif((A053 =3D=3D 0x0E030500) || (A053 =3D=3D 0x0F030500)) { // = inprogress inserted ? + if (A03I =3D=3D 0x00) { + Store(0x02030500, A053) // clear action value + } + Return(0xF) + } + else { + Return(0xF) + } + } + + Method (_EJ0, 1) { + if (A053 =3D=3D 0x02030500) { // really sw ejection call? + Store(0xF0030500, A053) // set SW ejection value + Store(0x680000B4, DIN0) // Blink RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CHG_= CMD =3D 3 + Store(0x68000243, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000243 to DBNS1_10 + } + } + + Name(_SUN, 0x00000004) + } + } + Method (_PXM, 0, NotSerialized) { // Patch by code Return(0xFF) diff --git a/Platform/Ampere/JadePkg/Ac02AcpiTables/PCI-S1.asi b/Platform/A= mpere/JadePkg/Ac02AcpiTables/PCI-S1.asi index cb03247895a6..72548fc8030a 100644 --- a/Platform/Ampere/JadePkg/Ac02AcpiTables/PCI-S1.asi +++ b/Platform/Ampere/JadePkg/Ac02AcpiTables/PCI-S1.asi @@ -330,6 +330,274 @@ Device (PCIA) { Name (_ADR, 0x00000000) } =20 + // + // Root Port 1 + // + Device (P2P1) { + // + // Device 1, Function 0 (Bus 0). + // + + Name (_ADR, 0x00010000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 1 ([01]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A120 =3D=3D 0xF0000201) { // SW ejected before ? + Store(0x02000201, A120) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CHG_= CMD =3D 3 + Store(0x68000216, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000216 to DBNS1_10 + Return (0xF) + } + elseif (A120 =3D=3D 0x10000201) { // ejected completed ? + Store(0x02000201, A120) // clear action value + Return (0x0) + } + elseif ((A120 =3D=3D 0x01000201) || (A120 =3D=3D 0x0F000201)) { //= inserted ? + if (A20I =3D=3D 0x00) { + Store(0x02000201, A120) // clear action value + } + Return (0xF) + } + elseif ((A120 =3D=3D 0x0E000201) || (A120 =3D=3D 0x0F000201)) { //= inprogress inserted ? + if (A20I =3D=3D 0x00) { + Store(0x02000201, A120) // clear action value + } + Return (0xF) + } + else { + Return (0xF) + } + } + + Method (_EJ0, 1) { + if (A120 =3D=3D 0x02000201) { // is sw ejection? + Store(0xF0000201, A120) // set SW ejection event + Store(0x680000B4, DIN0) // Blink RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CHG_= CMD =3D 3 + Store(0x68000216, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000216 to DBNS1_10 + } + } + + Name(_SUN, 0x00000001) + } + } + + // + // Root Port 2 + // + Device (P2P2) { + // + // Device 2, Function 0 (Bus 0). + // + + Name (_ADR, 0x00020000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 2 ([02]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A121 =3D=3D 0xF0010201) { // SW ejected before ? + Store(0x02010201, A121) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CHG_= CMD =3D 3 + Store(0x68000226, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000226 to DBNS1_10 + Return(0xF) + } + elseif (A121 =3D=3D 0x10010201) { // ejected completed ? + Store(0x02010201, A121) // clear action value + Return(0x0) + } + elseif ((A121 =3D=3D 0x01010201) || (A121 =3D=3D 0x0F010201)) { //= inserted ? + if (A21I =3D=3D 0x00) { + Store(0x02010201, A121) // clear action value + } + Return(0xF) + } + elseif ((A121 =3D=3D 0x0E010201) || (A121 =3D=3D 0x0F010201)) { //= inprogress inserted ? + if (A21I =3D=3D 0x00) { + Store(0x02010201, A121) // clear action value + } + Return(0xF) + } + else { + Return (0xF) + } + } + + Method (_EJ0, 1) { + if (A121 =3D=3D 0x02010201) { // is sw ejection? + Store(0xF0010201, A121) // set SW ejection event + Store(0x680000B4, DIN0) // Blink RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CHG_= CMD =3D 3 + Store(0x68000226, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000226 to DBNS1_10 + } + } + + Name(_SUN, 0x00000002) + } + } + + // + // Root Port 3 + // + Device (P2P3) { + // + // Device 3, Function 0 (Bus 0). + // + + Name (_ADR, 0x00030000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 3 [03]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A122 =3D=3D 0xF0020201) { // SW ejected before ? + Store(0x02020201, A122) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CHG_= CMD =3D 3 + Store(0x68000236, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000236 to DBNS1_10 + Return(0xF) + } + elseif (A122 =3D=3D 0x10020201) { // ejected complete ? + Store(0x02020201, A122) // clear action value + Return (0x0) + } + elseif ((A122 =3D=3D 0x01020201) || (A122 =3D=3D 0x0F020201)) { //= inserted ? + if (A22I =3D=3D 0x00) { + Store(0x02020201, A122) // clear action value + } + Return (0xF) + } + elseif ((A122 =3D=3D 0x0E020201) || (A122 =3D=3D 0x0F020201)) { //= inprogess inserted ? + if (A22I =3D=3D 0x00) { + Store(0x02020201, A122) // clear action value + } + Return (0xF) + } + else { + Return (0xF) + } + } + + Method (_EJ0, 1) { + if (A122 =3D=3D 0x02020201) { // is sw ejection? + Store(0xF0020201, A122) // set SW ejection event + Store(0x680000B4, DIN0) // Blink RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CHG_= CMD =3D 3 + Store(0x68000236, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000236 to DBNS1_10 + } + } + + Name(_SUN, 0x00000003) + } + } + + // + // Root Port 4 + // + Device (P2P4) { + // + // Device 4, Function 0 (Bus 0). + // + + Name (_ADR, 0x00040000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 4 [04]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A123 =3D=3D 0xF0030201) { // SW ejected before ? + Store(0x02030201, A123) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CHG_= CMD =3D 3 + Store(0x68000246, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000246 to DBNS1_10 + Return(0xF) + } + elseif (A123 =3D=3D 0x10030201) { // ejected complete ? + Store(0x02030201, A123) // clear action value + Return (0x0) + } + elseif ((A123 =3D=3D 0x01030201) || (A123 =3D=3D 0x0F030201)) { //= inserted ? + if (A23I =3D=3D 0x00) { + Store(0x02030201, A123) // clear action value + } + Return (0xF) + } + elseif ((A123 =3D=3D 0x0E030201) || (A123 =3D=3D 0x0F030201)) { //= inprogress inserted ? + if (A23I =3D=3D 0x00) { + Store(0x02030201, A123) // clear action value + } + Return (0xF) + } + else { + Return (0xF) + } + } + + Method (_EJ0, 1) { + if (A123 =3D=3D 0x02030201) { // is sw ejection? + Store(0xF0030201, A123) // set ejection event + Store(0x680000B4, DIN0) // Blink RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CHG_= CMD =3D 3 + Store(0x68000246, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000246 to DBNS1_10 + } + } + + Name(_SUN, 0x00000004) + } + } + Method (_PXM, 0, NotSerialized) { // Patch by code Return(0xFF) @@ -1350,6 +1618,274 @@ Device (PCID) { Name (_ADR, 0x00000000) } =20 + // + // Root Port 1 + // + Device (P2P1) { + // + // Device 1, Function 0 (Bus 0). + // + + Name (_ADR, 0x00010000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 1 [01]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A150 =3D=3D 0xF0000501) { // SW ejected ? + Store(0x02000501, A150) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CHG_= CMD =3D 3 + Store(0x68000219, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000219 to DBNS1_10 + Return(0xF) + } + elseif (A150 =3D=3D 0x10000501) { // ejected complete ? + Store(0x02000501, A150) // clear action value + Return(0x0) + } + elseif ((A150 =3D=3D 0x01000501) || (A150 =3D=3D 0x0F000501)) { //= inserted? + if (A16I =3D=3D 0x00) { + Store(0x02000501, A150) // clear action value + } + Return(0xF) + } + elseif ((A150 =3D=3D 0x0E000501) || (A150 =3D=3D 0x0F000501)) { //= inprogress inserted? + if (A16I =3D=3D 0x00) { + Store(0x02000501, A150) // clear action value + } + Return(0xF) + } + else { + Return(0xF) + } + } + + Method (_EJ0, 1) { + if (A150 =3D=3D 0x02000501) { // really sw ejection call? + Store(0xF0000501, A150) // set SW ejection action + Store(0x680000B4, DIN0) // Blink RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CHG_= CMD =3D 3 + Store(0x68000219, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000219 to DBNS1_10 + } + } + + Name(_SUN, 0x00000001) + } + } + + // + // Root Port 2 + // + Device (P2P2) { + // + // Device 2, Function 0 (Bus 0). + // + + Name (_ADR, 0x00020000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 2 [02]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A151 =3D=3D 0xF0010501) { // SW ejected ? + Store(0x02010501, A151) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CHG_= CMD =3D 3 + Store(0x68000229, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000229 to DBNS1_10 + Return(0xF) + } + elseif (A151 =3D=3D 0x10010501) { // ejected complete ? + Store(0x02010501, A151) // clear action value + Return(0x0) + } + elseif ((A151 =3D=3D 0x01010501) || (A151 =3D=3D 0x0F010501)) { //= inserted? + if (A17I =3D=3D 0x00) { + Store(0x02010501, A151) // clear action value + } + Return(0xF) + } + elseif ((A151 =3D=3D 0x0E010501) || (A151 =3D=3D 0x0F010501)) { //= inprogress inserted? + if (A17I =3D=3D 0x00) { + Store(0x02010501, A151) // clear action value + } + Return(0xF) + } + else { + Return(0xF) + } + } + + Method (_EJ0, 1) { + if (A151 =3D=3D 0x02010501) { // really sw ejection call? + Store(0xF0010501, A151) // set SW ejection action + Store(0x680000B4, DIN0) // Blink RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CHG_= CMD =3D 3 + Store(0x68000229, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000229 to DBNS1_10 + } + } + + Name(_SUN, 0x00000002) + } + } + + // + // Root Port 3 + // + Device (P2P3) { + // + // Device 3, Function 0 (Bus 0). + // + + Name (_ADR, 0x00030000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 3 [03]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A152 =3D=3D 0xF0020501) { // SW ejected ? + Store(0x02020501, A152) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CHG_= CMD =3D 3 + Store(0x68000239, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000239 to DBNS1_10 + Return(0xF) + } + elseif (A152 =3D=3D 0x10020501) { // ejected complete ? + Store(0x02020501, A152) // clear action value + Return(0x0) + } + elseif ((A152 =3D=3D 0x01020501) || (A152 =3D=3D 0x0F020501)) { //= inserted? + if (A18I =3D=3D 0x00) { + Store(0x02020501, A152) // clear action value + } + Return(0xF) + } + elseif ((A152 =3D=3D 0x0E020501) || (A152 =3D=3D 0x0F020501)) { //= inprogress inserted? + if (A18I =3D=3D 0x00) { + Store(0x02020501, A152) // clear action value + } + Return(0xF) + } + else { + Return(0xF) + } + } + + Method (_EJ0, 1) { + if (A152 =3D=3D 0x02020501) { // really sw ejection call? + Store(0xF0020501, A152) // set SW ejection action + Store(0x680000B4, DIN0) // Blink RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CHG_= CMD =3D 3 + Store(0x68000239, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000239 to DBNS1_10 + } + } + + Name(_SUN, 0x00000003) + } + } + + // + // Root Port 4 + // + Device (P2P4) { + // + // Device 4, Function 0 (Bus 0). + // + + Name (_ADR, 0x00040000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 4 ([04]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A153 =3D=3D 0xF0030501) { // SW ejected ? + Store(0x02030501, A153) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CHG_= CMD =3D 3 + Store(0x68000249, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000249 to DBNS1_10 + Return(0xF) + } + elseif(A153 =3D=3D 0x10030501) { // ejected complete ? + Store(0x02030501, A153) // clear action value + Return(0x0) + } + elseif((A153 =3D=3D 0x01030501) || (A153 =3D=3D 0x0F030501)) { // = inserted ? + if (A19I =3D=3D 0x00) { + Store(0x02030501, A153) // clear action value + } + Return(0xF) + } + elseif((A153 =3D=3D 0x0E030501) || (A153 =3D=3D 0x0F030501)) { // = inprogress inserted ? + if (A19I =3D=3D 0x00) { + Store(0x02030501, A153) // clear action value + } + Return(0xF) + } + else { + Return(0xF) + } + } + + Method (_EJ0, 1) { + if (A153 =3D=3D 0x02030501) { // really sw ejection call? + Store(0xF0030501, A153) // set SW ejection value + Store(0x680000B4, DIN0) // Blink RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CHG_= CMD =3D 3 + Store(0x68000249, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x68000249 to DBNS1_10 + } + } + + Name(_SUN, 0x00000004) + } + } + Method (_PXM, 0, NotSerialized) { // Patch by code Return(0xFF) @@ -1697,6 +2233,274 @@ Device (PCIE) { Name (_ADR, 0x00000000) } =20 + // + // Root Port 1 + // + Device (P2P1) { + // + // Device 1, Function 0 (Bus 0). + // + + Name (_ADR, 0x00010000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 1 ([01]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A160 =3D=3D 0xF0000601) { // SW ejected before ? + Store(0x02000601, A160) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CHG_= CMD =3D 3 + Store(0x6800021A, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x6800021A to DBNS1_10 + Return(0xF) + } + elseif (A160 =3D=3D 0x10000601) { // ejected complete ? + Store(0x02000601, A160) // clear action value + Return (0x0) + } + elseif ((A160 =3D=3D 0x01000601) || (A160 =3D=3D 0x0F000601)){ // = inserted ? + if (A11I =3D=3D 0x00) { + Store(0x02000601, A160) // clear action value + } + Return (0xF) + } + elseif ((A160 =3D=3D 0x0E000601) || (A160 =3D=3D 0x0F000601)) { //= inprogress inserted ? + if (A11I =3D=3D 0x00) { + Store(0x02000601, A160) // clear action value + } + Return (0xF) + } + else { + Return (0xF) + } + } + + Method (_EJ0, 1) { + if (A160 =3D=3D 0x02000601) { // is sw ejection? + Store(0xF0000601, A160) // set SW ejection event + Store(0x680000B4, DIN0) // Blink RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CHG_= CMD =3D 3 + Store(0x6800021A, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x6800021A to DBNS1_10 + } + } + + Name(_SUN, 0x00000001) + } + } + + // + // Root Port 2 + // + Device (P2P2) { + // + // Device 2, Function 0 (Bus 0). + // + + Name (_ADR, 0x00020000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 2 [02]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A161 =3D=3D 0xF0010601) { // SW ejected before ? + Store(0x02010601, A161) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CHG_= CMD =3D 3 + Store(0x6800022A, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x6800022A to DBNS1_10 + Return(0xF) + } + elseif (A161 =3D=3D 0x10010601) { // ejected completed ? + Store(0x02010601, A161) // clear action value + Return (0x0) + } + elseif ((A161 =3D=3D 0x01010601) || (A161 =3D=3D 0x0F010601)){ // = inserted ? + if (A10I =3D=3D 0x00) { + Store(0x02010601, A161) // clear action value + } + Return (0xF) + } + elseif ((A161 =3D=3D 0x0E010601) || (A161 =3D=3D 0x0F010601)) { //= inprogress inserted ? + if (A10I =3D=3D 0x00) { + Store(0x02010601, A161) // clear action value + } + Return (0xF) + } + else { + Return (0xF) + } + } + + Method (_EJ0, 1) { + if (A161 =3D=3D 0x02010601) { // is sw ejection? + Store(0xF0010601, A161) // set SW ejection event + Store(0x680000B4, DIN0) // Blink RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CHG_= CMD =3D 3 + Store(0x6800022A, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x6800022A to DBNS1_10 + } + } + + Name(_SUN, 0x00000002) + } + } + + // + // Root Port 3 + // + Device (P2P3) { + // + // Device 3, Function 0 (Bus 0). + // + + Name (_ADR, 0x00030000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 3 [03]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A162 =3D=3D 0xF0020601) { // SW ejected before ? + Store(0x02020601, A162) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CHG_= CMD =3D 3 + Store(0x6800023A, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x6800023A to DBNS1_10 + Return(0xF) + } + elseif (A162 =3D=3D 0x10020601) { // ejected complete ? + Store(0x02020601, A162) // clear action value + Return (0x0) + } + elseif ((A162 =3D=3D 0x01020601) || (A162 =3D=3D 0x0F020601)) { //= inserted ? + if (A09I =3D=3D 0x00) { + Store(0x02020601, A162) // clear action value + } + Return (0xF) + } + elseif ((A162 =3D=3D 0x0E020601) || (A162 =3D=3D 0x0F020601)) { //= inprogress inserted ? + if (A09I =3D=3D 0x00) { + Store(0x02020601, A162) // clear action value + } + Return (0xF) + } + else { + Return (0xF) + } + } + + Method (_EJ0, 1) { + if (A162 =3D=3D 0x02020601) { // is sw ejection? + Store(0xF0020601, A162) // set SW ejection event + Store(0x680000B4, DIN0) // Blink RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CHG_= CMD =3D 3 + Store(0x6800023A, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x6800023A to DBNS1_10 + } + } + + Name(_SUN, 0x00000003) + } + } + + // + // Root Port 4 + // + Device (P2P4) { + // + // Device 4, Function 0 (Bus 0). + // + + Name (_ADR, 0x00040000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 4 ([04]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A163 =3D=3D 0xF0030601) { // SW ejected before ? + Store(0x02030601, A163) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CHG_= CMD =3D 3 + Store(0x6800024A, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x6800024A to DBNS1_10 + Return(0xF) + } + elseif (A163 =3D=3D 0x10030601) { // ejected complete ? + Store(0x02030601, A163) // clear action value + Return (0x0) + } + elseif ((A163 =3D=3D 0x01030601) || (A163 =3D=3D 0x0F030601)) { //= inserted ? + if (A08I =3D=3D 0x00) { + Store(0x02030601, A163) // clear action value + } + Return (0xF) + } + elseif ((A163 =3D=3D 0x0E030601) || (A163 =3D=3D 0x0F030601)) { //= inprogress inserted ? + if (A08I =3D=3D 0x00) { + Store(0x02030601, A163) // clear action value + } + Return (0xF) + } + else { + Return (0xF) + } + } + + Method (_EJ0, 1) { + if (A163 =3D=3D 0x02030601) { // is sw ejection? + Store(0xF0030601, A163) // set SW ejection event + Store(0x680000B4, DIN0) // Blink RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CHG_= CMD =3D 3 + Store(0x6800024A, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x6800024A to DBNS1_10 + } + } + + Name(_SUN, 0x00000004) + } + } + Method (_PXM, 0, NotSerialized) { // Patch by code Return(0xFF) @@ -2044,6 +2848,274 @@ Device (PCIF) { Name (_ADR, 0x00000000) } =20 + // + // Root Port 1 + // + Device (P2P1) { + // + // Device 1, Function 0 (Bus 0). + // + + Name (_ADR, 0x00010000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 1 ([01]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A170 =3D=3D 0xF0000701) { // SW ejected before ? + Store(0x02000701, A170) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CHG_= CMD =3D 3 + Store(0x6800021B, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x6800021B to DBNS1_10 + Return(0xF) + } + elseif (A170 =3D=3D 0x10000701) { // ejected complete ? + Store(0x02000701, A170) // clear action value + Return (0x0) + } + elseif ((A170 =3D=3D 0x01000701) || (A170 =3D=3D 0x0F000701)){ // = inserted ? + if (A15I =3D=3D 0x00) { + Store(0x02000701, A170) // clear action value + } + Return (0xF) + } + elseif ((A170 =3D=3D 0x0E000701) || (A170 =3D=3D 0x0F000701)) { //= inprogress inserted ? + if (A15I =3D=3D 0x00) { + Store(0x02000701, A170) // clear action value + } + Return (0xF) + } + else { + Return (0xF) + } + } + + Method (_EJ0, 1) { + if (A170 =3D=3D 0x02000701) { // is sw ejection? + Store(0xF0000701, A170) // set SW ejection event + Store(0x680000B4, DIN0) // Blink RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CHG_= CMD =3D 3 + Store(0x6800021B, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x6800021B to DBNS1_10 + } + } + + Name(_SUN, 0x00000001) + } + } + + // + // Root Port 2 + // + Device (P2P2) { + // + // Device 2, Function 0 (Bus 0). + // + + Name (_ADR, 0x00020000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 2 [02]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A171 =3D=3D 0xF0010701) { // SW ejected before ? + Store(0x02010701, A171) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CHG_= CMD =3D 3 + Store(0x6800022B, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x6800022B to DBNS1_10 + Return(0xF) + } + elseif (A171 =3D=3D 0x10010701) { // ejected completed ? + Store(0x02010701, A171) // clear action value + Return (0x0) + } + elseif ((A171 =3D=3D 0x01010701) || (A171 =3D=3D 0x0F010701)){ // = inserted ? + if (A14I =3D=3D 0x00) { + Store(0x02010701, A171) // clear action value + } + Return (0xF) + } + elseif ((A171 =3D=3D 0x0E010701) || (A171 =3D=3D 0x0F010701)) { //= inprogress inserted ? + if (A14I =3D=3D 0x00) { + Store(0x02010701, A171) // clear action value + } + Return (0xF) + } + else { + Return (0xF) + } + } + + Method (_EJ0, 1) { + if (A171 =3D=3D 0x02010701) { // is sw ejection? + Store(0xF0010701, A171) // set SW ejection event + Store(0x680000B4, DIN0) // Blink RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CHG_= CMD =3D 3 + Store(0x6800022B, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x6800022B to DBNS1_10 + } + } + + Name(_SUN, 0x00000002) + } + } + + // + // Root Port 3 + // + Device (P2P3) { + // + // Device 3, Function 0 (Bus 0). + // + + Name (_ADR, 0x00030000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 3 [03]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A172 =3D=3D 0xF0020701) { // SW ejected before ? + Store(0x02020701, A172) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CHG_= CMD =3D 3 + Store(0x6800023B, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x6800023B to DBNS1_10 + Return(0xF) + } + elseif (A172 =3D=3D 0x10020701) { // ejected complete ? + Store(0x02020701, A172) // clear action value + Return (0x0) + } + elseif ((A172 =3D=3D 0x01020701) || (A172 =3D=3D 0x0F020701)) { //= inserted ? + if (A13I =3D=3D 0x00) { + Store(0x02020701, A172) // clear action value + } + Return (0xF) + } + elseif ((A172 =3D=3D 0x0E020701) || (A172 =3D=3D 0x0F020701)) { //= inprogress inserted ? + if (A13I =3D=3D 0x00) { + Store(0x02020701, A172) // clear action value + } + Return (0xF) + } + else { + Return (0xF) + } + } + + Method (_EJ0, 1) { + if (A172 =3D=3D 0x02020701) { // is sw ejection? + Store(0xF0020701, A172) // set SW ejection event + Store(0x680000B4, DIN0) // Blink RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CHG_= CMD =3D 3 + Store(0x6800023B, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x6800023B to DBNS1_10 + } + } + + Name(_SUN, 0x00000003) + } + } + + // + // Root Port 4 + // + Device (P2P4) { + // + // Device 4, Function 0 (Bus 0). + // + + Name (_ADR, 0x00040000) + Name(_HPP, Package(){0x08,0x40, 0x01, 0x00}) + + Device (S0F0) { + // + // On Bus 4 ([04]) + // Slot 0 (Device 0), Function 0 + // + + Name (_ADR, 0x00000000) + + Method (_STA, 0) { + if (A173 =3D=3D 0xF0030701) { // SW ejected before ? + Store(0x02030701, A173) // clear action value + Store(0x680000A4, DIN0) // Off RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CHG_= CMD =3D 3 + Store(0x6800024B, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x6800024B to DBNS1_10 + Return(0xF) + } + elseif (A173 =3D=3D 0x10030701) { // ejected complete ? + Store(0x02030701, A173) // clear action value + Return (0x0) + } + elseif ((A173 =3D=3D 0x01030701) || (A173 =3D=3D 0x0F030701)) { //= inserted ? + if (A12I =3D=3D 0x00) { + Store(0x02030701, A173) // clear action value + } + Return (0xF) + } + elseif ((A173 =3D=3D 0x0E030701) || (A173 =3D=3D 0x0F030701)) { //= inprogress inserted ? + if (A12I =3D=3D 0x00) { + Store(0x02030701, A173) // clear action value + } + Return (0xF) + } + else { + Return (0xF) + } + } + + Method (_EJ0, 1) { + if (A173 =3D=3D 0x02030701) { // is sw ejection? + Store(0xF0030701, A173) // set SW ejection event + Store(0x680000B4, DIN0) // Blink RED LED + // + // Ampere_HP_CMD: LED_CMD =3D 4, HP_CHG_= CMD =3D 3 + Store(0x6800024B, OUTV) // + // action: Insert =3D 1 & Remove =3D 2 + // 0x6800024B to DBNS1_10 + } + } + + Name(_SUN, 0x00000004) + } + } + Method (_PXM, 0, NotSerialized) { // Patch by code Return(0xFF) --=20 2.39.0 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#104719): https://edk2.groups.io/g/devel/message/104719 Mute This Topic: https://groups.io/mt/98831773/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sun May 19 11:06:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+104720+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+104720+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1683823638546226.03228647732874; Thu, 11 May 2023 09:47:18 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id dPJYYY1788612xcZmXxcYroO; Thu, 11 May 2023 09:47:18 -0700 X-Received: from NAM10-BN7-obe.outbound.protection.outlook.com (NAM10-BN7-obe.outbound.protection.outlook.com [40.107.92.123]) by mx.groups.io with SMTP id smtpd.web10.54055.1683792665199109785 for ; Thu, 11 May 2023 01:11:05 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gUrGRNvKovir9+XAD9VwD44osGfyGwWL+Zt8R2rWstdxg5HU/5DZjk1PNwyXi/DdDHvCOT1aAbkD6BCVk8SfxE3yO5J7wZDYw+cs3ZFEaCoUCjGTEApV+sMTcLfUzZKtMVkKvElyC+DUIx3ymMuPj//71iHgRNVksQ6AdnzQX3GD+mAwsLgyjGpKPTHtGYR6StmbRh4easi/5LWRb02HzaR1EIFSVGoogiUE0WyRqsMGru4JVH0UNs61vEVWwHKTywB6oHQXUMIgA3znUk98Uqdzvx8qOVBNK1yafgo2ZmFUpG3geGkgOONRiRo+MLofhDz2RxYoRwzW1U5UbXUFTA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=JX6c9n5RbQNG/t19GXVo9DaUZ0Uc/bEF/sqzYH9YF7E=; b=dDvI0dKuXGcIvZyOtuud2TGjRdXKUAHdq8ExIHZEyP+3NuICbHGDssKpAoqTaFBGrHTuz1GDy7OfziwlO7qIQiE3F7n13cfnZWwwmDU8I3EaPcffW1pK6JGPJhVqRQWMlTLxt8Fn8sPNflEWp05th/cdCoFdq1wu1D4YcnQRdxYjShURKgplKk2vUYJk1C3X74QG1s4ULlrK1x+In24hesNsIi+UkMjPXC1dhkHYp11H5mf7x0jK2AiTn4tDmP1ySAu4gtjrYPBkN488NwoFfXzu1ck9oOCA2Bvv+rvwmo+y9vK6qPJzGX/Ltevrhhf+qS5MVmJXspq33Ug50z4T3g== 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 X-Received: from PH0PR01MB8048.prod.exchangelabs.com (2603:10b6:510:280::7) by DM6PR01MB5436.prod.exchangelabs.com (2603:10b6:5:154::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.31; Thu, 11 May 2023 08:10:54 +0000 X-Received: from PH0PR01MB8048.prod.exchangelabs.com ([fe80::bbdb:b58c:140e:c4e1]) by PH0PR01MB8048.prod.exchangelabs.com ([fe80::bbdb:b58c:140e:c4e1%6]) with mapi id 15.20.6387.019; Thu, 11 May 2023 08:10:53 +0000 From: "Minh Nguyen via groups.io" To: devel@edk2.groups.io CC: patches@amperecomputing.com, quic_llindhol@quicinc.com, ardb+tianocore@kernel.org, nhi@os.amperecomputing.com, tinhnguyen@os.amperecomputing.com, Vu Nguyen , Minh Nguyen Subject: [edk2-devel] [edk2-platforms][PATCH 6/6] AmpereAltraPkg: Enable NVMe Hot Plug feature Date: Thu, 11 May 2023 15:10:11 +0700 Message-ID: <20230511081011.2692963-7-minhnguyen1@os.amperecomputing.com> In-Reply-To: <20230511081011.2692963-1-minhnguyen1@os.amperecomputing.com> References: <20230511081011.2692963-1-minhnguyen1@os.amperecomputing.com> X-ClientProxiedBy: SI2P153CA0033.APCP153.PROD.OUTLOOK.COM (2603:1096:4:190::21) To PH0PR01MB8048.prod.exchangelabs.com (2603:10b6:510:280::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR01MB8048:EE_|DM6PR01MB5436:EE_ X-MS-Office365-Filtering-Correlation-Id: c83f5628-1f84-4309-2955-08db51f73d91 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: QFOKgPsp4vFWOgNR8pc995YpqVJgiQb/O3Tf+28fOYiQwoJq5biG4rUm+D79NkMP1QZTyLMkgwDavk5IscTxQaJwRgrBikoD5k/QCyi8Wpu/k9X2oYQ0A0FMsrl2djEII5La7JnEL1DE7ii8KXIzjy/KVfBJnNOxkzuQ/A5KgQp+Xf3yECmH9+iEoK2OkK0eHVW2j/EqxTMcTlDHxpZo5i0iBc4VOplGQdDsgQY7Wc+yp6r7Q4S5ZGLZyM4B4A+LFrgCtHxzQCHEJPoVarkLIUUZbDHyx5CRq0HnQPqu2rNHwgme3MyWbIplOJ0H92DRr2mbWyLGAIwvZuUoVCTU/efaw5K0F7XxEtPVXPSgrjMKAXW1KagLgH+MhFh2quqvTF6ByU4Y0g9WedQ0v6jiwBkcD4nwk8AUni77U3MOetIiP+jwhHuIHDdajSYn92kQBchX9Eh39FVIqMRrxBYeOpj4zIi3Z23LpeF7LfHoJXvPieUCDfX5aak7tcrmcO6AGSTCP3jWlulBD2N9fG1CD0GXmxBQsJ4PEzHUrgIZSTDq1nlr+AyTANqz3VnPAsJKPtQLOdiY1PWVQOYdnMwh467+6t0QcU+c5sYqqSV6oVZ5I3PYGMTTmkcFFF+2W4Jh X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?pEHpyvc8kFWF+pq09LuThHUGms4AvBMngaQO5woxmuHYVQ/Hglg5FBvGIDrm?= =?us-ascii?Q?qJtWqDloYLErkV2ShG9XbWYUhLhj6woG16o8JYbSJ5gD2zxfMD3Q5rh7MkO5?= =?us-ascii?Q?Jt8Rl31Pe6zxCbgk028+ecBR41FDsTBQF7iej7NU4jXjckmZYi0M7LeDAORc?= =?us-ascii?Q?i1dJ4M5uiV+zUkmGG76e4ezBxpXHrFw2jS/UwbrDhWErPVXHgcheYylHH9D9?= =?us-ascii?Q?Yjsyh0u7CoYMy+4LLlshZY1zaukXDRKnHf/umigMWYnzpJlLFA9lRgdvv4XS?= =?us-ascii?Q?K54zgQnh8yc0E+dlbIjuzqY/rfjZW7FWu50PfOy9++M294lhzdqE0yLfKniX?= =?us-ascii?Q?655VYDCuZxTiSaTQcx/yEF+bwfwggi9Y/SmjMt+oaxRW8OxsXolf6rgC19HR?= =?us-ascii?Q?w8AVZeU49GvibJtIG5Vun4xcY8dBdacmrX4qyEOCA0FX53g260GyG/zDrz5X?= =?us-ascii?Q?mUjtTlnKQAE3GBa94s8f2l92LKVASFIf2lcDNZjkqUOiQvREAW1Ls5X9mNqT?= =?us-ascii?Q?g5F4A0ZZXvoSXzmYZBCjsn69cCqWbzZVEsCx9ZXXRvYiEYOcvOsJnhZhtTiu?= =?us-ascii?Q?AUBG7Lbx31zp3CWV6x6uqYeTb3QHQpdvzag8K/hNVgMCt2YAcrWkabzFJXGx?= =?us-ascii?Q?B2Nrh7AgRCu0C9Fu15hUjKf7W32sG31DRc9BfEyftAFHiq0iVU0ArXErMiM8?= =?us-ascii?Q?tVVNSF+x0jTDoxlGCWgxm0+jzgQTJAJ3+Z5cRksgvqPDd6lpyFzX13htOYJQ?= =?us-ascii?Q?n+pGUC1sKvHoGdQD8rRqqcCKcqyBl/L1fiTt5h2iGx5PlNcd2dsnqhpZ8jGw?= =?us-ascii?Q?W0vsIDsxne/w21x4l3F6SDk89QMuN5pra5F+Tp2YNQFWW9vP9l/fuez+1XfJ?= =?us-ascii?Q?PU8zNCC23Tdd9nj33dm5sr/APhW1APhwNmozBfB0zrKAIcutyk/le2RNPIIc?= =?us-ascii?Q?0T+Pos3ikqPUlJ34/DmSOGMrZubFROQxck6gcI1xlJwQlljkGs/3KwBjIYMq?= =?us-ascii?Q?W2cAxa6DOXY4QQ4Pxejug+lQpPOnLi/ydzRTEIvzlPWk9dmU8nggpkWIZO+0?= =?us-ascii?Q?Ml42wJu4LNtPiJR3P/Ee6toYhB2LScBdTjFBGNMMrnCt6sBJik3GJVZKHqKs?= =?us-ascii?Q?5uuBivaHmkdJgHuo7LRwiZ2XN0yxzvTzC7MdMJYvkUMQUCYikyuL0C1+Sb51?= =?us-ascii?Q?QCLTOUTylDnu4czfIiptt/1xSo+SOVt+stphRq75U/rb/Y94/8pFuHhQw+9K?= =?us-ascii?Q?viYNiSzeo59gkf4BZT8HFRUAtb5+znzfDtytD7wqop7A8NHFu/pVbvmfO/a5?= =?us-ascii?Q?vYhdj5sGV4A8qQTyRUXjwAioxhTwQ1jELf94OO99hRB35OjdnEITzYoJaR+r?= =?us-ascii?Q?E3hTTu5/OWyWEOeiglTiRIQ4pFkB22T7ycK7fWoQNANwVuLeQAFIG2x/iFzA?= =?us-ascii?Q?cdPT8ro9y2KyFfY5xcl1iT05jyY67MMedK22xf0f6IotvEPk/Orc/c57F4P0?= =?us-ascii?Q?GVcQW3T5A1KTwCmC3otQwRighN4T39wPGwRuoUwecMzvb7rU86wxqg4HuqAv?= =?us-ascii?Q?x/e0qCpsYs+/4TviSJiZ0rbsTztlIFr+wYV+tbGYSUwwxdbdBREe/xVY1ZKo?= =?us-ascii?Q?AybC6IlXHwgW5gHNJllnKBqLoRQ6aZ7xpqSQcKmFPMzg?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: c83f5628-1f84-4309-2955-08db51f73d91 X-MS-Exchange-CrossTenant-AuthSource: PH0PR01MB8048.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 May 2023 08:10:53.8376 (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: hZY9bvdXGqAdJoBKCHgANuLcrr4GlumE/K2Pgb/6a/b5hPvGUrbQcOpHXTmI5YDb7jGgNcNZUd04WvPbli4VB7hILYoqM9L4gLg0gqQcXQ6B3pfB37tkaO/wdgjiZg5B X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR01MB5436 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,minhnguyen1@os.amperecomputing.com X-Gm-Message-State: n9x0IcDZ1KVepvjtNgKs9jlex1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1683823638; bh=GyVTWlaFYCaYKdu45spetGgOYP5MfEC7mvoLecRxHQs=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=VVSSjZp8vHjHPtQ3bTzxmXaXgdmjT0uwt6+d8z3i+eIi86UZU2lZW9Yu+N8xoYWQhwd dDVcgSKnaViq8I7/skKbJtodtPc5fqmEVeM4lr1sAZfEAiM//V1KbiPwO4uaxvwroQS55 9wjJSu43clraFPD5MFfbaoGp9vHSu9OkrWw= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1683823640225100045 Content-Type: text/plain; charset="utf-8" From: Vu Nguyen This enables NVMe Hot Plug feature after finishing PCIe set up. This helps to detect NVMe disk when it's removed or inserted into its slot. Signed-off-by: Minh Nguyen --- Silicon/Ampere/AmpereAltraPkg/Drivers/PcieInitPei/PcieInitPei.inf | 3 ++- Silicon/Ampere/AmpereAltraPkg/Drivers/PcieInitPei/PcieInitPei.c | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Silicon/Ampere/AmpereAltraPkg/Drivers/PcieInitPei/PcieInitPei.= inf b/Silicon/Ampere/AmpereAltraPkg/Drivers/PcieInitPei/PcieInitPei.inf index 32d60bec1440..f9d5c927fca3 100644 --- a/Silicon/Ampere/AmpereAltraPkg/Drivers/PcieInitPei/PcieInitPei.inf +++ b/Silicon/Ampere/AmpereAltraPkg/Drivers/PcieInitPei/PcieInitPei.inf @@ -1,6 +1,6 @@ ## @file # -# Copyright (c) 2020 - 2021, Ampere Computing LLC. All rights reserved.
+# Copyright (c) 2020 - 2023, Ampere Computing LLC. All rights reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -30,6 +30,7 @@ [LibraryClasses] BoardPcieLib DebugLib HobLib + PcieHotPlugLib PeimEntryPoint PeiServicesLib =20 diff --git a/Silicon/Ampere/AmpereAltraPkg/Drivers/PcieInitPei/PcieInitPei.= c b/Silicon/Ampere/AmpereAltraPkg/Drivers/PcieInitPei/PcieInitPei.c index 598a2e64d02f..bf4395d48d40 100644 --- a/Silicon/Ampere/AmpereAltraPkg/Drivers/PcieInitPei/PcieInitPei.c +++ b/Silicon/Ampere/AmpereAltraPkg/Drivers/PcieInitPei/PcieInitPei.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -207,6 +208,8 @@ PcieInitEntry ( =20 Ac01PcieCorePostSetupRC (mRootComplexList); =20 + PcieHotPlugStart (); + // // Build Root Complex info Hob // --=20 2.39.0 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#104720): https://edk2.groups.io/g/devel/message/104720 Mute This Topic: https://groups.io/mt/98831774/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-