aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2016-01-29 01:53:17 -0500
committerDavid S. Miller <davem@davemloft.net>2016-01-29 01:53:17 -0500
commitb64438853f4c29f2235124a1c879b5e242d1ae19 (patch)
treef8264b7ca7316fe8194e190e1e840c6127da97d8
parenta77ce1bc12d6e0c03e9cc5683bb657ae2f2bb9b5 (diff)
parente4bf797ac1dcd8582d31a158dbdea5b1fbad94e6 (diff)
Merge branch 'phylib-regressions-part-2'
Andrew Lunn says: ==================== Part 2 of v4.5-rc1 phylib regression White list PHY compatible values which indicate PHYs. Issue a warning when one is encountered. Update the documentation to make it clear what is expected in the compatible string. v2: Fix Grammar, reword changelog, add Tested-by and Acked-by. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--Documentation/devicetree/bindings/net/brcm,bcmgenet.txt4
-rw-r--r--Documentation/devicetree/bindings/net/mdio-mux-gpio.txt8
-rw-r--r--Documentation/devicetree/bindings/net/mdio-mux.txt8
-rw-r--r--Documentation/devicetree/bindings/net/phy.txt6
-rw-r--r--drivers/of/of_mdio.c27
5 files changed, 33 insertions, 20 deletions
diff --git a/Documentation/devicetree/bindings/net/brcm,bcmgenet.txt b/Documentation/devicetree/bindings/net/brcm,bcmgenet.txt
index 451fef26b4df..10587bdadbbe 100644
--- a/Documentation/devicetree/bindings/net/brcm,bcmgenet.txt
+++ b/Documentation/devicetree/bindings/net/brcm,bcmgenet.txt
@@ -68,7 +68,7 @@ ethernet@f0b60000 {
68 phy1: ethernet-phy@1 { 68 phy1: ethernet-phy@1 {
69 max-speed = <1000>; 69 max-speed = <1000>;
70 reg = <0x1>; 70 reg = <0x1>;
71 compatible = "brcm,28nm-gphy", "ethernet-phy-ieee802.3-c22"; 71 compatible = "ethernet-phy-ieee802.3-c22";
72 }; 72 };
73 }; 73 };
74}; 74};
@@ -115,7 +115,7 @@ ethernet@f0ba0000 {
115 phy0: ethernet-phy@0 { 115 phy0: ethernet-phy@0 {
116 max-speed = <1000>; 116 max-speed = <1000>;
117 reg = <0x0>; 117 reg = <0x0>;
118 compatible = "brcm,bcm53125", "ethernet-phy-ieee802.3-c22"; 118 compatible = "ethernet-phy-ieee802.3-c22";
119 }; 119 };
120 }; 120 };
121}; 121};
diff --git a/Documentation/devicetree/bindings/net/mdio-mux-gpio.txt b/Documentation/devicetree/bindings/net/mdio-mux-gpio.txt
index 79384113c2b0..694987d3c17a 100644
--- a/Documentation/devicetree/bindings/net/mdio-mux-gpio.txt
+++ b/Documentation/devicetree/bindings/net/mdio-mux-gpio.txt
@@ -38,7 +38,6 @@ Example :
38 38
39 phy11: ethernet-phy@1 { 39 phy11: ethernet-phy@1 {
40 reg = <1>; 40 reg = <1>;
41 compatible = "marvell,88e1149r";
42 marvell,reg-init = <3 0x10 0 0x5777>, 41 marvell,reg-init = <3 0x10 0 0x5777>,
43 <3 0x11 0 0x00aa>, 42 <3 0x11 0 0x00aa>,
44 <3 0x12 0 0x4105>, 43 <3 0x12 0 0x4105>,
@@ -48,7 +47,6 @@ Example :
48 }; 47 };
49 phy12: ethernet-phy@2 { 48 phy12: ethernet-phy@2 {
50 reg = <2>; 49 reg = <2>;
51 compatible = "marvell,88e1149r";
52 marvell,reg-init = <3 0x10 0 0x5777>, 50 marvell,reg-init = <3 0x10 0 0x5777>,
53 <3 0x11 0 0x00aa>, 51 <3 0x11 0 0x00aa>,
54 <3 0x12 0 0x4105>, 52 <3 0x12 0 0x4105>,
@@ -58,7 +56,6 @@ Example :
58 }; 56 };
59 phy13: ethernet-phy@3 { 57 phy13: ethernet-phy@3 {
60 reg = <3>; 58 reg = <3>;
61 compatible = "marvell,88e1149r";
62 marvell,reg-init = <3 0x10 0 0x5777>, 59 marvell,reg-init = <3 0x10 0 0x5777>,
63 <3 0x11 0 0x00aa>, 60 <3 0x11 0 0x00aa>,
64 <3 0x12 0 0x4105>, 61 <3 0x12 0 0x4105>,
@@ -68,7 +65,6 @@ Example :
68 }; 65 };
69 phy14: ethernet-phy@4 { 66 phy14: ethernet-phy@4 {
70 reg = <4>; 67 reg = <4>;
71 compatible = "marvell,88e1149r";
72 marvell,reg-init = <3 0x10 0 0x5777>, 68 marvell,reg-init = <3 0x10 0 0x5777>,
73 <3 0x11 0 0x00aa>, 69 <3 0x11 0 0x00aa>,
74 <3 0x12 0 0x4105>, 70 <3 0x12 0 0x4105>,
@@ -85,7 +81,6 @@ Example :
85 81
86 phy21: ethernet-phy@1 { 82 phy21: ethernet-phy@1 {
87 reg = <1>; 83 reg = <1>;
88 compatible = "marvell,88e1149r";
89 marvell,reg-init = <3 0x10 0 0x5777>, 84 marvell,reg-init = <3 0x10 0 0x5777>,
90 <3 0x11 0 0x00aa>, 85 <3 0x11 0 0x00aa>,
91 <3 0x12 0 0x4105>, 86 <3 0x12 0 0x4105>,
@@ -95,7 +90,6 @@ Example :
95 }; 90 };
96 phy22: ethernet-phy@2 { 91 phy22: ethernet-phy@2 {
97 reg = <2>; 92 reg = <2>;
98 compatible = "marvell,88e1149r";
99 marvell,reg-init = <3 0x10 0 0x5777>, 93 marvell,reg-init = <3 0x10 0 0x5777>,
100 <3 0x11 0 0x00aa>, 94 <3 0x11 0 0x00aa>,
101 <3 0x12 0 0x4105>, 95 <3 0x12 0 0x4105>,
@@ -105,7 +99,6 @@ Example :
105 }; 99 };
106 phy23: ethernet-phy@3 { 100 phy23: ethernet-phy@3 {
107 reg = <3>; 101 reg = <3>;
108 compatible = "marvell,88e1149r";
109 marvell,reg-init = <3 0x10 0 0x5777>, 102 marvell,reg-init = <3 0x10 0 0x5777>,
110 <3 0x11 0 0x00aa>, 103 <3 0x11 0 0x00aa>,
111 <3 0x12 0 0x4105>, 104 <3 0x12 0 0x4105>,
@@ -115,7 +108,6 @@ Example :
115 }; 108 };
116 phy24: ethernet-phy@4 { 109 phy24: ethernet-phy@4 {
117 reg = <4>; 110 reg = <4>;
118 compatible = "marvell,88e1149r";
119 marvell,reg-init = <3 0x10 0 0x5777>, 111 marvell,reg-init = <3 0x10 0 0x5777>,
120 <3 0x11 0 0x00aa>, 112 <3 0x11 0 0x00aa>,
121 <3 0x12 0 0x4105>, 113 <3 0x12 0 0x4105>,
diff --git a/Documentation/devicetree/bindings/net/mdio-mux.txt b/Documentation/devicetree/bindings/net/mdio-mux.txt
index f65606f8d632..491f5bd55203 100644
--- a/Documentation/devicetree/bindings/net/mdio-mux.txt
+++ b/Documentation/devicetree/bindings/net/mdio-mux.txt
@@ -47,7 +47,6 @@ Example :
47 47
48 phy11: ethernet-phy@1 { 48 phy11: ethernet-phy@1 {
49 reg = <1>; 49 reg = <1>;
50 compatible = "marvell,88e1149r";
51 marvell,reg-init = <3 0x10 0 0x5777>, 50 marvell,reg-init = <3 0x10 0 0x5777>,
52 <3 0x11 0 0x00aa>, 51 <3 0x11 0 0x00aa>,
53 <3 0x12 0 0x4105>, 52 <3 0x12 0 0x4105>,
@@ -57,7 +56,6 @@ Example :
57 }; 56 };
58 phy12: ethernet-phy@2 { 57 phy12: ethernet-phy@2 {
59 reg = <2>; 58 reg = <2>;
60 compatible = "marvell,88e1149r";
61 marvell,reg-init = <3 0x10 0 0x5777>, 59 marvell,reg-init = <3 0x10 0 0x5777>,
62 <3 0x11 0 0x00aa>, 60 <3 0x11 0 0x00aa>,
63 <3 0x12 0 0x4105>, 61 <3 0x12 0 0x4105>,
@@ -67,7 +65,6 @@ Example :
67 }; 65 };
68 phy13: ethernet-phy@3 { 66 phy13: ethernet-phy@3 {
69 reg = <3>; 67 reg = <3>;
70 compatible = "marvell,88e1149r";
71 marvell,reg-init = <3 0x10 0 0x5777>, 68 marvell,reg-init = <3 0x10 0 0x5777>,
72 <3 0x11 0 0x00aa>, 69 <3 0x11 0 0x00aa>,
73 <3 0x12 0 0x4105>, 70 <3 0x12 0 0x4105>,
@@ -77,7 +74,6 @@ Example :
77 }; 74 };
78 phy14: ethernet-phy@4 { 75 phy14: ethernet-phy@4 {
79 reg = <4>; 76 reg = <4>;
80 compatible = "marvell,88e1149r";
81 marvell,reg-init = <3 0x10 0 0x5777>, 77 marvell,reg-init = <3 0x10 0 0x5777>,
82 <3 0x11 0 0x00aa>, 78 <3 0x11 0 0x00aa>,
83 <3 0x12 0 0x4105>, 79 <3 0x12 0 0x4105>,
@@ -94,7 +90,6 @@ Example :
94 90
95 phy21: ethernet-phy@1 { 91 phy21: ethernet-phy@1 {
96 reg = <1>; 92 reg = <1>;
97 compatible = "marvell,88e1149r";
98 marvell,reg-init = <3 0x10 0 0x5777>, 93 marvell,reg-init = <3 0x10 0 0x5777>,
99 <3 0x11 0 0x00aa>, 94 <3 0x11 0 0x00aa>,
100 <3 0x12 0 0x4105>, 95 <3 0x12 0 0x4105>,
@@ -104,7 +99,6 @@ Example :
104 }; 99 };
105 phy22: ethernet-phy@2 { 100 phy22: ethernet-phy@2 {
106 reg = <2>; 101 reg = <2>;
107 compatible = "marvell,88e1149r";
108 marvell,reg-init = <3 0x10 0 0x5777>, 102 marvell,reg-init = <3 0x10 0 0x5777>,
109 <3 0x11 0 0x00aa>, 103 <3 0x11 0 0x00aa>,
110 <3 0x12 0 0x4105>, 104 <3 0x12 0 0x4105>,
@@ -114,7 +108,6 @@ Example :
114 }; 108 };
115 phy23: ethernet-phy@3 { 109 phy23: ethernet-phy@3 {
116 reg = <3>; 110 reg = <3>;
117 compatible = "marvell,88e1149r";
118 marvell,reg-init = <3 0x10 0 0x5777>, 111 marvell,reg-init = <3 0x10 0 0x5777>,
119 <3 0x11 0 0x00aa>, 112 <3 0x11 0 0x00aa>,
120 <3 0x12 0 0x4105>, 113 <3 0x12 0 0x4105>,
@@ -124,7 +117,6 @@ Example :
124 }; 117 };
125 phy24: ethernet-phy@4 { 118 phy24: ethernet-phy@4 {
126 reg = <4>; 119 reg = <4>;
127 compatible = "marvell,88e1149r";
128 marvell,reg-init = <3 0x10 0 0x5777>, 120 marvell,reg-init = <3 0x10 0 0x5777>,
129 <3 0x11 0 0x00aa>, 121 <3 0x11 0 0x00aa>,
130 <3 0x12 0 0x4105>, 122 <3 0x12 0 0x4105>,
diff --git a/Documentation/devicetree/bindings/net/phy.txt b/Documentation/devicetree/bindings/net/phy.txt
index 525e1658f2da..bc1c3c8bf8fa 100644
--- a/Documentation/devicetree/bindings/net/phy.txt
+++ b/Documentation/devicetree/bindings/net/phy.txt
@@ -17,8 +17,7 @@ Optional Properties:
17 "ethernet-phy-ieee802.3-c22" or "ethernet-phy-ieee802.3-c45" for 17 "ethernet-phy-ieee802.3-c22" or "ethernet-phy-ieee802.3-c45" for
18 PHYs that implement IEEE802.3 clause 22 or IEEE802.3 clause 45 18 PHYs that implement IEEE802.3 clause 22 or IEEE802.3 clause 45
19 specifications. If neither of these are specified, the default is to 19 specifications. If neither of these are specified, the default is to
20 assume clause 22. The compatible list may also contain other 20 assume clause 22.
21 elements.
22 21
23 If the phy's identifier is known then the list may contain an entry 22 If the phy's identifier is known then the list may contain an entry
24 of the form: "ethernet-phy-idAAAA.BBBB" where 23 of the form: "ethernet-phy-idAAAA.BBBB" where
@@ -28,6 +27,9 @@ Optional Properties:
28 4 hex digits. This is the chip vendor OUI bits 19:24, 27 4 hex digits. This is the chip vendor OUI bits 19:24,
29 followed by 10 bits of a vendor specific ID. 28 followed by 10 bits of a vendor specific ID.
30 29
30 The compatible list should not contain other values than those
31 listed here.
32
31- max-speed: Maximum PHY supported speed (10, 100, 1000...) 33- max-speed: Maximum PHY supported speed (10, 100, 1000...)
32 34
33- broken-turn-around: If set, indicates the PHY device does not correctly 35- broken-turn-around: If set, indicates the PHY device does not correctly
diff --git a/drivers/of/of_mdio.c b/drivers/of/of_mdio.c
index b5aa004a24b6..5648317d355f 100644
--- a/drivers/of/of_mdio.c
+++ b/drivers/of/of_mdio.c
@@ -143,11 +143,31 @@ int of_mdio_parse_addr(struct device *dev, const struct device_node *np)
143} 143}
144EXPORT_SYMBOL(of_mdio_parse_addr); 144EXPORT_SYMBOL(of_mdio_parse_addr);
145 145
146/* The following is a list of PHY compatible strings which appear in
147 * some DTBs. The compatible string is never matched against a PHY
148 * driver, so is pointless. We only expect devices which are not PHYs
149 * to have a compatible string, so they can be matched to an MDIO
150 * driver. Encourage users to upgrade their DT blobs to remove these.
151 */
152static const struct of_device_id whitelist_phys[] = {
153 { .compatible = "brcm,40nm-ephy" },
154 { .compatible = "marvell,88E1111", },
155 { .compatible = "marvell,88e1116", },
156 { .compatible = "marvell,88e1118", },
157 { .compatible = "marvell,88e1149r", },
158 { .compatible = "marvell,88e1310", },
159 { .compatible = "marvell,88E1510", },
160 { .compatible = "marvell,88E1514", },
161 { .compatible = "moxa,moxart-rtl8201cp", },
162 {}
163};
164
146/* 165/*
147 * Return true if the child node is for a phy. It must either: 166 * Return true if the child node is for a phy. It must either:
148 * o Compatible string of "ethernet-phy-idX.X" 167 * o Compatible string of "ethernet-phy-idX.X"
149 * o Compatible string of "ethernet-phy-ieee802.3-c45" 168 * o Compatible string of "ethernet-phy-ieee802.3-c45"
150 * o Compatible string of "ethernet-phy-ieee802.3-c22" 169 * o Compatible string of "ethernet-phy-ieee802.3-c22"
170 * o In the white list above (and issue a warning)
151 * o No compatibility string 171 * o No compatibility string
152 * 172 *
153 * A device which is not a phy is expected to have a compatible string 173 * A device which is not a phy is expected to have a compatible string
@@ -166,6 +186,13 @@ static bool of_mdiobus_child_is_phy(struct device_node *child)
166 if (of_device_is_compatible(child, "ethernet-phy-ieee802.3-c22")) 186 if (of_device_is_compatible(child, "ethernet-phy-ieee802.3-c22"))
167 return true; 187 return true;
168 188
189 if (of_match_node(whitelist_phys, child)) {
190 pr_warn(FW_WARN
191 "%s: Whitelisted compatible string. Please remove\n",
192 child->full_name);
193 return true;
194 }
195
169 if (!of_find_property(child, "compatible", NULL)) 196 if (!of_find_property(child, "compatible", NULL))
170 return true; 197 return true;
171 198