platform: Move platform features to hart

PMP & performance counters belong to a hart rather than a platform.
In addition to that, these features enable reading/writing from a
particular csr. Thus, they can be detected and set at runtime rather
than compile time.

Move PMP/MCOUNTEREN/SCOUNTEREN features to hart and detect them at runtime.

Signed-off-by: Atish Patra <atish.patra@wdc.com>
Tested-by: Jonathan Balkind <jbalkind@cs.princeton.edu>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
This commit is contained in:
Atish Patra
2020-05-09 16:47:28 -07:00
committed by Anup Patel
parent 6a053f6e6c
commit b2df751acf
7 changed files with 77 additions and 36 deletions

View File

@@ -28,8 +28,6 @@
#define SBI_ARIANE_FEATURES \
(SBI_PLATFORM_HAS_TIMER_VALUE | \
SBI_PLATFORM_HAS_SCOUNTEREN | \
SBI_PLATFORM_HAS_MCOUNTEREN | \
SBI_PLATFORM_HAS_MFAULTS_DELEGATION)
/*

View File

@@ -28,8 +28,6 @@
#define SBI_OPENPITON_FEATURES \
(SBI_PLATFORM_HAS_TIMER_VALUE | \
SBI_PLATFORM_HAS_SCOUNTEREN | \
SBI_PLATFORM_HAS_MCOUNTEREN | \
SBI_PLATFORM_HAS_MFAULTS_DELEGATION)
static struct platform_uart_data uart = {

View File

@@ -8,9 +8,7 @@
#define C910_HART_COUNT 16
#define SBI_THEAD_FEATURES \
(SBI_PLATFORM_HAS_SCOUNTEREN | \
SBI_PLATFORM_HAS_MCOUNTEREN | \
SBI_PLATFORM_HAS_MFAULTS_DELEGATION | \
(SBI_PLATFORM_HAS_MFAULTS_DELEGATION | \
SBI_PLATFORM_HAS_HART_SECONDARY_BOOT)
#define CSR_MCOR 0x7c2