1 From 350a4e8e9d517d2d7c48bc915da5b1e30163add3 Mon Sep 17 00:00:00 2001
2 From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
3 Date: Mon, 15 Jul 2013 17:34:10 +0200
4 Subject: [PATCH 082/203] net: mvneta: add support for fixed links
6 Following the introduction of of_phy_register_fixed_link(), this patch
7 introduces fixed link support in the mvneta driver, for Marvell Armada
10 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
12 .../bindings/net/marvell-armada-370-neta.txt | 24 +++++++++++++++++++---
13 drivers/net/ethernet/marvell/mvneta.c | 18 +++++++++++-----
14 2 files changed, 34 insertions(+), 8 deletions(-)
16 --- a/Documentation/devicetree/bindings/net/marvell-armada-370-neta.txt
17 +++ b/Documentation/devicetree/bindings/net/marvell-armada-370-neta.txt
18 @@ -4,13 +4,21 @@ Required properties:
19 - compatible: should be "marvell,armada-370-neta".
20 - reg: address and length of the register set for the device.
21 - interrupts: interrupt for the device
22 -- phy: A phandle to a phy node defining the PHY address (as the reg
23 - property, a single integer).
24 - phy-mode: The interface between the SoC and the PHY (a string that
25 of_get_phy_mode() can understand)
26 - clocks: a pointer to the reference clock for this device.
31 +- phy: A phandle to a phy node defining the PHY address (as the reg
32 + property, a single integer). Note: if this property isn't present,
33 + then fixed link is assumed, and the 'fixed-link' property is
35 +- fixed-link: A 5 elements array that describe a fixed link, see
36 + fixed-link.txt for details. Note: if a 'phy' property is present,
37 + this 'fixed-link' property is ignored.
42 compatible = "marvell,armada-370-neta";
43 @@ -21,3 +29,13 @@ ethernet@d0070000 {
45 phy-mode = "rgmii-id";
49 + compatible = "marvell,armada-370-neta";
50 + reg = <0xd0070000 0x2500>;
52 + clocks = <&gate_clk 4>;
54 + fixed-link = <1 1 1000 0 0>;
55 + phy-mode = "rgmii-id";
57 --- a/drivers/net/ethernet/marvell/mvneta.c
58 +++ b/drivers/net/ethernet/marvell/mvneta.c
59 @@ -2360,8 +2360,12 @@ static int mvneta_mdio_probe(struct mvne
61 struct phy_device *phy_dev;
63 - phy_dev = of_phy_connect(pp->dev, pp->phy_node, mvneta_adjust_link, 0,
66 + phy_dev = of_phy_connect(pp->dev, pp->phy_node, mvneta_adjust_link, 0,
69 + phy_dev = of_phy_connect_fixed_link(pp->dev, mvneta_adjust_link,
72 netdev_err(pp->dev, "could not find the PHY\n");
74 @@ -2719,9 +2723,13 @@ static int mvneta_probe(struct platform_
76 phy_node = of_parse_phandle(dn, "phy", 0);
78 - dev_err(&pdev->dev, "no associated PHY\n");
81 + /* No 'phy' found, see if we have a 'fixed-link'
83 + err = of_phy_register_fixed_link(dn);
85 + dev_err(&pdev->dev, "no 'phy' or 'fixed-link' properties\n");
90 phy_mode = of_get_phy_mode(dn);