diff mbox

micrel: add support for KSZ8041RNLI

Message ID 201312100220.42153.sergei.shtylyov@cogentembedded.com (mailing list archive)
State Accepted
Commit 4bd7b5127bd02c12c1cc837a7a0b6ce295eb2505
Headers show

Commit Message

Sergei Shtylyov Dec. 9, 2013, 11:20 p.m. UTC
Renesas R-Car development boards use KSZ8041RNLI PHY which for some reason has
ID of 0x00221537 that is not documented for KSZ8041-family PHYs and does not
match the  documented ID of  0x0022151x (where 'x' is the revision).  We have
to add the new #define PHY_ID_* and new ksphy_driver[] entry, almost the same
as KSZ8041 one, differing only in the 'phy_id' and 'name' fields. 

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

---
This patch is atop of DaveM's 'net-next.git' repo.

 drivers/net/phy/micrel.c   |   15 +++++++++++++++
 include/linux/micrel_phy.h |    2 ++
 2 files changed, 17 insertions(+)

--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Geert Uytterhoeven Dec. 10, 2013, 1:19 p.m. UTC | #1
Hi Sergei,

On Tue, Dec 10, 2013 at 12:20 AM, Sergei Shtylyov
<sergei.shtylyov@cogentembedded.com> wrote:
> Renesas R-Car development boards use KSZ8041RNLI PHY which for some reason has
> ID of 0x00221537 that is not documented for KSZ8041-family PHYs and does not
> match the  documented ID of  0x0022151x (where 'x' is the revision).  We have
> to add the new #define PHY_ID_* and new ksphy_driver[] entry, almost the same
> as KSZ8041 one, differing only in the 'phy_id' and 'name' fields.
>
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>

I don't seem to get "net eth0: Receive FIFO Overflow" anymore after applying
this patch.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sergei Shtylyov Dec. 10, 2013, 5:21 p.m. UTC | #2
Hello.

On 10-12-2013 17:19, Geert Uytterhoeven wrote:

>> Renesas R-Car development boards use KSZ8041RNLI PHY which for some reason has
>> ID of 0x00221537 that is not documented for KSZ8041-family PHYs and does not
>> match the  documented ID of  0x0022151x (where 'x' is the revision).  We have
>> to add the new #define PHY_ID_* and new ksphy_driver[] entry, almost the same
>> as KSZ8041 one, differing only in the 'phy_id' and 'name' fields.

>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

> Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>

    Thanks. Though it's not the last version probably...

> I don't seem to get "net eth0: Receive FIFO Overflow" anymore after applying
> this patch.

    Cool.
    So you also enabled the Micrel PHY driver in .config? Asking because it's 
not in 'koelsch_defconfig' or any other R-Car defconfig yet...

> Gr{oetje,eeting}s,
>
>                          Geert

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Geert Uytterhoeven Dec. 10, 2013, 7:05 p.m. UTC | #3
On Tue, Dec 10, 2013 at 6:21 PM, Sergei Shtylyov
<sergei.shtylyov@cogentembedded.com> wrote:
>> I don't seem to get "net eth0: Receive FIFO Overflow" anymore after
>> applying
>> this patch.
>
>
>    Cool.
>    So you also enabled the Micrel PHY driver in .config? Asking because it's
> not in 'koelsch_defconfig' or any other R-Car defconfig yet...

Of course, CONFIG_MICREL_PHY=y. Dmesg before and after:

-net eth0: attached phy 1 to driver Generic PHY
+net eth0: attached phy 1 to driver Micrel KSZ8041RNLI
 libphy: r8a7791-ether-ff:01 - Link is Up - 100/Full

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Dec. 11, 2013, 3:26 a.m. UTC | #4
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date: Tue, 10 Dec 2013 02:20:41 +0300

> Renesas R-Car development boards use KSZ8041RNLI PHY which for some reason has
> ID of 0x00221537 that is not documented for KSZ8041-family PHYs and does not
> match the  documented ID of  0x0022151x (where 'x' is the revision).  We have
> to add the new #define PHY_ID_* and new ksphy_driver[] entry, almost the same
> as KSZ8041 one, differing only in the 'phy_id' and 'name' fields. 
> 
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> 
> ---
> This patch is atop of DaveM's 'net-next.git' repo.

You said something to Geert about "Though it's not the last version
probably..." are you talking about this patch needing more revisions?
If so, please make it explicit that you are posting something that is
just for feedback and not applying by using "RFC" in the subject line.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sergei Shtylyov Dec. 11, 2013, 3:39 p.m. UTC | #5
Hello.

On 11-12-2013 7:26, David Miller wrote:

>> Renesas R-Car development boards use KSZ8041RNLI PHY which for some reason has
>> ID of 0x00221537 that is not documented for KSZ8041-family PHYs and does not
>> match the  documented ID of  0x0022151x (where 'x' is the revision).  We have
>> to add the new #define PHY_ID_* and new ksphy_driver[] entry, almost the same
>> as KSZ8041 one, differing only in the 'phy_id' and 'name' fields.

>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

>> ---
>> This patch is atop of DaveM's 'net-next.git' repo.

> You said something to Geert about "Though it's not the last version
> probably..." are you talking about this patch needing more revisions?

    Well, maybe. I half-expected some criticisms. My changelog was somewhat 
tautological, and I'm not sure about the ID mask, perhaps it should be 
0x00ffffff to also cover the revision field. Since the ID is totally 
undocumented, I'm just not very sure how to deal with it properly.

> If so, please make it explicit that you are posting something that is
> just for feedback and not applying by using "RFC" in the subject line.

    At the time of sending I intended it to be applied, if no negative 
comments would have been posted.

> Thanks.

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Dec. 11, 2013, 6:58 p.m. UTC | #6
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date: Tue, 10 Dec 2013 02:20:41 +0300

> Renesas R-Car development boards use KSZ8041RNLI PHY which for some reason has
> ID of 0x00221537 that is not documented for KSZ8041-family PHYs and does not
> match the  documented ID of  0x0022151x (where 'x' is the revision).  We have
> to add the new #define PHY_ID_* and new ksphy_driver[] entry, almost the same
> as KSZ8041 one, differing only in the 'phy_id' and 'name' fields. 
> 
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> 
> ---
> This patch is atop of DaveM's 'net-next.git' repo.

Since this is just a simple device ID addition, I applied this to
'net', thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Dec. 11, 2013, 9:11 p.m. UTC | #7
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date: Thu, 12 Dec 2013 00:28:47 +0300

>    Hm, thanks, of course. But I don't see much difference w/my 'sh_eth'
>    driver patch adding support for R8A7791 which you've queued for
>    3.14. Oh, well, not that it matters much...

Sorry about that, want me to put it into 'net' too?
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sergei Shtylyov Dec. 11, 2013, 9:28 p.m. UTC | #8
Hello.

On 12/11/2013 09:58 PM, David Miller wrote:

>> Renesas R-Car development boards use KSZ8041RNLI PHY which for some reason has
>> ID of 0x00221537 that is not documented for KSZ8041-family PHYs and does not
>> match the  documented ID of  0x0022151x (where 'x' is the revision).  We have
>> to add the new #define PHY_ID_* and new ksphy_driver[] entry, almost the same
>> as KSZ8041 one, differing only in the 'phy_id' and 'name' fields.

>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

>> ---
>> This patch is atop of DaveM's 'net-next.git' repo.

> Since this is just a simple device ID addition, I applied this to
> 'net', thanks.

    Hm, thanks, of course. But I don't see much difference w/my 'sh_eth' 
driver patch adding support for R8A7791 which you've queued for 3.14. Oh, 
well, not that it matters much...

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Dec. 11, 2013, 10:10 p.m. UTC | #9
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date: Thu, 12 Dec 2013 02:02:16 +0300

>    Well, the R8A7791 Ether platform support should appear only in 3.14,
>    so don't bother. I just wanted to understand the principle you
>    follow...

Generally speaking, if the change to support a new device is simply
a matter of adding a new device ID I tend to queue it up for 'net'.
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sergei Shtylyov Dec. 11, 2013, 11:02 p.m. UTC | #10
Hello.

On 12/12/2013 12:11 AM, David Miller wrote:

>>     Hm, thanks, of course. But I don't see much difference w/my 'sh_eth'
>>     driver patch adding support for R8A7791 which you've queued for
>>     3.14. Oh, well, not that it matters much...

> Sorry about that, want me to put it into 'net' too?

    Well, the R8A7791 Ether platform support should appear only in 3.14, so 
don't bother. I just wanted to understand the principle you follow...

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

Index: net-next/drivers/net/phy/micrel.c
===================================================================
--- net-next.orig/drivers/net/phy/micrel.c
+++ net-next/drivers/net/phy/micrel.c
@@ -336,6 +336,21 @@  static struct phy_driver ksphy_driver[] 
 	.resume		= genphy_resume,
 	.driver		= { .owner = THIS_MODULE,},
 }, {
+	.phy_id		= PHY_ID_KSZ8041RNLI,
+	.phy_id_mask	= 0x00fffff0,
+	.name		= "Micrel KSZ8041RNLI",
+	.features	= PHY_BASIC_FEATURES |
+			  SUPPORTED_Pause | SUPPORTED_Asym_Pause,
+	.flags		= PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
+	.config_init	= kszphy_config_init,
+	.config_aneg	= genphy_config_aneg,
+	.read_status	= genphy_read_status,
+	.ack_interrupt	= kszphy_ack_interrupt,
+	.config_intr	= kszphy_config_intr,
+	.suspend	= genphy_suspend,
+	.resume		= genphy_resume,
+	.driver		= { .owner = THIS_MODULE,},
+}, {
 	.phy_id		= PHY_ID_KSZ8051,
 	.phy_id_mask	= 0x00fffff0,
 	.name		= "Micrel KSZ8051",
Index: net-next/include/linux/micrel_phy.h
===================================================================
--- net-next.orig/include/linux/micrel_phy.h
+++ net-next/include/linux/micrel_phy.h
@@ -22,6 +22,8 @@ 
 #define PHY_ID_KSZ8021		0x00221555
 #define PHY_ID_KSZ8031		0x00221556
 #define PHY_ID_KSZ8041		0x00221510
+/* undocumented */
+#define PHY_ID_KSZ8041RNLI	0x00221537
 #define PHY_ID_KSZ8051		0x00221550
 /* same id: ks8001 Rev. A/B, and ks8721 Rev 3. */
 #define PHY_ID_KSZ8001		0x0022161A