From: "Pankaj Bansal" <pankaj.bansal@nxp.com>
To: Leif Lindholm <leif@nuviainc.com>,
Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>,
Michael D Kinney <michael.d.kinney@intel.com>,
devel@edk2.groups.io, Varun Sethi <V.Sethi@nxp.com>,
Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>,
Jon Nettleton <jon@solid-run.com>,
Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: [PATCH edk2-platforms 4/8] Silicon/NXP: Implement PL011UartClockLib for NXP platforms
Date: Wed, 20 May 2020 09:19:50 +0530 [thread overview]
Message-ID: <20200520034954.5255-5-pankaj.bansal@oss.nxp.com> (raw)
In-Reply-To: <20200520034954.5255-1-pankaj.bansal@oss.nxp.com>
From: Pankaj Bansal <pankaj.bansal@nxp.com>
In NXP SOCs the UART clock is derived from System clock after PLL
multiplication. Therefore, add the PL011UartClockLib implementation
for NXP platforms.
Signed-off-by: Pankaj Bansal <pankaj.bansal@nxp.com>
---
Silicon/NXP/Library/PL011UartClockLib/PL011UartClockLib.inf | 24 ++++++++++++++++++++
Silicon/NXP/Library/PL011UartClockLib/PL011UartClockLib.c | 22 ++++++++++++++++++
2 files changed, 46 insertions(+)
diff --git a/Silicon/NXP/Library/PL011UartClockLib/PL011UartClockLib.inf b/Silicon/NXP/Library/PL011UartClockLib/PL011UartClockLib.inf
new file mode 100644
index 000000000000..b771dba7697f
--- /dev/null
+++ b/Silicon/NXP/Library/PL011UartClockLib/PL011UartClockLib.inf
@@ -0,0 +1,24 @@
+#/* @file
+# Copyright 2018, 2020 NXP
+#
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+#*/
+
+[Defines]
+ INF_VERSION = 0x0001001A
+ BASE_NAME = PL011UartClockLib
+ FILE_GUID = af8fef24-afbb-472a-b8b7-13101a79703c
+ MODULE_TYPE = BASE
+ VERSION_STRING = 1.0
+ LIBRARY_CLASS = PL011UartClockLib
+
+[Packages]
+ MdePkg/MdePkg.dec
+ Silicon/NXP/NxpQoriqLs.dec
+
+[Sources.common]
+ PL011UartClockLib.c
+
+[LibraryClasses]
+ ArmPlatformLib
diff --git a/Silicon/NXP/Library/PL011UartClockLib/PL011UartClockLib.c b/Silicon/NXP/Library/PL011UartClockLib/PL011UartClockLib.c
new file mode 100644
index 000000000000..3814685585eb
--- /dev/null
+++ b/Silicon/NXP/Library/PL011UartClockLib/PL011UartClockLib.c
@@ -0,0 +1,22 @@
+/** @file
+*
+* Copyright 2018, 2020 NXP
+*
+* SPDX-License-Identifier: BSD-2-Clause-Patent
+*
+**/
+
+#include <Base.h>
+#include <Ppi/NxpPlatformGetClock.h>
+
+/**
+ Return clock in for PL011 Uart IP
+**/
+UINT32
+EFIAPI
+PL011UartClockGetFreq (
+ VOID
+ )
+{
+ return gPlatformGetClockPpi.PlatformGetClock (NXP_UART_CLOCK, 0);
+}
--
2.17.1
next prev parent reply other threads:[~2020-05-20 3:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-20 3:49 [PATCH edk2-platforms 0/8] Add LX2160ARDB Platform Pankaj Bansal
2020-05-20 3:49 ` [PATCH edk2-platforms 1/8] Silicon/NXP: Use Metronome implementation from MdeModulePkg Pankaj Bansal
2020-05-20 3:49 ` [PATCH edk2-platforms 2/8] Platform/NXP: Use Monotonic counter " Pankaj Bansal
2020-05-20 3:49 ` [PATCH edk2-platforms 3/8] Silicon/NXP: Use edk2 recommended compilation flags Pankaj Bansal
2020-05-20 3:49 ` Pankaj Bansal [this message]
2020-05-20 3:49 ` [PATCH edk2-platforms 5/8] Silicon/NXP: Add Chassis3V2 Package Pankaj Bansal
2020-05-20 3:49 ` [PATCH edk2-platforms 6/8] Silicon/NXP: Add LX2160A Soc package Pankaj Bansal
2020-05-20 3:49 ` [PATCH edk2-platforms 7/8] Platform/NXP: Add LX2160ARDB Platform Pankaj Bansal
2020-05-21 9:33 ` Leif Lindholm
2020-05-20 3:49 ` [PATCH edk2-platforms 8/8] Platform/NXP/LX2160aRdbPkg: Add VarStore Pankaj Bansal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200520034954.5255-5-pankaj.bansal@oss.nxp.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox