Skip to contentSkip to conversation

mlxbf_gige: compute MDIO period based on i1clk

PATCH Applied David Thompson 3 participants 5 messages Aug 26, 2022 – Sep 1, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mlxbf_gige: compute MDIO period based on i1clk

This patch adds logic to compute the MDIO period based on the i1clk, and thereafter write the MDIO period into the YU MDIO config register. The i1clk resource from the ACPI table is used to provide addressing to YU bootrecord PLL registers. The values in these registers are used to compute MDIO period. If the i1clk resource is not present in the ACPI table, then the current default hardcorded value of 430Mhz is used. The i1clk clock value of 430MHz is only accurate for boards with BF2 mid bin and main bin SoCs. The BF2 high bin SoCs have i1clk = 500MHz, but can support a slower MDIO period.

Fixes f92e1869d74e ("Add Mellanox BlueField Gigabit Ethernet driver")
---
 .../ethernet/mellanox/mlxbf_gige/mlxbf_gige.h |   4 +-
 .../mellanox/mlxbf_gige/mlxbf_gige_mdio.c     | 122 +++++++++++++++---
 .../mellanox/mlxbf_gige/mlxbf_gige_regs.h     |   2 +
 3 files changed, 110 insertions(+), 18 deletions(-)
drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige.h +3 -1
index 5fdf9b7179f5..5a1027b07215 100644
@@ -75,6 +75,7 @@ struct mlxbf_gige {
 	struct net_device *netdev;
 	struct platform_device *pdev;
 	void __iomem *mdio_io;
+	void __iomem *clk_io;
 	struct mii_bus *mdiobus;
 	spinlock_t lock;      /* for packet processing indices */
 	u16 rx_q_entries;
@@ -137,7 +138,8 @@ enum mlxbf_gige_res {
 	MLXBF_GIGE_RES_MDIO9,
 	MLXBF_GIGE_RES_GPIO0,
 	MLXBF_GIGE_RES_LLU,
-	MLXBF_GIGE_RES_PLU
+	MLXBF_GIGE_RES_PLU,
+	MLXBF_GIGE_RES_CLK
 };
 
 /* Version of register data returned by mlxbf_gige_get_regs() */
drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c +105 -17

169 lines not on this page · raw message

drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_regs.h +2 -0
index 5fb33c9294bf..7be3a793984d 100644
@@ -8,6 +8,8 @@
 #ifndef __MLXBF_GIGE_REGS_H__
 #define __MLXBF_GIGE_REGS_H__
 
+#define MLXBF_GIGE_VERSION                            0x0000
+#define MLXBF_GIGE_VERSION_BF2                        0x0
 #define MLXBF_GIGE_STATUS                             0x0010
 #define MLXBF_GIGE_STATUS_READY                       BIT(0)
 #define MLXBF_GIGE_INT_STATUS                         0x0028
Signature · 1 line
2.30.1
maintainer
#1 lore raw
Quoted 11 lines · On Fri, 26 Aug 2022 11:59:16 -0400 David Thompson wrote:

This patch adds logic to compute the MDIO period based on the i1clk, and thereafter write the MDIO period into the YU MDIO config register. The i1clk resource from the ACPI table is used to provide addressing to YU bootrecord PLL registers. The values in these registers are used to compute MDIO period. If the i1clk resource is not present in the ACPI table, then the current default hardcorded value of 430Mhz is used. The i1clk clock value of 430MHz is only accurate for boards with BF2 mid bin and main bin SoCs. The BF2 high bin SoCs have i1clk = 500MHz, but can support a slower MDIO period.

Quoted 3 lines
Fixes f92e1869d74e ("Add Mellanox BlueField Gigabit Ethernet driver")

Hm, why did you repost this?

#2 lore raw
Quoted 21 lines

-----Original Message-----
From: Jakub Kicinski <[email protected]>
Sent: Friday, August 26, 2022 9:49 PM
To: David Thompson <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Liming Sun <[email protected]>; Asmaa Mnebhi <[email protected]>
Subject: Re: [PATCH net v1] mlxbf_gige: compute MDIO period based on i1clk

Quoted 11 lines · On Fri, 26 Aug 2022 11:59:16 -0400 David Thompson wrote:

This patch adds logic to compute the MDIO period based on the i1clk, and thereafter write the MDIO period into the YU MDIO config register. The i1clk resource from the ACPI table is used to provide addressing to YU bootrecord PLL registers.
The values in these registers are used to compute MDIO period. If the i1clk resource is not present in the ACPI table, then the current default hardcorded value of 430Mhz is used.
The i1clk clock value of 430MHz is only accurate for boards with BF2 mid bin and main bin SoCs. The BF2 high bin SoCs have i1clk = 500MHz, but can support a slower MDIO period.

Quoted 5 lines
Quoted 3 lines
Fixes f92e1869d74e ("Add Mellanox BlueField Gigabit Ethernet driver")

Hm, why did you repost this?

I reposted because the first post failed the "netdev/cc_maintainers" test:

netdev/cc_maintainers fail 1 blamed authors not CCed: [email protected]; 1 maintainers not CCed: [email protected]

In the second post I included "[email protected]" .

- Dave

maintainer
#3 lore raw
Quoted 7 lines · On Thu, 1 Sep 2022 15:32:13 +0000 David Thompson wrote:
Quoted 1 line

Hm, why did you repost this?

I reposted because the first post failed the "netdev/cc_maintainers" test:

netdev/cc_maintainers fail 1 blamed authors not CCed: [email protected]; 1 maintainers not CCed: [email protected]

In the second post I included "[email protected]" .

I see.. FWIW the checks are not 100% accurate, I would have ignored that one. We're a little more lax about CCing people from the same company. Next time please put the reason in the changelog under the --- separator, to avoid any confusion and delays. Thanks!

#4 lore raw
In reply to David Thompson
This patch was applied to netdev/net.git (master) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <[email protected]>:

Quoted 11 lines · On Fri, 26 Aug 2022 11:59:16 -0400 you wrote:

This patch adds logic to compute the MDIO period based on the i1clk, and thereafter write the MDIO period into the YU MDIO config register. The i1clk resource from the ACPI table is used to provide addressing to YU bootrecord PLL registers. The values in these registers are used to compute MDIO period. If the i1clk resource is not present in the ACPI table, then the current default hardcorded value of 430Mhz is used. The i1clk clock value of 430MHz is only accurate for boards with BF2 mid bin and main bin SoCs. The BF2 high bin SoCs have i1clk = 500MHz, but can support a slower MDIO period.

Quoted 1 line

[...]

Here is the summary with links:
- [net,v1] mlxbf_gige: compute MDIO period based on i1clk

    https://git.kernel.org/netdev/net/c/3a1a274e933f

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html