From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by mx.groups.io with SMTP id smtpd.web11.640.1583365104127540794 for ; Wed, 04 Mar 2020 15:38:24 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@akeo-ie.20150623.gappssmtp.com header.s=20150623 header.b=NWCawENJ; spf=none, err=permanent DNS error (domain: akeo.ie, ip: 209.85.128.67, mailfrom: pete@akeo.ie) Received: by mail-wm1-f67.google.com with SMTP id m3so3776826wmi.0 for ; Wed, 04 Mar 2020 15:38:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akeo-ie.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=D526OBkRUGqryR5gxC6Ky0qHy1IpbH6cbPEK6/SKHDY=; b=NWCawENJruQsnds6/Pbdp9a8wZbSyzyRMkLppQ4vXvPaX6ns0ol5T+usyx89xwtd4f 3m0NHS7LmYOvrBJljwizdtVWwkjtN+BjUL6LVKsFIYkfh5vT51wi0pAsMYR/EDeH519M 6Rc2hDDxFSCsiyP2thhdD0gQh6eWu9nLAle3peySb56H0L8X3zPpjh09yt7BcC8Fdr/1 jJsRayn33HvdXyeH5xIbDJaExvY5598bjDVzMvosVt91WC3sPNX7Mkv4M5RFDtywCzvt 99QZDZrOv+bk8ZqxbhF2Sj+FHZmFvM2bYiIjIjJmPuzEA9aUTsI/B+wseSv0nA6k4k6X GLaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=D526OBkRUGqryR5gxC6Ky0qHy1IpbH6cbPEK6/SKHDY=; b=qr2LhtJFoIdzEQL5lxkXsqK4mvWt3mCqFX5MGict3c3lUN8QjHGunC+MaX2pdfMRzh 51few6s06Jm+2VGJhHHxe5z/+1qdMqi12+3CTFsWPFNv7JqOFz3wqCkh1Q4Iso9VImru jOR5DtWDM5xthl/d8j5yF0F8OsR20ssTKXzYkO8RXLgSxe5N+5u7kzpdDO/JYmDzrAjy +oPy9I7GgeqiQPG1lJU93i52xt2aeiZQACWZE3p1FmR5kAWJ5MDXVSu8K4S6n4qNq5rk WjWSYlM8HSIfPK2hDIkrbg3mTTxprUWen4RtwcvB6rnwFciVeZYrhbEA8g87eZtFoPA+ FnKg== X-Gm-Message-State: ANhLgQ1mXLGfA1h1Pj0R9DGP301iTteROYEKwR2MOjGkLyeEC0NDJLwX CsBQsZI9Op9Bc2mEDBuzE/yABQ== X-Google-Smtp-Source: ADFU+vsjpDMNiJEUOgb3O2KbKW/7aq69h2/WhzDXMvUNo0NiaaljcBg86Xb2OVZiFcf5TsSXZjAj/A== X-Received: by 2002:a1c:810a:: with SMTP id c10mr5552066wmd.2.1583365102750; Wed, 04 Mar 2020 15:38:22 -0800 (PST) Return-Path: Received: from [10.0.0.122] ([84.203.49.209]) by smtp.googlemail.com with ESMTPSA id j205sm6429437wma.42.2020.03.04.15.38.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 04 Mar 2020 15:38:22 -0800 (PST) Subject: Re: [edk2-platforms][PATCH 2/2] Platform/RaspberryPi/Drivers/PlatformSmbiosDxe: improve UX with 3GB limit To: Andrei Warkentin , "devel@edk2.groups.io" Cc: "ard.biesheuvel@linaro.org" , "leif@nuviainc.com" , "philmd@redhat.com" References: <20200304223056.116868-1-awarkentin@vmware.com> <20200304223056.116868-3-awarkentin@vmware.com> From: "Pete Batard" Message-ID: <1871985d-f355-2c67-f168-669f2097b306@akeo.ie> Date: Wed, 4 Mar 2020 23:38:21 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <20200304223056.116868-3-awarkentin@vmware.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit 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 > --- > 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