ipq40xx: add PSGMII PHY mode define
[openwrt/openwrt.git] / target / linux / ipq40xx / patches-5.15 / 704-net-phy-define-PSGMII-PHY-interface-mode.patch
1 From 3e1825e00dafb68eec25df389b63f3ab3d905b59 Mon Sep 17 00:00:00 2001
2 From: Gabor Juhos <j4g8y7@gmail.com>
3 Date: Fri, 25 Dec 2020 08:02:47 +0100
4 Subject: [PATCH] net: phy: define PSGMII PHY interface mode
5
6 The PSGMII interface is similar to QSGMII. The main difference
7 is that the PSGMII interface combines five SGMII lines into a
8 single link while in QSGMII only four lines are combined.
9
10 Similarly to the QSGMII, this interface mode might also needs
11 special handling within the MAC driver.
12
13 Add definitions for the PHY layer to allow to express this type
14 of connection between the MAC and PHY.
15
16 Signed-off-by: Gabor Juhos <j4g8y7@gmail.com>
17 ---
18 Documentation/devicetree/bindings/net/ethernet-controller.yaml | 1 +
19 drivers/net/phy/phylink.c | 1 +
20 include/linux/phy.h | 3 +++
21 3 files changed, 5 insertions(+)
22
23 --- a/Documentation/devicetree/bindings/net/ethernet-controller.yaml
24 +++ b/Documentation/devicetree/bindings/net/ethernet-controller.yaml
25 @@ -64,6 +64,7 @@ properties:
26 - mii
27 - gmii
28 - sgmii
29 + - psgmii
30 - qsgmii
31 - tbi
32 - rev-mii
33 --- a/drivers/net/phy/phylink.c
34 +++ b/drivers/net/phy/phylink.c
35 @@ -293,6 +293,7 @@ static int phylink_parse_mode(struct phy
36
37 switch (pl->link_config.interface) {
38 case PHY_INTERFACE_MODE_SGMII:
39 + case PHY_INTERFACE_MODE_PSGMII:
40 case PHY_INTERFACE_MODE_QSGMII:
41 phylink_set(pl->supported, 10baseT_Half);
42 phylink_set(pl->supported, 10baseT_Full);
43 --- a/include/linux/phy.h
44 +++ b/include/linux/phy.h
45 @@ -138,6 +138,7 @@ typedef enum {
46 PHY_INTERFACE_MODE_XGMII,
47 PHY_INTERFACE_MODE_XLGMII,
48 PHY_INTERFACE_MODE_MOCA,
49 + PHY_INTERFACE_MODE_PSGMII,
50 PHY_INTERFACE_MODE_QSGMII,
51 PHY_INTERFACE_MODE_TRGMII,
52 PHY_INTERFACE_MODE_100BASEX,
53 @@ -209,6 +210,8 @@ static inline const char *phy_modes(phy_
54 return "xlgmii";
55 case PHY_INTERFACE_MODE_MOCA:
56 return "moca";
57 + case PHY_INTERFACE_MODE_PSGMII:
58 + return "psgmii";
59 case PHY_INTERFACE_MODE_QSGMII:
60 return "qsgmii";
61 case PHY_INTERFACE_MODE_TRGMII: