From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 89174D81163 for ; Thu, 11 Jan 2024 00:04:40 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=1jdIANCQx9LnMl9q1MRPYmgnROxn9Xg6WuHygrF29v8=; 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=X2DdIIxgCpUQohLsrKxf/25PHR9O/QJ955P4bDA44hKMYcizr9KWxpbU10NKrhUgiveiHp6R 7qIA1ODbXnVj8brnOUeHBgQOU2p73jMLKP9BhFItL7KeBd+5NYFtoe6NGNu+wVtXSvWbUPKZv0w YJKbZZo/tnjiAzBmO9zztXsA= X-Received: by 127.0.0.2 with SMTP id fW9TYY7687511xcbCOEOOarn; 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: ltcJJZDnZD1fmp4JQXYyPBJDx7686176AA= Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=X2DdIIxg; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=arm.com (policy=none) 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/RP= i4/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= .inf SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchroni= zationLib.inf PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanceLi= bNull.inf - ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseRep= ortStatusCodeLibNull.inf + ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeRep= ortStatusCodeLib.inf + PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BaseP= eCoffGetEntryPointLib.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 tab= le. + # TRUE - S3 performance data will be supported in ACPI FPDT table. + # FALSE - S3 performance data will not be supported in ACPI FPDT tab= le. + gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwarePerformanceDataTableS3Suppor= t|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_L= EVEL) =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/ReportStatusC= odeRouterRuntimeDxe.inf + MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/FirmwarePe= rformanceDxe.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/RP= i4/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/ReportSta= tusCodeRouterRuntimeDxe.inf + INF MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/Firmwa= rePerformanceDxe.inf + + [FV.FVMAIN_COMPACT] FvAlignment =3D 16 ERASE_POLARITY =3D 1 --=20 2.43.0 -=-=-=-=-=-=-=-=-=-=-=- 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/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-