Commit 496fd0a2 authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller

mlx5: Implement SyncE support using DPLL infrastructure

Implement SyncE support using newly introduced DPLL support.
Make sure that each PFs/VFs/SFs probed with appropriate capability
will spawn a dpll auxiliary device and register appropriate dpll device
and pin instances.
Signed-off-by: default avatarJiri Pirko <jiri@nvidia.com>
Signed-off-by: default avatarArkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
Signed-off-by: default avatarVadim Fedorenko <vadim.fedorenko@linux.dev>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 09eeb3ae
......@@ -189,3 +189,11 @@ config MLX5_SF_MANAGER
port is managed through devlink. A subfunction supports RDMA, netdevice
and vdpa device. It is similar to a SRIOV VF but it doesn't require
SRIOV support.
config MLX5_DPLL
tristate "Mellanox 5th generation network adapters (ConnectX series) DPLL support"
depends on NETDEVICES && ETHERNET && PCI && MLX5_CORE
select DPLL
help
DPLL support in Mellanox Technologies ConnectX NICs.
......@@ -128,3 +128,6 @@ mlx5_core-$(CONFIG_MLX5_SF) += sf/vhca_event.o sf/dev/dev.o sf/dev/driver.o irq_
# SF manager
#
mlx5_core-$(CONFIG_MLX5_SF_MANAGER) += sf/cmd.o sf/hw_table.o sf/devlink.o
obj-$(CONFIG_MLX5_DPLL) += mlx5_dpll.o
mlx5_dpll-y := dpll.o
......@@ -206,6 +206,19 @@ static bool is_ib_enabled(struct mlx5_core_dev *dev)
return err ? false : val.vbool;
}
static bool is_dpll_supported(struct mlx5_core_dev *dev)
{
if (!IS_ENABLED(CONFIG_MLX5_DPLL))
return false;
if (!MLX5_CAP_MCAM_REG2(dev, synce_registers)) {
mlx5_core_warn(dev, "Missing SyncE capability\n");
return false;
}
return true;
}
enum {
MLX5_INTERFACE_PROTOCOL_ETH,
MLX5_INTERFACE_PROTOCOL_ETH_REP,
......@@ -215,6 +228,8 @@ enum {
MLX5_INTERFACE_PROTOCOL_MPIB,
MLX5_INTERFACE_PROTOCOL_VNET,
MLX5_INTERFACE_PROTOCOL_DPLL,
};
static const struct mlx5_adev_device {
......@@ -237,6 +252,8 @@ static const struct mlx5_adev_device {
.is_supported = &is_ib_rep_supported },
[MLX5_INTERFACE_PROTOCOL_MPIB] = { .suffix = "multiport",
.is_supported = &is_mp_supported },
[MLX5_INTERFACE_PROTOCOL_DPLL] = { .suffix = "dpll",
.is_supported = &is_dpll_supported },
};
int mlx5_adev_idx_alloc(void)
......
This diff is collapsed.
......@@ -155,6 +155,8 @@ enum {
MLX5_REG_MCC = 0x9062,
MLX5_REG_MCDA = 0x9063,
MLX5_REG_MCAM = 0x907f,
MLX5_REG_MSECQ = 0x9155,
MLX5_REG_MSEES = 0x9156,
MLX5_REG_MIRC = 0x9162,
MLX5_REG_SBCAM = 0xB01F,
MLX5_REG_RESOURCE_DUMP = 0xC000,
......
......@@ -10176,7 +10176,9 @@ struct mlx5_ifc_mcam_access_reg_bits2 {
u8 mirc[0x1];
u8 regs_97_to_96[0x2];
u8 regs_95_to_64[0x20];
u8 regs_95_to_87[0x09];
u8 synce_registers[0x2];
u8 regs_84_to_64[0x15];
u8 regs_63_to_32[0x20];
......@@ -12549,4 +12551,59 @@ struct mlx5_ifc_modify_page_track_obj_in_bits {
struct mlx5_ifc_page_track_bits obj_context;
};
struct mlx5_ifc_msecq_reg_bits {
u8 reserved_at_0[0x20];
u8 reserved_at_20[0x12];
u8 network_option[0x2];
u8 local_ssm_code[0x4];
u8 local_enhanced_ssm_code[0x8];
u8 local_clock_identity[0x40];
u8 reserved_at_80[0x180];
};
enum {
MLX5_MSEES_FIELD_SELECT_ENABLE = BIT(0),
MLX5_MSEES_FIELD_SELECT_ADMIN_STATUS = BIT(1),
MLX5_MSEES_FIELD_SELECT_ADMIN_FREQ_MEASURE = BIT(2),
};
enum mlx5_msees_admin_status {
MLX5_MSEES_ADMIN_STATUS_FREE_RUNNING = 0x0,
MLX5_MSEES_ADMIN_STATUS_TRACK = 0x1,
};
enum mlx5_msees_oper_status {
MLX5_MSEES_OPER_STATUS_FREE_RUNNING = 0x0,
MLX5_MSEES_OPER_STATUS_SELF_TRACK = 0x1,
MLX5_MSEES_OPER_STATUS_OTHER_TRACK = 0x2,
MLX5_MSEES_OPER_STATUS_HOLDOVER = 0x3,
MLX5_MSEES_OPER_STATUS_FAIL_HOLDOVER = 0x4,
MLX5_MSEES_OPER_STATUS_FAIL_FREE_RUNNING = 0x5,
};
struct mlx5_ifc_msees_reg_bits {
u8 reserved_at_0[0x8];
u8 local_port[0x8];
u8 pnat[0x2];
u8 lp_msb[0x2];
u8 reserved_at_14[0xc];
u8 field_select[0x20];
u8 admin_status[0x4];
u8 oper_status[0x4];
u8 ho_acq[0x1];
u8 reserved_at_49[0xc];
u8 admin_freq_measure[0x1];
u8 oper_freq_measure[0x1];
u8 failure_reason[0x9];
u8 frequency_diff[0x20];
u8 reserved_at_80[0x180];
};
#endif /* MLX5_IFC_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment