diff mbox

[edk2,v3,5/6] ArmVirtPkg/FdtPL011SerialPortLib: Set the PL011 UART clock rate

Message ID 20160615125243.1376-6-evan.lloyd@arm.com
State New
Headers show

Commit Message

Evan Lloyd June 15, 2016, 12:52 p.m. UTC
From: Evan Lloyd <evan.lloyd@arm.com>


The interface to PL011UartInitializePort has changed in
ArmPlatformPkg/Drivers/PL011Uart with the title:
"ArmPlatformPkg: Add support to configure PL011 UART clock"

This patch updates the calls to PL011UartInitializePort(), in line with
that change, adding a parameter value using the PCD previously used
directly by the driver.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>

Signed-off-by: Evan Lloyd <evan.lloyd@arm.com>

---

Notes:
    pl011_v3:
    - Updated commit heading [Laszlo Ersek]

 ArmVirtPkg/Library/FdtPL011SerialPortLib/EarlyFdtPL011SerialPortLib.inf |  1 +
 ArmVirtPkg/Library/FdtPL011SerialPortLib/FdtPL011SerialPortLib.inf      |  1 +
 ArmVirtPkg/Library/FdtPL011SerialPortLib/EarlyFdtPL011SerialPortLib.c   |  8 +++++++-
 ArmVirtPkg/Library/FdtPL011SerialPortLib/FdtPL011SerialPortLib.c        | 10 ++++++++--
 4 files changed, 17 insertions(+), 3 deletions(-)

-- 
Guid("CE165669-3EF3-493F-B85D-6190EE5B9759")

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Comments

Laszlo Ersek June 15, 2016, 1:23 p.m. UTC | #1
On 06/15/16 14:52, evan.lloyd@arm.com wrote:
> From: Evan Lloyd <evan.lloyd@arm.com>

> 

> The interface to PL011UartInitializePort has changed in

> ArmPlatformPkg/Drivers/PL011Uart with the title:

> "ArmPlatformPkg: Add support to configure PL011 UART clock"

> 

> This patch updates the calls to PL011UartInitializePort(), in line with

> that change, adding a parameter value using the PCD previously used

> directly by the driver.

> 

> Contributed-under: TianoCore Contribution Agreement 1.0

> Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>

> Signed-off-by: Evan Lloyd <evan.lloyd@arm.com>

> ---

> 

> Notes:

>     pl011_v3:

>     - Updated commit heading [Laszlo Ersek]

> 

>  ArmVirtPkg/Library/FdtPL011SerialPortLib/EarlyFdtPL011SerialPortLib.inf |  1 +

>  ArmVirtPkg/Library/FdtPL011SerialPortLib/FdtPL011SerialPortLib.inf      |  1 +

>  ArmVirtPkg/Library/FdtPL011SerialPortLib/EarlyFdtPL011SerialPortLib.c   |  8 +++++++-

>  ArmVirtPkg/Library/FdtPL011SerialPortLib/FdtPL011SerialPortLib.c        | 10 ++++++++--

>  4 files changed, 17 insertions(+), 3 deletions(-)


Reviewed-by: Laszlo Ersek <lersek@redhat.com>


If we wanted to obsess about things, we might note that this patch
should be squashed with the previous one (so that at no stage during the
series the build break). But, we don't want to obsess :), the patches
are back-to-back, and "git bisect skip" can actually handle this case
(unlike when the build is broken for tens of patches in sequence).

Let me know if you need help committing this patch. In fact I think Ard
could commit the entire series for you, because he's a maintainer for
both ArmPlatformPkg and ArmVirtPkg.

Thanks!
Laszlo


> diff --git a/ArmVirtPkg/Library/FdtPL011SerialPortLib/EarlyFdtPL011SerialPortLib.inf b/ArmVirtPkg/Library/FdtPL011SerialPortLib/EarlyFdtPL011SerialPortLib.inf

> index cb2766b3780c6b99555f7413058e94a0e28fbd2b..bfd7142cc5d82541448e78ff9b697fd59d7977a0 100644

> --- a/ArmVirtPkg/Library/FdtPL011SerialPortLib/EarlyFdtPL011SerialPortLib.inf

> +++ b/ArmVirtPkg/Library/FdtPL011SerialPortLib/EarlyFdtPL011SerialPortLib.inf

> @@ -44,3 +44,4 @@ [FixedPcd]

>    gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits

>    gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity

>    gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits

> +  gArmPlatformTokenSpaceGuid.PL011UartClkInHz

> diff --git a/ArmVirtPkg/Library/FdtPL011SerialPortLib/FdtPL011SerialPortLib.inf b/ArmVirtPkg/Library/FdtPL011SerialPortLib/FdtPL011SerialPortLib.inf

> index 3bacd641f0624c4216461ed3f6a33c896363168e..0b06797293c69b9eb00522c5905e4ab51e2cb524 100644

> --- a/ArmVirtPkg/Library/FdtPL011SerialPortLib/FdtPL011SerialPortLib.inf

> +++ b/ArmVirtPkg/Library/FdtPL011SerialPortLib/FdtPL011SerialPortLib.inf

> @@ -43,6 +43,7 @@ [FixedPcd]

>    gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits

>    gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity

>    gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits

> +  gArmPlatformTokenSpaceGuid.PL011UartClkInHz

>  

>  [Guids]

>    gEarlyPL011BaseAddressGuid

> diff --git a/ArmVirtPkg/Library/FdtPL011SerialPortLib/EarlyFdtPL011SerialPortLib.c b/ArmVirtPkg/Library/FdtPL011SerialPortLib/EarlyFdtPL011SerialPortLib.c

> index 72b47652b6dd790946262755c50164fb770b95bd..c458abb622d9c25de5a9ea9dfa8ae0e52c4ac739 100644

> --- a/ArmVirtPkg/Library/FdtPL011SerialPortLib/EarlyFdtPL011SerialPortLib.c

> +++ b/ArmVirtPkg/Library/FdtPL011SerialPortLib/EarlyFdtPL011SerialPortLib.c

> @@ -112,7 +112,13 @@ SerialPortGetBaseAddress (

>  

>          Status = PL011UartInitializePort (

>                     UartBase,

> -                   &BaudRate, &ReceiveFifoDepth, &Parity, &DataBits, &StopBits);

> +                   FixedPcdGet32 (PL011UartClkInHz),

> +                   &BaudRate,

> +                   &ReceiveFifoDepth,

> +                   &Parity,

> +                   &DataBits,

> +                   &StopBits

> +                   );

>          if (!EFI_ERROR (Status)) {

>            return UartBase;

>          }

> diff --git a/ArmVirtPkg/Library/FdtPL011SerialPortLib/FdtPL011SerialPortLib.c b/ArmVirtPkg/Library/FdtPL011SerialPortLib/FdtPL011SerialPortLib.c

> index b73ab8f48a9df7f0924cd9a5f7bc6e0f16f3151f..48a0530dcc2fe59a87b37d2df6eba44c1247ad84 100644

> --- a/ArmVirtPkg/Library/FdtPL011SerialPortLib/FdtPL011SerialPortLib.c

> +++ b/ArmVirtPkg/Library/FdtPL011SerialPortLib/FdtPL011SerialPortLib.c

> @@ -81,8 +81,14 @@ FdtPL011SerialPortLibInitialize (

>    StopBits = (EFI_STOP_BITS_TYPE) PcdGet8 (PcdUartDefaultStopBits);

>  

>    return PL011UartInitializePort (

> -           mSerialBaseAddress, &BaudRate, &ReceiveFifoDepth,

> -           &Parity, &DataBits, &StopBits);

> +           mSerialBaseAddress,

> +           FixedPcdGet32 (PL011UartClkInHz),

> +           &BaudRate,

> +           &ReceiveFifoDepth,

> +           &Parity,

> +           &DataBits,

> +           &StopBits

> +           );

>  }

>  

>  /**

> 


_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
diff mbox

Patch

diff --git a/ArmVirtPkg/Library/FdtPL011SerialPortLib/EarlyFdtPL011SerialPortLib.inf b/ArmVirtPkg/Library/FdtPL011SerialPortLib/EarlyFdtPL011SerialPortLib.inf
index cb2766b3780c6b99555f7413058e94a0e28fbd2b..bfd7142cc5d82541448e78ff9b697fd59d7977a0 100644
--- a/ArmVirtPkg/Library/FdtPL011SerialPortLib/EarlyFdtPL011SerialPortLib.inf
+++ b/ArmVirtPkg/Library/FdtPL011SerialPortLib/EarlyFdtPL011SerialPortLib.inf
@@ -44,3 +44,4 @@  [FixedPcd]
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits
+  gArmPlatformTokenSpaceGuid.PL011UartClkInHz
diff --git a/ArmVirtPkg/Library/FdtPL011SerialPortLib/FdtPL011SerialPortLib.inf b/ArmVirtPkg/Library/FdtPL011SerialPortLib/FdtPL011SerialPortLib.inf
index 3bacd641f0624c4216461ed3f6a33c896363168e..0b06797293c69b9eb00522c5905e4ab51e2cb524 100644
--- a/ArmVirtPkg/Library/FdtPL011SerialPortLib/FdtPL011SerialPortLib.inf
+++ b/ArmVirtPkg/Library/FdtPL011SerialPortLib/FdtPL011SerialPortLib.inf
@@ -43,6 +43,7 @@  [FixedPcd]
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits
+  gArmPlatformTokenSpaceGuid.PL011UartClkInHz
 
 [Guids]
   gEarlyPL011BaseAddressGuid
diff --git a/ArmVirtPkg/Library/FdtPL011SerialPortLib/EarlyFdtPL011SerialPortLib.c b/ArmVirtPkg/Library/FdtPL011SerialPortLib/EarlyFdtPL011SerialPortLib.c
index 72b47652b6dd790946262755c50164fb770b95bd..c458abb622d9c25de5a9ea9dfa8ae0e52c4ac739 100644
--- a/ArmVirtPkg/Library/FdtPL011SerialPortLib/EarlyFdtPL011SerialPortLib.c
+++ b/ArmVirtPkg/Library/FdtPL011SerialPortLib/EarlyFdtPL011SerialPortLib.c
@@ -112,7 +112,13 @@  SerialPortGetBaseAddress (
 
         Status = PL011UartInitializePort (
                    UartBase,
-                   &BaudRate, &ReceiveFifoDepth, &Parity, &DataBits, &StopBits);
+                   FixedPcdGet32 (PL011UartClkInHz),
+                   &BaudRate,
+                   &ReceiveFifoDepth,
+                   &Parity,
+                   &DataBits,
+                   &StopBits
+                   );
         if (!EFI_ERROR (Status)) {
           return UartBase;
         }
diff --git a/ArmVirtPkg/Library/FdtPL011SerialPortLib/FdtPL011SerialPortLib.c b/ArmVirtPkg/Library/FdtPL011SerialPortLib/FdtPL011SerialPortLib.c
index b73ab8f48a9df7f0924cd9a5f7bc6e0f16f3151f..48a0530dcc2fe59a87b37d2df6eba44c1247ad84 100644
--- a/ArmVirtPkg/Library/FdtPL011SerialPortLib/FdtPL011SerialPortLib.c
+++ b/ArmVirtPkg/Library/FdtPL011SerialPortLib/FdtPL011SerialPortLib.c
@@ -81,8 +81,14 @@  FdtPL011SerialPortLibInitialize (
   StopBits = (EFI_STOP_BITS_TYPE) PcdGet8 (PcdUartDefaultStopBits);
 
   return PL011UartInitializePort (
-           mSerialBaseAddress, &BaudRate, &ReceiveFifoDepth,
-           &Parity, &DataBits, &StopBits);
+           mSerialBaseAddress,
+           FixedPcdGet32 (PL011UartClkInHz),
+           &BaudRate,
+           &ReceiveFifoDepth,
+           &Parity,
+           &DataBits,
+           &StopBits
+           );
 }
 
 /**