int fdt_parse_plic(void *fdt, struct plic_data *plic, const char *compat);
-int fdt_parse_aclint_node(void *fdt, int nodeoffset, bool for_timer,
+int fdt_parse_aclint_node(void *fdt, int nodeoffset,
+ bool for_timer, bool allow_regname,
unsigned long *out_addr1, unsigned long *out_size1,
unsigned long *out_addr2, unsigned long *out_size2,
u32 *out_first_hartid, u32 *out_hart_count);
return 0;
}
-int fdt_parse_aclint_node(void *fdt, int nodeoffset, bool for_timer,
+int fdt_parse_aclint_node(void *fdt, int nodeoffset,
+ bool for_timer, bool allow_regname,
unsigned long *out_addr1, unsigned long *out_size1,
unsigned long *out_addr2, unsigned long *out_size2,
u32 *out_first_hartid, u32 *out_hart_count)
!out_first_hartid || !out_hart_count)
return SBI_EINVAL;
- if (for_timer && out_addr2 && out_size2 &&
+ if (for_timer && allow_regname && out_addr2 && out_size2 &&
fdt_getprop(fdt, nodeoffset, "reg-names", NULL))
rc = fdt_get_aclint_addr_size_by_name(fdt, nodeoffset,
out_addr1, out_size1,
if (!ms)
return SBI_ENOMEM;
- rc = fdt_parse_aclint_node(fdt, nodeoff, false,
+ rc = fdt_parse_aclint_node(fdt, nodeoff, false, false,
&ms->addr, &ms->size, NULL, NULL,
&ms->first_hartid, &ms->hart_count);
if (rc) {
struct timer_mtimer_node *mtn, *n;
struct aclint_mtimer_data *mt;
const struct timer_mtimer_quirks *quirks = match->data;
+ bool is_clint = quirks && quirks->is_clint;
mtn = sbi_zalloc(sizeof(*mtn));
if (!mtn)
return SBI_ENOMEM;
mt = &mtn->data;
- rc = fdt_parse_aclint_node(fdt, nodeoff, true,
+ rc = fdt_parse_aclint_node(fdt, nodeoff, true, !is_clint,
&addr[0], &size[0], &addr[1], &size[1],
&mt->first_hartid, &mt->hart_count);
if (rc) {
return rc;
}
- if (quirks && quirks->is_clint) { /* SiFive CLINT */
+ if (is_clint) { /* SiFive CLINT */
/* Set CLINT addresses */
mt->mtimecmp_addr = addr[0] + ACLINT_DEFAULT_MTIMECMP_OFFSET;
mt->mtimecmp_size = ACLINT_DEFAULT_MTIMECMP_SIZE;