diff options
author | Marcin Wojtas <mw@semihalf.com> | 2017-04-10 17:45:39 +0200 |
---|---|---|
committer | Leif Lindholm <leif@developerbox> | 2017-10-29 16:47:27 +0000 |
commit | 6e049d5b6dc76f56751ec122e8bdccd688772044 (patch) | |
tree | 6255155be7b15eea6cb7908e73db435bab54d319 /Platform | |
parent | cf06f33ac588b036cfb8f94c331e3a61233dfa37 (diff) | |
download | edk2-platforms-6e049d5b6dc76f56751ec122e8bdccd688772044.tar.xz |
Marvell/Drivers: Pp2Dxe: Change settings for the always-up link
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 <mw@semihalf.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Diffstat (limited to 'Platform')
-rw-r--r-- | Platform/Marvell/Drivers/Net/Pp2Dxe/Mvpp2Lib.c | 19 | ||||
-rw-r--r-- | Platform/Marvell/Drivers/Net/Pp2Dxe/Mvpp2Lib.h | 5 | ||||
-rw-r--r-- | Platform/Marvell/Drivers/Net/Pp2Dxe/Pp2Dxe.c | 6 |
3 files changed, 29 insertions, 1 deletions
diff --git a/Platform/Marvell/Drivers/Net/Pp2Dxe/Mvpp2Lib.c b/Platform/Marvell/Drivers/Net/Pp2Dxe/Mvpp2Lib.c index 53154dbd14..0c9f00c04a 100644 --- a/Platform/Marvell/Drivers/Net/Pp2Dxe/Mvpp2Lib.c +++ b/Platform/Marvell/Drivers/Net/Pp2Dxe/Mvpp2Lib.c @@ -4804,6 +4804,25 @@ MvGop110PortEventsMask ( return 0;
}
+/*
+ * 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 = MvGop110GmacRead (Port, MVPP2_PORT_AUTO_NEG_CFG_REG);
+
+ RegVal |= MVPP2_PORT_AUTO_NEG_CFG_FORCE_LINK_UP_MASK;
+ RegVal &= ~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/Marvell/Drivers/Net/Pp2Dxe/Mvpp2Lib.h index a7011f7ed8..3dc9ecdd20 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
);
+VOID
+MvGop110GmacForceLinkUp (
+ IN PP2DXE_PORT *Port
+ );
+
INT32
MvGop110FlCfg (
IN PP2DXE_PORT *Port
diff --git a/Platform/Marvell/Drivers/Net/Pp2Dxe/Pp2Dxe.c b/Platform/Marvell/Drivers/Net/Pp2Dxe/Pp2Dxe.c index 2827976420..b0a38b3c90 100644 --- a/Platform/Marvell/Drivers/Net/Pp2Dxe/Pp2Dxe.c +++ b/Platform/Marvell/Drivers/Net/Pp2Dxe/Pp2Dxe.c @@ -1310,7 +1310,11 @@ Pp2DxeInitialiseController ( NetCompConfig |= MvpPp2xGop110NetcCfgCreate(&Pp2Context->Port);
MvGop110PortInit(&Pp2Context->Port);
- MvGop110FlCfg(&Pp2Context->Port);
+
+ if (Pp2Context->Port.AlwaysUp == TRUE) {
+ MvGop110GmacForceLinkUp (&Pp2Context->Port);
+ MvGop110FlCfg (&Pp2Context->Port);
+ }
Status = gBS->CreateEvent (
EVT_SIGNAL_EXIT_BOOT_SERVICES,
|