config SIFIVE_CLINT
bool
depends on RISCV_MMODE
+ select REGMAP
+ select SYSCON
help
The SiFive CLINT block holds memory-mapped control and status registers
associated with software and timer interrupts.
config SPL_SIFIVE_CLINT
bool
depends on SPL_RISCV_MMODE
+ select SPL_REGMAP
+ select SPL_SYSCON
help
The SiFive CLINT block holds memory-mapped control and status registers
associated with software and timer interrupts.
#include <common.h>
#include <dm.h>
+#include <regmap.h>
+#include <syscon.h>
#include <asm/global_data.h>
#include <asm/io.h>
#include <asm/smp.h>
+#include <asm/syscon.h>
#include <linux/err.h>
/* MSIP registers */
if (ret)
return ret;
- gd->arch.clint = dev_read_addr_ptr(dev);
+ if (dev_get_driver_data(dev) != 0)
+ gd->arch.clint = dev_read_addr_ptr(dev);
+ else
+ gd->arch.clint = syscon_get_first_range(RISCV_SYSCON_CLINT);
+
if (!gd->arch.clint)
return -EINVAL;
return 0;
}
+
+static const struct udevice_id riscv_aclint_swi_ids[] = {
+ { .compatible = "riscv,aclint-mswi", .data = RISCV_SYSCON_CLINT },
+ { }
+};
+
+U_BOOT_DRIVER(riscv_aclint_swi) = {
+ .name = "riscv_aclint_swi",
+ .id = UCLASS_SYSCON,
+ .of_match = riscv_aclint_swi_ids,
+ .flags = DM_FLAG_PRE_RELOC,
+};