From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: None (no SPF record) identity=mailfrom; client-ip=2a00:1450:4864:20::144; helo=mail-lf1-x144.google.com; envelope-from=mw@semihalf.com; receiver=edk2-devel@lists.01.org Received: from mail-lf1-x144.google.com (mail-lf1-x144.google.com [IPv6:2a00:1450:4864:20::144]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B12B1211B5A34 for ; Mon, 28 Jan 2019 01:45:42 -0800 (PST) Received: by mail-lf1-x144.google.com with SMTP id f5so11299766lfc.13 for ; Mon, 28 Jan 2019 01:45:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=UD3ZFBe37P6TVNrnuiYzWnLIJ7gxi9x0v5jSIc+is1I=; b=t6+Wl94N29PfMNB50KrahjVQ5oIz0uhD7Cs/J6pTtZgWyuFaMHQ6tWlG6w0AscLSht ZPJvCVCkfKUVMUiAij0QfI0LldtLVd5v/tSHoSDZBJyPtQhd6UJohRK35s3G8wjH80PH WjjMcyUn22KDouH3cX7zI5usMrrIe0IxYb2w9jXsQbbD7zGvFz90pQetsogCiJA917mg X5bY3otGzv0+L13pJ7vHkn7aymEk7aZue9pYzhHrmr/zzN8qU9qUi4xzyrsgxOe7TCI1 oMvKv6w0I3QbOW1vuo123+uXNmGcp8UbKZ2MFCCRUaBUMOvAkph3lsG8s06tZUKbT8rs pWuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=UD3ZFBe37P6TVNrnuiYzWnLIJ7gxi9x0v5jSIc+is1I=; b=Cdnz9g/FDJ6QYFwJCdxDJJP0RUJewcB+QxsGlFXpuEkKMx7pamxzqr3Ox7EpNrylNG SLJkCX8ZLPRopOfoHt5vQtTqd7rRkZSmY+eRfUCVcUrhz2oV6o+1+5SL//zvJKBPRH78 fyFO/pSV6MO5LQZjWx0gR78I8CGe69e9htEIXt9SmcLtJPzEOJEUA5rdtV6xC31gPInc 7YhpiV25RMbUSnVke6x8oPEC7osDcv1uyFmcIKE4gfL4hz6W/970DmSM4eW474FuBOXz kqo9PdqErWMcmId3auawi4LXexEqfg2JO6PuiKzqeEqSAg9LYhs+L9fOQxLRk1uuGGC0 lAgQ== X-Gm-Message-State: AJcUukdzbIheoVQ3S68+FjmPguYX3yTfS3ubcJ89q0U0M7Gr8XuYXrGd sGUHfBUr1CTjgg7xWVuufRW7XjQJPhY= X-Google-Smtp-Source: ALg8bN4/g1yw1doprDULp53OUaYSFSK6U5azJQPPmpimpqMKky7xLMhbVylfADsGlPY4CIACEhnDCA== X-Received: by 2002:a19:c70a:: with SMTP id x10mr7937399lff.88.1548668740493; Mon, 28 Jan 2019 01:45:40 -0800 (PST) Received: from gilgamesh.semihalf.com (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id 10sm2895213ljr.4.2019.01.28.01.45.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 28 Jan 2019 01:45:39 -0800 (PST) From: Marcin Wojtas To: edk2-devel@lists.01.org Cc: leif.lindholm@linaro.org, ard.biesheuvel@linaro.org, nadavh@marvell.com, mw@semihalf.com, jsd@semihalf.com, jaz@semihalf.com, kostap@marvell.com Date: Mon, 28 Jan 2019 10:45:13 +0100 Message-Id: <1548668715-15042-4-git-send-email-mw@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1548668715-15042-1-git-send-email-mw@semihalf.com> References: <1548668715-15042-1-git-send-email-mw@semihalf.com> Subject: [platforms: PATCH v3 3/5] Marvell/Library: Introduce common header for the SMC ID's X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:43 -0000 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 --- Silicon/Marvell/Include/IndustryStandard/MvSmc.h | 23 ++++++++++++++++++++ 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/IndustryStandard/MvSmc.h diff --git a/Silicon/Marvell/Include/IndustryStandard/MvSmc.h b/Silicon/Marvell/Include/IndustryStandard/MvSmc.h new file mode 100644 index 0000000..2d1542a --- /dev/null +++ b/Silicon/Marvell/Include/IndustryStandard/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..9fd6602 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 + /* * 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