[edk2-devel] [PATCH edk2-platforms 3/3] Platform/ARM/JunoPkg: Reserve the ECAM area in ACPI with RES0 device

Rebecca Cran posted 3 patches 3 years, 11 months ago
There is a newer version of this series
[edk2-devel] [PATCH edk2-platforms 3/3] Platform/ARM/JunoPkg: Reserve the ECAM area in ACPI with RES0 device
Posted by Rebecca Cran 3 years, 11 months ago
Add a RES0 device to the SSDT to reserve the PCI ECAM area.

This fixes the warning that Linux prints:

acpi PNP0A08:00: [Firmware Bug]: ECAM area [mem 0x40000000-0x4fffffff]
not reserved in ACPI namespace

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
---
 Platform/ARM/JunoPkg/AcpiTables/AcpiTables.inf      |  4 ++++
 Platform/ARM/JunoPkg/AcpiTables/AcpiSsdtRootPci.asl | 13 +++++++++++++
 2 files changed, 17 insertions(+)

diff --git a/Platform/ARM/JunoPkg/AcpiTables/AcpiTables.inf b/Platform/ARM/JunoPkg/AcpiTables/AcpiTables.inf
index f140febc4ad4..9a76475765f0 100644
--- a/Platform/ARM/JunoPkg/AcpiTables/AcpiTables.inf
+++ b/Platform/ARM/JunoPkg/AcpiTables/AcpiTables.inf
@@ -45,6 +45,10 @@ [FixedPcd]
   gArmTokenSpaceGuid.PcdGenericWatchdogControlBase
   gArmTokenSpaceGuid.PcdGenericWatchdogRefreshBase
 
+  gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
+  gArmJunoTokenSpaceGuid.PcdPciConfigurationSpaceSize
+  gArmJunoTokenSpaceGuid.PcdPciConfigurationSpaceLimit
+
   #
   # PL011 UART Settings for Serial Port Console Redirection
   #
diff --git a/Platform/ARM/JunoPkg/AcpiTables/AcpiSsdtRootPci.asl b/Platform/ARM/JunoPkg/AcpiTables/AcpiSsdtRootPci.asl
index 317b621e013e..e60fc42a3340 100644
--- a/Platform/ARM/JunoPkg/AcpiTables/AcpiSsdtRootPci.asl
+++ b/Platform/ARM/JunoPkg/AcpiTables/AcpiSsdtRootPci.asl
@@ -140,6 +140,19 @@ DefinitionBlock("SsdtPci.aml", "SSDT", 1, "ARMLTD", "ARM-JUNO", EFI_ACPI_ARM_OEM
         Return (RBUF)
       } // Method(_CRS)
 
+      Device (RES0) {
+        Name (_HID, "PNP0C02" /* PNP Motherboard Resources */)  // _HID: Hardware ID
+        Name (_CRS, ResourceTemplate () {                       // _CRS: Current Resource Settings
+           QWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite,
+           0x0000000000000000,                                  // Granularity
+           FixedPcdGet64 (PcdPciExpressBaseAddress),            // Range Minimum
+           FixedPcdGet64 (PcdPciConfigurationSpaceLimit),       // Range Maximum
+           0x0000000000000000,                                  // Translation Offset
+           FixedPcdGet64 (PcdPciConfigurationSpaceSize),        // Length
+           ,, , AddressRangeMemory, TypeStatic)
+        })
+      }
+
       //
       // OS Control Handoff
       //
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87301): https://edk2.groups.io/g/devel/message/87301
Mute This Topic: https://groups.io/mt/89565202/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH edk2-platforms 3/3] Platform/ARM/JunoPkg: Reserve the ECAM area in ACPI with RES0 device
Posted by Sami Mujawar 3 years, 10 months ago
Hi Rebecca,

Thank you for this patch. This change looks good to me.

I have a minor suggestion marked inline as [SAMI].

With that upated,

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

Regards,

Sami Mujawar
On 05/03/2022 04:19 AM, Rebecca Cran wrote:
> Add a RES0 device to the SSDT to reserve the PCI ECAM area.
>
> This fixes the warning that Linux prints:
>
> acpi PNP0A08:00: [Firmware Bug]: ECAM area [mem 0x40000000-0x4fffffff]
> not reserved in ACPI namespace
[SAMI] I noticed that the "Firmware Bug" message is no longer seen, but
instead the following message is now printed
"system 00:00: [mem 0x40000000-0x4fffffff window] could not be reserved"

It appears this is a harmless message and the relevant discussion can be
seen at: https://lore.kernel.org/all/20210603141641.GA17284@lpieralisi/#t

I think it may be better to update the commit message to reference this
discussion and clarify that this is an expected behavior.
[/SAMI]

> Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
> ---
>   Platform/ARM/JunoPkg/AcpiTables/AcpiTables.inf      |  4 ++++
>   Platform/ARM/JunoPkg/AcpiTables/AcpiSsdtRootPci.asl | 13 +++++++++++++
>   2 files changed, 17 insertions(+)
>
> diff --git a/Platform/ARM/JunoPkg/AcpiTables/AcpiTables.inf b/Platform/ARM/JunoPkg/AcpiTables/AcpiTables.inf
> index f140febc4ad4..9a76475765f0 100644
> --- a/Platform/ARM/JunoPkg/AcpiTables/AcpiTables.inf
> +++ b/Platform/ARM/JunoPkg/AcpiTables/AcpiTables.inf
> @@ -45,6 +45,10 @@ [FixedPcd]
>     gArmTokenSpaceGuid.PcdGenericWatchdogControlBase
>     gArmTokenSpaceGuid.PcdGenericWatchdogRefreshBase
>
> +  gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
> +  gArmJunoTokenSpaceGuid.PcdPciConfigurationSpaceSize
> +  gArmJunoTokenSpaceGuid.PcdPciConfigurationSpaceLimit
> +
>     #
>     # PL011 UART Settings for Serial Port Console Redirection
>     #
> diff --git a/Platform/ARM/JunoPkg/AcpiTables/AcpiSsdtRootPci.asl b/Platform/ARM/JunoPkg/AcpiTables/AcpiSsdtRootPci.asl
> index 317b621e013e..e60fc42a3340 100644
> --- a/Platform/ARM/JunoPkg/AcpiTables/AcpiSsdtRootPci.asl
> +++ b/Platform/ARM/JunoPkg/AcpiTables/AcpiSsdtRootPci.asl
> @@ -140,6 +140,19 @@ DefinitionBlock("SsdtPci.aml", "SSDT", 1, "ARMLTD", "ARM-JUNO", EFI_ACPI_ARM_OEM
>           Return (RBUF)
>         } // Method(_CRS)
>
> +      Device (RES0) {
> +        Name (_HID, "PNP0C02" /* PNP Motherboard Resources */)  // _HID: Hardware ID
> +        Name (_CRS, ResourceTemplate () {                       // _CRS: Current Resource Settings
> +           QWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite,
> +           0x0000000000000000,                                  // Granularity
> +           FixedPcdGet64 (PcdPciExpressBaseAddress),            // Range Minimum
> +           FixedPcdGet64 (PcdPciConfigurationSpaceLimit),       // Range Maximum
> +           0x0000000000000000,                                  // Translation Offset
> +           FixedPcdGet64 (PcdPciConfigurationSpaceSize),        // Length
> +           ,, , AddressRangeMemory, TypeStatic)
> +        })
> +      }
> +
>         //
>         // OS Control Handoff
>         //

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87659): https://edk2.groups.io/g/devel/message/87659
Mute This Topic: https://groups.io/mt/89565202/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH edk2-platforms 3/3] Platform/ARM/JunoPkg: Reserve the ECAM area in ACPI with RES0 device
Posted by Rebecca Cran 3 years, 10 months ago
On 3/17/22 03:55, Sami Mujawar wrote:
> On 05/03/2022 04:19 AM, Rebecca Cran wrote:
>> Add a RES0 device to the SSDT to reserve the PCI ECAM area.
>>
>> This fixes the warning that Linux prints:
>>
>> acpi PNP0A08:00: [Firmware Bug]: ECAM area [mem 0x40000000-0x4fffffff]
>> not reserved in ACPI namespace
> [SAMI] I noticed that the "Firmware Bug" message is no longer seen, but
> instead the following message is now printed
> "system 00:00: [mem 0x40000000-0x4fffffff window] could not be reserved"
>
> It appears this is a harmless message and the relevant discussion can be
> seen at: https://lore.kernel.org/all/20210603141641.GA17284@lpieralisi/#t
>
> I think it may be better to update the commit message to reference this
> discussion and clarify that this is an expected behavior.
> [/SAMI]

Thanks, I've updated the commit message in v2.


-- 
Rebecca Cran



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87763): https://edk2.groups.io/g/devel/message/87763
Mute This Topic: https://groups.io/mt/89565202/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-