Commit d7559982 authored by Daniel Mack's avatar Daniel Mack Committed by David S. Miller

net: ti cpsw ethernet: allow reading phy interface mode from DT

Allow users to specify the phy interface of the CPSW slaves. The new
node parameter is called "phy_if_mode" and is optional. The original
behaviour of the driver is preserved when not given.
Signed-off-by: default avatarDaniel Mack <zonque@gmail.com>
Cc: Mugunthan V N <mugunthanvnm@ti.com>
Cc: Vaibhav Hiremath <hvaibhav@ti.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 342b7b74
......@@ -25,6 +25,8 @@ Required properties:
- slave_reg_ofs : Specifies slave register offset
- sliver_reg_ofs : Specifies slave sliver register offset
- phy_id : Specifies slave phy id
- phy_if_mode : Specified slave phy interface mode (optional)
(one of the PHY_INTERFACE_MODE_* as numerical value)
- mac-address : Specifies slave MAC address
Optional properties:
......@@ -62,6 +64,7 @@ Examples:
slave_reg_ofs = <0x208>;
sliver_reg_ofs = <0xd80>;
phy_id = "davinci_mdio.16:00";
phy_if_mode = <6>; /* PHY_INTERFACE_MODE_RGMII */
/* Filled in by U-Boot */
mac-address = [ 00 00 00 00 00 00 ];
};
......
......@@ -855,6 +855,9 @@ static int cpsw_probe_dt(struct cpsw_platform_data *data,
}
slave_data->sliver_reg_ofs = prop;
if (!of_property_read_u32(slave_node, "phy_if_mode", &prop))
slave_data->phy_if = prop;
mac_addr = of_get_mac_address(slave_node);
if (mac_addr)
memcpy(slave_data->mac_addr, mac_addr, ETH_ALEN);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment