include: Remove disabled_hart_mask from sbi_platform

The disabled_hard_mask in sbi_platform is only 64bits wide so we
cannot disable a HART with HARTID > 63. To tackle this, we remove
disabled_hart_mask and replace it with hart_disabled() platform
callback.

Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Atish Patra <atish.patra@wdc.com>
This commit is contained in:
Anup Patel
2020-03-02 17:49:17 +05:30
committed by Anup Patel
parent 2b945fc180
commit 44ce5b99e9
9 changed files with 13 additions and 18 deletions

View File

@@ -156,7 +156,6 @@ static int ae350_system_shutdown(u32 type)
/* Platform descriptor. */
const struct sbi_platform_operations platform_ops = {
.final_init = ae350_final_init,
.pmp_region_count = ae350_pmp_region_count,
@@ -182,13 +181,11 @@ const struct sbi_platform_operations platform_ops = {
};
const struct sbi_platform platform = {
.opensbi_version = OPENSBI_VERSION,
.platform_version = SBI_PLATFORM_VERSION(0x0, 0x01),
.name = "Andes AE350",
.features = SBI_PLATFORM_DEFAULT_FEATURES,
.hart_count = AE350_HART_COUNT,
.hart_stack_size = AE350_HART_STACK_SIZE,
.disabled_hart_mask = 0,
.platform_ops_addr = (unsigned long)&platform_ops
};

View File

@@ -201,6 +201,5 @@ const struct sbi_platform platform = {
.features = SBI_ARIANE_FEATURES,
.hart_count = ARIANE_HART_COUNT,
.hart_stack_size = 4096,
.disabled_hart_mask = 0,
.platform_ops_addr = (unsigned long)&platform_ops
};

View File

@@ -139,6 +139,5 @@ const struct sbi_platform platform = {
.features = SBI_PLATFORM_HAS_TIMER_VALUE,
.hart_count = K210_HART_COUNT,
.hart_stack_size = K210_HART_STACK_SIZE,
.disabled_hart_mask = 0,
.platform_ops_addr = (unsigned long)&platform_ops
};

View File

@@ -159,6 +159,5 @@ const struct sbi_platform platform = {
.features = SBI_PLATFORM_DEFAULT_FEATURES,
.hart_count = VIRT_HART_COUNT,
.hart_stack_size = VIRT_HART_STACK_SIZE,
.disabled_hart_mask = 0,
.platform_ops_addr = (unsigned long)&platform_ops
};

View File

@@ -194,6 +194,11 @@ static int fu540_timer_init(bool cold_boot)
return clint_warm_timer_init();
}
static bool fu540_hart_disabled(u32 hartid)
{
return (FU540_HARITD_DISABLED & (1UL << hartid)) ? TRUE : FALSE;
}
static int fu540_system_down(u32 type)
{
/* For now nothing to do. */
@@ -216,6 +221,7 @@ const struct sbi_platform_operations platform_ops = {
.timer_event_stop = clint_timer_event_stop,
.timer_event_start = clint_timer_event_start,
.timer_init = fu540_timer_init,
.hart_disabled = fu540_hart_disabled,
.system_reboot = fu540_system_down,
.system_shutdown = fu540_system_down
};
@@ -227,6 +233,5 @@ const struct sbi_platform platform = {
.features = SBI_PLATFORM_DEFAULT_FEATURES,
.hart_count = FU540_HART_COUNT,
.hart_stack_size = FU540_HART_STACK_SIZE,
.disabled_hart_mask = FU540_HARITD_DISABLED,
.platform_ops_addr = (unsigned long)&platform_ops
};

View File

@@ -110,6 +110,5 @@ const struct sbi_platform platform = {
.features = SBI_PLATFORM_DEFAULT_FEATURES,
.hart_count = SPIKE_HART_COUNT,
.hart_stack_size = SPIKE_HART_STACK_SIZE,
.disabled_hart_mask = 0,
.platform_ops_addr = (unsigned long)&platform_ops
};

View File

@@ -223,6 +223,5 @@ const struct sbi_platform platform = {
.features = SBI_PLATFORM_DEFAULT_FEATURES,
.hart_count = 1,
.hart_stack_size = 4096,
.disabled_hart_mask = 0,
.platform_ops_addr = (unsigned long)&platform_ops
};

View File

@@ -153,6 +153,5 @@ const struct sbi_platform platform = {
.features = SBI_THEAD_FEATURES,
.hart_count = C910_HART_COUNT,
.hart_stack_size = C910_HART_STACK_SIZE,
.disabled_hart_mask = 0,
.platform_ops_addr = (unsigned long)&platform_ops
};