summaryrefslogtreecommitdiff
path: root/platform/kendryte
diff options
context:
space:
mode:
authorAnup Patel <anup.patel@wdc.com>2018-12-22 18:31:40 +0300
committerAnup Patel <anup@brainfault.org>2018-12-22 18:31:40 +0300
commit472d3f4e170814a2eda663a97b84728557a71757 (patch)
treea11f786cb324466ea57452fd32bd0ee71c75004a /platform/kendryte
parent58ca525a7d35b2d4cd7045fd343fb6d85567f01d (diff)
downloadopensbi-472d3f4e170814a2eda663a97b84728557a71757.tar.xz
platform: Remove PLAT_HART_COUNT and PLAT_HART_STACK_SIZE
The PLAT_HART_COUNT and PLAT_HART_STACK_SIZE are only used by platform code so no need of exposing these to everyone by adding it to platform-cppflags-y. Signed-off-by: Anup Patel <anup.patel@wdc.com>
Diffstat (limited to 'platform/kendryte')
-rw-r--r--platform/kendryte/k210/config.mk5
-rw-r--r--platform/kendryte/k210/platform.c10
-rw-r--r--platform/kendryte/k210/platform.h5
3 files changed, 10 insertions, 10 deletions
diff --git a/platform/kendryte/k210/config.mk b/platform/kendryte/k210/config.mk
index f800a41..512fc2a 100644
--- a/platform/kendryte/k210/config.mk
+++ b/platform/kendryte/k210/config.mk
@@ -7,11 +7,8 @@
# SPDX-License-Identifier: BSD-2-Clause
#
-# Essential defines required by SBI platform
-platform-cppflags-y+= -DPLAT_HART_COUNT=2
-platform-cppflags-y+= -DPLAT_HART_STACK_SIZE=4096
-
# Compiler flags
+platform-cppflags-y =
platform-cflags-y =-mabi=lp64 -march=rv64imafdc -mcmodel=medany
platform-asflags-y =-mabi=lp64 -march=rv64imafdc -mcmodel=medany
platform-ldflags-y =
diff --git a/platform/kendryte/k210/platform.c b/platform/kendryte/k210/platform.c
index 4ef1a24..226cb77 100644
--- a/platform/kendryte/k210/platform.c
+++ b/platform/kendryte/k210/platform.c
@@ -38,7 +38,7 @@ static char k210_console_getc(void)
static int k210_cold_irqchip_init(void)
{
return plic_cold_irqchip_init(PLIC_BASE_ADDR, PLIC_NUM_SOURCES,
- PLAT_HART_COUNT);
+ K210_HART_COUNT);
}
static int k210_warm_irqchip_init(u32 core_id)
@@ -50,12 +50,12 @@ static int k210_warm_irqchip_init(u32 core_id)
static int k210_cold_ipi_init(void)
{
- return clint_cold_ipi_init(CLINT_BASE_ADDR, PLAT_HART_COUNT);
+ return clint_cold_ipi_init(CLINT_BASE_ADDR, K210_HART_COUNT);
}
static int k210_cold_timer_init(void)
{
- return clint_cold_timer_init(CLINT_BASE_ADDR, PLAT_HART_COUNT);
+ return clint_cold_timer_init(CLINT_BASE_ADDR, K210_HART_COUNT);
}
static int k210_system_reboot(u32 type)
@@ -79,8 +79,8 @@ struct sbi_platform platform = {
.name = "Kendryte K210",
.features = SBI_PLATFORM_HAS_MMIO_TIMER_VALUE,
- .hart_count = PLAT_HART_COUNT,
- .hart_stack_size = PLAT_HART_STACK_SIZE,
+ .hart_count = K210_HART_COUNT,
+ .hart_stack_size = K210_HART_STACK_SIZE,
.disabled_hart_mask = 0,
.console_init = k210_console_init,
diff --git a/platform/kendryte/k210/platform.h b/platform/kendryte/k210/platform.h
index 6b520cf..ddfdf15 100644
--- a/platform/kendryte/k210/platform.h
+++ b/platform/kendryte/k210/platform.h
@@ -18,12 +18,15 @@
#include <sbi/riscv_asm.h>
+#define K210_HART_COUNT 2
+#define K210_HART_STACK_SIZE 4096
+
/* Register base address */
/* Under Coreplex */
#define CLINT_BASE_ADDR (0x02000000U)
#define PLIC_BASE_ADDR (0x0C000000U)
-#define PLIC_NUM_CORES (PLAT_HART_COUNT)
+#define PLIC_NUM_CORES (K210_HART_COUNT)
/* Under TileLink */
#define GPIOHS_BASE_ADDR (0x38001000U)