summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAnup Patel <apatel@ventanamicro.com>2021-04-08 08:58:02 +0300
committerAnup Patel <anup@brainfault.org>2022-02-15 18:07:55 +0300
commit99792653de29172890ace48e848330d389311199 (patch)
tree7a75eb8466e8c00619d9b73149a1b7a522ee287c /include
parent7127aaaaf709c0a5a08b70e993a135b27eb50006 (diff)
downloadopensbi-99792653de29172890ace48e848330d389311199.tar.xz
lib: utils/irqchip: Add APLIC initialization library
We add simple APLIC initialization library which is independent of hardware description format (FDT or ACPI). This APLIC initialization library can be used by custom OpenSBI platform support to setup APLIC domains. Signed-off-by: Anup Patel <anup.patel@wdc.com> Signed-off-by: Anup Patel <apatel@ventanamicro.com> Reviewed-by: Atish Patra <atishp@rivosinc.com>
Diffstat (limited to 'include')
-rw-r--r--include/sbi_utils/irqchip/aplic.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/include/sbi_utils/irqchip/aplic.h b/include/sbi_utils/irqchip/aplic.h
new file mode 100644
index 0000000..82682e8
--- /dev/null
+++ b/include/sbi_utils/irqchip/aplic.h
@@ -0,0 +1,47 @@
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2021 Western Digital Corporation or its affiliates.
+ * Copyright (c) 2022 Ventana Micro Systems Inc.
+ *
+ * Authors:
+ * Anup Patel <anup.patel@wdc.com>
+ */
+
+#ifndef __IRQCHIP_APLIC_H__
+#define __IRQCHIP_APLIC_H__
+
+#include <sbi/sbi_types.h>
+
+#define APLIC_MAX_DELEGATE 16
+
+struct aplic_msicfg_data {
+ unsigned long lhxs;
+ unsigned long lhxw;
+ unsigned long hhxs;
+ unsigned long hhxw;
+ unsigned long base_addr;
+};
+
+struct aplic_delegate_data {
+ u32 first_irq;
+ u32 last_irq;
+ u32 child_index;
+};
+
+struct aplic_data {
+ unsigned long addr;
+ unsigned long size;
+ unsigned long num_idc;
+ unsigned long num_source;
+ bool targets_mmode;
+ bool has_msicfg_mmode;
+ struct aplic_msicfg_data msicfg_mmode;
+ bool has_msicfg_smode;
+ struct aplic_msicfg_data msicfg_smode;
+ struct aplic_delegate_data delegate[APLIC_MAX_DELEGATE];
+};
+
+int aplic_cold_irqchip_init(struct aplic_data *aplic);
+
+#endif