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 45FBA7803D2 for ; Fri, 12 Jan 2024 10:48:34 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=Sr/YZDRqMVrRdQd75d3AZN7EpyDNOusna33krzs/5C8=; c=relaxed/simple; d=groups.io; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:To:Cc:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Transfer-Encoding; s=20140610; t=1705056512; v=1; b=pcEcxVFLK9G+Dr9wRr7IRERnnINyJsi3pRcI1DomhMAxNFg4OQJsPb829+5nbuiQ1syT/2AB M/8cFo9TmnDj3AbMg7Heo9QoiwyxXK0DyOd8lNJhiQWSrAmtfeFJHIZQ2rshElvaIXaxdpmEb62 72u605667UpW8MkpTGWWT4ag= X-Received: by 127.0.0.2 with SMTP id Eu4IYY7687511x2znlai1aZl; Fri, 12 Jan 2024 02:48:32 -0800 X-Received: from mail-oo1-f43.google.com (mail-oo1-f43.google.com [209.85.161.43]) by mx.groups.io with SMTP id smtpd.web10.4551.1705056511906452107 for ; Fri, 12 Jan 2024 02:48:32 -0800 X-Received: by mail-oo1-f43.google.com with SMTP id 006d021491bc7-5989d8decbfso1337025eaf.2 for ; Fri, 12 Jan 2024 02:48:31 -0800 (PST) X-Gm-Message-State: JcTxGaICslskId8t8EwmILLhx7686176AA= X-Google-Smtp-Source: AGHT+IEuxB+GZJzcRQDVstx1P2Unc8jjdN/DfB519vn95FC4VbhB/VmtshJF9AaGcsUsvGPn37dHE3fn2hj11NdULUc= X-Received: by 2002:a05:6820:22a6:b0:591:256f:e7fc with SMTP id ck38-20020a05682022a600b00591256fe7fcmr712674oob.15.1705056511219; Fri, 12 Jan 2024 02:48:31 -0800 (PST) MIME-Version: 1.0 References: <20231221005427.13932-1-ndhillon@marvell.com> <20231221005427.13932-4-ndhillon@marvell.com> In-Reply-To: <20231221005427.13932-4-ndhillon@marvell.com> From: "Marcin Wojtas via groups.io" Date: Fri, 12 Jan 2024 11:48:21 +0100 Message-ID: Subject: Re: [edk2-devel] [edk2-platforms PATCH v2 3/8] Silicon/Marvell: Odyssey SmcLib To: devel@edk2.groups.io, ndhillon@marvell.com Cc: quic_llindhol@quicinc.com, marcin.s.wojtas@gmail.com, sbalcerak@marvell.com 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,mw@semihalf.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=pcEcxVFL; dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io +marcin.s.wojtas@gmail.com Hi Narinder, czw., 21 gru 2023 o 01:54 Narinder Dhillon napisa=C5= =82(a): > > 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/Smc= Lib.h > > diff --git a/Silicon/Marvell/Library/SmcLib/SmcLib.c b/Silicon/Marvell/Li= brary/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/= 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 =3D 0x00010005 > + BASE_NAME =3D SmcLib > + FILE_GUID =3D fee427a7-816a-4636-bb81-a640c8288f2= 8 > + 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= /Silicon/Marvell/MarvellSiliconPkg/Include/Library/SmcLib.h This file should be placed in Silicon/Marvell/MarvellSiliconPkg/Include/IndustryStandard and: - either renamed to e.g. OdysseySmcLib.h - or its contents merged with existing Silicon/Marvell/MarvellSiliconPkg/Include/IndustryStandard/MvSmc.h The SMC ID's are not conflicting, so the latter could be pretty clean, assuming comments above the #define groups: /* Marvell Armada/Cn913x SiP services SMC ID's */ #define MV_SMC_ID_COMPHY_POWER_ON 0x82000001 #define MV_SMC_ID_COMPHY_POWER_OFF 0x82000002 #define MV_SMC_ID_COMPHY_PLL_LOCK 0x82000003 ... /* Marvell Odyssey SiP services SMC ID's */ #define MV_SMC_ID_CALL_COUNT 0xc200ff00 ... Best regards, Marcin > 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 > -- > 2.34.1 > > > >=20 > > -=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 (#113709): https://edk2.groups.io/g/devel/message/113709 Mute This Topic: https://groups.io/mt/103292511/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-