From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:4864:20::343; helo=mail-wm1-x343.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) (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 DABE8211A4584 for ; Thu, 20 Dec 2018 07:20:54 -0800 (PST) Received: by mail-wm1-x343.google.com with SMTP id f188so2602368wmf.5 for ; Thu, 20 Dec 2018 07:20:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=u4us8pArot4cwxim9oklVUD4BXVRQQLMjB8RaotH5mU=; b=hK+RLXsv19zZ0/4dZBpQexqn0QchxwQPA27yXq/cDe8Fjp5VZcpt7+xEOByvPIAquL +Fe+DA154yZfzPaRsXhuT9KUJfdZLn/LbAE0jQaY7KnRbKIha6ecqjvWdUgRaqHnVY1k xE3esAW8saGwPnv5t10GnspSD+LiKgOrDot5g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=u4us8pArot4cwxim9oklVUD4BXVRQQLMjB8RaotH5mU=; b=JlRJFJw1+ERZbnUGLt9yMy7vb/1R56UFbihv0HCh/d3eNyhtvBsdU96aG2gma8UIOO MUJMS0ecn40J1LA+MWiRmvAYebwnXf/ryYLAWUKeIqLGUx0QzG8QyT++mmomEFWirg+Y qaADL0nFwcSY+nTGXDOaE8cqqHWkAGKhAzPo0pJllxqhnW+10FUkOtONch9T7lNZK/f5 geTCxv0NrER2hm235iyKqw5/EvDMdq1QjGIC5QpjczddE4yW6twgtGPbVcQLilyc1iV3 XYu0ZRO0ahZ0S3cxizrYEzzRD4nQyDzKwCpXRiNm3OIBroWNsESrH1gvWh6Yvv+AzR3K LxoQ== X-Gm-Message-State: AA+aEWb/GwQLax5DxgfYDtyBQgMR5qkUpLU/RWLrfEKS44yhZg64XG9o K7VNXiBhyOZJSC4cTaHAvQjU3Q== X-Google-Smtp-Source: AFSGD/VxNKKtHAyKJnjqEpShRnXQ51osiZK13pYdJ9NoPgA1cQFONYRDhQg6SOHvRyyv/GO2vkI23g== X-Received: by 2002:a1c:7706:: with SMTP id t6mr11228398wmi.57.1545319253356; Thu, 20 Dec 2018 07:20:53 -0800 (PST) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id l14sm21929163wrp.55.2018.12.20.07.20.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 20 Dec 2018 07:20:52 -0800 (PST) Date: Thu, 20 Dec 2018 15:20:51 +0000 From: Leif Lindholm To: Ard Biesheuvel Cc: edk2-devel@lists.01.org Message-ID: <20181220152051.dbqbzi46hpl5ymls@bivouac.eciton.net> References: <20181217185145.24618-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 In-Reply-To: <20181217185145.24618-1-ard.biesheuvel@linaro.org> User-Agent: NeoMutt/20170113 (1.7.2) 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 15:20:55 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 > --- > 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 >