From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (NAM12-MW2-obe.outbound.protection.outlook.com [40.107.244.123]) by mx.groups.io with SMTP id smtpd.web11.9790.1637167847849599234 for ; Wed, 17 Nov 2021 08:50:48 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@os.amperecomputing.com header.s=selector2 header.b=S7OElWgG; spf=pass (domain: os.amperecomputing.com, ip: 40.107.244.123, mailfrom: nhi@os.amperecomputing.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Xf+uIRYZyOoeABevMqYtIUf2dl/YxeCiMQAZCs86jBMz7n6taJ03VijuczS5AoGiQK6bU/Pjf6IN5pMuYGUSbb71DvqbsGRk5KdNGc/CQ6kz79QwybHkJYYo94sIT/OV8PUIdzZTUs7stc930U6SImMclSTBAuu6poKsjIlArC1Rvtll2ZSOnYxPLxMyjW3eVupX3YPJEY8J7u2x7BS7xu/c/AVMIhBqeC2h78xxPDzV9c1drd6hrPAOJ5zgUCmSfgW9yB6gFLSw3Lqi8BkT51S88r+LfgvsLQ8YWp32QCjxcn+q+eXyLa89a+W0q8zvsv7u2sot+zZcebRNIqGd+Q== 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=TRBU1TRgfRRoslPUz5/dxCiK7HXh9uOlN+hqcW0vgtE=; b=TJCD5BHxM6xNl95b+dUsg2XaBI422qNwrkGJRKS3DsRI0jp7IMIQYVqT325gVFpw0vD5SLgbPWd61MbeDCOo6QuDCYmPleBnukmAkMWPjTcLaoJribZOf4UiAH3hMqd0CN6IEJVAl8yUhG0Z073UA22gR25Jx6OQUYwpK4rakPad1V6vgFyYb1s733ZFE9KpCi7NVlPeKIL3q/nNP0dxngffSBax0ncQfo2QvhW+aKLmo48TyRbThY2Bkp692hP/6gw0wqBMVdLKuYZAkFX1TDV66FtlErb+IqUPx9qP3wLCgyH/MfWS4c2xMP7MtcPPLI9lYULAPR/qjgB/FM9JtA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TRBU1TRgfRRoslPUz5/dxCiK7HXh9uOlN+hqcW0vgtE=; b=S7OElWgGBrm8mPE5kewnDYfJk+lhPGCB8ImT3rt9DT3ogiSxLAcTLcGk657WrhjRDQLWkUHIvH5jDLrnUpEcdDw8G58InR2UVAA5KkFRMuw/vCySb8hQyntTQgK8JuQKeadXTvoD4LQrM2OBebuQbOnOGZUlQgF9tek9gTmr35o= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from PH0PR01MB7287.prod.exchangelabs.com (2603:10b6:510:10a::21) by PH0PR01MB7521.prod.exchangelabs.com (2603:10b6:510:f4::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.19; Wed, 17 Nov 2021 16:50:46 +0000 Received: from PH0PR01MB7287.prod.exchangelabs.com ([fe80::254c:9533:7f35:aee]) by PH0PR01MB7287.prod.exchangelabs.com ([fe80::254c:9533:7f35:aee%4]) with mapi id 15.20.4713.019; Wed, 17 Nov 2021 16:50:46 +0000 From: "Nhi Pham" To: devel@edk2.groups.io CC: patches@amperecomputing.com, nhi@os.amperecomputing.com, vunguyen@os.amperecomputing.com, Thang Nguyen , Chuong Tran , Phong Vo , Leif Lindholm , Michael D Kinney , Ard Biesheuvel , Nate DeSimone Subject: [edk2-platforms][PATCH v5 22/30] AmpereAltraPkg: Add DebugInfoPei module Date: Wed, 17 Nov 2021 23:47:19 +0700 Message-ID: <20211117164727.10922-23-nhi@os.amperecomputing.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211117164727.10922-1-nhi@os.amperecomputing.com> References: <20211117164727.10922-1-nhi@os.amperecomputing.com> X-ClientProxiedBy: HKAPR04CA0001.apcprd04.prod.outlook.com (2603:1096:203:d0::11) To PH0PR01MB7287.prod.exchangelabs.com (2603:10b6:510:10a::21) Return-Path: nhi@os.amperecomputing.com MIME-Version: 1.0 Received: from sw004.amperecomputing.com (118.69.219.201) by HKAPR04CA0001.apcprd04.prod.outlook.com (2603:1096:203:d0::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.21 via Frontend Transport; Wed, 17 Nov 2021 16:50:43 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0d3e500a-654b-4a86-8ce3-08d9a9ea66fb X-MS-TrafficTypeDiagnostic: PH0PR01MB7521: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1850; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xVRE1jGB0VzE2hNM7bI+/YF0kY+2PuMKTNQiXMSo7gSjCZcUhgathj44iWbMFRsCijJgHAhroA0iN5zzT2y+Hu5sFt0utGXJ2WpaGNtVsZVexDrGWguYoqRSdgjdaf+Jt4skNkdcSAEDKZGRku2UIWI5DbHMoSTBrsZrad7+patpj8EfS6EWfD6/mucvP62YKKI/DxVCuz8sDrGo0icu7h9efAXOVzFC7KDTW4jpPzOfWY1bdYht8PboIZ1n4CS32Z7YWRLwxN8vbh2lcxtp4C5aM3putM4KAAGml0WKa0eca4Tj9ZB0USa6jz+/pwkdEiBcXPyL+UWwfv/yTBQbipVHdZmUGcKsSJ6a8Ure6hUwnxLKwjO4Tgs2Aol1qhaz8Ao/wrjamnlJvqcLMm1eZr6nGc/3sM+q4Yg663ANZHHYZbX9sDtaxitbWSGpi0aPmQI6cOpbW4cZLgkMo0WXev8IZLbKpcR56EdROzIPABExQd55bJ19s+iZbN6HMp0CGbhzysIEo5uLF9WTaoMgVmI9dQi2YIJ/UwW31tAe1Fzd0Urd7eASYEmv4+IFw1wgSjlOXKhX2LNUF0eur+E7pLQ9nrydVinT0XiCcAIYB1TPsPw9pwXKyinutIT8iTeXEKRXVFTS+2mjw4DL+eRHUG6itrgwf/N0zZsQJWCDhVV4l9l/gjacIEqs5QYjY6Ix4+6bbzdu1zWVbcoIpF5JzQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR01MB7287.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(54906003)(316002)(1076003)(8676002)(6506007)(4326008)(52116002)(86362001)(186003)(6512007)(6916009)(66556008)(2906002)(83380400001)(66476007)(956004)(38100700002)(8936002)(2616005)(38350700002)(6666004)(5660300002)(66946007)(6486002)(508600001)(26005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?I5b4CiPz61jV8ajUirqwwQG2CblYEko0EfsHX4QPaOSUj/tp5MWswbz0r18g?= =?us-ascii?Q?9+ODdNJyBCLnzYR28ixrUrFMosqmO/gdKVZA69mn1e1KPHFKRB4qSBaB0CKU?= =?us-ascii?Q?Sf9nuXmpwL/1HfElhwXUz+Ab4IXEKF2wINLkt2uSjfd7Zr7MdaJ5qHzkL6XP?= =?us-ascii?Q?b36VsTrdulUc7DiIFxlcGIRnRJvTE3yBVMBqUbDzmbXh6umJhc7rcLMbIaPG?= =?us-ascii?Q?OxmAz+O/CqTY7+swPAJrTE86r5hsCpFZPU9pm0e7X8AHBleJno61C6157i0m?= =?us-ascii?Q?0oxojfMn1q4e/GnUK+WGvnASClPaeFyL70XIeMt6Ljr+Dpxp9g6xRSc+Yjdl?= =?us-ascii?Q?PR8jPE9Qz2Ntf4+nFzhkmYdYlujgnD/qqObeloqVUEYChuu8Z5P+kuhbQW5a?= =?us-ascii?Q?68oiPo1zFnJhzq+5A3IeeqD/nRl97NXlOVHl3SiUKHHt3CrpFP2V6e163Sip?= =?us-ascii?Q?9A4haZuReNSntXP80DqIUIzENS533kSwrmGXs6Ss9t8ylUS9yfcV0coP7fWR?= =?us-ascii?Q?7gEyl1jU3lC19a9nRONDypQ9j0vWYngzGVWANsdy793oXFuTyffdIL6ni4/E?= =?us-ascii?Q?Pqi2vTJkYnva+waF5Xq+ZX+0WmUij9c8oVinJievGgoAPiqps5ANvXD5675/?= =?us-ascii?Q?kCijmvEI4QGb364gz1ErNJEJkdimIiPwjNTzi9uMvAuTr5+A9oOAJTSr745i?= =?us-ascii?Q?K4rZosOCMUu0wbmzj/cO3iYI4qksBT/Bmj0ppkJxsxQON8Rv4pFu52tK61QS?= =?us-ascii?Q?UeVdFTvX/Kusv13a78VeOJtBzPL46vvLtjZyIeUN6QMqOCLeja7hyuaX7QcT?= =?us-ascii?Q?SMAzJ4yeWo5TWUd9QKLDzapiVkjQqlWJZHP49+f91lnKms+OJBcqoUH6ecda?= =?us-ascii?Q?ZZH7V3dJDRV46YbmKiWJ4jTxbCcakRmN0prJy4G39NK9frJFhQZ/LGS2e7dg?= =?us-ascii?Q?Ln20zLjCClRPOs+Qt0Aaiz7HvKf0eddnvhMhgzGe1px3op5hmoIc1DtmemQA?= =?us-ascii?Q?VzsC+dYGy01p0MeCHluhDQNB0vQZFMyTFJK7C18gM4jsQ0042KISnVrUeG8O?= =?us-ascii?Q?IEqFNrLIb2+o8d6AuKJZpQr7HS2/DTzjZPrihT5jqLd0hsFbMzmbZnKkGWUd?= =?us-ascii?Q?oB3+90gCv+pSFkOmjXNDb1m2Y4gW9jRUhnVypZB8KHovI0RqWh9zIVBaUBkz?= =?us-ascii?Q?KRJZkgwGOAepY8NMDitCHET9+seRItWoyGvP+/tvJDQHVSfxhBqeosqkGBce?= =?us-ascii?Q?NI+AHvUauFIHgFWitJuI0yMUNm1bvDTTug6tUZRDPBaqmiBGoyiyqi0GEtoN?= =?us-ascii?Q?1T50UDe4aGz2p1e3kOzRr6TFNyAhX6Pc8Yu1rJiVDelPnRnitzuiIkPYmPJm?= =?us-ascii?Q?BxHLWysGsPxlIjVVsGJqPc+3xJy2OReuTn2ZalGyQKBmh6d8Ogz2Tv+gCa1F?= =?us-ascii?Q?VuTrGoddCpy10od5wphLt1ev7H+6bipUHkAVyJwVax0jhqh6sGOywPleSwn1?= =?us-ascii?Q?FbILYQJKJMwYa/BeFytLMj02tGLYyWdzTMqi990QpRFFkONHDNub4QzqhWk5?= =?us-ascii?Q?ipk94x6OiwUp1gQHy1uDFkOcn7WU1kTdYhTyCdvB02GGMlkuT0e8cgvbdGbE?= =?us-ascii?Q?JYhr9cIXiF3u0flEcR+r/0ZF6IJKU2rPt4kAcJqAOS8ZkTYkOXuTKVPwCulz?= =?us-ascii?Q?vw69VuxLDDDBSrmuK0MkgmMNyTQ=3D?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0d3e500a-654b-4a86-8ce3-08d9a9ea66fb X-MS-Exchange-CrossTenant-AuthSource: PH0PR01MB7287.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Nov 2021 16:50:46.6929 (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: PrEXbJwD8mUDqG5GfJA2FbVDez/K8blSTFn1JuWh0xswRzIwSIiYshIIYJDeJWG3uKHeOg5BvyZOvor0CUPyywq0Br6ogmwZQj6E2SA/7tE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR01MB7521 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain From: Vu Nguyen Helps to show various system information like CPU info and Board Setting values to UART console during boot process. Cc: Thang Nguyen Cc: Chuong Tran Cc: Phong Vo Cc: Leif Lindholm Cc: Michael D Kinney Cc: Ard Biesheuvel Cc: Nate DeSimone Signed-off-by: Nhi Pham Reviewed-by: Leif Lindholm --- Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dsc.inc | 4 = + Platform/Ampere/JadePkg/Jade.fdf | 2 = + Silicon/Ampere/AmpereAltraPkg/Drivers/DebugInfoPei/DebugInfoPei.inf | 40 = ++++ Silicon/Ampere/AmpereAltraPkg/Drivers/DebugInfoPei/DebugInfoPei.c | 209 = ++++++++++++++++++++ 4 files changed, 255 insertions(+) diff --git a/Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dsc.inc b/Silicon= /Ampere/AmpereAltraPkg/AmpereAltraPkg.dsc.inc index 36d96ff9a63f..f4007d654ec8 100644 --- a/Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dsc.inc +++ b/Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dsc.inc @@ -535,6 +535,10 @@ [Components.common] ArmPlatformPkg/PlatformPei/PlatformPeim.inf Silicon/Ampere/AmpereAltraPkg/Drivers/ATFHobPei/ATFHobPeim.inf ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.inf + Silicon/Ampere/AmpereAltraPkg/Drivers/DebugInfoPei/DebugInfoPei.inf { + + DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPor= t.inf + } Silicon/Ampere/AmpereAltraPkg/Drivers/FlashPei/FlashPei.inf Silicon/Ampere/AmpereAltraPkg/Drivers/PcieInitPei/PcieInitPei.inf ArmPkg/Drivers/CpuPei/CpuPei.inf diff --git a/Platform/Ampere/JadePkg/Jade.fdf b/Platform/Ampere/JadePkg/Jad= e.fdf index 647281fb6b8d..a59b12633691 100644 --- a/Platform/Ampere/JadePkg/Jade.fdf +++ b/Platform/Ampere/JadePkg/Jade.fdf @@ -167,6 +167,8 @@ [FV.FVMAIN_COMPACT] # # Print platform information before passing control into the Driver Exec= ution Environment (DXE) phase # + INF Silicon/Ampere/AmpereAltraPkg/Drivers/DebugInfoPei/DebugInfoPei.inf + INF MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf =20 FILE FV_IMAGE =3D 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 { diff --git a/Silicon/Ampere/AmpereAltraPkg/Drivers/DebugInfoPei/DebugInfoPe= i.inf b/Silicon/Ampere/AmpereAltraPkg/Drivers/DebugInfoPei/DebugInfoPei.inf new file mode 100644 index 000000000000..e9c383565ce5 --- /dev/null +++ b/Silicon/Ampere/AmpereAltraPkg/Drivers/DebugInfoPei/DebugInfoPei.inf @@ -0,0 +1,40 @@ +## @file +# +# Copyright (c) 2020 - 2021, Ampere Computing LLC. All rights reserved. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION =3D 0x0001001B + BASE_NAME =3D DebugInfo + FILE_GUID =3D C0571D26-6176-11E9-8647-D663BD873D93 + MODULE_TYPE =3D PEIM + VERSION_STRING =3D 1.0 + ENTRY_POINT =3D DebugInfoPeiEntryPoint + +[Sources] + DebugInfoPei.c + +[Packages] + ArmPkg/ArmPkg.dec + ArmPlatformPkg/ArmPlatformPkg.dec + MdeModulePkg/MdeModulePkg.dec + MdePkg/MdePkg.dec + Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dec + Silicon/Ampere/AmpereSiliconPkg/AmpereSiliconPkg.dec + +[LibraryClasses] + AmpereCpuLib + ArmLib + DebugLib + HobLib + NVParamLib + PeimEntryPoint + +[Guids] + gPlatformInfoHobGuid + +[Depex] + TRUE diff --git a/Silicon/Ampere/AmpereAltraPkg/Drivers/DebugInfoPei/DebugInfoPe= i.c b/Silicon/Ampere/AmpereAltraPkg/Drivers/DebugInfoPei/DebugInfoPei.c new file mode 100644 index 000000000000..2bb01b686abc --- /dev/null +++ b/Silicon/Ampere/AmpereAltraPkg/Drivers/DebugInfoPei/DebugInfoPei.c @@ -0,0 +1,209 @@ +/** @file + + Copyright (c) 2020 - 2021, Ampere Computing LLC. All rights reserved. + + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#define GB_SCALE_FACTOR 1073741824 +#define MB_SCALE_FACTOR 1048576 +#define KB_SCALE_FACTOR 1024 +#define MHZ_SCALE_FACTOR 1000000 + +/** + Print any existence NVRAM. +**/ +STATIC VOID +PrintNVRAM ( + VOID + ) +{ + EFI_STATUS Status; + NVPARAM Idx; + UINT32 Val; + UINT16 ACLRd =3D NV_PERM_ALL; + BOOLEAN Flag; + + Flag =3D FALSE; + for (Idx =3D NV_PREBOOT_PARAM_START; Idx <=3D NV_PREBOOT_PARAM_MAX; Idx = +=3D NVPARAM_SIZE) { + Status =3D NVParamGet (Idx, ACLRd, &Val); + if (!EFI_ERROR (Status)) { + if (!Flag) { + DebugPrint (DEBUG_INIT, "Pre-boot Configuration Setting:\n"); + Flag =3D TRUE; + } + DebugPrint (DEBUG_INIT, " %04X: 0x%X (%d)\n", (UINT32)Idx, Val, V= al); + } + } + + Flag =3D FALSE; + for (Idx =3D NV_MANU_PARAM_START; Idx <=3D NV_MANU_PARAM_MAX; Idx +=3D N= VPARAM_SIZE) { + Status =3D NVParamGet (Idx, ACLRd, &Val); + if (!EFI_ERROR (Status)) { + if (!Flag) { + DebugPrint (DEBUG_INIT, "Manufacturer Configuration Setting:\n"); + Flag =3D TRUE; + } + DebugPrint (DEBUG_INIT, " %04X: 0x%X (%d)\n", (UINT32)Idx, Val, V= al); + } + } + + Flag =3D FALSE; + for (Idx =3D NV_USER_PARAM_START; Idx <=3D NV_USER_PARAM_MAX; Idx +=3D N= VPARAM_SIZE) { + Status =3D NVParamGet (Idx, ACLRd, &Val); + if (!EFI_ERROR (Status)) { + if (!Flag) { + DebugPrint (DEBUG_INIT, "User Configuration Setting:\n"); + Flag =3D TRUE; + } + DebugPrint (DEBUG_INIT, " %04X: 0x%X (%d)\n", (UINT32)Idx, Val, V= al); + } + } + + Flag =3D FALSE; + for (Idx =3D NV_BOARD_PARAM_START; Idx <=3D NV_BOARD_PARAM_MAX; Idx +=3D= NVPARAM_SIZE) { + Status =3D NVParamGet (Idx, ACLRd, &Val); + if (!EFI_ERROR (Status)) { + if (!Flag) { + DebugPrint (DEBUG_INIT, "Board Configuration Setting:\n"); + Flag =3D TRUE; + } + DebugPrint (DEBUG_INIT, " %04X: 0x%X (%d)\n", (UINT32)Idx, Val, V= al); + } + } +} + +STATIC +CHAR8 * +GetCCIXLinkSpeed ( + IN UINTN Speed + ) +{ + switch (Speed) { + case 1: + return "2.5 GT/s"; + + case 2: + return "5 GT/s"; + + case 3: + return "8 GT/s"; + + case 4: + case 6: + return "16 GT/s"; + + case 0xa: + return "20 GT/s"; + + case 0xf: + return "25 GT/s"; + } + + return "Unknown"; +} + +/** + Print system info +**/ +STATIC VOID +PrintSystemInfo ( + VOID + ) +{ + UINTN Idx; + VOID *Hob; + PLATFORM_INFO_HOB *PlatformHob; + + Hob =3D GetFirstGuidHob (&gPlatformInfoHobGuid); + if (Hob =3D=3D NULL) { + return; + } + + PlatformHob =3D (PLATFORM_INFO_HOB *)GET_GUID_HOB_DATA (Hob); + + DebugPrint (DEBUG_INIT, "SCP FW version : %a\n", (const CHAR8 *)Platf= ormHob->SmPmProVer); + DebugPrint (DEBUG_INIT, "SCP FW build date : %a\n", (const CHAR8 *)Platf= ormHob->SmPmProBuild); + + DebugPrint (DEBUG_INIT, "Failsafe status : %d\n", Platfo= rmHob->FailSafeStatus); + DebugPrint (DEBUG_INIT, "Reset status : %d\n", Platfo= rmHob->ResetStatus); + DebugPrint (DEBUG_INIT, "CPU info\n"); + DebugPrint (DEBUG_INIT, " CPU ID : %X\n", ArmRea= dMidr ()); + DebugPrint (DEBUG_INIT, " CPU Clock : %d MHz\n", Pl= atformHob->CpuClk / MHZ_SCALE_FACTOR); + DebugPrint (DEBUG_INIT, " Number of active sockets : %d\n", GetNum= berOfActiveSockets ()); + DebugPrint (DEBUG_INIT, " Number of active cores : %d\n", GetNum= berOfActiveCores ()); + if (IsSlaveSocketActive ()) { + DebugPrint (DEBUG_INIT, + " Inter Socket Connection 0 : Width: x%d / Speed %a\n", + PlatformHob->Link2PWidth[0], + GetCCIXLinkSpeed (PlatformHob->Link2PSpeed[0]) + ); + DebugPrint (DEBUG_INIT, + " Inter Socket Connection 1 : Width: x%d / Speed %a\n", + PlatformHob->Link2PWidth[1], + GetCCIXLinkSpeed (PlatformHob->Link2PSpeed[1]) + ); + } + for (Idx =3D 0; Idx < GetNumberOfActiveSockets (); Idx++) { + DebugPrint (DEBUG_INIT, " Socket[%d]: Core voltage : %d\n", Idx= , PlatformHob->CoreVoltage[Idx]); + DebugPrint (DEBUG_INIT, " Socket[%d]: SCU ProductID : %X\n", Idx= , PlatformHob->ScuProductId[Idx]); + DebugPrint (DEBUG_INIT, " Socket[%d]: Max cores : %d\n", Idx= , PlatformHob->MaxNumOfCore[Idx]); + DebugPrint (DEBUG_INIT, " Socket[%d]: Warranty : %d\n", Idx= , PlatformHob->Warranty[Idx]); + DebugPrint (DEBUG_INIT, " Socket[%d]: Subnuma : %d\n", Idx= , PlatformHob->SubNumaMode[Idx]); + DebugPrint (DEBUG_INIT, " Socket[%d]: RC disable mask : %X\n", Idx= , PlatformHob->RcDisableMask[Idx]); + DebugPrint (DEBUG_INIT, " Socket[%d]: AVS enabled : %d\n", Idx= , PlatformHob->AvsEnable[Idx]); + DebugPrint (DEBUG_INIT, " Socket[%d]: AVS voltage : %d\n", Idx= , PlatformHob->AvsVoltageMV[Idx]); + } + + DebugPrint (DEBUG_INIT, "SOC info\n"); + DebugPrint (DEBUG_INIT, " DDR Frequency : %d MHz\n", Pl= atformHob->DramInfo.MaxSpeed); + for (Idx =3D 0; Idx < GetNumberOfActiveSockets (); Idx++) { + DebugPrint (DEBUG_INIT, " Socket[%d]: Soc voltage : %d\n", Idx= , PlatformHob->SocVoltage[Idx]); + DebugPrint (DEBUG_INIT, " Socket[%d]: DIMM1 voltage : %d\n", Idx= , PlatformHob->Dimm1Voltage[Idx]); + DebugPrint (DEBUG_INIT, " Socket[%d]: DIMM2 voltage : %d\n", Idx= , PlatformHob->Dimm2Voltage[Idx]); + } + + DebugPrint (DEBUG_INIT, " PCP Clock : %d MHz\n", Pl= atformHob->PcpClk / MHZ_SCALE_FACTOR); + DebugPrint (DEBUG_INIT, " SOC Clock : %d MHz\n", Pl= atformHob->SocClk / MHZ_SCALE_FACTOR); + DebugPrint (DEBUG_INIT, " SYS Clock : %d MHz\n", Pl= atformHob->SysClk / MHZ_SCALE_FACTOR); + DebugPrint (DEBUG_INIT, " AHB Clock : %d MHz\n", Pl= atformHob->AhbClk / MHZ_SCALE_FACTOR); +} + +/** + Entry point function for the PEIM + + @param FileHandle Handle of the file being invoked. + @param PeiServices Describes the list of possible PEI Services. + + @return EFI_SUCCESS If we installed our PPI + +**/ +EFI_STATUS +EFIAPI +DebugInfoPeiEntryPoint ( + IN EFI_PEI_FILE_HANDLE FileHandle, + IN CONST EFI_PEI_SERVICES **PeiServices + ) +{ + PrintSystemInfo (); + PrintNVRAM (); + + return EFI_SUCCESS; +} --=20 2.17.1