Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1684102

Re: [PATCH v2] net: axienet: add support for standard phy-mode binding

From Alvaro Gamez Machado <alvaro.gamez@hazent.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2] net: axienet: add support for standard phy-mode binding
Date 2017-07-10 11:50 +0200
Message-ID <u1Duj-3kz-35@gated-at.bofh.it> (permalink)
References <u0vp7-9I-3@gated-at.bofh.it> <u0F58-74W-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Jul 07, 2017 at 10:16:31AM -0700, Florian Fainelli wrote:
> On 07/06/2017 11:50 PM, Alvaro Gamez Machado wrote:
> > Keep supporting proprietary "xlnx,phy-type" attribute and add support for
> > MII connectivity to the PHY.
> > 
> > Signed-off-by: Alvaro Gamez Machado <alvaro.gamez@hazent.com>
> > ---
> > diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet.h b/drivers/net/ethernet/xilinx/xilinx_axienet.h
> > index af27f7d1cbf3..48e939a5fa31 100644
> > --- a/drivers/net/ethernet/xilinx/xilinx_axienet.h
> > +++ b/drivers/net/ethernet/xilinx/xilinx_axienet.h
> > @@ -389,7 +389,7 @@ struct axidma_bd {
> >   * @dma_err_tasklet: Tasklet structure to process Axi DMA errors
> >   * @tx_irq:	Axidma TX IRQ number
> >   * @rx_irq:	Axidma RX IRQ number
> > - * @phy_type:	Phy type to identify between MII/GMII/RGMII/SGMII/1000 Base-X
> > + * @phy_mode:	Phy type to identify between MII/GMII/RGMII/SGMII/1000 Base-X
> >   * @options:	AxiEthernet option word
> >   * @last_link:	Phy link state in which the PHY was negotiated earlier
> >   * @features:	Stores the extended features supported by the axienet hw
> > @@ -432,7 +432,7 @@ struct axienet_local {
> >  
> >  	int tx_irq;
> >  	int rx_irq;
> > -	u32 phy_type;
> > +	u32 phy_mode;
> 
> Can you use phy_interface_t here for storing this value?

Sure!

> 
> > @@ -1539,7 +1532,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 */
> > +	ret = of_property_read_u32(pdev->dev.of_node, "xlnx,phy-type", &value);
> > +	if (!ret) {
> > +		netdev_warn(ndev, "Please upgrade your device tree binary blob to use phy-mode");
> > +		switch (value) {
> > +		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;
> 
> This should be PHY_INTERFACE_MODE_RGMII_ID.

Yes, thank you, Andrew already noticed that. Sorry I didn't see it myself.

Since Andrew told me that netdev is closed for patches right now, I'll wait
until next week to send these changes.

Thanks to both of you for your assistance on this small patch!

-- 
Alvaro G. M.

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH v2] net: axienet: add support for standard phy-mode binding Alvaro Gamez Machado <alvaro.gamez@hazent.com> - 2017-07-07 09:00 +0200
  Re: [PATCH v2] net: axienet: add support for standard phy-mode  binding Andrew Lunn <andrew@lunn.ch> - 2017-07-07 16:10 +0200
  Re: [PATCH v2] net: axienet: add support for standard phy-mode  binding Florian Fainelli <f.fainelli@gmail.com> - 2017-07-07 19:20 +0200
    Re: [PATCH v2] net: axienet: add support for standard phy-mode  binding Alvaro Gamez Machado <alvaro.gamez@hazent.com> - 2017-07-10 11:50 +0200

csiph-web