From nobody Tue Feb 10 04:14:21 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+48573+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+48573+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1570538343; cv=none; d=zoho.com; s=zohoarc; b=E8M1dzqLCKcax2ay3+RqwMbVYHJuyy7M/Zgxu3TCBvv7khrRQNGVN8KWT7Bkxvvxv3kUuspTswwwQuDwPjrdfI/3xa+BIqvekGSL95pe3Q3rkOZhWDo6CfBzbPF3w2m/huuE3lJ7cNgnpbIBbsi4J/Bb9ABAVrb4+DhSzE+TqYE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570538343; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=bcR65LZrg7jsyeT4Yi7oBL6rcrN75OAdDQKs1iYo/mU=; b=kUH0D3ORsafUTRvDX2UIOlFkB4NH0mQxESJiwavbTxkgJvE3Dm46ydVnBgQv+P3GugxT94YtfkcyiQL7Xn3rvlOxYfAtxkkpJ0CoKUHTcswaaDJKBbIpWG3kryrNlLJsemfk1hNROrvV0RHlYAqgSFLOe0ecXVaicXDX3R051D4= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+48573+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1570538343108854.6818160323469; Tue, 8 Oct 2019 05:39:03 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id aaaaYY1788612xaaaaaaaaaa; Tue, 08 Oct 2019 05:39:02 -0700 X-Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by groups.io with SMTP; Tue, 08 Oct 2019 05:39:02 -0700 X-Received: by mail-wm1-f67.google.com with SMTP id m18so2974148wmc.1 for ; Tue, 08 Oct 2019 05:39:01 -0700 (PDT) X-Gm-Message-State: aaaaaaaaaaaaaaaaaaaaaaaax1787277AA= X-Google-Smtp-Source: APXvYqxBhxLXna/iq1OeEhqEyb0DPMkSNQwl4QbiNVmhu+kUIzSXxGnDi7ZPwxkauNRTea2X64AgoA== X-Received: by 2002:a7b:c631:: with SMTP id p17mr3645548wmk.5.1570538339820; Tue, 08 Oct 2019 05:38:59 -0700 (PDT) X-Received: from localhost.localdomain ([84.203.40.122]) by smtp.gmail.com with ESMTPSA id r6sm3203087wmh.38.2019.10.08.05.38.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Oct 2019 05:38:59 -0700 (PDT) From: "Pete Batard" To: devel@edk2.groups.io Cc: ard.biesheuvel@linaro.org, leif.lindholm@linaro.org Subject: [edk2-devel] [edk2-platforms][PATCH v2 5/5] Platform/RPi3/PlatformSmbiosDxe: Derive RAM size from board revision Date: Tue, 8 Oct 2019 13:38:41 +0100 Message-Id: <20191008123841.12952-6-pete@akeo.ie> In-Reply-To: <20191008123841.12952-1-pete@akeo.ie> References: <20191008123841.12952-1-pete@akeo.ie> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,pete@akeo.ie Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1570538342; bh=VddGTAW+gFWk9KQUc4z966RmMW9GkS7HC3ga6mMbQoI=; h=Cc:Date:From:Reply-To:Subject:To; b=CgTNKh31LdHEcTfVaVCBT02+uF1+EgMPhUtws7Xo8MVVYJ1Lg3dDYOhx1EsaRpsE3wR 0Uqdc7ZgTXLNsTDjvsEJtBDnVQjB2ucw9tpnWLI9nXLIIzl08a5wRKwjn5U6HtLDGliEJ ieCPxgNvbv1g8zCMeGyPSH9ji1BLpsgivAo= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" The board revision is the proper channel to use to detect the amount of RAM available as bits [20-22] report the effective RAM size for the board starting with 256 MB (000b) and doubling in size for each value. Signed-off-by: Pete Batard Reviewed-by: Leif Lindholm --- Platform/RaspberryPi/RPi3/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c | = 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/Platform/RaspberryPi/RPi3/Drivers/PlatformSmbiosDxe/PlatformSm= biosDxe.c b/Platform/RaspberryPi/RPi3/Drivers/PlatformSmbiosDxe/PlatformSmb= iosDxe.c index 66ffadd0cade..540e3fd61f25 100644 --- a/Platform/RaspberryPi/RPi3/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe= .c +++ b/Platform/RaspberryPi/RPi3/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe= .c @@ -863,16 +863,22 @@ MemArrMapInfoUpdateSmbiosType19 ( ) { EFI_STATUS Status; - UINT32 Base; - UINT32 Size; + UINT32 BoardRevision =3D 0; =20 - Status =3D mFwProtocol->GetArmMem (&Base, &Size); + // Note: Type 19 addresses are expressed in KB, not bytes + mMemArrMapInfoType19.StartingAddress =3D 0; + // The minimum RAM size used on any Raspberry Pi model is 256 MB + mMemArrMapInfoType19.EndingAddress =3D 256 * 1024; + Status =3D mFwProtocol->GetModelRevision (&BoardRevision); if (Status !=3D EFI_SUCCESS) { - DEBUG ((DEBUG_ERROR, "Couldn't get the ARM memory size: %r\n", Status)= ); + DEBUG ((DEBUG_WARNING, "Couldn't get the board memory size - defaultin= g to 256 MB: %r\n", Status)); } else { - mMemArrMapInfoType19.StartingAddress =3D Base / 1024; - mMemArrMapInfoType19.EndingAddress =3D (Base + Size - 1) / 1024; + // www.raspberrypi.org/documentation/hardware/raspberrypi/revision-cod= es/README.md + // Bits [20-22] indicate the amount of memory starting with 256MB (000= b) + // and doubling in size for each value (001b =3D 512 MB, 010b =3D 1GB,= etc.) + mMemArrMapInfoType19.EndingAddress <<=3D (BoardRevision >> 20) & 0x07; } + mMemArrMapInfoType19.EndingAddress -=3D 1; =20 LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER*)&mMemArrMapInfoType19, mMemArrM= apInfoType19Strings, NULL); } --=20 2.21.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#48573): https://edk2.groups.io/g/devel/message/48573 Mute This Topic: https://groups.io/mt/34441820/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-