Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 61509
b: refs/heads/master
c: 7132ab7
h: refs/heads/master
i:
  61507: a11ec09
v: v3
  • Loading branch information
Andy Fleming authored and Jeff Garzik committed Jul 18, 2007
1 parent 425ebe4 commit 3d5f0fb
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: af2d940df2b60b15c271033d381c2f3ead655562
refs/heads/master: 7132ab7f6e0309bb8e0424e395ba149aee0c750e
9 changes: 9 additions & 0 deletions trunk/arch/powerpc/sysdev/fsl_soc.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ static int __init gfar_of_init(void)
struct gianfar_platform_data gfar_data;
const unsigned int *id;
const char *model;
const char *ctype;
const void *mac_addr;
const phandle *ph;
int n_res = 2;
Expand Down Expand Up @@ -254,6 +255,14 @@ static int __init gfar_of_init(void)
FSL_GIANFAR_DEV_HAS_VLAN |
FSL_GIANFAR_DEV_HAS_EXTENDED_HASH;

ctype = of_get_property(np, "phy-connection-type", NULL);

/* We only care about rgmii-id. The rest are autodetected */
if (ctype && !strcmp(ctype, "rgmii-id"))
gfar_data.interface = PHY_INTERFACE_MODE_RGMII_ID;
else
gfar_data.interface = PHY_INTERFACE_MODE_MII;

ph = of_get_property(np, "phy-handle", NULL);
phy = of_find_node_by_phandle(*ph);

Expand Down
12 changes: 11 additions & 1 deletion trunk/drivers/net/gianfar.c
Original file line number Diff line number Diff line change
Expand Up @@ -420,8 +420,18 @@ static phy_interface_t gfar_get_interface(struct net_device *dev)
if (ecntrl & ECNTRL_REDUCED_MODE) {
if (ecntrl & ECNTRL_REDUCED_MII_MODE)
return PHY_INTERFACE_MODE_RMII;
else
else {
phy_interface_t interface = priv->einfo->interface;

/*
* This isn't autodetected right now, so it must
* be set by the device tree or platform code.
*/
if (interface == PHY_INTERFACE_MODE_RGMII_ID)
return PHY_INTERFACE_MODE_RGMII_ID;

return PHY_INTERFACE_MODE_RGMII;
}
}

if (priv->einfo->device_flags & FSL_GIANFAR_DEV_HAS_GIGABIT)
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/fsl_devices.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ struct gianfar_platform_data {
u32 bus_id;
u32 phy_id;
u8 mac_addr[6];
phy_interface_t interface;
};

struct gianfar_mdio_data {
Expand Down

0 comments on commit 3d5f0fb

Please sign in to comment.