From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4864:20::d42; helo=mail-io1-xd42.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-io1-xd42.google.com (mail-io1-xd42.google.com [IPv6:2607:f8b0:4864:20::d42]) (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 AA0CD2119EBC3 for ; Thu, 20 Dec 2018 09:36:03 -0800 (PST) Received: by mail-io1-xd42.google.com with SMTP id o13so85098ioh.2 for ; Thu, 20 Dec 2018 09:36:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ckoFHNxhfS1MTKPeEM6e/cMEvh6wTImmPhDuaXR/aVo=; b=Y4aVPz0NCC2+3FA5YIvAeWf9G18VrJleP3vLBLB5+B/7PEizFAiD58lIZkFaFKb5Cf fMiYnQmTkX5qcGSvxol8RxynTVjS0zxFX2pGIMzkX9OTrjxgQChGoGxWyV0j6rUYW4+U o/PU27WBZur2LIFr9vq0Ytm43MmH039A+EQ40= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ckoFHNxhfS1MTKPeEM6e/cMEvh6wTImmPhDuaXR/aVo=; b=mTarl4fWXrEXXLxTqw/Y9CbSlHfr6f4QqLntLS2tcsHbQbRBUVKDM1fYfmwrjVNOj9 4PiG9bXD9gPA5NkJ6qG9kaRHw7Fo65KaHMuIOwDG50SWrie5wDIpR+pyU15pST1quuXh kXDJtIo7/sOeG4hT3+Ud5zmq02jECJg0oufCGhAfe+eRI6zt3n0v/7Po4s98oaYw7+81 IGZiTMveeIkEVvRmgjw/sUtZwFYvxb51hUh/Ni255v2W1MQWwVwxtUAMBG0iMyTPLVRx xd7/T4DARTUymfBldsJShPS6SwRY8mf+ewh5226PzMPJxeaWT9WW4dvoK5DKvW06neSg KSrg== X-Gm-Message-State: AA+aEWbzc3i/SUY4Qms/C8AKU6WBBjSSmCMVOi/C96+1abAFYD/I4Coe U1slnqsyfH/eKFBkP1wF7yTFudbhrR83ARJKs/5ztg== X-Google-Smtp-Source: AFSGD/VHYo1r51Yur0SE8x6Keo7jNc33ARjOks8LTUhqNEdGTmy4zOpoDXWqPW7r37+qh+TiDmbvptACIzF6EM3Vxoo= X-Received: by 2002:a5e:cb0b:: with SMTP id p11mr22906804iom.60.1545327362858; Thu, 20 Dec 2018 09:36:02 -0800 (PST) MIME-Version: 1.0 References: <20181217185145.24618-1-ard.biesheuvel@linaro.org> <20181220152051.dbqbzi46hpl5ymls@bivouac.eciton.net> In-Reply-To: <20181220152051.dbqbzi46hpl5ymls@bivouac.eciton.net> From: Ard Biesheuvel Date: Thu, 20 Dec 2018 18:35:49 +0100 Message-ID: To: Leif Lindholm Cc: "edk2-devel@lists.01.org" Subject: Re: [PATCH] ArmPlatformPkg/PL011SerialPortLib: use untyped PCD for register base X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Dec 2018 17:36:03 -0000 Content-Type: text/plain; charset="UTF-8" On Thu, 20 Dec 2018 at 16:20, Leif Lindholm wrote: > > On Mon, Dec 17, 2018 at 07:51:45PM +0100, Ard Biesheuvel wrote: > > Use an untyped PCD reference for PcdSerialRegisterBase, so that the > > library gets built without hardcoded values, permitting modules to > > override the default serial port. This allows SerialDxe to use a > > different serial port from the one used for DEBUG output (which > > often gets occluded due to the console driver clearing the screen) > > > > Contributed-under: TianoCore Contribution Agreement 1.1 > > Signed-off-by: Ard Biesheuvel > > Reviewed-by: Leif Lindholm > Thanks Pushed as 6f42f9a54bf0..5a9b3eb8e5fb > > --- > > ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.c | 14 +++++++------- > > ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.inf | 4 +++- > > 2 files changed, 10 insertions(+), 8 deletions(-) > > > > diff --git a/ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.c b/ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.c > > index 212991d63859..d576f79c3e6e 100644 > > --- a/ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.c > > +++ b/ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.c > > @@ -48,7 +48,7 @@ SerialPortInitialize ( > > StopBits = (EFI_STOP_BITS_TYPE) FixedPcdGet8 (PcdUartDefaultStopBits); > > > > return PL011UartInitializePort ( > > - (UINTN)FixedPcdGet64 (PcdSerialRegisterBase), > > + (UINTN)PcdGet64 (PcdSerialRegisterBase), > > PL011UartClockGetFreq(), > > &BaudRate, > > &ReceiveFifoDepth, > > @@ -75,7 +75,7 @@ SerialPortWrite ( > > IN UINTN NumberOfBytes > > ) > > { > > - return PL011UartWrite ((UINTN)FixedPcdGet64 (PcdSerialRegisterBase), Buffer, NumberOfBytes); > > + return PL011UartWrite ((UINTN)PcdGet64 (PcdSerialRegisterBase), Buffer, NumberOfBytes); > > } > > > > /** > > @@ -95,7 +95,7 @@ SerialPortRead ( > > IN UINTN NumberOfBytes > > ) > > { > > - return PL011UartRead ((UINTN)FixedPcdGet64 (PcdSerialRegisterBase), Buffer, NumberOfBytes); > > + return PL011UartRead ((UINTN)PcdGet64 (PcdSerialRegisterBase), Buffer, NumberOfBytes); > > } > > > > /** > > @@ -111,7 +111,7 @@ SerialPortPoll ( > > VOID > > ) > > { > > - return PL011UartPoll ((UINTN)FixedPcdGet64 (PcdSerialRegisterBase)); > > + return PL011UartPoll ((UINTN)PcdGet64 (PcdSerialRegisterBase)); > > } > > /** > > Set new attributes to PL011. > > @@ -156,7 +156,7 @@ SerialPortSetAttributes ( > > ) > > { > > return PL011UartInitializePort ( > > - (UINTN)FixedPcdGet64 (PcdSerialRegisterBase), > > + (UINTN)PcdGet64 (PcdSerialRegisterBase), > > PL011UartClockGetFreq(), > > BaudRate, > > ReceiveFifoDepth, > > @@ -198,7 +198,7 @@ SerialPortSetControl ( > > IN UINT32 Control > > ) > > { > > - return PL011UartSetControl ((UINTN)FixedPcdGet64 (PcdSerialRegisterBase), Control); > > + return PL011UartSetControl ((UINTN)PcdGet64 (PcdSerialRegisterBase), Control); > > } > > > > /** > > @@ -239,5 +239,5 @@ SerialPortGetControl ( > > OUT UINT32 *Control > > ) > > { > > - return PL011UartGetControl ((UINTN)FixedPcdGet64 (PcdSerialRegisterBase), Control); > > + return PL011UartGetControl ((UINTN)PcdGet64 (PcdSerialRegisterBase), Control); > > } > > diff --git a/ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.inf b/ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.inf > > index 5ce5b2f5304c..bca7bed875c6 100644 > > --- a/ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.inf > > +++ b/ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.inf > > @@ -36,8 +36,10 @@ > > MdeModulePkg/MdeModulePkg.dec > > ArmPlatformPkg/ArmPlatformPkg.dec > > > > -[FixedPcd] > > +[Pcd] > > gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase > > + > > +[FixedPcd] > > gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate > > gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits > > gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity > > -- > > 2.17.1 > >