From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=pass header.i=@semihalf-com.20150623.gappssmtp.com header.s=20150623 header.b=rw0Wq4E8; spf=none, err=SPF record not found (domain: semihalf.com, ip: 209.85.208.193, mailfrom: mw@semihalf.com) Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) by groups.io with SMTP; Thu, 02 May 2019 16:50:39 -0700 Received: by mail-lj1-f193.google.com with SMTP id z26so3800885ljj.2 for ; Thu, 02 May 2019 16:50:38 -0700 (PDT) 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=dX8ZI7XyrJT99901uKBXQTdKNexhN/hXvzrvhMIU8fw=; b=rw0Wq4E87PdLi0jNLMkHjsm9/bR74MFT3RGG/QWPK8RmmJQZ3d8lfDsecTNta9pJiJ Zdch47CVFBKVHEcBlTho1SUvHk7oxg49soGJgQE2LNNJ0GBqz0+YyMd6s2GUrtcXaXSE ObmLd4wYh8TXGJPGXzSO1ns8Qob9Z0Xvs2FEPnEp+TCQVvcbOM/mP+dFpsph3w4gSyGF UNYvTVaoBBEZhcQ8fbU8ghxXLPbIQdEC57z5jUk34CZrqRCTRD3oaZ//UY1oN0GYQ+mI J/z9AYksh1ZaY2iUJn6t+1RQxJX64wbYrUHb9+k5IN2tTQMCQB1m7AokJ64IttZR/Ozn 7eag== 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=dX8ZI7XyrJT99901uKBXQTdKNexhN/hXvzrvhMIU8fw=; b=PnT3u5+IOHHey+v7LKqy0P8qrA+aPc6Rd3i581yAl5r9oBd68sJkDmx0ICwYVr8NPa qA82uWDVUxSOtFpXIr8F060ZKRZVqpAwjBkqRNG8gsNUnVUpa7Lrw6F7sgHGFGpL8nOY liMTJMSrsXQSdnlW6yU4ry5zCWmvJhaVe5IL99HstMJJjC3/bMRd9EX67QgFULTeuNEV LNF2XMA0Ix2bJQy0p8SH8h1HrItqojDq2PadSO4sn2+z995wZIf+l1S7OjBYaKHRHtYl biczs58NvIFY1kX7pBmv/3qmoBcskyN68rRVP65oRMMHTZ9k+cICr3t2P2wRHsizU7+L 1YEw== X-Gm-Message-State: APjAAAXG3tMBRnK7gLxg2k0N2VQMVl7OfLatHg59lWP8HpEdl2cgk7r5 gdIi5rnnBgCPhhnyo90CUpDxJfUG5uoe+g== X-Google-Smtp-Source: APXvYqw6KEziYTxNTPMx5CJcUDTOBj1v03/JwHJyDhynA1su682d93JNdiiv1a7T8sdxOuL22EkRjw== X-Received: by 2002:a2e:984d:: with SMTP id e13mr2502993ljj.61.1556841036773; Thu, 02 May 2019 16:50:36 -0700 (PDT) Return-Path: Received: from gilgamesh.semihalf.com (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id o17sm74078lji.23.2019.05.02.16.50.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 02 May 2019 16:50:36 -0700 (PDT) From: "Marcin Wojtas" To: devel@edk2.groups.io Cc: leif.lindholm@linaro.org, ard.biesheuvel@linaro.org, mw@semihalf.com, jsd@semihalf.com, jaz@semihalf.com, kostap@marvell.com, Jici.Gao@arm.com Subject: [edk2-platforms: PATCH 3/4] Marvell/Drivers: MvPhyDxe: Introduce 88E1112 initialization Date: Fri, 3 May 2019 01:50:15 +0200 Message-Id: <1556841016-10342-4-git-send-email-mw@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1556841016-10342-1-git-send-email-mw@semihalf.com> References: <1556841016-10342-1-git-send-email-mw@semihalf.com> This patch adds 88E1112 PHY support and updates PortingGuide accordingly. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Marcin Wojtas --- Silicon/Marvell/Drivers/Net/MvPhyDxe/MvPhyDxe.h | 17 ++++++++++- Silicon/Marvell/Drivers/Net/MvPhyDxe/MvPhyDxe.c | 31 ++++++++++++++++++++ Silicon/Marvell/Documentation/PortingGuide.txt | 7 +++-- 3 files changed, 51 insertions(+), 4 deletions(-) diff --git a/Silicon/Marvell/Drivers/Net/MvPhyDxe/MvPhyDxe.h b/Silicon/Marvell/Drivers/Net/MvPhyDxe/MvPhyDxe.h index 66974bb..cd5a475 100644 --- a/Silicon/Marvell/Drivers/Net/MvPhyDxe/MvPhyDxe.h +++ b/Silicon/Marvell/Drivers/Net/MvPhyDxe/MvPhyDxe.h @@ -75,7 +75,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define MIIM_88E1111_HWCFG_FIBER_COPPER_RES 0x2000 typedef enum { - MV_PHY_DEVICE_1512 + MV_PHY_DEVICE_1512, + MV_PHY_DEVICE_1112 } MV_PHY_DEVICE_ID; typedef @@ -97,4 +98,18 @@ MvPhyInit1512 ( IN OUT PHY_DEVICE *PhyDev ); +/** + Initialize Marvell 88E1112 PHY. + + @param[in] MvPhyProtocol Marvell PHY protocol instance. + @param[in out] *PhyDevice PHY device structure. + +**/ +STATIC +EFI_STATUS +MvPhyInit1112 ( + IN CONST MARVELL_PHY_PROTOCOL *MvPhyProtocol, + IN OUT PHY_DEVICE *PhyDevice + ); + #endif diff --git a/Silicon/Marvell/Drivers/Net/MvPhyDxe/MvPhyDxe.c b/Silicon/Marvell/Drivers/Net/MvPhyDxe/MvPhyDxe.c index 780e8bd..08a8ed0 100644 --- a/Silicon/Marvell/Drivers/Net/MvPhyDxe/MvPhyDxe.c +++ b/Silicon/Marvell/Drivers/Net/MvPhyDxe/MvPhyDxe.c @@ -66,6 +66,7 @@ STATIC UINT8 * CONST PhySmiAddresses = PcdGetPtr (PcdPhySmiAddresses); STATIC MV_PHY_DEVICE MvPhyDevices[] = { { MV_PHY_DEVICE_1512, MvPhyInit1512 }, + { MV_PHY_DEVICE_1112, MvPhyInit1112 }, { 0, NULL } }; @@ -382,6 +383,36 @@ MvPhyInit1512 ( return EFI_SUCCESS; } +/** + Initialize Marvell 88E1112 PHY. + + @param[in] MvPhyProtocol Marvell PHY protocol instance. + @param[in out] *PhyDevice PHY device structure. + +**/ +STATIC +EFI_STATUS +MvPhyInit1112 ( + IN CONST MARVELL_PHY_PROTOCOL *MvPhyProtocol, + IN OUT PHY_DEVICE *PhyDevice + ) +{ + EFI_STATUS Status; + + MvPhyM88e1111sConfig (PhyDevice); + + if (PcdGetBool (PcdPhyStartupAutoneg)) { + Status = MvPhyConfigureAutonegotiation (PhyDevice); + if (EFI_ERROR (Status)) { + return Status; + } + + MvPhyParseStatus (PhyDevice); + } + + return EFI_SUCCESS; +} + EFI_STATUS MvPhyInit ( IN CONST MARVELL_PHY_PROTOCOL *Snp, diff --git a/Silicon/Marvell/Documentation/PortingGuide.txt b/Silicon/Marvell/Documentation/PortingGuide.txt index 2603980..9dee5c8 100644 --- a/Silicon/Marvell/Documentation/PortingGuide.txt +++ b/Silicon/Marvell/Documentation/PortingGuide.txt @@ -146,7 +146,7 @@ Example PHY Driver configuration ======================== MvPhyDxe provides basic initialization and status routines for Marvell PHYs. -Currently only 1518 series PHYs are supported. Following PCDs are required: +Currently only 1512 and 1112 series PHYs are supported. Following PCDs are required: - gMarvellTokenSpaceGuid.PcdPhyStartupAutoneg (boolean - if true, driver waits for autonegotiation on startup) @@ -162,6 +162,7 @@ MV_PHY_DEVICE_ID: typedef enum { 0 MV_PHY_DEVICE_1512, + 1 MV_PHY_DEVICE_1112, } MV_PHY_DEVICE_ID; It should be extended when adding support for other PHY models. @@ -170,9 +171,9 @@ Disable autonegotiation: gMarvellTokenSpaceGuid.PcdPhyStartupAutoneg|FALSE -assuming, that PHY models are 1512: +assuming, that PHY models are 1512 and 1112 for two consecutive ports: - gMarvellTokenSpaceGuid.PcdPhyDeviceIds|{ 0x0, 0x0 } + gMarvellTokenSpaceGuid.PcdPhyDeviceIds|{ 0x0, 0x1 } MDIO configuration -- 2.7.4