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 D32C1D8081E for ; Thu, 18 Jan 2024 01:18:32 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=f6I+FhlKv6SZWe3B7aDwc1hBUV6w8mDrgISQ1ARa36o=; 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=1705540711; v=1; b=QhWoMH7z8oChoB7Mi140HB4Qv+CykMxmIP6G3SS8O5jNvdGfhQNqQABwVGxbeMEoo9YbDI/H t9QZYgMzvN567ckHLWW/AbhvGl3zFBV9Ne5CMWWvIvu/KxQMLHwdDGAOqHWOYN1BFnFcZHIEadP jqW+iS+fs3aei9oeuqU8HAbY= X-Received: by 127.0.0.2 with SMTP id YFXpYY7687511xoAP9Qki8o9; Wed, 17 Jan 2024 17:18:31 -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.927.1705540709673689451 for ; Wed, 17 Jan 2024 17:18:29 -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 40HHSY3d029567; Wed, 17 Jan 2024 17:18:29 -0800 X-Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3vpaskb4ru-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 17 Jan 2024 17:18:29 -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, 17 Jan 2024 17:18:27 -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, 17 Jan 2024 17:18:27 -0800 X-Received: from MRVL-5Lp9he46Ey.marvell.com (unknown [10.85.176.100]) by maili.marvell.com (Postfix) with ESMTP id 4D75D3F7084; Wed, 17 Jan 2024 17:18:27 -0800 (PST) From: "Narinder Dhillon" To: CC: , , , Narinder Dhillon Subject: [edk2-devel] [edk2-platforms PATCH v3 2/7] Silicon/Marvell: Odyssey SmcLib Date: Wed, 17 Jan 2024 17:18:12 -0800 Message-ID: <20240118011817.4348-3-ndhillon@marvell.com> In-Reply-To: <20240118011817.4348-1-ndhillon@marvell.com> References: <20240118011817.4348-1-ndhillon@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: 3X_ztjtuIgX1LIEoTKrST4pw2l4oku8y X-Proofpoint-GUID: 3X_ztjtuIgX1LIEoTKrST4pw2l4oku8y 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: ZnWSb6Klro1cheSe56ogaCAux7686176AA= 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=20140610 header.b=QhWoMH7z; 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=marvell.com (policy=none) 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..f2d0bed356 --- /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 (#113973): https://edk2.groups.io/g/devel/message/113973 Mute This Topic: https://groups.io/mt/103800151/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-