From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR03-DB5-obe.outbound.protection.outlook.com (EUR03-DB5-obe.outbound.protection.outlook.com [40.107.4.55]) by mx.groups.io with SMTP id smtpd.web10.281.1618332298035437334 for ; Tue, 13 Apr 2021 09:44:58 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=ZX1/O12t; spf=pass (domain: arm.com, ip: 40.107.4.55, mailfrom: samer.el-haj-mahmoud@arm.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Hc/9pE6oQIZEGgJCO1KL1E5AM9D2aD6QS2Jx55TdmcA=; b=ZX1/O12tbLSyTXJe6MOpGa1iznNg57hGhU9Y2yk7HTi3jpz8y1iRPgECnaaOh4VuhLTai76J9CSVCMfBT9Oa8NWREx+j6zA7PxOHZoS5PS5d4V+Cm4h6BA8O2SC9O7gXKNhLaPM+rTwM/upTpN+MlvuiajDeSQZAnq3prjHUP2M= Received: from AM5PR0202CA0023.eurprd02.prod.outlook.com (2603:10a6:203:69::33) by VI1PR0801MB1822.eurprd08.prod.outlook.com (2603:10a6:800:5c::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.21; Tue, 13 Apr 2021 16:44:55 +0000 Received: from AM5EUR03FT048.eop-EUR03.prod.protection.outlook.com (2603:10a6:203:69:cafe::b3) by AM5PR0202CA0023.outlook.office365.com (2603:10a6:203:69::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.16 via Frontend Transport; Tue, 13 Apr 2021 16:44:55 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; edk2.groups.io; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;edk2.groups.io; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT048.mail.protection.outlook.com (10.152.17.177) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.17 via Frontend Transport; Tue, 13 Apr 2021 16:44:54 +0000 Received: ("Tessian outbound 82c2d58b350b:v90"); Tue, 13 Apr 2021 16:44:54 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: d1cc61cbb487bb73 X-CR-MTA-TID: 64aa7808 Received: from b0636499a3de.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 8AF7207E-D719-4571-9765-0DC6743423E1.1; Tue, 13 Apr 2021 16:44:42 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id b0636499a3de.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 13 Apr 2021 16:44:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CMHlH+yp5TWYgMZoHR48LBfSbxYi6K865NyVix9u/Y63f86LtTr/QWiEE46fRYiE0LVwuYeCWytCJ2vgULvT23dz+kOWhUUmOG3ACdbM0ayB1x6f7m1/VksUKdYREAYKls3+B/czK6RYT+K8/RNFMnqJJ46g6ymraYX7EzMcTJkuBYZRqLKmrhI4WvZjNGP67S3MqWwZXZikp2GjusFQk6NMVFk1aaUGzRyhdWXrCPYE9Tl4Ofg8Cvdd9qrOt+6gDUdfw4/4ZY+2EMxf/27dAbcbE8+ek3UuewueBlafgHZNVsLQABBxr8/7irwclXvis+4mbPcIZsu+KkzKmehioQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Hc/9pE6oQIZEGgJCO1KL1E5AM9D2aD6QS2Jx55TdmcA=; b=C8k0mt9fgtH0xAhUK2A0hHoHAIJJdP7F3A8QGyBHpw2+OjFE1uARyiuCNuuuO0PSputUhB/rDF0vOig7i4PQJuevmii7di0yhd4bBU7QOHGMaYlnRnJq/bUXcQNALULsnutNM0SusP7BJIHMER0RazzkjGfZ2JRGQHtNuHwzQAIEYF+ERVgqhhY4gZZwt6p0raWTLqgQyiNizdH/OeF/ibXbsgNCGqBUhzpC1YxnCokg7K8aAdIUHs2PJbP63AE+5YRCcbMnUPFz2uWuKgccOrt9D9NPurWeteCpVs+BySmbudz6OjbWcfJqbIISObEkF9nTJBOqyPhq/O95lP84Fw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Hc/9pE6oQIZEGgJCO1KL1E5AM9D2aD6QS2Jx55TdmcA=; b=ZX1/O12tbLSyTXJe6MOpGa1iznNg57hGhU9Y2yk7HTi3jpz8y1iRPgECnaaOh4VuhLTai76J9CSVCMfBT9Oa8NWREx+j6zA7PxOHZoS5PS5d4V+Cm4h6BA8O2SC9O7gXKNhLaPM+rTwM/upTpN+MlvuiajDeSQZAnq3prjHUP2M= Received: from DB7PR08MB3260.eurprd08.prod.outlook.com (2603:10a6:5:21::23) by DB7PR08MB3164.eurprd08.prod.outlook.com (2603:10a6:5:24::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.22; Tue, 13 Apr 2021 16:44:41 +0000 Received: from DB7PR08MB3260.eurprd08.prod.outlook.com ([fe80::7492:d3fd:d6f4:e187]) by DB7PR08MB3260.eurprd08.prod.outlook.com ([fe80::7492:d3fd:d6f4:e187%6]) with mapi id 15.20.4020.022; Tue, 13 Apr 2021 16:44:41 +0000 From: "Samer El-Haj-Mahmoud" To: "Andrei Warkentin (awarkentin@vmware.com)" , Jeremy Linton , "devel@edk2.groups.io" CC: Ard Biesheuvel , "leif@nuviainc.com" , "pete@akeo.ie" , Samer El-Haj-Mahmoud Subject: Re: [PATCH 3/3] Platform/RaspberryPi/AcpiTables: Correct _DMA consumer Thread-Topic: [PATCH 3/3] Platform/RaspberryPi/AcpiTables: Correct _DMA consumer Thread-Index: AQHXLDxK9rrtmosIqEClGyylGxm9MaqqrQyAgAf3JdA= Date: Tue, 13 Apr 2021 16:44:41 +0000 Message-ID: References: <20210408055843.2883563-1-jeremy.linton@arm.com>,<20210408055843.2883563-4-jeremy.linton@arm.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: Authentication-Results-Original: vmware.com; dkim=none (message not signed) header.d=none;vmware.com; dmarc=none action=none header.from=arm.com; x-originating-ip: [99.132.126.10] x-ms-publictraffictype: Email X-MS-Office365-Filtering-Correlation-Id: 21022e06-038c-4351-ed67-08d8fe9b7734 x-ms-traffictypediagnostic: DB7PR08MB3164:|VI1PR0801MB1822: x-ld-processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:7691;OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: Fu83l1nKyVdQqVLjdu+TwQ9jZ0uwNKB8o9vVsbFrHUg+3g1yfi26B7TGTxmo3GlFWjwoJi8K5KurF/e3Z9SiyWSIAhRMg3mYYjytu4JkN94MPFE+JSZ0k6fangrIDvufQ3jldUTrDY3UmvZ9YIHtdmgR2O/fMzTX7d2IgAW9x3OeFP7hPCkLEtKpyUkcoaA/Osw4ACesPaRbMwSGngkZkTGE/Lxbait5kPN1RcSOcUl3Xr5R6uZjRQLu0MnUA27USPT99oq19A2cLZKjB1kc5iwTHBJmZfr+L82tAXaEO1W9olW+Gjxamm/uvHdd+VaV32f/n/ThcNELLcFAyTboUgjHfyxMZ+vI7S3QWem83l6trF/MAE2tj0FnobcSqNJs5tB0ivTlQWAWmc2ODHj7eaApBqwFMIMfkDWXBjpo1+r1z721494ZQy9tjeDwZgHW93GLUjNXfJtiOcocR1K89lLgzhoeWBcWvpCGZOcmf082hUERLJeGr0sMkh2FKKaidYrUX/KaqJtapl3n8GSnSmlWvGx6XW5tNTgxGW50WBocI5Bqff0+5CYYP2Gil96IzNRbEsI3nr0FB/0Vze/Cpc5Q2DxYesPlngCARVwelXEtxXXD7FrG7BJMVlUq76jEX4BJbtjVTPRyePKcPXkUXOpTMsoWEXCG6UB/KnKC4io5+D9P5yht2MFjlEcEke29 X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR08MB3260.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(39860400002)(366004)(136003)(346002)(396003)(376002)(4326008)(86362001)(71200400001)(478600001)(5660300002)(83380400001)(38100700002)(26005)(122000001)(55016002)(66946007)(966005)(33656002)(9686003)(53546011)(76116006)(54906003)(2906002)(52536014)(316002)(110136005)(6506007)(186003)(64756008)(166002)(7696005)(66476007)(8936002)(66446008)(66556008)(8676002);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?LbGde7bjbU7/dQpvvl0BFOtAcF8LzvzNFPKI9pdTYCWwZwtvezmS2sZ+Be18?= =?us-ascii?Q?thGxUzEBlZB2yC7/uMkchl43fDv+1a8/Jp2/nkwgsjLtLI9GvxyVTi4i+NRB?= =?us-ascii?Q?WssAmiuYLq8BXgCdQ6HNalGU4q7/TY58g2pFLJxpRHO7q439jXUizg6yIS2G?= =?us-ascii?Q?HnwoYkta+8tsdYpqHXKS9kPO0NLn9QnxgRVJ0fcTudSao47TzMfgVVTnaPhU?= =?us-ascii?Q?dL2LJgwPmsjKEaFSE1EDAitexw+/mguHZTvts8vULDYFRRiUghloRBuFGix1?= =?us-ascii?Q?b9p9Dp68WT2ERebTlOrU5I+dI1ZmKMC/fXGk2Fn5j74IVU+tDyw+LXYm9bPB?= =?us-ascii?Q?iB3ehRvIxga6k2KDqY30RMnYc5STPvxu1XwkC+ew8AhrCqfHRg6lN7bkwMiA?= =?us-ascii?Q?aZnnTeN3xj1DTLOCiCX5aO/jZ11MX8JAX157D4uV43/KjlK8gLwergcXKrdx?= =?us-ascii?Q?op5SulvVFzgksq3Nnk9EZ7XriUg1ukoqxxuRFjPCRYBvLTF9ZyxK6c7ZXds4?= =?us-ascii?Q?6xIVmKMmIrdF0w1rVA8k6CFacCBtwoMnW8eDY/fibAe29QAlWNBBfPSSjQCo?= =?us-ascii?Q?ihVBM4IM3bC6NA+DbIisg1mnGkGwjmUVumpSgMLGJ1BVmyNU+csZMqWzhzbI?= =?us-ascii?Q?Rapc3MUsnyYx4otysJ2XTkPRYQyE88cj8Ns6Nwq7WH3fCOL8ZQMtXrjiNmd9?= =?us-ascii?Q?JT2gkWXk/VZHQxRxhRxweRjkbnrETm3ZdjJIn/Z8dWd1V6fA2J07rkCXOVhe?= =?us-ascii?Q?kb10/VrQnxURn+T2XITR1PBsz0bigHP67yTlmxfT8lLQvUyPDr5lQXKxQeHz?= =?us-ascii?Q?qpLP90Q7x09NHk/qXczo30ZPqBizcwbHA2/SEQNSLNska6eY4YiFuitrdf+9?= =?us-ascii?Q?Wes1DtKZ0QJfSu9OxMAeLsDNqiF6hzin4luMEmGLON4kFA+7xeBTAa8XuZg6?= =?us-ascii?Q?/JMgPVj62QjlhJsRXvQYi8CYRcfzBx10BrXeYBzWSpX2RGJfscFWjYN+qkCJ?= =?us-ascii?Q?4WBmv3h+jmWvBqw/mkDuKaF02NubUs1rFXEfVD+nd+LbBtX2mBpqSmbZcwZc?= =?us-ascii?Q?h9F91d20W78ol0CcaT82cvhyRo7w1excp8Lkx3eic6O5fpoeai2F74nhU/Ig?= =?us-ascii?Q?bUz77YSXYkk0I0Rhmo2iRWQda6UZmYXPtum7RYmweVzfA+3ttaTx4BCORnUg?= =?us-ascii?Q?JEH+Z8+cSk/kQJCOQ7ZfMSQ8931hNcrvRg8xDcG8rw1zZF2LFZNRushG4rOF?= =?us-ascii?Q?7m736ZX+gylANZpP7apzsDstbJxLweRPspfLZ7v6zB/HXwwsr7ibpdL0bbSs?= =?us-ascii?Q?IX6J1wmFdehpxSqS9gZDaCOm?= MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3164 Original-Authentication-Results: vmware.com; dkim=none (message not signed) header.d=none;vmware.com; dmarc=none action=none header.from=arm.com; Return-Path: Samer.El-Haj-Mahmoud@arm.com X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT048.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: a4ba3dee-d866-4db2-e9f1-08d8fe9b6f3e X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JuGwMfQAlhk0+c5goSCtIGAxkoEOPVY/GKCuwgRWkwnaNX1nYfqycn4gE6iAASzIagu3oPyJlFyYSZtlQ72h2fdsmZ+gWnsfKWuvJrl4K+NCqOeBGVlr7xWUZpMgS0p9+9wW3r9sBDgKs9cIsDoxReFm6EelFWEd2XZdU/CsqIzJW1Fwu9yIypJthfW8TMvsBw3dfDTUwSlrErTGYjdtTew097oPnR9zCNZEcM4oZBCQ+ykFFkJQUZBBStVDzUsheoHmsARvlO0lo6pUagEcRdVzNvJR28e4bD33f4yo/wNIN86VK/vtLMc2k14lJAOfCKGjE+Tkef7i1UVJyYdXNg8uMbZ8z1oubMIHbrABuC+2xTjqHM7CicuPyYOlGBjYoYy/OqWRNWwOIIyGsF910HHsfrxpaFlNG/sLQVm3L11ttuCG5GK+vwn4pmQYn1Th5MjmTfosI+mthAzZeCoxk0XptOJMeMc6EpsrW5uo5dT3XGkETlTBwk4A+ca+1elSkEhl2VmDhDjyKxxVegcwOPgh3oDYJaO+Djcz2KCz/7j3osEeh3+6y7uowMFyTNqAqxiXrIDGHR8/0nRsId+6hfQZQWYC+0q6MBQm/ezdDYPPWrrsUsHCswAF17mI1/apYKcGNRe7zBejkF4ATCtzsZdpS1WDUarE6umaGus80vm3BxTrVDdnZ04yfq1y3SNqEOKCkTiDuiGrJYwgzVtPANVKdrox1j2jl10I4uzkN8I= X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(396003)(376002)(136003)(346002)(39860400002)(46966006)(36840700001)(9686003)(110136005)(47076005)(82310400003)(86362001)(52536014)(55016002)(54906003)(5660300002)(4326008)(8936002)(7696005)(186003)(6506007)(70206006)(336012)(356005)(166002)(53546011)(82740400003)(966005)(478600001)(316002)(83380400001)(2906002)(81166007)(33656002)(8676002)(70586007)(36860700001)(26005);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2021 16:44:54.5528 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 21022e06-038c-4351-ed67-08d8fe9b7734 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM5EUR03FT048.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB1822 Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_DB7PR08MB3260A561B9170928EABC1F55904F9DB7PR08MB3260eurp_" --_000_DB7PR08MB3260A561B9170928EABC1F55904F9DB7PR08MB3260eurp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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_Refer= ence.html#qwordmemory-qword-memory-resource-descriptor-macro "ResourceUsage specifies whether the Memory range is consumed by this devic= e (ResourceConsumer) or passed on to child devices (ResourceProducer). If n= othing is specified, then ResourceConsumer is assumed." https://uefi.org/specs/ACPI/6.4/06_Device_Configuration/Device_Configuratio= n.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 describ= es 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 u= sed by child devices for DMA or bus master transactions.." The way I read the spec, this wording in the _DMA definition "Any ranges de= scribed in the resources of a _DMA object can be used by child devices.." s= uggests that this should be a ResourceProducer, per the QWordMemory resourc= e 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 i= s the CPU's view of the same range. I submitted a "code first" ECR to correct the ACPI spec example (here : htt= ps://bugzilla.tianocore.org/show_bug.cgi?id=3D3335). Please provide feedbac= k 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 Sent: Thursday, April 8, 2021 10:24 AM To: Jeremy Linton ; devel@edk2.groups.io Cc: Ard Biesheuvel ; leif@nuviainc.com; pete@akeo.i= e; Samer El-Haj-Mahmoud Subject: Re: [PATCH 3/3] Platform/RaspberryPi/AcpiTables: Correct _DMA cons= umer I don't know... the ACPI spec is weird. https://uefi.org/specs/ACPI/6.4/06_Device_Configuration/Device_Configuratio= n.html#dma-direct-memory-access ...lists ResourceConsumer for _DMA. A ________________________________ From: Jeremy Linton > Sent: Thursday, April 8, 2021 12:58 AM To: devel@edk2.groups.io > Cc: ard.biesheuvel@arm.com >; leif@nuviainc.com >; pete@akeo.ie >; samer.el-haj-mahmoud@ar= m.com >; Andrei Warkentin >; Jeremy Linton > 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 > --- 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/RaspberryP= i/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/RaspberryP= i/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 confid= ential and may also be privileged. If you are not the intended recipient, p= lease 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. --_000_DB7PR08MB3260A561B9170928EABC1F55904F9DB7PR08MB3260eurp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

I just got to this thread. Apologies for the delay.<= o:p>

 

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

 

https://uefi.org/s= pecs/ACPI/6.4/19_ASL_Reference/ACPI_Source_Language_Reference.html#qwordmem= ory-qword-memory-resource-descriptor-macro

 

Reso=
urceUsage specifies whether the Memory range is consumed by this device (Re=
sourceConsumer) or passed on to child devices (ResourceProducer). If nothin=
g is specified, then ResourceConsumer is assumed.”<=
/pre>
 =
https://uefi.org/specs/ACPI/6.4/06_Device_Configuratio=
n/Device_Configuration.html#dma-direct-memory-access<=
/pre>
 
“&nbs=
p;It specifies the ranges the bus controller (bridge) decodes on the child-=
side of its interface. (This is analogous to the _CRS object, which describ=
es 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 u=
sed by child devices for DMA or bus master transactions..”=
 =
The way I read the spec, this wording in the _DMA defini=
tion “Any ranges described in the resources of a _DMA object can be u=
sed by child devices..” suggests that this should be a ResourceProduc=
er, per the QWordMemory resource descriptor definition above
 

The _DMA example in section 6.2.4 uses a “Reso= urceConsumer”, 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 th=
e ACPI spec example (here : https://bugzilla.tianocore.org/show_bug.cgi?id=3D3335). 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@vmware.= com>
Sent: Thursday, April 8, 2021 10:24 AM
To: Jeremy Linton <Jeremy.Linton@arm.com>; devel@edk2.groups.i= o
Cc: Ard Biesheuvel <Ard.Biesheuvel@arm.com>; leif@nuviainc.com= ; pete@akeo.ie; Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com> Subject: Re: [PATCH 3/3] Platform/RaspberryPi/AcpiTables: Correct _D= MA consumer

 

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

 

 

...lists ResourceConsumer for _DMA.

 

A

 


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

 

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 <j= eremy.linton@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/RaspberryP= i/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 av= ailable.

         // Bus 0xC0000000 -> CP= U 0x00000000.

         //

-        QWordMemory (ResourceConsumer,<= br>
+        QWordMemory (ResourceProducer,<= br>
           ,

           MinFixed,

           MaxFixed,

diff --git a/Platform/RaspberryPi/AcpiTables/Emmc.asl b/Platform/RaspberryP= i/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, "RPI= FDN", "RPI4EMMC", 2)
       }

 

       Name (_DMA, ResourceTemplate() {

-        QWordMemory (ResourceConsumer,<= br>
+        QWordMemory (ResourceProducer,<= br>
           ,

           MinFixed,

           MaxFixed,

--
2.13.7

IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease 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. --_000_DB7PR08MB3260A561B9170928EABC1F55904F9DB7PR08MB3260eurp_--