From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (NAM11-DM6-obe.outbound.protection.outlook.com [40.107.223.129]) by mx.groups.io with SMTP id smtpd.web11.322.1623775886748028086 for ; Tue, 15 Jun 2021 09:51:26 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@os.amperecomputing.com header.s=selector2 header.b=DvkEwc7d; spf=pass (domain: os.amperecomputing.com, ip: 40.107.223.129, mailfrom: nhi@os.amperecomputing.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SDtEd5bWMX7OL3D1yTa1gYYm/RpfiqzRDiKVlcSN3mEw5/OwFsPCXbk2xGxOCf5bOCP3z9qug/5ufDZHYB9oEw8bDUiAtGF2oJiBFJeYA9i9tGSLyCQTEvJH4fUGBL5Ppkdh51DCWomLLu1Yr4yD2W0o926LAf5ArCnUclNWYYYfNeegwZalP/223rAE97Z8j0l22VmrImPQL9tCwLzn0QpWB+a/v6gf4Z/vA03mqMb6f4suMedX1WlZBBCAOVESQKoHb5bzWIf3I05QObQV7fXJnDlJVqwzQju2tkQzFSnqHP+tbuhDkON/8A2cf4mFnY8FFKlc96fKyNFUfG1UZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Va4kRO46VwgtciuMAsXGJfMYlcl11FBt5GbWdAM//mU=; b=CEK6FOkQkZNOLHbQkSvEDoMm7zfqSnPnGtA7aBv6OGrlgreQcoVOiqq+1+VVYUPVg7Cw0yVWNt/joE1q+39ph4lO0/twDa5TRRadg2I8X6fJ+N0RveUFkkWI2zrHh5GuRchrveHrV5lIxRgrHXTrBh30yB1FMBcOPiZaaOcYt0SJ/TXoGnq3WbJk4yAGMJIF1oEY0DdxSNDra8MGus+OkXPRbWihvSOCWvPuGaPzjeIVdGOnHYaAp7GqumA/6/Yb3pH6VVv4ODH8urs2FAHNVd2Yz5FouPN1v/Cj1xYXHSX9hbS/wWMLg99PUDHmm4gLpTG7jcL1n0uz+rH/0aSquQ== 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=Va4kRO46VwgtciuMAsXGJfMYlcl11FBt5GbWdAM//mU=; b=DvkEwc7dCglJrdfVywxNyUc+NCCAmWyLCW+D/0qIs8Z7AKJn3W6FHWLPdtkG02tKfkclixt0zk2lvn2nQh6ajSNVZI738/MPZTi892NHLPFe6n92pZTewhbKpQKQD1iOelc4ozYYIlQrJ0drmVNXMKZaiyvrWpOZ13Emp/Ht3KU= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=os.amperecomputing.com; Received: from DM6PR01MB5849.prod.exchangelabs.com (2603:10b6:5:205::20) by DM8PR01MB6965.prod.exchangelabs.com (2603:10b6:8:16::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.22; Tue, 15 Jun 2021 16:51:25 +0000 Received: from DM6PR01MB5849.prod.exchangelabs.com ([fe80::4d8d:74e3:6747:75a2]) by DM6PR01MB5849.prod.exchangelabs.com ([fe80::4d8d:74e3:6747:75a2%7]) with mapi id 15.20.4219.025; Tue, 15 Jun 2021 16:51:25 +0000 Subject: Re: [edk2-platforms][PATCH v2 21/32] AmpereAltraPkg: Add DebugInfoPei module To: Leif Lindholm Cc: devel@edk2.groups.io, Vu Nguyen , Thang Nguyen , Chuong Tran , Phong Vo , Michael D Kinney , Ard Biesheuvel , Nate DeSimone References: <20210526100724.5359-1-nhi@os.amperecomputing.com> <20210526100724.5359-23-nhi@os.amperecomputing.com> <20210607230855.lrucwc6ccxfsq7rk@leviathan> From: "Nhi Pham" Message-ID: <0b95b281-e392-d5ee-1bad-2887ac43425c@os.amperecomputing.com> Date: Tue, 15 Jun 2021 23:51:17 +0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 In-Reply-To: <20210607230855.lrucwc6ccxfsq7rk@leviathan> X-Originating-IP: [116.110.40.240] X-ClientProxiedBy: HK2PR06CA0017.apcprd06.prod.outlook.com (2603:1096:202:2e::29) To DM6PR01MB5849.prod.exchangelabs.com (2603:10b6:5:205::20) Return-Path: nhi@os.amperecomputing.com MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.1.7] (116.110.40.240) by HK2PR06CA0017.apcprd06.prod.outlook.com (2603:1096:202:2e::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.15 via Frontend Transport; Tue, 15 Jun 2021 16:51:22 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a93d0a0d-69b3-4624-6685-08d9301dd024 X-MS-TrafficTypeDiagnostic: DM8PR01MB6965: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4125; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VxhqS7LRlbWOhZirSgtAoeq5W7OkBNryMevi/449GkbFrhGg5ZELjQ7O/pr4b1Yu/3mOxSazIqoTJK1NJCZ1E86K2wfqEC3FeRTuelUpjWpzUnz2VQTkT2adhKDla+2d2CieNYMrdMkIAKAapo4Jdt2BjUHs6KeJZWxlTw/dg4LTT859fqI0KrtWzPmV2CgRSrawUywzzfiC+I3gq0E4L3l4O/+cCjNjiDLH4OgQGE4HyE1KwzeyUzbuiOQSJodgjXBSQUn6BD+PX4J+RUUXQxDZGYHQ8nJqRjK6zHAa15s4edw0+9wj0rmBldl8Tf1PiOFHH2M1SErNA5UcC64SWV2JVV5ig06YyhojCef9ibsXpcYunJXisRYxSLqAHTwFtvD2WmC7IfDFTqs4OJ5w5jRUjNDI8UL7zxuCD3keV57pFML2IpjsfaAWm/u+ii477ASD7ETYGewkW3R9mr8qiy2Ub7HQDl5bDiqYtgDQT8aoOzr+VaKSdhUv11cyKcmUg4T3DMiqt/aag7bzmUjcyEdZS61ihM8G6PKmFVCDNGRXJmSYa4MrrwFejguRnz3tVyW92zOKnj9hIYEVR5BSSsI8E7IW6ypeySzCzj0kFoJz5npQlgBi96gQwz8hgGxST7lWp0eNb3pXCGk24b/giU9h7ZfzV8ATk7bedl9pXzB9SGOm2XI8WSMNRB4lfoH0ovR3O9UV7axbUA6wXRaoh9b0BLVKpXNoJvkGtboitE4= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR01MB5849.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(4636009)(39840400004)(346002)(376002)(136003)(366004)(396003)(16576012)(30864003)(478600001)(316002)(5660300002)(16526019)(31686004)(186003)(6916009)(2616005)(83380400001)(956004)(38100700002)(38350700002)(2906002)(6666004)(66946007)(8936002)(52116002)(26005)(6486002)(8676002)(54906003)(66556008)(86362001)(66476007)(4326008)(31696002)(53546011)(43740500002)(45980500001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?VVJjNmxHOE41aDRiaGtEUndwK0pGNks0a2N6OGw2WnRPQnBwREFETWZUMGVX?= =?utf-8?B?b091UnBkRHRlM3VNcUoxWldGdXg3UXMyaS9lOXZCQzd0dWNTU1Z5NnRDMWg1?= =?utf-8?B?SEt4ZHIxUmxROC9QNHo1dFNvRXdGSGtSL3NzQmV6b2V1aXBtbng5MnFXQmRJ?= =?utf-8?B?QmkxVzZ6YiszeTlFd0VlTHI1cnUxTGpQcWpvN0kxZG5uMVNqc2dFM3NOUEFn?= =?utf-8?B?bTBDZ3hPQzJuUzV4akgvYnpZQ1UyRU9LR090Vkl0SEh4b1hiRGJpVzV5VDl2?= =?utf-8?B?b0UxMTg4RWxDbjllYWhyODdxMU5sU0h6VjBPRDh1VWVmdGVqbjFJV0VVYTQz?= =?utf-8?B?MDN3R3ZSRHNQdUgvSm1qMVJHNWVHWWp0WlVuTXlQS2NjRWJkamFGY3JvdGk4?= =?utf-8?B?ME43VGRoa2NFdG4wSmpYUjdsTW92WnpyVWZqSWFOTkFZTWNmUFhQNlNOeFN2?= =?utf-8?B?amdqMUdTMTcxdUdnRjlXU2NnalM4RDh0bTREUHdCR2tkTWU3VTRrcndzc09i?= =?utf-8?B?Q2tJaERkazN4VmxBT3pyVkYwVklpU1IzeGNYbTU2cEVpYmcvTzBLcWkxSjk3?= =?utf-8?B?RHJhSVAyK3pURmx1anI4UjZLVS9zMTlNdDkxYk5xK0VLYVFvTXNzU25tcjM1?= =?utf-8?B?aGdwaEVuQldnK0xlVzhxL0RTcDhSek1Sc2U1dlVkbG5ZWTdQVUttY20ybG5H?= =?utf-8?B?bWhpdmtXZVkyNEVMOEIvMnFmOW5mbkFJTXZnUHN6Umx1eDNrN2dPeG1vZzlt?= =?utf-8?B?ZW9FSEVpSWtHcnhYVm9qWEp1ZVowL3l1Q1dha28waVNLMUtiK3FIcjM0dG9P?= =?utf-8?B?UVFRb0tSb2daZURjdG9Pc3U2TjF2dDhYWStVQUlqS3VjTGsxcnlOelJUS1E0?= =?utf-8?B?KzEvWXpGd0x5clJXQnlXS1hHMWhDYWpmQ0J2RW5FeXFhRmlsaVNkV0hLSDBl?= =?utf-8?B?QlFCUktCcVZWTG05M0Q5WmhpYjUwSmF2TnFuanpOb0RkTWpWa0U2Z0x5ZnRy?= =?utf-8?B?RkdFUkE0TkJyM0pBN25GT05uRnkrYnRiclc4RWlXOWN4NHNnTUVhUjlvM0Ny?= =?utf-8?B?Nm9CdEtVRzFQVHlpUFVTR3VaOGVwekpZdkZQaGFCQlJZSzN2Qis0ZVNqdTV6?= =?utf-8?B?blR5bW5TVmc4YWE3SFRQSVJzZEU2d0RvOEZXSWVXNmFjSytGam9MSkdtNkUv?= =?utf-8?B?eU15S1lsOE9mYjhoaEdBM1dIZU83NzNYS1NmajAxRHlqZmlLUlBkckRoM2w2?= =?utf-8?B?YVV0cHJQdTVGQTJKME1xNm9nekRGVkw2S1JLalpCVUhacnhyeGMxZDREV2dh?= =?utf-8?B?cjVxQ3NzQVA1Z1ZWUnZkaGdtRHY3TWFQUXlhUHA5RzM0SkgvUFlxN3Q5c2d1?= =?utf-8?B?MWFyVXlXVTNyQy9JM0tsSGZmTHJ1ZHVjUzI0NnZKTXQ0bklvazY2TjBabUJq?= =?utf-8?B?QjF1NnZURDJzYnc4dGFianpoZG03ankzUHhiNllnRjY0Nkt2T2txOFAvVkR2?= =?utf-8?B?R0RlaWJYUnZ6Kyt1bjkySy84ZE1qV3hFd0RvblhjTG9Sdys2dHl2NEFjWndx?= =?utf-8?B?WVUvVG9DOUNPS3p2a0tRR1VXdG5LemhmdHhPQTcwdWg0a2cvTDlGVHVycXli?= =?utf-8?B?Y0RKN0ZOQzZrVVc4cFdzU1R4dDFuaTBzUUx0WE95S2ZSOTB2enhFamh1NUJW?= =?utf-8?B?NmpQeFVMMUVOQVVCazZhU2oxdGpsczFFUW1aTStIakpYeGJ3UGVoajZ6d1I5?= =?utf-8?Q?0c8Qk2JcL14lttygRJCcGpy5RJL2X2UZ1bddYJz?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: a93d0a0d-69b3-4624-6685-08d9301dd024 X-MS-Exchange-CrossTenant-AuthSource: DM6PR01MB5849.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jun 2021 16:51:25.5356 (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: GtPIwgNWJKo50JYkl5K5xeFVFDTbO6czVO4uCzVkjpuEmcmajFdvaaE4y7+bTAKJf62qryFqR3Zz3WUzyUhkO35dez82rg+pd88oMe8/5A8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR01MB6965 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US On 6/8/21 06:08, Leif Lindholm wrote: > On Wed, May 26, 2021 at 17:07:13 +0700, Nhi Pham wrote: >> 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: Vu Nguyen >> --- >> Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dsc.inc | 1 + >> Platform/Ampere/JadePkg/Jade.fdf | 2 + >> Silicon/Ampere/AmpereAltraPkg/Drivers/DebugInfoPei/DebugInfoPei.inf | 41 ++++ >> Silicon/Ampere/AmpereAltraPkg/Drivers/DebugInfoPei/DebugInfoPei.c | 230 ++++++++++++++++++++ >> 4 files changed, 274 insertions(+) >> >> diff --git a/Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dsc.inc b/Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dsc.inc >> index 930bbb5d385b..2d380b21df24 100755 >> --- a/Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dsc.inc >> +++ b/Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dsc.inc >> @@ -534,6 +534,7 @@ [Components.common] >> ArmPlatformPkg/PlatformPei/PlatformPeim.inf >> Silicon/Ampere/AmpereAltraPkg/Drivers/ATFHobPei/ATFHobPeim.inf >> Silicon/Ampere/AmpereAltraPkg/Drivers/MemoryInitPeim/MemoryInitPeim.inf >> + Silicon/Ampere/AmpereAltraPkg/Drivers/DebugInfoPei/DebugInfoPei.inf >> Silicon/Ampere/AmpereAltraPkg/Drivers/MmCommunicationPei/MmCommunicationPei.inf >> Silicon/Ampere/AmpereAltraPkg/Drivers/FlashPei/FlashPei.inf >> ArmPkg/Drivers/CpuPei/CpuPei.inf >> diff --git a/Platform/Ampere/JadePkg/Jade.fdf b/Platform/Ampere/JadePkg/Jade.fdf >> index 3d5d857178b3..8c09e2a49089 100755 >> --- 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 Execution Environment (DXE) phase >> # >> + INF Silicon/Ampere/AmpereAltraPkg/Drivers/DebugInfoPei/DebugInfoPei.inf >> + >> INF MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf >> >> FILE FV_IMAGE = 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 { >> diff --git a/Silicon/Ampere/AmpereAltraPkg/Drivers/DebugInfoPei/DebugInfoPei.inf b/Silicon/Ampere/AmpereAltraPkg/Drivers/DebugInfoPei/DebugInfoPei.inf >> new file mode 100755 >> index 000000000000..11414f72f369 >> --- /dev/null >> +++ b/Silicon/Ampere/AmpereAltraPkg/Drivers/DebugInfoPei/DebugInfoPei.inf >> @@ -0,0 +1,41 @@ >> +## @file >> +# >> +# Copyright (c) 2020 - 2021, Ampere Computing LLC. All rights reserved.
>> +# >> +# SPDX-License-Identifier: BSD-2-Clause-Patent >> +# >> +## >> + >> +[Defines] >> + INF_VERSION = 0x0001001B >> + BASE_NAME = DebugInfo >> + FILE_GUID = C0571D26-6176-11E9-8647-D663BD873D93 >> + MODULE_TYPE = PEIM >> + VERSION_STRING = 1.0 >> + ENTRY_POINT = 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 >> + HobLib >> + NVParamLib >> + PeimEntryPoint >> + PrintLib >> + SerialPortLib >> + >> +[Guids] >> + gPlatformHobGuid >> + >> +[Depex] >> + TRUE >> diff --git a/Silicon/Ampere/AmpereAltraPkg/Drivers/DebugInfoPei/DebugInfoPei.c b/Silicon/Ampere/AmpereAltraPkg/Drivers/DebugInfoPei/DebugInfoPei.c >> new file mode 100644 >> index 000000000000..d6775ffa4a79 >> --- /dev/null >> +++ b/Silicon/Ampere/AmpereAltraPkg/Drivers/DebugInfoPei/DebugInfoPei.c >> @@ -0,0 +1,230 @@ >> +/** @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 >> +#include >> +#include >> +#include >> +#include >> + >> +#define MAX_PRINT_LEN 512 >> + >> +#define GB_SCALE_FACTOR 1073741824 >> +#define MB_SCALE_FACTOR 1048576 >> +#define KB_SCALE_FACTOR 1024 >> +#define MHZ_SCALE_FACTOR 1000000 >> + >> +STATIC VOID >> +SerialPrint ( >> + IN CONST CHAR8 *FormatString, >> + ... >> + ) >> +{ >> + CHAR8 Buf[MAX_PRINT_LEN]; >> + VA_LIST Marker; >> + UINTN NumberOfPrinted; >> + >> + VA_START (Marker, FormatString); >> + NumberOfPrinted = AsciiVSPrint (Buf, sizeof (Buf), FormatString, Marker); >> + SerialPortWrite ((UINT8 *)Buf, NumberOfPrinted); >> + VA_END (Marker); >> +} > Why not use BaseDebugLibSerialPort? Thanks Leif for catching that. Will replace it by DebugPrint in the v3. Best regards, Nhi > > / > Leif > >> + >> +/** >> + Print any existence NVRAM. >> +**/ >> +STATIC VOID >> +PrintNVRAM ( >> + VOID >> + ) >> +{ >> + EFI_STATUS Status; >> + NVPARAM Idx; >> + UINT32 Val; >> + UINT16 ACLRd = NV_PERM_ALL; >> + BOOLEAN Flag; >> + >> + Flag = FALSE; >> + for (Idx = NV_PREBOOT_PARAM_START; Idx <= NV_PREBOOT_PARAM_MAX; Idx += NVPARAM_SIZE) { >> + Status = NVParamGet (Idx, ACLRd, &Val); >> + if (!EFI_ERROR (Status)) { >> + if (!Flag) { >> + SerialPrint ("Pre-boot Configuration Setting:\n"); >> + Flag = TRUE; >> + } >> + SerialPrint (" %04X: 0x%X (%d)\n", (UINT32)Idx, Val, Val); >> + } >> + } >> + >> + Flag = FALSE; >> + for (Idx = NV_MANU_PARAM_START; Idx <= NV_MANU_PARAM_MAX; Idx += NVPARAM_SIZE) { >> + Status = NVParamGet (Idx, ACLRd, &Val); >> + if (!EFI_ERROR (Status)) { >> + if (!Flag) { >> + SerialPrint ("Manufacturer Configuration Setting:\n"); >> + Flag = TRUE; >> + } >> + SerialPrint (" %04X: 0x%X (%d)\n", (UINT32)Idx, Val, Val); >> + } >> + } >> + >> + Flag = FALSE; >> + for (Idx = NV_USER_PARAM_START; Idx <= NV_USER_PARAM_MAX; Idx += NVPARAM_SIZE) { >> + Status = NVParamGet (Idx, ACLRd, &Val); >> + if (!EFI_ERROR (Status)) { >> + if (!Flag) { >> + SerialPrint ("User Configuration Setting:\n"); >> + Flag = TRUE; >> + } >> + SerialPrint (" %04X: 0x%X (%d)\n", (UINT32)Idx, Val, Val); >> + } >> + } >> + >> + Flag = FALSE; >> + for (Idx = NV_BOARD_PARAM_START; Idx <= NV_BOARD_PARAM_MAX; Idx += NVPARAM_SIZE) { >> + Status = NVParamGet (Idx, ACLRd, &Val); >> + if (!EFI_ERROR (Status)) { >> + if (!Flag) { >> + SerialPrint ("Board Configuration Setting:\n"); >> + Flag = TRUE; >> + } >> + SerialPrint (" %04X: 0x%X (%d)\n", (UINT32)Idx, Val, Val); >> + } >> + } >> +} >> + >> +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 = GetFirstGuidHob (&gPlatformHobGuid); >> + if (Hob == NULL) { >> + return; >> + } >> + >> + PlatformHob = (PLATFORM_INFO_HOB *)GET_GUID_HOB_DATA (Hob); >> + >> + SerialPrint ("SCP FW version : %a\n", (const CHAR8 *)PlatformHob->SmPmProVer); >> + SerialPrint ("SCP FW build date : %a\n", (const CHAR8 *)PlatformHob->SmPmProBuild); >> + >> + SerialPrint ("Failsafe status : %d\n", PlatformHob->FailSafeStatus); >> + SerialPrint ("Reset status : %d\n", PlatformHob->ResetStatus); >> + SerialPrint ("CPU info\n"); >> + SerialPrint (" CPU ID : %X\n", ArmReadMidr ()); >> + SerialPrint (" CPU Clock : %d MHz\n", PlatformHob->CpuClk / MHZ_SCALE_FACTOR); >> + SerialPrint (" Number of active sockets : %d\n", GetNumberOfActiveSockets ()); >> + SerialPrint (" Number of active cores : %d\n", GetNumberOfActiveCores ()); >> + if (IsSlaveSocketActive ()) { >> + SerialPrint ( >> + " Inter Socket Connection 0 : Width: x%d / Speed %a\n", >> + PlatformHob->Link2PWidth[0], >> + GetCCIXLinkSpeed (PlatformHob->Link2PSpeed[0]) >> + ); >> + SerialPrint ( >> + " Inter Socket Connection 1 : Width: x%d / Speed %a\n", >> + PlatformHob->Link2PWidth[1], >> + GetCCIXLinkSpeed (PlatformHob->Link2PSpeed[1]) >> + ); >> + } >> + for (Idx = 0; Idx < GetNumberOfActiveSockets (); Idx++) { >> + SerialPrint (" Socket[%d]: Core voltage : %d\n", Idx, PlatformHob->CoreVoltage[Idx]); >> + SerialPrint (" Socket[%d]: SCU ProductID : %X\n", Idx, PlatformHob->ScuProductId[Idx]); >> + SerialPrint (" Socket[%d]: Max cores : %d\n", Idx, PlatformHob->MaxNumOfCore[Idx]); >> + SerialPrint (" Socket[%d]: Warranty : %d\n", Idx, PlatformHob->Warranty[Idx]); >> + SerialPrint (" Socket[%d]: Subnuma : %d\n", Idx, PlatformHob->SubNumaMode[Idx]); >> + SerialPrint (" Socket[%d]: RC disable mask : %X\n", Idx, PlatformHob->RcDisableMask[Idx]); >> + SerialPrint (" Socket[%d]: AVS enabled : %d\n", Idx, PlatformHob->AvsEnable[Idx]); >> + SerialPrint (" Socket[%d]: AVS voltage : %d\n", Idx, PlatformHob->AvsVoltageMV[Idx]); >> + } >> + >> + SerialPrint ("SOC info\n"); >> + SerialPrint (" DDR Frequency : %d MHz\n", PlatformHob->DramInfo.MaxSpeed); >> + for (Idx = 0; Idx < GetNumberOfActiveSockets (); Idx++) { >> + SerialPrint (" Socket[%d]: Soc voltage : %d\n", Idx, PlatformHob->SocVoltage[Idx]); >> + SerialPrint (" Socket[%d]: DIMM1 voltage : %d\n", Idx, PlatformHob->Dimm1Voltage[Idx]); >> + SerialPrint (" Socket[%d]: DIMM2 voltage : %d\n", Idx, PlatformHob->Dimm2Voltage[Idx]); >> + } >> + >> + SerialPrint (" PCP Clock : %d MHz\n", PlatformHob->PcpClk / MHZ_SCALE_FACTOR); >> + SerialPrint (" SOC Clock : %d MHz\n", PlatformHob->SocClk / MHZ_SCALE_FACTOR); >> + SerialPrint (" SYS Clock : %d MHz\n", PlatformHob->SysClk / MHZ_SCALE_FACTOR); >> + SerialPrint (" AHB Clock : %d MHz\n", PlatformHob->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; >> +} >> -- >> 2.17.1 >>