@@ -1904,20 +1904,16 @@ static void rvu_dbg_npc_init(struct rvu *rvu)
1904
1904
& rvu_dbg_npc_rx_miss_act_fops );
1905
1905
}
1906
1906
1907
- /* CPT debugfs APIs */
1908
1907
static int cpt_eng_sts_display (struct seq_file * filp , u8 eng_type )
1909
1908
{
1910
- struct rvu * rvu = filp -> private ;
1909
+ struct cpt_ctx * ctx = filp -> private ;
1911
1910
u64 busy_sts = 0 , free_sts = 0 ;
1912
1911
u32 e_min = 0 , e_max = 0 , e , i ;
1913
1912
u16 max_ses , max_ies , max_aes ;
1914
- int blkaddr ;
1913
+ struct rvu * rvu = ctx -> rvu ;
1914
+ int blkaddr = ctx -> blkaddr ;
1915
1915
u64 reg ;
1916
1916
1917
- blkaddr = rvu_get_blkaddr (rvu , BLKTYPE_CPT , 0 );
1918
- if (blkaddr < 0 )
1919
- return - ENODEV ;
1920
-
1921
1917
reg = rvu_read64 (rvu , blkaddr , CPT_AF_CONSTANTS1 );
1922
1918
max_ses = reg & 0xffff ;
1923
1919
max_ies = (reg >> 16 ) & 0xffff ;
@@ -1977,16 +1973,13 @@ RVU_DEBUG_SEQ_FOPS(cpt_ie_sts, cpt_ie_sts_display, NULL);
1977
1973
1978
1974
static int rvu_dbg_cpt_engines_info_display (struct seq_file * filp , void * unused )
1979
1975
{
1980
- struct rvu * rvu = filp -> private ;
1976
+ struct cpt_ctx * ctx = filp -> private ;
1981
1977
u16 max_ses , max_ies , max_aes ;
1978
+ struct rvu * rvu = ctx -> rvu ;
1979
+ int blkaddr = ctx -> blkaddr ;
1982
1980
u32 e_max , e ;
1983
- int blkaddr ;
1984
1981
u64 reg ;
1985
1982
1986
- blkaddr = rvu_get_blkaddr (rvu , BLKTYPE_CPT , 0 );
1987
- if (blkaddr < 0 )
1988
- return - ENODEV ;
1989
-
1990
1983
reg = rvu_read64 (rvu , blkaddr , CPT_AF_CONSTANTS1 );
1991
1984
max_ses = reg & 0xffff ;
1992
1985
max_ies = (reg >> 16 ) & 0xffff ;
@@ -2014,17 +2007,15 @@ RVU_DEBUG_SEQ_FOPS(cpt_engines_info, cpt_engines_info_display, NULL);
2014
2007
2015
2008
static int rvu_dbg_cpt_lfs_info_display (struct seq_file * filp , void * unused )
2016
2009
{
2017
- struct rvu * rvu = filp -> private ;
2018
- struct rvu_hwinfo * hw = rvu -> hw ;
2010
+ struct cpt_ctx * ctx = filp -> private ;
2011
+ int blkaddr = ctx -> blkaddr ;
2012
+ struct rvu * rvu = ctx -> rvu ;
2019
2013
struct rvu_block * block ;
2020
- int blkaddr ;
2014
+ struct rvu_hwinfo * hw ;
2021
2015
u64 reg ;
2022
2016
u32 lf ;
2023
2017
2024
- blkaddr = rvu_get_blkaddr (rvu , BLKTYPE_CPT , 0 );
2025
- if (blkaddr < 0 )
2026
- return - ENODEV ;
2027
-
2018
+ hw = rvu -> hw ;
2028
2019
block = & hw -> block [blkaddr ];
2029
2020
if (!block -> lf .bmap )
2030
2021
return - ENODEV ;
@@ -2049,13 +2040,10 @@ RVU_DEBUG_SEQ_FOPS(cpt_lfs_info, cpt_lfs_info_display, NULL);
2049
2040
2050
2041
static int rvu_dbg_cpt_err_info_display (struct seq_file * filp , void * unused )
2051
2042
{
2052
- struct rvu * rvu = filp -> private ;
2043
+ struct cpt_ctx * ctx = filp -> private ;
2044
+ struct rvu * rvu = ctx -> rvu ;
2045
+ int blkaddr = ctx -> blkaddr ;
2053
2046
u64 reg0 , reg1 ;
2054
- int blkaddr ;
2055
-
2056
- blkaddr = rvu_get_blkaddr (rvu , BLKTYPE_CPT , 0 );
2057
- if (blkaddr < 0 )
2058
- return - ENODEV ;
2059
2047
2060
2048
reg0 = rvu_read64 (rvu , blkaddr , CPT_AF_FLTX_INT (0 ));
2061
2049
reg1 = rvu_read64 (rvu , blkaddr , CPT_AF_FLTX_INT (1 ));
@@ -2079,15 +2067,11 @@ RVU_DEBUG_SEQ_FOPS(cpt_err_info, cpt_err_info_display, NULL);
2079
2067
2080
2068
static int rvu_dbg_cpt_pc_display (struct seq_file * filp , void * unused )
2081
2069
{
2082
- struct rvu * rvu ;
2083
- int blkaddr ;
2070
+ struct cpt_ctx * ctx = filp -> private ;
2071
+ struct rvu * rvu = ctx -> rvu ;
2072
+ int blkaddr = ctx -> blkaddr ;
2084
2073
u64 reg ;
2085
2074
2086
- rvu = filp -> private ;
2087
- blkaddr = rvu_get_blkaddr (rvu , BLKTYPE_CPT , 0 );
2088
- if (blkaddr < 0 )
2089
- return - ENODEV ;
2090
-
2091
2075
reg = rvu_read64 (rvu , blkaddr , CPT_AF_INST_REQ_PC );
2092
2076
seq_printf (filp , "CPT instruction requests %llu\n" , reg );
2093
2077
reg = rvu_read64 (rvu , blkaddr , CPT_AF_INST_LATENCY_PC );
@@ -2108,26 +2092,39 @@ static int rvu_dbg_cpt_pc_display(struct seq_file *filp, void *unused)
2108
2092
2109
2093
RVU_DEBUG_SEQ_FOPS (cpt_pc , cpt_pc_display , NULL );
2110
2094
2111
- static void rvu_dbg_cpt_init (struct rvu * rvu )
2095
+ static void rvu_dbg_cpt_init (struct rvu * rvu , int blkaddr )
2112
2096
{
2113
- if (!is_block_implemented (rvu -> hw , BLKADDR_CPT0 ))
2097
+ struct cpt_ctx * ctx ;
2098
+
2099
+ if (!is_block_implemented (rvu -> hw , blkaddr ))
2114
2100
return ;
2115
2101
2116
- rvu -> rvu_dbg .cpt = debugfs_create_dir ("cpt" , rvu -> rvu_dbg .root );
2102
+ if (blkaddr == BLKADDR_CPT0 ) {
2103
+ rvu -> rvu_dbg .cpt = debugfs_create_dir ("cpt" , rvu -> rvu_dbg .root );
2104
+ ctx = & rvu -> rvu_dbg .cpt_ctx [0 ];
2105
+ ctx -> blkaddr = BLKADDR_CPT0 ;
2106
+ ctx -> rvu = rvu ;
2107
+ } else {
2108
+ rvu -> rvu_dbg .cpt = debugfs_create_dir ("cpt1" ,
2109
+ rvu -> rvu_dbg .root );
2110
+ ctx = & rvu -> rvu_dbg .cpt_ctx [1 ];
2111
+ ctx -> blkaddr = BLKADDR_CPT1 ;
2112
+ ctx -> rvu = rvu ;
2113
+ }
2117
2114
2118
- debugfs_create_file ("cpt_pc" , 0600 , rvu -> rvu_dbg .cpt , rvu ,
2115
+ debugfs_create_file ("cpt_pc" , 0600 , rvu -> rvu_dbg .cpt , ctx ,
2119
2116
& rvu_dbg_cpt_pc_fops );
2120
- debugfs_create_file ("cpt_ae_sts" , 0600 , rvu -> rvu_dbg .cpt , rvu ,
2117
+ debugfs_create_file ("cpt_ae_sts" , 0600 , rvu -> rvu_dbg .cpt , ctx ,
2121
2118
& rvu_dbg_cpt_ae_sts_fops );
2122
- debugfs_create_file ("cpt_se_sts" , 0600 , rvu -> rvu_dbg .cpt , rvu ,
2119
+ debugfs_create_file ("cpt_se_sts" , 0600 , rvu -> rvu_dbg .cpt , ctx ,
2123
2120
& rvu_dbg_cpt_se_sts_fops );
2124
- debugfs_create_file ("cpt_ie_sts" , 0600 , rvu -> rvu_dbg .cpt , rvu ,
2121
+ debugfs_create_file ("cpt_ie_sts" , 0600 , rvu -> rvu_dbg .cpt , ctx ,
2125
2122
& rvu_dbg_cpt_ie_sts_fops );
2126
- debugfs_create_file ("cpt_engines_info" , 0600 , rvu -> rvu_dbg .cpt , rvu ,
2123
+ debugfs_create_file ("cpt_engines_info" , 0600 , rvu -> rvu_dbg .cpt , ctx ,
2127
2124
& rvu_dbg_cpt_engines_info_fops );
2128
- debugfs_create_file ("cpt_lfs_info" , 0600 , rvu -> rvu_dbg .cpt , rvu ,
2125
+ debugfs_create_file ("cpt_lfs_info" , 0600 , rvu -> rvu_dbg .cpt , ctx ,
2129
2126
& rvu_dbg_cpt_lfs_info_fops );
2130
- debugfs_create_file ("cpt_err_info" , 0600 , rvu -> rvu_dbg .cpt , rvu ,
2127
+ debugfs_create_file ("cpt_err_info" , 0600 , rvu -> rvu_dbg .cpt , ctx ,
2131
2128
& rvu_dbg_cpt_err_info_fops );
2132
2129
}
2133
2130
@@ -2146,7 +2143,8 @@ void rvu_dbg_init(struct rvu *rvu)
2146
2143
rvu_dbg_nix_init (rvu , BLKADDR_NIX1 );
2147
2144
rvu_dbg_cgx_init (rvu );
2148
2145
rvu_dbg_npc_init (rvu );
2149
- rvu_dbg_cpt_init (rvu );
2146
+ rvu_dbg_cpt_init (rvu , BLKADDR_CPT0 );
2147
+ rvu_dbg_cpt_init (rvu , BLKADDR_CPT1 );
2150
2148
}
2151
2149
2152
2150
void rvu_dbg_exit (struct rvu * rvu )
0 commit comments