Branch data Line data Source code
1 : : /* SPDX-License-Identifier: BSD-3-Clause 2 : : * Copyright(C) 2021 Marvell. 3 : : */ 4 : : 5 : : #include "cnxk_telemetry.h" 6 : : #include "roc_api.h" 7 : : #include "roc_priv.h" 8 : : 9 : : static int 10 : 0 : cnxk_tel_bphy(struct plt_tel_data *d) 11 : : { 12 : : struct idev_cfg *idev; 13 : : 14 : 0 : idev = idev_get_cfg(); 15 [ # # # # ]: 0 : if (!idev || !idev->bphy) 16 : : return -ENODEV; 17 : : 18 : 0 : plt_tel_data_add_dict_int(d, "sso_pf_func", roc_bphy_sso_pf_func_get()); 19 : 0 : plt_tel_data_add_dict_int(d, "npa_pf_func", roc_bphy_npa_pf_func_get()); 20 : : 21 : 0 : return 0; 22 : : } 23 : : 24 : : static int 25 : 0 : cnxk_bphy_tel_handle_info(const char *cmd __plt_unused, 26 : : const char *params __plt_unused, 27 : : struct plt_tel_data *d) 28 : : { 29 : 0 : plt_tel_data_start_dict(d); 30 : : 31 : 0 : return cnxk_tel_bphy(d); 32 : : } 33 : : 34 : : static int 35 : 0 : cnxk_bphy_telemetry_register(void) 36 : : { 37 [ # # ]: 0 : if (!(roc_model->flag & ROC_MODEL_CNF9K) && 38 : : !(roc_model->flag & ROC_MODEL_CNF10K)) 39 : : return 0; 40 : : 41 : 0 : plt_telemetry_register_cmd( 42 : : "/cnxk/bphy/info", cnxk_bphy_tel_handle_info, 43 : : "Returns bphy information. Takes no parameters"); 44 : : 45 : 0 : return 0; 46 : : } 47 : : 48 : 254 : PLT_INIT(cnxk_telemetry_bphy_init) 49 : : { 50 : 254 : roc_plt_init_cb_register(cnxk_bphy_telemetry_register); 51 : 254 : }