diff mbox

[v2,4/7] fsl_pq_mdio: Add Suport for etsec2.0 devices.

Message ID 12566625182528-git-send-email-sandeep.kumar@freescale.com
State Not Applicable, archived
Delegated to: David Miller
Headers show

Commit Message

Sandeep Gopalpet Oct. 27, 2009, 4:55 p.m. UTC
This patch adds mdio support for etsec2.0 devices.

Modified the fsl_pq_mdio structure to include the new mdio
members.

Signed-off-by: Sandeep Gopalpet <sandeep.kumar@freescale.com>
---
 drivers/net/fsl_pq_mdio.c |   59 ++++++++++++++++++++++++++++++++++++--------
 drivers/net/fsl_pq_mdio.h |   11 +++++++-
 2 files changed, 57 insertions(+), 13 deletions(-)

Comments

David Miller Oct. 28, 2009, 9:43 a.m. UTC | #1
From: Sandeep Gopalpet <sandeep.kumar@freescale.com>
Date: Tue, 27 Oct 2009 22:25:18 +0530

> This patch adds mdio support for etsec2.0 devices.
> 
> Modified the fsl_pq_mdio structure to include the new mdio
> members.
> 
> Signed-off-by: Sandeep Gopalpet <sandeep.kumar@freescale.com>

This is the third time you've submitted this patch, and for
the third time it DOES NOT apply to net-next-2.6 at all when
I try to apply this gianfar patch series.

You must be patching against another tree that has some changes
that conflict with this one.

Sort this out before submitting this again.

If you submit once more this same series, and it doesn't apply
properly to net-next-2.6, I will flat our ignore your submissions
for a week or so.

You are wasting that much of my time by doing this over and over.

Get your act together.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Kumar Gopalpet-B05799 Oct. 28, 2009, noon UTC | #2
>-----Original Message-----
>From: David Miller [mailto:davem@davemloft.net] 
>Sent: Wednesday, October 28, 2009 3:13 PM
>To: Kumar Gopalpet-B05799
>Cc: netdev@vger.kernel.org
>Subject: Re: [PATCH v2 4/7] fsl_pq_mdio: Add Suport for 
>etsec2.0 devices.
>
>From: Sandeep Gopalpet <sandeep.kumar@freescale.com>
>Date: Tue, 27 Oct 2009 22:25:18 +0530
>
>> This patch adds mdio support for etsec2.0 devices.
>> 
>> Modified the fsl_pq_mdio structure to include the new mdio members.
>> 
>> Signed-off-by: Sandeep Gopalpet <sandeep.kumar@freescale.com>
>
>This is the third time you've submitted this patch, and for 
>the third time it DOES NOT apply to net-next-2.6 at all when I 
>try to apply this gianfar patch series.
>
>You must be patching against another tree that has some 
>changes that conflict with this one.
>

I had rebased and tested on the master branch of the following tree
http://www.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6.git

(The git protocol clone was not working, hence we used http)
If this is not the right tree, kindly correct me.
I could not find any other net-next-2.6 tree/branch on kernel.org.


I have updated the tree again, (though there is no change)
the last commit on the tree being :

commit b37b62fea1d1bf68ca51818f8eb1035188efd030
Author: Ben Hutchings <bhutchings@solarflare.com>
Date:   Fri Oct 23 08:33:42 2009 +0000

    sfc: Rename 'xfp' file and functions to reflect reality

    The 'XFP' driver is really a driver for the QT2022C2 and QT2025C
PHYs,
    covering both more and less than XFP.  Rename its functions and
    constants to reflect reality and to reduce namespace pollution when
    sfc is a built-in driver.

    Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

 
Also, I have merged it with the latest linux-next tree 
(It is already updated with the net-next-2.6.git)

>Sort this out before submitting this again.

I am working on it.
>
>If you submit once more this same series, and it doesn't apply 
>properly to net-next-2.6, I will flat our ignore your 
>submissions for a week or so.
>

>You are wasting that much of my time by doing this over and over.
I apologize for that.
>
>Get your act together.
>

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Kumar Gopalpet-B05799 Oct. 29, 2009, 9:32 a.m. UTC | #3
>-----Original Message-----
>From: David Miller [mailto:davem@davemloft.net] 
>Sent: Wednesday, October 28, 2009 3:13 PM
>To: Kumar Gopalpet-B05799
>Cc: netdev@vger.kernel.org
>Subject: Re: [PATCH v2 4/7] fsl_pq_mdio: Add Suport for 
>etsec2.0 devices.
>
>From: Sandeep Gopalpet <sandeep.kumar@freescale.com>
>Date: Tue, 27 Oct 2009 22:25:18 +0530
>
>> This patch adds mdio support for etsec2.0 devices.
>> 
>> Modified the fsl_pq_mdio structure to include the new mdio members.
>> 
>> Signed-off-by: Sandeep Gopalpet <sandeep.kumar@freescale.com>
>
>This is the third time you've submitted this patch, and for 
>the third time it DOES NOT apply to net-next-2.6 at all when I 
>try to apply this gianfar patch series.
>
>You must be patching against another tree that has some 
>changes that conflict with this one.
>
>Sort this out before submitting this again.
>
>If you submit once more this same series, and it doesn't apply 
>properly to net-next-2.6, I will flat our ignore your 
>submissions for a week or so.
>
>You are wasting that much of my time by doing this over and over.
>
>Get your act together.
>
>

 
Hi All,

I couldn't find the following commit on the net-next-2.6 tree:

commit e72701acbe0b35e52d3f04d442837c06b4e64f1c
Author: Anton Vorontsov <avorontsov@ru.mvista.com>
Date:   Wed Oct 14 14:54:52 2009 -0700

    net: Fix OF platform drivers coldplug/hotplug when compiled as
modules

    Some OF platform drivers are missing module device tables, so they
won't
    load automatically on boot. This patch fixes the issue by adding
proper
    MODULE_DEVICE_TABLE() macros to the drivers.

    Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>


The same commit is present on the linux-next tree

I cloned the 2 trees from the following links:
linux-next from:

http://www.kernel.org/pub/scm/linux/kernel/git/sfr/linux-next.git/

And net-next-2.6 from:

http://www.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6.git

The absence of the above mentioned commit in the net-next-2.6 tree is
causing
some issues with patches getting applied.

Can you let me know if the net-next-2.6 tree that I am cloning is the
proper one ?


I based all my patches on net-next-2.6 tree cloned from the above link.
But some how when David tries to apply
my patches they fail. I took a diff at the linux-next and net-next-2.6
and the said commit is missing.


-Thanks
Sandeep 
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Oct. 29, 2009, 9:45 a.m. UTC | #4
From: "Kumar Gopalpet-B05799" <B05799@freescale.com>
Date: Thu, 29 Oct 2009 15:02:44 +0530

> The absence of the above mentioned commit in the net-next-2.6 tree
> is causing some issues with patches getting applied.

You should never use linux-next as you base for working against
other people's trees.

Instead, clone net-next-2.6 and work purely against that when sending
me patches.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Kumar Gopalpet-B05799 Oct. 29, 2009, 10:11 a.m. UTC | #5
>-----Original Message-----
>From: David Miller [mailto:davem@davemloft.net] 
>Sent: Thursday, October 29, 2009 3:16 PM
>To: Kumar Gopalpet-B05799
>Cc: netdev@vger.kernel.org; avorontsov@ru.mvista.com
>Subject: Re: [PATCH v2 4/7] fsl_pq_mdio: Add Suport for 
>etsec2.0 devices.
>
>From: "Kumar Gopalpet-B05799" <B05799@freescale.com>
>Date: Thu, 29 Oct 2009 15:02:44 +0530
>
>> The absence of the above mentioned commit in the 
>net-next-2.6 tree is 
>> causing some issues with patches getting applied.
>
>You should never use linux-next as you base for working 
>against other people's trees.
>
>Instead, clone net-next-2.6 and work purely against that when 
>sending me patches.

This is the tree I generated the patches against initially. 
The initial set of patches were generated against this tree:
(http://www.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6.git)

Can you please confirm that the above tree is correct.

After you reported the failure, 
I merged against the linux-next tree, therein I too got a similar
failure.
The reason being the commit from Anton present in linux-next and absent
on net-next.

The patches sent by me applies cleanly to the above mentioned
net-next-2.6 tree. 


--

Thanks
Sandeep
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Oct. 29, 2009, 10:16 a.m. UTC | #6
From: "Kumar Gopalpet-B05799" <B05799@freescale.com>
Date: Thu, 29 Oct 2009 15:41:22 +0530

> This is the tree I generated the patches against initially. 
> The initial set of patches were generated against this tree:
> (http://www.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6.git)
> 
> Can you please confirm that the above tree is correct.

Yes.

> The patches sent by me applies cleanly to the above mentioned
> net-next-2.6 tree. 

It may have applied cleanly when you sent them, but by the
time I applied them it didn't.

Resend a fresh patch set against a fresh net-next-2.6 checkout
and let's see what happens :-)
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Kumar Gopalpet-B05799 Oct. 29, 2009, 10:33 a.m. UTC | #7
>-----Original Message-----
>From: David Miller [mailto:davem@davemloft.net] 
>Sent: Thursday, October 29, 2009 3:46 PM
>To: Kumar Gopalpet-B05799
>Cc: netdev@vger.kernel.org; avorontsov@ru.mvista.com
>Subject: Re: [PATCH v2 4/7] fsl_pq_mdio: Add Support for 
>etsec2.0 devices.
>
>From: "Kumar Gopalpet-B05799" <B05799@freescale.com>
>Date: Thu, 29 Oct 2009 15:41:22 +0530
>
>> This is the tree I generated the patches against initially. 
>> The initial set of patches were generated against this tree:
>> 
>(http://www.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6.git
>> )
>> 
>> Can you please confirm that the above tree is correct.
>
>Yes.

Thank you. I cloned this tree again about 2 hours ago (and updated it 5
mins ago as well).
git describe:
v2.6.32-rc3-464-gb37b62f

The last commit is: b37b62fea1d1bf68ca51818f8eb1035188efd030


>
>> The patches sent by me applies cleanly to the above mentioned
>> net-next-2.6 tree. 
>
>It may have applied cleanly when you sent them, but by the 
>time I applied them it didn't.

The PATCH v2 series applied cleanly to the above clone.

>
>Resend a fresh patch set against a fresh net-next-2.6 checkout 
>and let's see what happens :-)
Ok. But there is NO change to the patch set.


--

Thanks
Sandeep
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Oct. 29, 2009, 10:43 a.m. UTC | #8
From: "Kumar Gopalpet-B05799" <B05799@freescale.com>
Date: Thu, 29 Oct 2009 16:03:30 +0530

> The PATCH v2 series applied cleanly to the above clone.

It absolutely does NOT!

And I just tried it again to verify this, and you can try it yourself:

	http://vger.kernel.org/~davem/bundle-640.mbox

davem@sunset:~/src/GIT/net-next-2.6$ git am --signoff bundle-640.mbox 
Applying: gianfar: Add per queue structure support
Applying: gianfar: Introduce logical group support.
Applying: gianfar: Add Multiple Queue Support
Applying: fsl_pq_mdio: Add Suport for etsec2.0 devices.
error: patch failed: drivers/net/fsl_pq_mdio.c:405
error: drivers/net/fsl_pq_mdio.c: patch does not apply
Patch failed at 0004 fsl_pq_mdio: Add Suport for etsec2.0 devices.
When you have resolved this problem run "git am --resolved".
If you would prefer to skip this patch, instead run "git am --skip".
To restore the original branch and stop patching run "git am --abort".
davem@sunset:~/src/GIT/net-next-2.6$ 

So stop telling me it applies cleanly.

Because I've tried to do it multiple times and it absolutely does not.
--
To unsubscribe from this list: send the line "unsubscribe netdev" 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

diff --git a/drivers/net/fsl_pq_mdio.c b/drivers/net/fsl_pq_mdio.c
index d167090..6de7b24 100644
--- a/drivers/net/fsl_pq_mdio.c
+++ b/drivers/net/fsl_pq_mdio.c
@@ -3,8 +3,9 @@ 
  * Provides Bus interface for MIIM regs
  *
  * Author: Andy Fleming <afleming@freescale.com>
+ * Modifier: Sandeep Gopalpet <sandeep.kumar@freescale.com>
  *
- * Copyright (c) 2002-2004,2008 Freescale Semiconductor, Inc.
+ * Copyright 2002-2004, 2008-2009 Freescale Semiconductor, Inc.
  *
  * Based on gianfar_mii.c and ucc_geth_mii.c (Li Yang, Kim Phillips)
  *
@@ -189,19 +190,29 @@  static int fsl_pq_mdio_find_free(struct mii_bus *new_bus)
 
 
 #if defined(CONFIG_GIANFAR) || defined(CONFIG_GIANFAR_MODULE)
-static u32 __iomem *get_gfar_tbipa(struct fsl_pq_mdio __iomem *regs)
+static u32 __iomem *get_gfar_tbipa(struct fsl_pq_mdio __iomem *regs, struct device_node *np)
 {
 	struct gfar __iomem *enet_regs;
+	u32 __iomem *ioremap_tbipa;
+	u64 addr, size;
 
 	/*
 	 * This is mildly evil, but so is our hardware for doing this.
 	 * Also, we have to cast back to struct gfar because of
 	 * definition weirdness done in gianfar.h.
 	 */
-	enet_regs = (struct gfar __iomem *)
-		((char __iomem *)regs - offsetof(struct gfar, gfar_mii_regs));
-
-	return &enet_regs->tbipa;
+	if(of_device_is_compatible(np, "fsl,gianfar-mdio") ||
+		of_device_is_compatible(np, "fsl,gianfar-tbi") ||
+		of_device_is_compatible(np, "gianfar")) {
+		enet_regs = (struct gfar __iomem *)regs;
+		return &enet_regs->tbipa;
+	} else if (of_device_is_compatible(np, "fsl,etsec2-mdio") ||
+			of_device_is_compatible(np, "fsl,etsec2-tbi")) {
+		addr = of_translate_address(np, of_get_address(np, 1, &size, NULL));
+		ioremap_tbipa = ioremap(addr, size);
+		return ioremap_tbipa;
+	} else
+		return NULL;
 }
 #endif
 
@@ -250,11 +261,11 @@  static int fsl_pq_mdio_probe(struct of_device *ofdev,
 {
 	struct device_node *np = ofdev->node;
 	struct device_node *tbi;
-	struct fsl_pq_mdio __iomem *regs;
+	struct fsl_pq_mdio __iomem *regs = NULL;
 	u32 __iomem *tbipa;
 	struct mii_bus *new_bus;
 	int tbiaddr = -1;
-	u64 addr, size;
+	u64 addr = 0, size = 0, ioremap_miimcfg = 0;
 	int err = 0;
 
 	new_bus = mdiobus_alloc();
@@ -268,8 +279,22 @@  static int fsl_pq_mdio_probe(struct of_device *ofdev,
 	fsl_pq_mdio_bus_name(new_bus->id, np);
 
 	/* Set the PHY base address */
-	addr = of_translate_address(np, of_get_address(np, 0, &size, NULL));
-	regs = ioremap(addr, size);
+	if (of_device_is_compatible(np,"fsl,gianfar-mdio") ||
+		of_device_is_compatible(np, "fsl,gianfar-tbi") ||
+		of_device_is_compatible(np, "fsl,ucc-mdio") ||
+		of_device_is_compatible(np,"ucc_geth_phy" )) {
+		addr = of_translate_address(np, of_get_address(np, 0, &size, NULL));
+		ioremap_miimcfg =  container_of(addr, struct fsl_pq_mdio, miimcfg);
+		regs = ioremap(ioremap_miimcfg, size +
+				offsetof(struct fsl_pq_mdio, miimcfg));
+	} else if (of_device_is_compatible(np,"fsl,etsec2-mdio") ||
+			of_device_is_compatible(np, "fsl,etsec2-tbi")) {
+		addr = of_translate_address(np, of_get_address(np, 0, &size, NULL));
+		regs = ioremap(addr, size);
+	} else {
+		err = -EINVAL;
+		goto err_free_bus;
+	}
 
 	if (NULL == regs) {
 		err = -ENOMEM;
@@ -290,9 +315,15 @@  static int fsl_pq_mdio_probe(struct of_device *ofdev,
 
 	if (of_device_is_compatible(np, "fsl,gianfar-mdio") ||
 			of_device_is_compatible(np, "fsl,gianfar-tbi") ||
+			of_device_is_compatible(np, "fsl,etsec2-mdio") ||
+			of_device_is_compatible(np, "fsl,etsec2-tbi") ||
 			of_device_is_compatible(np, "gianfar")) {
 #if defined(CONFIG_GIANFAR) || defined(CONFIG_GIANFAR_MODULE)
-		tbipa = get_gfar_tbipa(regs);
+		tbipa = get_gfar_tbipa(regs, np);
+		if (!tbipa) {
+			err = -EINVAL;
+			goto err_free_irqs;
+		}
 #else
 		err = -ENODEV;
 		goto err_free_irqs;
@@ -405,6 +436,12 @@  static struct of_device_id fsl_pq_mdio_match[] = {
 	{
 		.compatible = "fsl,gianfar-mdio",
 	},
+	{
+		.compatible = "fsl,etsec2-tbi",
+	},
+	{
+		.compatible = "fsl,etsec2-mdio",
+	},
 	{},
 };
 
diff --git a/drivers/net/fsl_pq_mdio.h b/drivers/net/fsl_pq_mdio.h
index 36dad52..1f7d865 100644
--- a/drivers/net/fsl_pq_mdio.h
+++ b/drivers/net/fsl_pq_mdio.h
@@ -3,8 +3,9 @@ 
  * Driver for the MDIO bus controller on Freescale PowerQUICC processors
  *
  * Author: Andy Fleming
+ * Modifier: Sandeep Gopalpet
  *
- * Copyright (c) 2002-2004,2008 Freescale Semiconductor, Inc.
+ * Copyright 2002-2004, 2008-2009 Freescale Semiconductor, Inc.
  *
  * This program is free software; you can redistribute  it and/or modify it
  * under  the terms of  the GNU General  Public License as published by the
@@ -23,6 +24,12 @@ 
 #define MII_READ_COMMAND       0x00000001
 
 struct fsl_pq_mdio {
+	u8 res1[16];
+	u32 ieventm;	/* MDIO Interrupt event register (for etsec2)*/
+	u32 imaskm;	/* MDIO Interrupt mask register (for etsec2)*/
+	u8 res2[4];
+	u32 emapm;	/* MDIO Event mapping register (for etsec2)*/
+	u8 res3[1280];
 	u32 miimcfg;		/* MII management configuration reg */
 	u32 miimcom;		/* MII management command reg */
 	u32 miimadd;		/* MII management address reg */
@@ -31,9 +38,9 @@  struct fsl_pq_mdio {
 	u32 miimind;		/* MII management indication reg */
 	u8 reserved[28];	/* Space holder */
 	u32 utbipar;		/* TBI phy address reg (only on UCC) */
+	u8 res4[2728];
 } __attribute__ ((packed));
 
-
 int fsl_pq_mdio_read(struct mii_bus *bus, int mii_id, int regnum);
 int fsl_pq_mdio_write(struct mii_bus *bus, int mii_id, int regnum, u16 value);
 int fsl_pq_local_mdio_write(struct fsl_pq_mdio __iomem *regs, int mii_id,