@@ -108,6 +108,54 @@ static const struct {
108108 { 0xF1 , "3GPP HFN matches or exceeds the Threshold" },
109109};
110110
111+ static const struct {
112+ u8 value ;
113+ const char * error_text ;
114+ } qi_error_list [] = {
115+ { 0x1F , "Job terminated by FQ or ICID flush" },
116+ { 0x20 , "FD format error" },
117+ { 0x21 , "FD command format error" },
118+ { 0x23 , "FL format error" },
119+ { 0x25 , "CRJD specified in FD, but not enabled in FLC" },
120+ { 0x30 , "Max. buffer size too small" },
121+ { 0x31 , "DHR exceeds max. buffer size (allocate mode, S/G format)" },
122+ { 0x32 , "SGT exceeds max. buffer size (allocate mode, S/G format" },
123+ { 0x33 , "Size over/underflow (allocate mode)" },
124+ { 0x34 , "Size over/underflow (reuse mode)" },
125+ { 0x35 , "Length exceeds max. short length (allocate mode, S/G/ format)" },
126+ { 0x36 , "Memory footprint exceeds max. value (allocate mode, S/G/ format)" },
127+ { 0x41 , "SBC frame format not supported (allocate mode)" },
128+ { 0x42 , "Pool 0 invalid / pool 1 size < pool 0 size (allocate mode)" },
129+ { 0x43 , "Annotation output enabled but ASAR = 0 (allocate mode)" },
130+ { 0x44 , "Unsupported or reserved frame format or SGHR = 1 (reuse mode)" },
131+ { 0x45 , "DHR correction underflow (reuse mode, single buffer format)" },
132+ { 0x46 , "Annotation length exceeds offset (reuse mode)" },
133+ { 0x48 , "Annotation output enabled but ASA limited by ASAR (reuse mode)" },
134+ { 0x49 , "Data offset correction exceeds input frame data length (reuse mode)" },
135+ { 0x4B , "Annotation output enabled but ASA cannote be expanded (frame list)" },
136+ { 0x51 , "Unsupported IF reuse mode" },
137+ { 0x52 , "Unsupported FL use mode" },
138+ { 0x53 , "Unsupported RJD use mode" },
139+ { 0x54 , "Unsupported inline descriptor use mode" },
140+ { 0xC0 , "Table buffer pool 0 depletion" },
141+ { 0xC1 , "Table buffer pool 1 depletion" },
142+ { 0xC2 , "Data buffer pool 0 depletion, no OF allocated" },
143+ { 0xC3 , "Data buffer pool 1 depletion, no OF allocated" },
144+ { 0xC4 , "Data buffer pool 0 depletion, partial OF allocated" },
145+ { 0xC5 , "Data buffer pool 1 depletion, partial OF allocated" },
146+ { 0xD0 , "FLC read error" },
147+ { 0xD1 , "FL read error" },
148+ { 0xD2 , "FL write error" },
149+ { 0xD3 , "OF SGT write error" },
150+ { 0xD4 , "PTA read error" },
151+ { 0xD5 , "PTA write error" },
152+ { 0xD6 , "OF SGT F-bit write error" },
153+ { 0xD7 , "ASA write error" },
154+ { 0xE1 , "FLC[ICR]=0 ICID error" },
155+ { 0xE2 , "FLC[ICR]=1 ICID error" },
156+ { 0xE4 , "source of ICID flush not trusted (BDI = 0)" },
157+ };
158+
111159static const char * const cha_id_list [] = {
112160 "" ,
113161 "AES" ,
@@ -236,6 +284,27 @@ static void report_deco_status(struct device *jrdev, const u32 status,
236284 status , error , idx_str , idx , err_str , err_err_code );
237285}
238286
287+ static void report_qi_status (struct device * qidev , const u32 status ,
288+ const char * error )
289+ {
290+ u8 err_id = status & JRSTA_QIERR_ERROR_MASK ;
291+ const char * err_str = "unidentified error value 0x" ;
292+ char err_err_code [3 ] = { 0 };
293+ int i ;
294+
295+ for (i = 0 ; i < ARRAY_SIZE (qi_error_list ); i ++ )
296+ if (qi_error_list [i ].value == err_id )
297+ break ;
298+
299+ if (i != ARRAY_SIZE (qi_error_list ) && qi_error_list [i ].error_text )
300+ err_str = qi_error_list [i ].error_text ;
301+ else
302+ snprintf (err_err_code , sizeof (err_err_code ), "%02x" , err_id );
303+
304+ dev_err (qidev , "%08x: %s: %s%s\n" ,
305+ status , error , err_str , err_err_code );
306+ }
307+
239308static void report_jr_status (struct device * jrdev , const u32 status ,
240309 const char * error )
241310{
@@ -250,7 +319,7 @@ static void report_cond_code_status(struct device *jrdev, const u32 status,
250319 status , error , __func__ );
251320}
252321
253- void caam_jr_strstatus (struct device * jrdev , u32 status )
322+ void caam_strstatus (struct device * jrdev , u32 status , bool qi_v2 )
254323{
255324 static const struct stat_src {
256325 void (* report_ssed )(struct device * jrdev , const u32 status ,
@@ -262,7 +331,7 @@ void caam_jr_strstatus(struct device *jrdev, u32 status)
262331 { report_ccb_status , "CCB" },
263332 { report_jump_status , "Jump" },
264333 { report_deco_status , "DECO" },
265- { NULL , "Queue Manager Interface" },
334+ { report_qi_status , "Queue Manager Interface" },
266335 { report_jr_status , "Job Ring" },
267336 { report_cond_code_status , "Condition Code" },
268337 { NULL , NULL },
@@ -288,4 +357,4 @@ void caam_jr_strstatus(struct device *jrdev, u32 status)
288357 else
289358 dev_err (jrdev , "%d: unknown error source\n" , ssrc );
290359}
291- EXPORT_SYMBOL (caam_jr_strstatus );
360+ EXPORT_SYMBOL (caam_strstatus );
0 commit comments