forked from Mirrors/opensbi
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>
This commit is contained in:
@@ -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 =
|
||||
|
@@ -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,
|
||||
|
@@ -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)
|
||||
|
@@ -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 =
|
||||
|
@@ -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,
|
||||
|
@@ -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 =
|
||||
|
@@ -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,
|
||||
|
@@ -7,11 +7,8 @@
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
|
||||
# Essential defines required by SBI platform
|
||||
platform-cppflags-y+= -DPLAT_HART_COUNT=5
|
||||
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 =
|
||||
|
@@ -15,6 +15,9 @@
|
||||
#include <plat/serial/sifive-uart.h>
|
||||
#include <plat/sys/clint.h>
|
||||
|
||||
#define SIFIVE_U_HART_COUNT 5
|
||||
#define SIFIVE_U_HART_STACK_SIZE 8192
|
||||
|
||||
#define SIFIVE_U_SYS_CLK 1000000000
|
||||
|
||||
#define SIFIVE_U_CLINT_ADDR 0x2000000
|
||||
@@ -41,7 +44,7 @@ static int sifive_u_cold_final_init(void)
|
||||
void *fdt = sbi_scratch_thishart_arg1_ptr();
|
||||
|
||||
plic_fdt_fixup(fdt, "riscv,plic0", 0);
|
||||
for (i = 1; i < PLAT_HART_COUNT; i++)
|
||||
for (i = 1; i < SIFIVE_U_HART_COUNT; i++)
|
||||
plic_fdt_fixup(fdt, "riscv,plic0", 2 * i - 1);
|
||||
|
||||
return 0;
|
||||
@@ -91,7 +94,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)
|
||||
@@ -104,13 +107,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)
|
||||
@@ -122,8 +125,8 @@ static int sifive_u_system_down(u32 type)
|
||||
struct sbi_platform platform = {
|
||||
.name = "SiFive HiFive U540",
|
||||
.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 = ~(1 << SIFIVE_U_HARITD_ENABLED),
|
||||
.pmp_region_count = sifive_u_pmp_region_count,
|
||||
.pmp_region_info = sifive_u_pmp_region_info,
|
||||
|
Reference in New Issue
Block a user