From patchwork Sat May 28 13:54:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Evan Lloyd X-Patchwork-Id: 68793 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp593888qge; Sat, 28 May 2016 06:54:27 -0700 (PDT) X-Received: by 10.67.29.239 with SMTP id jz15mr26309997pad.86.1464443667074; Sat, 28 May 2016 06:54:27 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id f191si22154075pfc.101.2016.05.28.06.54.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 28 May 2016 06:54:27 -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 BF8031A1FB8; Sat, 28 May 2016 06:54:34 -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 8C0F31A1FA9 for ; Sat, 28 May 2016 06:54:32 -0700 (PDT) Received: from E107800.Emea.Arm.com (e107800.emea.arm.com [10.1.32.78]) by cam-smtp0.cambridge.arm.com (8.13.8/8.13.8) with ESMTP id u4SDsG6T001418 for ; Sat, 28 May 2016 14:54:18 +0100 From: evan.lloyd@arm.com To: edk2-devel@ml01.01.org Date: Sat, 28 May 2016 14:54:13 +0100 Message-Id: <1464443656-12108-4-git-send-email-evan.lloyd@arm.com> X-Mailer: git-send-email 2.8.0 In-Reply-To: <1464443656-12108-1-git-send-email-evan.lloyd@arm.com> References: <1464443656-12108-1-git-send-email-evan.lloyd@arm.com> Subject: [edk2] [PATCH 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: , 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 --- 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 Tested-by: Ryan Harkin Reviewed-by: Ryan Harkin diff --git a/ArmPlatformPkg/Drivers/PL011Uart/PL011Uart.c b/ArmPlatformPkg/Drivers/PL011Uart/PL011Uart.c index cd2cccad6295544b0b4d4c0aa4ceb7ac7b56a8e7..dd5f88d3d629d345a50af468ed394a269b35f52a 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; }