blob: 27e3d4ed4f32861a4c46eebcc4634eb835a8e45b [file] [log] [blame]
Thomas Gleixnercaab2772019-06-03 07:44:50 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Marc Zyngierd51d0af2014-06-30 16:01:30 +01002/*
3 * Copyright (C) 2002 ARM Limited, All Rights Reserved.
Marc Zyngierd51d0af2014-06-30 16:01:30 +01004 */
5
6#ifndef _IRQ_GIC_COMMON_H
7#define _IRQ_GIC_COMMON_H
8
9#include <linux/of.h>
10#include <linux/irqdomain.h>
Julien Grall502d6df2016-04-11 16:32:54 +010011#include <linux/irqchip/arm-gic-common.h>
Marc Zyngierd51d0af2014-06-30 16:01:30 +010012
Robert Richter67510cc2015-09-21 22:58:37 +020013struct gic_quirk {
14 const char *desc;
Srinivas Kandagatlaf70fdb42018-12-10 13:56:31 +000015 const char *compatible;
Ard Biesheuvel9d111d42017-10-17 17:55:55 +010016 bool (*init)(void *data);
Robert Richter67510cc2015-09-21 22:58:37 +020017 u32 iidr;
18 u32 mask;
19};
20
Liviu Dudaufb7e7de2015-01-20 16:52:59 +000021int gic_configure_irq(unsigned int irq, unsigned int type,
Marc Zyngierd51d0af2014-06-30 16:01:30 +010022 void __iomem *base, void (*sync_access)(void));
23void gic_dist_config(void __iomem *base, int gic_irqs,
24 void (*sync_access)(void));
Marc Zyngier1a60e1e2019-07-18 11:15:14 +010025void gic_cpu_config(void __iomem *base, int nr, void (*sync_access)(void));
Robert Richter67510cc2015-09-21 22:58:37 +020026void gic_enable_quirks(u32 iidr, const struct gic_quirk *quirks,
27 void *data);
Srinivas Kandagatlaf70fdb42018-12-10 13:56:31 +000028void gic_enable_of_quirks(const struct device_node *np,
29 const struct gic_quirk *quirks, void *data);
Marc Zyngierd51d0af2014-06-30 16:01:30 +010030
Marc Zyngierd51d0af2014-06-30 16:01:30 +010031#endif /* _IRQ_GIC_COMMON_H */