diff options
author | Florinel Iordache <florinel.iordache@nxp.com> | 2020-03-16 15:35:59 +0200 |
---|---|---|
committer | Priyanka Jain <priyanka.jain@nxp.com> | 2020-04-20 13:35:11 +0530 |
commit | 5d3bcdb12fc48421573e1cef5c260643337bfada (patch) | |
tree | 6d68220dc8978567ee1bdf4271b3f6bfd68f5150 /include/phy_interface.h | |
parent | 316fc6ff762b44044ef164f51e042cb8a90dc147 (diff) |
phy: add support for backplane kr mode
Add generic support for backplane kr modes currently available:
10gbase-kr, 40gbase-kr4. Remove platform generic fixups
(armv8/layerscape and powerpc) for ethernet interfaces specified
in device tree as supported backplane modes.
Signed-off-by: Florinel Iordache <florinel.iordache@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
Diffstat (limited to 'include/phy_interface.h')
-rw-r--r-- | include/phy_interface.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/include/phy_interface.h b/include/phy_interface.h index 31ca72a81f..882e4af8ff 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 */ |