From nobody Wed Feb 11 01:09:09 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+105770+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+105770+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1686043299; cv=none; d=zohomail.com; s=zohoarc; b=Lef9Tmfbo65+vAj6lqZxlveaJxt1B/8DqEeToyD7NhzaoeO5tKBAkySqw9OHCuamhRyBwMDq3b7/iIXNB/UTEYmjNplFxo19zPvdVt40tYlljqJwvV10nuSOwz184vZEeYZnsQRtjvLNa2uDA3IZUrlPkt4y8WpjdBzP7RzmFLU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1686043299; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=tDG1C9be7Ow4Tv4+z8xYMArcofaeLLKx6erJuz9NQ6Y=; b=fqGxbQcPjlwVInBPphFvNwpAvaBu6YcOoLVAqaRZyFHOaZS5Lt2GYA8Ecg3KkWKPCrydubHKJGWlJfHSIaRo8Akm+m+zRt/jbLfs+jLXmTNgkjZNNyAzOaLFFv4Wsdu7S1tvMdZ4vWrZvDgT+7ROYEkskbA5Gdb3rG/kXwhRcrM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+105770+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1686043299326783.2162900773051; Tue, 6 Jun 2023 02:21:39 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id ndVUYY1788612xF7n1BCteu0; Tue, 06 Jun 2023 02:21:38 -0700 X-Received: from muminek.juszkiewicz.com.pl (muminek.juszkiewicz.com.pl [213.251.184.221]) by mx.groups.io with SMTP id smtpd.web10.4461.1686043297551382821 for ; Tue, 06 Jun 2023 02:21:37 -0700 X-Received: from localhost (localhost [127.0.0.1]) by muminek.juszkiewicz.com.pl (Postfix) with ESMTP id AE3A4260214; Tue, 6 Jun 2023 11:21:35 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at juszkiewicz.com.pl X-Received: from muminek.juszkiewicz.com.pl ([127.0.0.1]) by localhost (muminek.juszkiewicz.com.pl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Ho4imZurEnwi; Tue, 6 Jun 2023 11:21:33 +0200 (CEST) X-Received: from applejack.lan (83.21.93.182.ipv4.supernova.orange.pl [83.21.93.182]) by muminek.juszkiewicz.com.pl (Postfix) with ESMTPSA id F05E2260698; Tue, 6 Jun 2023 11:21:31 +0200 (CEST) From: "Marcin Juszkiewicz" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Leif Lindholm , Graeme Gregory , Marcin Juszkiewicz Subject: [edk2-devel] [PATCH edk2-platforms v2 2/2] Platform/SbsaQemu: read GIC base from TF-A Date: Tue, 6 Jun 2023 11:21:25 +0200 Message-Id: <20230606092125.513420-3-marcin.juszkiewicz@linaro.org> In-Reply-To: <20230606092125.513420-1-marcin.juszkiewicz@linaro.org> References: <20230606092125.513420-1-marcin.juszkiewicz@linaro.org> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,marcin.juszkiewicz@linaro.org X-Gm-Message-State: a5vyvwwveSd8DrkWF8PGmOzSx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1686043298; bh=wSdNA5QKJHGmMKBmApjJcRklYOUXgG6pfLxRNh3Z0rk=; h=Cc:Date:From:Reply-To:Subject:To; b=tSqR9AunHScfTNqqFSRLnMh9Uji+T1SaewQDbcqzZAOjYKkaEdhhERHEjjLGOJ2HqnZ UDRhywWID2eKQkEkKum4gxv62T2svImkYcUANPkO03O/7GLtVJk5q/YuOk3sGzoQkes4o WwDf1LQWimAL70DpK3fgUR0lY23FW9QB16g= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1686043301461100001 Content-Type: text/plain; charset="utf-8" Qemu has versioning for sbsa-ref platform. TF-A reads data from provided DeviceTree and provides as SMC. This change adds reading GIC base addresses into EDK2. Signed-off-by: Marcin Juszkiewicz --- .../SbsaQemuPlatformDxe.inf | 5 +++++ .../Include/IndustryStandard/SbsaQemuSmc.h | 1 + .../SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.c | 18 ++++++++++++++++++ 3 files changed, 24 insertions(+) diff --git a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlat= formDxe.inf b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPla= tformDxe.inf index cb1826979bd6..545794a8c7ff 100644 --- a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe= .inf +++ b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe= .inf @@ -40,6 +40,11 @@ [Pcd] =20 gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformVersionMajor gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformVersionMinor + + gArmTokenSpaceGuid.PcdGicDistributorBase + gArmTokenSpaceGuid.PcdGicRedistributorsBase + + [Depex] TRUE =20 diff --git a/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuSmc.h b= /Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuSmc.h index 5a179f69b629..24ae6e390abd 100644 --- a/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuSmc.h +++ b/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuSmc.h @@ -9,3 +9,4 @@ #include =20 #define SIP_SVC_VERSION SMC_SIP_FUNCTION_ID(1) +#define SIP_SVC_GET_GIC SMC_SIP_FUNCTION_ID(100) diff --git a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlat= formDxe.c b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatf= ormDxe.c index 515d18564bd0..2c4ee54c3e6b 100644 --- a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe= .c +++ b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe= .c @@ -70,5 +70,23 @@ InitializeSbsaQemuPlatformDxe ( Arg1 =3D PcdGet32 (PcdPlatformVersionMinor); =20 DEBUG ((DEBUG_INFO, "Platform version: %d.%d\n", Arg0, Arg1)); + + SmcResult =3D ArmCallSmc0 (SIP_SVC_GET_GIC, &Arg0, &Arg1, NULL); + if (SmcResult =3D=3D SMC_ARCH_CALL_SUCCESS) + { + Result =3D PcdSet64S (PcdGicDistributorBase, Arg0); + ASSERT_RETURN_ERROR (Result); + Result =3D PcdSet64S (PcdGicRedistributorsBase, Arg1); + ASSERT_RETURN_ERROR (Result); + } + + Arg0 =3D PcdGet64 (PcdGicDistributorBase); + + DEBUG ((DEBUG_INFO, "GICD base: 0x%x\n", Arg0)); + + Arg0 =3D PcdGet64 (PcdGicRedistributorsBase); + + DEBUG ((DEBUG_INFO, "GICR base: 0x%x\n", Arg0)); + return EFI_SUCCESS; } --=20 2.40.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 (#105770): https://edk2.groups.io/g/devel/message/105770 Mute This Topic: https://groups.io/mt/99359660/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-