From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=104.47.0.79; helo=eur01-he1-obe.outbound.protection.outlook.com; envelope-from=alexei.fedorov@arm.com; receiver=edk2-devel@lists.01.org Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0079.outbound.protection.outlook.com [104.47.0.79]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id C21912117A29F for ; Tue, 5 Jun 2018 05:30:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=H+mBv0F7bTo5j5Eud+Y5gDozxL7rVBY4puVXXOPnV1w=; b=mvrnHxaFDy26TB68oNhMzypf7lu0NnjPnVgFVkdChQRHiC2Avplgsx9/E4gCapZ3PSN1TqjfaH1k7XY8E5kfrWbvdYMiPBvu3xMH0Gt1wh/pfg1zxu9FUBII/NQ4Un8K9OSkjf+tAHhsO6pvAO+3u5kp7s+/SYUXCRSp0UvcPAo= Received: from DB6PR0801MB1766.eurprd08.prod.outlook.com (10.169.227.13) by DB6PR0801MB2021.eurprd08.prod.outlook.com (10.168.86.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.841.13; Tue, 5 Jun 2018 12:30:42 +0000 Received: from DB6PR0801MB1766.eurprd08.prod.outlook.com ([fe80::a816:2466:5972:aadc]) by DB6PR0801MB1766.eurprd08.prod.outlook.com ([fe80::a816:2466:5972:aadc%8]) with mapi id 15.20.0820.015; Tue, 5 Jun 2018 12:30:42 +0000 From: Alexei Fedorov To: Udit Kumar , "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/MHd111s7M0kFEuuMHQ+Hf42FqRRl5sA Date: Tue, 5 Jun 2018 12:30:42 +0000 Message-ID: References: <1528155339-5050-1-git-send-email-udit.kumar@nxp.com> In-Reply-To: <1528155339-5050-1-git-send-email-udit.kumar@nxp.com> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexei.Fedorov@arm.com; x-originating-ip: [217.140.96.140] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB6PR0801MB2021; 7:umUuPStfTfnv7hWIcd/Tu002IRZ1E9HfDnojRCSnPrqSBvIYWFpWJD/nexDHjcCzbo2YjOUi+sUIGpEVj6Na4+bPwWCnDHXJ+fu8+ujwKoAdncsxR0v3s/0x22sjq+bu6maxutS5wwYb9brb68mLDJKq64YgoyHF63NPybeax6naNDtm6AuKPeyVc2F/zZc6ANb4u95XaD0NCWe4+4dKZnJE0//uHBHSpkRIOqBA7MQlhghFwJ3AjL982CmXW0ES 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:DB6PR0801MB2021; x-ms-traffictypediagnostic: DB6PR0801MB2021: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(185117386973197)(162533806227266); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231254)(944501410)(52105095)(10201501046)(3002001)(6055026)(149027)(150027)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:DB6PR0801MB2021; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0801MB2021; x-forefront-prvs: 0694C54398 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39380400002)(39860400002)(346002)(396003)(376002)(366004)(13464003)(199004)(189003)(40434004)(15188155005)(229853002)(68736007)(105586002)(305945005)(106356001)(2906002)(53936002)(9686003)(5660300001)(33656002)(966005)(74316002)(6306002)(14454004)(55016002)(66066001)(7736002)(97736004)(6436002)(6116002)(3846002)(102836004)(2900100001)(6506007)(53546011)(110136005)(86362001)(186003)(2201001)(26005)(99286004)(7696005)(316002)(59450400001)(76176011)(478600001)(486006)(8676002)(6246003)(476003)(81166006)(53376002)(16799955002)(81156014)(11346002)(5890100001)(446003)(2501003)(3660700001)(72206003)(8656006)(5250100002)(25786009)(3280700002)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0801MB2021; H:DB6PR0801MB1766.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: FMmHnFua2Do/G0PyxoezkyXQm6k4VbBX2QzeMoNvZhLQ+1AxY2+n/UdW5kjuTK8webeKJWbVw0OmfUURjMEN9yr/equ4XPpYKSQYEC70yGnFpOXnKqf5f6n2bU5U/+T3Lln+dznXn0kKGNbvDQEIs635NA/UilCjkgKszlcwEgFyzTKL1LBSJtEMCchLrBf2 spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: a44a0162-4b94-49c4-0e0d-08d5cae02764 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: a44a0162-4b94-49c4-0e0d-08d5cae02764 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Jun 2018 12:30:42.3825 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0801MB2021 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 12:30:46 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Please see my comment in-lined > -----Original Message----- > From: edk2-devel On Behalf Of Udit Kuma= r > 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 Supp= ort > > Some platform support dynamic clocking, Which is controlled by some jumpe= r > setting or hardware registers. > Result of that PCD PL011UartClkInHz needs to be updated for frequency cha= nge. > 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 > +* http://opensource.org/licenses/bsd-license.php > +* > +* 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 Why cannot this function just return FixedPcdGet32 (PL011UartClkInHz) if dy= namic clocking is not supported? > + > + @return Return frequency of PL011 > + > +**/ > +UINT32 > +ArmPlatformGetPL011ClockFreq ( > + VOID > + ); > + > +#endif > diff --git > a/ArmPlatformPkg/Library/ArmPlatformClockLibNull/ArmPlatformClockLib.inf > b/ArmPlatformPkg/Library/ArmPlatformClockLibNull/ArmPlatformClockLib.inf > new file mode 100644 > index 0000000..b708ad3 > --- /dev/null > +++ b/ArmPlatformPkg/Library/ArmPlatformClockLibNull/ArmPlatformClockLib > +++ .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 # http://opensource.org/licenses/bsd-license.php > +# > +# 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-13101a79703= c > + 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/ArmPlatformClockLibNull.= c > b/ArmPlatformPkg/Library/ArmPlatformClockLibNull/ArmPlatformClockLibNull.= c > new file mode 100644 > index 0000000..28eaa63 > --- /dev/null > +++ b/ArmPlatformPkg/Library/ArmPlatformClockLibNull/ArmPlatformClockLib > +++ 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 > +* http://opensource.org/licenses/bsd-license.php > +* > +* 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://lists.01.org/mailman/listinfo/edk2-devel IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease 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.