From 36394d2f2429c48d1db4e26ad25f9541c8c1027f Mon Sep 17 00:00:00 2001 From: Anup Patel Date: Wed, 23 Jan 2019 08:03:20 +0530 Subject: [PATCH] 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 --- include/sbi/sbi_platform.h | 12 ++++++------ lib/sbi_timer.c | 2 +- platform/kendryte/k210/platform.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/sbi/sbi_platform.h b/include/sbi/sbi_platform.h index 10c97031..e7615716 100644 --- a/include/sbi/sbi_platform.h +++ b/include/sbi/sbi_platform.h @@ -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) diff --git a/lib/sbi_timer.c b/lib/sbi_timer.c index 93b4d7ed..0cef98a8 100644 --- a/lib/sbi_timer.c +++ b/lib/sbi_timer.c @@ -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(); diff --git a/platform/kendryte/k210/platform.c b/platform/kendryte/k210/platform.c index 0b944be5..acb453df 100644 --- a/platform/kendryte/k210/platform.c +++ b/platform/kendryte/k210/platform.c @@ -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,