1 /* SPDX-License-Identifier: GPL-2.0-only */
4 #include <device/mmio.h>
5 #include <mainboard/addressmap.h>
7 /* This function is used to initialize HLS()->time/HLS()->timecmp */
10 long hart_id
= read_csr(mhartid
);
11 HLS()->time
= (uint64_t *)(QEMU_VIRT_CLINT
+ 0xbff8);
12 HLS()->timecmp
= (uint64_t *)(QEMU_VIRT_CLINT
+ 0x4000 + 8 * hart_id
);
15 void set_msip(int hartid
, int val
)
17 write32((void *)(QEMU_VIRT_CLINT
+ 4 * (uintptr_t)hartid
), !!val
);