From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: Laszlo Ersek <lersek@redhat.com>
Cc: "edk2-devel@lists.01.org" <edk2-devel@lists.01.org>,
Leif Lindholm <leif.lindholm@linaro.org>
Subject: Re: [PATCH v2 2/2] ArmVirtPkg: switch to new PL011UartLib implementation
Date: Fri, 17 Nov 2017 10:01:15 +0000 [thread overview]
Message-ID: <CAKv+Gu-gSdiEQRkbUk7x2nBeSeQxbOZRR_x6k3Lm5PA1AjK6wA@mail.gmail.com> (raw)
In-Reply-To: <7884b0a5-d42c-23de-2dd3-fee5bde85947@redhat.com>
On 16 November 2017 at 22:17, Laszlo Ersek <lersek@redhat.com> wrote:
> On 11/16/17 18:47, Ard Biesheuvel wrote:
>> Switch to the new, cleaned up PL011UartLib implementation so we will
>> be able to remove the old one.
>>
>> Contributed-under: TianoCore Contribution Agreement 1.1
>> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>> ---
>> ArmVirtPkg/ArmVirt.dsc.inc | 2 +-
>> ArmVirtPkg/Library/FdtPL011SerialPortLib/EarlyFdtPL011SerialPortLib.c | 5 ++---
>> ArmVirtPkg/Library/FdtPL011SerialPortLib/FdtPL011SerialPortLib.c | 5 ++---
>> 3 files changed, 5 insertions(+), 7 deletions(-)
>>
>> diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc
>> index c92a69281ae4..50eb8675d1c0 100644
>> --- a/ArmVirtPkg/ArmVirt.dsc.inc
>> +++ b/ArmVirtPkg/ArmVirt.dsc.inc
>> @@ -106,7 +106,7 @@ [LibraryClasses.common]
>> RealTimeClockLib|ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.inf
>> TimeBaseLib|EmbeddedPkg/Library/TimeBaseLib/TimeBaseLib.inf
>> # ARM PL011 UART Driver
>> - PL011UartLib|ArmPlatformPkg/Drivers/PL011Uart/PL011Uart.inf
>> + PL011UartLib|ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.inf
>> SerialPortLib|ArmVirtPkg/Library/FdtPL011SerialPortLib/FdtPL011SerialPortLib.inf
>>
>> #
>> diff --git a/ArmVirtPkg/Library/FdtPL011SerialPortLib/EarlyFdtPL011SerialPortLib.c b/ArmVirtPkg/Library/FdtPL011SerialPortLib/EarlyFdtPL011SerialPortLib.c
>> index e28750f3b4c4..d9fd0ef98359 100644
>> --- a/ArmVirtPkg/Library/FdtPL011SerialPortLib/EarlyFdtPL011SerialPortLib.c
>> +++ b/ArmVirtPkg/Library/FdtPL011SerialPortLib/EarlyFdtPL011SerialPortLib.c
>> @@ -16,14 +16,13 @@
>>
>> **/
>>
>> -#include <Base.h>
>> +#include <Uefi.h>
>>
>> #include <Library/PcdLib.h>
>> +#include <Library/PL011UartLib.h>
>> #include <Library/SerialPortLib.h>
>> #include <libfdt.h>
>>
>> -#include <Drivers/PL011Uart.h>
>> -
>> RETURN_STATUS
>> EFIAPI
>> SerialPortInitialize (
>> diff --git a/ArmVirtPkg/Library/FdtPL011SerialPortLib/FdtPL011SerialPortLib.c b/ArmVirtPkg/Library/FdtPL011SerialPortLib/FdtPL011SerialPortLib.c
>> index 05d3547fda91..c161dd6349d3 100644
>> --- a/ArmVirtPkg/Library/FdtPL011SerialPortLib/FdtPL011SerialPortLib.c
>> +++ b/ArmVirtPkg/Library/FdtPL011SerialPortLib/FdtPL011SerialPortLib.c
>> @@ -17,9 +17,10 @@
>>
>> **/
>>
>> -#include <Base.h>
>> +#include <Uefi.h>
>>
>> #include <Library/PcdLib.h>
>> +#include <Library/PL011UartLib.h>
>> #include <Library/SerialPortLib.h>
>> #include <Pi/PiBootMode.h>
>> #include <Uefi/UefiBaseType.h>
>> @@ -28,8 +29,6 @@
>> #include <Library/HobLib.h>
>> #include <Guid/EarlyPL011BaseAddress.h>
>>
>> -#include <Drivers/PL011Uart.h>
>> -
>> STATIC UINTN mSerialBaseAddress;
>>
>> RETURN_STATUS
>>
>
> Awesome idea!
>
> One comment: can you please check whether, if you replace
>
> #include <Uefi.h>
>
> with
>
> #include <Uefi/UefiBaseType.h>
>
> then stuff will still build?
>
> Both SerialPortLib instances are BASE, so we should not include <Uefi.h>
> (in particular <Uefi/UefiSpec.h> included by it).
>
> If it works, then:
>
> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
>
> If it doesn't work, then I think we should figure out why not; it could
> be a sign of some layering violation, which would be nice to document at
> least in the commit message.
>
Yes, that works. I added #include <Uefi/UefiBaseType.h> to
Library/PL011UartLib.h, which includes Protocol/SerialIo.h and
therefore needs the UEFI types. With that, I can drop the change from
the SerialPortLib implementations, in both patches.
next prev parent reply other threads:[~2017-11-17 9:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-16 17:47 [PATCH v2 0/2] ArmplatformPkg: clean up PL011 support library Ard Biesheuvel
2017-11-16 17:47 ` [PATCH v2 1/2] ArmPlatformPkg: reorganize PL011 code Ard Biesheuvel
2017-11-16 17:47 ` [PATCH v2 2/2] ArmVirtPkg: switch to new PL011UartLib implementation Ard Biesheuvel
2017-11-16 22:17 ` Laszlo Ersek
2017-11-17 10:01 ` Ard Biesheuvel [this message]
2017-11-16 18:41 ` [PATCH v2 0/2] ArmplatformPkg: clean up PL011 support library Leif Lindholm
2017-11-17 10:06 ` 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=CAKv+Gu-gSdiEQRkbUk7x2nBeSeQxbOZRR_x6k3Lm5PA1AjK6wA@mail.gmail.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