mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2026-04-13 06:11:37 +01:00
Add a 32-bit unique ID to plic, aplic, and imsic data which can be used to differentiate multiple irqchip devices. Signed-off-by: Anup Patel <anup.patel@oss.qualcomm.com> Link: https://lore.kernel.org/r/20260213055342.3124872-7-anup.patel@oss.qualcomm.com Signed-off-by: Anup Patel <anup@brainfault.org>
57 lines
1.1 KiB
C
57 lines
1.1 KiB
C
/*
|
|
* 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>
|
|
#include <sbi/sbi_irqchip.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 {
|
|
/* Private members */
|
|
struct sbi_irqchip_device irqchip;
|
|
struct sbi_dlist node;
|
|
/* Public members */
|
|
u32 unique_id;
|
|
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];
|
|
u32 *idc_map;
|
|
};
|
|
|
|
int aplic_cold_irqchip_init(struct aplic_data *aplic);
|
|
|
|
void aplic_reinit_all(void);
|
|
|
|
#endif
|