From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id D218FD8062F for ; Thu, 11 Jan 2024 00:04:22 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=RWQYTlCxHXorc+rTdiFa7ymDNu6fxNQLkRfuUr9fSKs=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1704931461; v=1; b=KgF6ETHOmw6AmzulKXQNKmHoKZXfveEIVgF/Fv5d5JOFNvDcYys+lnJoBPeHgc2l4ajY2xKx hudTnOy5Thlm8vQ2e0Gd5480vpah4m1GzKQREnDy4D+NAMh/9Xm0hvhVhQc+tV+t+LlVCZJIRc2 t9BD2fMwMKVQg5h5zsf7a+7U= X-Received: by 127.0.0.2 with SMTP id m2YZYY7687511x5lWPlJTWFM; Wed, 10 Jan 2024 16:04:21 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.9455.1704931457340761689 for ; Wed, 10 Jan 2024 16:04:17 -0800 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C82651570; Wed, 10 Jan 2024 16:05:02 -0800 (PST) X-Received: from u200865.usa.arm.com (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B34B23F7B4; Wed, 10 Jan 2024 16:04:16 -0800 (PST) From: "Jeremy Linton" To: devel@edk2.groups.io Cc: ardb+tianocore@kernel.org, quic_llindhol@quicinc.com, Jeremy Linton Subject: [edk2-devel] [PATCH 5/7] Platform/RaspberryPi: Add SPI/GPIO to memory map Date: Wed, 10 Jan 2024 18:04:08 -0600 Message-ID: <20240111000412.2734985-6-jeremy.linton@arm.com> In-Reply-To: <20240111000412.2734985-1-jeremy.linton@arm.com> References: <20240111000412.2734985-1-jeremy.linton@arm.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: 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,jeremy.linton@arm.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 0XbfxSacWvyyqzY2dyTIhyocx7686176AA= Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=KgF6ETHO; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=arm.com (policy=none) A large reason for using the SPI flash on this platform is that it can be updated without OS interference at rutime. In order for that to happen we need both the SPI, as well as the GPIO which is used to change the pinmux from the PWM device to SPI added to the UEFI memory map as being used by the runtime service. Signed-off-by: Jeremy Linton --- .../RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c b/Platfor= m/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c index 151f3cd801..377ef438ff 100644 --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c @@ -504,6 +504,22 @@ ApplyVariables ( DEBUG ((DEBUG_INFO, "Current CPU speed is %u MHz\n", Rate / FREQ_1_M= HZ)); } =20 + if (mModelFamily =3D=3D 4) { + Status =3D gDS->AddMemorySpace (EfiGcdMemoryTypeMemoryMappedIo, BCM2= 836_SPI0_BASE_ADDRESS, + SIZE_4KB, EFI_MEMORY_UC | EFI_MEMORY_R= UNTIME); + ASSERT_EFI_ERROR (Status); + Status =3D gDS->SetMemorySpaceAttributes (BCM2836_SPI0_BASE_ADDRESS, + SIZE_4KB, EFI_MEMORY_UC|EFI_= MEMORY_RUNTIME); + + Status =3D gDS->AddMemorySpace (EfiGcdMemoryTypeMemoryMappedIo, GPIO= _BASE_ADDRESS, + SIZE_4KB, EFI_MEMORY_UC | EFI_MEMORY_R= UNTIME); + ASSERT_EFI_ERROR (Status); + Status =3D gDS->SetMemorySpaceAttributes (GPIO_BASE_ADDRESS, + SIZE_4KB, EFI_MEMORY_UC|EFI_= MEMORY_RUNTIME); + + ASSERT_EFI_ERROR (Status); + } + if (mModelFamily >=3D 4 && PcdGet32 (PcdRamMoreThan3GB) !=3D 0 && PcdGet32 (PcdRamLimitTo3GB) =3D=3D 0) { UINT64 SystemMemorySize; --=20 2.43.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113554): https://edk2.groups.io/g/devel/message/113554 Mute This Topic: https://groups.io/mt/103653091/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-