From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=92.121.34.21; helo=inva021.nxp.com; envelope-from=udit.kumar@nxp.com; receiver=edk2-devel@lists.01.org Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 0F4912112DF64 for ; Tue, 5 Jun 2018 04:39:22 -0700 (PDT) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id C58B420001F; Tue, 5 Jun 2018 13:39:20 +0200 (CEST) Received: from smtp.na-rdc02.nxp.com (inv1260.us-phx01.nxp.com [134.27.49.11]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 909B6200011; Tue, 5 Jun 2018 13:39:20 +0200 (CEST) Received: from az84smr01.freescale.net (az84smr01.freescale.net [10.64.34.197]) by inv1260.na-rdc02.nxp.com (Postfix) with ESMTP id 0FDC040A56; Tue, 5 Jun 2018 04:39:20 -0700 (MST) Received: from uefi-OptiPlex-790.ap.freescale.net ([10.232.132.56]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id w55BdD3x001846; Tue, 5 Jun 2018 04:39:18 -0700 From: Udit Kumar To: edk2-devel@lists.01.org, ard.biesheuvel@linaro.org, leif.lindholm@linaro.org Date: Tue, 5 Jun 2018 05:05:39 +0530 Message-Id: <1528155339-5050-2-git-send-email-udit.kumar@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1528155339-5050-1-git-send-email-udit.kumar@nxp.com> References: <1528155339-5050-1-git-send-email-udit.kumar@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [PATCH 2/2] ArmPlatformPkg: Include ArmPlatformClock Lib 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 11:39:22 -0000 This patch includes, ArmPlatformClock in PL011 lib. In case of NULL implemenation of Clock Lib, Pcd value will be used for PL011 frequency. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Udit Kumar --- ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.c | 7 +++++-- ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.inf | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.c b/ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.c index 6aa8063..40fa50a 100644 --- a/ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.c +++ b/ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.c @@ -17,11 +17,14 @@ #include +#include #include #include #include #include + + /** Initialise the serial device hardware with default settings. @retval RETURN_SUCCESS The serial device was initialised. @@ -48,7 +51,7 @@ SerialPortInitialize ( return PL011UartInitializePort ( (UINTN)FixedPcdGet64 (PcdSerialRegisterBase), - FixedPcdGet32 (PL011UartClkInHz), + ArmPlatformGetPL011ClockFreq() ? ArmPlatformGetPL011ClockFreq() : FixedPcdGet32 (PL011UartClkInHz), &BaudRate, &ReceiveFifoDepth, &Parity, @@ -156,7 +159,7 @@ SerialPortSetAttributes ( { return PL011UartInitializePort ( (UINTN)FixedPcdGet64 (PcdSerialRegisterBase), - FixedPcdGet32 (PL011UartClkInHz), + ArmPlatformGetPL011ClockFreq() ? ArmPlatformGetPL011ClockFreq() : FixedPcdGet32 (PL011UartClkInHz), BaudRate, ReceiveFifoDepth, Parity, diff --git a/ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.inf b/ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.inf index 3683e06..9820811 100644 --- a/ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.inf +++ b/ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.inf @@ -26,6 +26,7 @@ PL011SerialPortLib.c [LibraryClasses] + ArmPlatformClockLib PL011UartLib PcdLib -- 1.9.1