From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id 5809DAC1A65 for ; Sat, 4 May 2024 21:32:40 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=eHKZKqtC2ZzZZPA687f3s2hnvPc6wpHGNFDyPGsRS6c=; 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:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20240206; t=1714858358; v=1; b=LxNYcOEui9+oi7y8TDRLlBH2Ta2pbv5wxLzQMDdPbHeIxQ+PmW5znuiX39xntTkeKlJaAdg+ W0xGaItMxVJJpUMKJKtf/99LOxiFetMYo6S09PoPlDQSxFIDW7JlBvfipKjOegOM9t1ao6WTrX6 d5TaGVY+X3oa1DktiretkyV2RGJwYobidfgo8mzNvOz12uRQiA+sMTUQ0oNHwoTpi67SgYHOeBO Qmqb8u9iVa65zKvBhbHJ6+OUr/8bHpxlUz9pxo8HX7OYoB2QHznieNBHioi35nj5uqfjLKyV3uC jtNFUc45XtAAhizJrJMCA243XlNrfwx4AGbFsHOZFMvBQ== X-Received: by 127.0.0.2 with SMTP id vRjBYY7687511xAWc5O3Wzpr; Sat, 04 May 2024 14:32:38 -0700 X-Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.148.174]) by mx.groups.io with SMTP id smtpd.web11.6860.1714858357937594202 for ; Sat, 04 May 2024 14:32:37 -0700 X-Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 444LSExP026658; Sat, 4 May 2024 14:32:36 -0700 X-Received: from dc6wp-exch02.marvell.com ([4.21.29.225]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3xwjck8x85-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 04 May 2024 14:32:36 -0700 (PDT) X-Received: from DC6WP-EXCH02.marvell.com (10.76.176.209) by DC6WP-EXCH02.marvell.com (10.76.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sat, 4 May 2024 14:32:34 -0700 X-Received: from maili.marvell.com (10.69.176.80) by DC6WP-EXCH02.marvell.com (10.76.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Sat, 4 May 2024 14:32:34 -0700 X-Received: from MRVL-5Lp9he46Ey.marvell.com (unknown [10.193.11.115]) by maili.marvell.com (Postfix) with ESMTP id 1F8333F708C; Sat, 4 May 2024 14:32:34 -0700 (PDT) From: "Narinder Dhillon" To: CC: , , , , Narinder Dhillon Subject: [edk2-devel] [edk2-platforms PATCH v4 2/7] Silicon/Marvell: Odyssey SmcLib Date: Sat, 4 May 2024 14:32:25 -0700 Message-ID: <20240504213230.31976-3-ndhillon@marvell.com> In-Reply-To: <20240504213230.31976-1-ndhillon@marvell.com> References: <20240504213230.31976-1-ndhillon@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: YO3-E1whrQc9uQcypjjpZV86Wj6cU9F7 X-Proofpoint-ORIG-GUID: YO3-E1whrQc9uQcypjjpZV86Wj6cU9F7 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 Resent-Date: Sat, 04 May 2024 14:32:38 -0700 Resent-From: ndhillon@marvell.com Reply-To: devel@edk2.groups.io,ndhillon@marvell.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: F2p1j3cu338JWhv89dqRLwEkx7686176AA= Content-Transfer-Encoding: 8bit Content-Type: text/plain X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=LxNYcOEu; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=marvell.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io From: Narinder Dhillon This patch provides SMC call needed by Odyssey to determine size of available memory. Signed-off-by: Narinder Dhillon --- Silicon/Marvell/Library/SmcLib/SmcLib.c | 24 +++++++++++++++ Silicon/Marvell/Library/SmcLib/SmcLib.inf | 29 +++++++++++++++++++ .../Include/IndustryStandard/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/IndustryStandard/SmcLib.h diff --git a/Silicon/Marvell/Library/SmcLib/SmcLib.c b/Silicon/Marvell/Library/SmcLib/SmcLib.c new file mode 100644 index 0000000000..0280983dd0 --- /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 = MV_SMC_ID_DRAM_SIZE; + ArmSmcArgs.Arg1 = Node; + ArmCallSmc (&ArmSmcArgs); + + return ArmSmcArgs.Arg0; +} diff --git a/Silicon/Marvell/Library/SmcLib/SmcLib.inf b/Silicon/Marvell/Library/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 = 0x00010005 + BASE_NAME = SmcLib + FILE_GUID = fee427a7-816a-4636-bb81-a640c8288f28 + MODULE_TYPE = DXE_DRIVER + VERSION_STRING = 1.0 + LIBRARY_CLASS = 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/IndustryStandard/SmcLib.h b/Silicon/Marvell/MarvellSiliconPkg/Include/IndustryStandard/SmcLib.h new file mode 100644 index 0000000000..5251f4cd00 --- /dev/null +++ b/Silicon/Marvell/MarvellSiliconPkg/Include/IndustryStandard/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 -- 2.34.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#118567): https://edk2.groups.io/g/devel/message/118567 Mute This Topic: https://groups.io/mt/105913424/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-