Refine platform features control

Allow a platform to report its supported features in more details.
The new features defined are:
* SBI_PLATFORM_HAS_PMP
* SBI_PLATFORM_HAS_SCOUNTEREN
* SBI_PLATFORM_HAS_MCOUNTEREN

In addition, define the macro SBI_PLATFORM_DEFAULT_FEATURES as the set
of features that are generally expected to be supported by a Linux
capable platform.

Operations touching the features controlled with these falgs are not
executed if the platform does not set the corresponding feature flags.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
This commit is contained in:
Damien Le Moal
2018-12-21 09:13:37 +09:00
parent f003787455
commit aa68f0252f
7 changed files with 45 additions and 26 deletions

View File

@@ -88,7 +88,7 @@ static int sifive_u_system_down(u32 type)
struct sbi_platform platform = {
.name = STRINGIFY(PLAT_NAME),
.features = SBI_PLATFORM_HAS_MMIO_TIMER_VALUE,
.features = SBI_PLATFORM_DEFAULT_FEATURES,
.hart_count = PLAT_HART_COUNT,
.hart_stack_size = PLAT_HART_STACK_SIZE,
.pmp_region_count = sifive_u_pmp_region_count,

View File

@@ -86,7 +86,7 @@ static int virt_system_down(u32 type)
struct sbi_platform platform = {
.name = STRINGIFY(PLAT_NAME),
.features = SBI_PLATFORM_HAS_MMIO_TIMER_VALUE,
.features = SBI_PLATFORM_DEFAULT_FEATURES,
.hart_count = PLAT_HART_COUNT,
.hart_stack_size = PLAT_HART_STACK_SIZE,
.pmp_region_count = virt_pmp_region_count,

View File

@@ -105,7 +105,7 @@ static int sifive_u_system_down(u32 type)
struct sbi_platform platform = {
.name = STRINGIFY(PLAT_NAME),
.features = SBI_PLATFORM_HAS_MMIO_TIMER_VALUE,
.features = SBI_PLATFORM_DEFAULT_FEATURES;
.hart_count = PLAT_HART_COUNT,
.hart_stack_size = PLAT_HART_STACK_SIZE,
.pmp_region_count = sifive_u_pmp_region_count,