[edk2-devel] [PATCH] ArmPlatformPkg/PL011UartLib: Check PID2 if FiFoDepth is zero

Irene Park posted 1 patch 3 years, 10 months ago
Failed in applying to current master (apply log)
ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.c   | 4 ++++
ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.inf | 1 +
2 files changed, 5 insertions(+)
[edk2-devel] [PATCH] ArmPlatformPkg/PL011UartLib: Check PID2 if FiFoDepth is zero
Posted by Irene Park 3 years, 10 months ago
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.

Change-Id: I2dd7b3412f9306888078e0cb0488b902d4a8ace9
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


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#60978): https://edk2.groups.io/g/devel/message/60978
Mute This Topic: https://groups.io/mt/74780076/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH v2] ArmPlatformPkg/PL011UartLib: Check PID2 if FiFoDepth is zero
Posted by Irene Park 3 years, 10 months ago
Hi Ard,
Would you please review this patch v2?
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


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#60979): https://edk2.groups.io/g/devel/message/60979
Mute This Topic: https://groups.io/mt/74780197/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH v2] ArmPlatformPkg/PL011UartLib: Check PID2 if FiFoDepth is zero
Posted by Irene Park 3 years, 10 months ago
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


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#61568): https://edk2.groups.io/g/devel/message/61568
Mute This Topic: https://groups.io/mt/75047196/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH v2] ArmPlatformPkg/PL011UartLib: Check PID2 if FiFoDepth is zero
Posted by Samer El-Haj-Mahmoud 3 years, 10 months ago
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.

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#61569): https://edk2.groups.io/g/devel/message/61569
Mute This Topic: https://groups.io/mt/75047196/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH v2] ArmPlatformPkg/PL011UartLib: Check PID2 if FiFoDepth is zero
Posted by Irene Park 3 years, 10 months ago
Hello Ard,
Would you please kindly review this change?
Thank you,
Irene

-----Original Message-----
From: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com> 
Sent: Monday, June 22, 2020 5:01 PM
To: devel@edk2.groups.io; Irene Park <ipark@nvidia.com>; Ard Biesheuvel <Ard.Biesheuvel@arm.com>
Subject: RE: [edk2-devel] [PATCH v2] ArmPlatformPkg/PL011UartLib: Check PID2 if FiFoDepth is zero

External email: Use caution opening links or attachments


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.

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#61701): https://edk2.groups.io/g/devel/message/61701
Mute This Topic: https://groups.io/mt/75047196/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH v2] ArmPlatformPkg/PL011UartLib: Check PID2 if FiFoDepth is zero
Posted by Irene Park 3 years, 9 months ago
Hello Ard,
Would you please kindly review this change?
Thank you,
Irene

-----Original Message-----
From: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
Sent: Monday, June 22, 2020 5:01 PM
To: devel@edk2.groups.io; Irene Park <ipark@nvidia.com>; Ard Biesheuvel <Ard.Biesheuvel@arm.com>
Subject: RE: [edk2-devel] [PATCH v2] ArmPlatformPkg/PL011UartLib: Check PID2 if FiFoDepth is zero

External email: Use caution opening links or attachments


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.

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#61953): https://edk2.groups.io/g/devel/message/61953
Mute This Topic: https://groups.io/mt/75047196/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH v2] ArmPlatformPkg/PL011UartLib: Check PID2 if FiFoDepth is zero
Posted by Ard Biesheuvel 3 years, 9 months ago
On 7/2/20 8:22 AM, Irene Park wrote:
> Hello Ard,
> Would you please kindly review this change?
> Thank you,
> Irene
> 

Merged as #753, apologies for the delay.

Please double check the version I committed - I cleaned up the code slightly


> -----Original Message-----
> From: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
> Sent: Monday, June 22, 2020 5:01 PM
> To: devel@edk2.groups.io; Irene Park <ipark@nvidia.com>; Ard Biesheuvel <Ard.Biesheuvel@arm.com>
> Subject: RE: [edk2-devel] [PATCH v2] ArmPlatformPkg/PL011UartLib: Check PID2 if FiFoDepth is zero
> 
> External email: Use caution opening links or attachments
> 
> 
> 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.
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#61963): https://edk2.groups.io/g/devel/message/61963
Mute This Topic: https://groups.io/mt/75047196/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-