aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c36
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h6
2 files changed, 42 insertions, 0 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c
index 61c000a08ebb..35ec23073c7f 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c
@@ -813,6 +813,41 @@ static const struct file_operations mps_tcam_debugfs_fops = {
813 .release = seq_release, 813 .release = seq_release,
814}; 814};
815 815
816/* Display various sensor information.
817 */
818static int sensors_show(struct seq_file *seq, void *v)
819{
820 struct adapter *adap = seq->private;
821 u32 param[7], val[7];
822 int ret;
823
824 /* Note that if the sensors haven't been initialized and turned on
825 * we'll get values of 0, so treat those as "<unknown>" ...
826 */
827 param[0] = (FW_PARAMS_MNEM_V(FW_PARAMS_MNEM_DEV) |
828 FW_PARAMS_PARAM_X_V(FW_PARAMS_PARAM_DEV_DIAG) |
829 FW_PARAMS_PARAM_Y_V(FW_PARAM_DEV_DIAG_TMP));
830 param[1] = (FW_PARAMS_MNEM_V(FW_PARAMS_MNEM_DEV) |
831 FW_PARAMS_PARAM_X_V(FW_PARAMS_PARAM_DEV_DIAG) |
832 FW_PARAMS_PARAM_Y_V(FW_PARAM_DEV_DIAG_VDD));
833 ret = t4_query_params(adap, adap->mbox, adap->fn, 0, 2,
834 param, val);
835
836 if (ret < 0 || val[0] == 0)
837 seq_puts(seq, "Temperature: <unknown>\n");
838 else
839 seq_printf(seq, "Temperature: %dC\n", val[0]);
840
841 if (ret < 0 || val[1] == 0)
842 seq_puts(seq, "Core VDD: <unknown>\n");
843 else
844 seq_printf(seq, "Core VDD: %dmV\n", val[1]);
845
846 return 0;
847}
848
849DEFINE_SIMPLE_DEBUGFS_FILE(sensors);
850
816#if IS_ENABLED(CONFIG_IPV6) 851#if IS_ENABLED(CONFIG_IPV6)
817static int clip_tbl_open(struct inode *inode, struct file *file) 852static int clip_tbl_open(struct inode *inode, struct file *file)
818{ 853{
@@ -1584,6 +1619,7 @@ int t4_setup_debugfs(struct adapter *adap)
1584 { "obq_ulp3", &cim_obq_fops, S_IRUSR, 3 }, 1619 { "obq_ulp3", &cim_obq_fops, S_IRUSR, 3 },
1585 { "obq_sge", &cim_obq_fops, S_IRUSR, 4 }, 1620 { "obq_sge", &cim_obq_fops, S_IRUSR, 4 },
1586 { "obq_ncsi", &cim_obq_fops, S_IRUSR, 5 }, 1621 { "obq_ncsi", &cim_obq_fops, S_IRUSR, 5 },
1622 { "sensors", &sensors_debugfs_fops, S_IRUSR, 0 },
1587 { "pm_stats", &pm_stats_debugfs_fops, S_IRUSR, 0 }, 1623 { "pm_stats", &pm_stats_debugfs_fops, S_IRUSR, 0 },
1588#if IS_ENABLED(CONFIG_IPV6) 1624#if IS_ENABLED(CONFIG_IPV6)
1589 { "clip_tbl", &clip_tbl_debugfs_fops, S_IRUSR, 0 }, 1625 { "clip_tbl", &clip_tbl_debugfs_fops, S_IRUSR, 0 },
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h b/drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h
index 1e72cda5eb1a..95fc425375c4 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h
+++ b/drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h
@@ -1059,6 +1059,7 @@ enum fw_params_param_dev {
1059 FW_PARAMS_PARAM_DEV_FWREV = 0x0B, 1059 FW_PARAMS_PARAM_DEV_FWREV = 0x0B,
1060 FW_PARAMS_PARAM_DEV_TPREV = 0x0C, 1060 FW_PARAMS_PARAM_DEV_TPREV = 0x0C,
1061 FW_PARAMS_PARAM_DEV_CF = 0x0D, 1061 FW_PARAMS_PARAM_DEV_CF = 0x0D,
1062 FW_PARAMS_PARAM_DEV_DIAG = 0x11,
1062 FW_PARAMS_PARAM_DEV_MAXORDIRD_QP = 0x13, /* max supported QP IRD/ORD */ 1063 FW_PARAMS_PARAM_DEV_MAXORDIRD_QP = 0x13, /* max supported QP IRD/ORD */
1063 FW_PARAMS_PARAM_DEV_MAXIRD_ADAPTER = 0x14, /* max supported adap IRD */ 1064 FW_PARAMS_PARAM_DEV_MAXIRD_ADAPTER = 0x14, /* max supported adap IRD */
1064 FW_PARAMS_PARAM_DEV_ULPTX_MEMWRITE_DSGL = 0x17, 1065 FW_PARAMS_PARAM_DEV_ULPTX_MEMWRITE_DSGL = 0x17,
@@ -1122,6 +1123,11 @@ enum fw_params_param_dmaq {
1122 FW_PARAMS_PARAM_DMAQ_EQ_DCBPRIO_ETH = 0x13, 1123 FW_PARAMS_PARAM_DMAQ_EQ_DCBPRIO_ETH = 0x13,
1123}; 1124};
1124 1125
1126enum fw_params_param_dev_diag {
1127 FW_PARAM_DEV_DIAG_TMP = 0x00,
1128 FW_PARAM_DEV_DIAG_VDD = 0x01,
1129};
1130
1125enum fw_params_param_dev_fwcache { 1131enum fw_params_param_dev_fwcache {
1126 FW_PARAM_DEV_FWCACHE_FLUSH = 0x00, 1132 FW_PARAM_DEV_FWCACHE_FLUSH = 0x00,
1127 FW_PARAM_DEV_FWCACHE_FLUSHINV = 0x01, 1133 FW_PARAM_DEV_FWCACHE_FLUSHINV = 0x01,