From nobody Mon May 6 11:35:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+55321+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55321+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1583240911; cv=none; d=zohomail.com; s=zohoarc; b=S28yQLS/KLEyeKknNUSSYyEYr0Xr7nb01Oiz84jBcGkwBnJNxMBbN10WvdnEB3KyF3u75q7puO/RV4Ad93zwRZjSnqjHjp0EMJD2TRH0jpyFrUGzsk9vHK8cRJqxU+/2TcJizpUmZH4hliaXorXJWTHfqAZ55irDqb1dscI32n0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583240911; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=L7R0EQl6aWzd+tsO+pko5xZRIEt9mMeTMp/8zf7jQZo=; b=Q3gywuSRizJQwRlY5w3VDcr0K6rdNtJrxjinXWL2b5eoOzWzpLPfvIqL5fuIuGRHPqe5TobExsmrpyALeaWGR0N/fHjK3s8SvjVmbHNjTFAZgKwRuvZOU+OmGU8nzDJvAX9Fiw68wk3+Eh6UEw/Lc0naZT3z8itiGv7j5T1PxR4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55321+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1583240911988232.4304811123593; Tue, 3 Mar 2020 05:08:31 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id nia0YY1788612xEM3pd7nadC; Tue, 03 Mar 2020 05:08:30 -0800 X-Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by mx.groups.io with SMTP id smtpd.web11.3391.1583240910012173479 for ; Tue, 03 Mar 2020 05:08:30 -0800 X-Received: by mail-wr1-f66.google.com with SMTP id v2so4184620wrp.12 for ; Tue, 03 Mar 2020 05:08:29 -0800 (PST) X-Gm-Message-State: QVP7Uc4tVHL2MXikjOgooP9kx1787277AA= X-Google-Smtp-Source: ADFU+vvGIV6Ni2bkBhI5vc7txq5cfG7yAOch99ew6aGP4R+tFZBoINYsRn9ENkN3Yfi0bASNHbLufg== X-Received: by 2002:adf:b1d4:: with SMTP id r20mr5299241wra.303.1583240908282; Tue, 03 Mar 2020 05:08:28 -0800 (PST) X-Received: from localhost.localdomain ([84.203.56.244]) by smtp.gmail.com with ESMTPSA id j5sm3907620wmi.33.2020.03.03.05.08.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Mar 2020 05:08:27 -0800 (PST) From: "Pete Batard" To: devel@edk2.groups.io Cc: ard.biesheuvel@linaro.org, leif@nuviainc.com, philmd@redhat.com, awarkentin@vmware.com Subject: [edk2-devel][PATCH v2 1/6] Platform/RPi: Add firmware call to read installed memory size Date: Tue, 3 Mar 2020 13:08:09 +0000 Message-Id: <20200303130814.3092-2-pete@akeo.ie> In-Reply-To: <20200303130814.3092-1-pete@akeo.ie> References: <20200303130814.3092-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=1583240910; bh=XaHueFACjlSus/2Zp5lg44pB1YLpdNiHVXpUTEaHODg=; h=Cc:Date:From:Reply-To:Subject:To; b=LvGrdn/LVtOtbCo9Foorr7HpNuXcgSjk3+5pmZKuckyi4vSRNqSQKi1nCTdWOv8Il0h dg9igBg/gyar7M5TgQ0XVY9orENTvCsaYSTinRGg1s5wNvV+TMlu0WVFtqakrbc967gks KdxY+fz3mbsQNobpLbd+rTo2yccrPgw9m/s= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Andrei Warkentin Add a new RPiFirmwareGetModelInstalledMB () call in RpiFirmwareDxe to return the amount of detected installed RAM on the system (in MB). Signed-off-by: Pete Batard Reviewed-by: Ard Biesheuvel --- Platform/RaspberryPi/Drivers/RpiFirmwareDxe/RpiFirmwareDxe.c | 29 ++++++++= +++- Platform/RaspberryPi/Include/Protocol/RpiFirmware.h | 47 ++++++++= +++--------- 2 files changed, 55 insertions(+), 21 deletions(-) diff --git a/Platform/RaspberryPi/Drivers/RpiFirmwareDxe/RpiFirmwareDxe.c b= /Platform/RaspberryPi/Drivers/RpiFirmwareDxe/RpiFirmwareDxe.c index 75826fdc0e53..40c78b5d57cf 100644 --- a/Platform/RaspberryPi/Drivers/RpiFirmwareDxe/RpiFirmwareDxe.c +++ b/Platform/RaspberryPi/Drivers/RpiFirmwareDxe/RpiFirmwareDxe.c @@ -606,6 +606,32 @@ RpiFirmwareGetModelName ( } } =20 +STATIC +EFI_STATUS +EFIAPI +RPiFirmwareGetModelInstalledMB ( + OUT UINT32 *InstalledMB + ) +{ + EFI_STATUS Status; + UINT32 Revision; + + Status =3D RpiFirmwareGetModelRevision(&Revision); + if (EFI_ERROR(Status)) { + DEBUG ((DEBUG_ERROR, "%a: Could not get the board revision: Status =3D= =3D %r\n", + __FUNCTION__, Status)); + return EFI_DEVICE_ERROR; + } + + // + // www.raspberrypi.org/documentation/hardware/raspberrypi/revision-codes= /README.md + // Bits [20-22] indicate the amount of memory starting with 256MB (000b) + // and doubling in size for each value (001b =3D 512 MB, 010b =3D 1GB, e= tc.) + // + *InstalledMB =3D 256 << ((Revision >> 20) & 0x07); + return EFI_SUCCESS; +} + STATIC EFI_STATUS EFIAPI @@ -1236,7 +1262,8 @@ STATIC RASPBERRY_PI_FIRMWARE_PROTOCOL mRpiFirmwarePro= tocol =3D { RpiFirmwareGetFirmwareRevision, RpiFirmwareGetManufacturerName, RpiFirmwareGetCpuName, - RpiFirmwareGetArmMemory + RpiFirmwareGetArmMemory, + RPiFirmwareGetModelInstalledMB, }; =20 /** diff --git a/Platform/RaspberryPi/Include/Protocol/RpiFirmware.h b/Platform= /RaspberryPi/Include/Protocol/RpiFirmware.h index e3287e3c040f..108becbd3b6d 100644 --- a/Platform/RaspberryPi/Include/Protocol/RpiFirmware.h +++ b/Platform/RaspberryPi/Include/Protocol/RpiFirmware.h @@ -115,6 +115,12 @@ EFI_STATUS UINT32 *Revision ); =20 +typedef +EFI_STATUS +(EFIAPI *GET_MODEL_INSTALLED_MB) ( + UINT32 *InstalledMB + ); + typedef CHAR8* (EFIAPI *GET_MANUFACTURER_NAME) ( @@ -135,26 +141,27 @@ EFI_STATUS ); =20 typedef struct { - SET_POWER_STATE SetPowerState; - GET_MAC_ADDRESS GetMacAddress; - GET_COMMAND_LINE GetCommandLine; - GET_CLOCK_RATE GetClockRate; - GET_CLOCK_RATE GetMaxClockRate; - GET_CLOCK_RATE GetMinClockRate; - SET_CLOCK_RATE SetClockRate; - GET_FB GetFB; - FREE_FB FreeFB; - GET_FB_SIZE GetFBSize; - SET_LED SetLed; - GET_SERIAL GetSerial; - GET_MODEL GetModel; - GET_MODEL_REVISION GetModelRevision; - GET_MODEL_NAME GetModelName; - GET_MODEL_FAMILY GetModelFamily; - GET_FIRMWARE_REVISION GetFirmwareRevision; - GET_MANUFACTURER_NAME GetManufacturerName; - GET_CPU_NAME GetCpuName; - GET_ARM_MEM GetArmMem; + SET_POWER_STATE SetPowerState; + GET_MAC_ADDRESS GetMacAddress; + GET_COMMAND_LINE GetCommandLine; + GET_CLOCK_RATE GetClockRate; + GET_CLOCK_RATE GetMaxClockRate; + GET_CLOCK_RATE GetMinClockRate; + SET_CLOCK_RATE SetClockRate; + GET_FB GetFB; + FREE_FB FreeFB; + GET_FB_SIZE GetFBSize; + SET_LED SetLed; + GET_SERIAL GetSerial; + GET_MODEL GetModel; + GET_MODEL_REVISION GetModelRevision; + GET_MODEL_NAME GetModelName; + GET_MODEL_FAMILY GetModelFamily; + GET_FIRMWARE_REVISION GetFirmwareRevision; + GET_MANUFACTURER_NAME GetManufacturerName; + GET_CPU_NAME GetCpuName; + GET_ARM_MEM GetArmMem; + GET_MODEL_INSTALLED_MB GetModelInstalledMB; } RASPBERRY_PI_FIRMWARE_PROTOCOL; =20 extern EFI_GUID gRaspberryPiFirmwareProtocolGuid; --=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 (#55321): https://edk2.groups.io/g/devel/message/55321 Mute This Topic: https://groups.io/mt/71699472/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- From nobody Mon May 6 11:35:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+55322+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55322+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1583240913; cv=none; d=zohomail.com; s=zohoarc; b=lPKgBqrviy5xFnik/CdQpAqrgtB/elwMv3J5IYMlwui8UYv1YQuJyVqdyMZIqCwIBuRjx+K8VEut/FAj2y/IsFrWaFZHKw9jrVRdzd1A4uAdGZlCa5dkRgjso533Cef/rHVUeDj4n971/sy/Bo9qFV0FksXcdBsn05StxXaBlwg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583240913; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=VrIxMgw+Hi6XAKop7pk6g9EIZdNDXmwYqUTTY8615XI=; b=CCNTexNmnojwjQdAGN94dLlOY9HpGqIkCvddkKRnnEN0BFW0Z2KCOmToCKY3d6E9Qc4MMm0R4i+66WGXmcg1On+T2efwi0cDcCvq8qzu/ILliN1nfaSRuHJeiO8/vPWpjGSfJPc/UsGBSif0hzXOWKJOItC9L4Lkfxn3MJ5U3EA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55322+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1583240913753148.7447775607693; Tue, 3 Mar 2020 05:08:33 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id A8c2YY1788612xY7sQ5Q5mIY; Tue, 03 Mar 2020 05:08:32 -0800 X-Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by mx.groups.io with SMTP id smtpd.web12.3385.1583240911694790036 for ; Tue, 03 Mar 2020 05:08:32 -0800 X-Received: by mail-wr1-f66.google.com with SMTP id j16so4283299wrt.3 for ; Tue, 03 Mar 2020 05:08:31 -0800 (PST) X-Gm-Message-State: 2GGTW9qY9owLrE4KOHn7HgVnx1787277AA= X-Google-Smtp-Source: ADFU+vuc59VV6BfDCnKJZeCzk2COJ7MU/4KZt2YM+4rhIOxiQeavOWr/0IDgE6ZEpf3HdZ34XLfs7w== X-Received: by 2002:adf:f407:: with SMTP id g7mr5768672wro.178.1583240910025; Tue, 03 Mar 2020 05:08:30 -0800 (PST) X-Received: from localhost.localdomain ([84.203.56.244]) by smtp.gmail.com with ESMTPSA id j5sm3907620wmi.33.2020.03.03.05.08.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Mar 2020 05:08:29 -0800 (PST) From: "Pete Batard" To: devel@edk2.groups.io Cc: ard.biesheuvel@linaro.org, leif@nuviainc.com, philmd@redhat.com, awarkentin@vmware.com Subject: [edk2-devel][PATCH v2 2/6] Platform/RPi: Use GetModelInstalledMB () to read RAM size Date: Tue, 3 Mar 2020 13:08:10 +0000 Message-Id: <20200303130814.3092-3-pete@akeo.ie> In-Reply-To: <20200303130814.3092-1-pete@akeo.ie> References: <20200303130814.3092-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=1583240912; bh=xva51ET4Ij+USccmyidxdqKOpjZeVMAFG1bfpRE3XVA=; h=Cc:Date:From:Reply-To:Subject:To; b=HAUrwBzt9TyO27+58Zwbn5IarFdwd6eSoH9gB7Pqa1jHc5lamwEGmSDhKhhf9OYGWNV vccijPbVsDhqtCVbyXn8MPrlk3VoH0Ogfb8lYHrIrPBwkaz3tQvlHcd0OqZ3G/vDQgIXy USeM08ybojacBh2FV+Y+GLqv+TorZypOKgE= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Andrei Warkentin Use the call introduced in the previous commit to read the platform's installed memory. Signed-off-by: Pete Batard Reviewed-by: Ard Biesheuvel --- Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c | 10 ++= ++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosD= xe.c b/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c index f25c439f89c8..5585cb846f41 100644 --- a/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c +++ b/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c @@ -870,21 +870,19 @@ MemArrMapInfoUpdateSmbiosType19 ( ) { EFI_STATUS Status; - UINT32 BoardRevision =3D 0; + UINT32 InstalledMB =3D 0; =20 // Note: Type 19 addresses are expressed in KB, not bytes // The memory layout used in all known Pi SoC's starts at 0 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); + Status =3D mFwProtocol->GetModelInstalledMB (&InstalledMB); if (Status !=3D EFI_SUCCESS) { DEBUG ((DEBUG_WARN, "Couldn't get the board memory size - defaulting t= o 256 MB: %r\n", Status)); } else { - // 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 InstalledMB * 1024; } mMemArrMapInfoType19.EndingAddress -=3D 1; =20 --=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 (#55322): https://edk2.groups.io/g/devel/message/55322 Mute This Topic: https://groups.io/mt/71699473/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- From nobody Mon May 6 11:35:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+55323+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55323+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1583240915; cv=none; d=zohomail.com; s=zohoarc; b=LcCSbBDOsiIMDGDvCs8BaB9159DwnMTjBoBzg9S0JuDKPEMesDxO81D8BGVGbRrha7czZ2LkpktMavbaN+hk6EYBkJ0e29wvvMbkty4/K0Ht2OjA4HtC9UtAKlPPNdQ7krYFeELSEZM4PDLxwZHIxgZqxm+Y1UhqFhg9E7N6d94= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583240915; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=7aEuD8N+14pFGHBcOiC/tfc+FO0e64RhuWEP7rWZkyU=; b=i7NXfUgOUjmHhHf/uvf9rVG7RmDoCapwGwUxRPhmSbtrcRq2pLYOnZBOVq0JOshbpzx9/ggdc/9E9rYHNMK+wf9QT0JI2Y1JUyUbMI6y9gMRAiGZn7FT5kzCv6EPf1ftgxftgV7Y83YKgz4ZwNelaLrFUESlYUV2ZIrLPyx7hlY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55323+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1583240915118166.04241959597357; Tue, 3 Mar 2020 05:08:35 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id 3l7ZYY1788612xHCPqa19OFh; Tue, 03 Mar 2020 05:08:34 -0800 X-Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by mx.groups.io with SMTP id smtpd.web12.3386.1583240913040008858 for ; Tue, 03 Mar 2020 05:08:33 -0800 X-Received: by mail-wm1-f66.google.com with SMTP id a141so2779465wme.2 for ; Tue, 03 Mar 2020 05:08:32 -0800 (PST) X-Gm-Message-State: m3kRswf6KM6Dne2otSLfprJwx1787277AA= X-Google-Smtp-Source: ADFU+vsGN3WxM7CYs0fJb8fA/+DGBpJ4Re+/cY0papgmES5GtHZqBM/YjZZPm8fkrHCny1uIc0V5xw== X-Received: by 2002:a7b:cf39:: with SMTP id m25mr4237796wmg.146.1583240911174; Tue, 03 Mar 2020 05:08:31 -0800 (PST) X-Received: from localhost.localdomain ([84.203.56.244]) by smtp.gmail.com with ESMTPSA id j5sm3907620wmi.33.2020.03.03.05.08.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Mar 2020 05:08:30 -0800 (PST) From: "Pete Batard" To: devel@edk2.groups.io Cc: ard.biesheuvel@linaro.org, leif@nuviainc.com, philmd@redhat.com, awarkentin@vmware.com Subject: [edk2-devel][PATCH v2 3/6] Platform/RPi: Separate RAM descriptors between 0-3 GB and 3+ GB Date: Tue, 3 Mar 2020 13:08:11 +0000 Message-Id: <20200303130814.3092-4-pete@akeo.ie> In-Reply-To: <20200303130814.3092-1-pete@akeo.ie> References: <20200303130814.3092-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=1583240914; bh=LReP5g2d4+63BlU7Y4gDtJdr1Vc8OkR8SZIFzBZ20OI=; h=Cc:Date:From:Reply-To:Subject:To; b=gtqSk+vzfLdPrFhMlsSh/dgPzJbaNVsC90eSSDh4mhHnsNvUPeWh+kQe4XBZRUh1Xsd es4oMYi0LBJZtBsFLwG0tfydcx1hn7/r48C4Hq3TNUvbFs00e7nadEiJKdXzkom1tiGaw 36/4GGXx6pOx7QkpPcRi6XOjXGDBPkcjyx8= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Andrei Warkentin Splitting the RAM descriptors is required so that we can make the 3 to 4 GB segment of the Raspberry Pi 4 a user-configurable option. This also removes the need for the PcdAcpiBasicMode PCD. Signed-off-by: Pete Batard Reviewed-by: Ard Biesheuvel --- Platform/RaspberryPi/Library/PlatformLib/PlatformLib.inf | 3 -- Platform/RaspberryPi/Library/PlatformLib/RaspberryPiMem.c | 32 +++++++++++= +++------ 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/Platform/RaspberryPi/Library/PlatformLib/PlatformLib.inf b/Pla= tform/RaspberryPi/Library/PlatformLib/PlatformLib.inf index 9abcc2cc0075..77cdbe399a06 100644 --- a/Platform/RaspberryPi/Library/PlatformLib/PlatformLib.inf +++ b/Platform/RaspberryPi/Library/PlatformLib/PlatformLib.inf @@ -59,8 +59,5 @@ [FixedPcd] gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize =20 -[FeaturePcd] - gRaspberryPiTokenSpaceGuid.PcdAcpiBasicMode - [Ppis] gArmMpCoreInfoPpiGuid diff --git a/Platform/RaspberryPi/Library/PlatformLib/RaspberryPiMem.c b/Pl= atform/RaspberryPi/Library/PlatformLib/RaspberryPiMem.c index 4b388465cdde..901e5e3ee924 100644 --- a/Platform/RaspberryPi/Library/PlatformLib/RaspberryPiMem.c +++ b/Platform/RaspberryPi/Library/PlatformLib/RaspberryPiMem.c @@ -25,7 +25,7 @@ UINT32 mBoardRevision; =20 =20 // The total number of descriptors, including the final "end-of-table" des= criptor. -#define MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS 10 +#define MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS 11 =20 STATIC BOOLEAN VirtualMemoryInfoInitialized =3D FALSE; STATIC RPI_MEMORY_REGION_INFO VirtualMemoryInfo[MAX_VIRTUAL_MEMORY_MAP_D= ESCRIPTORS]; @@ -60,6 +60,7 @@ ArmPlatformGetVirtualMemoryMap ( { UINTN Index =3D 0; UINTN GpuIndex; + INT64 OrigMemorySize; INT64 SystemMemorySize; ARM_MEMORY_REGION_DESCRIPTOR *VirtualMemoryTable; =20 @@ -155,13 +156,13 @@ ArmPlatformGetVirtualMemoryMap ( VirtualMemoryInfo[Index].Type =3D RPI_MEM_UNMAPPED_REGION; VirtualMemoryInfo[Index++].Name =3D L"SoC Reserved (283x)"; =20 - if (FeaturePcdGet (PcdAcpiBasicMode)) { - // - // Limit the memory to 3 GB to work around the DMA bugs in the SoC wit= hout - // having to rely on IORT or _DMA descriptions. - // - SystemMemorySize =3D MIN(SystemMemorySize, 3U * SIZE_1GB); - } + // + // By default we limit the memory to 3 GB to work around the DMA bugs in= the SoC, + // for OSes that don't support _DMA range descriptors. On 4GB boards, it= 's runtime + // setting to boot with 4 GB, and the additional 1 GB is added by Config= Dxe. + // + OrigMemorySize =3D SystemMemorySize; + SystemMemorySize =3D MIN(SystemMemorySize, 3UL * SIZE_1GB); =20 // If we have RAM above the 1 GB mark, declare it if (SystemMemorySize - SIZE_1GB > 0) { @@ -170,7 +171,20 @@ ArmPlatformGetVirtualMemoryMap ( VirtualMemoryTable[Index].Length =3D SystemMemorySize - SIZE_1G= B; VirtualMemoryTable[Index].Attributes =3D ARM_MEMORY_REGION_ATTRIBUT= E_WRITE_BACK; VirtualMemoryInfo[Index].Type =3D RPI_MEM_BASIC_REGION; - VirtualMemoryInfo[Index++].Name =3D L"Extended System RAM"; + VirtualMemoryInfo[Index++].Name =3D L"Extended System RAM belo= w 3 GB"; + } + + // + // If we have RAM above 3 GB mark, declare it so it's mapped, but + // don't add it to the memory map. This is done later by ConfigDxe if ne= cessary. + // + if (OrigMemorySize > (3UL * SIZE_1GB)) { + VirtualMemoryTable[Index].PhysicalBase =3D 3UL * SIZE_1GB; + VirtualMemoryTable[Index].VirtualBase =3D VirtualMemoryTable[Index].= PhysicalBase; + VirtualMemoryTable[Index].Length =3D OrigMemorySize - VirtualMe= moryTable[Index].PhysicalBase; + VirtualMemoryTable[Index].Attributes =3D ARM_MEMORY_REGION_ATTRIBUT= E_WRITE_BACK; + VirtualMemoryInfo[Index].Type =3D RPI_MEM_UNMAPPED_REGION; + VirtualMemoryInfo[Index++].Name =3D L"Extended System RAM abov= e 3 GB"; } =20 // End of Table --=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 (#55323): https://edk2.groups.io/g/devel/message/55323 Mute This Topic: https://groups.io/mt/71699475/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- From nobody Mon May 6 11:35:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+55324+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55324+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1583240916; cv=none; d=zohomail.com; s=zohoarc; b=IEulItskeCH933cCFUCNVo3mB2xQGPHs3m8xobGczf/Jpmg56sdwlsSG/Q20+vEHy32W7zUtVEsLfgZde0WptxHIaE7voG//NiK6N0pLv3bFh17LqRq1doUDqfqW+ylPo4Rr+plWjoIAkdc9q46G0+6nK42nqHI8cD9etHMtn94= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583240916; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=WZYed1T8BraNKXvn/vmuopS8lVUU2gB1WP6hIM2aBWU=; b=lZoSyhZmIdCx7KEvFfbpaD8zp7CYf6m6hIVKxBxFU/L65PbneXYuihY7EEIAystvzLOjAbYEF0W7q5xdP1hRZ0u+y2Eb2bJ0fhWFaMJumAxGAQAgaiWYkrgrokxPR5q5YOpgwInHy/U33Oky65QZxAfkOh2G/YT0dNMG0sw5ZxE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55324+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 158324091683239.266767276587984; Tue, 3 Mar 2020 05:08:36 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id AC9LYY1788612xil2hm8PV9v; Tue, 03 Mar 2020 05:08:35 -0800 X-Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by mx.groups.io with SMTP id smtpd.web11.3393.1583240914917316915 for ; Tue, 03 Mar 2020 05:08:35 -0800 X-Received: by mail-wr1-f67.google.com with SMTP id h9so3293475wrr.10 for ; Tue, 03 Mar 2020 05:08:34 -0800 (PST) X-Gm-Message-State: HFKrq6SbfNCpPkV8ZN9W2FB7x1787277AA= X-Google-Smtp-Source: ADFU+vuUToZbGHUE9xj868QoQRPcJK9Hu21ZLHKviHGfSeFSu4D0VRR06c6feXA33X0fXUJ5JEuO0w== X-Received: by 2002:adf:f4c9:: with SMTP id h9mr5519500wrp.168.1583240912828; Tue, 03 Mar 2020 05:08:32 -0800 (PST) X-Received: from localhost.localdomain ([84.203.56.244]) by smtp.gmail.com with ESMTPSA id j5sm3907620wmi.33.2020.03.03.05.08.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Mar 2020 05:08:32 -0800 (PST) From: "Pete Batard" To: devel@edk2.groups.io Cc: ard.biesheuvel@linaro.org, leif@nuviainc.com, philmd@redhat.com, awarkentin@vmware.com Subject: [edk2-devel][PATCH v2 4/6] Platform/RPi: Make 3GB/4GB a runtime (BIOS setup) choice Date: Tue, 3 Mar 2020 13:08:12 +0000 Message-Id: <20200303130814.3092-5-pete@akeo.ie> In-Reply-To: <20200303130814.3092-1-pete@akeo.ie> References: <20200303130814.3092-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=1583240915; bh=87lLjSRCn4qHNJhEHglDGTv8Gc+5fgU5afGSE9Q/jBI=; h=Cc:Date:From:Reply-To:Subject:To; b=mpwZ/i9B4/5jKr/JyynpDmJ1f68rGlZFo8GUTJPC4rwcTHFCigGjluHOTzD85RDeoO1 6UJNszlFKXfsurPXLzb1KVI6+ciGnro0kVEWKoOoDGoMSZyFMDf78ANDfCI6XKAR7VfWF UxTWI7AAwyygb+ALLvxk6ySV7yHS41o15To= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Andrei Warkentin Currently some OSes (e.g FreeBSD) can make full use of the maximum 4 GB of RAM a Raspberry Pi 4 can offer, whereas others (e.g. Linux) must be restricted to only the first 3 GB. Previously this was a compile-time choice chosen by PcdAcpiBasicMode, and now we make it user-selectable. The default is a 3 GB limit. Signed-off-by: Pete Batard Reviewed-by: Ard Biesheuvel --- Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c | 72 +++++++++++++= ++++--- Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf | 8 ++- Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni | 11 +++ Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr | 41 +++++++++++ Platform/RaspberryPi/RPi3/RPi3.dsc | 6 ++ Platform/RaspberryPi/RPi4/RPi4.dsc | 6 ++ Platform/RaspberryPi/RaspberryPi.dec | 4 +- 7 files changed, 134 insertions(+), 14 deletions(-) diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c b/Platform/= RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c index 2f48ca0dd758..964ca6d369da 100644 --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c @@ -11,11 +11,13 @@ #include #include #include +#include #include #include #include #include #include +#include #include #include #include @@ -26,6 +28,8 @@ extern UINT8 ConfigDxeHiiBin[]; extern UINT8 ConfigDxeStrings[]; =20 STATIC RASPBERRY_PI_FIRMWARE_PROTOCOL *mFwProtocol; +STATIC UINT32 mModelFamily =3D 0; +STATIC UINT32 mModelInstalledMB =3D 0; =20 /* * The GUID inside Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.inf and @@ -129,6 +133,24 @@ SetupVariables ( PcdSet32 (PcdCustomCpuClock, PcdGet32 (PcdCustomCpuClock)); } =20 + if (mModelFamily >=3D 4 && mModelInstalledMB > 3 * 1024) { + /* + * This allows changing PcdRamLimitTo3GB in forms. + */ + PcdSet32 (PcdRamMoreThan3GB, 1); + + Size =3D sizeof (UINT32); + Status =3D gRT->GetVariable (L"RamLimitTo3GB", + &gConfigDxeFormSetGuid, + NULL, &Size, &Var32); + if (EFI_ERROR (Status)) { + PcdSet32 (PcdRamLimitTo3GB, PcdGet32 (PcdRamLimitTo3GB)); + } + } else { + PcdSet32 (PcdRamMoreThan3GB, 0); + PcdSet32 (PcdRamLimitTo3GB, 0); + } + Size =3D sizeof (UINT32); Status =3D gRT->GetVariable (L"SdIsArasan", &gConfigDxeFormSetGuid, @@ -224,7 +246,7 @@ ApplyVariables ( UINT32 CpuClock =3D PcdGet32 (PcdCpuClock); UINT32 CustomCpuClock =3D PcdGet32 (PcdCustomCpuClock); UINT32 Rate =3D 0; - UINT32 ModelFamily =3D 0; + UINT64 SystemMemorySize; =20 if (CpuClock !=3D 0) { if (CpuClock =3D=3D 2) { @@ -258,15 +280,31 @@ ApplyVariables ( DEBUG ((DEBUG_INFO, "Current CPU speed is %uHz\n", Rate)); } =20 - Status =3D mFwProtocol->GetModelFamily (&ModelFamily); - if (Status !=3D EFI_SUCCESS) { - DEBUG ((DEBUG_ERROR, "Couldn't get the Raspberry Pi model family: %r\n= ", Status)); - } else { - DEBUG ((DEBUG_INFO, "Current Raspberry Pi model family is 0x%x\n", Mod= elFamily)); + if (mModelFamily >=3D 4 && PcdGet32 (PcdRamLimitTo3GB) =3D=3D 0) { + /* + * Similar to how we compute the > 3 GB RAM segment's size in Platform= Lib/ + * RaspberryPiMem.c, with some overlap protection for the Bcm2xxx regi= ster + * spaces. This computation should also work for models with more than= 4 GB + * RAM, if there ever exist ones. + */ + SystemMemorySize =3D (UINT64)mModelInstalledMB * SIZE_1MB; + ASSERT (SystemMemorySize > 3UL * SIZE_1GB); + SystemMemorySize =3D MIN(SystemMemorySize, BCM2836_SOC_REGISTERS); + if (BCM2711_SOC_REGISTERS > 0) { + SystemMemorySize =3D MIN(SystemMemorySize, BCM2711_SOC_REGISTERS); + } + + Status =3D gDS->AddMemorySpace (EfiGcdMemoryTypeSystemMemory, 3UL * BA= SE_1GB, + SystemMemorySize - (3UL * SIZE_1GB), + EFI_MEMORY_UC | EFI_MEMORY_WC | EFI_MEMORY_WT | EFI_ME= MORY_WB); + ASSERT_EFI_ERROR (Status); + Status =3D gDS->SetMemorySpaceAttributes (3UL * BASE_1GB, + SystemMemorySize - (3UL * SIZE_1GB), + EFI_MEMORY_WB); + ASSERT_EFI_ERROR (Status); } =20 - - if (ModelFamily =3D=3D 3) { + if (mModelFamily =3D=3D 3) { /* * Pi 3: either Arasan or SdHost goes to SD card. * @@ -316,7 +354,7 @@ ApplyVariables ( GpioPinFuncSet (52, Gpio48Group); GpioPinFuncSet (53, Gpio48Group); =20 - } else if (ModelFamily =3D=3D 4) { + } else if (mModelFamily =3D=3D 4) { /* * Pi 4: either Arasan or eMMC2 goes to SD card. */ @@ -352,7 +390,7 @@ ApplyVariables ( GpioPinFuncSet (39, GPIO_FSEL_ALT3); } } else { - DEBUG ((DEBUG_ERROR, "Model Family %d not supported...\n", ModelFamily= )); + DEBUG ((DEBUG_ERROR, "Model Family %d not supported...\n", mModelFamil= y)); } =20 /* @@ -400,6 +438,20 @@ ConfigInitialize ( return Status; } =20 + Status =3D mFwProtocol->GetModelFamily (&mModelFamily); + if (Status !=3D EFI_SUCCESS) { + DEBUG ((DEBUG_ERROR, "Couldn't get the Raspberry Pi model family: %r\n= ", Status)); + } else { + DEBUG ((DEBUG_INFO, "Current Raspberry Pi model family is %d\n", mMode= lFamily)); + } + + Status =3D mFwProtocol->GetModelInstalledMB (&mModelInstalledMB); + if (Status !=3D EFI_SUCCESS) { + DEBUG ((DEBUG_ERROR, "Couldn't get the Raspberry Pi installed RAM size= : %r\n", Status)); + } else { + DEBUG ((DEBUG_INFO, "Current Raspberry Pi installed RAM size is %d MB\= n", mModelInstalledMB)); + } + Status =3D SetupVariables (); if (Status !=3D EFI_SUCCESS) { DEBUG ((DEBUG_ERROR, "Couldn't not setup NV vars: %r\n", Status)); diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf b/Platfor= m/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf index dc726cc6d934..407aac89c7b3 100644 --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf @@ -33,6 +33,7 @@ [Packages] ArmPlatformPkg/ArmPlatformPkg.dec MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec + Silicon/Broadcom/Bcm27xx/Bcm27xx.dec Silicon/Broadcom/Bcm283x/Bcm283x.dec Platform/RaspberryPi/RaspberryPi.dec EmbeddedPkg/EmbeddedPkg.dec @@ -53,10 +54,11 @@ [Guids] gConfigDxeFormSetGuid =20 [Protocols] - gRaspberryPiFirmwareProtocolGuid ## CONSUMES + gRaspberryPiFirmwareProtocolGuid ## CONSUMES gRaspberryPiConfigAppliedProtocolGuid ## PRODUCES =20 [Pcd] + gBcm27xxTokenSpaceGuid.PcdBcm27xxRegistersAddress gBcm283xTokenSpaceGuid.PcdBcm283xRegistersAddress gRaspberryPiTokenSpaceGuid.PcdCpuClock gRaspberryPiTokenSpaceGuid.PcdCustomCpuClock @@ -70,8 +72,8 @@ [Pcd] gRaspberryPiTokenSpaceGuid.PcdDebugShowUEFIExit gRaspberryPiTokenSpaceGuid.PcdDisplayEnableScaledVModes gRaspberryPiTokenSpaceGuid.PcdDisplayEnableSShot - -[FeaturePcd] + gRaspberryPiTokenSpaceGuid.PcdRamMoreThan3GB + gRaspberryPiTokenSpaceGuid.PcdRamLimitTo3GB =20 [Depex] gPcdProtocolGuid AND gRaspberryPiFirmwareProtocolGuid diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni b/Plat= form/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni index 9b4076635f05..830533a9dc49 100644 --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni @@ -35,6 +35,17 @@ #string STR_CHIPSET_SD_SDHOST #language en-US "Broadcom SDHOST" #string STR_CHIPSET_SD_ARASAN #language en-US "Arasan SDHCI" =20 +/* + * Advanced configuration. + */ + +#string STR_ADVANCED_FORM_TITLE #language en-US "Advanced Configurati= on" + +#string STR_ADVANCED_3GB_PROMPT #language en-US "Limit RAM to 3 GB" +#string STR_ADVANCED_3GB_HELP #language en-US "OSes not supporting = ACPI DMA constraints require a 3 GB limit or face broken xHCI USB" +#string STR_ADVANCED_3GB_OFF #language en-US "Disabled" +#string STR_ADVANCED_3GB_ON #language en-US "Enabled" + /* * MMC/SD configuration. */ diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr b/Plat= form/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr index 60bfdbd4d17e..483edd7459c5 100644 --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr @@ -73,6 +73,18 @@ typedef struct { UINT32 Routing; } CHIPSET_SD_VARSTORE_DATA; =20 +typedef struct { + /* + * Always set by ConfigDxe prior to HII init to reflect + * platform capability. + */ + UINT32 Supported; +} ADVANCED_RAM_MORE_THAN_3GB_VARSTORE_DATA; + +typedef struct { + UINT32 Enabled; +} ADVANCED_RAM_LIMIT_TO_3GB_VARSTORE_DATA; + typedef struct { /* * 0 - Don't disable multi-block. @@ -140,6 +152,16 @@ formset name =3D SdIsArasan, guid =3D CONFIGDXE_FORM_SET_GUID; =20 + efivarstore ADVANCED_RAM_MORE_THAN_3GB_VARSTORE_DATA, + attribute =3D EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME= _ACCESS | EFI_VARIABLE_NON_VOLATILE, + name =3D RamMoreThan3GB, + guid =3D CONFIGDXE_FORM_SET_GUID; + + efivarstore ADVANCED_RAM_LIMIT_TO_3GB_VARSTORE_DATA, + attribute =3D EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME= _ACCESS | EFI_VARIABLE_NON_VOLATILE, + name =3D RamLimitTo3GB, + guid =3D CONFIGDXE_FORM_SET_GUID; + efivarstore MMC_DISMULTI_VARSTORE_DATA, attribute =3D EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME= _ACCESS | EFI_VARIABLE_NON_VOLATILE, name =3D MmcDisableMulti, @@ -193,6 +215,10 @@ formset prompt =3D STRING_TOKEN(STR_CHIPSET_FORM_TITLE), help =3D STRING_TOKEN(STR_NULL_STRING); =20 + goto 0x1006, + prompt =3D STRING_TOKEN(STR_ADVANCED_FORM_TITLE), + help =3D STRING_TOKEN(STR_NULL_STRING); + goto 0x1003, prompt =3D STRING_TOKEN(STR_MMC_FORM_TITLE), help =3D STRING_TOKEN(STR_NULL_STRING); @@ -240,6 +266,21 @@ formset endoneof; endform; =20 + form formid =3D 0x1006, + title =3D STRING_TOKEN(STR_ADVANCED_FORM_TITLE); + subtitle text =3D STRING_TOKEN(STR_NULL_STRING); + + grayoutif ideqval RamMoreThan3GB.Supported =3D=3D 0; + oneof varid =3D RamLimitTo3GB.Enabled, + prompt =3D STRING_TOKEN(STR_ADVANCED_3GB_PROMPT), + help =3D STRING_TOKEN(STR_ADVANCED_3GB_HELP), + flags =3D NUMERIC_SIZE_4 | INTERACTIVE | RESET_REQUIRE= D, + option text =3D STRING_TOKEN(STR_ADVANCED_3GB_OFF), value = =3D 0, flags =3D DEFAULT; + option text =3D STRING_TOKEN(STR_ADVANCED_3GB_ON), value =3D= 1, flags =3D 0; + endoneof; + endif; + endform; + form formid =3D 0x1003, title =3D STRING_TOKEN(STR_MMC_FORM_TITLE); subtitle text =3D STRING_TOKEN(STR_MMC_FORM_SUBTITLE); diff --git a/Platform/RaspberryPi/RPi3/RPi3.dsc b/Platform/RaspberryPi/RPi3= /RPi3.dsc index df5b246af1f8..48e1a32e1d24 100644 --- a/Platform/RaspberryPi/RPi3/RPi3.dsc +++ b/Platform/RaspberryPi/RPi3/RPi3.dsc @@ -439,6 +439,12 @@ [PcdsDynamicHii.common.DEFAULT] gRaspberryPiTokenSpaceGuid.PcdDisplayEnableScaledVModes|L"DisplayEnableS= caledVModes"|gConfigDxeFormSetGuid|0x0|0xff gRaspberryPiTokenSpaceGuid.PcdDisplayEnableSShot|L"DisplayEnableSShot"|g= ConfigDxeFormSetGuid|0x0|1 =20 + # + # Supporting > 3GB of memory. + # + gRaspberryPiTokenSpaceGuid.PcdRamMoreThan3GB|L"RamMoreThan3GB"|gConfigDx= eFormSetGuid|0x0|0 + gRaspberryPiTokenSpaceGuid.PcdRamLimitTo3GB|L"RamLimitTo3GB"|gConfigDxeF= ormSetGuid|0x0|0 + # # Common UEFI ones. # diff --git a/Platform/RaspberryPi/RPi4/RPi4.dsc b/Platform/RaspberryPi/RPi4= /RPi4.dsc index 60a5e38da778..3ce2c3e4d519 100644 --- a/Platform/RaspberryPi/RPi4/RPi4.dsc +++ b/Platform/RaspberryPi/RPi4/RPi4.dsc @@ -477,6 +477,12 @@ [PcdsDynamicHii.common.DEFAULT] gRaspberryPiTokenSpaceGuid.PcdDisplayEnableScaledVModes|L"DisplayEnableS= caledVModes"|gConfigDxeFormSetGuid|0x0|0xff gRaspberryPiTokenSpaceGuid.PcdDisplayEnableSShot|L"DisplayEnableSShot"|g= ConfigDxeFormSetGuid|0x0|1 =20 + # + # Supporting > 3GB of memory. + # + gRaspberryPiTokenSpaceGuid.PcdRamMoreThan3GB|L"RamMoreThan3GB"|gConfigDx= eFormSetGuid|0x0|0 + gRaspberryPiTokenSpaceGuid.PcdRamLimitTo3GB|L"RamLimitTo3GB"|gConfigDxeF= ormSetGuid|0x0|1 + # # Common UEFI ones. # diff --git a/Platform/RaspberryPi/RaspberryPi.dec b/Platform/RaspberryPi/Ra= spberryPi.dec index bc378ffbfb8d..7f2c37ac9a7f 100644 --- a/Platform/RaspberryPi/RaspberryPi.dec +++ b/Platform/RaspberryPi/RaspberryPi.dec @@ -57,6 +57,8 @@ [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, Pc= dsDynamicEx] gRaspberryPiTokenSpaceGuid.PcdCustomCpuClock|0|UINT32|0x00000016 gRaspberryPiTokenSpaceGuid.PcdDisplayEnableScaledVModes|0|UINT8|0x000000= 17 gRaspberryPiTokenSpaceGuid.PcdDisplayEnableSShot|0|UINT32|0x00000018 + gRaspberryPiTokenSpaceGuid.PcdRamMoreThan3GB|0|UINT32|0x00000019 + gRaspberryPiTokenSpaceGuid.PcdRamLimitTo3GB|0|UINT32|0x0000001A =20 [PcdsFeatureFlag.common] - gRaspberryPiTokenSpaceGuid.PcdAcpiBasicMode|FALSE|BOOLEAN|0x00000019 + gRaspberryPiTokenSpaceGuid.PcdAcpiBasicMode|FALSE|BOOLEAN|0x0000001B --=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 (#55324): https://edk2.groups.io/g/devel/message/55324 Mute This Topic: https://groups.io/mt/71699476/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- From nobody Mon May 6 11:35:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+55325+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55325+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1583240918; cv=none; d=zohomail.com; s=zohoarc; b=PzulM+SZjzRDwik8tHLTqDmBSvmoab/Mh/btzmoHLJYdfJTrCAQkNFkzO0KniUt40mW+Obh50vq4zFjTeKcyog/XZzKYc9gupW0TXOE7nYCgkbIEpzTlSSptAX4xc6zZ4nuHy44xAiSL938VhKA8U0O667vSv4xAUbEyAPSITn0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583240918; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=vi0FpLGiXQRlTAR4XeoJo1qMNFYRaMD/xWImHkXPy54=; b=ZPrXgj0XheENzktPx8EVNLDNuNq7R/Gq/P0GvNt/XeaAg8dk+JoocUeFIwuaTkZihw3hPzLaNL5L36fObT122Py/bLkLIPmBe3qE+Dh1E52/Uj1L5wgDz8BclC63KksYkWv1s27nvznt+o6636259Mj75SzACsGqUZ/mj34VE68= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55325+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1583240918060804.731330516132; Tue, 3 Mar 2020 05:08:38 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id Q2UGYY1788612xTVyDGODyXK; Tue, 03 Mar 2020 05:08:36 -0800 X-Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by mx.groups.io with SMTP id smtpd.web10.3423.1583240916155715703 for ; Tue, 03 Mar 2020 05:08:36 -0800 X-Received: by mail-wr1-f66.google.com with SMTP id t11so4256808wrw.5 for ; Tue, 03 Mar 2020 05:08:35 -0800 (PST) X-Gm-Message-State: Rf7HtdoKiW4cUjH4QYKZkzs9x1787277AA= X-Google-Smtp-Source: ADFU+vtt3e6Egj1ndjJr6xytcH0GkAx6VtAaHrRdxniuCj6Jb9k7jmLp4LRSxYbxmI10UvA6lmVy3g== X-Received: by 2002:adf:cc85:: with SMTP id p5mr5347009wrj.196.1583240914205; Tue, 03 Mar 2020 05:08:34 -0800 (PST) X-Received: from localhost.localdomain ([84.203.56.244]) by smtp.gmail.com with ESMTPSA id j5sm3907620wmi.33.2020.03.03.05.08.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Mar 2020 05:08:33 -0800 (PST) From: "Pete Batard" To: devel@edk2.groups.io Cc: ard.biesheuvel@linaro.org, leif@nuviainc.com, philmd@redhat.com, awarkentin@vmware.com Subject: [edk2-devel][PATCH v2 5/6] Platform/RPi: Make Device Tree provision a runtime (BIOS setup) choice Date: Tue, 3 Mar 2020 13:08:13 +0000 Message-Id: <20200303130814.3092-6-pete@akeo.ie> In-Reply-To: <20200303130814.3092-1-pete@akeo.ie> References: <20200303130814.3092-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=1583240916; bh=QHBb2RL5FouFjsyjTWw1kuq/OKbJhPJIEywNr8KHMtE=; h=Cc:Date:From:Reply-To:Subject:To; b=GcnduFQ/Zq2JnhUrT6OfGUbE++gXFvy+TUC2peX74UjyHBl4p7LHM51goQGRbPKTzYe nHUfQ0BNpul9joHuW43FOH8hfqdFJwEmpwMCLawiUOU3PF/sw6wsCPYQTiPh5b8oIXrvA UBCbZCpfuozuOmzCf4sz9qVMZRJ48HUBHsM= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" With this and the previous commit, ACPI_BASIC_MODE_ENABLE becomes superfluous so remove it. New option defaults to enabled on Pi 3, disabled on Pi 4. Signed-off-by: Pete Batard Reviewed-by: Ard Biesheuvel --- Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c | 8 ++++++++ Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf | 1 + Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni | 5 +++++ Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr | 21 +++++++++++++= +++++++ Platform/RaspberryPi/Drivers/FdtDxe/FdtDxe.c | 5 +++++ Platform/RaspberryPi/Drivers/FdtDxe/FdtDxe.inf | 3 +++ Platform/RaspberryPi/RPi3/RPi3.dsc | 5 +++++ Platform/RaspberryPi/RPi4/RPi4.dsc | 10 +++++----- Platform/RaspberryPi/RPi4/RPi4.fdf | 2 -- Platform/RaspberryPi/RPi4/Readme.md | 15 ++++++-------- Platform/RaspberryPi/RaspberryPi.dec | 4 +--- 11 files changed, 60 insertions(+), 19 deletions(-) diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c b/Platform/= RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c index 964ca6d369da..ccac8daad402 100644 --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c @@ -151,6 +151,14 @@ SetupVariables ( PcdSet32 (PcdRamLimitTo3GB, 0); } =20 + Size =3D sizeof (UINT32); + Status =3D gRT->GetVariable (L"OptDeviceTree", + &gConfigDxeFormSetGuid, + NULL, &Size, &Var32); + if (EFI_ERROR (Status)) { + PcdSet32 (PcdOptDeviceTree, PcdGet32 (PcdOptDeviceTree)); + } + Size =3D sizeof (UINT32); Status =3D gRT->GetVariable (L"SdIsArasan", &gConfigDxeFormSetGuid, diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf b/Platfor= m/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf index 407aac89c7b3..736d49df562b 100644 --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf @@ -72,6 +72,7 @@ [Pcd] gRaspberryPiTokenSpaceGuid.PcdDebugShowUEFIExit gRaspberryPiTokenSpaceGuid.PcdDisplayEnableScaledVModes gRaspberryPiTokenSpaceGuid.PcdDisplayEnableSShot + gRaspberryPiTokenSpaceGuid.PcdOptDeviceTree gRaspberryPiTokenSpaceGuid.PcdRamMoreThan3GB gRaspberryPiTokenSpaceGuid.PcdRamLimitTo3GB =20 diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni b/Plat= form/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni index 830533a9dc49..2e79e322e558 100644 --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni @@ -46,6 +46,11 @@ #string STR_ADVANCED_3GB_OFF #language en-US "Disabled" #string STR_ADVANCED_3GB_ON #language en-US "Enabled" =20 +#string STR_ADVANCED_DT_PROMPT #language en-US "Device Tree" +#string STR_ADVANCED_DT_HELP #language en-US "Disable this option = to force OSes such as GNU/Linux to use ACPI" +#string STR_ADVANCED_DT_OFF #language en-US "Disabled (Force ACPI= )" +#string STR_ADVANCED_DT_ON #language en-US "Enabled" + /* * MMC/SD configuration. */ diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr b/Plat= form/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr index 483edd7459c5..d16058da4926 100644 --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr @@ -85,6 +85,14 @@ typedef struct { UINT32 Enabled; } ADVANCED_RAM_LIMIT_TO_3GB_VARSTORE_DATA; =20 +typedef struct { + /* + * 0 - Do not provide a Device Tree to the OS + * 1 - Provide a Device Tree to the OS + */ + UINT32 Enabled; +} ADVANCED_DEVICE_TREE_VARSTORE_DATA; + typedef struct { /* * 0 - Don't disable multi-block. @@ -162,6 +170,11 @@ formset name =3D RamLimitTo3GB, guid =3D CONFIGDXE_FORM_SET_GUID; =20 + efivarstore ADVANCED_DEVICE_TREE_VARSTORE_DATA, + attribute =3D EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME= _ACCESS | EFI_VARIABLE_NON_VOLATILE, + name =3D OptDeviceTree, + guid =3D CONFIGDXE_FORM_SET_GUID; + efivarstore MMC_DISMULTI_VARSTORE_DATA, attribute =3D EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME= _ACCESS | EFI_VARIABLE_NON_VOLATILE, name =3D MmcDisableMulti, @@ -279,6 +292,14 @@ formset option text =3D STRING_TOKEN(STR_ADVANCED_3GB_ON), value =3D= 1, flags =3D 0; endoneof; endif; + + oneof varid =3D OptDeviceTree.Enabled, + prompt =3D STRING_TOKEN(STR_ADVANCED_DT_PROMPT), + help =3D STRING_TOKEN(STR_ADVANCED_DT_HELP), + flags =3D NUMERIC_SIZE_4 | INTERACTIVE | RESET_REQUIRED, + option text =3D STRING_TOKEN(STR_ADVANCED_DT_OFF), value =3D 0= , flags =3D 0; + option text =3D STRING_TOKEN(STR_ADVANCED_DT_ON), value =3D 1,= flags =3D DEFAULT; + endoneof; endform; =20 form formid =3D 0x1003, diff --git a/Platform/RaspberryPi/Drivers/FdtDxe/FdtDxe.c b/Platform/Raspbe= rryPi/Drivers/FdtDxe/FdtDxe.c index eb8048930c30..e7143f57b3b6 100644 --- a/Platform/RaspberryPi/Drivers/FdtDxe/FdtDxe.c +++ b/Platform/RaspberryPi/Drivers/FdtDxe/FdtDxe.c @@ -443,6 +443,11 @@ FdtDxeInitialize ( UINT32 BoardRevision; BOOLEAN Internal; =20 + if (PcdGet32 (PcdOptDeviceTree) =3D=3D 0) { + DEBUG ((DEBUG_INFO, "Device Tree disabled per user configuration\n")); + return EFI_SUCCESS; + } + Status =3D gBS->LocateProtocol (&gRaspberryPiFirmwareProtocolGuid, NULL, (VOID**)&mFwProtocol); ASSERT_EFI_ERROR (Status); diff --git a/Platform/RaspberryPi/Drivers/FdtDxe/FdtDxe.inf b/Platform/Rasp= berryPi/Drivers/FdtDxe/FdtDxe.inf index bf9912b4f7d8..fc37353f883f 100644 --- a/Platform/RaspberryPi/Drivers/FdtDxe/FdtDxe.inf +++ b/Platform/RaspberryPi/Drivers/FdtDxe/FdtDxe.inf @@ -48,3 +48,6 @@ [Depex] =20 [FixedPcd] gRaspberryPiTokenSpaceGuid.PcdFdtBaseAddress + +[Pcd] + gRaspberryPiTokenSpaceGuid.PcdOptDeviceTree diff --git a/Platform/RaspberryPi/RPi3/RPi3.dsc b/Platform/RaspberryPi/RPi3= /RPi3.dsc index 48e1a32e1d24..91d5738afbc6 100644 --- a/Platform/RaspberryPi/RPi3/RPi3.dsc +++ b/Platform/RaspberryPi/RPi3/RPi3.dsc @@ -445,6 +445,11 @@ [PcdsDynamicHii.common.DEFAULT] gRaspberryPiTokenSpaceGuid.PcdRamMoreThan3GB|L"RamMoreThan3GB"|gConfigDx= eFormSetGuid|0x0|0 gRaspberryPiTokenSpaceGuid.PcdRamLimitTo3GB|L"RamLimitTo3GB"|gConfigDxeF= ormSetGuid|0x0|0 =20 + # + # Device Tree + # + gRaspberryPiTokenSpaceGuid.PcdOptDeviceTree|L"OptDeviceTree"|gConfigDxeF= ormSetGuid|0x0|1 + # # Common UEFI ones. # diff --git a/Platform/RaspberryPi/RPi4/RPi4.dsc b/Platform/RaspberryPi/RPi4= /RPi4.dsc index 3ce2c3e4d519..79295729f6ee 100644 --- a/Platform/RaspberryPi/RPi4/RPi4.dsc +++ b/Platform/RaspberryPi/RPi4/RPi4.dsc @@ -38,7 +38,6 @@ [Defines] DEFINE SECURE_BOOT_ENABLE =3D FALSE DEFINE INCLUDE_TFTP_COMMAND =3D FALSE DEFINE DEBUG_PRINT_ERROR_LEVEL =3D 0x8000004F - DEFINE ACPI_BASIC_MODE_ENABLE =3D FALSE =20 !ifndef TFA_BUILD_ARTIFACTS # @@ -271,8 +270,6 @@ [PcdsFeatureFlag.common] gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE =20 - gRaspberryPiTokenSpaceGuid.PcdAcpiBasicMode|$(ACPI_BASIC_MODE_ENABLE) - [PcdsFixedAtBuild.common] gEfiMdePkgTokenSpaceGuid.PcdMaximumUnicodeStringLength|1000000 gEfiMdePkgTokenSpaceGuid.PcdMaximumAsciiStringLength|1000000 @@ -483,6 +480,11 @@ [PcdsDynamicHii.common.DEFAULT] gRaspberryPiTokenSpaceGuid.PcdRamMoreThan3GB|L"RamMoreThan3GB"|gConfigDx= eFormSetGuid|0x0|0 gRaspberryPiTokenSpaceGuid.PcdRamLimitTo3GB|L"RamLimitTo3GB"|gConfigDxeF= ormSetGuid|0x0|1 =20 + # + # Device Tree + # + gRaspberryPiTokenSpaceGuid.PcdOptDeviceTree|L"OptDeviceTree"|gConfigDxeF= ormSetGuid|0x0|0 + # # Common UEFI ones. # @@ -575,9 +577,7 @@ [Components.common] =20 ArmPkg/Drivers/ArmGic/ArmGicDxe.inf Platform/RaspberryPi/Drivers/RpiFirmwareDxe/RpiFirmwareDxe.inf -!if $(ACPI_BASIC_MODE_ENABLE) =3D=3D FALSE Platform/RaspberryPi/Drivers/FdtDxe/FdtDxe.inf -!endif Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf ArmPkg/Drivers/TimerDxe/TimerDxe.inf MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf diff --git a/Platform/RaspberryPi/RPi4/RPi4.fdf b/Platform/RaspberryPi/RPi4= /RPi4.fdf index cb5e8e9ae92e..c38320350213 100644 --- a/Platform/RaspberryPi/RPi4/RPi4.fdf +++ b/Platform/RaspberryPi/RPi4/RPi4.fdf @@ -208,9 +208,7 @@ [FV.FvMain] =20 INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf INF Platform/RaspberryPi/Drivers/RpiFirmwareDxe/RpiFirmwareDxe.inf -!if $(ACPI_BASIC_MODE_ENABLE) =3D=3D FALSE INF Platform/RaspberryPi/Drivers/FdtDxe/FdtDxe.inf -!endif INF Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf INF MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf diff --git a/Platform/RaspberryPi/RPi4/Readme.md b/Platform/RaspberryPi/RPi= 4/Readme.md index 758d0124a6cf..21c9fd4f0a4a 100644 --- a/Platform/RaspberryPi/RPi4/Readme.md +++ b/Platform/RaspberryPi/RPi4/Readme.md @@ -16,9 +16,12 @@ Raspberry Pi is a trademark of the [Raspberry Pi Foundat= ion](https://www.raspber This firmware is still in development stage, meaning that it comes with the following __major__ limitations: =20 -- USB may only work in pre-OS phase at this stage due to nonstandard ECAM, - missing/incomplete ACPI tables as well as other factors. For Linux, using - the `ACPI_BASIC_MODE_ENABLE` build option may help. +- xHCI USB may only work in pre-OS phase due to nonstandard DMA constraint= s. + For 4 GB models running Linux, limiting the RAM to 3 GB should help. + The 3 GB limitation is currently enabled by default in the user settings. +- Device Tree boot of OSes such as Linux may not work at all. + For this reason, the provision of a Device Tree is disabled by default in + the user settings, in order to enforce ACPI boot. - Serial I/O from the OS may not work due to CPU throttling affecting the miniUART baudrate. This can be worked around by using the PL011 UART through the device tree overlays. @@ -27,12 +30,6 @@ following __major__ limitations: =20 Build instructions from the top level edk2-platforms Readme.md apply. =20 -The following additional build options are also available: -- `-D ACPI_BASIC_MODE_ENABLE=3D1`: Limits OS visible memory to 3 GB and fo= rces - ACPI (by disabling the Device Tree driver altogether). This may be requi= red - to boot Operating Systems such as Linux on account of the current PCIe/x= HCI - limitations. - # Booting the firmware =20 1. Format a uSD card as FAT16 or FAT32 diff --git a/Platform/RaspberryPi/RaspberryPi.dec b/Platform/RaspberryPi/Ra= spberryPi.dec index 7f2c37ac9a7f..25058ccc7783 100644 --- a/Platform/RaspberryPi/RaspberryPi.dec +++ b/Platform/RaspberryPi/RaspberryPi.dec @@ -57,8 +57,6 @@ [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, Pc= dsDynamicEx] gRaspberryPiTokenSpaceGuid.PcdCustomCpuClock|0|UINT32|0x00000016 gRaspberryPiTokenSpaceGuid.PcdDisplayEnableScaledVModes|0|UINT8|0x000000= 17 gRaspberryPiTokenSpaceGuid.PcdDisplayEnableSShot|0|UINT32|0x00000018 + gRaspberryPiTokenSpaceGuid.PcdOptDeviceTree|1|UINT32|0x0000001B gRaspberryPiTokenSpaceGuid.PcdRamMoreThan3GB|0|UINT32|0x00000019 gRaspberryPiTokenSpaceGuid.PcdRamLimitTo3GB|0|UINT32|0x0000001A - -[PcdsFeatureFlag.common] - gRaspberryPiTokenSpaceGuid.PcdAcpiBasicMode|FALSE|BOOLEAN|0x0000001B --=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 (#55325): https://edk2.groups.io/g/devel/message/55325 Mute This Topic: https://groups.io/mt/71699477/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- From nobody Mon May 6 11:35:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+55326+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55326+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1583240920; cv=none; d=zohomail.com; s=zohoarc; b=BCzLow/DB683IXebiCFf8pFrbx3wJYBBatLHZV5FtS5KwMBui+WaXKtvicdjdzPKP0JhrDdSxbrT7EP8t7SB9A/x07O/Z3VtlOZFVorma7mFX02dDr0MNZ2anzMnDFy+TK08rwcGqj4uCreznBKJoJWB6qEqb4IrZacsuH6chZk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583240920; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=mT+2z+hyEjG9tXS9Au5ReX2O0D53Tcd8yobDVLNbJPI=; b=QK8Pc+1Hs3NprOi2mowc7EBm5bsAo9dnscmXOvsinYr0VomsW7t3JxCc92yQK9CLBeO/zaep1a7cGbLp0kJL58Jd5SvBCLj+Wuki20aqvYaOH38KtGyXhszHe7O5POBkss9Bbn1kKJyI8YDAZdPpEU0eUtXIw3tYFCdTtdYw40k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55326+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1583240920587794.093779971075; Tue, 3 Mar 2020 05:08:40 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id QeYcYY1788612x6a01FEzb8I; Tue, 03 Mar 2020 05:08:38 -0800 X-Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by mx.groups.io with SMTP id smtpd.web09.3316.1583240917408042694 for ; Tue, 03 Mar 2020 05:08:37 -0800 X-Received: by mail-wr1-f43.google.com with SMTP id z15so4297322wrl.1 for ; Tue, 03 Mar 2020 05:08:37 -0800 (PST) X-Gm-Message-State: Jk8eaS9TglbqkcM7SR13Xgenx1787277AA= X-Google-Smtp-Source: ADFU+vtFP5naI7ONSYo8GeJ5gt8Sl0YiRKj8w64i7mrJsbnS7lgJEj42it4L64yoMJluxNe4rXOg/w== X-Received: by 2002:a05:6000:104f:: with SMTP id c15mr5209167wrx.376.1583240915491; Tue, 03 Mar 2020 05:08:35 -0800 (PST) X-Received: from localhost.localdomain ([84.203.56.244]) by smtp.gmail.com with ESMTPSA id j5sm3907620wmi.33.2020.03.03.05.08.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Mar 2020 05:08:34 -0800 (PST) From: "Pete Batard" To: devel@edk2.groups.io Cc: ard.biesheuvel@linaro.org, leif@nuviainc.com, philmd@redhat.com, awarkentin@vmware.com Subject: [edk2-devel][PATCH v2 6/6] Platform/RPi/ConfigDxe: Improve RPi configuration form Date: Tue, 3 Mar 2020 13:08:14 +0000 Message-Id: <20200303130814.3092-7-pete@akeo.ie> In-Reply-To: <20200303130814.3092-1-pete@akeo.ie> References: <20200303130814.3092-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=1583240918; bh=EGFzMFYfosC/HKZwdUdL3Wgfzyzu6A8Fm8Ehhx6N/Js=; h=Cc:Date:From:Reply-To:Subject:To; b=iZ1FxL5k3ZZZ/the2cgEW0rvhRVMhiu+r1+L+/+wHmmouaoq6dVO4/aocuRWOcWGCcq jOybNUhQajVQIqK9fnFhN/8bzLuNfexwiWU/HmTG899Xg7627kGyKRIj8gTK2K08+A08t B6nUgQk60T6MqzJpl6V0QkpjsLyfTVpI6Ic= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Group all SD/MMC settings under the SD/MMC form. Make CPU settings more prominent. Harmonise form titles and text content. Reorder forms in the order they are most likely to be queried. Signed-off-by: Pete Batard Reviewed-by: Andrei Warkentin Reviewed-by: Ard Biesheuvel --- Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni | 24 +++++----- Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr | 50 ++++++++++---= ------- 2 files changed, 37 insertions(+), 37 deletions(-) diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni b/Plat= form/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni index 2e79e322e558..77eda96d8136 100644 --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni @@ -14,11 +14,11 @@ #string STR_FORM_SET_TITLE_HELP #language en-US "Press to configu= re system settings." =20 /* - * Chipset config. + * Chipset configuration. */ =20 -#string STR_CHIPSET_FORM_TITLE #language en-US "Chipset Configuration" -#string STR_CHIPSET_FORM_SUBTITLE #language en-US "Note: OS may override= settings when booted." +#string STR_CHIPSET_FORM_TITLE #language en-US "CPU Configuration" +#string STR_CHIPSET_FORM_SUBTITLE #language en-US "Note: OS may override= settings." =20 #string STR_CHIPSET_CLOCK_CPU_PROMPT #language en-US "CPU Clock" #string STR_CHIPSET_CLOCK_CPU_HELP #language en-US "CPU Speed" @@ -30,11 +30,6 @@ #string STR_CHIPSET_CUSTOM_CPU_CLOCK_PROMPT #language en-US "CPU Clock Rat= e (MHz)" #string STR_CHIPSET_CUSTOM_CPU_CLOCK_HELP #language en-US "Adjust the CP= U speed.\nMin value: 100 MHz\nMax value: 1600 MHz\n\nWarning: Overclocking = can make the system unbootable!" =20 -#string STR_CHIPSET_SD_PROMPT #language en-US "uSD Routing" -#string STR_CHIPSET_SD_HELP #language en-US "Choose host controll= er to drive uSD slot" -#string STR_CHIPSET_SD_SDHOST #language en-US "Broadcom SDHOST" -#string STR_CHIPSET_SD_ARASAN #language en-US "Arasan SDHCI" - /* * Advanced configuration. */ @@ -55,8 +50,13 @@ * MMC/SD configuration. */ =20 -#string STR_MMC_FORM_TITLE #language en-US "SD/MMC Tweaks" -#string STR_MMC_FORM_SUBTITLE #language en-US "Note: UEFI only, OS will= override settings when booted." +#string STR_MMC_FORM_TITLE #language en-US "SD/MMC Configuration" +#string STR_MMC_FORM_SUBTITLE #language en-US "Note: UEFI only, OS may = override settings." + +#string STR_MMC_SD_PROMPT #language en-US "uSD Routing" +#string STR_MMC_SD_HELP #language en-US "Choose host controller t= o drive uSD slot" +#string STR_MMC_SD_SDHOST #language en-US "Broadcom SDHOST" +#string STR_MMC_SD_ARASAN #language en-US "Arasan SDHCI" =20 #string STR_MMC_DISMULTI_PROMPT #language en-US "Multi-Block Support" #string STR_MMC_DISMULTI_HELP #language en-US "Use CMD18/CMD25 for tran= sfers when possible" @@ -84,7 +84,7 @@ * Display settings. */ =20 -#string STR_DISPLAY_FORM_TITLE #language en-US "Display" +#string STR_DISPLAY_FORM_TITLE #language en-US "Display Configuration" #string STR_DISPLAY_FORM_SUBTITLE #language en-US "UEFI video driver set= tings" =20 #string STR_DISPLAY_VMODES_640_PROMPT #language en-US "Virtual 640x480" @@ -109,7 +109,7 @@ /* * Debugging settings go here. */ -#string STR_DEBUG_FORM_TITLE #language en-US "Debugging" +#string STR_DEBUG_FORM_TITLE #language en-US "Debugging Configurati= on" #string STR_DEBUG_FORM_SUBTITLE #language en-US "For UEFI/OS Developer= s" =20 #string STR_DEBUG_JTAG_PROMPT #language en-US "JTAG Routing" diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr b/Plat= form/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr index d16058da4926..9c2fd64a8e27 100644 --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr @@ -65,14 +65,6 @@ typedef struct { UINT32 Clock; } CHIPSET_CUSTOM_CPU_CLOCK_VARSTORE_DATA; =20 -typedef struct { - /* - * 0 - uSD slot routed to Broadcom SDHOST. - * 1 - uSD slot routed to Arasan SDHCI. - */ - UINT32 Routing; -} CHIPSET_SD_VARSTORE_DATA; - typedef struct { /* * Always set by ConfigDxe prior to HII init to reflect @@ -93,6 +85,14 @@ typedef struct { UINT32 Enabled; } ADVANCED_DEVICE_TREE_VARSTORE_DATA; =20 +typedef struct { + /* + * 0 - uSD slot routed to Broadcom SDHOST. + * 1 - uSD slot routed to Arasan SDHCI. + */ + UINT32 Routing; +} MMC_SD_VARSTORE_DATA; + typedef struct { /* * 0 - Don't disable multi-block. @@ -155,11 +155,6 @@ formset name =3D CustomCpuClock, guid =3D CONFIGDXE_FORM_SET_GUID; =20 - efivarstore CHIPSET_SD_VARSTORE_DATA, - attribute =3D EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME= _ACCESS | EFI_VARIABLE_NON_VOLATILE, - name =3D SdIsArasan, - guid =3D CONFIGDXE_FORM_SET_GUID; - efivarstore ADVANCED_RAM_MORE_THAN_3GB_VARSTORE_DATA, attribute =3D EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME= _ACCESS | EFI_VARIABLE_NON_VOLATILE, name =3D RamMoreThan3GB, @@ -175,6 +170,11 @@ formset name =3D OptDeviceTree, guid =3D CONFIGDXE_FORM_SET_GUID; =20 + efivarstore MMC_SD_VARSTORE_DATA, + attribute =3D EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME= _ACCESS | EFI_VARIABLE_NON_VOLATILE, + name =3D SdIsArasan, + guid =3D CONFIGDXE_FORM_SET_GUID; + efivarstore MMC_DISMULTI_VARSTORE_DATA, attribute =3D EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME= _ACCESS | EFI_VARIABLE_NON_VOLATILE, name =3D MmcDisableMulti, @@ -228,6 +228,10 @@ formset prompt =3D STRING_TOKEN(STR_CHIPSET_FORM_TITLE), help =3D STRING_TOKEN(STR_NULL_STRING); =20 + goto 0x1004, + prompt =3D STRING_TOKEN(STR_DISPLAY_FORM_TITLE), + help =3D STRING_TOKEN(STR_NULL_STRING); + goto 0x1006, prompt =3D STRING_TOKEN(STR_ADVANCED_FORM_TITLE), help =3D STRING_TOKEN(STR_NULL_STRING); @@ -236,10 +240,6 @@ formset prompt =3D STRING_TOKEN(STR_MMC_FORM_TITLE), help =3D STRING_TOKEN(STR_NULL_STRING); =20 - goto 0x1004, - prompt =3D STRING_TOKEN(STR_DISPLAY_FORM_TITLE), - help =3D STRING_TOKEN(STR_NULL_STRING); - goto 0x1005, prompt =3D STRING_TOKEN(STR_DEBUG_FORM_TITLE), help =3D STRING_TOKEN(STR_NULL_STRING); @@ -269,14 +269,6 @@ formset default =3D 600, endnumeric; endif; - - oneof varid =3D SdIsArasan.Routing, - prompt =3D STRING_TOKEN(STR_CHIPSET_SD_PROMPT), - help =3D STRING_TOKEN(STR_CHIPSET_SD_HELP), - flags =3D NUMERIC_SIZE_4 | INTERACTIVE | RESET_REQUIRED, - option text =3D STRING_TOKEN(STR_CHIPSET_SD_ARASAN), value =3D= 1, flags =3D 0; - option text =3D STRING_TOKEN(STR_CHIPSET_SD_SDHOST), value =3D= 0, flags =3D DEFAULT; - endoneof; endform; =20 form formid =3D 0x1006, @@ -306,6 +298,14 @@ formset title =3D STRING_TOKEN(STR_MMC_FORM_TITLE); subtitle text =3D STRING_TOKEN(STR_MMC_FORM_SUBTITLE); =20 + oneof varid =3D SdIsArasan.Routing, + prompt =3D STRING_TOKEN(STR_MMC_SD_PROMPT), + help =3D STRING_TOKEN(STR_MMC_SD_HELP), + flags =3D NUMERIC_SIZE_4 | INTERACTIVE | RESET_REQUIRED, + option text =3D STRING_TOKEN(STR_MMC_SD_ARASAN), value =3D 1, = flags =3D 0; + option text =3D STRING_TOKEN(STR_MMC_SD_SDHOST), value =3D 0, = flags =3D DEFAULT; + endoneof; + oneof varid =3D MmcDisableMulti.DisableMulti, prompt =3D STRING_TOKEN(STR_MMC_DISMULTI_PROMPT), help =3D STRING_TOKEN(STR_MMC_DISMULTI_HELP), --=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 (#55326): https://edk2.groups.io/g/devel/message/55326 Mute This Topic: https://groups.io/mt/71699478/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-