* [PATCH] Add Fixed PHY support for ucc_geth
@ 2008-03-18 9:46 Joakim Tjernlund
2008-03-18 16:32 ` Vitaly Bordug
2008-03-21 8:51 ` Li Yang
0 siblings, 2 replies; 4+ messages in thread
From: Joakim Tjernlund @ 2008-03-18 9:46 UTC (permalink / raw)
To: Netdev, Li Yang, Linuxppc-Embedded@Ozlabs.Org; +Cc: Joakim Tjernlund
The new Fixed PHY method, fixed-link property, isn't
impl. for ucc_geth which makes fixed PHYs non functional.
Add support for the new method to restore the Fixed PHY
functionality.
Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
---
This is a regression as fixed PHYs works in 2.6.23 and I am
using it.
drivers/net/ucc_geth.c | 53 +++++++++++++++++++++++++++--------------------
1 files changed, 30 insertions(+), 23 deletions(-)
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index ecc5712..18c8b39 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -3836,6 +3836,7 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
struct device_node *phy;
int err, ucc_num, max_speed = 0;
const phandle *ph;
+ const u32 *fixed_link;
const unsigned int *prop;
const char *sprop;
const void *mac_addr;
@@ -3926,18 +3927,38 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
ug_info->uf_info.regs = res.start;
ug_info->uf_info.irq = irq_of_parse_and_map(np, 0);
+ fixed_link = of_get_property(np, "fixed-link", NULL);
+ if (fixed_link) {
+ ug_info->mdio_bus = 0;
+ ug_info->phy_address = fixed_link[0];
+ phy = NULL;
+ } else {
+ ph = of_get_property(np, "phy-handle", NULL);
+ phy = of_find_node_by_phandle(*ph);
- ph = of_get_property(np, "phy-handle", NULL);
- phy = of_find_node_by_phandle(*ph);
+ if (phy == NULL)
+ return -ENODEV;
- if (phy == NULL)
- return -ENODEV;
+ /* set the PHY address */
+ prop = of_get_property(phy, "reg", NULL);
+ if (prop == NULL)
+ return -1;
+ ug_info->phy_address = *prop;
+
+ /* Set the bus id */
+ mdio = of_get_parent(phy);
+
+ if (mdio == NULL)
+ return -1;
- /* set the PHY address */
- prop = of_get_property(phy, "reg", NULL);
- if (prop == NULL)
- return -1;
- ug_info->phy_address = *prop;
+ err = of_address_to_resource(mdio, 0, &res);
+ of_node_put(mdio);
+
+ if (err)
+ return -1;
+
+ ug_info->mdio_bus = res.start;
+ }
/* get the phy interface type, or default to MII */
prop = of_get_property(np, "phy-connection-type", NULL);
@@ -3982,20 +4003,6 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
ug_info->numThreadsRx = UCC_GETH_NUM_OF_THREADS_4;
}
- /* Set the bus id */
- mdio = of_get_parent(phy);
-
- if (mdio == NULL)
- return -1;
-
- err = of_address_to_resource(mdio, 0, &res);
- of_node_put(mdio);
-
- if (err)
- return -1;
-
- ug_info->mdio_bus = res.start;
-
if (netif_msg_probe(&debug))
printk(KERN_INFO "ucc_geth: UCC%1d at 0x%8x (irq = %d) \n",
ug_info->uf_info.ucc_num + 1, ug_info->uf_info.regs,
--
1.5.4.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] Add Fixed PHY support for ucc_geth
2008-03-18 9:46 [PATCH] Add Fixed PHY support for ucc_geth Joakim Tjernlund
@ 2008-03-18 16:32 ` Vitaly Bordug
2008-03-21 8:51 ` Li Yang
1 sibling, 0 replies; 4+ messages in thread
From: Vitaly Bordug @ 2008-03-18 16:32 UTC (permalink / raw)
To: Joakim Tjernlund
Cc: Tjernlund, Joakim, Netdev, linuxppc-dev@ozlabs.org,
Linuxppc-Embedded@Ozlabs.Org
On Tue, 18 Mar 2008 10:46:55 +0100
Joakim Tjernlund wrote:
> The new Fixed PHY method, fixed-link property, isn't
> impl. for ucc_geth which makes fixed PHYs non functional.
> Add support for the new method to restore the Fixed PHY
> functionality.
>
Makes sense to me, but let's cc linuxppc-devel
> Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Acked-by: Vitaly Bordug <vitb@kernel.crashing.org>
> ---
>
> This is a regression as fixed PHYs works in 2.6.23 and I am
> using it.
>
> drivers/net/ucc_geth.c | 53
> +++++++++++++++++++++++++++-------------------- 1 files changed, 30
> insertions(+), 23 deletions(-)
>
> diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
> index ecc5712..18c8b39 100644
> --- a/drivers/net/ucc_geth.c
> +++ b/drivers/net/ucc_geth.c
> @@ -3836,6 +3836,7 @@ static int ucc_geth_probe(struct of_device*
> ofdev, const struct of_device_id *ma struct device_node *phy;
> int err, ucc_num, max_speed = 0;
> const phandle *ph;
> + const u32 *fixed_link;
> const unsigned int *prop;
> const char *sprop;
> const void *mac_addr;
> @@ -3926,18 +3927,38 @@ static int ucc_geth_probe(struct of_device*
> ofdev, const struct of_device_id *ma
> ug_info->uf_info.regs = res.start;
> ug_info->uf_info.irq = irq_of_parse_and_map(np, 0);
> + fixed_link = of_get_property(np, "fixed-link", NULL);
> + if (fixed_link) {
> + ug_info->mdio_bus = 0;
> + ug_info->phy_address = fixed_link[0];
> + phy = NULL;
> + } else {
> + ph = of_get_property(np, "phy-handle", NULL);
> + phy = of_find_node_by_phandle(*ph);
>
> - ph = of_get_property(np, "phy-handle", NULL);
> - phy = of_find_node_by_phandle(*ph);
> + if (phy == NULL)
> + return -ENODEV;
>
> - if (phy == NULL)
> - return -ENODEV;
> + /* set the PHY address */
> + prop = of_get_property(phy, "reg", NULL);
> + if (prop == NULL)
> + return -1;
> + ug_info->phy_address = *prop;
> +
> + /* Set the bus id */
> + mdio = of_get_parent(phy);
> +
> + if (mdio == NULL)
> + return -1;
>
> - /* set the PHY address */
> - prop = of_get_property(phy, "reg", NULL);
> - if (prop == NULL)
> - return -1;
> - ug_info->phy_address = *prop;
> + err = of_address_to_resource(mdio, 0, &res);
> + of_node_put(mdio);
> +
> + if (err)
> + return -1;
> +
> + ug_info->mdio_bus = res.start;
> + }
>
> /* get the phy interface type, or default to MII */
> prop = of_get_property(np, "phy-connection-type", NULL);
> @@ -3982,20 +4003,6 @@ static int ucc_geth_probe(struct of_device*
> ofdev, const struct of_device_id *ma ug_info->numThreadsRx =
> UCC_GETH_NUM_OF_THREADS_4; }
>
> - /* Set the bus id */
> - mdio = of_get_parent(phy);
> -
> - if (mdio == NULL)
> - return -1;
> -
> - err = of_address_to_resource(mdio, 0, &res);
> - of_node_put(mdio);
> -
> - if (err)
> - return -1;
> -
> - ug_info->mdio_bus = res.start;
> -
> if (netif_msg_probe(&debug))
> printk(KERN_INFO "ucc_geth: UCC%1d at 0x%8x (irq =
> %d) \n", ug_info->uf_info.ucc_num + 1, ug_info->uf_info.regs,
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH] Add Fixed PHY support for ucc_geth
2008-03-18 9:46 [PATCH] Add Fixed PHY support for ucc_geth Joakim Tjernlund
2008-03-18 16:32 ` Vitaly Bordug
@ 2008-03-21 8:51 ` Li Yang
2008-04-02 12:15 ` Joakim Tjernlund
1 sibling, 1 reply; 4+ messages in thread
From: Li Yang @ 2008-03-21 8:51 UTC (permalink / raw)
To: Jeff Garzik; +Cc: Netdev, Joakim Tjernlund, Linuxppc-Embedded@Ozlabs.Org
> -----Original Message-----
> From: Joakim Tjernlund [mailto:Joakim.Tjernlund@transmode.se]=20
> Sent: Tuesday, March 18, 2008 5:47 PM
> To: Netdev; Li Yang; Linuxppc-Embedded@Ozlabs.Org
> Cc: Joakim Tjernlund
> Subject: [PATCH] Add Fixed PHY support for ucc_geth
>=20
> The new Fixed PHY method, fixed-link property, isn't
> impl. for ucc_geth which makes fixed PHYs non functional.
> Add support for the new method to restore the Fixed PHY
> functionality.
>=20
> Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Signed-off-by: Li Yang <leoli@freescale.com>
---
Ps: This patch depends on the patch "ucc_geth: use correct thread number
for 10/100Mbps link" to apply, which hasn't made to Linus' tree for now
but has already been in Jeff and David's trees.
> ---
>=20
> This is a regression as fixed PHYs works in 2.6.23 and I am
> using it.
>=20
> drivers/net/ucc_geth.c | 53=20
> +++++++++++++++++++++++++++--------------------
> 1 files changed, 30 insertions(+), 23 deletions(-)
>=20
> diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
> index ecc5712..18c8b39 100644
> --- a/drivers/net/ucc_geth.c
> +++ b/drivers/net/ucc_geth.c
> @@ -3836,6 +3836,7 @@ static int ucc_geth_probe(struct=20
> of_device* ofdev, const struct of_device_id *ma
> struct device_node *phy;
> int err, ucc_num, max_speed =3D 0;
> const phandle *ph;
> + const u32 *fixed_link;
> const unsigned int *prop;
> const char *sprop;
> const void *mac_addr;
> @@ -3926,18 +3927,38 @@ static int ucc_geth_probe(struct=20
> of_device* ofdev, const struct of_device_id *ma
> =20
> ug_info->uf_info.regs =3D res.start;
> ug_info->uf_info.irq =3D irq_of_parse_and_map(np, 0);
> + fixed_link =3D of_get_property(np, "fixed-link", NULL);
> + if (fixed_link) {
> + ug_info->mdio_bus =3D 0;
> + ug_info->phy_address =3D fixed_link[0];
> + phy =3D NULL;
> + } else {
> + ph =3D of_get_property(np, "phy-handle", NULL);
> + phy =3D of_find_node_by_phandle(*ph);
> =20
> - ph =3D of_get_property(np, "phy-handle", NULL);
> - phy =3D of_find_node_by_phandle(*ph);
> + if (phy =3D=3D NULL)
> + return -ENODEV;
> =20
> - if (phy =3D=3D NULL)
> - return -ENODEV;
> + /* set the PHY address */
> + prop =3D of_get_property(phy, "reg", NULL);
> + if (prop =3D=3D NULL)
> + return -1;
> + ug_info->phy_address =3D *prop;
> +
> + /* Set the bus id */
> + mdio =3D of_get_parent(phy);
> +
> + if (mdio =3D=3D NULL)
> + return -1;
> =20
> - /* set the PHY address */
> - prop =3D of_get_property(phy, "reg", NULL);
> - if (prop =3D=3D NULL)
> - return -1;
> - ug_info->phy_address =3D *prop;
> + err =3D of_address_to_resource(mdio, 0, &res);
> + of_node_put(mdio);
> +
> + if (err)
> + return -1;
> +
> + ug_info->mdio_bus =3D res.start;
> + }
> =20
> /* get the phy interface type, or default to MII */
> prop =3D of_get_property(np, "phy-connection-type", NULL);
> @@ -3982,20 +4003,6 @@ static int ucc_geth_probe(struct=20
> of_device* ofdev, const struct of_device_id *ma
> ug_info->numThreadsRx =3D UCC_GETH_NUM_OF_THREADS_4;
> }
> =20
> - /* Set the bus id */
> - mdio =3D of_get_parent(phy);
> -
> - if (mdio =3D=3D NULL)
> - return -1;
> -
> - err =3D of_address_to_resource(mdio, 0, &res);
> - of_node_put(mdio);
> -
> - if (err)
> - return -1;
> -
> - ug_info->mdio_bus =3D res.start;
> -
> if (netif_msg_probe(&debug))
> printk(KERN_INFO "ucc_geth: UCC%1d at 0x%8x=20
> (irq =3D %d) \n",
> ug_info->uf_info.ucc_num + 1,=20
> ug_info->uf_info.regs,
> --=20
> 1.5.4.3
>=20
>=20
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH] Add Fixed PHY support for ucc_geth
2008-03-21 8:51 ` Li Yang
@ 2008-04-02 12:15 ` Joakim Tjernlund
0 siblings, 0 replies; 4+ messages in thread
From: Joakim Tjernlund @ 2008-04-02 12:15 UTC (permalink / raw)
To: Li Yang; +Cc: Netdev, Jeff Garzik, Linuxppc-Embedded@Ozlabs.Org
On Fri, 2008-03-21 at 16:51 +0800, Li Yang wrote:
> > -----Original Message-----
> > From: Joakim Tjernlund [mailto:Joakim.Tjernlund@transmode.se]
> > Sent: Tuesday, March 18, 2008 5:47 PM
> > To: Netdev; Li Yang; Linuxppc-Embedded@Ozlabs.Org
> > Cc: Joakim Tjernlund
> > Subject: [PATCH] Add Fixed PHY support for ucc_geth
> >
> > The new Fixed PHY method, fixed-link property, isn't
> > impl. for ucc_geth which makes fixed PHYs non functional.
> > Add support for the new method to restore the Fixed PHY
> > functionality.
> >
> > Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
>
> Signed-off-by: Li Yang <leoli@freescale.com>
>
> ---
> Ps: This patch depends on the patch "ucc_geth: use correct thread number
> for 10/100Mbps link" to apply, which hasn't made to Linus' tree for now
> but has already been in Jeff and David's trees.
What happened to this patch? It is not in Linus tree.
Jocke
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-04-02 12:15 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-18 9:46 [PATCH] Add Fixed PHY support for ucc_geth Joakim Tjernlund
2008-03-18 16:32 ` Vitaly Bordug
2008-03-21 8:51 ` Li Yang
2008-04-02 12:15 ` Joakim Tjernlund
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).