From: Leif Lindholm <leif.lindholm@linaro.org>
To: Marcin Wojtas <mw@semihalf.com>
Cc: edk2-devel@lists.01.org, ard.biesheuvel@linaro.org,
nadavh@marvell.com, jsd@semihalf.com, jaz@semihalf.com,
kostap@marvell.com
Subject: Re: [platforms: PATCH v2 2/4] Marvell/Library: Introduce common header for the SMC ID's
Date: Tue, 22 Jan 2019 17:35:59 +0000 [thread overview]
Message-ID: <20190122173559.7nuidsdtoxoiexag@bivouac.eciton.net> (raw)
In-Reply-To: <1548120742-11928-3-git-send-email-mw@semihalf.com>
On Tue, Jan 22, 2019 at 02:32:20AM +0100, Marcin Wojtas wrote:
> Marvell firmware allows to use SiP services other than
> for ComPhy handling. In order to avoid spreading the SMC
> ID's definitions across many files, introduce common header
> for that purpose.
>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Marcin Wojtas <mw@semihalf.com>
> ---
> Silicon/Marvell/Include/Library/MvSmc.h | 23 ++++++++++++++++++++
Final nitpick: This isn't a library.
IndustryStandard is probably a better approximation. (You are
effectively extending ArmPkg/Include/IndustryStandard/ArmStdSmc.h with
vendor-specific bits.)
With that change:
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
/
Leif
> Silicon/Marvell/Library/ComPhyLib/ComPhySipSvc.h | 8 +++----
> Silicon/Marvell/Library/ComPhyLib/ComPhyCp110.c | 14 ++++++------
> 3 files changed, 33 insertions(+), 12 deletions(-)
> create mode 100644 Silicon/Marvell/Include/Library/MvSmc.h
>
> diff --git a/Silicon/Marvell/Include/Library/MvSmc.h b/Silicon/Marvell/Include/Library/MvSmc.h
> new file mode 100644
> index 0000000..2d1542a
> --- /dev/null
> +++ b/Silicon/Marvell/Include/Library/MvSmc.h
> @@ -0,0 +1,23 @@
> +/**
> +*
> +* Copyright (C) 2019, Marvell International Ltd. and its affiliates.
> +*
> +* This program and the accompanying materials are licensed and made available
> +* under the terms and conditions of the BSD License which accompanies this
> +* distribution. The full text of the license may be found at
> +* http://opensource.org/licenses/bsd-license.php
> +*
> +* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
> +* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
> +*
> +**/
> +
> +#ifndef __MV_SMC_H__
> +#define __MV_SMC_H__
> +
> +/* Marvell 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
> +
> +#endif //__MV_SMC_H__
> diff --git a/Silicon/Marvell/Library/ComPhyLib/ComPhySipSvc.h b/Silicon/Marvell/Library/ComPhyLib/ComPhySipSvc.h
> index d156af6..f6ac65b 100644
> --- a/Silicon/Marvell/Library/ComPhyLib/ComPhySipSvc.h
> +++ b/Silicon/Marvell/Library/ComPhyLib/ComPhySipSvc.h
> @@ -35,16 +35,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> #ifndef __COMPHY_SIP_SVC_H__
> #define __COMPHY_SIP_SVC_H__
>
> +#include <Library/MvSmc.h>
> +
> /*
> * All values in this file are defined externally and used
> * for the SerDes configuration via SiP services.
> */
>
> -/* Firmware related definitions used for SMC calls */
> -#define MV_SIP_COMPHY_POWER_ON 0x82000001
> -#define MV_SIP_COMPHY_POWER_OFF 0x82000002
> -#define MV_SIP_COMPHY_PLL_LOCK 0x82000003
> -
> +/* Helper macros for passing ComPhy parameters to the EL3 */
> #define COMPHY_FW_MODE_FORMAT(mode) (mode << 12)
> #define COMPHY_FW_FORMAT(mode, idx, speeds) \
> ((mode << 12) | (idx << 8) | (speeds << 2))
> diff --git a/Silicon/Marvell/Library/ComPhyLib/ComPhyCp110.c b/Silicon/Marvell/Library/ComPhyLib/ComPhyCp110.c
> index 2abb006..4f85676 100755
> --- a/Silicon/Marvell/Library/ComPhyLib/ComPhyCp110.c
> +++ b/Silicon/Marvell/Library/ComPhyLib/ComPhyCp110.c
> @@ -163,7 +163,7 @@ ComPhySataPowerUp (
>
> ComPhySataMacPowerDown (Desc[ChipId].SoC->AhciBaseAddress);
>
> - Status = ComPhySmc (MV_SIP_COMPHY_POWER_ON,
> + Status = ComPhySmc (MV_SMC_ID_COMPHY_POWER_ON,
> ComPhyBase,
> Lane,
> COMPHY_FW_FORMAT (COMPHY_SATA_MODE,
> @@ -175,7 +175,7 @@ ComPhySataPowerUp (
>
> ComPhySataPhyPowerUp (Desc[ChipId].SoC->AhciBaseAddress);
>
> - Status = ComPhySmc (MV_SIP_COMPHY_PLL_LOCK,
> + Status = ComPhySmc (MV_SMC_ID_COMPHY_PLL_LOCK,
> ComPhyBase,
> Lane,
> COMPHY_FW_FORMAT (COMPHY_SATA_MODE,
> @@ -234,7 +234,7 @@ ComPhyCp110Init (
> case COMPHY_TYPE_PCIE1:
> case COMPHY_TYPE_PCIE2:
> case COMPHY_TYPE_PCIE3:
> - Status = ComPhySmc (MV_SIP_COMPHY_POWER_ON,
> + Status = ComPhySmc (MV_SMC_ID_COMPHY_POWER_ON,
> PtrChipCfg->ComPhyBaseAddr,
> Lane,
> COMPHY_FW_PCIE_FORMAT (PcieWidth,
> @@ -269,7 +269,7 @@ ComPhyCp110Init (
> break;
> case COMPHY_TYPE_USB3_HOST0:
> case COMPHY_TYPE_USB3_HOST1:
> - Status = ComPhySmc (MV_SIP_COMPHY_POWER_ON,
> + Status = ComPhySmc (MV_SMC_ID_COMPHY_POWER_ON,
> PtrChipCfg->ComPhyBaseAddr,
> Lane,
> COMPHY_FW_MODE_FORMAT (COMPHY_USB3H_MODE));
> @@ -278,7 +278,7 @@ ComPhyCp110Init (
> case COMPHY_TYPE_SGMII1:
> case COMPHY_TYPE_SGMII2:
> case COMPHY_TYPE_SGMII3:
> - Status = ComPhySmc (MV_SIP_COMPHY_POWER_ON,
> + Status = ComPhySmc (MV_SMC_ID_COMPHY_POWER_ON,
> PtrChipCfg->ComPhyBaseAddr,
> Lane,
> COMPHY_FW_FORMAT (COMPHY_SGMII_MODE,
> @@ -286,7 +286,7 @@ ComPhyCp110Init (
> PtrComPhyMap->Speed));
> break;
> case COMPHY_TYPE_SFI:
> - Status = ComPhySmc (MV_SIP_COMPHY_POWER_ON,
> + Status = ComPhySmc (MV_SMC_ID_COMPHY_POWER_ON,
> PtrChipCfg->ComPhyBaseAddr,
> Lane,
> COMPHY_FW_FORMAT (COMPHY_SFI_MODE,
> @@ -295,7 +295,7 @@ ComPhyCp110Init (
> break;
> case COMPHY_TYPE_RXAUI0:
> case COMPHY_TYPE_RXAUI1:
> - Status = ComPhySmc (MV_SIP_COMPHY_POWER_ON,
> + Status = ComPhySmc (MV_SMC_ID_COMPHY_POWER_ON,
> PtrChipCfg->ComPhyBaseAddr,
> Lane,
> COMPHY_FW_MODE_FORMAT (COMPHY_RXAUI_MODE));
> --
> 2.7.4
>
next prev parent reply other threads:[~2019-01-22 17:36 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-22 1:32 [platforms: PATCH v2 0/4] Armada7k8k memory handling update Marcin Wojtas
2019-01-22 1:32 ` [platforms: PATCH v2 1/4] Marvell/Armada7k8k: Shift PEI stack base Marcin Wojtas
2019-01-22 17:26 ` Leif Lindholm
2019-01-22 18:26 ` Marcin Wojtas
2019-01-22 19:06 ` Leif Lindholm
2019-01-22 19:27 ` Marcin Wojtas
2019-01-22 20:26 ` Leif Lindholm
2019-01-22 20:56 ` Marcin Wojtas
2019-01-22 21:09 ` Leif Lindholm
2019-01-23 8:28 ` Marcin Wojtas
2019-01-23 9:42 ` Leif Lindholm
2019-01-23 9:45 ` Marcin Wojtas
2019-01-22 1:32 ` [platforms: PATCH v2 2/4] Marvell/Library: Introduce common header for the SMC ID's Marcin Wojtas
2019-01-22 17:35 ` Leif Lindholm [this message]
2019-01-22 18:15 ` Marcin Wojtas
2019-01-22 1:32 ` [platforms: PATCH v2 3/4] Marvell/Library: ArmadaSoCDescLib: Add North Bridge description Marcin Wojtas
2019-01-22 17:38 ` Leif Lindholm
2019-01-22 1:32 ` [platforms: PATCH v2 4/4] Marvell/Armada7k8k: Read DRAM settings from ARM-TF Marcin Wojtas
2019-01-22 17:39 ` Leif Lindholm
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=20190122173559.7nuidsdtoxoiexag@bivouac.eciton.net \
--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