[PATCH] lib:firmware: Select preferred boot hart for cold boot.

yangcheng.work at foxmail.com yangcheng.work at foxmail.com
Tue Jan 23 21:25:29 PST 2024


> add check here
>       if (scratch->boot_hart != -1UL && sbi_platform_cold_boot_allowed(plat, scratch->boot_hart)
>               sbi_hart_hang();

What this check means is that if the preferred hart does not allow cold boot, will we enter sbi_hart_hang? 
So should the conditions for judgment be like if (scratch->boot_hart != -1UL && !sbi_platform_cold_boot_allowed(plat, scratch->boot_hart))?

>> +    if (sbi_platform_cold_boot_allowed(plat, hartid) && next_mode_supported) {
>> +            if (scratch->boot_hart == -1) {
>replace -1 with -1UL
>> +                    if (atomic_xchg(&coldboot_lottery, 1) == 0)
>> +                            coldboot = true;
>> +            } else {
>> +                    if (scratch->boot_hart == hartid)
>> +                            coldboot = true;
>> +            }
>>      }
>>  

Sorry the email I sent before was not plain text, I have changed the format now.
Thank u.

Regards
Cheng Yang



More information about the opensbi mailing list