public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Pete Batard" <pete@akeo.ie>
To: Andrei Warkentin <awarkentin@vmware.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "ard.biesheuvel@linaro.org" <ard.biesheuvel@linaro.org>,
	"leif@nuviainc.com" <leif@nuviainc.com>,
	"philmd@redhat.com" <philmd@redhat.com>
Subject: Re: [edk2-platforms][PATCH 2/2] Platform/RaspberryPi/Drivers/PlatformSmbiosDxe: improve UX with 3GB limit
Date: Wed, 4 Mar 2020 23:38:21 +0000	[thread overview]
Message-ID: <1871985d-f355-2c67-f168-669f2097b306@akeo.ie> (raw)
In-Reply-To: <20200304223056.116868-3-awarkentin@vmware.com>

On 2020.03.04 22:31, Andrei Warkentin wrote:
> Right now there was no way to tell you're booting with RAM limited
> to 3GB, since the setup front page still listed 4096 MB.
> 
> Fix this by honoring PcdRamLimitTo3GB in PlatformSmbiosDxe.
> 
> Tested on 2GB and 4GB boards (with limiting and without)
> 
> Signed-off-by: Andrei Warkentin <awarkentin@vmware.com>
> ---
>   Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c   | 7 ++++++-
>   Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.inf | 2 ++
>   2 files changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c b/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c
> index 5585cb84..3351fea2 100644
> --- a/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c
> +++ b/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c
> @@ -882,7 +882,12 @@ MemArrMapInfoUpdateSmbiosType19 (
>     if (Status != EFI_SUCCESS) {
>       DEBUG ((DEBUG_WARN, "Couldn't get the board memory size - defaulting to 256 MB: %r\n", Status));
>     } else {
> -    mMemArrMapInfoType19.EndingAddress = InstalledMB * 1024;
> +    if (PcdGet32 (PcdRamMoreThan3GB) && PcdGet32 (PcdRamLimitTo3GB)) {
> +      ASSERT (InstalledMB > 3 * 1024);
> +      mMemArrMapInfoType19.EndingAddress = 3 * 1024 * 1024;
> +    } else {
> +      mMemArrMapInfoType19.EndingAddress = InstalledMB * 1024;
> +    }
>     }
>     mMemArrMapInfoType19.EndingAddress -= 1;
>   
> diff --git a/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.inf b/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.inf
> index 9554c2e9..1ed6338c 100644
> --- a/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.inf
> +++ b/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.inf
> @@ -52,3 +52,5 @@
>     gArmTokenSpaceGuid.PcdSystemMemorySize
>     gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor
>     gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString
> +  gRaspberryPiTokenSpaceGuid.PcdRamMoreThan3GB
> +  gRaspberryPiTokenSpaceGuid.PcdRamLimitTo3GB
> 

Reviewed-by: Pete Batard <pete@akeo.ie>


  reply	other threads:[~2020-03-04 23:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-04 22:31 [edk2-platforms][PATCH 0/2] RPi4 fixes to 3GB RAM limit logic Andrei Warkentin
2020-03-04 22:31 ` [edk2-platforms][PATCH 1/2] Platform/RaspberryPi/Drivers/ConfigDxe: fix bug in 3GB RAM logic Andrei Warkentin
2020-03-04 23:38   ` Pete Batard
2020-03-05 11:58     ` [edk2-devel] " Philippe Mathieu-Daudé
2020-03-04 22:31 ` [edk2-platforms][PATCH 2/2] Platform/RaspberryPi/Drivers/PlatformSmbiosDxe: improve UX with 3GB limit Andrei Warkentin
2020-03-04 23:38   ` Pete Batard [this message]
2020-03-05 13:52 ` [edk2-platforms][PATCH 0/2] RPi4 fixes to 3GB RAM limit logic Ard Biesheuvel
2020-03-05 13:55   ` 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=1871985d-f355-2c67-f168-669f2097b306@akeo.ie \
    --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