public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 1/1] Platform/ARM/JunoPkg: Don't setup PCIe root bridge for Juno-r0
@ 2023-04-13 13:14 PierreGondois
  2023-04-13 16:04 ` Sami Mujawar
  2023-04-13 22:04 ` [edk2-devel] " Rebecca Cran
  0 siblings, 2 replies; 4+ messages in thread
From: PierreGondois @ 2023-04-13 13:14 UTC (permalink / raw)
  To: devel; +Cc: Thomas Abraham, Ard Biesheuvel, Sami Mujawar, Fabien Ficheau

From: Pierre Gondois <pierre.gondois@arm.com>

Booting a Juno-r0 with a DEBUG build triggers an ASSERT when
processing the library constructors of:
MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf

JunoPciHostBridgeLib.inf::HWPciRbInit() returns an error code
as Juno-r0 doesn't support PCIe.

Check Juno's revision in HWPciRbInit() before setting up the
PCIe root complex.

Reported-by: Fabien Ficheau <fabien.ficheau@arm.com>
Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
---
 .../ARM/JunoPkg/Library/JunoPciHostBridgeLib/XPressRich3.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/Platform/ARM/JunoPkg/Library/JunoPciHostBridgeLib/XPressRich3.c b/Platform/ARM/JunoPkg/Library/JunoPciHostBridgeLib/XPressRich3.c
index 0755dc155616..583efd0efb16 100644
--- a/Platform/ARM/JunoPkg/Library/JunoPciHostBridgeLib/XPressRich3.c
+++ b/Platform/ARM/JunoPkg/Library/JunoPciHostBridgeLib/XPressRich3.c
@@ -69,6 +69,13 @@ HWPciRbInit (
   UINTN                   TranslationTable;
   EFI_CPU_IO2_PROTOCOL    *CpuIo;
   EFI_STATUS              Status;
+  UINT32                  JunoRevision;
+
+  GetJunoRevision (JunoRevision);
+  DEBUG ((DEBUG_ERROR, "Juno rev=%d\n", JunoRevision));
+  if (JunoRevision == JUNO_REVISION_R0) {
+    return EFI_SUCCESS;
+  }
 
   PCI_TRACE ("VExpressPciRbInit()");
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] Platform/ARM/JunoPkg: Don't setup PCIe root bridge for Juno-r0
  2023-04-13 13:14 [PATCH 1/1] Platform/ARM/JunoPkg: Don't setup PCIe root bridge for Juno-r0 PierreGondois
@ 2023-04-13 16:04 ` Sami Mujawar
  2023-04-13 22:04 ` [edk2-devel] " Rebecca Cran
  1 sibling, 0 replies; 4+ messages in thread
From: Sami Mujawar @ 2023-04-13 16:04 UTC (permalink / raw)
  To: Pierre.Gondois, devel
  Cc: Thomas Abraham, Ard Biesheuvel, Fabien Ficheau, nd@arm.com

Hi Pierre,

Thank you for this patch.

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>

Regards,

Sami Mujawar

On 13/04/2023 02:14 pm, Pierre.Gondois@arm.com wrote:
> From: Pierre Gondois <pierre.gondois@arm.com>
>
> Booting a Juno-r0 with a DEBUG build triggers an ASSERT when
> processing the library constructors of:
> MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
>
> JunoPciHostBridgeLib.inf::HWPciRbInit() returns an error code
> as Juno-r0 doesn't support PCIe.
>
> Check Juno's revision in HWPciRbInit() before setting up the
> PCIe root complex.
>
> Reported-by: Fabien Ficheau <fabien.ficheau@arm.com>
> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
> ---
>   .../ARM/JunoPkg/Library/JunoPciHostBridgeLib/XPressRich3.c | 7 +++++++
>   1 file changed, 7 insertions(+)
>
> diff --git a/Platform/ARM/JunoPkg/Library/JunoPciHostBridgeLib/XPressRich3.c b/Platform/ARM/JunoPkg/Library/JunoPciHostBridgeLib/XPressRich3.c
> index 0755dc155616..583efd0efb16 100644
> --- a/Platform/ARM/JunoPkg/Library/JunoPciHostBridgeLib/XPressRich3.c
> +++ b/Platform/ARM/JunoPkg/Library/JunoPciHostBridgeLib/XPressRich3.c
> @@ -69,6 +69,13 @@ HWPciRbInit (
>     UINTN                   TranslationTable;
>     EFI_CPU_IO2_PROTOCOL    *CpuIo;
>     EFI_STATUS              Status;
> +  UINT32                  JunoRevision;
> +
> +  GetJunoRevision (JunoRevision);
> +  DEBUG ((DEBUG_ERROR, "Juno rev=%d\n", JunoRevision));
> +  if (JunoRevision == JUNO_REVISION_R0) {
> +    return EFI_SUCCESS;
> +  }
>   
>     PCI_TRACE ("VExpressPciRbInit()");
>   

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [edk2-devel] [PATCH 1/1] Platform/ARM/JunoPkg: Don't setup PCIe root bridge for Juno-r0
  2023-04-13 13:14 [PATCH 1/1] Platform/ARM/JunoPkg: Don't setup PCIe root bridge for Juno-r0 PierreGondois
  2023-04-13 16:04 ` Sami Mujawar
@ 2023-04-13 22:04 ` Rebecca Cran
  2023-04-14  7:12   ` PierreGondois
  1 sibling, 1 reply; 4+ messages in thread
From: Rebecca Cran @ 2023-04-13 22:04 UTC (permalink / raw)
  To: devel, pierre.gondois
  Cc: Thomas Abraham, Ard Biesheuvel, Sami Mujawar, Fabien Ficheau

On 4/13/23 07:14, PierreGondois wrote:

> diff --git a/Platform/ARM/JunoPkg/Library/JunoPciHostBridgeLib/XPressRich3.c b/Platform/ARM/JunoPkg/Library/JunoPciHostBridgeLib/XPressRich3.c
> index 0755dc155616..583efd0efb16 100644
> --- a/Platform/ARM/JunoPkg/Library/JunoPciHostBridgeLib/XPressRich3.c
> +++ b/Platform/ARM/JunoPkg/Library/JunoPciHostBridgeLib/XPressRich3.c
> @@ -69,6 +69,13 @@ HWPciRbInit (
>     UINTN                   TranslationTable;
>     EFI_CPU_IO2_PROTOCOL    *CpuIo;
>     EFI_STATUS              Status;
> +  UINT32                  JunoRevision;
> +
> +  GetJunoRevision (JunoRevision);
> +  DEBUG ((DEBUG_ERROR, "Juno rev=%d\n", JunoRevision));

Should that be DEBUG_INFO? Or is it DEBUG_ERROR because of the value of 
PcdDebugPrintErrorLevel which doesn't include INFO messages?

I was just wondering a few days ago whether it should be 0x8000004F 
instead of 0x8000000F?


-- 
Rebecca Cran


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [edk2-devel] [PATCH 1/1] Platform/ARM/JunoPkg: Don't setup PCIe root bridge for Juno-r0
  2023-04-13 22:04 ` [edk2-devel] " Rebecca Cran
@ 2023-04-14  7:12   ` PierreGondois
  0 siblings, 0 replies; 4+ messages in thread
From: PierreGondois @ 2023-04-14  7:12 UTC (permalink / raw)
  To: Rebecca Cran, devel
  Cc: Thomas Abraham, Ard Biesheuvel, Sami Mujawar, Fabien Ficheau



On 4/14/23 00:04, Rebecca Cran wrote:
> On 4/13/23 07:14, PierreGondois wrote:
> 
>> diff --git a/Platform/ARM/JunoPkg/Library/JunoPciHostBridgeLib/XPressRich3.c b/Platform/ARM/JunoPkg/Library/JunoPciHostBridgeLib/XPressRich3.c
>> index 0755dc155616..583efd0efb16 100644
>> --- a/Platform/ARM/JunoPkg/Library/JunoPciHostBridgeLib/XPressRich3.c
>> +++ b/Platform/ARM/JunoPkg/Library/JunoPciHostBridgeLib/XPressRich3.c
>> @@ -69,6 +69,13 @@ HWPciRbInit (
>>      UINTN                   TranslationTable;
>>      EFI_CPU_IO2_PROTOCOL    *CpuIo;
>>      EFI_STATUS              Status;
>> +  UINT32                  JunoRevision;
>> +
>> +  GetJunoRevision (JunoRevision);
>> +  DEBUG ((DEBUG_ERROR, "Juno rev=%d\n", JunoRevision));
> 
> Should that be DEBUG_INFO? Or is it DEBUG_ERROR because of the value of
> PcdDebugPrintErrorLevel which doesn't include INFO messages?
> 
> I was just wondering a few days ago whether it should be 0x8000004F
> instead of 0x8000000F?
> 

The DEBUG message is not necessary, I will remove it.
PcdDebugPrintErrorLevel effectively doesn't include INFO messages,
I assume this is ok not to have them even in the DEBUG build.

Regards,
Pierre


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-04-14  7:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-13 13:14 [PATCH 1/1] Platform/ARM/JunoPkg: Don't setup PCIe root bridge for Juno-r0 PierreGondois
2023-04-13 16:04 ` Sami Mujawar
2023-04-13 22:04 ` [edk2-devel] " Rebecca Cran
2023-04-14  7:12   ` PierreGondois

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox