From nobody Sun May 5 20:01:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+72493+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+72493+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1614950072; cv=none; d=zohomail.com; s=zohoarc; b=I0/ucPv7/XGVtJruI8nLEWZQYI1Xs0kCB0LO6gGYhbzQFDg0lgwISm5IQjn9Do+3FHNttWEeVfO2PSLDHYKDpABtT6kbCkk3nUJhpx2DKHR3NYUtXfhKIb1CXVnrMJtMPPAipMu9rLwF6cMiNk6ETZjhBwJvCFUzjV0aC9aXyFc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614950072; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=1w/msh7oc//5a52gDQ80qY0cvZ9aUQ0D4gsqOQmDX88=; b=LRHkrwpO/npbJS6IAnUrkKFaerIGoGrQ0BpcDllgZiy2wz88rX13FyXYsrFYhY4wq9hIv+uO1ipJuDZGErN8dXHjgI95vo7C/X0n+UTJKIftTDnB+QB+zitzKPjYgEH0TX0IPzr3HBSXP5OtCvg9ZQ+TGk8nFNedH2KvOngCCpU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+72493+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1614950072525400.5847392880056; Fri, 5 Mar 2021 05:14:32 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id uehDYY1788612xORTpSp8JWF; Fri, 05 Mar 2021 05:14:32 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.11581.1614950071513924297 for ; Fri, 05 Mar 2021 05:14:31 -0800 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 94CEA11FB; Fri, 5 Mar 2021 05:14:27 -0800 (PST) X-Received: from usa.arm.com (a074945.blr.arm.com [10.162.16.71]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id EB2483F73B; Fri, 5 Mar 2021 05:14:25 -0800 (PST) From: "Vivek Kumar Gautam" To: devel@edk2.groups.io Cc: ardb+tianocore@kernel.org, leif@nuviainc.com, Sami.Mujawar@arm.com, Vivek.Gautam@arm.com Subject: [edk2-devel] [edk2-platforms][PATCH V2 1/2] Platform/Sgi: Add smmu-v3 node in the iort acpi table Date: Fri, 5 Mar 2021 18:44:18 +0530 Message-Id: <20210305131419.24069-2-vivek.gautam@arm.com> In-Reply-To: <20210305131419.24069-1-vivek.gautam@arm.com> References: <20210305131419.24069-1-vivek.gautam@arm.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,vivek.gautam@arm.com X-Gm-Message-State: VX6acYiSCt7HZsrjnU8A2Cugx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1614950072; bh=cdN0NPv8lCTn0hcAvx8rL4pbM7pVorTP9nPvx21yeQI=; h=Cc:Date:From:Reply-To:Subject:To; b=BB5rKyBTgwmu3trxeepqGBXu9x9RY+s9CENZfAsgZ1GI6dy2TZrafnhURWFEnJ6VI35 GZHvyXxAOm8QebEeUwWmqsSIEIb7pK33+VNK+MTKnGmfMShH/irRrDdY7RQFbMTwz7Aak zMV4UGhAn1ZtZrCuOx8o3HawoycuZpD+nD0= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Arm's SMMU-v3 present in various SGI/RD platforms provides address translation support for devices such as the ones present over PCIe bus. SMMU-v3 also supports Address Translation Service (ATS) and Page Request Interface (PRI) to work with PCIe devices. The overall system topology looks as below: --------------- ------------ ------------ | PCIe device |---->| SMMUv3 |---->| ITS | | (RequesterID) | | (StreamID) | | (DeviceID) | --------------- ------------ ------------ SMMU-v3 accepts requests coming from the PCIe device, and forwards the traffic to the GIC ITS block that can provide the translation for interrupts coming from LPI sources. Add this generic SMMUv3 type node in the iort table and setup the rid->stream-id->device-id mapping accordingly. Signed-off-by: Vivek Gautam --- Platform/ARM/SgiPkg/AcpiTables/Iort.aslc | 58 ++++++++++++++++++-- 1 file changed, 54 insertions(+), 4 deletions(-) diff --git a/Platform/ARM/SgiPkg/AcpiTables/Iort.aslc b/Platform/ARM/SgiPkg= /AcpiTables/Iort.aslc index 58ec31ddc837..ce8eefc585ea 100644 --- a/Platform/ARM/SgiPkg/AcpiTables/Iort.aslc +++ b/Platform/ARM/SgiPkg/AcpiTables/Iort.aslc @@ -20,6 +20,12 @@ typedef struct UINT32 ItsIdentifiers; } ARM_EFI_ACPI_6_0_IO_REMAPPING_ITS_NODE; =20 +typedef struct +{ + EFI_ACPI_6_0_IO_REMAPPING_SMMU3_NODE SmmuNode; + EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE SmmuIdMap[2]; +} ARM_EFI_ACPI_6_0_IO_REMAPPING_SMMU3_NODE; + typedef struct { EFI_ACPI_6_0_IO_REMAPPING_RC_NODE RcNode; @@ -30,6 +36,7 @@ typedef struct { EFI_ACPI_6_0_IO_REMAPPING_TABLE Header; ARM_EFI_ACPI_6_0_IO_REMAPPING_ITS_NODE ItsNode; + ARM_EFI_ACPI_6_0_IO_REMAPPING_SMMU3_NODE SmmuNode; ARM_EFI_ACPI_6_0_IO_REMAPPING_RC_NODE RcNode; } ARM_EFI_ACPI_6_0_IO_REMAPPING_TABLE; =20 @@ -45,7 +52,7 @@ ARM_EFI_ACPI_6_0_IO_REMAPPING_TABLE Iort =3D ARM_EFI_ACPI_6_0_IO_REMAPPING_TABLE, EFI_ACPI_IO_REMAPPING_TABLE_REVISION ), - 2, // NumNodes + 3, // NumNodes sizeof (EFI_ACPI_6_0_IO_REMAPPING_TABLE), // NodeOffset 0, // Reserved }, @@ -62,9 +69,52 @@ ARM_EFI_ACPI_6_0_IO_REMAPPING_TABLE Iort =3D 0, // NumIdMappings 0, // IdReference }, - 1, // GIC ITS Identifiers + 1, // ITS count + }, + 0, // GIC ITS Identifiers + }, + // SMMU + { + // EFI_ACPI_6_0_IO_REMAPPING_SMMU3_NODE + { + // EFI_ACPI_6_0_IO_REMAPPING_NODE + { + EFI_ACPI_IORT_TYPE_SMMUv3, // Type + sizeof (ARM_EFI_ACPI_6_0_IO_REMAPPING_SMMU3_NODE), // Length + 2, // Revision + 0, // Reserved + 2, // NumIdMapping + OFFSET_OF (ARM_EFI_ACPI_6_0_IO_REMAPPING_SMMU3_NODE, SmmuIdMap), /= / IdReference + }, + 0x4F000000, // Base address + EFI_ACPI_IORT_SMMUv3_FLAG_COHAC_OVERRIDE, // Flags + 0, // Reserved + 0, // VATOS address + EFI_ACPI_IORT_SMMUv3_MODEL_GENERIC, // SMMUv3 Model + 260, // Event + 0, // Pri + 262, // Gerror + 261, // Sync + 0, // Proximity domain + 1, // DevIDMappingIndex + }, + // EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE + { + { + 0x0000, // InputBase + 0xffff, // NumIds + 0x0000, // OutputBase + OFFSET_OF (ARM_EFI_ACPI_6_0_IO_REMAPPING_TABLE, ItsNode), // Outpu= tReference + 0, // Flags + }, + { + 0x0, // InputBase + 0x1, // NumIds + 0x10000, // OutputBase + OFFSET_OF (ARM_EFI_ACPI_6_0_IO_REMAPPING_TABLE, ItsNode), // Outpu= tReference + EFI_ACPI_IORT_ID_MAPPING_FLAGS_SINGLE, // Flags + }, }, - 0, }, // ARM_EFI_ACPI_6_0_IO_REMAPPING_RC_NODE { @@ -91,7 +141,7 @@ ARM_EFI_ACPI_6_0_IO_REMAPPING_TABLE Iort =3D 0x0000, // InputBase 0xffff, // NumIds 0x0000, // OutputBase - OFFSET_OF (ARM_EFI_ACPI_6_0_IO_REMAPPING_TABLE, ItsNode), // Output= Reference + OFFSET_OF (ARM_EFI_ACPI_6_0_IO_REMAPPING_TABLE, SmmuNode), // Outpu= tReference 0, // Flags } } --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#72493): https://edk2.groups.io/g/devel/message/72493 Mute This Topic: https://groups.io/mt/81102022/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sun May 5 20:01:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+72491+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+72491+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1614950071; cv=none; d=zohomail.com; s=zohoarc; b=f3aTmqPUv25GYl625R/6ioBzvKNLYAtaU82mKpCXIuREYzoTg6hnDdi9Xx+ZTp3mdOrV/D+xYNsC6NfmOoVvlDkBC1y/z0Uf9/kg1Owe0bYNBJxLefL6zFYyXlsrrnycLAHTR6fLvqpIZhkyuTLeUg2zkmobLRxTkN4epTYDTN4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614950071; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=yQLK1+BDXn1xKxRiKcHCStwufbnQCbjgbxFcHFakBZs=; b=PI+mQZqfu4Nuh458ebPCic9e6ZfAIZbYJEbjnurHR8jQ9rAgYdI83O2x4IdGNknf40HS4ria1C42xxKPd80aPIvh7tZk6COLKctmn3/X2a/s8TrCB59jpRPaClKKEOwkmsbKblbXk7FkOn3ZeAXx2dPua2SaD9ERvSGd605FmdQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+72491+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1614950071443184.28314848478828; Fri, 5 Mar 2021 05:14:31 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id drRFYY1788612xVxdwctbR4y; Fri, 05 Mar 2021 05:14:31 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.11513.1614950070370845874 for ; Fri, 05 Mar 2021 05:14:30 -0800 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B6C0112FC; Fri, 5 Mar 2021 05:14:29 -0800 (PST) X-Received: from usa.arm.com (a074945.blr.arm.com [10.162.16.71]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 107203F73B; Fri, 5 Mar 2021 05:14:27 -0800 (PST) From: "Vivek Kumar Gautam" To: devel@edk2.groups.io Cc: ardb+tianocore@kernel.org, leif@nuviainc.com, Sami.Mujawar@arm.com, Vivek.Gautam@arm.com Subject: [edk2-devel] [edk2-platforms][PATCH V2 2/2] Platform/Sgi: Enable ATS mode over PCI root complex Date: Fri, 5 Mar 2021 18:44:19 +0530 Message-Id: <20210305131419.24069-3-vivek.gautam@arm.com> In-Reply-To: <20210305131419.24069-1-vivek.gautam@arm.com> References: <20210305131419.24069-1-vivek.gautam@arm.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,vivek.gautam@arm.com X-Gm-Message-State: mUyoHwdW7POkqUGzyN1qmGmtx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1614950071; bh=jCvmRKzsB2Be7ufrnCD+zL+EtDVxvoR0jV6wfAzKu1U=; h=Cc:Date:From:Reply-To:Subject:To; b=pv4KHoXOMo9BlkH5aOER/EFHW1qgkkceoTHmWYxtG2DeZqviO08Zd0WLstrUTwO7p3C w0MwLsaOLFzMAvFRKfHYA837TN77YiMrzuGgyMad70WC1FlliqroHegIr53XwIEveXNDz Te9k0mzbh7fF23uu1fAYThWuuNSkTXB7qBc= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Enable Address Translation Service (ATS) support for the PCI root complex listed in the iort table. ATS allows PCIe devices to request an address translation before starting the dma transaction, so that devices can cache these translations in their private cache that is called as Address Translation Cache (ATC). Devices that support Page Request Interface (PRI) can also enable the feature when ATS is enabled as ATS is a prerequisite for PRI. Signed-off-by: Vivek Gautam --- Platform/ARM/SgiPkg/AcpiTables/Iort.aslc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Platform/ARM/SgiPkg/AcpiTables/Iort.aslc b/Platform/ARM/SgiPkg= /AcpiTables/Iort.aslc index ce8eefc585ea..fcc28a71c82e 100644 --- a/Platform/ARM/SgiPkg/AcpiTables/Iort.aslc +++ b/Platform/ARM/SgiPkg/AcpiTables/Iort.aslc @@ -133,7 +133,7 @@ ARM_EFI_ACPI_6_0_IO_REMAPPING_TABLE Iort =3D 0, // AllocationHints 0, // Reserved 0, // MemoryAccessFlags - EFI_ACPI_IORT_ROOT_COMPLEX_ATS_UNSUPPORTED, // AtsAttribute + EFI_ACPI_IORT_ROOT_COMPLEX_ATS_SUPPORTED, // AtsAttribute 0x0, // PciSegmentNumber }, // EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#72491): https://edk2.groups.io/g/devel/message/72491 Mute This Topic: https://groups.io/mt/81102020/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-