summaryrefslogtreecommitdiff
path: root/include/phy_interface.h
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2020-04-21 15:20:42 -0400
committerTom Rini <trini@konsulko.com>2020-04-21 15:20:42 -0400
commitbdcb29960e3a9558803632783b922f26993d219e (patch)
treec0c343ca723b8736b74af172bb47f1007dc2fc5c /include/phy_interface.h
parent1bf65142b31a48c8e354df603c9f6fa5c8cac389 (diff)
parente174fb7061e7a3f1996f57eb36525c51dd87b5a3 (diff)
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-fsl-qoriq
- Backplane support and bug fixes
Diffstat (limited to 'include/phy_interface.h')
-rw-r--r--include/phy_interface.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/phy_interface.h b/include/phy_interface.h
index 31ca72a81fd..882e4af8ffd 100644
--- a/include/phy_interface.h
+++ b/include/phy_interface.h
@@ -1,6 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0+ */
/*
* Copyright 2011 Freescale Semiconductor, Inc.
+ * Copyright 2020 NXP
* Andy Fleming <afleming@gmail.com>
*
* This file pretty much stolen from Linux's mii.h/ethtool.h/phy.h
@@ -67,6 +68,15 @@ static const char * const phy_interface_strings[] = {
[PHY_INTERFACE_MODE_NONE] = "",
};
+/* Backplane modes:
+ * are considered a sub-type of phy_interface_t: XGMII
+ * and are specified in "phy-connection-type" with one of the following strings
+ */
+static const char * const backplane_mode_strings[] = {
+ "10gbase-kr",
+ "40gbase-kr4",
+};
+
static inline const char *phy_string_for_interface(phy_interface_t i)
{
/* Default to unknown */
@@ -76,4 +86,17 @@ static inline const char *phy_string_for_interface(phy_interface_t i)
return phy_interface_strings[i];
}
+static inline bool is_backplane_mode(const char *phyconn)
+{
+ int i;
+
+ if (!phyconn)
+ return false;
+ for (i = 0; i < ARRAY_SIZE(backplane_mode_strings); i++) {
+ if (!strcmp(phyconn, backplane_mode_strings[i]))
+ return true;
+ }
+ return false;
+}
+
#endif /* _PHY_INTERFACE_H */