Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1673711 > unrolled thread
| Started by | Florian Fainelli <f.fainelli@gmail.com> |
|---|---|
| First post | 2017-06-23 19:40 +0200 |
| Last post | 2017-06-23 21:10 +0200 |
| Articles | 5 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH net-next 0/4] net: phy: Support "internal" PHY interface Florian Fainelli <f.fainelli@gmail.com> - 2017-06-23 19:40 +0200
[PATCH net-next 1/4] dt-bindings: Add "internal" as a valid 'phy-mode' property Florian Fainelli <f.fainelli@gmail.com> - 2017-06-23 19:40 +0200
[PATCH net-next 4/4] net: dsa: bcm_sf2: Remove special handling of "internal" phy-mode Florian Fainelli <f.fainelli@gmail.com> - 2017-06-23 19:40 +0200
[PATCH net-next 2/4] net: phy: Support "internal" PHY interface Florian Fainelli <f.fainelli@gmail.com> - 2017-06-23 19:40 +0200
Re: [PATCH net-next 0/4] net: phy: Support "internal" PHY interface David Miller <davem@davemloft.net> - 2017-06-23 21:10 +0200
| From | Florian Fainelli <f.fainelli@gmail.com> |
|---|---|
| Date | 2017-06-23 19:40 +0200 |
| Subject | [PATCH net-next 0/4] net: phy: Support "internal" PHY interface |
| Message-ID | <tVAIN-57u-5@gated-at.bofh.it> |
Hi all, This makes the "internal" phy-mode property generally available and documented and this allows us to remove some custom parsing code we had for bcmgenet and bcm_sf2 which both used that specific value. Florian Fainelli (4): dt-bindings: Add "internal" as a valid 'phy-mode' property net: phy: Support "internal" PHY interface net: bcmgenet: Remove special handling of "internal" phy-mode net: dsa: bcm_sf2: Remove special handling of "internal" phy-mode Documentation/devicetree/bindings/net/ethernet.txt | 1 + drivers/net/dsa/bcm_sf2.c | 16 +++++---------- drivers/net/ethernet/broadcom/genet/bcmmii.c | 24 ++++++++-------------- include/linux/phy.h | 3 +++ 4 files changed, 17 insertions(+), 27 deletions(-) -- 2.9.3
[toc] | [next] | [standalone]
| From | Florian Fainelli <f.fainelli@gmail.com> |
|---|---|
| Date | 2017-06-23 19:40 +0200 |
| Subject | [PATCH net-next 1/4] dt-bindings: Add "internal" as a valid 'phy-mode' property |
| Message-ID | <tVAIO-57u-23@gated-at.bofh.it> |
| In reply to | #1673711 |
A number of Ethernet MACs have internal Ethernet PHYs and the internal wiring makes it so that this knowledge needs to be available using the standard 'phy-mode' property. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> --- Documentation/devicetree/bindings/net/ethernet.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/net/ethernet.txt b/Documentation/devicetree/bindings/net/ethernet.txt index d4abe9a98109..edd7fd2bbbf9 100644 --- a/Documentation/devicetree/bindings/net/ethernet.txt +++ b/Documentation/devicetree/bindings/net/ethernet.txt @@ -11,6 +11,7 @@ The following properties are common to the Ethernet controllers: the maximum frame size (there's contradiction in ePAPR). - phy-mode: string, operation mode of the PHY interface. This is now a de-facto standard property; supported values are: + * "internal" * "mii" * "gmii" * "sgmii" -- 2.9.3
[toc] | [prev] | [next] | [standalone]
| From | Florian Fainelli <f.fainelli@gmail.com> |
|---|---|
| Date | 2017-06-23 19:40 +0200 |
| Subject | [PATCH net-next 4/4] net: dsa: bcm_sf2: Remove special handling of "internal" phy-mode |
| Message-ID | <tVAIO-57u-37@gated-at.bofh.it> |
| In reply to | #1673711 |
The PHY library now supports an "internal" phy-mode, thus making our
custom parsing code now unnecessary.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/dsa/bcm_sf2.c | 16 +++++-----------
1 file changed, 5 insertions(+), 11 deletions(-)
diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c
index 76e98e8ed315..648f91b58d1e 100644
--- a/drivers/net/dsa/bcm_sf2.c
+++ b/drivers/net/dsa/bcm_sf2.c
@@ -498,10 +498,8 @@ static void bcm_sf2_identify_ports(struct bcm_sf2_priv *priv,
struct device_node *dn)
{
struct device_node *port;
- const char *phy_mode_str;
int mode;
unsigned int port_num;
- int ret;
priv->moca_port = -1;
@@ -515,15 +513,11 @@ static void bcm_sf2_identify_ports(struct bcm_sf2_priv *priv,
* time
*/
mode = of_get_phy_mode(port);
- if (mode < 0) {
- ret = of_property_read_string(port, "phy-mode",
- &phy_mode_str);
- if (ret < 0)
- continue;
-
- if (!strcasecmp(phy_mode_str, "internal"))
- priv->int_phy_mask |= 1 << port_num;
- }
+ if (mode < 0)
+ continue;
+
+ if (mode == PHY_INTERFACE_MODE_INTERNAL)
+ priv->int_phy_mask |= 1 << port_num;
if (mode == PHY_INTERFACE_MODE_MOCA)
priv->moca_port = port_num;
--
2.9.3
[toc] | [prev] | [next] | [standalone]
| From | Florian Fainelli <f.fainelli@gmail.com> |
|---|---|
| Date | 2017-06-23 19:40 +0200 |
| Subject | [PATCH net-next 2/4] net: phy: Support "internal" PHY interface |
| Message-ID | <tVAIO-57u-39@gated-at.bofh.it> |
| In reply to | #1673711 |
Now that the Device Tree binding has been updated, update the PHY
library phy_interface_t and phy_modes to support the "internal" PHY
interface type.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
include/linux/phy.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 23d2e46dd322..1d8d70193782 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -64,6 +64,7 @@
/* Interface Mode definitions */
typedef enum {
PHY_INTERFACE_MODE_NA,
+ PHY_INTERFACE_MODE_INTERNAL,
PHY_INTERFACE_MODE_MII,
PHY_INTERFACE_MODE_GMII,
PHY_INTERFACE_MODE_SGMII,
@@ -114,6 +115,8 @@ static inline const char *phy_modes(phy_interface_t interface)
switch (interface) {
case PHY_INTERFACE_MODE_NA:
return "";
+ case PHY_INTERFACE_MODE_INTERNAL:
+ return "internal";
case PHY_INTERFACE_MODE_MII:
return "mii";
case PHY_INTERFACE_MODE_GMII:
--
2.9.3
[toc] | [prev] | [next] | [standalone]
| From | David Miller <davem@davemloft.net> |
|---|---|
| Date | 2017-06-23 21:10 +0200 |
| Message-ID | <tVC7U-66A-9@gated-at.bofh.it> |
| In reply to | #1673711 |
From: Florian Fainelli <f.fainelli@gmail.com> Date: Fri, 23 Jun 2017 10:33:12 -0700 > This makes the "internal" phy-mode property generally available and > documented and this allows us to remove some custom parsing code > we had for bcmgenet and bcm_sf2 which both used that specific value. Nice cleanup. Series applied, thanks.
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web