Add support for Marvell 88E1118 phy to drivers/net/tsec.c
PATCH 1/1 Add support for Marvell 88E1118 phy to drivers/net/tsec.c
Add support for Marvell 88E1118 phy todrivers/net/tsec.c
--- clean_u-boot-1.3.3/drivers/net/tsec.c 2008-05-19
03:47:11.000000000 -0700
+++ u-boot-1.3.3/drivers/net/tsec.c 2008-05-20
12:40:14.000000000 -0700
@@ -1128,6 +1128,36 @@ struct phy_infophy_info_M88E1111S = {
},
};
+struct phy_info phy_info_M88E1118 = {
+ 0x01410e1,
+ "Marvell 88E1118",
+ 4,
+ (struct phy_cmd[]){ /* config */
+ /* Reset and configure the PHY */
+ {MIIM_CONTROL, MIIM_CONTROL_RESET, NULL},
+ {0x16, 0x0002, NULL}, /* Change Page Number */
+ {0x15, 0x1070, NULL}, /* Delay RGMII TX and RX */
+ {MIIM_GBIT_CONTROL, MIIM_GBIT_CONTROL_INIT, NULL},
+ {MIIM_ANAR, MIIM_ANAR_INIT, NULL},
+ {MIIM_CONTROL, MIIM_CONTROL_RESET, NULL},
+ {MIIM_CONTROL, MIIM_CONTROL_INIT, &mii_cr_init},
+ {miim_end,}
+ },
+ (struct phy_cmd[]){ /* startup */
+ {0x16, 0x0000, NULL}, /* Change Page Number */
+ /* Status is read once to clear old link state */
+ {MIIM_STATUS, miim_read, NULL},
+ /* Auto-negotiate */
+ /* Read the status */
+ {MIIM_88E1011_PHY_STATUS, miim_read,
+ &mii_parse_88E1011_psr},
+ {miim_end,}
+ },
+ (struct phy_cmd[]){ /* shutdown */
+ {miim_end,}
+ },
+};
+
static unsigned int m88e1145_setmode(uint mii_reg,
struct tsec_private *priv)
{
uint mii_data = read_phy_reg(priv, mii_reg);
@@ -1492,6 +1522,7 @@ struct phy_info *phy_info[] = {
&phy_info_BCM5464S, &phy_info_M88E1011S, &phy_info_M88E1111S,
+ &phy_info_M88E1118,
&phy_info_M88E1145, &phy_info_M88E1149S, &phy_info_dm9161,
PATCH 1/1 Add support for Marvell 88E1118 phy to drivers/net/tsec.c
If possible can we start to export the phy support in phy drivers to allow other net drivers to use it.
We can start to think to implement like is done in linux to add a generic phylib with a generir phy driver.
Best Regards,
J.
PATCH 1/1 Add support for Marvell 88E1118 phy to drivers/net/tsec.c
That sounds like a good idea. I was honestly kinda surprised that this hadn't already been done (not a critisism). Currently though I'm trying to add support for a new board. I'd be glad to try and help in the future though if this kind of implementation is done.
Ron Madrid
--- Jean-Christophe PLAGNIOL-VILLARD
Quoted 11 lines · <[email protected]> wrote:
If possible can we start to export the phy support in phy drivers to
allow other net drivers to use it.We can start to think to implement like is done in linux to add a
generic phylib with a generir phy driver.Best Regards,
J.
PATCH 1/1 Add support for Marvell 88E1118 phy to drivers/net/tsec.c
In reply to Jean-Christophe PLAGNIOL-VILLARDQuoted 10 lines · Jean-Christophe PLAGNIOL-VILLARD
If possible can we start to export the phy support in phy drivers to allow other net drivers to use it.
We can start to think to implement like is done in linux to add a generic phylib with a generir phy driver.
Best Regards,
J.
For now, please leave as-is and I'll pull the patch in tonight. It's better to move all the PHY drivers at once than to do them piecemeal.
regards,
Ben
PATCH 1/1 Add support for Marvell 88E1118 phy to drivers/net/tsec.c
Quoted 7 lines · --- Ben Warren
Quoted 1 line · Jean-Christophe PLAGNIOL-VILLARD
If possible can we start to export the phy support
in phy drivers to
Quoted 3 lines
allow other net drivers to use it.
We can start to think to implement like is done in
linux to add a
Quoted 8 lines
Quoted 6 lines
generic phylib with a generir phy driver.
Best Regards,
J.For now, please leave as-is and I'll pull the patch in tonight. It's
Will do,
Quoted 2 lines
better to move all the PHY drivers at once than to do them piecemeal.
and agreed.
Quoted 4 lines
regards,
Ben
Ron Madrid
PATCH 1/1 Add support for Marvell 88E1118 phy to drivers/net/tsec.c
In reply to Ben WarrenQuoted 7 lines · Ben Warren
Quoted 6 lines · Jean-Christophe PLAGNIOL-VILLARD
If possible can we start to export the phy support in phy drivers to allow other net drivers to use it.
We can start to think to implement like is done in linux to add a generic phylib with a generir phy driver.
Quoted 6 lines
Quoted 4 lines
Best Regards,
J.For now, please leave as-is and I'll pull the patch in tonight. It's better to move all the PHY drivers at once than to do them piecemeal.
I agree , I just ask to start think to move to this architecture
Best Regards,
J.
PATCH 1/1 Add support for Marvell 88E1118 phy to drivers/net/tsec.c
In reply to Ron MadridHi Ron,
Quoted 10 lines · Ron Madrid
Add support for Marvell 88E1118 phy to
drivers/net/tsec.cSigned-off-by Ron Madrid <[email protected]>---
clean_u-boot-1.3.3/drivers/net/tsec.c2008-05-19
03:47:11.000000000 -0700
+++u-boot-1.3.3/drivers/net/tsec.c2008-05-20
12:40:14.000000000 -0700
The content of this patch looks OK, but the patch itself is mangled. Please use git tools to create your patches, then re-submit.
Quoted 43 lines
(quoted diff) +30
-0@@ -1128,6 +1128,36 @@ struct phy_info phy_info_M88E1111S = { }, }; +struct phy_info phy_info_M88E1118 = { + 0x01410e1, + "Marvell 88E1118", + 4, + (struct phy_cmd[]){ /* config */ + /* Reset and configure the PHY */ + {MIIM_CONTROL, MIIM_CONTROL_RESET, NULL}, + {0x16, 0x0002, NULL}, /* Change Page Number */ + {0x15, 0x1070, NULL}, /* Delay RGMII TX and RX */ + {MIIM_GBIT_CONTROL, MIIM_GBIT_CONTROL_INIT, NULL}, + {MIIM_ANAR, MIIM_ANAR_INIT, NULL}, + {MIIM_CONTROL, MIIM_CONTROL_RESET, NULL}, + {MIIM_CONTROL, MIIM_CONTROL_INIT, &mii_cr_init}, + {miim_end,} + }, + (struct phy_cmd[]){ /* startup */ + {0x16, 0x0000, NULL}, /* Change Page Number */ + /* Status is read once to clear old link state */ + {MIIM_STATUS, miim_read, NULL}, + /* Auto-negotiate */ + /* Read the status */ + {MIIM_88E1011_PHY_STATUS, miim_read, + &mii_parse_88E1011_psr}, + {miim_end,} + }, + (struct phy_cmd[]){ /* shutdown */ + {miim_end,} + }, +}; + static unsigned int m88e1145_setmode(uint mii_reg, struct tsec_private *priv){
(quoted diff) +0
-0uint mii_data = read_phy_reg(priv, mii_reg);
Review struct phy_info *phy_info[] = { · line 1528
Quoted 7 lines
(quoted diff) +1
-0@@ -1492,6 +1522,7 @@ struct phy_info *phy_info[] = { &phy_info_BCM5464S, &phy_info_M88E1011S, &phy_info_M88E1111S, + &phy_info_M88E1118, &phy_info_M88E1145, &phy_info_M88E1149S, &phy_info_dm9161,
regards,
Ben