From nobody Tue Nov 26 14:37:53 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+49936+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+49936+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=nvidia.com ARC-Seal: i=1; a=rsa-sha256; t=1572889777; cv=none; d=zoho.com; s=zohoarc; b=SVS0nPUqoT93hdnetpnZmDL3rsib0OeVPwWIfntcnIaibXvrOQxdRYvzQzDswBPgf4lP1sHfUjsKskLZWiQGDt/9Y2XjE7vLuT+fSETNt6sQl5uah3U8c+VMn2wHbQB0pqI+FjpWf+PLpmdSCerjHsdDGSKFzzsnyG5TnTtYrNE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1572889777; h=Content-Type:Cc:Date:From:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=l0dZCAqdJgE4cKKarDIucUpx5lzdm+mYLy1BrnpkmSM=; b=gy9ftHI4v3anFhhsMHxYOBGXfDKqCGV9sizTIfPruCwZrPfZvg6Nz/5k2GAV7JNfyMzBp4EYkNtFVbudzfRR87sofHrifLC64KGVghH538UPZqN8UW1LCS/+XehNLw2U5K03hHiqxr9vIrfJ8LBK+91jqLbaek/2O9iX67PQE4I= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+49936+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1572889777789997.4000286899812; Mon, 4 Nov 2019 09:49:37 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id aaaaYY1788612xaaaaaaaaaa; Mon, 04 Nov 2019 09:49:36 -0800 X-Received: from hqemgate16.nvidia.com (hqemgate16.nvidia.com [216.228.121.65]) by mx.groups.io with SMTP id smtpd.web09.8534.1572889776491672471 for ; Mon, 04 Nov 2019 09:49:36 -0800 X-Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate16.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Mon, 04 Nov 2019 09:49:42 -0800 X-Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Mon, 04 Nov 2019 09:49:36 -0800 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Mon, 04 Nov 2019 09:49:36 -0800 X-Received: from HQMAIL109.nvidia.com (172.20.187.15) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 4 Nov 2019 17:49:35 +0000 X-Received: from HQMAIL105.nvidia.com (172.20.187.12) by HQMAIL109.nvidia.com (172.20.187.15) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 4 Nov 2019 17:49:35 +0000 X-Received: from hqnvemgw02.nvidia.com (172.16.227.111) by HQMAIL105.nvidia.com (172.20.187.12) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Mon, 4 Nov 2019 17:49:35 +0000 X-Received: from ashishsingha-lnx.nvidia.com (Not Verified[10.28.48.147]) by hqnvemgw02.nvidia.com with Trustwave SEG (v7,5,8,10121) id ; Mon, 04 Nov 2019 09:49:35 -0800 From: "Ashish Singhal" To: , , CC: Ashish Singhal Subject: [edk2-devel] [PATCH] EmbeddedPkg/DtPlatformDxe: Add DT/ACPI Default Flexibility Date: Mon, 4 Nov 2019 10:49:31 -0700 Message-ID: <36d7d7bc005983af4ca5edca8e80b1df1d7c5559.1572889407.git.ashishsingha@nvidia.com> X-NVConfidentiality: public 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,ashishsingha@nvidia.com X-Gm-Message-State: aaaaaaaaaaaaaaaaaaaaaaaax1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1572889776; bh=QXQ9vZjxOe0vU6bXNN9YszlxlEkRDLpkUYPE4YaswWk=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=NgduwHQ7+8txoNr9uES2j06Aa7r32KJ3MklvPw0EZGBvqV3/ZDRiTGHE0t1Nru0rUVE 7lvIx7F5ncsADLYBZfrPDZgjcmgXU6Q0Qy7I0AOrUO8ljZC3p2E7gxOdJDTUfPxtatmhw iKLxkuIcCDqS3zvVr4JcRxV6iCyOU5Jedng= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add a PCD to govern whether to use DT or ACPI in case the variable governing this is not found or is not valid. Signed-off-by: Ashish Singhal Reviewed-by: Ard Biesheuvel --- EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.c | 16 ++++++++++------ EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.inf | 3 +++ EmbeddedPkg/EmbeddedPkg.dec | 5 +++++ 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.c b/EmbeddedPk= g/Drivers/DtPlatformDxe/DtPlatformDxe.c index 907d46a..e35ca33 100644 --- a/EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.c +++ b/EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.c @@ -124,18 +124,22 @@ DtPlatformDxeEntryPoint ( Status =3D gRT->GetVariable(DT_ACPI_VARIABLE_NAME, &gDtPlatformFormSet= Guid, NULL, &BufferSize, &DtAcpiPref); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_WARN, "%a: no DT/ACPI preference found, defaulting to = DT\n", - __FUNCTION__)); - DtAcpiPref.Pref =3D DT_ACPI_SELECT_DT; + DEBUG ((DEBUG_WARN, "%a: no DT/ACPI preference found, defaulting to = %s\n", + __FUNCTION__, PcdGetBool (PcdDefaultDtPref) ? L"DT" : L"ACPI")); + DtAcpiPref.Pref =3D PcdGetBool (PcdDefaultDtPref) ? + DT_ACPI_SELECT_DT : + DT_ACPI_SELECT_ACPI; } } =20 if (!EFI_ERROR (Status) && DtAcpiPref.Pref !=3D DT_ACPI_SELECT_ACPI && DtAcpiPref.Pref !=3D DT_ACPI_SELECT_DT) { - DEBUG ((DEBUG_WARN, "%a: invalid value for %s, defaulting to DT\n", - __FUNCTION__, DT_ACPI_VARIABLE_NAME)); - DtAcpiPref.Pref =3D DT_ACPI_SELECT_DT; + DEBUG ((DEBUG_WARN, "%a: invalid value for %s, defaulting to %s\n", + __FUNCTION__, DT_ACPI_VARIABLE_NAME, PcdGetBool (PcdDefaultDtPref) ?= L"DT" : L"ACPI")); + DtAcpiPref.Pref =3D PcdGetBool (PcdDefaultDtPref) ? + DT_ACPI_SELECT_DT : + DT_ACPI_SELECT_ACPI; Status =3D EFI_INVALID_PARAMETER; // trigger setvar below } =20 diff --git a/EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.inf b/Embedded= Pkg/Drivers/DtPlatformDxe/DtPlatformDxe.inf index b68f154..450ea29 100644 --- a/EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.inf +++ b/EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.inf @@ -46,6 +46,9 @@ gEdkiiPlatformHasAcpiGuid gFdtTableGuid =20 +[Pcd] + gEmbeddedTokenSpaceGuid.PcdDefaultDtPref + [Depex] gEfiVariableArchProtocolGuid AND gEfiVariableWriteArchProtocolGuid diff --git a/EmbeddedPkg/EmbeddedPkg.dec b/EmbeddedPkg/EmbeddedPkg.dec index bbaadc5..8812a6d 100644 --- a/EmbeddedPkg/EmbeddedPkg.dec +++ b/EmbeddedPkg/EmbeddedPkg.dec @@ -185,3 +185,8 @@ # truncation on overflow to specify negative offsets. # gEmbeddedTokenSpaceGuid.PcdDmaDeviceOffset|0x0|UINT64|0x0000058 + + # + # Selection between DT and ACPI as a default + # + gEmbeddedTokenSpaceGuid.PcdDefaultDtPref|TRUE|BOOLEAN|0x0000059 --=20 2.7.4 -=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 (#49936): https://edk2.groups.io/g/devel/message/49936 Mute This Topic: https://groups.io/mt/41355681/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-