mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-06-23 15:11:42 +00:00
drivers: net: cpsw: add support for using second port as ethernet
Add support for using the second slave port of cpsw to be used as primary ethernet. Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
This commit is contained in:
parent
23f23f23d5
commit
7a0227534d
2 changed files with 6 additions and 3 deletions
|
@ -211,6 +211,8 @@ struct cpdma_chan {
|
||||||
#define chan_read(chan, fld) __raw_readl((chan)->fld)
|
#define chan_read(chan, fld) __raw_readl((chan)->fld)
|
||||||
#define chan_read_ptr(chan, fld) ((void *)__raw_readl((chan)->fld))
|
#define chan_read_ptr(chan, fld) ((void *)__raw_readl((chan)->fld))
|
||||||
|
|
||||||
|
#define for_active_slave(slave, priv) \
|
||||||
|
slave = (priv)->slaves + (priv)->data.active_slave; if (slave)
|
||||||
#define for_each_slave(slave, priv) \
|
#define for_each_slave(slave, priv) \
|
||||||
for (slave = (priv)->slaves; slave != (priv)->slaves + \
|
for (slave = (priv)->slaves; slave != (priv)->slaves + \
|
||||||
(priv)->data.slaves; slave++)
|
(priv)->data.slaves; slave++)
|
||||||
|
@ -609,7 +611,7 @@ static int cpsw_update_link(struct cpsw_priv *priv)
|
||||||
int link = 0;
|
int link = 0;
|
||||||
struct cpsw_slave *slave;
|
struct cpsw_slave *slave;
|
||||||
|
|
||||||
for_each_slave(slave, priv)
|
for_active_slave(slave, priv)
|
||||||
cpsw_slave_update_link(slave, priv, &link);
|
cpsw_slave_update_link(slave, priv, &link);
|
||||||
priv->mdio_link = readl(&mdio_regs->link);
|
priv->mdio_link = readl(&mdio_regs->link);
|
||||||
return link;
|
return link;
|
||||||
|
@ -785,7 +787,7 @@ static int cpsw_init(struct eth_device *dev, bd_t *bis)
|
||||||
ALE_SECURE);
|
ALE_SECURE);
|
||||||
cpsw_ale_add_mcast(priv, NetBcastAddr, 1 << priv->host_port);
|
cpsw_ale_add_mcast(priv, NetBcastAddr, 1 << priv->host_port);
|
||||||
|
|
||||||
for_each_slave(slave, priv)
|
for_active_slave(slave, priv)
|
||||||
cpsw_slave_init(slave, priv);
|
cpsw_slave_init(slave, priv);
|
||||||
|
|
||||||
cpsw_update_link(priv);
|
cpsw_update_link(priv);
|
||||||
|
@ -1013,7 +1015,7 @@ int cpsw_register(struct cpsw_platform_data *data)
|
||||||
|
|
||||||
cpsw_mdio_init(dev->name, data->mdio_base, data->mdio_div);
|
cpsw_mdio_init(dev->name, data->mdio_base, data->mdio_div);
|
||||||
priv->bus = miiphy_get_dev_by_name(dev->name);
|
priv->bus = miiphy_get_dev_by_name(dev->name);
|
||||||
for_each_slave(slave, priv)
|
for_active_slave(slave, priv)
|
||||||
cpsw_phy_init(dev, slave);
|
cpsw_phy_init(dev, slave);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
@ -44,6 +44,7 @@ struct cpsw_platform_data {
|
||||||
struct cpsw_slave_data *slave_data;
|
struct cpsw_slave_data *slave_data;
|
||||||
void (*control)(int enabled);
|
void (*control)(int enabled);
|
||||||
u32 host_port_num;
|
u32 host_port_num;
|
||||||
|
u32 active_slave;
|
||||||
u8 version;
|
u8 version;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue