1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 3 #include <mcall.h> 4 #include <stdint.h> 5 #include <device/mmio.h> 6 #include <soc/addressmap.h> 7 mtime_init(void)8void mtime_init(void) 9 { 10 long hart_id = read_csr(mhartid); 11 HLS()->time = (uint64_t *)(FU540_CLINT + 0xbff8); 12 HLS()->timecmp = (uint64_t *)(FU540_CLINT + 0x4000 + 8 * hart_id); 13 } 14 set_msip(int hartid,int val)15void set_msip(int hartid, int val) 16 { 17 write32((void *)(FU540_CLINT + 4 * (uintptr_t)hartid), !!val); 18 } 19