The cold_init() functions of ACLINT drivers should skip the HART
if sbi_hartid_to_scratch() returns NULL because we might be dealing
with a HART that is disabled in the device tree.
Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Reviewed-by: Xiang W <wxjstz@126.com>
/* Update MSWI pointer in scratch space */
for (i = 0; i < mswi->hart_count; i++) {
scratch = sbi_hartid_to_scratch(mswi->first_hartid + i);
+ /*
+ * We don't need to fail if scratch pointer is not available
+ * because we might be dealing with hartid of a HART disabled
+ * in the device tree.
+ */
if (!scratch)
- return SBI_ENOENT;
+ continue;
mswi_set_hart_data_ptr(scratch, mswi);
}
/* Update MTIMER pointer in scratch space */
for (i = 0; i < mt->hart_count; i++) {
scratch = sbi_hartid_to_scratch(mt->first_hartid + i);
+ /*
+ * We don't need to fail if scratch pointer is not available
+ * because we might be dealing with hartid of a HART disabled
+ * in the device tree.
+ */
if (!scratch)
- return SBI_ENOENT;
+ continue;
mtimer_set_hart_data_ptr(scratch, mt);
}