diff options
author | Anup Patel <anup.patel@wdc.com> | 2018-12-22 18:31:40 +0300 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2018-12-22 18:31:40 +0300 |
commit | 472d3f4e170814a2eda663a97b84728557a71757 (patch) | |
tree | a11f786cb324466ea57452fd32bd0ee71c75004a /platform/qemu | |
parent | 58ca525a7d35b2d4cd7045fd343fb6d85567f01d (diff) | |
download | opensbi-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/qemu')
-rw-r--r-- | platform/qemu/sifive_u/config.mk | 5 | ||||
-rw-r--r-- | platform/qemu/sifive_u/platform.c | 15 | ||||
-rw-r--r-- | platform/qemu/virt/config.mk | 5 | ||||
-rw-r--r-- | platform/qemu/virt/platform.c | 15 |
4 files changed, 20 insertions, 20 deletions
diff --git a/platform/qemu/sifive_u/config.mk b/platform/qemu/sifive_u/config.mk index c2668a8..630098e 100644 --- a/platform/qemu/sifive_u/config.mk +++ b/platform/qemu/sifive_u/config.mk @@ -7,11 +7,8 @@ # SPDX-License-Identifier: BSD-2-Clause # -# Essential defines required by SBI platform -platform-cppflags-y+= -DPLAT_HART_COUNT=1 -platform-cppflags-y+= -DPLAT_HART_STACK_SIZE=8192 - # 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/qemu/sifive_u/platform.c b/platform/qemu/sifive_u/platform.c index c2dcafc..f593323 100644 --- a/platform/qemu/sifive_u/platform.c +++ b/platform/qemu/sifive_u/platform.c @@ -14,6 +14,9 @@ #include <plat/serial/sifive-uart.h> #include <plat/sys/clint.h> +#define SIFIVE_U_HART_COUNT 1 +#define SIFIVE_U_HART_STACK_SIZE 8192 + #define SIFIVE_U_SYS_CLK 1000000000 #define SIFIVE_U_PERIPH_CLK (SIFIVE_U_SYS_CLK / 2) @@ -31,7 +34,7 @@ static int sifive_u_cold_final_init(void) u32 i; void *fdt = sbi_scratch_thishart_arg1_ptr(); - for (i = 0; i < PLAT_HART_COUNT; i++) + for (i = 0; i < SIFIVE_U_HART_COUNT; i++) plic_fdt_fixup(fdt, "riscv,plic0", 2 * i); return 0; @@ -71,7 +74,7 @@ static int sifive_u_cold_irqchip_init(void) { return plic_cold_irqchip_init(SIFIVE_U_PLIC_ADDR, SIFIVE_U_PLIC_NUM_SOURCES, - PLAT_HART_COUNT); + SIFIVE_U_HART_COUNT); } static int sifive_u_warm_irqchip_init(u32 target_hart) @@ -84,13 +87,13 @@ static int sifive_u_warm_irqchip_init(u32 target_hart) static int sifive_u_cold_ipi_init(void) { return clint_cold_ipi_init(SIFIVE_U_CLINT_ADDR, - PLAT_HART_COUNT); + SIFIVE_U_HART_COUNT); } static int sifive_u_cold_timer_init(void) { return clint_cold_timer_init(SIFIVE_U_CLINT_ADDR, - PLAT_HART_COUNT); + SIFIVE_U_HART_COUNT); } static int sifive_u_system_down(u32 type) @@ -102,8 +105,8 @@ static int sifive_u_system_down(u32 type) struct sbi_platform platform = { .name = "QEMU SiFive Unleashed", .features = SBI_PLATFORM_DEFAULT_FEATURES, - .hart_count = PLAT_HART_COUNT, - .hart_stack_size = PLAT_HART_STACK_SIZE, + .hart_count = SIFIVE_U_HART_COUNT, + .hart_stack_size = SIFIVE_U_HART_STACK_SIZE, .disabled_hart_mask = 0, .pmp_region_count = sifive_u_pmp_region_count, .pmp_region_info = sifive_u_pmp_region_info, diff --git a/platform/qemu/virt/config.mk b/platform/qemu/virt/config.mk index 467b057..927422c 100644 --- a/platform/qemu/virt/config.mk +++ b/platform/qemu/virt/config.mk @@ -7,11 +7,8 @@ # SPDX-License-Identifier: BSD-2-Clause # -# Essential defines required by SBI platform -platform-cppflags-y+= -DPLAT_HART_COUNT=8 -platform-cppflags-y+= -DPLAT_HART_STACK_SIZE=8192 - # 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/qemu/virt/platform.c b/platform/qemu/virt/platform.c index 7b82e4e..98357cf 100644 --- a/platform/qemu/virt/platform.c +++ b/platform/qemu/virt/platform.c @@ -14,6 +14,9 @@ #include <plat/serial/uart8250.h> #include <plat/sys/clint.h> +#define VIRT_HART_COUNT 8 +#define VIRT_HART_STACK_SIZE 8192 + #define VIRT_TEST_ADDR 0x100000 #define VIRT_CLINT_ADDR 0x2000000 @@ -31,7 +34,7 @@ static int virt_cold_final_init(void) u32 i; void *fdt = sbi_scratch_thishart_arg1_ptr(); - for (i = 0; i < PLAT_HART_COUNT; i++) + for (i = 0; i < VIRT_HART_COUNT; i++) plic_fdt_fixup(fdt, "riscv,plic0", 2 * i); return 0; @@ -72,7 +75,7 @@ static int virt_cold_irqchip_init(void) { return plic_cold_irqchip_init(VIRT_PLIC_ADDR, VIRT_PLIC_NUM_SOURCES, - PLAT_HART_COUNT); + VIRT_HART_COUNT); } static int virt_warm_irqchip_init(u32 target_hart) @@ -85,13 +88,13 @@ static int virt_warm_irqchip_init(u32 target_hart) static int virt_cold_ipi_init(void) { return clint_cold_ipi_init(VIRT_CLINT_ADDR, - PLAT_HART_COUNT); + VIRT_HART_COUNT); } static int virt_cold_timer_init(void) { return clint_cold_timer_init(VIRT_CLINT_ADDR, - PLAT_HART_COUNT); + VIRT_HART_COUNT); } static int virt_system_down(u32 type) @@ -103,8 +106,8 @@ static int virt_system_down(u32 type) struct sbi_platform platform = { .name = "QEMU Virt Machine", .features = SBI_PLATFORM_DEFAULT_FEATURES, - .hart_count = PLAT_HART_COUNT, - .hart_stack_size = PLAT_HART_STACK_SIZE, + .hart_count = VIRT_HART_COUNT, + .hart_stack_size = VIRT_HART_STACK_SIZE, .disabled_hart_mask = 0, .pmp_region_count = virt_pmp_region_count, .pmp_region_info = virt_pmp_region_info, |