mirror of
				https://xff.cz/git/u-boot/
				synced 2025-10-31 10:26:10 +01:00 
			
		
		
		
	The supervisor binary interface (SBI) provides the necessary functions to implement the platform IPI functions riscv_send_ipi() and riscv_clear_ipi(). Use it to implement them. This adds support for inter-processor interrupts (IPIs) on RISC-V CPUs running in supervisor mode. Support for machine mode is already available for CPUs that include the SiFive CLINT. Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Reviewed-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Atish Patra <atish.patra@wdc.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
		
			
				
	
	
		
			26 lines
		
	
	
		
			341 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
		
			341 B
		
	
	
	
		
			C
		
	
	
	
	
	
| // SPDX-License-Identifier: GPL-2.0+
 | |
| /*
 | |
|  * Copyright (C) 2019 Fraunhofer AISEC,
 | |
|  * Lukas Auer <lukas.auer@aisec.fraunhofer.de>
 | |
|  */
 | |
| 
 | |
| #include <common.h>
 | |
| #include <asm/sbi.h>
 | |
| 
 | |
| int riscv_send_ipi(int hart)
 | |
| {
 | |
| 	ulong mask;
 | |
| 
 | |
| 	mask = 1UL << hart;
 | |
| 	sbi_send_ipi(&mask);
 | |
| 
 | |
| 	return 0;
 | |
| }
 | |
| 
 | |
| int riscv_clear_ipi(int hart)
 | |
| {
 | |
| 	sbi_clear_ipi();
 | |
| 
 | |
| 	return 0;
 | |
| }
 |