public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	Alexei Fedorov <alexei.fedorov@arm.com>
Cc: "edk2-devel@lists.01.org" <edk2-devel@lists.01.org>,
	Arvind Chauhan <Arvind.Chauhan@arm.com>,
	Daniil Egranov <Daniil.Egranov@arm.com>,
	Thomas Panakamattam Abraham <thomas.abraham@arm.com>,
	Leif Lindholm <Leif.Lindholm@linaro.org>,
	Matteo Carlini <Matteo.Carlini@arm.com>,
	Stephanie Hughes-Fitt <Stephanie.Hughes-Fitt@arm.com>,
	nd <nd@arm.com>, Evan Lloyd <Evan.Lloyd@arm.com>,
	Sami Mujawar <Sami.Mujawar@arm.com>,
	Jeremy Linton <jeremy.linton@arm.com>,
	Alan Ott <alan@softiron.co.uk>
Subject: Re: [PATCH edk2-platforms v1] Platform/ARM: Add PeiReportStatusCodeLib
Date: Thu, 3 May 2018 14:28:02 +0200	[thread overview]
Message-ID: <7306e255-6659-dbd8-c09e-5c5296d44d98@redhat.com> (raw)
In-Reply-To: <CAKv+Gu_zJSqO6gZDWpTwqrUeMPmfRPDiMqni3o9=5d-WTgZsMA@mail.gmail.com>

On 05/03/18 13:44, Ard Biesheuvel wrote:
> (add some potentially interested parties to cc)
> 
> On 3 May 2018 at 11:24, Alexei Fedorov <alexei.fedorov@arm.com> wrote:
>> From: Alexei Fedorov <Alexei.Fedorov@arm.com>
>>
>> UEFI build fails for ArmVExpress-FVP-AArch64 when using
>> "-D ARM_FVP_RUN_NORFLASH" build option, which prevents
>> EDK2_SKIP_PEICORE macro from being defined in
>> ArmVExpress-FVP-AArch64.dsc:
>>
>> !ifndef ARM_FVP_RUN_NORFLASH
>>   DEFINE EDK2_SKIP_PEICORE=1
>> !endif
>>
>> When EDK2_SKIP_PEICORE macro is not defined, build fails with
>> errors 1001:
>> Module type [PEI_CORE] is not supported by library instance
>> [MdeModulePkg\Library\DxeReportStatusCodeLib\DxeReportStatusCodeLib.inf]
>> consumed by [n:\edk2\MdeModulePkg\Core\Pei\PeiMain.inf]
>> and
>> Module type [PEIM] is not supported by library instance
>> [MdeModulePkg\Library\DxeReportStatusCodeLib\DxeReportStatusCodeLib.inf]
>> consumed by [n:\edk2\MdeModulePkg\Core\DxeIplPeim\DxeIpl.inf]
>>
>> This patch fixes the above build errors by adding
>> MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf
>> in [LibraryClasses.common.PEI_CORE] and [LibraryClasses.common.PEIM]
>> sections of ArmVExpress.dsc.inc.
>>
>> Contributed-under: TianoCore Contribution Agreement 1.1
>> Signed-off-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
>> Reviewed-by:   Evan Lloyd <Evan.Lloyd@arm.com>
>> ---
>> All the changes can be reviewed at:
>> https://github.com/AlexeiFedorov/edk2-platforms/tree/237_add_peireportstatuscodelib_v1
>>
>> Notes:
>>     v1:
>>     - Add PeiReportStatusCodeLib in PEI_CORE and PEIM sections   [Alexei]
>>
>>  Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc | 2 ++
>>  1 file changed, 2 insertions(+)
>>
> 
> Just for my understanding: is anyone using these status codes on ARM,
> and if so, how exactly?

(on a wild tangent)

Earlier I tried to use status codes (in VMs) for the following purpose:
the UEFI boot manager emits status codes about gBS->LoadImage() and
gBS->StartImage(), but I didn't find them detailed enough. So I
attempted to extend them, with the intent to catch *and print* them in
BdsDxe / PlatformBootManagerLib, to the console. This would have
provided the end-user with some insight into the boot option processing.

Alas, the status codes weren't possible to extend in edk2 without UEFI
spec development. I did start on that, but clearly we couldn't wait for
it to complete, so we solved our issue differently.

Now back to the question whether status codes are helpful in practice on
ARM. The vendor-provided firmware on my Mustang uses them, in that the
status codes are printed to the serial port. They tell me exactly
nothing. :)

For a while I had built the firmware for the Mustang myself. I'd always
enable full logs (DEBUG_VERBOSE). Now that serial log was helpful.

I guess status codes can be useful if there are other machines that read
them and act upon them -- but that likely occurs through a different
representation and/or hardware interface, not through hex codes printed
to the serial port.

Thanks
Laszlo


> 
> 
>> diff --git a/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc b/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
>> index de201b0c81d020e1e06ee320cf0f14f186723657..bb899b91c525ee821b9506cca75224f4bc41e3ae 100644
>> --- a/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
>> +++ b/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
>> @@ -166,6 +166,7 @@ [LibraryClasses.common.PEI_CORE]
>>    MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf
>>    PeiCoreEntryPoint|MdePkg/Library/PeiCoreEntryPoint/PeiCoreEntryPoint.inf
>>    PerformanceLib|MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf
>> +  ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf
>>    OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf
>>    PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf
>>    ExtractGuidedSectionLib|MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.inf
>> @@ -179,6 +180,7 @@ [LibraryClasses.common.PEIM]
>>    MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf
>>    PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf
>>    PerformanceLib|MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf
>> +  ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf
>>    OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf
>>    PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf
>>    PeiResourcePublicationLib|MdePkg/Library/PeiResourcePublicationLib/PeiResourcePublicationLib.inf
>> --
>> 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'
>>
>>



  parent reply	other threads:[~2018-05-03 12:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-03  9:24 [PATCH edk2-platforms v1] Platform/ARM: Add PeiReportStatusCodeLib Alexei Fedorov
2018-05-03 11:44 ` Ard Biesheuvel
2018-05-03 12:07   ` Alan Ott
2018-05-03 12:28   ` Laszlo Ersek [this message]
2018-05-09 16:24 ` Leif Lindholm
2018-05-09 16:58   ` Alexei Fedorov
2018-05-09 21:13     ` Leif Lindholm
2018-05-10  9:56       ` Alexei Fedorov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7306e255-6659-dbd8-c09e-5c5296d44d98@redhat.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox