mirror of
https://github.com/Fishwaldo/opensbi.git
synced 2025-07-02 19:21:51 +00:00
platform: Replace CLINT library usage with ACLINT library
The ACLINT devices are backward compatible with SiFive CLINT so we replace all CLINT library usage in various platforms with ACLINT library. As a result of this replacement, the CLINT library is not used by any part of OpenSBI hence we remove it. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Xiang W <wxjstz@126.com>
This commit is contained in:
parent
03d6bb51ba
commit
a731c7e369
9 changed files with 107 additions and 337 deletions
|
@ -12,9 +12,10 @@
|
|||
#include <sbi/sbi_hart.h>
|
||||
#include <sbi/sbi_platform.h>
|
||||
#include <sbi_utils/fdt/fdt_fixup.h>
|
||||
#include <sbi_utils/ipi/aclint_mswi.h>
|
||||
#include <sbi_utils/irqchip/plic.h>
|
||||
#include <sbi_utils/serial/uart8250.h>
|
||||
#include <sbi_utils/sys/clint.h>
|
||||
#include <sbi_utils/timer/aclint_mtimer.h>
|
||||
|
||||
#define ARIANE_UART_ADDR 0x10000000
|
||||
#define ARIANE_UART_FREQ 50000000
|
||||
|
@ -25,14 +26,26 @@
|
|||
#define ARIANE_PLIC_NUM_SOURCES 3
|
||||
#define ARIANE_HART_COUNT 1
|
||||
#define ARIANE_CLINT_ADDR 0x2000000
|
||||
#define ARIANE_ACLINT_MSWI_ADDR (ARIANE_CLINT_ADDR + \
|
||||
CLINT_MSWI_OFFSET)
|
||||
#define ARIANE_ACLINT_MTIMER_ADDR (ARIANE_CLINT_ADDR + \
|
||||
CLINT_MTIMER_OFFSET)
|
||||
|
||||
static struct plic_data plic = {
|
||||
.addr = ARIANE_PLIC_ADDR,
|
||||
.num_src = ARIANE_PLIC_NUM_SOURCES,
|
||||
};
|
||||
|
||||
static struct clint_data clint = {
|
||||
.addr = ARIANE_CLINT_ADDR,
|
||||
static struct aclint_mswi_data mswi = {
|
||||
.addr = ARIANE_ACLINT_MSWI_ADDR,
|
||||
.size = ACLINT_MSWI_SIZE,
|
||||
.first_hartid = 0,
|
||||
.hart_count = ARIANE_HART_COUNT,
|
||||
};
|
||||
|
||||
static struct aclint_mtimer_data mtimer = {
|
||||
.addr = ARIANE_ACLINT_MTIMER_ADDR,
|
||||
.size = ACLINT_MTIMER_SIZE,
|
||||
.first_hartid = 0,
|
||||
.hart_count = ARIANE_HART_COUNT,
|
||||
.has_64bit_mmio = TRUE,
|
||||
|
@ -123,12 +136,12 @@ static int ariane_ipi_init(bool cold_boot)
|
|||
int ret;
|
||||
|
||||
if (cold_boot) {
|
||||
ret = clint_cold_ipi_init(&clint);
|
||||
ret = aclint_mswi_cold_init(&mswi);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
return clint_warm_ipi_init();
|
||||
return aclint_mswi_warm_init();
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -139,12 +152,12 @@ static int ariane_timer_init(bool cold_boot)
|
|||
int ret;
|
||||
|
||||
if (cold_boot) {
|
||||
ret = clint_cold_timer_init(&clint, NULL);
|
||||
ret = aclint_mtimer_cold_init(&mtimer, NULL);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
return clint_warm_timer_init();
|
||||
return aclint_mtimer_warm_init();
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue