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::143; helo=mail-lf1-x143.google.com; envelope-from=mw@semihalf.com; receiver=edk2-devel@lists.01.org Received: from mail-lf1-x143.google.com (mail-lf1-x143.google.com [IPv6:2a00:1450:4864:20::143]) (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 F3EA121962301 for ; Mon, 21 Jan 2019 17:32:49 -0800 (PST) Received: by mail-lf1-x143.google.com with SMTP id l10so16835077lfh.9 for ; Mon, 21 Jan 2019 17:32:49 -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=halLvqNlxywshwLMjKzeY8dv74OF/eu9nsyX05QBZzw=; b=d0hLRh3iu6AuiGZzQz2M1+EQ82WC/fabx39yqjDLBxB8/Je3nb+m0EG06pKGwDJEOv dSJ2KVGma7AZGrnO/wUn+1qJ/QZkaEL7KCGIP/7uXGCfSDHSvcIJVPhgnYhp5BqnObnT cy3qK8ITgF3XXHtzycpftIlnJ4626NQ6qON4L4wapaqAuZ99Bl2Jyg0dADTmzOR1/dCX 6wfs/tJ10Ktofnm+WSgIpTVNASJj6zMjklFFrjXIBJuyLiwxSNQ3AZw27WVr/VXQsPuF rusipLiedhTd6K2Cq0x5sb6fErOb79mhTgnY1uiIMAm4o90YRMdw9PDRD+s3HpJGQC7H N4ww== 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=halLvqNlxywshwLMjKzeY8dv74OF/eu9nsyX05QBZzw=; b=mWQ8ksOhjKYU8qbp6lQ8PXZ9aJbESRhBQIaHLridNd7tbgdY1T9qOR2qHxJl2hvhxK pOggkXbiKn9jf2AXwC6iSgi/QBgLyRMKcUBGuBWS/l+AgZ99zGhwrVwrrqpjWnUmiDDQ pXaoTuuSsAx8XTZF2VEFG1Vg03zm2FKlMgPpfCvKbBofYM0M/ZSZ3XPWqW5Gid3STkjk ijfBnzEyo+ZJCS1nyNEn5pBPrupf0jeS2nJmuna65TP0pWKvG41hCsuQ8rCbdHhjSzRu OgRqLfWseNOdGjodHVsZmHbTl+2I1ckD7cKV1C3hWGKQdaRu7+6maGkGW2BMY6SCEiRP KW4g== X-Gm-Message-State: AJcUukeb+o0riU/VgNiDzbT8oYLql6I63foG7wP1gVGjqR3eL8ewx9HZ Df+VTvzP9gQucGqzPImfsS0grtv8AXo= X-Google-Smtp-Source: ALg8bN6dsrFJuaIEIiJCLt5LpoMusyJC3+8axFhR3+2C5j5rzNpC5t4V/6gzCNe8vjJGvTIeJlTHNA== X-Received: by 2002:a19:1a14:: with SMTP id a20mr18829506lfa.1.1548120767858; Mon, 21 Jan 2019 17:32:47 -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 b21sm2524463lfi.7.2019.01.21.17.32.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 21 Jan 2019 17:32:47 -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: Tue, 22 Jan 2019 02:32:20 +0100 Message-Id: <1548120742-11928-3-git-send-email-mw@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1548120742-11928-1-git-send-email-mw@semihalf.com> References: <1548120742-11928-1-git-send-email-mw@semihalf.com> Subject: [platforms: PATCH v2 2/4] 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: Tue, 22 Jan 2019 01:32:50 -0000 X-List-Received-Date: Tue, 22 Jan 2019 01:32:50 -0000 X-List-Received-Date: Tue, 22 Jan 2019 01:32:50 -0000 X-List-Received-Date: Tue, 22 Jan 2019 01:32:50 -0000 X-List-Received-Date: Tue, 22 Jan 2019 01:32:50 -0000 X-List-Received-Date: Tue, 22 Jan 2019 01:32:50 -0000 X-List-Received-Date: Tue, 22 Jan 2019 01:32:50 -0000 X-List-Received-Date: Tue, 22 Jan 2019 01:32:50 -0000 X-List-Received-Date: Tue, 22 Jan 2019 01:32:50 -0000 X-List-Received-Date: Tue, 22 Jan 2019 01:32:50 -0000 X-List-Received-Date: Tue, 22 Jan 2019 01:32:50 -0000 X-List-Received-Date: Tue, 22 Jan 2019 01:32:50 -0000 X-List-Received-Date: Tue, 22 Jan 2019 01:32:50 -0000 X-List-Received-Date: Tue, 22 Jan 2019 01:32:50 -0000 X-List-Received-Date: Tue, 22 Jan 2019 01:32:50 -0000 X-List-Received-Date: Tue, 22 Jan 2019 01:32:50 -0000 X-List-Received-Date: Tue, 22 Jan 2019 01:32:50 -0000 X-List-Received-Date: Tue, 22 Jan 2019 01:32:50 -0000 X-List-Received-Date: Tue, 22 Jan 2019 01:32:50 -0000 X-List-Received-Date: Tue, 22 Jan 2019 01:32:50 -0000 X-List-Received-Date: Tue, 22 Jan 2019 01:32:50 -0000 X-List-Received-Date: Tue, 22 Jan 2019 01:32:50 -0000 X-List-Received-Date: Tue, 22 Jan 2019 01:32:50 -0000 X-List-Received-Date: Tue, 22 Jan 2019 01:32:50 -0000 X-List-Received-Date: Tue, 22 Jan 2019 01:32:50 -0000 X-List-Received-Date: Tue, 22 Jan 2019 01:32:50 -0000 X-List-Received-Date: Tue, 22 Jan 2019 01:32:50 -0000 X-List-Received-Date: Tue, 22 Jan 2019 01:32:50 -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/Library/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/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 + /* * 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