From nobody Fri May 17 02:03:17 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+113564+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+113564+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1704931479; cv=none; d=zohomail.com; s=zohoarc; b=R9GyB+qdJz5X5p9URIGPkg8PUh5P/Fv/4MhJrBK3KB8W8RLkpmXoaUU4taHgO2m5K0r0QWvrfhZsWWT/+RIN16n8oVsFA4iwO4rhu7hxr08f4okM+rGx+hY+9MBH5XaRgdS5BTdrgK6QgHJDiBHE5gkZegGM3LN9G3S9oy/CuuI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704931479; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:Sender:Subject:Subject:To:To:Message-Id; bh=hLvQ8hWPCa2x0dJN8+s0jr8OxJuZSztQvIidzuJ/FxM=; b=UQKKB4G9AV+nsmAfgjF6L5MSxR/I+z3c1Bvnu1K/IxZKEy2zMoVCmS0yiOLVO+FRgaBWCedfplIRvWGUApy6EGDCMh3On+6QWViwOS1Js70+IQWQa73PvAUB/Ig6yNZVogmlj7nuw3N9hVrZWg2V3iXdcXFRYe+KajIezj+kyE4= ARC-Authentication-Results: i=1; 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+113564+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1704931479606320.07509760909215; Wed, 10 Jan 2024 16:04:39 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=jQb9k8Xb8R7503VGzHTpoouDSNJop6O57gclDFM01Pk=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1704931479; v=1; b=R5NISKMWsgIhKSEhtRZp92T4sEsZYBxxyhFzEhhxzSggApEaOz6N6nBI8aLSLwPP+969UBnV Ez1nALny7xB5mxBUGDcASL6GNfLro0FbWltQ1qCekAIA9SLaryUWncBDYqwg2Aa++wh3ssdIyBX mYn20ym9m396oeIMXG/wj6hM= X-Received: by 127.0.0.2 with SMTP id cotjYY1788612xsD0wg1M1Of; Wed, 10 Jan 2024 16:04:39 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.9372.1704931478627946143 for ; Wed, 10 Jan 2024 16:04:38 -0800 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 386E02F4; Wed, 10 Jan 2024 16:05:24 -0800 (PST) X-Received: from u200865.usa.arm.com (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 223573F5A1; Wed, 10 Jan 2024 16:04:38 -0800 (PST) From: "Jeremy Linton" To: devel@edk2.groups.io Cc: ardb+tianocore@kernel.org, quic_llindhol@quicinc.com, Jeremy Linton Subject: [edk2-devel] [PATCH] Platform/RaspberryPi: Enable FPDT data on RPi4 Date: Wed, 10 Jan 2024 18:04:33 -0600 Message-ID: <20240111000433.2735028-1-jeremy.linton@arm.com> MIME-Version: 1.0 Precedence: Bulk 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,jeremy.linton@arm.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 4YuBvFjg7UnEYAwbsbOhaz9mx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1704931481380100001 Content-Type: text/plain; charset="utf-8" FPDT data gives an approximation of how long each stage of the firmware boot takes. Since the RPi has a generic timer this is a fairly accurate timestamp from the point where edk2 takes over, which is a few ms from actual power on. While its not perfect its sufficiently granular that a command like `systemd-analyze` shows the debug boot to be quite slow. Ex: [root@rpi4 ~]# systemd-analyze Startup finished in 24.313s (firmware) + 7.771s (loader) + 2.442s (kernel) = + 5.810s (initrd) + 20.371s (userspace) =3D 1min 708ms multi-user.target reached after 17.343s in userspace. Signed-off-by: Jeremy Linton --- Platform/RaspberryPi/RPi4/RPi4.dsc | 28 ++++++++++++++++++++++++++-- Platform/RaspberryPi/RPi4/RPi4.fdf | 7 +++++++ 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/Platform/RaspberryPi/RPi4/RPi4.dsc b/Platform/RaspberryPi/RPi4= /RPi4.dsc index 170e45ae7e..e9ca9463ce 100644 --- a/Platform/RaspberryPi/RPi4/RPi4.dsc +++ b/Platform/RaspberryPi/RPi4/RPi4.dsc @@ -69,7 +69,8 @@ BmpSupportLib|MdeModulePkg/Library/BaseBmpSupportLib/BaseBmpSupportLib.i= nf SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchroniza= tionLib.inf PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibN= ull.inf - ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseRepor= tStatusCodeLibNull.inf + ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeRepor= tStatusCodeLib.inf + PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeC= offGetEntryPointLib.inf PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf @@ -279,13 +280,25 @@ gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport|FALSE =20 + ## Indicates if S3 performance data will be supported in ACPI FPDT table. + # TRUE - S3 performance data will be supported in ACPI FPDT table. + # FALSE - S3 performance data will not be supported in ACPI FPDT table. + gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwarePerformanceDataTableS3Support|= FALSE + [PcdsFixedAtBuild.common] gEfiMdePkgTokenSpaceGuid.PcdMaximumUnicodeStringLength|1000000 gEfiMdePkgTokenSpaceGuid.PcdMaximumAsciiStringLength|1000000 gEfiMdePkgTokenSpaceGuid.PcdMaximumLinkedListLength|1000000 gEfiMdePkgTokenSpaceGuid.PcdSpinLockTimeout|10000000 gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue|0xAF - gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask|1 + #define PERFORMANCE_LIBRARY_PROPERTY_MEASUREMENT_ENABLED 0x00000001 + #define PERF_CORE_START_IMAGE 0x0002 + #define PERF_CORE_LOAD_IMAGE 0x0004 + #define PERF_CORE_DB_SUPPORT 0x0008 + #define PERF_CORE_DB_START 0x0010 + #define PERF_CORE_DB_STOP 0x0020 + #define PERF_GENERAL_TYPE 0x0040 + gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask|0x1 gEfiMdePkgTokenSpaceGuid.PcdPostCodePropertyMask|0 gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize|320 =20 @@ -324,6 +337,7 @@ gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|$(DEBUG_PRINT_ERROR_LEV= EL) =20 gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x07 + gEfiMdeModulePkgTokenSpaceGuid.PcdExtFpdtBootRecordPadSize|0x20000000 =20 # # Optional feature to help prevent EFI memory map fragments @@ -812,6 +826,16 @@ Silicon/Broadcom/Drivers/I2cDxe/I2cDxe.inf =20 =20 + # + # Firmware Performance Data Table (FPDT) + # + MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCod= eRouterRuntimeDxe.inf + MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/FirmwarePerf= ormanceDxe.inf { + + LockBoxLib|MdeModulePkg/Library/LockBoxNullLib/LockBoxNullLib.inf + } + + # # UEFI application (Shell Embedded Boot Loader) # ShellPkg/Application/Shell/Shell.inf { diff --git a/Platform/RaspberryPi/RPi4/RPi4.fdf b/Platform/RaspberryPi/RPi4= /RPi4.fdf index 989d99a49f..321639fc64 100644 --- a/Platform/RaspberryPi/RPi4/RPi4.fdf +++ b/Platform/RaspberryPi/RPi4/RPi4.fdf @@ -326,6 +326,13 @@ READ_LOCK_STATUS =3D TRUE # INF Platform/RaspberryPi/Drivers/LogoDxe/LogoDxe.inf =20 + # + # Firmware Performance Data Table (FPDT) + # + INF MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatu= sCodeRouterRuntimeDxe.inf + INF MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/Firmware= PerformanceDxe.inf + + [FV.FVMAIN_COMPACT] FvAlignment =3D 16 ERASE_POLARITY =3D 1 --=20 2.43.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 (#113564): https://edk2.groups.io/g/devel/message/113564 Mute This Topic: https://groups.io/mt/103653104/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-