mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2025-08-25 15:51:41 +01:00
include: Drop MMIO from SBI_PLATFORM_HAS_MMIO_TIMER_VALUE
It is not necessary that platform has MMIO-based timer value register. It can also have some custom (implementation specific) CSR for timer value. This patch renames SBI_PLATFORM_HAS_MMIO_TIMER_VALUE to SBI_PLATFORM_HAS_TIMER_VALUE to imply "platform timer value" instead of "mmio timer value". Signed-off-by: Anup Patel <anup.patel@wdc.com>
This commit is contained in:
@@ -25,8 +25,8 @@
|
||||
|
||||
/** Possible feature flags of a platform */
|
||||
enum sbi_platform_features {
|
||||
/** Platform has MMIO timer value */
|
||||
SBI_PLATFORM_HAS_MMIO_TIMER_VALUE = (1 << 0),
|
||||
/** Platform has timer value */
|
||||
SBI_PLATFORM_HAS_TIMER_VALUE = (1 << 0),
|
||||
/** Platform has HART hotplug support */
|
||||
SBI_PLATFORM_HAS_HART_HOTPLUG = (1 << 1),
|
||||
/** Platform has PMP support */
|
||||
@@ -41,7 +41,7 @@ enum sbi_platform_features {
|
||||
|
||||
/** Default feature set for a platform */
|
||||
#define SBI_PLATFORM_DEFAULT_FEATURES \
|
||||
(SBI_PLATFORM_HAS_MMIO_TIMER_VALUE | \
|
||||
(SBI_PLATFORM_HAS_TIMER_VALUE | \
|
||||
SBI_PLATFORM_HAS_PMP | \
|
||||
SBI_PLATFORM_HAS_SCOUNTEREN | \
|
||||
SBI_PLATFORM_HAS_MCOUNTEREN | \
|
||||
@@ -114,9 +114,9 @@ struct sbi_platform {
|
||||
/** Get pointer to sbi_platform for current HART */
|
||||
#define sbi_platform_thishart_ptr() \
|
||||
((struct sbi_platform *)(sbi_scratch_thishart_ptr()->platform_addr))
|
||||
/** Check whether the platform supports MMIO timer value */
|
||||
#define sbi_platform_has_mmio_timer_value(__p) \
|
||||
((__p)->features & SBI_PLATFORM_HAS_MMIO_TIMER_VALUE)
|
||||
/** Check whether the platform supports timer value */
|
||||
#define sbi_platform_has_timer_value(__p) \
|
||||
((__p)->features & SBI_PLATFORM_HAS_TIMER_VALUE)
|
||||
/** Check whether the platform supports HART hotplug */
|
||||
#define sbi_platform_has_hart_hotplug(__p) \
|
||||
((__p)->features & SBI_PLATFORM_HAS_HART_HOTPLUG)
|
||||
|
@@ -41,7 +41,7 @@ u64 sbi_timer_value(struct sbi_scratch *scratch)
|
||||
{
|
||||
struct sbi_platform *plat = sbi_platform_ptr(scratch);
|
||||
|
||||
if (sbi_platform_has_mmio_timer_value(plat))
|
||||
if (sbi_platform_has_timer_value(plat))
|
||||
return sbi_platform_timer_value(plat);
|
||||
else
|
||||
return get_ticks();
|
||||
|
@@ -101,7 +101,7 @@ static int k210_system_shutdown(u32 type)
|
||||
struct sbi_platform platform = {
|
||||
|
||||
.name = "Kendryte K210",
|
||||
.features = SBI_PLATFORM_HAS_MMIO_TIMER_VALUE,
|
||||
.features = SBI_PLATFORM_HAS_TIMER_VALUE,
|
||||
|
||||
.hart_count = K210_HART_COUNT,
|
||||
.hart_stack_size = K210_HART_STACK_SIZE,
|
||||
|
Reference in New Issue
Block a user