* [PATCH v2 4/7] fsl_pq_mdio: Add Suport for etsec2.0 devices.
@ 2009-10-27 16:55 Sandeep Gopalpet
2009-10-28 9:43 ` David Miller
0 siblings, 1 reply; 9+ messages in thread
From: Sandeep Gopalpet @ 2009-10-27 16:55 UTC (permalink / raw)
To: netdev; +Cc: davem, Sandeep Gopalpet
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(-)
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,
--
1.5.2.2
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH v2 4/7] fsl_pq_mdio: Add Suport for etsec2.0 devices.
2009-10-27 16:55 [PATCH v2 4/7] fsl_pq_mdio: Add Suport for etsec2.0 devices Sandeep Gopalpet
@ 2009-10-28 9:43 ` David Miller
2009-10-28 12:00 ` Kumar Gopalpet-B05799
2009-10-29 9:32 ` Kumar Gopalpet-B05799
0 siblings, 2 replies; 9+ messages in thread
From: David Miller @ 2009-10-28 9:43 UTC (permalink / raw)
To: sandeep.kumar; +Cc: netdev
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.
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [PATCH v2 4/7] fsl_pq_mdio: Add Suport for etsec2.0 devices.
2009-10-28 9:43 ` David Miller
@ 2009-10-28 12:00 ` Kumar Gopalpet-B05799
2009-10-29 9:32 ` Kumar Gopalpet-B05799
1 sibling, 0 replies; 9+ messages in thread
From: Kumar Gopalpet-B05799 @ 2009-10-28 12:00 UTC (permalink / raw)
To: netdev; +Cc: David Miller
>-----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.
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [PATCH v2 4/7] fsl_pq_mdio: Add Suport for etsec2.0 devices.
2009-10-28 9:43 ` David Miller
2009-10-28 12:00 ` Kumar Gopalpet-B05799
@ 2009-10-29 9:32 ` Kumar Gopalpet-B05799
2009-10-29 9:45 ` David Miller
1 sibling, 1 reply; 9+ messages in thread
From: Kumar Gopalpet-B05799 @ 2009-10-29 9:32 UTC (permalink / raw)
To: netdev; +Cc: David Miller, avorontsov
>-----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
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 4/7] fsl_pq_mdio: Add Suport for etsec2.0 devices.
2009-10-29 9:32 ` Kumar Gopalpet-B05799
@ 2009-10-29 9:45 ` David Miller
2009-10-29 10:11 ` Kumar Gopalpet-B05799
0 siblings, 1 reply; 9+ messages in thread
From: David Miller @ 2009-10-29 9:45 UTC (permalink / raw)
To: B05799; +Cc: netdev, avorontsov
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.
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [PATCH v2 4/7] fsl_pq_mdio: Add Suport for etsec2.0 devices.
2009-10-29 9:45 ` David Miller
@ 2009-10-29 10:11 ` Kumar Gopalpet-B05799
2009-10-29 10:16 ` David Miller
0 siblings, 1 reply; 9+ messages in thread
From: Kumar Gopalpet-B05799 @ 2009-10-29 10:11 UTC (permalink / raw)
To: netdev; +Cc: avorontsov, David Miller
>-----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
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 4/7] fsl_pq_mdio: Add Suport for etsec2.0 devices.
2009-10-29 10:11 ` Kumar Gopalpet-B05799
@ 2009-10-29 10:16 ` David Miller
2009-10-29 10:33 ` Kumar Gopalpet-B05799
0 siblings, 1 reply; 9+ messages in thread
From: David Miller @ 2009-10-29 10:16 UTC (permalink / raw)
To: B05799; +Cc: netdev, avorontsov
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 :-)
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [PATCH v2 4/7] fsl_pq_mdio: Add Suport for etsec2.0 devices.
2009-10-29 10:16 ` David Miller
@ 2009-10-29 10:33 ` Kumar Gopalpet-B05799
2009-10-29 10:43 ` David Miller
0 siblings, 1 reply; 9+ messages in thread
From: Kumar Gopalpet-B05799 @ 2009-10-29 10:33 UTC (permalink / raw)
To: David Miller; +Cc: netdev, avorontsov
>-----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
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 4/7] fsl_pq_mdio: Add Suport for etsec2.0 devices.
2009-10-29 10:33 ` Kumar Gopalpet-B05799
@ 2009-10-29 10:43 ` David Miller
0 siblings, 0 replies; 9+ messages in thread
From: David Miller @ 2009-10-29 10:43 UTC (permalink / raw)
To: B05799; +Cc: netdev, avorontsov
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.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2009-10-29 10:43 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-27 16:55 [PATCH v2 4/7] fsl_pq_mdio: Add Suport for etsec2.0 devices Sandeep Gopalpet
2009-10-28 9:43 ` David Miller
2009-10-28 12:00 ` Kumar Gopalpet-B05799
2009-10-29 9:32 ` Kumar Gopalpet-B05799
2009-10-29 9:45 ` David Miller
2009-10-29 10:11 ` Kumar Gopalpet-B05799
2009-10-29 10:16 ` David Miller
2009-10-29 10:33 ` Kumar Gopalpet-B05799
2009-10-29 10:43 ` David Miller
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).