From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=209.85.221.49; helo=mail-wr1-f49.google.com; envelope-from=philmd@redhat.com; receiver=edk2-devel@lists.01.org Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) (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 7376A2119EBDE for ; Tue, 18 Dec 2018 02:01:45 -0800 (PST) Received: by mail-wr1-f49.google.com with SMTP id z5so15205675wrt.11 for ; Tue, 18 Dec 2018 02:01:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:openpgp:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=LS7bnD+b4uo8svlrmZkYv0syTPFXDIWm15l25s+9zEY=; b=mJi847rUHDzndKgmhLSiOBbR5raHfgNaHWamFwv9I3RW4v0x+8+BAjX89zuKOxVogu WCRL4RvHpcnZKTC/B4bM8b0UJHZxWmJvb1vWqIXBR/uuSZc4SySoqVfq9LIlQKlPfM5s LuaHx8FpYNBXM8aobaMUT/vYBqVE0AogpqBBZ74AVJDKkUum92aFWRbSaqejvOKebaYD jVKzBo+wsZ9UUzSjoWLEeKjhDXufEGjE7vGWVOzT9S+EOfiSiV3Lcr+AXfw54P9PZx+v lbfklkPTodccUcCTtYC9wLVyzHJYJVU6YL89ncJJQm2jqMWyM2zirNPaX6XMwEM01yRb YSqg== X-Gm-Message-State: AA+aEWYdMgC3b+6y7AFlwTEeJpExPfQqLHZJXR/R7L64sWVuAncislhn Ihvmk2urBtz8ItB7HlYW4XFE2GRuZfg= X-Google-Smtp-Source: AFSGD/UK2n6NkOOQkjsxPDjdXitdWb7OGcOBdBsbSlkU6UCBlV+UwwUpxOWrGWPeVKQlL0a14MDy4Q== X-Received: by 2002:adf:8421:: with SMTP id 30mr14520800wrf.153.1545127303697; Tue, 18 Dec 2018 02:01:43 -0800 (PST) Received: from [192.168.1.34] (172.red-88-21-202.staticip.rima-tde.net. [88.21.202.172]) by smtp.gmail.com with ESMTPSA id l197sm4879849wma.44.2018.12.18.02.01.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Dec 2018 02:01:42 -0800 (PST) To: Ard Biesheuvel , edk2-devel@lists.01.org References: <20181217185145.24618-1-ard.biesheuvel@linaro.org> From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= Openpgp: id=89C1E78F601EE86C867495CBA2A3FD6EDEADC0DE; url=http://pgp.mit.edu/pks/lookup?op=get&search=0xA2A3FD6EDEADC0DE Message-ID: Date: Tue, 18 Dec 2018 11:01:42 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 MIME-Version: 1.0 In-Reply-To: <20181217185145.24618-1-ard.biesheuvel@linaro.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: Tue, 18 Dec 2018 10:01:45 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit On 12/17/18 7:51 PM, 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) You missed the trailing '.' :) > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Ard Biesheuvel Reviewed-by: Philippe Mathieu-Daudé > --- > 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 >