[PATCH net-next v2 5/5] net: phy: marvell: add support for Amethyst internal PHY

2021-04-20 Thread Marek Behún
Add support for Amethyst internal PHY. The only difference from Peridot is HWMON. Signed-off-by: Marek Behún --- drivers/net/phy/marvell.c | 117 +++- include/linux/marvell_phy.h | 1 + 2 files changed, 115 insertions(+), 3 deletions(-) diff --git a/drivers

[PATCH net-next v2 4/5] net: dsa: mv88e6xxx: simulate Amethyst PHY model number

2021-04-20 Thread Marek Behún
Amethyst internal PHYs also report empty model number in MII_PHYSID2. Fill in switch product number, as is done for Topaz and Peridot. Signed-off-by: Marek Behún Reviewed-by: Andrew Lunn --- drivers/net/dsa/mv88e6xxx/chip.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/dsa

[PATCH net-next v2 3/5] net: phy: marvell: use assignment by bitwise AND operator

2021-04-20 Thread Marek Behún
Use the &= operator instead of ret = ret & ... Signed-off-by: Marek Behún Reviewed-by: Andrew Lunn --- drivers/net/phy/marvell.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c index 9529aaa3bed3..e505060d074

[PATCH net-next v2 0/5] net: phy: marvell: some HWMON updates

2021-04-20 Thread Marek Behún
Here are some updates for Marvell PHY HWMON, mainly - refactoring for code deduplication - Amethyst PHY support Changes since v1: - addressed Andrew's comments - fixed macro names MII_88E6393_MISC_TEST_SAMPLES_4096 to _2048 MII_88E6393_MISC_TEST_SAMPLES_8192 to _4096 ... Marek Beh

[PATCH net-next v2 1/5] net: phy: marvell: refactor HWMON OOP style

2021-04-20 Thread Marek Behún
Use a structure of Marvell PHY specific HWMON methods to reduce code duplication. Store a pointer to this structure into the PHY driver's driver_data member. Signed-off-by: Marek Behún --- drivers/net/phy/marvell.c | 369 +- 1 file changed, 125 inser

[PATCH net-next v2 2/5] net: phy: marvell: fix HWMON enable register for 6390

2021-04-20 Thread Marek Behún
is reserved, although it is R/W. Since the code works, I think we can assume that it is correct.) Rename this register and define all 4 values according to 6393X documentation. Signed-off-by: Marek Behún --- drivers/net/phy/marvell.c | 19 +-- 1 file changed, 9 insertions(+), 10

Re: [PATCH net-next 1/5] net: phy: marvell: refactor HWMON OOP style

2021-04-13 Thread Marek Behún
On Tue, 13 Apr 2021 16:36:35 +0200 Andrew Lunn wrote: > > +static int marvell_hwmon_read(struct device *dev, enum hwmon_sensor_types > > type, > > + u32 attr, int channel, long *temp) > > { > > struct phy_device *phydev = dev_get_drvdata(dev); > > - int err; > > +

Re: [PATCH net-next 2/5] net: phy: marvell: fix HWMON enable register for 6390

2021-04-13 Thread Marek Behún
On Tue, 13 Apr 2021 16:25:33 +0200 Andrew Lunn wrote: > On Tue, Apr 13, 2021 at 09:55:35AM +0200, Marek Behún wrote: > > Register 27_6.15:14 has the following description in 88E6393X > > documentation: > > Temperature Sensor Enable > > 0x0 - Sample every 1s >

[PATCH net-next 4/5] net: dsa: mv88e6xxx: simulate Amethyst PHY model number

2021-04-13 Thread Marek Behún
Amethyst internal PHYs also report empty model number in MII_PHYSID2. Fill in switch product number, as is done for Topaz and Peridot. Signed-off-by: Marek Behún --- drivers/net/dsa/mv88e6xxx/chip.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers

[PATCH net-next 2/5] net: phy: marvell: fix HWMON enable register for 6390

2021-04-13 Thread Marek Behún
the 6390 code uses this register currently, but the 6390 code handles it as two 1-bit registers (somewhat), instead of one register with 4 possible values. Rename this register and define all 4 values according to 6393X documentation. Signed-off-by: Marek Behún --- drivers/net/phy/marvell.c | 19

[PATCH net-next 3/5] net: phy: marvell: use assignment by bitwise AND operator

2021-04-13 Thread Marek Behún
Use the &= operator instead of ret = ret & ... Signed-off-by: Marek Behún --- drivers/net/phy/marvell.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c index bae2a225b550..9eb65898da83 100644 --- a/drivers

[PATCH net-next 5/5] net: phy: marvell: add support for Amethyst internal PHY

2021-04-13 Thread Marek Behún
Add support for Amethyst internal PHY. The only difference from Peridot is HWMON. Signed-off-by: Marek Behún --- drivers/net/phy/marvell.c | 117 +++- include/linux/marvell_phy.h | 1 + 2 files changed, 115 insertions(+), 3 deletions(-) diff --git a/drivers

[PATCH net-next 0/5] net: phy: marvell: some HWMON updates

2021-04-13 Thread Marek Behún
Here are some updates for Marvell PHY HWMON, mainly - refactoring for code deduplication - Amethyst PHY support Marek Behún (5): net: phy: marvell: refactor HWMON OOP style net: phy: marvell: fix HWMON enable register for 6390 net: phy: marvell: use assignment by bitwise AND operator net

[PATCH net-next 1/5] net: phy: marvell: refactor HWMON OOP style

2021-04-13 Thread Marek Behún
Use a structure of Marvell PHY specific HWMON methods to reduce code duplication. Store a pointer to this structure into the PHY driver's driver_data member. Signed-off-by: Marek Behún --- drivers/net/phy/marvell.c | 371 +- 1 file changed, 127 inser

Re: [PATCH] net: phy: marvell: fix detection of PHY on Topaz switches

2021-04-12 Thread Marek Behún
On Mon, 12 Apr 2021 18:38:29 +0200 Pali Rohár wrote: > On Monday 12 April 2021 18:12:35 Andrew Lunn wrote: > > On Mon, Apr 12, 2021 at 05:52:39PM +0200, Pali Rohár wrote: > > > On Monday 12 April 2021 17:32:33 Andrew Lunn wrote: > > > > > Anyway, now I'm looking at phy/marvell.c driver again

Re: [PATCH net-next 1/2] net: phy: marvell-88x2222: check that link is operational

2021-04-12 Thread Marek Behún
On Mon, 12 Apr 2021 15:16:59 +0300 Ivan Bornyakov wrote: > Some SFP modules uses RX_LOS for link indication. In such cases link > will be always up, even without cable connected. RX_LOS changes will > trigger link_up()/link_down() upstream operations. Thus, check that SFP > link is operational be

Re: [PATCH v2] net: phy: marvell: fix detection of PHY on Topaz switches

2021-04-12 Thread Marek Behún
> + /* Some internal PHYs don't have a model number. */ > + if (reg == MII_PHYSID2 && !(val & 0x3f0) && > + chip->info->family < ARRAY_SIZE(family_prod_id_table)) { > + prod_id = family_prod_id_table[chip->info->family]; > + if (prod_id) > +

Re: [PATCH kbuild] Makefile.extrawarn: disable -Woverride-init in W=1

2021-04-07 Thread Marek Behún
On Wed, 7 Apr 2021 09:14:29 +0200 Arnd Bergmann wrote: > On Wed, Apr 7, 2021 at 2:24 AM Marek Behún wrote: > > > > The -Wextra flag enables -Woverride-init in newer versions of GCC. > > > > This causes the compiler to warn when a value is written twice in a >

[PATCH net-next v4 10/16] net: phy: marvell10g: support other MACTYPEs

2021-04-07 Thread Marek Behún
Signed-off-by: Marek Behún --- drivers/net/phy/marvell10g.c | 90 +--- 1 file changed, 54 insertions(+), 36 deletions(-) diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c index 20d3e572c935..2dc1317e601e 100644 --- a/drivers/net/phy/marvell1

[PATCH net-next v4 06/16] net: phy: marvell10g: add MACTYPE definitions for 88E21xx

2021-04-07 Thread Marek Behún
Add all MACTYPE definitions for 88E2110, 88E2180, 88E2111 and 88E2181. Signed-off-by: Marek Behún Reviewed-by: Andrew Lunn --- drivers/net/phy/marvell10g.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c index

[PATCH net-next v4 05/16] net: phy: marvell10g: add all MACTYPE definitions for 88X33x0

2021-04-07 Thread Marek Behún
Add all MACTYPE definitions for 88X3310, 88X3310P, 88X3340 and 88X3340P. In order to have consistent naming, rename MV_V2_33X0_PORT_CTRL_MACTYPE_RATE_MATCH to MV_V2_33X0_PORT_CTRL_MACTYPE_10GBASER_RATE_MATCH. Signed-off-by: Marek Behún Reviewed-by: Andrew Lunn --- drivers/net/phy/marvell10g.c

[PATCH net-next v4 04/16] net: phy: marvell10g: indicate 88X33x0 only port control registers

2021-04-07 Thread Marek Behún
Rename port control registers to indicate that they are valid only for 88X33x0, not for 88E21x0. Signed-off-by: Marek Behún --- drivers/net/phy/marvell10g.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy

[PATCH net-next v4 15/16] net: phy: marvell10g: change module description

2021-04-07 Thread Marek Behún
This module supports not only Alaska X, but also Alaska M. Change module description appropriately. Signed-off-by: Marek Behún Reviewed-by: Andrew Lunn --- drivers/net/phy/marvell10g.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/phy/marvell10g.c b/drivers

[PATCH net-next v4 13/16] net: phy: add constants for 2.5G and 5G speed in PCS speed register

2021-04-07 Thread Marek Behún
Add constants for 2.5G and 5G speed in PCS speed register into mdio.h. Signed-off-by: Marek Behún Reviewed-by: Andrew Lunn --- include/uapi/linux/mdio.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/uapi/linux/mdio.h b/include/uapi/linux/mdio.h index 3f302e2523b2..bdf77dffa5a4

[PATCH net-next v4 14/16] net: phy: marvell10g: differentiate 88E2110 vs 88E2111

2021-04-07 Thread Marek Behún
88E2111 is a variant of 88E2110 which does not support 5 gigabit speeds. Differentiate these variants via the match_phy_device() method, since they have the same PHY ID. Signed-off-by: Marek Behún --- drivers/net/phy/marvell10g.c | 62 1 file changed, 62

[PATCH net-next v4 16/16] MAINTAINERS: add myself as maintainer of marvell10g driver

2021-04-07 Thread Marek Behún
Add myself as maintainer of the marvell10g ethernet PHY driver, in addition to Russell King. Signed-off-by: Marek Behún --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 217c7470bfa9..3ea9539821b5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS

[PATCH net-next v4 11/16] net: phy: marvell10g: add separate structure for 88X3340

2021-04-07 Thread Marek Behún
The 88X3340 contains 4 cores similar to 88X3310, but there is a difference: it does not support xaui host mode. Instead the corresponding MACTYPE means rxaui / 5gbase-r / 2500base-x / sgmii without AN Signed-off-by: Marek Behún --- drivers/net/phy/marvell10g.c | 58

[PATCH net-next v4 12/16] net: phy: marvell10g: fix driver name for mv88e2110

2021-04-07 Thread Marek Behún
The driver name "mv88x2110" should be instead "mv88e2110". Signed-off-by: Marek Behún Reviewed-by: Andrew Lunn --- drivers/net/phy/marvell10g.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.

[PATCH net-next v4 09/16] net: phy: marvell10g: store temperature read method in chip strucutre

2021-04-07 Thread Marek Behún
Now that we have a chip structure, we can store the temperature reading method in this structure (OOP style). Signed-off-by: Marek Behún Reviewed-by: Andrew Lunn --- drivers/net/phy/marvell10g.c | 23 ++- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a

[PATCH net-next v4 07/16] net: phy: marvell10g: support all rate matching modes

2021-04-07 Thread Marek Behún
setting the MACTYPE register). There is work in progress to enable this driver to deduce the best MACTYPE from the knowledge of which interface modes are supported by the host, but this work is not finished yet. Signed-off-by: Marek Behún --- drivers/net/phy/marvell10g.c | 103

[PATCH net-next v4 03/16] net: phy: marvell10g: allow 5gbase-r and usxgmii

2021-04-07 Thread Marek Behún
These modes are also supported by these PHYs. Signed-off-by: Marek Behún Reviewed-by: Andrew Lunn --- drivers/net/phy/marvell10g.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c index f2f0da9717be

[PATCH net-next v4 02/16] net: phy: marvell10g: fix typo

2021-04-07 Thread Marek Behún
This space should be a tab instead. Signed-off-by: Marek Behún Reviewed-by: Andrew Lunn --- drivers/net/phy/marvell10g.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c index 9b514124af0d..f2f0da9717be 100644 --- a

[PATCH net-next v4 08/16] net: phy: marvell10g: check for correct supported interface mode

2021-04-07 Thread Marek Behún
The 88E2110 does not support xaui nor rxaui modes. Check for correct interface mode for different chips. Signed-off-by: Marek Behún --- drivers/net/phy/marvell10g.c | 37 +--- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/drivers/net/phy

[PATCH net-next v4 01/16] net: phy: marvell10g: rename register

2021-04-07 Thread Marek Behún
The MV_V2_PORT_MAC_TYPE_* is part of the CTRL register. Rename to MV_V2_PORT_CTRL_MACTYPE_*. Signed-off-by: Marek Behún Reviewed-by: Andrew Lunn --- drivers/net/phy/marvell10g.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/phy/marvell10g.c b/drivers

[PATCH net-next v4 00/16] net: phy: marvell10g updates

2021-04-07 Thread Marek Behún
-port SXGMII modes are ignored for now) Changes since v1: - added various MACTYPEs support also for 88E21XX - differentiate between specific models with same PHY_ID - better check for compatible interface - print exact model Marek Behún (16): net: phy: marvell10g: rename register net

Re: [PATCH kbuild] Makefile.extrawarn: disable -Woverride-init in W=1

2021-04-07 Thread Marek Behún
On Wed, 7 Apr 2021 09:14:29 +0200 Arnd Bergmann wrote: > On Wed, Apr 7, 2021 at 2:24 AM Marek Behún wrote: > > > > The -Wextra flag enables -Woverride-init in newer versions of GCC. > > > > This causes the compiler to warn when a value is written twice in a >

[PATCH kbuild] Makefile.extrawarn: disable -Woverride-init in W=1

2021-04-06 Thread Marek Behún
MAP(bm, 64) = INITIALIZE_BITMAP(0, 1, 32, 33); can only be implemented by allowing a designated initializer to initialize the same members multiple times (because the compiler complains even if the multiple initializations initialize to the same value). Disable the -Woverride-init flag. Signed-off-by: Marek

Re: [PATCH net-next v3 04/18] net: phy: marvell10g: indicate 88X33x0 only port control registers

2021-04-06 Thread Marek Behún
On Wed, 7 Apr 2021 02:10:24 +0200 Andrew Lunn wrote: > > @@ -479,8 +479,8 @@ static int mv3310_config_init(struct phy_device *phydev) > > val = phy_read_mmd(phydev, MDIO_MMD_VEND2, MV_V2_PORT_CTRL); > > if (val < 0) > > return val; > > - priv->rate_match = ((val & MV_V2_PORT

Re: [PATCH net-next v3 07/18] net: phy: marvell10g: support all rate matching modes

2021-04-06 Thread Marek Behún
On Wed, 7 Apr 2021 01:33:33 +0200 Andrew Lunn wrote: > On Wed, Apr 07, 2021 at 12:10:56AM +0200, Marek Behún wrote: > > Add support for all rate matching modes for 88X3310 (currently only > > 10gbase-r is supported, but xaui and rxaui can also be used). > > > > Add su

Re: [PATCH net-next v3 09/18] include: bitmap: add macro for bitmap initialization

2021-04-06 Thread Marek Behún
On Wed, 7 Apr 2021 01:38:30 +0200 Andrew Lunn wrote: > On Wed, Apr 07, 2021 at 12:10:58AM +0200, Marek Behún wrote: > > Use the new variadic-macro.h library to implement macro > > INITIALIZE_BITMAP(nbits, ...), which can be used for compile time bitmap > > initialization in

Re: [PATCH net-next v3 07/18] net: phy: marvell10g: support all rate matching modes

2021-04-06 Thread Marek Behún
On Wed, 7 Apr 2021 01:30:28 +0200 Andrew Lunn wrote: > > +static inline const struct mv3310_chip * > > +to_mv3310_chip(struct phy_device *phydev) > > +{ > > + return phydev->drv->driver_data; > > +} > > No inline functions in C code please. Let the compiler decide. > >Andrew Fixed in m

[PATCH net-next v3 18/18] MAINTAINERS: add myself as maintainer of marvell10g driver

2021-04-06 Thread Marek Behún
Add myself as maintainer of the marvell10g ethernet PHY driver, in addition to Russell King. Signed-off-by: Marek Behún --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 217c7470bfa9..3ea9539821b5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS

[PATCH net-next v3 17/18] net: phy: marvell10g: change module description

2021-04-06 Thread Marek Behún
This module supports not not only Alaska X, but also Alaska M. Change module description appropriately. Signed-off-by: Marek Behún --- drivers/net/phy/marvell10g.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c

[PATCH net-next v3 16/18] net: phy: marvell10g: differentiate 88E2110 vs 88E2111

2021-04-06 Thread Marek Behún
88E2111 is a variant of 88E2110 which does not support 5 gigabit speeds. Differentiate these variants via the match_phy_device() method, since they have the same PHY ID. Signed-off-by: Marek Behún --- drivers/net/phy/marvell10g.c | 59 1 file changed, 59

[PATCH net-next v3 14/18] net: phy: marvell10g: fix driver name for mv88e2110

2021-04-06 Thread Marek Behún
The driver name "mv88x2110" should be instead "mv88e2110". Signed-off-by: Marek Behún --- drivers/net/phy/marvell10g.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c index 74a91853ef46..51b7a

[PATCH net-next v3 15/18] net: phy: add constants for 2.5G and 5G speed in PCS speed register

2021-04-06 Thread Marek Behún
Add constants for 2.5G and 5G speed in PCS speed register into mdio.h. Signed-off-by: Marek Behún --- include/uapi/linux/mdio.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/uapi/linux/mdio.h b/include/uapi/linux/mdio.h index 3f302e2523b2..bdf77dffa5a4 100644 --- a/include/uapi

[PATCH net-next v3 13/18] net: phy: marvell10g: add separate structure for 88X3340

2021-04-06 Thread Marek Behún
The 88X3340 contains 4 cores similar to 88X3310, but there is a difference: it does not support xaui host mode. Instead the corresponding MACTYPE means rxaui / 5gbase-r / 2500base-x / sgmii without AN Signed-off-by: Marek Behún --- drivers/net/phy/marvell10g.c | 55

[PATCH net-next v3 12/18] net: phy: marvell10g: support other MACTYPEs

2021-04-06 Thread Marek Behún
Signed-off-by: Marek Behún --- drivers/net/phy/marvell10g.c | 90 +--- 1 file changed, 54 insertions(+), 36 deletions(-) diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c index a7c7c87201fa..2fd823318de8 100644 --- a/drivers/net/phy/marvell1

[PATCH net-next v3 11/18] net: phy: marvell10g: store temperature read method in chip strucutre

2021-04-06 Thread Marek Behún
Now that we have a chip structure, we can store the temperature reading method in this structure (OOP style). Signed-off-by: Marek Behún --- drivers/net/phy/marvell10g.c | 23 ++- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/drivers/net/phy/marvell10g.c b

[PATCH net-next v3 10/18] net: phy: marvell10g: check for correct supported interface mode

2021-04-06 Thread Marek Behún
The 88E2110 does not support xaui nor rxaui modes. Check for correct interface mode for different chips. Signed-off-by: Marek Behún --- drivers/net/phy/marvell10g.c | 25 ++--- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/drivers/net/phy/marvell10g.c b

[PATCH net-next v3 09/18] include: bitmap: add macro for bitmap initialization

2021-04-06 Thread Marek Behún
-time error if an argument is out of range. Signed-off-by: Marek Behún --- include/linux/bitmap.h | 24 1 file changed, 24 insertions(+) diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h index 70a932470b2d..a9e74d3420bf 100644 --- a/include/linux/bitmap.h +++ b

[PATCH net-next v3 02/18] net: phy: marvell10g: fix typo

2021-04-06 Thread Marek Behún
This space should be a tab instead. Signed-off-by: Marek Behún --- drivers/net/phy/marvell10g.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c index 9b514124af0d..f2f0da9717be 100644 --- a/drivers/net/phy

[PATCH net-next v3 01/18] net: phy: marvell10g: rename register

2021-04-06 Thread Marek Behún
The MV_V2_PORT_MAC_TYPE_* is part of the CTRL register. Rename to MV_V2_PORT_CTRL_MACTYPE_*. Signed-off-by: Marek Behún --- drivers/net/phy/marvell10g.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c index

[PATCH net-next v3 00/18] net: phy: marvell10g updates

2021-04-06 Thread Marek Behún
models with same PHY_ID - better check for compatible interface - print exact model Marek Behún (18): net: phy: marvell10g: rename register net: phy: marvell10g: fix typo net: phy: marvell10g: allow 5gbase-r and usxgmii net: phy: marvell10g: indicate 88X33x0 only port control registers

[PATCH net-next v3 07/18] net: phy: marvell10g: support all rate matching modes

2021-04-06 Thread Marek Behún
Add support for all rate matching modes for 88X3310 (currently only 10gbase-r is supported, but xaui and rxaui can also be used). Add support for rate matching for 88E2110 (on 88E2110 the MACTYPE register is at a different place). Signed-off-by: Marek Behún --- drivers/net/phy/marvell10g.c

[PATCH net-next v3 08/18] include: add library helpers for variadic macro expansion

2021-04-06 Thread Marek Behún
) used to implement a sane way for compile-time bitmap initialization, something like static DECLARE_BITMAP(bm, 100) = INITIALIZE_BITMAP(100, 7, 9, 66, 98); Signed-off-by: Marek Behún --- include/linux/variadic-macro.h | 221 + 1 file changed, 221 insertions

[PATCH net-next v3 06/18] net: phy: marvell10g: add MACTYPE definitions for 88E21xx

2021-04-06 Thread Marek Behún
Add all MACTYPE definitions for 88E2110, 88E2180, 88E2111 and 88E2181. Signed-off-by: Marek Behún --- drivers/net/phy/marvell10g.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c index 7d9a45437b69..556c9b43860e 100644

[PATCH net-next v3 05/18] net: phy: marvell10g: add all MACTYPE definitions for 88X33x0

2021-04-06 Thread Marek Behún
Add all MACTYPE definitions for 88X3310, 88X3310P, 88X3340 and 88X3340P. In order to have consistent naming, rename MV_V2_33X0_PORT_CTRL_MACTYPE_RATE_MATCH to MV_V2_33X0_PORT_CTRL_MACTYPE_10GBASER_RATE_MATCH. Signed-off-by: Marek Behún --- drivers/net/phy/marvell10g.c | 18

[PATCH net-next v3 03/18] net: phy: marvell10g: allow 5gbase-r and usxgmii

2021-04-06 Thread Marek Behún
These modes are also supported by these PHYs. Signed-off-by: Marek Behún --- drivers/net/phy/marvell10g.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c index f2f0da9717be..881a0717846e 100644 --- a/drivers

[PATCH net-next v3 04/18] net: phy: marvell10g: indicate 88X33x0 only port control registers

2021-04-06 Thread Marek Behún
Rename port control registers to indicate that they are valid only for 88X33x0, not for 88E21x0. Signed-off-by: Marek Behún --- drivers/net/phy/marvell10g.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy

Re: [PATCH net-next v2 11/12] net: phy: marvell10g: print exact model

2021-03-26 Thread Marek Behún
On Fri, 26 Mar 2021 09:07:34 + Russell King - ARM Linux admin wrote: > > Nice, didn't know about that. But I fear whether this would always work > > for the 88X3310 vs 88X3310P, it is possible that this feature is only > > recognizable if the firmware in the PHY is already running. > > The

Re: [PATCH net-next v2 11/12] net: phy: marvell10g: print exact model

2021-03-25 Thread Marek Behún
On Thu, 25 Mar 2021 21:44:21 +0100 Heiner Kallweit wrote: > On 25.03.2021 21:29, Marek Behún wrote: > > On Thu, 25 Mar 2021 15:54:52 + > > Russell King - ARM Linux admin wrote: > > > >> The 88X3310 and 88X3340 can be differentiated by bit 3 in the revision

Re: [PATCH net-next v2 11/12] net: phy: marvell10g: print exact model

2021-03-25 Thread Marek Behún
On Thu, 25 Mar 2021 15:54:52 + Russell King - ARM Linux admin wrote: > The 88X3310 and 88X3340 can be differentiated by bit 3 in the revision. > In other words, 88X3310 is 0x09a0..0x09a7, and 88X3340 is > 0x09a8..0x09af. We could add a separate driver structure, which would > then allow the k

Re: [PATCH net-next v2 11/12] net: phy: marvell10g: print exact model

2021-03-25 Thread Marek Behún
On Thu, 25 Mar 2021 15:54:52 + Russell King - ARM Linux admin wrote: > On Thu, Mar 25, 2021 at 02:12:49PM +0100, Marek Behún wrote: > > @@ -443,12 +446,24 @@ static int mv3310_probe(struct phy_device *phydev) > > > > switch (phydev->drv->phy_id) { > >

Re: [PATCH net-next v2 11/12] net: phy: marvell10g: print exact model

2021-03-25 Thread Marek Behún
On Thu, 25 Mar 2021 14:12:49 +0100 Marek Behún wrote: > Print exact mode, one of typo: model

[PATCH net-next v2 10/12] net: phy: add constants for 2.5G and 5G speed in PCS speed register

2021-03-25 Thread Marek Behún
Add constants for 2.5G and 5G speed in PCS speed register into mdio.h. Signed-off-by: Marek Behún --- include/uapi/linux/mdio.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/uapi/linux/mdio.h b/include/uapi/linux/mdio.h index 3f302e2523b2..bdf77dffa5a4 100644 --- a/include/uapi

[PATCH net-next v2 12/12] net: phy: marvell10g: better check for compatible interface

2021-03-25 Thread Marek Behún
Do a model-specific check for compatible interface: - 88X3340 does not support XAUI - 88E21XX does not support XAUI and RXAUI - 88E21X1 does not support 5gbase-r Signed-off-by: Marek Behún --- drivers/net/phy/marvell10g.c | 38 1 file changed, 25 insertions

[PATCH net-next v2 11/12] net: phy: marvell10g: print exact model

2021-03-25 Thread Marek Behún
Print exact mode, one of 88E2110 88E2111 88E2180 88E2181 88X3310 88X3310P 88X3340 88X3340P Signed-off-by: Marek Behún --- drivers/net/phy/marvell10g.c | 27 ++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/marvell10g.c b

[PATCH net-next v2 08/12] net: phy: marvell10g: support all rate matching modes

2021-03-25 Thread Marek Behún
Add support for all rate matching modes, not only for 10gbase-r. Signed-off-by: Marek Behún --- drivers/net/phy/marvell10g.c | 67 ++-- 1 file changed, 57 insertions(+), 10 deletions(-) diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c

[PATCH net-next v2 09/12] net: phy: marvell10g: support other MACTYPEs

2021-03-25 Thread Marek Behún
Currently the only "changing" MACTYPE we support is when the PHY changes between 10gbase-r / 5gbase-r / 2500base-x / sgmii Add support for xaui / 5gbase-r / 2500base-x / sgmii rxaui / 5gbase-r / 2500base-x / sgmii Signed-off-by: Marek Behún --- drivers/net/phy/marvell

[PATCH net-next v2 07/12] net: phy: marvell10g: add code to determine number of ports

2021-03-25 Thread Marek Behún
Add code to determine number of ports, from which we differentiate 88E211X from 88E218X and 88X3310 from 88X3340. Signed-off-by: Marek Behún --- drivers/net/phy/marvell10g.c | 44 +++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy

[PATCH net-next v2 06/12] net: phy: marvell10g: add MACTYPE definitions for 88E21XX

2021-03-25 Thread Marek Behún
Add all MACTYPE definitions for 88E2110, 88E2180, 88E2111 and 88E2181. Signed-off-by: Marek Behún --- drivers/net/phy/marvell10g.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c index 7d9a45437b69..556c9b43860e 100644

[PATCH net-next v2 04/12] net: phy: marvell10g: indicate 88X33X0 only port control registers

2021-03-25 Thread Marek Behún
Indicate via register names registers that are only valid for 88X33X0, not for 88E21X0. Signed-off-by: Marek Behún --- drivers/net/phy/marvell10g.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c

[PATCH net-next v2 03/12] net: phy: marvell10g: allow 5gbase-r and usxgmii

2021-03-25 Thread Marek Behún
This modes are also supported by this PHYs. Signed-off-by: Marek Behún --- drivers/net/phy/marvell10g.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c index f2f0da9717be..881a0717846e 100644 --- a/drivers

[PATCH net-next v2 05/12] net: phy: marvell10g: add MACTYPE definitions for 88X33X0/88X33X0P

2021-03-25 Thread Marek Behún
Add all MACTYPE definitions for 88X3310, 88X3310P, 88X3340 and 88X3340P. In order to have consistent naming, rename MV_V2_33X0_PORT_CTRL_MACTYPE_RATE_MATCH to MV_V2_33X0_PORT_CTRL_MACTYPE_10GBASER_RATE_MATCH. Signed-off-by: Marek Behún --- drivers/net/phy/marvell10g.c | 18

[PATCH net-next v2 00/12] net: phy: marvell10g updates

2021-03-25 Thread Marek Behún
Here are some updates for marvell10g PHY driver. Changes since v1: - added various MACTYPEs support also for 88E21XX - differentiate between specific models with same PHY_ID - better check for compatible interface - print exact model Marek Behún (12): net: phy: marvell10g: rename register

[PATCH net-next v2 02/12] net: phy: marvell10g: fix typo

2021-03-25 Thread Marek Behún
This space should be a tab instead. Signed-off-by: Marek Behún --- drivers/net/phy/marvell10g.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c index 9b514124af0d..f2f0da9717be 100644 --- a/drivers/net/phy

[PATCH net-next v2 01/12] net: phy: marvell10g: rename register

2021-03-25 Thread Marek Behún
The MV_V2_PORT_MAC_TYPE_* is part of the CTRL register. Rename to MV_V2_PORT_CTRL_MACTYPE_*. Signed-off-by: Marek Behún --- drivers/net/phy/marvell10g.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c index

Re: [PATCH net-next 0/2] dt-bindings: define property describing supported ethernet PHY modes

2021-03-24 Thread Marek Behún
On Wed, 24 Mar 2021 17:11:25 -0700 Florian Fainelli wrote: > On 3/24/2021 4:45 PM, Marek Behún wrote: > > On Wed, 24 Mar 2021 16:16:41 -0700 > > Florian Fainelli wrote: > > > >> On 3/24/2021 4:00 PM, Marek Behún wrote: > >>> On Wed, 24 Mar 2021 14

Re: [PATCH net-next 0/2] dt-bindings: define property describing supported ethernet PHY modes

2021-03-24 Thread Marek Behún
On Wed, 24 Mar 2021 16:16:41 -0700 Florian Fainelli wrote: > On 3/24/2021 4:00 PM, Marek Behún wrote: > > On Wed, 24 Mar 2021 14:19:28 -0700 > > Florian Fainelli wrote: > > > >>> Another problem is that if lower modes are supported, we should > >&

Re: [PATCH net-next 0/2] dt-bindings: define property describing supported ethernet PHY modes

2021-03-24 Thread Marek Behún
On Wed, 24 Mar 2021 14:19:28 -0700 Florian Fainelli wrote: > > Another problem is that if lower modes are supported, we should > > maybe use them in order to save power. > > That is an interesting proposal but if you want it to be truly valuable, > does not that mean that an user ought to be a

Re: [PATCH net-next 1/2] dt-bindings: ethernet-controller: create a type for PHY interface modes

2021-03-24 Thread Marek Behún
On Wed, 24 Mar 2021 14:07:06 -0600 Rob Herring wrote: > On Wed, Mar 24, 2021 at 11:35:55AM +0100, Marek Behún wrote: > > In order to be able to define a property describing an array of PHY > > interface modes, we need to change the current scalar > > `phy-connection-t

Re: [PATCH net-next 5/7] net: phy: marvell10g: save MACTYPE instead of rate_matching boolean

2021-03-24 Thread Marek Behún
On Wed, 24 Mar 2021 16:59:46 + Russell King - ARM Linux admin wrote: > On Wed, Mar 24, 2021 at 05:50:21PM +0100, Marek Behún wrote: > > Save MACTYPE instead of rate_matching boolean. We will need this for > > other configurations. > > This could lead us to having

Re: [PATCH net-next 4/7] net: phy: marvell10g: add MACTYPE definitions for 88X3310/88X3310P

2021-03-24 Thread Marek Behún
On Wed, 24 Mar 2021 16:58:36 + Russell King - ARM Linux admin wrote: > On Wed, Mar 24, 2021 at 05:50:20PM +0100, Marek Behún wrote: > > Add all MACTYPE definitions for 88X3310/88X3310P. > > > > In order to have consistent naming, rename > > MV_V2_PORT

[PATCH net-next 0/7] net: phy: marvell10g updates

2021-03-24 Thread Marek Behún
Here are some updates for marvell10g PHY driver. Marek Behún (7): net: phy: marvell10g: rename register net: phy: marvell10g: fix typo net: phy: marvell10g: allow 5gabse-r and usxgmii net: phy: marvell10g: add MACTYPE definitions for 88X3310/88X3310P net: phy: marvell10g: save MACTYPE

[PATCH net-next 7/7] net: phy: marvell10g: support other MACTYPEs

2021-03-24 Thread Marek Behún
Currently the only "changing" MACTYPE we support is when the PHY changes between 10gbase-r / 5gbase-r / 2500base-x / sgmii Add support for xaui / 5gbase-r / 2500base-x / sgmii rxaui / 5gbase-r / 2500base-x / sgmii Signed-off-by: Marek Behún --- drivers/net/phy/marvell

[PATCH net-next 6/7] net: phy: marvell10g: support more rate matching modes

2021-03-24 Thread Marek Behún
The 88X3310P supports rate matching mode also for XAUI and RXAUI. Signed-off-by: Marek Behún --- drivers/net/phy/marvell10g.c | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c index b4f9831b4db6

[PATCH net-next 2/7] net: phy: marvell10g: fix typo

2021-03-24 Thread Marek Behún
This space should be a tab instead. Signed-off-by: Marek Behún --- drivers/net/phy/marvell10g.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c index 96c081a7ec54..567e7900e5b8 100644 --- a/drivers/net/phy

[PATCH net-next 5/7] net: phy: marvell10g: save MACTYPE instead of rate_matching boolean

2021-03-24 Thread Marek Behún
Save MACTYPE instead of rate_matching boolean. We will need this for other configurations. Signed-off-by: Marek Behún --- drivers/net/phy/marvell10g.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c index

[PATCH net-next 3/7] net: phy: marvell10g: allow 5gabse-r and usxgmii

2021-03-24 Thread Marek Behún
This modes are also supported by this PHYs. Signed-off-by: Marek Behún --- drivers/net/phy/marvell10g.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c index 567e7900e5b8..70639b9393f3 100644 --- a/drivers/net

[PATCH net-next 4/7] net: phy: marvell10g: add MACTYPE definitions for 88X3310/88X3310P

2021-03-24 Thread Marek Behún
Add all MACTYPE definitions for 88X3310/88X3310P. In order to have consistent naming, rename MV_V2_PORT_CTRL_MACTYPE_RATE_MATCH to MV_V2_PORT_CTRL_MACTYPE_10GR_RATE_MATCH. Signed-off-by: Marek Behún --- drivers/net/phy/marvell10g.c | 13 ++--- 1 file changed, 10 insertions(+), 3

[PATCH net-next 1/7] net: phy: marvell10g: rename register

2021-03-24 Thread Marek Behún
The MV_V2_PORT_MAC_TYPE_* is part of the CTRL register. Rename to MV_V2_PORT_CTRL_MACTYPE_*. Signed-off-by: Marek Behún --- drivers/net/phy/marvell10g.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c index

[PATCH net-next 2/2] dt-bindings: ethernet-phy: define `supported-mac-connection-types` property

2021-03-24 Thread Marek Behún
property is missing, all modes supported by the PHY and MAC are presumed to be supported by the board. Signed-off-by: Marek Behún --- .../devicetree/bindings/net/ethernet-phy.yaml | 18 ++ 1 file changed, 18 insertions(+) diff --git a/Documentation/devicetree/bindings/net/ethernet

[PATCH net-next 1/2] dt-bindings: ethernet-controller: create a type for PHY interface modes

2021-03-24 Thread Marek Behún
. Signed-off-by: Marek Behún --- .../bindings/net/ethernet-controller.yaml | 89 ++- 1 file changed, 48 insertions(+), 41 deletions(-) diff --git a/Documentation/devicetree/bindings/net/ethernet-controller.yaml b/Documentation/devicetree/bindings/net/ethernet-controller.yaml

[PATCH net-next 0/2] dt-bindings: define property describing supported ethernet PHY modes

2021-03-24 Thread Marek Behún
that the same list does not have to be defined twice. Marek Marek Behún (2): dt-bindings: ethernet-controller: create a type for PHY interface modes dt-bindings: ethernet-phy: define `supported-mac-connection-types` property .../bindings/net/ethernet-controller.yaml | 89

Re: [RFC net-next 1/2] dt-bindings: ethernet-controller: create a type for PHY interface modes

2021-03-22 Thread Marek Behún
On Mon, 22 Mar 2021 22:11:04 +0100 Andrew Lunn wrote: > On Mon, Mar 22, 2021 at 08:49:58PM +0100, Marek Behún wrote: > > In order to be able to define a property describing an array of PHY > > interface modes, we need to change the current scalar > > `phy-connection-t

Re: [RFC net-next 2/2] dt-bindings: ethernet-phy: define `unsupported-mac-connection-types` property

2021-03-22 Thread Marek Behún
On Mon, 22 Mar 2021 19:56:05 + Russell King - ARM Linux admin wrote: > On Mon, Mar 22, 2021 at 08:49:59PM +0100, Marek Behún wrote: > > diff --git a/Documentation/devicetree/bindings/net/ethernet-phy.yaml > > b/Documentation/devicetree/bindings/net/ethernet-phy.yaml > &g

[RFC net-next 1/2] dt-bindings: ethernet-controller: create a type for PHY interface modes

2021-03-22 Thread Marek Behún
. Signed-off-by: Marek Behún --- Is `phy-connection-type` prefered over `phy-mode`? If not, maybe the type could be called `phy-modes-array`... --- .../bindings/net/ethernet-controller.yaml | 89 ++- 1 file changed, 48 insertions(+), 41 deletions(-) diff --git a/Documentation

[RFC net-next 2/2] dt-bindings: ethernet-phy: define `unsupported-mac-connection-types` property

2021-03-22 Thread Marek Behún
-types`, which lists these unsupported modes. Signed-off-by: Marek Behún --- As in the previous patch: we allow both `phy-connection-type` and `phy-mode` to define PHY interface mode. Should we call this new property as it is proposed by this patch, or something different, like `unsupported-mac

[RFC net-next 2/2] dt-bindings: ethernet-phy: define `unsupported-mac-connection-types` property

2021-03-22 Thread Marek Behún
-types`, which lists these unsupported modes. Signed-off-by: Marek Behún --- As in the previous patch: we allow both `phy-connection-type` and `phy-mode` to define PHY interface mode. Should we call this new property as it is proposed by this patch, or something different, like `unsupported-mac

  1   2   3   4   5   >