Introduce hart disabled parameter in platform.

As of now, uboot doesn't have support for SMP.
Moreover, unleashed board has a E51 hart which
doesn't not support S mode.

We should only boot only 1 non-zero hart.

Signed-off-by: Atish Patra <atish.patra@wdc.com>
This commit is contained in:
Atish Patra
2018-12-21 11:29:28 -08:00
parent a6a5bb22a8
commit 88b173b33b
8 changed files with 24 additions and 7 deletions

View File

@@ -33,6 +33,7 @@ struct sbi_platform {
u64 features;
u32 hart_count;
u32 hart_stack_size;
u64 disabled_hart_mask;
int (*cold_early_init)(void);
int (*cold_final_init)(void);
int (*warm_early_init)(u32 target_hart);
@@ -83,6 +84,13 @@ static inline const char *sbi_platform_name(struct sbi_platform *plat)
return NULL;
}
static inline bool sbi_platform_hart_disabled(struct sbi_platform *plat, u32 hartid)
{
if (plat && (plat->disabled_hart_mask & (1 << hartid)))
return 1;
else
return 0;
}
static inline u32 sbi_platform_hart_count(struct sbi_platform *plat)
{
if (plat)