From: "Abdul Lateef Attar via groups.io" <AbdulLateef.Attar=amd.com@groups.io>
To: devel@edk2.groups.io, ndhillon@marvell.com
Cc: quic_llindhol@quicinc.com, mw@semihalf.com, sbalcerak@marvell.com
Subject: Re: [edk2-devel] [edk2-platforms PATCH v3 2/7] Silicon/Marvell: Odyssey SmcLib
Date: Fri, 08 Mar 2024 07:29:08 -0800 [thread overview]
Message-ID: <fcaead6c-9906-4782-b750-f0d2c12fa885@amd.com> (raw)
In-Reply-To: <20240118011817.4348-3-ndhillon@marvell.com>
[-- Attachment #1: Type: text/plain, Size: 4349 bytes --]
Hi Narinder,
Patch looks good with minor comments inline.
Thanks
AbduL
On 18-01-2024 06:48, Narinder Dhillon via groups.io wrote:
> Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
>
>
> From: Narinder Dhillon<ndhillon@marvell.com>
>
> This patch provides SMC call needed by Odyssey to determine size
> of available memory.
>
> Signed-off-by: Narinder Dhillon<ndhillon@marvell.com>
> ---
> 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 <IndustryStandard/SmcLib.h>
> +#include <Library/ArmSmcLib.h> // 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
[Abdul] New library class is defined here, but didnt the corresponding
entry in MarvellSiliconPkg.dec file, there should be an entry in .dec file
SmcLib|Include/IndustryStandard/SmcLib.h
Also its good to have this patch first, patch 1/7 consumes this library
class.
> +
> +[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__
[Abdul] Coding standard prefers the macro should start with alphabet,
like 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 (#116524): https://edk2.groups.io/g/devel/message/116524
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]
-=-=-=-=-=-=-=-=-=-=-=-
[-- Attachment #2: Type: text/html, Size: 5702 bytes --]
next prev parent reply other threads:[~2024-03-08 15:29 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-18 1:18 [edk2-devel] [edk2-platforms PATCH v3 0/7] Silicon/Marvell/OdysseyPkg Narinder Dhillon
2024-01-18 1:18 ` [edk2-devel] [edk2-platforms PATCH v3 1/7] Silicon/Marvell: New Marvell Odyssey processor Narinder Dhillon
2024-01-18 1:18 ` [edk2-devel] [edk2-platforms PATCH v3 2/7] Silicon/Marvell: Odyssey SmcLib Narinder Dhillon
2024-03-08 15:29 ` Abdul Lateef Attar via groups.io [this message]
2024-01-18 1:18 ` [edk2-devel] [edk2-platforms PATCH v3 3/7] Silicon/Marvell: Odyssey watchdog driver Narinder Dhillon
2024-01-18 1:18 ` [edk2-devel] [edk2-platforms PATCH v3 4/7] Silicon/Marvell: Device tree driver Narinder Dhillon
2024-01-18 1:18 ` [edk2-devel] [edk2-platforms PATCH v3 5/7] Silicon/Marvell: Driver to publish device tree Narinder Dhillon
2024-03-08 15:57 ` Abdul Lateef Attar via groups.io
2024-01-18 1:18 ` [edk2-devel] [edk2-platforms PATCH v3 6/7] Silicon/Marvell: Command to dump " Narinder Dhillon
2024-01-18 1:18 ` [edk2-devel] [edk2-platforms PATCH v3 7/7] Silicon/Marvell: Odyssey project description files Narinder Dhillon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fcaead6c-9906-4782-b750-f0d2c12fa885@amd.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox