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 15C19AC1AA8 for ; Sat, 20 Jul 2024 19:55:06 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=xqfbTy8vlJfunrN0NKmw4tVUceoShR2ZZOUcwXgaM5o=; 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=1721505306; v=1; b=WG5DmzHPj+gW1MkTkRkuxEjMJnuo4ZgZSG1wr7+UAW3SXO5f/sY12D8+YJEow2hEZUwdNFUQ vVd6ls55080UoGGqzi1FiS+wsrtdiTClrjZ0RtgdYzt6DqR+XWTsmnGJxEFew7UaQGCwD835ZRG lD6ljzZWZLzEs3nhDNP7Yv+WRpVkkK0JERZC5QPbg5+CbiJBfGYH0KN0xTwXzSHmZAd2iOEb8gv SKbKhPPuw6/MmprI2hJoKXuYWI7NGVkf03AEvwgRjkM/Xz9G/63kPDoec0KNXVf3fvEuisqdfNp rnMgjZIN/2IgF+sw3yS7hCST4uppt/QeeJfiAeuJhsK9Q== X-Received: by 127.0.0.2 with SMTP id hLD8YY7687511xxyPrrsB81S; Sat, 20 Jul 2024 12:55:05 -0700 X-Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.148.174]) by mx.groups.io with SMTP id smtpd.web10.12740.1721505295218034972 for ; Sat, 20 Jul 2024 12:54:55 -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 46KGl6U2018429; Sat, 20 Jul 2024 12:54:53 -0700 X-Received: from dc6wp-exch02.marvell.com ([4.21.29.225]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 40gakjrmte-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 20 Jul 2024 12:54:53 -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, 20 Jul 2024 12:53:28 -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, 20 Jul 2024 12:53:28 -0700 X-Received: from MRVL-5Lp9he46Ey.marvell.com (unknown [10.193.3.166]) by maili.marvell.com (Postfix) with ESMTP id 185123F705A; Sat, 20 Jul 2024 12:53:28 -0700 (PDT) From: "Narinder Dhillon" To: CC: , , , , Narinder Dhillon Subject: [edk2-devel] [edk2-platforms PATCH v4 2/7] Silicon/Marvell: Odyssey SmcLib Date: Sat, 20 Jul 2024 12:53:18 -0700 Message-ID: <20240720195323.130619-3-ndhillon@marvell.com> In-Reply-To: <20240720195323.130619-1-ndhillon@marvell.com> References: <20240720195323.130619-1-ndhillon@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: R9Zs7j16oEFr5jyn86mvsMlvcL5-L868 X-Proofpoint-ORIG-GUID: R9Zs7j16oEFr5jyn86mvsMlvcL5-L868 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, 20 Jul 2024 12:54:55 -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: WY5MDSSEEqziWzC39aBNnrYRx7686176AA= 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=WG5DmzHP; 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 (#119994): https://edk2.groups.io/g/devel/message/119994 Mute This Topic: https://groups.io/mt/107457447/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-