summaryrefslogtreecommitdiff
path: root/include/sbi_utils/irqchip/aplic.h
blob: 82682e8a75a7ab8fe9226fea066498ed0adffd31 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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