From nobody Tue Feb 10 10:54:48 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+112781+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+112781+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=marvell.com ARC-Seal: i=1; a=rsa-sha256; t=1703120076; cv=none; d=zohomail.com; s=zohoarc; b=G6v/RwEOI4ED7HxpLds9f97QZzECv3EKnj7ZeVZ396fRrZKheGJKkBdBuU5aGZMmeSPWVAz0zVvmWaIP0LTr8qxqP/HpGBELTyiFW7+Ycm0SlvHr5Ki8DzMkkThK/LKET9duy47Yix0dtgk71zyiueUxPCQei1bOtd7BxcFx1Aw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1703120076; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=PQqRsH0JDzPTBUxKGRQkPatLDAHTLSruJkqwab8g9zQ=; b=ZcsVoiLPaoZKFjCtwtW+OBlHAclZ0e5ElCKkRL8IzSFofPFn6l73hgw1DuZvOeah0LzSfVhGATIiPUUNQPLhaZGZhgWKliR7/EyCFVbRLRrXYitxscnH6Fp7K6pRT1INK91rggp2XZ74ZgAtn2F8K/kVibsTYWivKpSUyCqRr6A= 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+112781+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 1703120076314523.301765322534; Wed, 20 Dec 2023 16:54:36 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=06qACvXLgIV5wsMMJItaoPRKVDb0khqHbHWQNfCV+AM=; 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:Content-Type; s=20140610; t=1703120076; v=1; b=C96wAZWA9Zjbv6IUqsrVmpket6MVpOXcdaU3xaqWU/iZv/MZbdbC8wNdI2dOewvNuKbdErWr 20pV/z0HS1OGXhCURqXyWbc5rm+2Y5bJnaQva+GwySctFjLXZO4FxuZoej8hn9nct7tzhIkwrco Cykqc3xBvG1nEEqcjikP3+mM= X-Received: by 127.0.0.2 with SMTP id cYpqYY1788612xFeZ9FeNJLm; Wed, 20 Dec 2023 16:54:36 -0800 X-Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.148.174]) by mx.groups.io with SMTP id smtpd.web10.41713.1703120075502527572 for ; Wed, 20 Dec 2023 16:54:35 -0800 X-Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BKH2Ed6004000; Wed, 20 Dec 2023 16:54:35 -0800 X-Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3v3tbcvg8e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 20 Dec 2023 16:54:34 -0800 (PST) X-Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Wed, 20 Dec 2023 16:54:32 -0800 X-Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Wed, 20 Dec 2023 16:54:32 -0800 X-Received: from MRVL-5Lp9he46Ey.marvell.com (unknown [10.193.15.34]) by maili.marvell.com (Postfix) with ESMTP id 473975C68E1; Wed, 20 Dec 2023 16:54:32 -0800 (PST) From: "Narinder Dhillon" To: CC: , , , Narinder Dhillon Subject: [edk2-devel] [edk2-platforms PATCH v2 3/8] Silicon/Marvell: Odyssey SmcLib Date: Wed, 20 Dec 2023 16:54:22 -0800 Message-ID: <20231221005427.13932-4-ndhillon@marvell.com> In-Reply-To: <20231221005427.13932-1-ndhillon@marvell.com> References: <20231221005427.13932-1-ndhillon@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: RNMiVDpd0Vd_Nny0h_8g_Ai4hTyM32qt X-Proofpoint-GUID: RNMiVDpd0Vd_Nny0h_8g_Ai4hTyM32qt 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,ndhillon@marvell.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: I9WvWnMgVCQEPqB0st3v8T7Wx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1703120077757100010 Content-Type: text/plain; charset="utf-8" From: Narinder Dhillon This patch provides SMC call needed by Odyssey to determine available memory size. Signed-off-by: Narinder Dhillon --- Silicon/Marvell/Library/SmcLib/SmcLib.c | 24 +++++++++++++++ Silicon/Marvell/Library/SmcLib/SmcLib.inf | 29 +++++++++++++++++++ .../Include/Library/SmcLib.h | 28 ++++++++++++++++++ 3 files changed, 81 insertions(+) create mode 100644 Silicon/Marvell/Library/SmcLib/SmcLib.c create mode 100644 Silicon/Marvell/Library/SmcLib/SmcLib.inf create mode 100644 Silicon/Marvell/MarvellSiliconPkg/Include/Library/SmcLi= b.h diff --git a/Silicon/Marvell/Library/SmcLib/SmcLib.c b/Silicon/Marvell/Libr= ary/SmcLib/SmcLib.c new file mode 100644 index 0000000000..20a2fb2017 --- /dev/null +++ b/Silicon/Marvell/Library/SmcLib/SmcLib.c @@ -0,0 +1,24 @@ +/** @file +* +* SPDX-License-Identifier: BSD-2-Clause-Patent +* https://spdx.org/licenses +* +* Copyright (C) 2023 Marvell +* +* Source file for Marvell SMC Interface +* +**/ + +#include +#include // ArmCallSmc + +UINTN SmcGetRamSize ( IN UINTN Node ) +{ + ARM_SMC_ARGS ArmSmcArgs; + + ArmSmcArgs.Arg0 =3D MV_SMC_ID_DRAM_SIZE; + ArmSmcArgs.Arg1 =3D Node; + ArmCallSmc (&ArmSmcArgs); + + return ArmSmcArgs.Arg0; +} diff --git a/Silicon/Marvell/Library/SmcLib/SmcLib.inf b/Silicon/Marvell/Li= brary/SmcLib/SmcLib.inf new file mode 100644 index 0000000000..7fc1085b85 --- /dev/null +++ b/Silicon/Marvell/Library/SmcLib/SmcLib.inf @@ -0,0 +1,29 @@ +#/** @file +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# https://spdx.org/licenses +# +# Copyright (C) 2023 Marvell +# +# Marvell SMC Interface library +# +#**/ + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D SmcLib + FILE_GUID =3D fee427a7-816a-4636-bb81-a640c8288f28 + MODULE_TYPE =3D DXE_DRIVER + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D SmcLib + +[Sources] + SmcLib.c + +[Packages] + ArmPkg/ArmPkg.dec + MdePkg/MdePkg.dec + Silicon/Marvell/MarvellSiliconPkg/MarvellSiliconPkg.dec + +[LibraryClasses] + ArmSmcLib diff --git a/Silicon/Marvell/MarvellSiliconPkg/Include/Library/SmcLib.h b/S= ilicon/Marvell/MarvellSiliconPkg/Include/Library/SmcLib.h new file mode 100644 index 0000000000..f2d0bed356 --- /dev/null +++ b/Silicon/Marvell/MarvellSiliconPkg/Include/Library/SmcLib.h @@ -0,0 +1,28 @@ +/** @file +* +* SPDX-License-Identifier: BSD-2-Clause-Patent +* https://spdx.org/licenses +* +* Copyright (C) 2023 Marvell +* +* Header file for for Marvell SMC Interface +* +**/ + +#ifndef __SMCLIB_H__ +#define __SMCLIB_H__ + +/* SMC function IDs for Marvell Service queries */ + +#define MV_SMC_ID_CALL_COUNT 0xc200ff00 +#define MV_SMC_ID_UID 0xc200ff01 + +#define MV_SMC_ID_VERSION 0xc200ff03 + +/* x1 - node number */ +#define MV_SMC_ID_DRAM_SIZE 0xc2000301 + + +UINTN SmcGetRamSize (IN UINTN Node); + +#endif --=20 2.34.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 (#112781): https://edk2.groups.io/g/devel/message/112781 Mute This Topic: https://groups.io/mt/103292511/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-