summaryrefslogtreecommitdiff
path: root/platform/kendryte
diff options
context:
space:
mode:
authorAbner Chang <abner.chang@hpe.com>2019-06-29 11:18:04 +0300
committerAnup Patel <anup@brainfault.org>2019-06-29 15:50:00 +0300
commitfa6fd6bf86e97140cf3c991f605cf04a0b24ab50 (patch)
tree964d7521cda741aee67a1224e43773152022e5a1 /platform/kendryte
parent3048f979cab3d0f42461bd4d96a4bdecf1791f62 (diff)
downloadopensbi-fa6fd6bf86e97140cf3c991f605cf04a0b24ab50.tar.xz
include: Move callbacks in sbi_platform to separate struct
Move platform opensbi functions to sbi_platform_operations structure. Both sbi_platform and sbi_platform_operations structures are maintained by platform vendors. Signed-off-by: Abner Chang <abner.chang@hpe.com> Acked-by: Anup Patel <anup.patel@wdc.com>
Diffstat (limited to 'platform/kendryte')
-rw-r--r--platform/kendryte/k210/platform.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/platform/kendryte/k210/platform.c b/platform/kendryte/k210/platform.c
index 299b343..f332dab 100644
--- a/platform/kendryte/k210/platform.c
+++ b/platform/kendryte/k210/platform.c
@@ -93,18 +93,10 @@ static int k210_system_shutdown(u32 type)
return 0;
}
-const struct sbi_platform platform = {
-
- .name = "Kendryte K210",
- .features = SBI_PLATFORM_HAS_TIMER_VALUE,
-
- .hart_count = K210_HART_COUNT,
- .hart_stack_size = K210_HART_STACK_SIZE,
- .disabled_hart_mask = 0,
-
- .console_init = k210_console_init,
- .console_putc = k210_console_putc,
- .console_getc = k210_console_getc,
+const struct sbi_platform_operations platform_ops = {
+ .console_init = k210_console_init,
+ .console_putc = k210_console_putc,
+ .console_getc = k210_console_getc,
.irqchip_init = k210_irqchip_init,
@@ -121,3 +113,12 @@ const struct sbi_platform platform = {
.system_reboot = k210_system_reboot,
.system_shutdown = k210_system_shutdown
};
+
+const struct sbi_platform platform = {
+ .name = "Kendryte K210",
+ .features = SBI_PLATFORM_HAS_TIMER_VALUE,
+ .hart_count = K210_HART_COUNT,
+ .hart_stack_size = K210_HART_STACK_SIZE,
+ .disabled_hart_mask = 0,
+ .platform_ops_addr = (unsigned long)&platform_ops
+};