-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RISC-V: KVM: Add APLIC related defines
We add APLIC related defines in a separate header so that different parts of KVM code can share it. Once AIA drivers are merged will have a common APLIC header shared by both KVM and IRQCHIP driver. Signed-off-by: Anup Patel <apatel@ventanamicro.com> Reviewed-by: Atish Patra <atishp@rivosinc.com> Signed-off-by: Anup Patel <anup@brainfault.org>
- Loading branch information
Anup Patel
authored and
Anup Patel
committed
Jun 18, 2023
1 parent
f7fec5e
commit cf55201
Showing
1 changed file
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* SPDX-License-Identifier: GPL-2.0-only */ | ||
/* | ||
* Copyright (C) 2021 Western Digital Corporation or its affiliates. | ||
* Copyright (C) 2022 Ventana Micro Systems Inc. | ||
*/ | ||
#ifndef __KVM_RISCV_AIA_IMSIC_H | ||
#define __KVM_RISCV_AIA_IMSIC_H | ||
|
||
#include <linux/bitops.h> | ||
|
||
#define APLIC_MAX_IDC BIT(14) | ||
#define APLIC_MAX_SOURCE 1024 | ||
|
||
#define APLIC_DOMAINCFG 0x0000 | ||
#define APLIC_DOMAINCFG_RDONLY 0x80000000 | ||
#define APLIC_DOMAINCFG_IE BIT(8) | ||
#define APLIC_DOMAINCFG_DM BIT(2) | ||
#define APLIC_DOMAINCFG_BE BIT(0) | ||
|
||
#define APLIC_SOURCECFG_BASE 0x0004 | ||
#define APLIC_SOURCECFG_D BIT(10) | ||
#define APLIC_SOURCECFG_CHILDIDX_MASK 0x000003ff | ||
#define APLIC_SOURCECFG_SM_MASK 0x00000007 | ||
#define APLIC_SOURCECFG_SM_INACTIVE 0x0 | ||
#define APLIC_SOURCECFG_SM_DETACH 0x1 | ||
#define APLIC_SOURCECFG_SM_EDGE_RISE 0x4 | ||
#define APLIC_SOURCECFG_SM_EDGE_FALL 0x5 | ||
#define APLIC_SOURCECFG_SM_LEVEL_HIGH 0x6 | ||
#define APLIC_SOURCECFG_SM_LEVEL_LOW 0x7 | ||
|
||
#define APLIC_IRQBITS_PER_REG 32 | ||
|
||
#define APLIC_SETIP_BASE 0x1c00 | ||
#define APLIC_SETIPNUM 0x1cdc | ||
|
||
#define APLIC_CLRIP_BASE 0x1d00 | ||
#define APLIC_CLRIPNUM 0x1ddc | ||
|
||
#define APLIC_SETIE_BASE 0x1e00 | ||
#define APLIC_SETIENUM 0x1edc | ||
|
||
#define APLIC_CLRIE_BASE 0x1f00 | ||
#define APLIC_CLRIENUM 0x1fdc | ||
|
||
#define APLIC_SETIPNUM_LE 0x2000 | ||
#define APLIC_SETIPNUM_BE 0x2004 | ||
|
||
#define APLIC_GENMSI 0x3000 | ||
|
||
#define APLIC_TARGET_BASE 0x3004 | ||
#define APLIC_TARGET_HART_IDX_SHIFT 18 | ||
#define APLIC_TARGET_HART_IDX_MASK 0x3fff | ||
#define APLIC_TARGET_GUEST_IDX_SHIFT 12 | ||
#define APLIC_TARGET_GUEST_IDX_MASK 0x3f | ||
#define APLIC_TARGET_IPRIO_MASK 0xff | ||
#define APLIC_TARGET_EIID_MASK 0x7ff | ||
|
||
#endif |