From patchwork Wed Jun 15 12:52:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Evan Lloyd X-Patchwork-Id: 70108 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp2553848qgf; Wed, 15 Jun 2016 05:52:56 -0700 (PDT) X-Received: by 10.107.188.71 with SMTP id m68mr41564302iof.1.1465995176459; Wed, 15 Jun 2016 05:52:56 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id bx9si3790355pad.41.2016.06.15.05.52.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Jun 2016 05:52:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 5FF201A1E45; Wed, 15 Jun 2016 05:53:17 -0700 (PDT) X-Original-To: edk2-devel@ml01.01.org Delivered-To: edk2-devel@ml01.01.org Received: from cam-smtp0.cambridge.arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 99FD91A1E3D for ; Wed, 15 Jun 2016 05:53:15 -0700 (PDT) Received: from E107800.Emea.Arm.com (e107800.emea.arm.com [10.1.26.57]) by cam-smtp0.cambridge.arm.com (8.13.8/8.13.8) with ESMTP id u5FCqkuS020558; Wed, 15 Jun 2016 13:52:47 +0100 From: evan.lloyd@arm.com To: edk2-devel@ml01.01.org Date: Wed, 15 Jun 2016 13:52:40 +0100 Message-Id: <20160615125243.1376-4-evan.lloyd@arm.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20160615125243.1376-1-evan.lloyd@arm.com> References: <20160615125243.1376-1-evan.lloyd@arm.com> Subject: [edk2] [PATCH v3 3/6] ArmPlatformPkg: Remove double write in PL011 X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: WoA-Tech , Laszlo Ersek , Leif Lindholm , Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" From: Evan Lloyd The variable LineControl was initialised to zero, then updated in a condition. This change converts that to a write in each branch of the condition, removing the Write/Read/Modify/Write sequence. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Sami Mujawar Signed-off-by: Evan Lloyd Tested-by: Ryan Harkin Reviewed-by: Ryan Harkin --- ArmPlatformPkg/Drivers/PL011Uart/PL011Uart.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) -- Guid("CE165669-3EF3-493F-B85D-6190EE5B9759") _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/ArmPlatformPkg/Drivers/PL011Uart/PL011Uart.c b/ArmPlatformPkg/Drivers/PL011Uart/PL011Uart.c index d0f9381e9eaad2c14e1c86b89ff1c1cf9f0a6427..db15a8b322fe35aa3a21cd8f5cc123804c6d2fcd 100644 --- a/ArmPlatformPkg/Drivers/PL011Uart/PL011Uart.c +++ b/ArmPlatformPkg/Drivers/PL011Uart/PL011Uart.c @@ -73,20 +73,19 @@ PL011UartInitializePort ( UINT32 LineControl; UINT32 Divisor; - LineControl = 0; - // The PL011 supports a buffer of 1, 16 or 32 chars. Therefore we can accept // 1 char buffer as the minimum FIFO size. Because everything can be rounded // down, there is no maximum FIFO size. if ((*ReceiveFifoDepth == 0) || (*ReceiveFifoDepth >= 32)) { // Enable FIFO - LineControl |= PL011_UARTLCR_H_FEN; + LineControl = PL011_UARTLCR_H_FEN; if (PL011_UARTPID2_VER (MmioRead32 (UartBase + UARTPID2)) > PL011_VER_R1P4) *ReceiveFifoDepth = 32; else *ReceiveFifoDepth = 16; } else { - ASSERT (*ReceiveFifoDepth < 32); + // Disable FIFO + LineControl = 0; // Nothing else to do. 1 byte FIFO is default. *ReceiveFifoDepth = 1; }