public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Samer El-Haj-Mahmoud" <samer.el-haj-mahmoud@arm.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
	"ipark@nvidia.com" <ipark@nvidia.com>,
	Ard Biesheuvel <Ard.Biesheuvel@arm.com>
Subject: Re: [edk2-devel] [PATCH v2] ArmPlatformPkg/PL011UartLib: Check PID2 if FiFoDepth is zero
Date: Mon, 22 Jun 2020 21:00:45 +0000	[thread overview]
Message-ID: <DB7PR08MB32606223988C56A94DF1197290970@DB7PR08MB3260.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <BN8PR12MB345882C60098B3723820D5B6C9970@BN8PR12MB3458.namprd12.prod.outlook.com>

Adding Ard's new Arm e-mail address, and removing the old Linaro e-mail.

Thanks,
--Samer

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Irene
> Park via groups.io
> Sent: Monday, June 22, 2020 4:15 PM
> To: devel@edk2.groups.io; ard.biesheuvel@linaro.org
> Subject: Re: [edk2-devel] [PATCH v2] ArmPlatformPkg/PL011UartLib: Check
> PID2 if FiFoDepth is zero
>
> Hi Ard,
> Would you please review this change ?
> I also wonder what you think of the following.
>
> #if FixedPcdGet16 (PcdUartDefaultReceiveFifoDepth) == 0 VS if
> (FixedPcdGet16 (PcdUartDefaultReceiveFifoDepth) == 0) or if
> (HardwareFifoDepth == 0)
>
> Thank you,
> Irene
>
> -----Original Message-----
> From: Irene Park <ipark@nvidia.com>
> Sent: Tuesday, June 9, 2020 1:59 PM
> To: devel@edk2.groups.io
> Cc: Irene Park <ipark@nvidia.com>
> Subject: [PATCH v2] ArmPlatformPkg/PL011UartLib: Check PID2 if FiFoDepth
> is zero
>
> From: Irene Park <ipark@nvidia.com>
>
> PL011UartLib determines its FIFO depth based on the PID2 value but the
> register PID2 is not mandatory as per the SBSA spec.
> This change won't check PID2 if PcdUartDefaultReceiveFifoDepth is set to a
> value > 0.
>
> Signed-off-by: Irene Park <ipark@nvidia.com>
> ---
>  ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.c   | 4 ++++
>  ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.inf | 1 +
>  2 files changed, 5 insertions(+)
>
> diff --git a/ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.c
> b/ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.c
> index 801990d..05ad1ad 100644
> --- a/ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.c
> +++ b/ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.c
> @@ -79,9 +79,13 @@ PL011UartInitializePort (
>    UINT32      Fractional;
>    UINT32      HardwareFifoDepth;
>
> +  HardwareFifoDepth = FixedPcdGet16 (PcdUartDefaultReceiveFifoDepth);
> +#if FixedPcdGet16 (PcdUartDefaultReceiveFifoDepth) == 0
>    HardwareFifoDepth = (PL011_UARTPID2_VER (MmioRead32 (UartBase +
> UARTPID2)) \
>                         > PL011_VER_R1P4) \
>                        ? 32 : 16 ;
> +#endif
> +
>    // 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.
> diff --git a/ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.inf
> b/ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.inf
> index d99e89f..e3da507 100644
> --- a/ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.inf
> +++ b/ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.inf
> @@ -30,6 +30,7 @@
>    ArmPlatformPkg/ArmPlatformPkg.dec
>
>  [FixedPcd]
> +  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultReceiveFifoDepth
>    gEfiMdeModulePkgTokenSpaceGuid.PcdSerialBaudRate
>
>    gArmPlatformTokenSpaceGuid.PL011UartInteger
> --
> 2.7.4
>
>
> 

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

  reply	other threads:[~2020-06-22 21:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-09 17:56 [PATCH] ArmPlatformPkg/PL011UartLib: Check PID2 if FiFoDepth is zero Irene Park
2020-06-09 18:00 ` [PATCH v2] " Irene Park
2020-06-22 20:14 ` Irene Park
2020-06-22 21:00   ` Samer El-Haj-Mahmoud [this message]
2020-06-25  5:41     ` [edk2-devel] " Irene Park
2020-07-02  6:22       ` Irene Park
2020-07-02  7:12         ` Ard Biesheuvel

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=DB7PR08MB32606223988C56A94DF1197290970@DB7PR08MB3260.eurprd08.prod.outlook.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