projects/linux·blob master · refs

48 lines · 1.2 KiB

1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * Aspeed AST2700 Interrupt Controller.
4 *
5 * Copyright (C) 2026 ASPEED Technology Inc.
6 */
7#ifndef DRIVERS_IRQCHIP_AST2700
8#define DRIVERS_IRQCHIP_AST2700
9
10#include <linux/device.h>
11#include <linux/irqdomain.h>
12
13#define AST2700_INTC_INVALID_ROUTE (~0U)
14#define ASPEED_INTC_RANGES_BASE 0U
15#define ASPEED_INTC_RANGES_COUNT 1U
16
17struct aspeed_intc_interrupt_range {
18 u32 start;
19 u32 count;
20 struct irq_fwspec upstream;
21 struct irq_domain *domain;
22};
23
24struct aspeed_intc_interrupt_ranges {
25 struct aspeed_intc_interrupt_range *ranges;
26 unsigned int nranges;
27};
28
29struct aspeed_intc0 {
30 struct device *dev;
31 void __iomem *base;
32 raw_spinlock_t intc_lock;
33 struct irq_domain *local;
34 struct device_node *parent;
35 struct aspeed_intc_interrupt_ranges ranges;
36};
37
38int aspeed_intc_populate_ranges(struct device *dev,
39 struct aspeed_intc_interrupt_ranges *ranges);
40
41int aspeed_intc0_resolve_route(const struct irq_domain *c0domain,
42 size_t nc1outs,
43 const u32 *c1outs,
44 size_t nc1ranges,
45 const struct aspeed_intc_interrupt_range *c1ranges,
46 struct aspeed_intc_interrupt_range *resolved);
47
48#endif