From nobody Wed Dec 25 14:18:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1509121981314778.0735304566756; Fri, 27 Oct 2017 09:33:01 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 0905B21F3B3E6; Fri, 27 Oct 2017 09:29:01 -0700 (PDT) Received: from mail-lf0-x242.google.com (mail-lf0-x242.google.com [IPv6:2a00:1450:4010:c07::242]) (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 4A04121E1B76A for ; Fri, 27 Oct 2017 09:28:58 -0700 (PDT) Received: by mail-lf0-x242.google.com with SMTP id n69so8032561lfn.2 for ; Fri, 27 Oct 2017 09:32:45 -0700 (PDT) Received: from gilgamesh.semihalf.com (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id h3sm1569222lfj.26.2017.10.27.09.32.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 27 Oct 2017 09:32:43 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: None (no SPF record) identity=mailfrom; client-ip=2a00:1450:4010:c07::242; helo=mail-lf0-x242.google.com; envelope-from=mw@semihalf.com; receiver=edk2-devel@lists.01.org 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=rwet9tcB6m+d7EppTvzCZbj3uAtRZWmz7vvXBHa72U0=; b=nizQLqn7x2244YclH0c/N4GLs6Ap0UlxUR8CXIvMYtu7GHIh+nAvWBa+jANrAaGvJi VOrZ4FVBwY4n3BmcXU8i9TedxWQg/7MmQBWKw2YuY4PN10EJ0hHpV5XtOcIc6KFTAtov geXhvU9DbeiNqJXMma8oJiOop3qzJ7i8ok7xC5M7UMnkaqJFjoFYoV6LTJJRIgqV8n1P qlf7E7I3fAdqMg4vY0ZDTXoX8ouY+WBQbw254LDuhXnp5uE329/DGPTIjcFCFKvOL2fc waBY457r+IHsKV/g73wLv6jiISq1g4WzqnlSLLL+itDsNRePKzGoj0QDLJhWoKiUXPv/ doLw== 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=rwet9tcB6m+d7EppTvzCZbj3uAtRZWmz7vvXBHa72U0=; b=H+VgFwU9SXc6vQ0UlM4RtcBR6vLGvT5yYFXVkMSmuI4XDYaHkQMR40diGqECpK1+wD /4lipLSCJllkUPUWWzICI4S/P0qUJDvwXK929yqWuPuFupAMNKPcuzmzyxk+S5Sas1/S tR6mBFHNl4+KbALfflfiLaEKPWHBsdFk4DnxsRqrtpQGSLg5p4aLd0xCPhlWwhj8n8Tz XjwoP/SbvaEpJUJv+sIkWbc92onvfTIi2jUdEbS4+m+Q9oC+5K2PnTaemvVyNZWDGXh4 iW9rQW3vEujOarnRbF6oljW4nqvsMoHybthwuHl7K8+ba8ZucCj5WrGo+5qM+iklBWIL kygQ== X-Gm-Message-State: AMCzsaWFwruQuj2mC+kDN/bz7gKBdA6uKk0wWOH/xC4n6pUG5wGGva1q nQU3909OBXWrSa/lpiGlql6vcTcAGic= X-Google-Smtp-Source: ABhQp+Ta9ylpCxd77JJvkRwZG5FSKKPOVthMVIwU3v8NniX3Dhbl5TeEAXCI4DWmzgi4NEu6Ahjs0Q== X-Received: by 10.46.4.29 with SMTP id 29mr487328lje.82.1509121963761; Fri, 27 Oct 2017 09:32:43 -0700 (PDT) From: Marcin Wojtas To: edk2-devel@lists.01.org Date: Fri, 27 Oct 2017 18:31:50 +0200 Message-Id: <1509121913-12937-8-git-send-email-mw@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1509121913-12937-1-git-send-email-mw@semihalf.com> References: <1509121913-12937-1-git-send-email-mw@semihalf.com> Subject: [edk2] [platforms: PATCH v3 07/10] Marvell/Drivers: Pp2Dxe: Change settings for the always-up link X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jinghua@marvell.com, ard.biesheuvel@linaro.org, leif.lindholm@linaro.org, nadavh@marvell.com, neta@marvell.com, kostap@marvell.com MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Currently initial forcing link status happened for all ports, not only marked as 'always-up'. Although this didn't actually matter for the MAC settings, because MAC is automatically updated with PHY HW polling feature of the controller, perform mv_gop110_fl_cfg only when the appropriate flag is true. Also in such case, force the link as up, using a new library routine. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Marcin Wojtas --- Platform/Marvell/Drivers/Net/Pp2Dxe/Mvpp2Lib.c | 19 +++++++++++++++++++ Platform/Marvell/Drivers/Net/Pp2Dxe/Mvpp2Lib.h | 5 +++++ Platform/Marvell/Drivers/Net/Pp2Dxe/Pp2Dxe.c | 6 +++++- 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/Platform/Marvell/Drivers/Net/Pp2Dxe/Mvpp2Lib.c b/Platform/Marv= ell/Drivers/Net/Pp2Dxe/Mvpp2Lib.c index 53154db..0c9f00c 100644 --- a/Platform/Marvell/Drivers/Net/Pp2Dxe/Mvpp2Lib.c +++ b/Platform/Marvell/Drivers/Net/Pp2Dxe/Mvpp2Lib.c @@ -4804,6 +4804,25 @@ MvGop110PortEventsMask ( return 0; } =20 +/* + * Sets "Force Link Pass" and clears "Do Not Force Link Fail" bits. + * This function should only be called when the port is disabled. + */ +VOID +MvGop110GmacForceLinkUp ( + IN PP2DXE_PORT *Port + ) +{ + UINT32 RegVal; + + RegVal =3D MvGop110GmacRead (Port, MVPP2_PORT_AUTO_NEG_CFG_REG); + + RegVal |=3D MVPP2_PORT_AUTO_NEG_CFG_FORCE_LINK_UP_MASK; + RegVal &=3D ~MVPP2_PORT_AUTO_NEG_CFG_FORCE_LINK_DOWN_MASK; + + MvGop110GmacWrite (Port, MVPP2_PORT_AUTO_NEG_CFG_REG, RegVal); +} + INT32 MvGop110FlCfg ( IN PP2DXE_PORT *Port diff --git a/Platform/Marvell/Drivers/Net/Pp2Dxe/Mvpp2Lib.h b/Platform/Marv= ell/Drivers/Net/Pp2Dxe/Mvpp2Lib.h index a7011f7..3dc9ecd 100644 --- a/Platform/Marvell/Drivers/Net/Pp2Dxe/Mvpp2Lib.h +++ b/Platform/Marvell/Drivers/Net/Pp2Dxe/Mvpp2Lib.h @@ -504,6 +504,11 @@ MvGop110XlgPortLinkEventMask ( IN PP2DXE_PORT *Port ); =20 +VOID +MvGop110GmacForceLinkUp ( + IN PP2DXE_PORT *Port + ); + INT32 MvGop110FlCfg ( IN PP2DXE_PORT *Port diff --git a/Platform/Marvell/Drivers/Net/Pp2Dxe/Pp2Dxe.c b/Platform/Marvel= l/Drivers/Net/Pp2Dxe/Pp2Dxe.c index 2827976..b0a38b3 100644 --- a/Platform/Marvell/Drivers/Net/Pp2Dxe/Pp2Dxe.c +++ b/Platform/Marvell/Drivers/Net/Pp2Dxe/Pp2Dxe.c @@ -1310,7 +1310,11 @@ Pp2DxeInitialiseController ( NetCompConfig |=3D MvpPp2xGop110NetcCfgCreate(&Pp2Context->Port); =20 MvGop110PortInit(&Pp2Context->Port); - MvGop110FlCfg(&Pp2Context->Port); + + if (Pp2Context->Port.AlwaysUp =3D=3D TRUE) { + MvGop110GmacForceLinkUp (&Pp2Context->Port); + MvGop110FlCfg (&Pp2Context->Port); + } =20 Status =3D gBS->CreateEvent ( EVT_SIGNAL_EXIT_BOOT_SERVICES, --=20 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel