Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1681570
| From | Alvaro Gamez Machado <alvaro.gamez@hazent.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] net: axienet: add of_phy_connect call for XAE_PHY_TYPE_MII case |
| Date | 2017-07-05 16:50 +0200 |
| Message-ID | <tZTMS-7yB-21@gated-at.bofh.it> (permalink) |
| References | (1 earlier) <tY83E-8nx-17@gated-at.bofh.it> <tYKiC-su-25@gated-at.bofh.it> <tZyS6-2nd-1@gated-at.bofh.it> <tZPzA-4Wj-21@gated-at.bofh.it> <tZTDb-7v9-13@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Wed, Jul 05, 2017 at 04:34:36PM +0200, Andrew Lunn wrote:
> So the only property which is currently wrong is xlnx,phy-type. As you
> said, all the others are garbage. So i would suggest something like:
>
> diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> index 33c595f4691d..34a514d3288a 100644
> --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> @@ -1539,7 +1539,38 @@ static int axienet_probe(struct platform_device *pdev)
> * the device-tree and accordingly set flags.
> */
> of_property_read_u32(pdev->dev.of_node, "xlnx,rxmem", &lp->rxmem);
> - of_property_read_u32(pdev->dev.of_node, "xlnx,phy-type", &lp->phy_type);
> +
> + /* Start with the proprietary, and broken phy_type */
> + err = of_property_read_u32(pdev->dev.of_node, "xlnx,phy-type", &phy_type);
> + if (!err) {
> + netdev_warn(ndev, "Please upgrade your device tree binary blob to use phy-mode");
> + switch (phy_type) {
> + case XAE_PHY_TYPE_MII:
> + lp->phy_mode = PHY_INTERFACE_MODE_MII;
> + break;
> + case XAE_PHY_TYPE_GMII:
> + lp->phy_mode = PHY_INTERFACE_MODE_GMII;
> + break;
> + case XAE_PHY_TYPE_RGMII_2_0:
> + lp->phy_mode = PHY_INTERFACE_MODE_RGMII;
> + break;
> + case XAE_PHY_TYPE_SGMII:
> + lp->pht_mode = PHY_INTERFACE_MODE_SGMII;
> + break;
> + case XAE_PHY_TYPE_1000BASE_X:
> + lp->pht_mode = PHY_INTERFACE_MODE_1000BASEX;
> + break;
> + default:
> + ret = -EINVAL;
> + goto free_netdev;
> + }
> + } else {
> + lp->phy_mode = of_get_phy_mode(pdev->dev.of_node);
> + if (lp->phy_mode < 0) {
> + ret = -EINVAL;
> + goto free_netdev;
> + }
> + }
>
> /* Find the DMA node, map the DMA registers, and decode the DMA IRQs */
> np = of_parse_phandle(pdev->dev.of_node, "axistream-connected", 0);
>
> Andrew
That sounds really respectful with current users and sets the basis for a
future removal of that proprietary parameter without causing more harm than
needed, so I like that a lot.
--
Alvaro G. M.
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: [PATCH] net: axienet: add of_phy_connect call for XAE_PHY_TYPE_MII case Florian Fainelli <f.fainelli@gmail.com> - 2017-07-04 18:30 +0200
Re: [PATCH] net: axienet: add of_phy_connect call for XAE_PHY_TYPE_MII case Alvaro Gamez Machado <alvaro.gamez@hazent.com> - 2017-07-05 12:20 +0200
Re: [PATCH] net: axienet: add of_phy_connect call for XAE_PHY_TYPE_MII case Andrew Lunn <andrew@lunn.ch> - 2017-07-05 16:40 +0200
Re: [PATCH] net: axienet: add of_phy_connect call for XAE_PHY_TYPE_MII case Alvaro Gamez Machado <alvaro.gamez@hazent.com> - 2017-07-05 16:50 +0200
Re: [PATCH] net: axienet: add of_phy_connect call for XAE_PHY_TYPE_MII case Andrew Lunn <andrew@lunn.ch> - 2017-07-05 17:30 +0200
csiph-web