[edk2-devel] [PATCH 3/3] Platform/RaspberryPi/AcpiTables: Correct _DMA consumer

Samer El-Haj-Mahmoud samer.el-haj-mahmoud at arm.com
Fri Apr 30 18:05:01 UTC 2021


Update: UEFI Forum ASWG (ACPI spec working group) approved the submitted ECR as an errata for future ACPI 6.4 spec publication.

We can go ahead and proceed with this patch as submitted, based on that ECR clarification.

With that,

Reviewed-By: Samer El-Haj-Mahmoud Samer.El-Haj-Mahmoud at arm.com<mailto:Samer.El-Haj-Mahmoud at arm.com>

Thanks,
--Samer


From: devel at edk2.groups.io <devel at edk2.groups.io> On Behalf Of Samer El-Haj-Mahmoud via groups.io
Sent: Thursday, April 29, 2021 10:03 AM
To: devel at edk2.groups.io; Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud at arm.com>; Andrei Warkentin (awarkentin at vmware.com) <awarkentin at vmware.com>; Jeremy Linton <Jeremy.Linton at arm.com>; rfc at edk2.groups.io
Cc: Ard Biesheuvel <Ard.Biesheuvel at arm.com>; leif at nuviainc.com; pete at akeo.ie; Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud at arm.com>
Subject: Re: [edk2-devel] [PATCH 3/3] Platform/RaspberryPi/AcpiTables: Correct _DMA consumer

Any further comments on the ACPI ECR documented in: https://bugzilla.tianocore.org/show_bug.cgi?id=3335 ?

I already have comments from Jeremey and Andrew saying it looks good. If there are no objections, I will let ASWG know to approve the ECR for future ACPI spec publication.

Thanks,
--Samer




From: devel at edk2.groups.io<mailto:devel at edk2.groups.io> <devel at edk2.groups.io<mailto:devel at edk2.groups.io>> On Behalf Of Samer El-Haj-Mahmoud via groups.io
Sent: Tuesday, April 13, 2021 12:45 PM
To: Andrei Warkentin (awarkentin at vmware.com<mailto:awarkentin at vmware.com>) <awarkentin at vmware.com<mailto:awarkentin at vmware.com>>; Jeremy Linton <Jeremy.Linton at arm.com<mailto:Jeremy.Linton at arm.com>>; devel at edk2.groups.io<mailto:devel at edk2.groups.io>
Cc: Ard Biesheuvel <Ard.Biesheuvel at arm.com<mailto:Ard.Biesheuvel at arm.com>>; leif at nuviainc.com<mailto:leif at nuviainc.com>; pete at akeo.ie<mailto:pete at akeo.ie>; Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud at arm.com<mailto:Samer.El-Haj-Mahmoud at arm.com>>
Subject: Re: [edk2-devel] [PATCH 3/3] Platform/RaspberryPi/AcpiTables: Correct _DMA consumer

I just got to this thread. Apologies for the delay.

I went through the ACPI spec. Here is what I see:

https://uefi.org/specs/ACPI/6.4/19_ASL_Reference/ACPI_Source_Language_Reference.html#qwordmemory-qword-memory-resource-descriptor-macro


"ResourceUsage specifies whether the Memory range is consumed by this device (ResourceConsumer) or passed on to child devices (ResourceProducer). If nothing is specified, then ResourceConsumer is assumed."



https://uefi.org/specs/ACPI/6.4/06_Device_Configuration/Device_Configuration.html#dma-direct-memory-access



" It specifies the ranges the bus controller (bridge) decodes on the child-side of its interface. (This is analogous to the _CRS object, which describes the resources that the bus controller decodes on the parent-side of its interface.) Any ranges described in the resources of a _DMA object can be used by child devices for DMA or bus master transactions.."



The way I read the spec, this wording in the _DMA definition "Any ranges described in the resources of a _DMA object can be used by child devices.." suggests that this should be a ResourceProducer, per the QWordMemory resource descriptor definition above


The _DMA example in section 6.2.4 uses a "ResourceConsumer", when it should really be "ResourceProducer" according to these definitions: It describes , the child devices view of the address range, so the "translation" added is the CPU's view of the same range.



I submitted a "code first" ECR to correct the ACPI spec example (here : https://bugzilla.tianocore.org/show_bug.cgi?id=3335). Please provide feedback on the BZ (or this thread) whether you agree or not, so we can take this to ASWG/UEFI Forum for discussion and approval



Thanks,

--Samer





From: Andrei Warkentin <awarkentin at vmware.com<mailto:awarkentin at vmware.com>>
Sent: Thursday, April 8, 2021 10:24 AM
To: Jeremy Linton <Jeremy.Linton at arm.com<mailto:Jeremy.Linton at arm.com>>; devel at edk2.groups.io<mailto:devel at edk2.groups.io>
Cc: Ard Biesheuvel <Ard.Biesheuvel at arm.com<mailto:Ard.Biesheuvel at arm.com>>; leif at nuviainc.com<mailto:leif at nuviainc.com>; pete at akeo.ie<mailto:pete at akeo.ie>; Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud at arm.com<mailto:Samer.El-Haj-Mahmoud at arm.com>>
Subject: Re: [PATCH 3/3] Platform/RaspberryPi/AcpiTables: Correct _DMA consumer

I don't know... the ACPI spec is weird.

https://uefi.org/specs/ACPI/6.4/06_Device_Configuration/Device_Configuration.html#dma-direct-memory-access

...lists ResourceConsumer for _DMA.

A

________________________________
From: Jeremy Linton <jeremy.linton at arm.com<mailto:jeremy.linton at arm.com>>
Sent: Thursday, April 8, 2021 12:58 AM
To: devel at edk2.groups.io<mailto:devel at edk2.groups.io> <devel at edk2.groups.io<mailto:devel at edk2.groups.io>>
Cc: ard.biesheuvel at arm.com<mailto:ard.biesheuvel at arm.com> <ard.biesheuvel at arm.com<mailto:ard.biesheuvel at arm.com>>; leif at nuviainc.com<mailto:leif at nuviainc.com> <leif at nuviainc.com<mailto:leif at nuviainc.com>>; pete at akeo.ie<mailto:pete at akeo.ie> <pete at akeo.ie<mailto:pete at akeo.ie>>; samer.el-haj-mahmoud at arm.com<mailto:samer.el-haj-mahmoud at arm.com> <samer.el-haj-mahmoud at arm.com<mailto:samer.el-haj-mahmoud at arm.com>>; Andrei Warkentin <awarkentin at vmware.com<mailto:awarkentin at vmware.com>>; Jeremy Linton <jeremy.linton at arm.com<mailto:jeremy.linton at arm.com>>
Subject: [PATCH 3/3] Platform/RaspberryPi/AcpiTables: Correct _DMA consumer

Bridge devices should be marked as producers so that their
children can consume the resources. In linux if this isn't
true then the translation gets ignored and the DMA values
are incorrect. This fixes DMA on all the devices that
need a translation.

Signed-off-by: Jeremy Linton <jeremy.linton at arm.com<mailto:jeremy.linton at arm.com>>
---
 Platform/RaspberryPi/AcpiTables/Dsdt.asl | 2 +-
 Platform/RaspberryPi/AcpiTables/Emmc.asl | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Platform/RaspberryPi/AcpiTables/Dsdt.asl b/Platform/RaspberryPi/AcpiTables/Dsdt.asl
index d116f965e1..32cd5fc9f9 100644
--- a/Platform/RaspberryPi/AcpiTables/Dsdt.asl
+++ b/Platform/RaspberryPi/AcpiTables/Dsdt.asl
@@ -205,7 +205,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "RPIFDN", "RPI", 2)
         // Only the first GB is available.

         // Bus 0xC0000000 -> CPU 0x00000000.

         //

-        QWordMemory (ResourceConsumer,

+        QWordMemory (ResourceProducer,

           ,

           MinFixed,

           MaxFixed,

diff --git a/Platform/RaspberryPi/AcpiTables/Emmc.asl b/Platform/RaspberryPi/AcpiTables/Emmc.asl
index 179dd3ecdb..0fbc2a79ea 100644
--- a/Platform/RaspberryPi/AcpiTables/Emmc.asl
+++ b/Platform/RaspberryPi/AcpiTables/Emmc.asl
@@ -32,7 +32,7 @@ DefinitionBlock (__FILE__, "SSDT", 5, "RPIFDN", "RPI4EMMC", 2)
       }



       Name (_DMA, ResourceTemplate() {

-        QWordMemory (ResourceConsumer,

+        QWordMemory (ResourceProducer,

           ,

           MinFixed,

           MaxFixed,

--
2.13.7
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.
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.

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 (#74669): https://edk2.groups.io/g/devel/message/74669
Mute This Topic: https://groups.io/mt/81935645/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/edk2-devel-archive/attachments/20210430/3af2640f/attachment.htm>


More information about the edk2-devel-archive mailing list