From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=40.107.0.69; helo=eur02-am5-obe.outbound.protection.outlook.com; envelope-from=udit.kumar@nxp.com; receiver=edk2-devel@lists.01.org Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00069.outbound.protection.outlook.com [40.107.0.69]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B140B211958E6 for ; Tue, 5 Jun 2018 10:16:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=U92NuA3qqdRiXauuC2Uc4C2W5U78IkFAqRRvBx1KOA4=; b=eu7naMgDGMWeArfxOl+1SMv42xqodD8OTTPijBm0HjweHl/1NhpZNw0Z331c6XYz29AIJiPj0g+QPsNvy8Krm97JKv05777SVPeCLvgMT2Gzpbt9YijcZ2oux2zin8/GCUIdswk5Ui9JIlMxYMQTdf3T+bDTwne6J0NhKY6ZMkM= Received: from AM6PR0402MB3334.eurprd04.prod.outlook.com (52.133.18.151) by AM6PR0402MB3894.eurprd04.prod.outlook.com (52.133.29.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.820.11; Tue, 5 Jun 2018 17:16:04 +0000 Received: from AM6PR0402MB3334.eurprd04.prod.outlook.com ([fe80::397b:61de:4465:b93c]) by AM6PR0402MB3334.eurprd04.prod.outlook.com ([fe80::397b:61de:4465:b93c%2]) with mapi id 15.20.0820.012; Tue, 5 Jun 2018 17:16:04 +0000 From: Udit Kumar To: Alexei Fedorov , "edk2-devel@lists.01.org" , "ard.biesheuvel@linaro.org" , "leif.lindholm@linaro.org" Thread-Topic: [edk2] [PATCH 1/2] ArmPlatformPkg: PL011 Dynamic clock freq Support Thread-Index: AQHT/MkHFjqW8a/Xm0mzjmlDmTWCi6RR5/rw Date: Tue, 5 Jun 2018 17:16:04 +0000 Message-ID: References: <1528155339-5050-1-git-send-email-udit.kumar@nxp.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=udit.kumar@nxp.com; x-originating-ip: [117.242.225.166] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM6PR0402MB3894; 7:b02cWemgu9ybcappjU31+yh5a0f/u/UVH3txw4lnbLHQadJRKVdHLJPO6L7vEfKeNUmvufESO/MwMhOSJqkV1N0+eoW/4/Tpo73Mdu0OIkcas07+cAGmlJmsIG0WDD2Z63k3zMge7OYf7BH6F8pgZ6zRy4lN9gGBIg8SXi1AfmNaVzrUcXRvy6xcr2qL8ONuGK7R3KmVjOGfmeaAuz+OU3ZjMWfmEtLfuLB1MPWA1izbaMAql6Ch5z0c3CdssvzF x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:AM6PR0402MB3894; x-ms-traffictypediagnostic: AM6PR0402MB3894: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(180628864354917)(189930954265078)(185117386973197)(162533806227266)(45079756050767); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231254)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123560045)(20161123564045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:AM6PR0402MB3894; BCL:0; PCL:0; RULEID:; SRVR:AM6PR0402MB3894; x-forefront-prvs: 0694C54398 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(366004)(396003)(39860400002)(39380400002)(346002)(199004)(13464003)(189003)(8936002)(8676002)(3846002)(5660300001)(2906002)(7736002)(305945005)(478600001)(110136005)(45080400002)(99286004)(6306002)(186003)(316002)(59450400001)(25786009)(16799955002)(68736007)(106356001)(3660700001)(6246003)(74316002)(33656002)(53546011)(3280700002)(102836004)(11346002)(6506007)(26005)(55016002)(2900100001)(476003)(97736004)(76176011)(5250100002)(486006)(5890100001)(14454004)(6116002)(44832011)(966005)(81166006)(6436002)(9686003)(2501003)(66066001)(86362001)(53936002)(446003)(575784001)(105586002)(81156014)(7696005)(229853002)(2201001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR0402MB3894; H:AM6PR0402MB3334.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: oRjg0/Kk2OcZ/DlNN1C8Xl6Oq8oXR7WksznIn2OquHoTkG3gWs8tNIztF7tsACi8q72zhT6iZXD9umpy4oFh1lIZLIadX4cMNb59OZ1d+FC0ui2rYwSXf9noYQ+THIKNm1f82PvUc6bKPZ8XbFbgyOagyYPXXZhjN16pi+EFVCAX5F3H4NQ5XSz2HSD7iz9f spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: dd4c742a-803e-4d4e-cca7-08d5cb0804fe X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: dd4c742a-803e-4d4e-cca7-08d5cb0804fe X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Jun 2018 17:16:04.5446 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0402MB3894 Subject: Re: [PATCH 1/2] ArmPlatformPkg: PL011 Dynamic clock freq Support X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 17:16:07 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: Alexei Fedorov [mailto:Alexei.Fedorov@arm.com] > Sent: Tuesday, June 5, 2018 6:01 PM > To: Udit Kumar ; edk2-devel@lists.01.org; > ard.biesheuvel@linaro.org; leif.lindholm@linaro.org > Subject: RE: [edk2] [PATCH 1/2] ArmPlatformPkg: PL011 Dynamic clock freq > Support >=20 > Please see my comment in-lined >=20 > > -----Original Message----- > > From: edk2-devel On Behalf Of Udit > > Kumar > > Sent: 05 June 2018 00:36 > > To: edk2-devel@lists.01.org; ard.biesheuvel@linaro.org; > > leif.lindholm@linaro.org > > Subject: [edk2] [PATCH 1/2] ArmPlatformPkg: PL011 Dynamic clock freq > > Support > > > > Some platform support dynamic clocking, Which is controlled by some > > jumper setting or hardware registers. > > Result of that PCD PL011UartClkInHz needs to be updated for frequency > change. > > This patch implements support for dynamic frequency for > > PL011 uart. > > This patch implement NULL lib for such platform where Pcd clock > > frequency to > > PL011 can change > > > > Contributed-under: TianoCore Contribution Agreement 1.1 > > Signed-off-by: Udit Kumar > > --- > > .../Include/Library/ArmPlatformClockLib.h | 32 ++++++++++++++= ++++++ > > .../ArmPlatformClockLib.inf | 33 ++++++++++++++= ++++++ > > .../ArmPlatformClockLibNull.c | 35 ++++++++++++++= ++++++++ > > 3 files changed, 100 insertions(+) > > create mode 100644 > > ArmPlatformPkg/Include/Library/ArmPlatformClockLib.h > > create mode 100644 > > ArmPlatformPkg/Library/ArmPlatformClockLibNull/ArmPlatformClockLib.inf > > create mode 100644 > > ArmPlatformPkg/Library/ArmPlatformClockLibNull/ArmPlatformClockLibNull > > .c > > > > diff --git a/ArmPlatformPkg/Include/Library/ArmPlatformClockLib.h > > b/ArmPlatformPkg/Include/Library/ArmPlatformClockLib.h > > new file mode 100644 > > index 0000000..f9d1425 > > --- /dev/null > > +++ b/ArmPlatformPkg/Include/Library/ArmPlatformClockLib.h > > @@ -0,0 +1,32 @@ > > +/** @file > > +* > > +* Copyright 2018 NXP > > +* > > +* This program and the accompanying materials > > +* are licensed and made available under the terms and conditions of > > +the BSD License > > +* which accompanies this distribution. The full text of the license > > +may be found at > > +* > > +https://emea01.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fop= e > > +nsource.org%2Flicenses%2Fbsd- > license.php&data=3D02%7C01%7Cudit.kumar%40 > > > +nxp.com%7Cdd365496e05b46d7be4508d5cae0286e%7C686ea1d3bc2b4c6fa9 > 2cd99c > > > +5c301635%7C0%7C1%7C636637986464241388&sdata=3DrmypRtJplfoFQHAftihQ > tfqHQ > > +IcLO0Xele3IKdab6fM%3D&reserved=3D0 > > +* > > +* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" > > +BASIS, > > +* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER > > EXPRESS OR IMPLIED. > > +* > > +**/ > > + > > +#ifndef _ARMPLATFORMCLOCKLIB_H_ > > +#define _ARMPLATFORMCLOCKLIB_H_ > > + > > + > > +/** > > + Return frequency of PL011. > > + > > + If this function return 0 then fixed value in Pcd will be used >=20 > Why cannot this function just return FixedPcdGet32 (PL011UartClkInHz) if > dynamic clocking is not supported? Ok, agreed with Ard's comment too=20 Thanks =20 > > + > > + @return Return frequency of PL011 > > + > > +**/ > > +UINT32 > > +ArmPlatformGetPL011ClockFreq ( > > + VOID > > + ); > > + > > +#endif > > diff --git > > a/ArmPlatformPkg/Library/ArmPlatformClockLibNull/ArmPlatformClockLib.i > > nf > > b/ArmPlatformPkg/Library/ArmPlatformClockLibNull/ArmPlatformClockLib.i > > nf > > new file mode 100644 > > index 0000000..b708ad3 > > --- /dev/null > > +++ b/ArmPlatformPkg/Library/ArmPlatformClockLibNull/ArmPlatformClockL > > +++ ib > > +++ .inf > > @@ -0,0 +1,33 @@ > > +#/* @file > > +# Copyright 2018 NXP > > +# > > +# This program and the accompanying materials # are licensed and > > +made available under the terms and conditions of the BSD License # > > +which accompanies this distribution. The full text of the license > > +may be found at # > > +https://emea01.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fop= e > > +nsource.org%2Flicenses%2Fbsd- > license.php&data=3D02%7C01%7Cudit.kumar%40 > > > +nxp.com%7Cdd365496e05b46d7be4508d5cae0286e%7C686ea1d3bc2b4c6fa9 > 2cd99c > > > +5c301635%7C0%7C1%7C636637986464241388&sdata=3DrmypRtJplfoFQHAftihQ > tfqHQ > > +IcLO0Xele3IKdab6fM%3D&reserved=3D0 > > +# > > +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" > > +BASIS, # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, > EITHER > > EXPRESS OR IMPLIED. > > +# > > +#*/ > > + > > +[Defines] > > + INF_VERSION =3D 0x0001000A > > + BASE_NAME =3D ArmPlatformClockLibNull > > + FILE_GUID =3D af8fef24-afbb-472a-b8b7-13101a797= 03c > > + MODULE_TYPE =3D BASE > > + VERSION_STRING =3D 1.0 > > + LIBRARY_CLASS =3D ArmPlatformClockLib > > + > > +[Packages] > > + MdePkg/MdePkg.dec > > + MdeModulePkg/MdeModulePkg.dec > > + ArmPkg/ArmPkg.dec > > + ArmPlatformPkg/ArmPlatformPkg.dec > > + > > +[LibraryClasses] > > + ArmLib > > + DebugLib > > + > > +[Sources.common] > > + ArmPlatformClockLibNull.c > > diff --git > > a/ArmPlatformPkg/Library/ArmPlatformClockLibNull/ArmPlatformClockLibNu > > ll.c > > b/ArmPlatformPkg/Library/ArmPlatformClockLibNull/ArmPlatformClockLibNu > > ll.c > > new file mode 100644 > > index 0000000..28eaa63 > > --- /dev/null > > +++ b/ArmPlatformPkg/Library/ArmPlatformClockLibNull/ArmPlatformClockL > > +++ ib > > +++ Null.c > > @@ -0,0 +1,35 @@ > > +/** @file > > +* > > +* Copyright 2018 NXP > > +* > > +* This program and the accompanying materials > > +* are licensed and made available under the terms and conditions of > > +the BSD License > > +* which accompanies this distribution. The full text of the license > > +may be found at > > +* > > +https://emea01.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fop= e > > +nsource.org%2Flicenses%2Fbsd- > license.php&data=3D02%7C01%7Cudit.kumar%40 > > > +nxp.com%7Cdd365496e05b46d7be4508d5cae0286e%7C686ea1d3bc2b4c6fa9 > 2cd99c > > > +5c301635%7C0%7C1%7C636637986464241388&sdata=3DrmypRtJplfoFQHAftihQ > tfqHQ > > +IcLO0Xele3IKdab6fM%3D&reserved=3D0 > > +* > > +* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" > > +BASIS, > > +* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER > > EXPRESS OR IMPLIED. > > +* > > +**/ > > + > > +#include > > + > > + > > + > > +/** > > + Return clock in for PL011 Uart IP. > > +**/ > > +UINT32 > > +ArmPlatformGetPL011ClockFreq ( > > + VOID > > + ) > > +{ > > + // Implement platform specific code > > + // and return PL011 freq > > + > > + // Some platform supports dynamic clocking, > > + // This function needs to be implemented on platforms which > > +supports > > + // dynamic clocking to avoid re-building of UEFI firmware for PL011 > > + // clock change > > + return 0; > > +} > > -- > > 1.9.1 > > > > _______________________________________________ > > edk2-devel mailing list > > edk2-devel@lists.01.org > > https://emea01.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fli= s > > ts.01.org%2Fmailman%2Flistinfo%2Fedk2- > devel&data=3D02%7C01%7Cudit.kumar% > > > 40nxp.com%7Cdd365496e05b46d7be4508d5cae0286e%7C686ea1d3bc2b4c6fa > 92cd99 > > > c5c301635%7C0%7C1%7C636637986464241388&sdata=3Du3j1ouO0GgtN2uKGAQ > BdJ%2Bh > > PdQkIjfyd3t7N%2FYyTCTA%3D&reserved=3D0 > IMPORTANT NOTICE: The contents of this email and any attachments are > confidential and may also be privileged. If you are not the intended reci= pient, > please 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.