]> git.baikalelectronics.ru Git - kernel.git/commit
mlxbf_gige: compute MDIO period based on i1clk
authorDavid Thompson <davthompson@nvidia.com>
Fri, 26 Aug 2022 15:59:16 +0000 (11:59 -0400)
committerJakub Kicinski <kuba@kernel.org>
Wed, 31 Aug 2022 19:13:46 +0000 (12:13 -0700)
commite05bec86ee8c80019fbc5387a31ff335638a2007
treee548cd1bd8fab0529639dced1ceb6d75d60d2fe2
parent889b702327eb70e4a3453b118cf10eb582c34fba
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: 1239c1f29b29 ("Add Mellanox BlueField Gigabit Ethernet driver")
Reviewed-by: Asmaa Mnebhi <asmaa@nvidia.com>
Signed-off-by: David Thompson <davthompson@nvidia.com>
Link: https://lore.kernel.org/r/20220826155916.12491-1-davthompson@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige.h
drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c
drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_regs.h