2023-05-22 12:47:20

by Harini Katakam

[permalink] [raw]
Subject: [PATCH net-next v4 0/2] Add support for VSC85xx DT RGMII delays

Provide an option to change RGMII delay value via devicetree.

v4:
- Remove VSC8531_02 support. Existing code will identify VSC8531_01/02
and there is no unique functionality to be added for either version.
- Correct type of rx/tx_delay to accept correct return value.
- Added Andrew's tag to patch 1

Lore link for v3:
https://lore.kernel.org/netdev/[email protected]/

v3 changes:
- Remove patch 2/3 from v2 as custom mscc properties dont need to be
defined. rx-internal-delay-ps and tx-internal-delay-ps can be used.
- Change RGMII delay precedence as advised by Vladimir:
phy-mode rgmii rgmii-rxid/rgmii-id
--------------------------------------------------------------------------------------------
rx-internal-delay-ps absent 0.2 ns 2 ns
rx-internal-delay-ps present follow rx-internal-delay-ps follow rx-internal-delay-ps
- Split VSC8531-02 and RGMII delay config into separate patches.
- Correct vendor ID
- Update commit description and subject everywhere to say RGMII delays
instead of RGMII tuning.

v2 changes:
- Added patch to use a common vendor phy id match
- Removed dt include header patch because delays should be specied in
ps, not register values
- Updated DT binding description and commit for optional delay tuning to
be clearer on the precedence
- Updated dt property name to include vendor instead of phy device name
- Switch both VSC8531 and VSC8531-02 to use exact phy id match as they
share the same model number
- Ensure RCT
- Improve optional property read

Harini Katakam (2):
phy: mscc: Use PHY_ID_MATCH_VENDOR to minimize PHY ID table
phy: mscc: Add support for RGMII delay configuration

drivers/net/phy/mscc/mscc.h | 3 ++
drivers/net/phy/mscc/mscc_main.c | 49 +++++++++++++++++++-------------
2 files changed, 32 insertions(+), 20 deletions(-)

--
2.17.1



2023-05-22 12:56:44

by Harini Katakam

[permalink] [raw]
Subject: [PATCH net-next v4 1/2] phy: mscc: Use PHY_ID_MATCH_VENDOR to minimize PHY ID table

All the PHY devices variants specified have the same mask and
hence can be simplified to one vendor look up for 0x00070400.
Any individual config can be identified by PHY_ID_MATCH_EXACT
in the respective structure.

Signed-off-by: Harini Katakam <[email protected]>
Reviewed-by: Andrew Lunn <[email protected]>
---
v4:
Added Andrew's tag
v3:
Correct vendor ID
v2:
New patch
drivers/net/phy/mscc/mscc.h | 1 +
drivers/net/phy/mscc/mscc_main.c | 14 +-------------
2 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/drivers/net/phy/mscc/mscc.h b/drivers/net/phy/mscc/mscc.h
index a50235fdf7d9..9acee8759105 100644
--- a/drivers/net/phy/mscc/mscc.h
+++ b/drivers/net/phy/mscc/mscc.h
@@ -290,6 +290,7 @@ enum rgmii_clock_delay {
#define PHY_ID_VSC8575 0x000707d0
#define PHY_ID_VSC8582 0x000707b0
#define PHY_ID_VSC8584 0x000707c0
+#define PHY_VENDOR_MSCC 0x00070400

#define MSCC_VDDMAC_1500 1500
#define MSCC_VDDMAC_1800 1800
diff --git a/drivers/net/phy/mscc/mscc_main.c b/drivers/net/phy/mscc/mscc_main.c
index 62bf99e45af1..91010524e03d 100644
--- a/drivers/net/phy/mscc/mscc_main.c
+++ b/drivers/net/phy/mscc/mscc_main.c
@@ -2656,19 +2656,7 @@ static struct phy_driver vsc85xx_driver[] = {
module_phy_driver(vsc85xx_driver);

static struct mdio_device_id __maybe_unused vsc85xx_tbl[] = {
- { PHY_ID_VSC8504, 0xfffffff0, },
- { PHY_ID_VSC8514, 0xfffffff0, },
- { PHY_ID_VSC8530, 0xfffffff0, },
- { PHY_ID_VSC8531, 0xfffffff0, },
- { PHY_ID_VSC8540, 0xfffffff0, },
- { PHY_ID_VSC8541, 0xfffffff0, },
- { PHY_ID_VSC8552, 0xfffffff0, },
- { PHY_ID_VSC856X, 0xfffffff0, },
- { PHY_ID_VSC8572, 0xfffffff0, },
- { PHY_ID_VSC8574, 0xfffffff0, },
- { PHY_ID_VSC8575, 0xfffffff0, },
- { PHY_ID_VSC8582, 0xfffffff0, },
- { PHY_ID_VSC8584, 0xfffffff0, },
+ { PHY_ID_MATCH_VENDOR(PHY_VENDOR_MSCC) },
{ }
};

--
2.17.1


2023-05-24 10:11:32

by Vladimir Oltean

[permalink] [raw]
Subject: Re: [PATCH net-next v4 0/2] Add support for VSC85xx DT RGMII delays

Hi Harini,

On Mon, May 22, 2023 at 05:58:27PM +0530, Harini Katakam wrote:
> Provide an option to change RGMII delay value via devicetree.
>
> v4:
> - Remove VSC8531_02 support. Existing code will identify VSC8531_01/02
> and there is no unique functionality to be added for either version.
> - Correct type of rx/tx_delay to accept correct return value.
> - Added Andrew's tag to patch 1

Would you mind waiting until this patch set for "net" is merged first,
then rebasing your "net-next" work on top of it?
https://patchwork.kernel.org/project/netdevbpf/cover/[email protected]/

You should be able to resend your patch set tomorrow, after the net pull
request and the subsequent net -> net-next merge.

There are going to be merge conflicts if your series gets applied
simultaneously, and they're ugly enough that I would prefer you to deal
with them locally, before submitting, rather than leaving the netdev
maintainers do it.

2023-05-24 11:28:19

by Harini Katakam

[permalink] [raw]
Subject: RE: [PATCH net-next v4 0/2] Add support for VSC85xx DT RGMII delays

Hi Vladimir,

> -----Original Message-----
> From: Vladimir Oltean <[email protected]>
> Sent: Wednesday, May 24, 2023 3:27 PM
> To: Katakam, Harini <[email protected]>
> Cc: [email protected]; [email protected]; [email protected];
> [email protected]; [email protected]; [email protected];
> [email protected]; [email protected];
> [email protected]; [email protected]; linux-
> [email protected]; [email protected]; Simek, Michal
> <[email protected]>; Pandey, Radhey Shyam
> <[email protected]>
> Subject: Re: [PATCH net-next v4 0/2] Add support for VSC85xx DT RGMII
> delays
>
> Hi Harini,
>
> On Mon, May 22, 2023 at 05:58:27PM +0530, Harini Katakam wrote:
> > Provide an option to change RGMII delay value via devicetree.
> >
> > v4:
> > - Remove VSC8531_02 support. Existing code will identify VSC8531_01/02
> > and there is no unique functionality to be added for either version.
> > - Correct type of rx/tx_delay to accept correct return value.
> > - Added Andrew's tag to patch 1
>
> Would you mind waiting until this patch set for "net" is merged first, then
> rebasing your "net-next" work on top of it?
> https://patchwork.kernel.org/project/netdevbpf/cover/20230523153108.1854
> [email protected]/
>
> You should be able to resend your patch set tomorrow, after the net pull
> request and the subsequent net -> net-next merge.
>
> There are going to be merge conflicts if your series gets applied
> simultaneously, and they're ugly enough that I would prefer you to deal with
> them locally, before submitting, rather than leaving the netdev maintainers do
> it.

Ok sure, I'll wait and rebase after the above set is merged.

Regards,
Harini