devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Timur Tabi <timur@codeaurora.org>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	sdharia@codeaurora.org,
	Shanker Donthineni <shankerd@codeaurora.org>,
	Greg Kroah-Hartman <greg@kroah.com>,
	vikrams@codeaurora.org, cov@codeaurora.org,
	gavidov@codeaurora.org, Rob Herring <robh+dt@kernel.org>,
	andrew@lunn.ch, bjorn.andersson@linaro.org,
	Mark Langsdorf <mlangsdo@redhat.com>,
	Jon Masters <jcm@redhat.com>, Andy Gross <agross@codeaurora.org>,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH 1/2] [v4] net: emac: emac gigabit ethernet controller driver
Date: Fri, 22 Apr 2016 12:56:55 -0700	[thread overview]
Message-ID: <571A8207.60704@gmail.com> (raw)
In-Reply-To: <571A7F3D.1070609@codeaurora.org>

On 22/04/16 12:45, Timur Tabi wrote:
> Timur Tabi wrote:
>>>
>>
>> So I've done some more research, and I believe that the internal phy is
>> not a candidate for phylib, but the external phy (which is a real phy)
>> might be.  There's no MDIO bus to the internal phy.
>>
>> Does this mean that I will need to enable a PHY driver, and that driver
>> will control the external phy?  If so, then does that mean that I would
>> delete all to code in my driver that calls emac_phy_read() and
>> emac_phy_write()?  For example, I wouldn't need emac_phy_link_check()
>> any more?
> 
> So I think I have it partially working, but I'm not sure if I'm doing
> things correctly, and I'd like some help.
> 
> The external phy is an Atheros 8031, so I load the at803x driver.  I
> added this code to my driver:
> 
>     mii_bus = devm_mdiobus_alloc(&pdev->dev);
>     mii_bus->phy_mask = ~(1 << adpt->hw.phy_addr);
>     mii_bus->read = emac_mdio_read;
>     mii_bus->write = emac_mdio_write;
>     mii_bus->reset = emac_mdio_reset;
>     mii_bus->parent = &pdev->dev;
>     mii_bus->priv = hw;
> 
>     mdiobus_register(mii_bus);
> 
> When I call mdiobus_register, I can see that the at803x_probe() probe
> function is called, so a connection is made.
> 
> The problem is that after that point, it appears that the at803x driver
> is never called again.  I tried bring the interface up and down, and
> connecting and disconnecting an Ethernet cable, but that didn't trigger
> anything.  I would expect the PHY driver to do more than just probe.

Are you utilizing the PHYLIB APIs properly? You need at least a
phy_start() to start the PHY state machine, and an adjust_link callback
to be provided to phy_connect() (or of_phy_connect()) to manage link
state changes. And that's the very basic minimum here, there could be
additional APIs that you may end up using.

There are tons of example in tree of drivers doing this, bcmgenet,
bcmsysport, tg3 etc.
-- 
Florian

  reply	other threads:[~2016-04-22 19:56 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-13 17:59 [PATCH 1/2] [v4] net: emac: emac gigabit ethernet controller driver Timur Tabi
2016-04-13 17:59 ` [PATCH 2/2] MAINTAINERS: add Qualcomm EMAC network driver maintainer Timur Tabi
2016-04-13 19:22 ` [PATCH 1/2] [v4] net: emac: emac gigabit ethernet controller driver kbuild test robot
2016-04-13 19:31   ` Timur Tabi
2016-04-13 19:40     ` Shanker Donthineni
2016-04-13 19:55       ` Timur Tabi
2016-04-13 20:07         ` Bjørn Mork
2016-04-14 16:24     ` Rob Herring
2016-04-13 22:16 ` Florian Fainelli
2016-04-14 20:19   ` Timur Tabi
2016-04-14 21:19     ` Florian Fainelli
2016-04-14 22:00       ` Vikram Sethi
2016-04-14 23:34         ` Timur Tabi
2016-04-15 12:35           ` Rob Herring
2016-04-15 15:44             ` Timur Tabi
2016-04-15 15:59               ` Rob Herring
2016-04-15 17:23                 ` Timur Tabi
     [not found]           ` <57102920.7000104-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2016-04-15 16:44             ` Bjorn Andersson
2016-04-15 17:00               ` Timur Tabi
2016-04-15 17:35                 ` Bjorn Andersson
2016-04-15 18:22                   ` Timur Tabi
2016-04-21 18:03       ` Timur Tabi
2016-04-22 19:45         ` Timur Tabi
2016-04-22 19:56           ` Florian Fainelli [this message]
2016-05-10 23:18             ` Timur Tabi
2016-05-10 23:26               ` Florian Fainelli
2016-05-11  2:24                 ` Timur Tabi
2016-05-11 20:27                   ` Timur Tabi
2016-04-25 13:16         ` Andrew Lunn
2016-06-01 22:27   ` Timur Tabi
     [not found] ` <1460570393-19838-1-git-send-email-timur-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2016-04-14  3:27   ` kbuild test robot
2016-04-14 16:32 ` Rob Herring
2016-04-14 16:47   ` Timur Tabi
2016-04-14 17:18     ` Rob Herring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=571A8207.60704@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=agross@codeaurora.org \
    --cc=andrew@lunn.ch \
    --cc=bjorn.andersson@linaro.org \
    --cc=cov@codeaurora.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=gavidov@codeaurora.org \
    --cc=greg@kroah.com \
    --cc=jcm@redhat.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mlangsdo@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=sdharia@codeaurora.org \
    --cc=shankerd@codeaurora.org \
    --cc=timur@codeaurora.org \
    --cc=vikrams@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).