From patchwork Wed Mar 16 10:57:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: gary guo X-Patchwork-Id: 63917 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp1241223lbc; Wed, 16 Mar 2016 03:58:28 -0700 (PDT) X-Received: by 10.98.16.4 with SMTP id y4mr4756752pfi.45.1458125908482; Wed, 16 Mar 2016 03:58:28 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id tq6si1948869pab.92.2016.03.16.03.58.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Mar 2016 03:58:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 3C4A61A1F9C; Wed, 16 Mar 2016 03:58:47 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-pf0-x22b.google.com (mail-pf0-x22b.google.com [IPv6:2607:f8b0:400e:c00::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 539721A1F97 for ; Wed, 16 Mar 2016 03:58:46 -0700 (PDT) Received: by mail-pf0-x22b.google.com with SMTP id 124so71123269pfg.0 for ; Wed, 16 Mar 2016 03:58:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=SS09kFseKmvFsjmcoRflKMVsbcBMdIezg30/i7iryho=; b=JsBx1d2P+KlX7URXIO5XENqkbss1qhEYZGkpmrp6I6If5KfT9O9GyWHu+C2/wWDYCE IMaBamPDSQA0OLWHJJISO3ZyIff3mYWZhdSGOlC57Gb820J5uRQsQRdY0p/CZfE5hbRb OFajD7uuIc994Dji2XmtQ+Pvx/nmJxAf7ceD4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=SS09kFseKmvFsjmcoRflKMVsbcBMdIezg30/i7iryho=; b=SbnNEscRvlAMxt1txYjSvPyxtqEWCzELPi1W2GaVJicY4zA8af1cg8Xm5EqO4cStP5 DxUWtpKMtWKakMDO2fVUEpOzoNmAIa7iXMkMtk27iIsNOJTaG4tppPYTZQqt8cge3it/ twSxa1or4ZdouEbRK8+ljEBu3QDWAVQf9vjEb8sTZTm5fM+XkW5fz8mqkL0mBNBeAw9P d6jXGdIwErk2W+TQ4jDXWYbWoYON/UQH4GvLyYwXWd0Up5OacPJiVbG5AGC1JBmEn2c/ ltrTMyDtorypauPaNzniFjFj3LXco94XcTs/ACZ46ck4OrofevToZSr8Bqa/kVtZgw62 yGkg== X-Gm-Message-State: AD7BkJJZPSsJckisNqyZzSuDMMSsK46wzI+UjpLOzihnC1dkbVbIi2EOdDMOAmWAvh39aMbL X-Received: by 10.66.254.168 with SMTP id aj8mr4896015pad.18.1458125906775; Wed, 16 Mar 2016 03:58:26 -0700 (PDT) Received: from localhost.localdomain ([104.237.91.144]) by smtp.gmail.com with ESMTPSA id s66sm4721896pfi.3.2016.03.16.03.58.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 16 Mar 2016 03:58:26 -0700 (PDT) From: Heyi Guo To: edk2-devel@lists.01.org Date: Wed, 16 Mar 2016 18:57:55 +0800 Message-Id: <1458125876-8097-2-git-send-email-heyi.guo@linaro.org> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1458125876-8097-1-git-send-email-heyi.guo@linaro.org> References: <1458125876-8097-1-git-send-email-heyi.guo@linaro.org> Cc: Heyi Guo , Feng Tian , Star Zeng Subject: [edk2] [RFC 2/3] MdeModulePkg/SerialDxe: Set FIFO depth with PCD X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.17 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" Set UART receive FIFO depth with PCD instead of fixed number "1". The default value of PCD is also 1, so it makes no difference for platforms which do not explicitly set this PCD. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Heyi Guo Cc: Feng Tian Cc: Star Zeng --- MdeModulePkg/Universal/SerialDxe/SerialDxe.inf | 9 +++++---- MdeModulePkg/Universal/SerialDxe/SerialIo.c | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) -- 2.7.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/MdeModulePkg/Universal/SerialDxe/SerialDxe.inf b/MdeModulePkg/Universal/SerialDxe/SerialDxe.inf index 164060b..a1453bd 100644 --- a/MdeModulePkg/Universal/SerialDxe/SerialDxe.inf +++ b/MdeModulePkg/Universal/SerialDxe/SerialDxe.inf @@ -41,10 +41,11 @@ gEfiDevicePathProtocolGuid ## PRODUCES [Pcd] - gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate ## CONSUMES - gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits ## CONSUMES - gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity ## CONSUMES - gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits ## CONSUMES + gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate ## CONSUMES + gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits ## CONSUMES + gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity ## CONSUMES + gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits ## CONSUMES + gEfiMdePkgTokenSpaceGuid.PcdUartDefaultReceiveFifoDepth ## CONSUMES [Depex] TRUE diff --git a/MdeModulePkg/Universal/SerialDxe/SerialIo.c b/MdeModulePkg/Universal/SerialDxe/SerialIo.c index f5b3064..1fdbe10 100644 --- a/MdeModulePkg/Universal/SerialDxe/SerialIo.c +++ b/MdeModulePkg/Universal/SerialDxe/SerialIo.c @@ -236,7 +236,7 @@ SerialReset ( // // Set the Serial I/O mode // - This->Mode->ReceiveFifoDepth = 1; + This->Mode->ReceiveFifoDepth = PcdGet32 (PcdUartDefaultReceiveFifoDepth); This->Mode->Timeout = 1000 * 1000; This->Mode->BaudRate = PcdGet64 (PcdUartDefaultBaudRate); This->Mode->DataBits = (UINT32) PcdGet8 (PcdUartDefaultDataBits); @@ -508,6 +508,7 @@ SerialDxeInitialize ( mSerialIoMode.DataBits = (UINT32) PcdGet8 (PcdUartDefaultDataBits); mSerialIoMode.Parity = (UINT32) PcdGet8 (PcdUartDefaultParity); mSerialIoMode.StopBits = (UINT32) PcdGet8 (PcdUartDefaultStopBits); + mSerialIoMode.ReceiveFifoDepth = PcdGet32 (PcdUartDefaultReceiveFifoDepth); mSerialDevicePath.Uart.BaudRate = PcdGet64 (PcdUartDefaultBaudRate); mSerialDevicePath.Uart.DataBits = PcdGet8 (PcdUartDefaultDataBits); mSerialDevicePath.Uart.Parity = PcdGet8 (PcdUartDefaultParity);