mbox series

[v5,net-next,00/13] net: phy: marvell-88q2xxx: add driver for the Marvell 88Q2220 PHY

Message ID 20240122212848.3645785-1-dima.fedrau@gmail.com (mailing list archive)
Headers show
Series net: phy: marvell-88q2xxx: add driver for the Marvell 88Q2220 PHY | expand

Message

Dimitri Fedrau Jan. 22, 2024, 9:28 p.m. UTC
Changes in v2:
	- used defines MDIO_CTRL1_LPOWER and MDIO_PMA_CTRL1_SPEED1000
	  in mv88q222x_config_aneg_preinit
	- use genphy_c45_loopback
	- mv88q2xxx_read_status reads speed, master or slave state when
	  autonegotiation is enabled
	- added defines for magic values in mv88q222x_get_sqi

Changes in v3:
	- mv88q2xxx_read_status includes autonegotiation case
	- add support for 100BT1 and 1000BT1 linkmode advertisement
	- use mv88q2xxx_get_sqi and mv88q2xxx_get_sqi_max, remove
	  mv88q222x_get_sqi and mv88q222x_get_sqi_max
	- fix typo: rename mv88q2xxxx_get_sqi and mv88q2xxxx_get_sqi_max to
	  mv88q2xxx_get_sqi and mv88q2xxx_get_sqi
	- add define MDIO_MMD_PCS_MV_RX_STAT for magic value 0x8230, documented
	  in latest datasheets for both PHYs

Changes in V4:
	- clean up init sequence
	- separate patch for fixing typos in upstreamed code

Changes in V5:
	- add missing statics for mv88q222x_revb0_init_seq0 and
	  mv88q222x_revb0_init_seq1
	- fix typo in commit message: autonegotiation
	- fix ordering of Signed-off-by and Reviewed-by in commit messages
	- add interrupt support for link detection
	- add suspend / resume ops
	- add support for internal temperature sensor
	- add cable test support
	- call .soft_reset in mv88q2xxx_config_aneg, this makes
	  mv88q2xxx_config_aneg compatible for Marvell88Q222x devices and
	  remove mv88q222x_config_aneg which is then just duplicated code
	- cleanup mv88q2xxx_config_init and make it compatible with
	  Marvell88Q222x devices
	- move parts from mv88q222x_config_init to mv88q2xxx_config_init
	  that are applicable for all Marvell88Q2xxx devices.

Dimitri Fedrau (13):
  net: phy: Add BaseT1 auto-negotiation constants
  net: phy: Support 100/1000BT1 linkmode advertisements
  net: phy: c45: detect 100/1000BASE-T1 linkmode advertisements
  net: phy: marvell-88q2xxx: fix typos
  net: phy: marvell-88q2xxx: add driver for the Marvell 88Q2220 PHY
  net: phy: marvell-88q2xxx: add interrupt support for link detection
  net: phy: marvell-88q2xxx: add suspend / resume ops
  net: phy: marvell-88q2xxx: add support for temperature sensor
  net: phy: marvell-88q2xxx: add cable test support
  net: phy: marvell-88q2xxx: make mv88q2xxx_config_aneg generic
  net: phy: marvell-88q2xxx: switch to mv88q2xxx_config_aneg
  net: phy: marvell-88q2xxx: cleanup mv88q2xxx_config_init
  net: phy: marvell-88q2xxx: remove redundant code

 drivers/net/phy/marvell-88q2xxx.c | 634 ++++++++++++++++++++++++++++--
 drivers/net/phy/phy-c45.c         |   3 +-
 include/linux/marvell_phy.h       |   1 +
 include/linux/mdio.h              |   8 +
 include/uapi/linux/mdio.h         |   2 +
 5 files changed, 618 insertions(+), 30 deletions(-)

Comments

Jakub Kicinski Jan. 30, 2024, 2:09 a.m. UTC | #1
On Mon, 22 Jan 2024 22:28:33 +0100 Dimitri Fedrau wrote:
> Changes in V5:
> 	- add missing statics for mv88q222x_revb0_init_seq0 and
> 	  mv88q222x_revb0_init_seq1
> 	- fix typo in commit message: autonegotiation
> 	- fix ordering of Signed-off-by and Reviewed-by in commit messages
> 	- add interrupt support for link detection
> 	- add suspend / resume ops
> 	- add support for internal temperature sensor
> 	- add cable test support
> 	- call .soft_reset in mv88q2xxx_config_aneg, this makes
> 	  mv88q2xxx_config_aneg compatible for Marvell88Q222x devices and
> 	  remove mv88q222x_config_aneg which is then just duplicated code
> 	- cleanup mv88q2xxx_config_init and make it compatible with
> 	  Marvell88Q222x devices
> 	- move parts from mv88q222x_config_init to mv88q2xxx_config_init
> 	  that are applicable for all Marvell88Q2xxx devices.

PHY maintainers - could anyone take a look at these patches?
Dimitri Fedrau Feb. 2, 2024, 6:30 p.m. UTC | #2
[...]

Probably late, but there are parts of the code which are based on the
sample code provided by Marvell. The sample code is licensed under BSD
2 Clause. Should I change the license in the driver to dual license ?

Best regards,
Dimitri
Andrew Lunn Feb. 3, 2024, 4:07 p.m. UTC | #3
On Fri, Feb 02, 2024 at 07:30:29PM +0100, Dimitri Fedrau wrote:
> [...]
> 
> Probably late, but there are parts of the code which are based on the
> sample code provided by Marvell. The sample code is licensed under BSD
> 2 Clause. Should I change the license in the driver to dual license ?

IANAL

You can take BSD code and release it with a GPL license. But it would
be better to indicate it is derived from BSD code. Either make it dual
license, or add a comment about the origin of the code.

	 Andrew
Dimitri Fedrau Feb. 5, 2024, 9:32 a.m. UTC | #4
Am Sat, Feb 03, 2024 at 05:07:13PM +0100 schrieb Andrew Lunn:
> On Fri, Feb 02, 2024 at 07:30:29PM +0100, Dimitri Fedrau wrote:
> > [...]
> > 
> > Probably late, but there are parts of the code which are based on the
> > sample code provided by Marvell. The sample code is licensed under BSD
> > 2 Clause. Should I change the license in the driver to dual license ?
> 
> IANAL
> 
> You can take BSD code and release it with a GPL license. But it would
> be better to indicate it is derived from BSD code. Either make it dual
> license, or add a comment about the origin of the code.
>
Is there a reason why the "MODULE_AUTHOR" is not in the driver and it's
also missing in marvell-88x2222.c. I also don't see any copyright
information. I'm just curious, not seeking for any legal advice. :) I
just have to get this figured out to stay out of trouble.

Dimitri