forked from Mirrors/opensbi

Unlike other platforms, Ariane and OpenPiton enable all IRQs by default.
This was described in commit b44e844880
("Add support for Ariane FPGA
SoC") as "due to some issue of the design." Add this workaround behind a
flag in plic_warm_irqchip_init(), so every platform can use the same
warm init function.
Signed-off-by: Samuel Holland <samuel.holland@sifive.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
43 lines
1.1 KiB
C
43 lines
1.1 KiB
C
/*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*
|
|
* Copyright (c) 2019 Western Digital Corporation or its affiliates.
|
|
*
|
|
* Authors:
|
|
* Anup Patel <anup.patel@wdc.com>
|
|
*/
|
|
|
|
#ifndef __IRQCHIP_PLIC_H__
|
|
#define __IRQCHIP_PLIC_H__
|
|
|
|
#include <sbi/sbi_types.h>
|
|
|
|
struct plic_data {
|
|
unsigned long addr;
|
|
unsigned long size;
|
|
unsigned long num_src;
|
|
unsigned long flags;
|
|
};
|
|
|
|
/** Work around a bug on Ariane that requires enabling interrupts at boot */
|
|
#define PLIC_FLAG_ARIANE_BUG BIT(0)
|
|
|
|
/* So far, priorities on all consumers of these functions fit in 8 bits. */
|
|
void plic_priority_save(const struct plic_data *plic, u8 *priority, u32 num);
|
|
|
|
void plic_priority_restore(const struct plic_data *plic, const u8 *priority,
|
|
u32 num);
|
|
|
|
void plic_context_save(const struct plic_data *plic, int context_id,
|
|
u32 *enable, u32 *threshold, u32 num);
|
|
|
|
void plic_context_restore(const struct plic_data *plic, int context_id,
|
|
const u32 *enable, u32 threshold, u32 num);
|
|
|
|
int plic_warm_irqchip_init(const struct plic_data *plic,
|
|
int m_cntx_id, int s_cntx_id);
|
|
|
|
int plic_cold_irqchip_init(const struct plic_data *plic);
|
|
|
|
#endif
|