summaryrefslogtreecommitdiff
path: root/include/sbi/sbi_platform.h
diff options
context:
space:
mode:
authorAtish Patra <atish.patra@wdc.com>2020-02-12 04:32:36 +0300
committerAnup Patel <anup@brainfault.org>2020-02-24 15:34:23 +0300
commitf64f4b92e411709227ee830bc1e9f8f87c72423e (patch)
tree72972065bc6aa528d701884a5df2b41ecbb7857d /include/sbi/sbi_platform.h
parentac5e821d50be631f26274765a59bc1b444ffd862 (diff)
downloadopensbi-f64f4b92e411709227ee830bc1e9f8f87c72423e.tar.xz
lib: Add a new platform feature to bringup secondary harts
A platform may have a specific method to bring-up secondary harts for the first time but may rely on generic WFI based approach for hart hotplug in absence of a platform specific hart hotplug method. Define a platform feature flag for such platforms. The platform needs to implement platform specific bring-up method in hart_start and not define hart_stop method in this case. They must only define SBI_PLATFORM_HAS_HART_SECONDARY_BOOT. SBI_PLATFORM_HAS_HART_HOTPLUG should only be defined when the platform intend to support both hart_start and hart_stop and do not intend to rely on generic WFI based approach. Signed-off-by: Atish Patra <atish.patra@wdc.com> Reviewed-by: Anup Patel <anup.patel@wdc.com>
Diffstat (limited to 'include/sbi/sbi_platform.h')
-rw-r--r--include/sbi/sbi_platform.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/sbi/sbi_platform.h b/include/sbi/sbi_platform.h
index ba1d95f..16ee05c 100644
--- a/include/sbi/sbi_platform.h
+++ b/include/sbi/sbi_platform.h
@@ -59,6 +59,8 @@ enum sbi_platform_features {
SBI_PLATFORM_HAS_MCOUNTEREN = (1 << 4),
/** Platform has fault delegation support */
SBI_PLATFORM_HAS_MFAULTS_DELEGATION = (1 << 5),
+ /** Platform has custom secondary hart booting support */
+ SBI_PLATFORM_HAS_HART_SECONDARY_BOOT = (1 << 6),
};
/** Default feature set for a platform */
@@ -204,6 +206,9 @@ struct sbi_platform {
/** Check whether the platform supports fault delegation */
#define sbi_platform_has_mfaults_delegation(__p) \
((__p)->features & SBI_PLATFORM_HAS_MFAULTS_DELEGATION)
+/** Check whether the platform supports custom secondary hart booting support */
+#define sbi_platform_has_hart_secondary_boot(__p) \
+ ((__p)->features & SBI_PLATFORM_HAS_HART_SECONDARY_BOOT)
/**
* Get name of the platform