From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from nat-hk.nvidia.com (nat-hk.nvidia.com [203.18.50.4]) by mx.groups.io with SMTP id smtpd.web09.163.1573081781942615560 for ; Wed, 06 Nov 2019 15:09:42 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nvidia.com header.s=n1 header.b=B8gfaiR8; spf=pass (domain: nvidia.com, ip: 203.18.50.4, mailfrom: ashishsingha@nvidia.com) Received: from hkpgpgate102.nvidia.com (Not Verified[10.18.92.9]) by nat-hk.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Thu, 07 Nov 2019 07:09:41 +0800 Received: from HKMAIL103.nvidia.com ([10.18.16.12]) by hkpgpgate102.nvidia.com (PGP Universal service); Wed, 06 Nov 2019 15:09:39 -0800 X-PGP-Universal: processed; by hkpgpgate102.nvidia.com on Wed, 06 Nov 2019 15:09:39 -0800 Received: from HKMAIL104.nvidia.com (10.18.16.13) by HKMAIL103.nvidia.com (10.18.16.12) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 6 Nov 2019 23:09:39 +0000 Received: from NAM01-SN1-obe.outbound.protection.outlook.com (104.47.32.59) by HKMAIL104.nvidia.com (10.18.16.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Wed, 6 Nov 2019 23:09:38 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bT6IdDXHzSyQXgNGqlOrd7J849nJveaQa3zSN24e/hBvekVUTCNVJ/U5dMvoznKN5AJQlnMDpRo1utgP4JAjoaSAucFRVRbQmUznn07N2HaYVzipN56yx63zLsShskPa7diBDqBrAkbEQGfc2B6a2dVJJrWeD5nW1JCOhQhbz8UxYI0LGE7D2eMp/eW6hxwld0yLmDkRTJGqhoSwEQE+He7hoiS4qNGSUdnQIZO83sv+PyUVG5GY558R0KCG47JsOWVBi0AhKcPhggcwiTy1RM2JCClItF+Vpw68Dg3gjBFJQD0nQUdtFqt/9GKWYfSKDXO2SJlnmbloyN9m7KCuAA== 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=/eF+ZzYqcVNA16Xb18NhSwCkCPIe9ycHKm5+ajLJkAI=; b=SA+jDtY4OcxSy4KkpqcWiDZ0jXzMlxkJ0NhRwRBMaZxLODh58PU7XAdvP08wR8jafmAO2VkkByLUUtS/IHZOYmTpoikpd5oWONDaee/zPuKe6bxYreTm1FmyCKfHn0NpjAcKQUUNePsNdZtElzfH5tFpFT1WbcHSSxt4z95Prbjsp7vyzQZYUC6rxmTZ5RdbzyM5GgImzbtu9wE2Ff6FrEaiMc/hSaHI3GHvWxh5TjY3RM2Xw7q5RZK/faDRdQkL/aa3umqcL+alTfm2GgTa1Qx/N3XYY61tkCZkyRYRA6l00kH7hdkcU4AIdFMXTplusOmmT9z0kWecoHlMZ1cPZg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none Received: from DM6PR12MB3324.namprd12.prod.outlook.com (20.178.31.154) by DM6PR12MB3228.namprd12.prod.outlook.com (20.179.105.96) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2408.24; Wed, 6 Nov 2019 23:09:34 +0000 Received: from DM6PR12MB3324.namprd12.prod.outlook.com ([fe80::b53a:559d:9ca3:8ad1]) by DM6PR12MB3324.namprd12.prod.outlook.com ([fe80::b53a:559d:9ca3:8ad1%6]) with mapi id 15.20.2408.024; Wed, 6 Nov 2019 23:09:34 +0000 From: "Ashish Singhal" To: "devel@edk2.groups.io" , "leif.lindholm@linaro.org" , "ard.biesheuvel@linaro.org" Subject: Re: [PATCH] EmbeddedPkg/DtPlatformDxe: Add DT/ACPI Default Flexibility Thread-Topic: [PATCH] EmbeddedPkg/DtPlatformDxe: Add DT/ACPI Default Flexibility Thread-Index: AQHVkzg8kFLjOdEQpEqGpmOb/S/Uy6d+x9HL Date: Wed, 6 Nov 2019 23:09:34 +0000 Message-ID: References: <36d7d7bc005983af4ca5edca8e80b1df1d7c5559.1572889407.git.ashishsingha@nvidia.com> In-Reply-To: <36d7d7bc005983af4ca5edca8e80b1df1d7c5559.1572889407.git.ashishsingha@nvidia.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=ashishsingha@nvidia.com; x-originating-ip: [216.228.112.22] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 9e20fd21-f36d-4bec-7f82-08d7630e634d x-ms-traffictypediagnostic: DM6PR12MB3228: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:75; x-forefront-prvs: 02135EB356 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6029001)(4636009)(136003)(39860400002)(396003)(366004)(376002)(346002)(189003)(199004)(3846002)(6116002)(102836004)(74316002)(7736002)(53546011)(6506007)(71190400001)(71200400001)(7696005)(76176011)(86362001)(2906002)(33656002)(25786009)(19627405001)(2201001)(256004)(8936002)(446003)(81166006)(81156014)(8676002)(11346002)(99286004)(476003)(486006)(105004)(316002)(110136005)(2501003)(66066001)(66946007)(66476007)(64756008)(66446008)(66556008)(76116006)(9686003)(54896002)(55016002)(186003)(52536014)(6246003)(5660300002)(229853002)(26005)(478600001)(6436002)(14454004);DIR:OUT;SFP:1101;SCL:1;SRVR:DM6PR12MB3228;H:DM6PR12MB3324.namprd12.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: nvidia.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 6/AmMtdd65nU0JnB78VVWYKUf8chIT61PBYDdjElwrc67L9dz4CnJWgw6go3KYDyTm3FOCHL7W6BqXqLiRUVOWw41VuMa5shilG7X4TMzP5j9+cjTNsq7NbWDQIEAcN6ejrhv4NhxBYEp0mQeL0k7pdiDkR7s8Bh9j3LAPMY1+dZbBLwo/ngomB1Ii2slP1+iGAjspbk++24eT/P8X7m9D7n4EuMgafPv89otMqVZ5bVsk+ZMSs6ntpIFSIxLweWnBIunUH44CNXjUyEiUTOYtvvndnoy7SNh3prcJEGyyiOe1OBmv3glFwxnpmLdaLd+vYQ34N6laqkk7GdYt20onyRTihUCH0QU4F9ultsGMdwg9bz1FF+WpstE6MRYJ6nvSpWpU69bQCn4DLAdWASMVE19hmSsagmWhqz5e0ayYofFDWAmaSyW8zQQImuO7Ai x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 9e20fd21-f36d-4bec-7f82-08d7630e634d X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Nov 2019 23:09:34.1020 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: cMGQ2N1alMxXSte8sCc0S19WWIMJMGmil/PUq2PFROgpWZOHnMgzCVZYz8tVsnHVIuXdq/f3Y0Je6lkNUD/3Iw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3228 Return-Path: ashishsingha@nvidia.com X-OriginatorOrg: Nvidia.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1573081781; bh=h5g8eaOkhBUnooDXQsQF3PVCVuVilfZyIQRd2rhtYhM=; h=X-PGP-Universal:ARC-Seal:ARC-Message-Signature: ARC-Authentication-Results:From:To:Subject:Thread-Topic: Thread-Index:Date:Message-ID:References:In-Reply-To: Accept-Language:X-MS-Has-Attach:X-MS-TNEF-Correlator: authentication-results:x-originating-ip:x-ms-publictraffictype: x-ms-office365-filtering-correlation-id:x-ms-traffictypediagnostic: x-microsoft-antispam-prvs:x-ms-oob-tlc-oobclassifiers: x-forefront-prvs:x-forefront-antispam-report:received-spf: x-ms-exchange-senderadcheck:x-microsoft-antispam: x-microsoft-antispam-message-info:x-ms-exchange-transport-forked: MIME-Version:X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-originalarrivaltime: X-MS-Exchange-CrossTenant-fromentityheader: X-MS-Exchange-CrossTenant-id:X-MS-Exchange-CrossTenant-mailboxtype: X-MS-Exchange-CrossTenant-userprincipalname: X-MS-Exchange-Transport-CrossTenantHeadersStamped:X-OriginatorOrg: Content-Language:Content-Type; b=B8gfaiR8i3QOEYBJtboqYteAcnLvDmEWbcl1KsJC8CXJSXWUV8N8yRh8r29t8S9zH DSwGX0R2KZITlRmzqC2mCiUGo49TWImOopCZBSLg29lr/sRMkUMk4lACcudsArgD0N lN9wiF+iiT5yZWRoGwe1xAAvLFe03ETn70gBGaH6GRIg6C6219W4kp/fNCBcHT3840 FqigUe6L3brUGKt7rKW88nFc7W47aBzqdo0CJ1DRWEowgRbK4p5EdX7HWeqhb+WR10 x5rDLFGeWF5whkgw0UrnVMwdnZb2kMh7i5Jfsn7E+SjwaoCXnJ/xNEpQW3jFXseUl6 7rgoM1m8IJPgA== Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_DM6PR12MB33249E1EE792D8BB25334840BA790DM6PR12MB3324namp_" --_000_DM6PR12MB33249E1EE792D8BB25334840BA790DM6PR12MB3324namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hello Leif/Ard, Any comments/suggestions on this one? Thanks Ashish ________________________________ From: Ashish Singhal Sent: Monday, November 4, 2019 10:49 AM To: devel@edk2.groups.io ; leif.lindholm@linaro.org= =20; ard.biesheuvel@linaro.org Cc: Ashish Singhal Subject: [PATCH] EmbeddedPkg/DtPlatformDxe: Add DT/ACPI Default Flexibili= ty 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 --- =20EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.c | 16 ++++++++++---= --- =20EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.inf | 3 +++ =20EmbeddedPkg/EmbeddedPkg.dec | 5 +++++ =203 files changed, 18 insertions(+), 6 deletions(-) diff --git a/EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.c b/Embedded= Pkg/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 ( =20 Status =3D gRT->GetVariable(DT_ACPI_VARIABLE_NAME, &gDtPlatformFor= mSetGuid, =20 NULL, &BufferSize, &DtAcpiPref); =20 if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_WARN, "%a: no DT/ACPI preference found, defaulting t= o DT\n", - __FUNCTION__)); - DtAcpiPref.Pref =3D DT_ACPI_SELECT_DT; + DEBUG ((DEBUG_WARN, "%a: no DT/ACPI preference found, defaulting t= o %s\n", + __FUNCTION__, PcdGetBool (PcdDefaultDtPref) ? L"DT" : L"ACPI"));= + DtAcpiPref.Pref =3D PcdGetBool (PcdDefaultDtPref) ? + DT_ACPI_SELECT_DT : + DT_ACPI_SELECT_ACPI; =20 } =20 } =20 if (!EFI_ERROR (Status) && =20 DtAcpiPref.Pref !=3D DT_ACPI_SELECT_ACPI && =20 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)= =20? L"DT" : L"ACPI")); + DtAcpiPref.Pref =3D PcdGetBool (PcdDefaultDtPref) ? + DT_ACPI_SELECT_DT : + DT_ACPI_SELECT_ACPI; =20 Status =3D EFI_INVALID_PARAMETER; // trigger setvar below =20 } diff --git a/EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.inf b/Embedd= edPkg/Drivers/DtPlatformDxe/DtPlatformDxe.inf index b68f154..450ea29 100644 --- a/EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.inf +++ b/EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.inf @@ -46,6 +46,9 @@ =20 gEdkiiPlatformHasAcpiGuid =20 gFdtTableGuid +[Pcd] + gEmbeddedTokenSpaceGuid.PcdDefaultDtPref + =20[Depex] =20 gEfiVariableArchProtocolGuid AND =20 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 @@ =20 # truncation on overflow to specify negative offsets. =20 # =20 gEmbeddedTokenSpaceGuid.PcdDmaDeviceOffset|0x0|UINT64|0x0000058 + + # + # Selection between DT and ACPI as a default + # + gEmbeddedTokenSpaceGuid.PcdDefaultDtPref|TRUE|BOOLEAN|0x0000059 -- 2.7.4 -------------------------------------------------------------------------= ---------- This email message is for the sole use of the intended recipient(s) and m= ay contain confidential information. Any unauthorized review, use, disclosure or di= stribution is prohibited. If you are not the intended recipient, please contact the= =20sender by reply email and destroy all copies of the original message. -------------------------------------------------------------------------= ---------- --_000_DM6PR12MB33249E1EE792D8BB25334840BA790DM6PR12MB3324namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
Hello Leif/Ard,

Any comments/suggestions on this one?

Thanks
Ashish

From: Ashish Singhal &l= t;ashishsingha@nvidia.com>
Sent: Monday, November 4, 2019 10:49 AM
To: devel@edk2.groups.io <devel@edk2.groups.io>; leif.lindho= lm@linaro.org <leif.lindholm@linaro.org>; ard.biesheuvel@linaro.org= =20<ard.biesheuvel@linaro.org>
Cc: Ashish Singhal <ashishsingha@nvidia.com>
Subject: [PATCH] EmbeddedPkg/DtPlatformDxe: Add DT/ACPI Default Fl= exibility
 
Add a PCD to govern whether to use DT or ACPI in= =20case the
variable governing this is not found or is not valid.

Signed-off-by: Ashish Singhal <ashishsingha@nvidia.com>
---
 EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.c   | 16 = ++++++++++------
 EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.inf |  3 += ++
 EmbeddedPkg/EmbeddedPkg.dec      &nbs= p;            = ;      |  5 +++++
 3 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.c b/Embedded= Pkg/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, &gDtPlatformFormSetGuid,
            &= nbsp;        NULL, &BufferSize, &a= mp;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/A= CPI preference found, defaulting to %s\n",
+        __FUNCTION__, PcdGetBool = (PcdDefaultDtPref) ? L"DT" : L"ACPI"));
+      DtAcpiPref.Pref =3D PcdGetBool (PcdDe= faultDtPref) ?
+           &n= bsp;           &nb= sp;  DT_ACPI_SELECT_DT :
+           &n= bsp;           &nb= sp;  DT_ACPI_SELECT_ACPI;
     }
   }
 
   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, d= efaulting 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)= =20?
+           &n= bsp;            DT= _ACPI_SELECT_DT :
+           &n= bsp;            DT= _ACPI_SELECT_ACPI;
     Status =3D EFI_INVALID_PARAMETER; // trigger set= var below
   }
 
diff --git a/EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.inf b/Embedd= edPkg/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
 
+[Pcd]
+  gEmbeddedTokenSpaceGuid.PcdDefaultDtPref
+
 [Depex]
   gEfiVariableArchProtocolGuid     &n= bsp;  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|0x0000= 058
+
+  #
+  # Selection between DT and ACPI as a default
+  #
+  gEmbeddedTokenSpaceGuid.PcdDefaultDtPref|TRUE|BOOLEAN|0x00000= 59
--
2.7.4


This email message is for the sole use of the intended recipient(s) = and may=20 contain confidential information.  Any unauthorized review, use, dis= closure=20 or distribution is prohibited.  If you are not the intended recipien= t,=20 please contact the sender by reply email and destroy all copies of the or= iginal=20 message.

--_000_DM6PR12MB33249E1EE792D8BB25334840BA790DM6PR12MB3324namp_--