Phylib changes
Subsystems (3)
PATCH v2 4/5 phy: Add Marvell 88E1116R phy ID
In reply to Michal SimekThis phy is on Xilinx ZC702 zynq development board.
---
Changes in v2: None
drivers/net/phy/marvell.c | 65 +++++++++++++++++++++++++++++++++++++++++++++ include/linux/marvell_phy.h | 1 + 2 files changed, 66 insertions(+)
drivers/net/phy/marvell.c +65 -0
@@ -116,6 +116,8 @@#define MII_M1011_PHY_STATUS_RESOLVED 0x0800#define MII_M1011_PHY_STATUS_LINK 0x0400 +#define MII_M1116R_CONTROL_REG_MAC 21 +MODULE_DESCRIPTION ("Marvell PHY driver" );MODULE_AUTHOR ("Andy Fleming" );
@@ -372,6 +374,55 @@ static int m88e1318_config_aneg(struct phy_device *phydev)return m88e1121_config_aneg (phydev); } +static int m88e1116r_config_init (struct phy_device *phydev) +{ +int temp; +int err; + + temp =phy_read (phydev,MII_BMCR ); + temp |=BMCR_RESET ; + err =phy_write (phydev,MII_BMCR , temp); +if (err <0 ) +return err; + +mdelay (500 ); + + err =phy_write (phydev,MII_MARVELL_PHY_PAGE ,0 ); +if (err <0 ) +return err; + + temp =phy_read (phydev,MII_M1011_PHY_SCR ); + temp |= (7 <<12 );/* max number of gigabit attempts */ + temp |= (1 <<11 );/* enable downshift */ + temp |=MII_M1011_PHY_SCR_AUTO_CROSS ; + err =phy_write (phydev,MII_M1011_PHY_SCR , temp); +if (err <0 ) +return err; + + err =phy_write (phydev,MII_MARVELL_PHY_PAGE ,2 ); +if (err <0 ) +return err; + temp =phy_read (phydev,MII_M1116R_CONTROL_REG_MAC ); + temp |= (1 <<5 ); + temp |= (1 <<4 ); + err =phy_write (phydev,MII_M1116R_CONTROL_REG_MAC , temp); +if (err <0 ) +return err; + err =phy_write (phydev,MII_MARVELL_PHY_PAGE ,0 ); +if (err <0 ) +return err; + + temp =phy_read (phydev,MII_BMCR ); + temp |=BMCR_RESET ; + err =phy_write (phydev,MII_BMCR , temp); +if (err <0 ) +return err; + +mdelay (500 ); + +return 0 ; +} +static int m88e1111_config_init (struct phy_device *phydev) {int err;
@@ -940,6 +991,19 @@ static struct phy_driver marvell_drivers[] = { .config_intr = &marvell_config_intr, .driver = { .owner = THIS_MODULE }, }, + { + .phy_id = MARVELL_PHY_ID_88E1116R, + .phy_id_mask = MARVELL_PHY_ID_MASK, + .name = "Marvell 88E1116R", + .features = PHY_GBIT_FEATURES, + .flags = PHY_HAS_INTERRUPT, + .config_init = &m88e1116r_config_init, + .config_aneg = &genphy_config_aneg, + .read_status = &genphy_read_status, + .ack_interrupt = &marvell_ack_interrupt, + .config_intr = &marvell_config_intr, + .driver = { .owner = THIS_MODULE }, + }, };static int __init marvell_init (void )
@@ -967,6 +1031,7 @@ static struct mdio_device_id __maybe_unused marvell_tbl[] = { { MARVELL_PHY_ID_88E1149R, MARVELL_PHY_ID_MASK }, { MARVELL_PHY_ID_88E1240, MARVELL_PHY_ID_MASK }, { MARVELL_PHY_ID_88E1318S, MARVELL_PHY_ID_MASK }, + { MARVELL_PHY_ID_88E1116R, MARVELL_PHY_ID_MASK }, { } };
include/linux/marvell_phy.h +1 -0
@@ -14,6 +14,7 @@#define MARVELL_PHY_ID_88E1149R 0x01410e50#define MARVELL_PHY_ID_88E1240 0x01410e30#define MARVELL_PHY_ID_88E1318S 0x01410e90 +#define MARVELL_PHY_ID_88E1116R 0x01410e40/* struct phy_device dev_flags definitions */ #define MARVELL_PHY_M1145_FLAGS_RESISTANCE 0x00000001
--
1.8.2.3
PATCH v2 5/5 phy: Add Marvell 88E1510 phy ID
In reply to Michal SimekAdd support for this new phy ID.
---
Changes in v2:
- None
drivers/net/phy/marvell.c | 25 +++++++++++++++++++++++++ include/linux/marvell_phy.h | 1 + 2 files changed, 26 insertions(+)
drivers/net/phy/marvell.c +25 -0
@@ -374,6 +374,17 @@ static int m88e1318_config_aneg(struct phy_device *phydev)return m88e1121_config_aneg (phydev); } +static int m88e1510_config_aneg (struct phy_device *phydev) +{ +int err; + + err =m88e1318_config_aneg (phydev); +if (err <0 ) +return err; + +return marvell_of_reg_init (phydev); +} +static int m88e1116r_config_init (struct phy_device *phydev) {int temp;
@@ -1004,6 +1015,19 @@ static struct phy_driver marvell_drivers[] = { .config_intr = &marvell_config_intr, .driver = { .owner = THIS_MODULE }, }, + { + .phy_id = MARVELL_PHY_ID_88E1510, + .phy_id_mask = MARVELL_PHY_ID_MASK, + .name = "Marvell 88E1510", + .features = PHY_GBIT_FEATURES, + .flags = PHY_HAS_INTERRUPT, + .config_aneg = &m88e1510_config_aneg, + .read_status = &marvell_read_status, + .ack_interrupt = &marvell_ack_interrupt, + .config_intr = &marvell_config_intr, + .did_interrupt = &m88e1121_did_interrupt, + .driver = { .owner = THIS_MODULE }, + }, };static int __init marvell_init (void )
@@ -1032,6 +1056,7 @@ static struct mdio_device_id __maybe_unused marvell_tbl[] = { { MARVELL_PHY_ID_88E1240, MARVELL_PHY_ID_MASK }, { MARVELL_PHY_ID_88E1318S, MARVELL_PHY_ID_MASK }, { MARVELL_PHY_ID_88E1116R, MARVELL_PHY_ID_MASK }, + { MARVELL_PHY_ID_88E1510, MARVELL_PHY_ID_MASK }, { } };
include/linux/marvell_phy.h +1 -0
@@ -15,6 +15,7 @@#define MARVELL_PHY_ID_88E1240 0x01410e30#define MARVELL_PHY_ID_88E1318S 0x01410e90#define MARVELL_PHY_ID_88E1116R 0x01410e40 +#define MARVELL_PHY_ID_88E1510 0x01410dd0/* struct phy_device dev_flags definitions */ #define MARVELL_PHY_M1145_FLAGS_RESISTANCE 0x00000001
--
1.8.2.3
v2 cover Phylib changes
We have these changes in our tree for quite a long time and I would like to ask you for review. All phys are used on xilinx zynq boards.
Thanks,
Michal
v2: Resent these phy patches without emaclite changes
Changes in v2:
- None
Michal Simek (5):
phy: Clean coding style in vitesse phy
phy: Add Vitesse 8211 phy ID
phy: Use macros instead of hardcoded values in marvell phy driver
phy: Add Marvell 88E1116R phy ID
phy: Add Marvell 88E1510 phy ID
drivers/net/phy/marvell.c | 108 ++++++++++++++++++++++++++++++++++++++++---- drivers/net/phy/vitesse.c | 38 +++++++++++----- include/linux/marvell_phy.h | 2 + 3 files changed, 127 insertions(+), 21 deletions(-)
--
1.8.2.3
PATCH v2 1/5 phy: Clean coding style in vitesse phy
- Remove trailing white space
- Remove spaces before tag
- Fix comments
---
Changes in v2: None
drivers/net/phy/vitesse.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-)
drivers/net/phy/vitesse.c +11 -12
@@ -44,12 +44,12 @@#define MII_VSC8244_ISTAT_DUPLEX 0x1000/* Vitesse Auxiliary Control/Status Register */ -#define MII_VSC8244_AUX_CONSTAT 0x1c -#define MII_VSC8244_AUXCONSTAT_INIT 0x0000 -#define MII_VSC8244_AUXCONSTAT_DUPLEX 0x0020 -#define MII_VSC8244_AUXCONSTAT_SPEED 0x0018 -#define MII_VSC8244_AUXCONSTAT_GBIT 0x0010 -#define MII_VSC8244_AUXCONSTAT_100 0x0008 +#define MII_VSC8244_AUX_CONSTAT 0x1c +#define MII_VSC8244_AUXCONSTAT_INIT 0x0000 +#define MII_VSC8244_AUXCONSTAT_DUPLEX 0x0020 +#define MII_VSC8244_AUXCONSTAT_SPEED 0x0018 +#define MII_VSC8244_AUXCONSTAT_GBIT 0x0010 +#define MII_VSC8244_AUXCONSTAT_100 0x0008#define MII_VSC8221_AUXCONSTAT_INIT 0x0004/* need to set this bit? */ #define MII_VSC8221_AUXCONSTAT_RESERVED 0x0004
@@ -100,9 +100,8 @@ static int vsc824x_config_init(struct phy_device *phydev)static int vsc824x_ack_interrupt (struct phy_device *phydev) {int err =0 ; - -/* -* Don't bother to ACK the interrupts if interrupts + +/* Don't bother to ACK the interrupts if interrupts * are disabled. The 824x cannot clear the interrupts * if they are disabled. */
@@ -122,8 +121,7 @@ static int vsc82xx_config_intr(struct phy_device *phydev) MII_VSC8244_IMASK_MASK : MII_VSC8221_IMASK_MASK); else { -/* -* The Vitesse PHY cannot clear the interrupt +/* The Vitesse PHY cannot clear the interrupt * once it has disabled them, so we clear them first */ err =phy_read (phydev,MII_VSC8244_ISTAT );
@@ -146,7 +144,8 @@ static int vsc8221_config_init(struct phy_device *phydev)return err;/* Perhaps we should set EXT_CON1 based on the interface? -Options are 802.3Z SerDes or SGMII */ +* Options are 802.3Z SerDes or SGMII +*/ }/* Vitesse 824x */
--
1.8.2.3
PATCH v2 2/5 phy: Add Vitesse 8211 phy ID
In reply to Michal SimekPhy is compatible with Vitesse 8221.
---
Changes in v2: None
drivers/net/phy/vitesse.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
drivers/net/phy/vitesse.c +15 -0
@@ -56,6 +56,7 @@#define PHY_ID_VSC8244 0x000fc6c0#define PHY_ID_VSC8221 0x000fc550 +#define PHY_ID_VSC8211 0x000fc4b0MODULE_DESCRIPTION ("Vitesse PHY driver" );MODULE_AUTHOR ("Kriston Carson" );
@@ -175,6 +176,19 @@ static struct phy_driver vsc82xx_driver[] = { .ack_interrupt = &vsc824x_ack_interrupt, .config_intr = &vsc82xx_config_intr, .driver = { .owner = THIS_MODULE,}, +}, { +/* Vitesse 8211 */ + .phy_id = PHY_ID_VSC8211, + .phy_id_mask = 0x000ffff0, + .name = "Vitesse VSC8211", + .features = PHY_GBIT_FEATURES, + .flags = PHY_HAS_INTERRUPT, + .config_init = &vsc8221_config_init, + .config_aneg = &genphy_config_aneg, + .read_status = &genphy_read_status, + .ack_interrupt = &vsc824x_ack_interrupt, + .config_intr = &vsc82xx_config_intr, + .driver = { .owner = THIS_MODULE,}, } };static int __init vsc82xx_init (void )
@@ -195,6 +209,7 @@ module_exit(vsc82xx_exit);static struct mdio_device_id __maybe_unused vitesse_tbl[] = { {PHY_ID_VSC8244 ,0x000fffc0 }, {PHY_ID_VSC8221 ,0x000ffff0 }, + {PHY_ID_VSC8211 ,0x000ffff0 }, { } };
--
1.8.2.3
PATCH v2 3/5 phy: Use macros instead of hardcoded values in marvell phy driver
In reply to Michal SimekUse macros from linux/marvell_phy.h instead of duplicate magic phy ID in the driver.
---
Changes in v2: None
drivers/net/phy/marvell.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/net/phy/marvell.c +9 -9
@@ -958,15 +958,15 @@ module_init(marvell_init);module_exit (marvell_exit);static struct mdio_device_id __maybe_unused marvell_tbl[] = { - {0x01410c60 ,0xfffffff0 }, - {0x01410c90 ,0xfffffff0 }, - {0x01410cc0 ,0xfffffff0 }, - {0x01410e10 ,0xfffffff0 }, - {0x01410cb0 ,0xfffffff0 }, - {0x01410cd0 ,0xfffffff0 }, - {0x01410e50 ,0xfffffff0 }, - {0x01410e30 ,0xfffffff0 }, - {0x01410e90 ,0xfffffff0 }, + {MARVELL_PHY_ID_88E1101 ,MARVELL_PHY_ID_MASK }, + {MARVELL_PHY_ID_88E1112 ,MARVELL_PHY_ID_MASK }, + {MARVELL_PHY_ID_88E1111 ,MARVELL_PHY_ID_MASK }, + {MARVELL_PHY_ID_88E1118 ,MARVELL_PHY_ID_MASK }, + {MARVELL_PHY_ID_88E1121R ,MARVELL_PHY_ID_MASK }, + {MARVELL_PHY_ID_88E1145 ,MARVELL_PHY_ID_MASK }, + {MARVELL_PHY_ID_88E1149R ,MARVELL_PHY_ID_MASK }, + {MARVELL_PHY_ID_88E1240 ,MARVELL_PHY_ID_MASK }, + {MARVELL_PHY_ID_88E1318S ,MARVELL_PHY_ID_MASK }, { } };
--
1.8.2.3
David Miller
maintainerFrom: Michal Simek <[email protected]>
Date: Fri, 31 May 2013 08:08:22 +0200
Quoted 3 lines
We have these changes in our tree for quite a long time and I would like to ask you for review. All phys are used on xilinx zynq boards.
All applied to net-next, thanks.