Commit 8a3a565f authored by Arkadiusz Kubalewski's avatar Arkadiusz Kubalewski Committed by David S. Miller

ice: add admin commands to access cgu configuration

Add firmware admin command to access clock generation unit
configuration, it is required to enable Extended PTP and SyncE features
in the driver.
Add definitions of possible hardware variations of input and output pins
related to clock generation unit and functions to access the data.
Signed-off-by: default avatarArkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
Signed-off-by: default avatarVadim Fedorenko <vadim.fedorenko@linux.dev>
Signed-off-by: default avatarJiri Pirko <jiri@nvidia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5f184269
...@@ -198,7 +198,9 @@ ...@@ -198,7 +198,9 @@
enum ice_feature { enum ice_feature {
ICE_F_DSCP, ICE_F_DSCP,
ICE_F_PTP_EXTTS, ICE_F_PTP_EXTTS,
ICE_F_PHY_RCLK,
ICE_F_SMA_CTRL, ICE_F_SMA_CTRL,
ICE_F_CGU,
ICE_F_GNSS, ICE_F_GNSS,
ICE_F_ROCE_LAG, ICE_F_ROCE_LAG,
ICE_F_SRIOV_LAG, ICE_F_SRIOV_LAG,
......
This diff is collapsed.
...@@ -94,6 +94,12 @@ ice_aq_get_phy_caps(struct ice_port_info *pi, bool qual_mods, u8 report_mode, ...@@ -94,6 +94,12 @@ ice_aq_get_phy_caps(struct ice_port_info *pi, bool qual_mods, u8 report_mode,
struct ice_sq_cd *cd); struct ice_sq_cd *cd);
bool ice_is_pf_c827(struct ice_hw *hw); bool ice_is_pf_c827(struct ice_hw *hw);
int int
ice_find_netlist_node(struct ice_hw *hw, u8 node_type_ctx, u8 node_part_number,
u16 *node_handle);
int
ice_aq_get_netlist_node(struct ice_hw *hw, struct ice_aqc_get_link_topo *cmd,
u8 *node_part_number, u16 *node_handle);
int
ice_aq_list_caps(struct ice_hw *hw, void *buf, u16 buf_size, u32 *cap_count, ice_aq_list_caps(struct ice_hw *hw, void *buf, u16 buf_size, u32 *cap_count,
enum ice_adminq_opc opc, struct ice_sq_cd *cd); enum ice_adminq_opc opc, struct ice_sq_cd *cd);
int int
...@@ -196,6 +202,44 @@ void ice_output_fw_log(struct ice_hw *hw, struct ice_aq_desc *desc, void *buf); ...@@ -196,6 +202,44 @@ void ice_output_fw_log(struct ice_hw *hw, struct ice_aq_desc *desc, void *buf);
struct ice_q_ctx * struct ice_q_ctx *
ice_get_lan_q_ctx(struct ice_hw *hw, u16 vsi_handle, u8 tc, u16 q_handle); ice_get_lan_q_ctx(struct ice_hw *hw, u16 vsi_handle, u8 tc, u16 q_handle);
int ice_sbq_rw_reg(struct ice_hw *hw, struct ice_sbq_msg_input *in); int ice_sbq_rw_reg(struct ice_hw *hw, struct ice_sbq_msg_input *in);
int
ice_aq_get_cgu_abilities(struct ice_hw *hw,
struct ice_aqc_get_cgu_abilities *abilities);
int
ice_aq_set_input_pin_cfg(struct ice_hw *hw, u8 input_idx, u8 flags1, u8 flags2,
u32 freq, s32 phase_delay);
int
ice_aq_get_input_pin_cfg(struct ice_hw *hw, u8 input_idx, u8 *status, u8 *type,
u8 *flags1, u8 *flags2, u32 *freq, s32 *phase_delay);
int
ice_aq_set_output_pin_cfg(struct ice_hw *hw, u8 output_idx, u8 flags,
u8 src_sel, u32 freq, s32 phase_delay);
int
ice_aq_get_output_pin_cfg(struct ice_hw *hw, u8 output_idx, u8 *flags,
u8 *src_sel, u32 *freq, u32 *src_freq);
int
ice_aq_get_cgu_dpll_status(struct ice_hw *hw, u8 dpll_num, u8 *ref_state,
u8 *dpll_state, u8 *config, s64 *phase_offset,
u8 *eec_mode);
int
ice_aq_set_cgu_dpll_config(struct ice_hw *hw, u8 dpll_num, u8 ref_state,
u8 config, u8 eec_mode);
int
ice_aq_set_cgu_ref_prio(struct ice_hw *hw, u8 dpll_num, u8 ref_idx,
u8 ref_priority);
int
ice_aq_get_cgu_ref_prio(struct ice_hw *hw, u8 dpll_num, u8 ref_idx,
u8 *ref_prio);
int
ice_aq_get_cgu_info(struct ice_hw *hw, u32 *cgu_id, u32 *cgu_cfg_ver,
u32 *cgu_fw_ver);
int
ice_aq_set_phy_rec_clk_out(struct ice_hw *hw, u8 phy_output, bool enable,
u32 *freq);
int
ice_aq_get_phy_rec_clk_out(struct ice_hw *hw, u8 *phy_output, u8 *port_num,
u8 *flags, u16 *node_handle);
void void
ice_stat_update40(struct ice_hw *hw, u32 reg, bool prev_stat_loaded, ice_stat_update40(struct ice_hw *hw, u32 reg, bool prev_stat_loaded,
u64 *prev_stat, u64 *cur_stat); u64 *prev_stat, u64 *cur_stat);
......
...@@ -3985,13 +3985,22 @@ void ice_init_feature_support(struct ice_pf *pf) ...@@ -3985,13 +3985,22 @@ void ice_init_feature_support(struct ice_pf *pf)
case ICE_DEV_ID_E810C_BACKPLANE: case ICE_DEV_ID_E810C_BACKPLANE:
case ICE_DEV_ID_E810C_QSFP: case ICE_DEV_ID_E810C_QSFP:
case ICE_DEV_ID_E810C_SFP: case ICE_DEV_ID_E810C_SFP:
case ICE_DEV_ID_E810_XXV_BACKPLANE:
case ICE_DEV_ID_E810_XXV_QSFP:
case ICE_DEV_ID_E810_XXV_SFP:
ice_set_feature_support(pf, ICE_F_DSCP); ice_set_feature_support(pf, ICE_F_DSCP);
ice_set_feature_support(pf, ICE_F_PTP_EXTTS); ice_set_feature_support(pf, ICE_F_PTP_EXTTS);
if (ice_is_e810t(&pf->hw)) { if (ice_is_phy_rclk_present(&pf->hw))
ice_set_feature_support(pf, ICE_F_PHY_RCLK);
/* If we don't own the timer - don't enable other caps */
if (!pf->hw.func_caps.ts_func_info.src_tmr_owned)
break;
if (ice_is_cgu_present(&pf->hw))
ice_set_feature_support(pf, ICE_F_CGU);
if (ice_is_clock_mux_present_e810t(&pf->hw))
ice_set_feature_support(pf, ICE_F_SMA_CTRL); ice_set_feature_support(pf, ICE_F_SMA_CTRL);
if (ice_gnss_is_gps_present(&pf->hw)) if (ice_gnss_is_gps_present(&pf->hw))
ice_set_feature_support(pf, ICE_F_GNSS); ice_set_feature_support(pf, ICE_F_GNSS);
}
break; break;
default: default:
break; break;
......
This diff is collapsed.
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#ifndef _ICE_PTP_HW_H_ #ifndef _ICE_PTP_HW_H_
#define _ICE_PTP_HW_H_ #define _ICE_PTP_HW_H_
#include <linux/dpll.h>
enum ice_ptp_tmr_cmd { enum ice_ptp_tmr_cmd {
INIT_TIME, INIT_TIME,
...@@ -110,6 +111,77 @@ struct ice_cgu_pll_params_e822 { ...@@ -110,6 +111,77 @@ struct ice_cgu_pll_params_e822 {
u32 post_pll_div; u32 post_pll_div;
}; };
#define E810C_QSFP_C827_0_HANDLE 2
#define E810C_QSFP_C827_1_HANDLE 3
enum ice_e810_c827_idx {
C827_0,
C827_1
};
enum ice_phy_rclk_pins {
ICE_RCLKA_PIN = 0, /* SCL pin */
ICE_RCLKB_PIN, /* SDA pin */
};
#define ICE_E810_RCLK_PINS_NUM (ICE_RCLKB_PIN + 1)
#define ICE_E822_RCLK_PINS_NUM (ICE_RCLKA_PIN + 1)
#define E810T_CGU_INPUT_C827(_phy, _pin) ((_phy) * ICE_E810_RCLK_PINS_NUM + \
(_pin) + ZL_REF1P)
enum ice_zl_cgu_in_pins {
ZL_REF0P = 0,
ZL_REF0N,
ZL_REF1P,
ZL_REF1N,
ZL_REF2P,
ZL_REF2N,
ZL_REF3P,
ZL_REF3N,
ZL_REF4P,
ZL_REF4N,
NUM_ZL_CGU_INPUT_PINS
};
enum ice_zl_cgu_out_pins {
ZL_OUT0 = 0,
ZL_OUT1,
ZL_OUT2,
ZL_OUT3,
ZL_OUT4,
ZL_OUT5,
ZL_OUT6,
NUM_ZL_CGU_OUTPUT_PINS
};
enum ice_si_cgu_in_pins {
SI_REF0P = 0,
SI_REF0N,
SI_REF1P,
SI_REF1N,
SI_REF2P,
SI_REF2N,
SI_REF3,
SI_REF4,
NUM_SI_CGU_INPUT_PINS
};
enum ice_si_cgu_out_pins {
SI_OUT0 = 0,
SI_OUT1,
SI_OUT2,
SI_OUT3,
SI_OUT4,
NUM_SI_CGU_OUTPUT_PINS
};
struct ice_cgu_pin_desc {
char *name;
u8 index;
enum dpll_pin_type type;
u32 freq_supp_num;
struct dpll_pin_frequency *freq_supp;
};
extern const struct extern const struct
ice_cgu_pll_params_e822 e822_cgu_params[NUM_ICE_TIME_REF_FREQ]; ice_cgu_pll_params_e822 e822_cgu_params[NUM_ICE_TIME_REF_FREQ];
...@@ -197,6 +269,20 @@ int ice_ptp_init_phy_e810(struct ice_hw *hw); ...@@ -197,6 +269,20 @@ int ice_ptp_init_phy_e810(struct ice_hw *hw);
int ice_read_sma_ctrl_e810t(struct ice_hw *hw, u8 *data); int ice_read_sma_ctrl_e810t(struct ice_hw *hw, u8 *data);
int ice_write_sma_ctrl_e810t(struct ice_hw *hw, u8 data); int ice_write_sma_ctrl_e810t(struct ice_hw *hw, u8 data);
int ice_read_pca9575_reg_e810t(struct ice_hw *hw, u8 offset, u8 *data); int ice_read_pca9575_reg_e810t(struct ice_hw *hw, u8 offset, u8 *data);
bool ice_is_pca9575_present(struct ice_hw *hw);
bool ice_is_phy_rclk_present(struct ice_hw *hw);
bool ice_is_clock_mux_present_e810t(struct ice_hw *hw);
int ice_get_pf_c827_idx(struct ice_hw *hw, u8 *idx);
bool ice_is_cgu_present(struct ice_hw *hw);
enum dpll_pin_type ice_cgu_get_pin_type(struct ice_hw *hw, u8 pin, bool input);
struct dpll_pin_frequency *
ice_cgu_get_pin_freq_supp(struct ice_hw *hw, u8 pin, bool input, u8 *num);
const char *ice_cgu_get_pin_name(struct ice_hw *hw, u8 pin, bool input);
int ice_get_cgu_state(struct ice_hw *hw, u8 dpll_idx,
enum dpll_lock_status last_dpll_state, u8 *pin,
u8 *ref_state, u8 *eec_mode, s64 *phase_offset,
enum dpll_lock_status *dpll_state);
int ice_get_cgu_rclk_pin_info(struct ice_hw *hw, u8 *base_idx, u8 *pin_num);
#define PFTSYN_SEM_BYTES 4 #define PFTSYN_SEM_BYTES 4
......
...@@ -965,6 +965,7 @@ struct ice_hw { ...@@ -965,6 +965,7 @@ struct ice_hw {
DECLARE_BITMAP(hw_ptype, ICE_FLOW_PTYPE_MAX); DECLARE_BITMAP(hw_ptype, ICE_FLOW_PTYPE_MAX);
u8 dvm_ena; u8 dvm_ena;
u16 io_expander_handle; u16 io_expander_handle;
u8 cgu_part_number;
}; };
/* Statistics collected by each port, VSI, VEB, and S-channel */ /* Statistics collected by each port, VSI, VEB, and S-channel */
......
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