From: Florian Fainelli <f.fainelli@gmail.com>
To: "Rafał Miłecki" <zajec5@gmail.com>,
"David S . Miller" <davem@davemloft.net>
Cc: "Jon Mason" <jon.mason@broadcom.com>,
"Felix Fietkau" <nbd@openwrt.org>,
netdev@vger.kernel.org, "Rafał Miłecki" <rafal@milecki.pl>
Subject: Re: [PATCH V2 3/3] net: bgmac: use PHY subsystem for initializing PHY
Date: Sat, 28 Jan 2017 19:08:31 -0800 [thread overview]
Message-ID: <08f74e19-f9b2-a0ea-ee21-d35cbdf6ee76@gmail.com> (raw)
In-Reply-To: <20170128210832.26174-4-zajec5@gmail.com>
On 01/28/2017 01:08 PM, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
>
> This adds support for using bgmac with PHYs supported by standalone PHY
> drivers. Having any PHY initialization in bgmac is hacky and shouldn't
> be extended but rather removed if anyone has hardware to test it.
>
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> ---
> drivers/net/ethernet/broadcom/bgmac-bcma-mdio.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/drivers/net/ethernet/broadcom/bgmac-bcma-mdio.c b/drivers/net/ethernet/broadcom/bgmac-bcma-mdio.c
> index 9d9984999dce..6ce80cbcb48e 100644
> --- a/drivers/net/ethernet/broadcom/bgmac-bcma-mdio.c
> +++ b/drivers/net/ethernet/broadcom/bgmac-bcma-mdio.c
> @@ -132,6 +132,10 @@ static void bcma_mdio_phy_init(struct bgmac *bgmac)
> struct bcma_chipinfo *ci = &bgmac->bcma.core->bus->chipinfo;
> u8 i;
>
> + /* For some legacy hardware we do chipset-based PHY initialization here
> + * without even detecting PHY ID. It's hacky and should be cleaned as
> + * soon as someone can test it.
> + */
> if (ci->id == BCMA_CHIP_ID_BCM5356) {
> for (i = 0; i < 5; i++) {
> bcma_mdio_phy_write(bgmac, i, 0x1f, 0x008b);
> @@ -140,6 +144,7 @@ static void bcma_mdio_phy_init(struct bgmac *bgmac)
> bcma_mdio_phy_write(bgmac, i, 0x12, 0x2aaa);
> bcma_mdio_phy_write(bgmac, i, 0x1f, 0x000b);
> }
> + return;
That part is clearly initializing the built-in Ethernet switch's PHYs,
and so the natural place for that would be to stick these init values
into the Broadcom PHY driver. When b53-srab/b53_common attaches the
switch, it will scan all of these port's builtin PHYs and bind to an
appropriate PHY driver which could have this initialization as part of
the config_init routine for instance. Right now, we are most likely
using the Generic PHY.
Here are the different PHY IDs you should read from these models if you
want to make a subsequent patch that moves this initialization down to
the Broadcom PHY driver:
5356: 0x03625DA0
5357/53572: 0x03625F00
4749: could either be 0x600D85F0 or the same as 53010 (0x600D8760),
unclear where that product came from... Jon, would you know by chance?
--
Florian
next prev parent reply other threads:[~2017-01-29 3:18 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-28 21:08 [PATCH V2 0/3] net-next: use one struct bgmac & add PHY support Rafał Miłecki
2017-01-28 21:08 ` [PATCH V2 1/3] net: bgmac: allocate struct bgmac just once & don't copy it Rafał Miłecki
2017-01-28 23:40 ` kbuild test robot
2017-01-29 20:03 ` Rafał Miłecki
2017-01-31 18:07 ` Florian Fainelli
2017-01-28 21:08 ` [PATCH V2 2/3] net: bgmac: drop struct bcma_mdio we don't need anymore Rafał Miłecki
2017-01-31 18:07 ` Florian Fainelli
2017-01-28 21:08 ` [PATCH V2 3/3] net: bgmac: use PHY subsystem for initializing PHY Rafał Miłecki
2017-01-29 3:08 ` Florian Fainelli [this message]
2017-01-29 20:14 ` Rafał Miłecki
[not found] ` <03584f21-6ea2-a6ea-3100-cf5b1ead4f0f@gmail.com>
2017-01-29 21:31 ` Rafał Miłecki
2017-01-29 22:36 ` Florian Fainelli
2017-01-30 7:02 ` Rafał Miłecki
2017-01-30 18:29 ` Florian Fainelli
2017-01-30 16:07 ` Jon Mason
2017-01-31 18:04 ` David Miller
2017-01-31 18:06 ` Florian Fainelli
2017-01-31 18:14 ` David Miller
2017-01-31 18:16 ` David Miller
2017-01-31 18:17 ` Rafał Miłecki
2017-01-31 18:07 ` Florian Fainelli
2017-01-31 18:37 ` [PATCH V3 0/3] net-next: use one struct bgmac & add PHY support Rafał Miłecki
2017-01-31 18:37 ` [PATCH V3 1/3] net: bgmac: allocate struct bgmac just once & don't copy it Rafał Miłecki
2017-01-31 18:37 ` [PATCH V3 2/3] net: bgmac: drop struct bcma_mdio we don't need anymore Rafał Miłecki
2017-01-31 18:37 ` [PATCH V3 3/3] net: bgmac: use PHY subsystem for initializing PHY Rafał Miłecki
2017-01-31 19:03 ` [PATCH V3 0/3] net-next: use one struct bgmac & add PHY support David Miller
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=08f74e19-f9b2-a0ea-ee21-d35cbdf6ee76@gmail.com \
--to=f.fainelli@gmail.com \
--cc=davem@davemloft.net \
--cc=jon.mason@broadcom.com \
--cc=nbd@openwrt.org \
--cc=netdev@vger.kernel.org \
--cc=rafal@milecki.pl \
--cc=zajec5@gmail.com \
/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).