[U-Boot] [PATCH 05/15] ARM: PSCI: Add fallback value for CONFIG_ARMV7_PSCI_NR_CPUS

Chen-Yu Tsai wens at csie.org
Sat Jul 2 11:17:34 CEST 2016


On Fri, Jul 1, 2016 at 6:39 PM, Hongbo Zhang <macro.wave.z at gmail.com> wrote:
> On Sun, Jun 19, 2016 at 12:38 PM, Chen-Yu Tsai <wens at csie.org> wrote:
>> The original PSCI implementation assumed CONFIG_ARMV7_PSCI_NR_CPUS=4.
>> Add this as a fallback value in case platforms have not defined it.
>>
>> Signed-off-by: Chen-Yu Tsai <wens at csie.org>
>> ---
>>  arch/arm/include/asm/config.h | 5 +++++
>>  1 file changed, 5 insertions(+)
>>
>> diff --git a/arch/arm/include/asm/config.h b/arch/arm/include/asm/config.h
>> index 435fc4521c2e..f70302dfc4f1 100644
>> --- a/arch/arm/include/asm/config.h
>> +++ b/arch/arm/include/asm/config.h
>> @@ -23,4 +23,9 @@
>>  #include <asm/arch/config.h>
>>  #endif
>>
>> +/* Original code assumed 4 CPUs */
>> +#ifndef CONFIG_ARMV7_PSCI_NR_CPUS
>> +#define CONFIG_ARMV7_PSCI_NR_CPUS 4
>
> This makes platforms which have there own macro definition embarrassed somehow.
> we should add
> #define CONFIG_ARMV7_PSCI_NR_CPUS CONFIG_MAX_CPUS
> if this patch merged.
> some of our platform even has 16 cores.

I'm not sure how CONFIG_MAX_CPUS is used though.

Thinking about this, my first approach is probably wrong.
I should add missing PSCI_NR_CPUS for the existing platforms.
New platforms should define it themselves when enabling PSCI.
Failure to do so will result in a compile error, rather than
having a fallback value that subtly breaks later on.

Regards
ChenYu

>
>> +#endif
>> +
>>  #endif
>> --
>> 2.8.1
>>


More information about the U-Boot mailing list