@@ -319,7 +319,8 @@ static char *arc_extn_mumbojumbo(int cpu_id, char *buf, int len)
319319static void arc_chk_core_config (void )
320320{
321321 struct cpuinfo_arc * cpu = & cpuinfo_arc700 [smp_processor_id ()];
322- int fpu_enabled ;
322+ int saved = 0 , present = 0 ;
323+ char * opt_nm = NULL ;;
323324
324325 if (!cpu -> extn .timer0 )
325326 panic ("Timer0 is not present!\n" );
@@ -346,17 +347,28 @@ static void arc_chk_core_config(void)
346347
347348 /*
348349 * FP hardware/software config sanity
349- * -If hardware contains DPFP , kernel needs to save/restore FPU state
350+ * -If hardware present , kernel needs to save/restore FPU state
350351 * -If not, it will crash trying to save/restore the non-existant regs
351- *
352- * (only DPDP checked since SP has no arch visible regs)
353352 */
354- fpu_enabled = IS_ENABLED (CONFIG_ARC_FPU_SAVE_RESTORE );
355353
356- if (cpu -> extn .fpu_dp && !fpu_enabled )
357- pr_warn ("CONFIG_ARC_FPU_SAVE_RESTORE needed for working apps\n" );
358- else if (!cpu -> extn .fpu_dp && fpu_enabled )
359- panic ("FPU non-existent, disable CONFIG_ARC_FPU_SAVE_RESTORE\n" );
354+ if (is_isa_arcompact ()) {
355+ opt_nm = "CONFIG_ARC_FPU_SAVE_RESTORE" ;
356+ saved = IS_ENABLED (CONFIG_ARC_FPU_SAVE_RESTORE );
357+
358+ /* only DPDP checked since SP has no arch visible regs */
359+ present = cpu -> extn .fpu_dp ;
360+ } else {
361+ opt_nm = "CONFIG_ARC_HAS_ACCL_REGS" ;
362+ saved = IS_ENABLED (CONFIG_ARC_HAS_ACCL_REGS );
363+
364+ /* Accumulator Low:High pair (r58:59) present if DSP MPY or FPU */
365+ present = cpu -> extn_mpy .dsp | cpu -> extn .fpu_sp | cpu -> extn .fpu_dp ;
366+ }
367+
368+ if (present && !saved )
369+ pr_warn ("Enable %s for working apps\n" , opt_nm );
370+ else if (!present && saved )
371+ panic ("Disable %s, hardware NOT present\n" , opt_nm );
360372}
361373
362374/*
0 commit comments