From nobody Mon Nov 25 12:25:18 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+71688+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+71688+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1613422864159917.8345473330868; Mon, 15 Feb 2021 13:01:04 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id EUkoYY1788612xbIO3mVs496; Mon, 15 Feb 2021 13:01:03 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.29550.1613385158504563275 for ; Mon, 15 Feb 2021 02:32:38 -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 17656101E; Mon, 15 Feb 2021 02:32:38 -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 693C73F40C; Mon, 15 Feb 2021 02:32:36 -0800 (PST) From: "Vivek Kumar Gautam" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Leif Lindholm , Sami Mujawar , Vivek Gautam Subject: [edk2-devel] [edk2-platforms][PATCH V1 1/2] Platform/Sgi: Add smmu node in the iort acpi table Date: Mon, 15 Feb 2021 16:02:28 +0530 Message-Id: <20210215103229.12310-2-vivek.gautam@arm.com> In-Reply-To: <20210215103229.12310-1-vivek.gautam@arm.com> References: <20210215103229.12310-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: 3MSFFr9tc8zJuneL9RLkRzYRx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1613422863; bh=Yvq4xbSIGTabzATdmyHe7ahGNwe43qYU8xO6mnTv2wI=; h=Cc:Date:From:Reply-To:Subject:To; b=oJQTBtqNIjpDxFAnBuoscv5XkXbU4AajPcw8Cg3yhyAItVKGE3/4JdfDZKpIUk7F9Sw kmCXeXwQr5rgmfCI3pM/KQa2MeXLXez2kM4E59x8dWUplR/pgJtp2vqWjbhQo8qRoiuBC 7VRdIXihyEmKJkgaj9w8MxVfX1CfoCtTaS4= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Add the 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..df9bd501158c 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 + __builtin_offsetof (ARM_EFI_ACPI_6_0_IO_REMAPPING_SMMU3_NODE, Smmu= IdMap), // 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 + __builtin_offsetof (ARM_EFI_ACPI_6_0_IO_REMAPPING_TABLE, ItsNode),= // OutputReference + 0, // Flags + }, + { + 0x0, // InputBase + 0x1, // NumIds + 0x10000, // OutputBase + __builtin_offsetof (ARM_EFI_ACPI_6_0_IO_REMAPPING_TABLE, ItsNode),= // OutputReference + 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 (#71688): https://edk2.groups.io/g/devel/message/71688 Mute This Topic: https://groups.io/mt/80664134/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-