diff options
| author | David S. Miller <davem@davemloft.net> | 2014-05-16 17:19:44 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2014-05-16 17:19:44 -0400 |
| commit | ad2ebb3d4dd244f9fd6b24f523b06134e571ae92 (patch) | |
| tree | faa633af7d98bd712b99220c0a35da13c59e4e2d /include/linux | |
| parent | 2770abcc33b14c3f4ce5648cb3917a3be8d4044f (diff) | |
| parent | 84f6e11f21d40025ae9b0ebbf1c9b3be91ea8e1a (diff) | |
Merge branch 'dt_fixed_phy'
Thomas Petazzoni says:
====================
Add DT support for fixed PHYs
Here is a fourth version of the patch set that adds a Device Tree
binding and the related code to support fixed PHYs. I'm hoping to get
this merged in 3.16.
Changes since v3:
* Rebased on top of v3.15-rc5
* In patch "net: phy: decouple PHY id and PHY address in fixed PHY
driver", changed the PHY ID of fixed PHYs from 0xdeadbeef to 0x0,
as suggested by Grant Likely.
* Fixed the !CONFIG_PHY_FIXED case in patch "net: phy: extend fixed
driver with fixed_phy_register()". Noticed by Florian Fainelli.
* Added Acked-by from Grant Likely and Florian Fainelli on patch
"net: phy: extend fixed driver with fixed_phy_register()".
* Reworked the new fixed-link DT binding to be just a sub-node of the
Ethernet MAC node, and not a node referenced by the 'phy'
property. This was requested by Grant Likely.
* Reworked the code implementing the new DT binding to also make it
accept the old, single property based, DT binding.
* Added a patch that actually uses the new fixed link DT binding for
the Armada XP Matrix board.
Changes since v2:
* Rebased on top of v3.14-rc1, and re-tested on hardware.
* Removed the RFC tag, since there seems to be some real interest in
this feature, and the code has gone through several iterations
already.
* The error handling in fixed_phy_register() has been fixed.
Changes since v1:
* Instead of using a 'fixed-link' property inside the Ethernet device
DT node, with a fairly cryptic succession of integer values, we now
use a PHY subnode under the Ethernet device DT node, with explicit
properties to configure the duplex, speed, pause and other PHY
properties.
* The PHY address is automatically allocated by the kernel and no
longer visible in the Device Tree binding.
* The PHY device is created directly when the network driver calls
of_phy_connect_fixed_link(), and associated to the PHY DT node,
which allows the existing of_phy_connect() function to work,
without the need to use the deprecated of_phy_connect_fixed_link().
Posts of previous versions:
RFCv1: http://www.spinics.net/lists/netdev/msg243253.html
RFCv2: http://lists.infradead.org/pipermail/linux-arm-kernel/2013-September/196919.html
PATCHv3: http://www.spinics.net/lists/netdev/msg273117.html
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/of_mdio.h | 15 | ||||
| -rw-r--r-- | include/linux/phy_fixed.h | 11 |
2 files changed, 26 insertions, 0 deletions
diff --git a/include/linux/of_mdio.h b/include/linux/of_mdio.h index 881a7c3571f4..0aa367e316cb 100644 --- a/include/linux/of_mdio.h +++ b/include/linux/of_mdio.h | |||
| @@ -72,4 +72,19 @@ static inline struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np) | |||
| 72 | } | 72 | } |
| 73 | #endif /* CONFIG_OF */ | 73 | #endif /* CONFIG_OF */ |
| 74 | 74 | ||
| 75 | #if defined(CONFIG_OF) && defined(CONFIG_FIXED_PHY) | ||
| 76 | extern int of_phy_register_fixed_link(struct device_node *np); | ||
| 77 | extern bool of_phy_is_fixed_link(struct device_node *np); | ||
| 78 | #else | ||
| 79 | static inline int of_phy_register_fixed_link(struct device_node *np) | ||
| 80 | { | ||
| 81 | return -ENOSYS; | ||
| 82 | } | ||
| 83 | static inline bool of_phy_is_fixed_link(struct device_node *np) | ||
| 84 | { | ||
| 85 | return false; | ||
| 86 | } | ||
| 87 | #endif | ||
| 88 | |||
| 89 | |||
| 75 | #endif /* __LINUX_OF_MDIO_H */ | 90 | #endif /* __LINUX_OF_MDIO_H */ |
diff --git a/include/linux/phy_fixed.h b/include/linux/phy_fixed.h index 509d8f5f984e..4f2478b47136 100644 --- a/include/linux/phy_fixed.h +++ b/include/linux/phy_fixed.h | |||
| @@ -9,15 +9,26 @@ struct fixed_phy_status { | |||
| 9 | int asym_pause; | 9 | int asym_pause; |
| 10 | }; | 10 | }; |
| 11 | 11 | ||
| 12 | struct device_node; | ||
| 13 | |||
| 12 | #ifdef CONFIG_FIXED_PHY | 14 | #ifdef CONFIG_FIXED_PHY |
| 13 | extern int fixed_phy_add(unsigned int irq, int phy_id, | 15 | extern int fixed_phy_add(unsigned int irq, int phy_id, |
| 14 | struct fixed_phy_status *status); | 16 | struct fixed_phy_status *status); |
| 17 | extern int fixed_phy_register(unsigned int irq, | ||
| 18 | struct fixed_phy_status *status, | ||
| 19 | struct device_node *np); | ||
| 15 | #else | 20 | #else |
| 16 | static inline int fixed_phy_add(unsigned int irq, int phy_id, | 21 | static inline int fixed_phy_add(unsigned int irq, int phy_id, |
| 17 | struct fixed_phy_status *status) | 22 | struct fixed_phy_status *status) |
| 18 | { | 23 | { |
| 19 | return -ENODEV; | 24 | return -ENODEV; |
| 20 | } | 25 | } |
| 26 | static inline int fixed_phy_register(unsigned int irq, | ||
| 27 | struct fixed_phy_status *status, | ||
| 28 | struct device_node *np) | ||
| 29 | { | ||
| 30 | return -ENODEV; | ||
| 31 | } | ||
| 21 | #endif /* CONFIG_FIXED_PHY */ | 32 | #endif /* CONFIG_FIXED_PHY */ |
| 22 | 33 | ||
| 23 | /* | 34 | /* |
