mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 15:14:43 +00:00
drivers: net: cpsw: add support to have phy address from cpsw platform data
Some platforms like AM437x have different EVMs with different phy addresses, so this patch adds support for passing phy address via cpsw plaform data. Also renamed phy_id to phy_addr so better understanding of the code. Reviewed-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com> [trini: Update BuR am335x_igep0033 pcm051_rev3 pcm051_rev1 cm_t335 pengwyn boards] Signed-off-by: Tom Rini <trini@ti.com>
This commit is contained in:
parent
eeb72e6761
commit
9c653aad16
24 changed files with 22 additions and 33 deletions
|
@ -141,12 +141,12 @@ static struct cpsw_slave_data cpsw_slaves[] = {
|
|||
{
|
||||
.slave_reg_ofs = 0x208,
|
||||
.sliver_reg_ofs = 0xd80,
|
||||
.phy_id = 0,
|
||||
.phy_addr = 0,
|
||||
},
|
||||
{
|
||||
.slave_reg_ofs = 0x308,
|
||||
.sliver_reg_ofs = 0xdc0,
|
||||
.phy_id = 1,
|
||||
.phy_addr = 1,
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ static void cpsw_control(int enabled)
|
|||
static struct cpsw_slave_data cpsw_slave = {
|
||||
.slave_reg_ofs = 0x208,
|
||||
.sliver_reg_ofs = 0xd80,
|
||||
.phy_id = 0,
|
||||
.phy_addr = 0,
|
||||
.phy_if = PHY_INTERFACE_MODE_RGMII,
|
||||
};
|
||||
|
||||
|
|
|
@ -116,7 +116,7 @@ static struct cpsw_slave_data cpsw_slaves[] = {
|
|||
{
|
||||
.slave_reg_ofs = 0x208,
|
||||
.sliver_reg_ofs = 0xd80,
|
||||
.phy_id = 0,
|
||||
.phy_addr = 0,
|
||||
.phy_if = PHY_INTERFACE_MODE_RMII,
|
||||
},
|
||||
};
|
||||
|
|
|
@ -176,13 +176,13 @@ static struct cpsw_slave_data cpsw_slaves[] = {
|
|||
{
|
||||
.slave_reg_ofs = 0x208,
|
||||
.sliver_reg_ofs = 0xd80,
|
||||
.phy_id = 0,
|
||||
.phy_addr = 0,
|
||||
.phy_if = PHY_INTERFACE_MODE_RGMII,
|
||||
},
|
||||
{
|
||||
.slave_reg_ofs = 0x308,
|
||||
.sliver_reg_ofs = 0xdc0,
|
||||
.phy_id = 1,
|
||||
.phy_addr = 1,
|
||||
.phy_if = PHY_INTERFACE_MODE_RGMII,
|
||||
},
|
||||
};
|
||||
|
|
|
@ -198,7 +198,7 @@ static struct cpsw_slave_data cpsw_slaves[] = {
|
|||
{
|
||||
.slave_reg_ofs = 0x208,
|
||||
.sliver_reg_ofs = 0xd80,
|
||||
.phy_id = 0,
|
||||
.phy_addr = 0,
|
||||
.phy_if = PHY_INTERFACE_MODE_MII,
|
||||
},
|
||||
};
|
||||
|
|
|
@ -181,13 +181,13 @@ static struct cpsw_slave_data cpsw_slaves[] = {
|
|||
{
|
||||
.slave_reg_ofs = 0x208,
|
||||
.sliver_reg_ofs = 0xd80,
|
||||
.phy_id = 0,
|
||||
.phy_addr = 0,
|
||||
.phy_if = PHY_INTERFACE_MODE_RMII,
|
||||
},
|
||||
{
|
||||
.slave_reg_ofs = 0x308,
|
||||
.sliver_reg_ofs = 0xdc0,
|
||||
.phy_id = 1,
|
||||
.phy_addr = 1,
|
||||
.phy_if = PHY_INTERFACE_MODE_RMII,
|
||||
},
|
||||
};
|
||||
|
|
|
@ -143,13 +143,13 @@ static struct cpsw_slave_data cpsw_slaves[] = {
|
|||
{
|
||||
.slave_reg_ofs = 0x208,
|
||||
.sliver_reg_ofs = 0xd80,
|
||||
.phy_id = 1,
|
||||
.phy_addr = 1,
|
||||
.phy_if = PHY_INTERFACE_MODE_RMII,
|
||||
},
|
||||
{
|
||||
.slave_reg_ofs = 0x308,
|
||||
.sliver_reg_ofs = 0xdc0,
|
||||
.phy_id = 0,
|
||||
.phy_addr = 0,
|
||||
.phy_if = PHY_INTERFACE_MODE_RMII,
|
||||
},
|
||||
};
|
||||
|
|
|
@ -141,13 +141,13 @@ static struct cpsw_slave_data cpsw_slaves[] = {
|
|||
{
|
||||
.slave_reg_ofs = 0x208,
|
||||
.sliver_reg_ofs = 0xd80,
|
||||
.phy_id = 0,
|
||||
.phy_addr = 0,
|
||||
.phy_if = PHY_INTERFACE_MODE_MII,
|
||||
},
|
||||
{
|
||||
.slave_reg_ofs = 0x308,
|
||||
.sliver_reg_ofs = 0xdc0,
|
||||
.phy_id = 1,
|
||||
.phy_addr = 1,
|
||||
.phy_if = PHY_INTERFACE_MODE_MII,
|
||||
},
|
||||
};
|
||||
|
|
|
@ -544,12 +544,12 @@ static struct cpsw_slave_data cpsw_slaves[] = {
|
|||
{
|
||||
.slave_reg_ofs = 0x208,
|
||||
.sliver_reg_ofs = 0xd80,
|
||||
.phy_id = 0,
|
||||
.phy_addr = 0,
|
||||
},
|
||||
{
|
||||
.slave_reg_ofs = 0x308,
|
||||
.sliver_reg_ofs = 0xdc0,
|
||||
.phy_id = 1,
|
||||
.phy_addr = 1,
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
@ -149,12 +149,12 @@ static struct cpsw_slave_data cpsw_slaves[] = {
|
|||
{
|
||||
.slave_reg_ofs = 0x208,
|
||||
.sliver_reg_ofs = 0xd80,
|
||||
.phy_id = 0,
|
||||
.phy_addr = 2,
|
||||
},
|
||||
{
|
||||
.slave_reg_ofs = 0x308,
|
||||
.sliver_reg_ofs = 0xdc0,
|
||||
.phy_id = 1,
|
||||
.phy_addr = 3,
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
@ -132,12 +132,12 @@ static struct cpsw_slave_data cpsw_slaves[] = {
|
|||
{
|
||||
.slave_reg_ofs = 0x50,
|
||||
.sliver_reg_ofs = 0x700,
|
||||
.phy_id = 1,
|
||||
.phy_addr = 1,
|
||||
},
|
||||
{
|
||||
.slave_reg_ofs = 0x90,
|
||||
.sliver_reg_ofs = 0x740,
|
||||
.phy_id = 0,
|
||||
.phy_addr = 0,
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
@ -656,7 +656,7 @@ static void cpsw_slave_init(struct cpsw_slave *slave, struct cpsw_priv *priv)
|
|||
|
||||
cpsw_ale_add_mcast(priv, NetBcastAddr, 1 << slave_port);
|
||||
|
||||
priv->phy_mask |= 1 << slave->data->phy_id;
|
||||
priv->phy_mask |= 1 << slave->data->phy_addr;
|
||||
}
|
||||
|
||||
static struct cpdma_desc *cpdma_desc_alloc(struct cpsw_priv *priv)
|
||||
|
@ -948,7 +948,7 @@ static int cpsw_phy_init(struct eth_device *dev, struct cpsw_slave *slave)
|
|||
SUPPORTED_1000baseT_Full);
|
||||
|
||||
phydev = phy_connect(priv->bus,
|
||||
CONFIG_PHY_ADDR,
|
||||
slave->data->phy_addr,
|
||||
dev,
|
||||
slave->data->phy_if);
|
||||
|
||||
|
|
|
@ -398,7 +398,6 @@
|
|||
/* Network. */
|
||||
#define CONFIG_PHY_GIGE
|
||||
#define CONFIG_PHYLIB
|
||||
#define CONFIG_PHY_ADDR 0
|
||||
#define CONFIG_PHY_SMSC
|
||||
|
||||
/* NAND support */
|
||||
|
|
|
@ -181,7 +181,6 @@
|
|||
#define CONFIG_NET_RETRY_COUNT 10
|
||||
#define CONFIG_NET_MULTI
|
||||
#define CONFIG_PHYLIB
|
||||
#define CONFIG_PHY_ADDR 0
|
||||
#define CONFIG_PHY_SMSC
|
||||
|
||||
/* NAND support */
|
||||
|
|
|
@ -51,7 +51,6 @@
|
|||
#define CONFIG_MII /* Required in net/eth.c */
|
||||
#define CONFIG_SPL_ETH_SUPPORT
|
||||
#define CONFIG_PHYLIB
|
||||
#define CONFIG_PHY_ADDR 1
|
||||
#define CONFIG_PHY_NATSEMI
|
||||
#define CONFIG_SPL_NET_SUPPORT
|
||||
#define CONFIG_SPL_ENV_SUPPORT /* used for a fetching MAC-Address */
|
||||
|
|
|
@ -114,7 +114,6 @@
|
|||
/* Network. */
|
||||
#define CONFIG_PHY_GIGE
|
||||
#define CONFIG_PHYLIB
|
||||
#define CONFIG_PHY_ADDR 0
|
||||
#define CONFIG_PHY_ATHEROS
|
||||
|
||||
/* NAND support */
|
||||
|
|
|
@ -62,7 +62,6 @@
|
|||
#define CONFIG_MII /* Required in net/eth.c */
|
||||
#define CONFIG_PHY_GIGE /* per-board part of CPSW */
|
||||
#define CONFIG_PHYLIB
|
||||
#define CONFIG_PHY_ADDR 2
|
||||
|
||||
/* SPI */
|
||||
#undef CONFIG_OMAP3_SPI
|
||||
|
|
|
@ -49,7 +49,6 @@
|
|||
|
||||
#undef CONFIG_MII
|
||||
#undef CONFIG_PHY_GIGE
|
||||
#define CONFIG_PHY_ADDR 0
|
||||
#define CONFIG_PHY_SMSC
|
||||
|
||||
#define CONFIG_FACTORYSET
|
||||
|
|
|
@ -297,7 +297,6 @@
|
|||
#define CONFIG_NET_MULTI
|
||||
#define CONFIG_PHY_GIGE
|
||||
#define CONFIG_PHYLIB
|
||||
#define CONFIG_PHY_ADDR 0
|
||||
#define CONFIG_PHY_SMSC
|
||||
|
||||
#endif /* ! __CONFIG_PCM051_H */
|
||||
|
|
|
@ -196,7 +196,6 @@
|
|||
/* Network */
|
||||
#define CONFIG_CMD_MII
|
||||
#define CONFIG_PHYLIB
|
||||
#define CONFIG_PHY_ADDR 1
|
||||
#define CONFIG_PHY_RESET 1
|
||||
#define CONFIG_PHY_NATSEMI
|
||||
|
||||
|
|
|
@ -44,7 +44,6 @@
|
|||
#undef CONFIG_SPL_NET_VCI_STRING
|
||||
#undef CONFIG_SPL_ETH_SUPPORT
|
||||
|
||||
#define CONFIG_PHY_ADDR 0
|
||||
#define CONFIG_PHY_ATHEROS
|
||||
|
||||
#define CONFIG_FACTORYSET
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
#undef CONFIG_SPL_NET_VCI_STRING
|
||||
#undef CONFIG_SPL_ETH_SUPPORT
|
||||
|
||||
#define CONFIG_PHY_ADDR 1
|
||||
#define CONFIG_PHY_NATSEMI
|
||||
|
||||
#define CONFIG_FACTORYSET
|
||||
|
|
|
@ -233,7 +233,6 @@
|
|||
#define CONFIG_NET_MULTI
|
||||
#define CONFIG_PHY_GIGE
|
||||
#define CONFIG_PHYLIB
|
||||
#define CONFIG_PHY_ADDR 1
|
||||
#define CONFIG_PHY_ET1011C
|
||||
#define CONFIG_PHY_ET1011C_TX_CLK_FIX
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
struct cpsw_slave_data {
|
||||
u32 slave_reg_ofs;
|
||||
u32 sliver_reg_ofs;
|
||||
int phy_id;
|
||||
int phy_addr;
|
||||
int phy_if;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue