[edk2-devel] [edk2-platforms: PATCH v2 3/4] Marvell/Drivers: MvPhyDxe: Introduce 88E1112 initialization
Marcin Wojtas
mw at semihalf.com
Mon May 6 02:37:06 UTC 2019
This patch adds 88E1112 PHY support and updates PortingGuide
accordingly.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marcin Wojtas <mw at semihalf.com>
---
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 63af640..81f9c0f 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
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#40022): https://edk2.groups.io/g/devel/message/40022
Mute This Topic: https://groups.io/mt/31515979/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-
More information about the edk2-devel-archive
mailing list