| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Atheros AR71xx/AR724x/AR913x MISC interrupt controller |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 7 | 8 | * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org> |
|---|
| 8 | 9 | * |
|---|
| 9 | 10 | * Parts of this file are based on Atheros' 2.6.15/2.6.31 BSP |
|---|
| 10 | | - * |
|---|
| 11 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 12 | | - * under the terms of the GNU General Public License version 2 as published |
|---|
| 13 | | - * by the Free Software Foundation. |
|---|
| 14 | 11 | */ |
|---|
| 15 | 12 | |
|---|
| 16 | 13 | #include <linux/irqchip.h> |
|---|
| .. | .. |
|---|
| 22 | 19 | #define AR71XX_RESET_REG_MISC_INT_ENABLE 4 |
|---|
| 23 | 20 | |
|---|
| 24 | 21 | #define ATH79_MISC_IRQ_COUNT 32 |
|---|
| 22 | +#define ATH79_MISC_PERF_IRQ 5 |
|---|
| 23 | + |
|---|
| 24 | +static int ath79_perfcount_irq; |
|---|
| 25 | + |
|---|
| 26 | +int get_c0_perfcount_int(void) |
|---|
| 27 | +{ |
|---|
| 28 | + return ath79_perfcount_irq; |
|---|
| 29 | +} |
|---|
| 30 | +EXPORT_SYMBOL_GPL(get_c0_perfcount_int); |
|---|
| 25 | 31 | |
|---|
| 26 | 32 | static void ath79_misc_irq_handler(struct irq_desc *desc) |
|---|
| 27 | 33 | { |
|---|
| .. | .. |
|---|
| 113 | 119 | { |
|---|
| 114 | 120 | void __iomem *base = domain->host_data; |
|---|
| 115 | 121 | |
|---|
| 122 | + ath79_perfcount_irq = irq_create_mapping(domain, ATH79_MISC_PERF_IRQ); |
|---|
| 123 | + |
|---|
| 116 | 124 | /* Disable and clear all interrupts */ |
|---|
| 117 | 125 | __raw_writel(0, base + AR71XX_RESET_REG_MISC_INT_ENABLE); |
|---|
| 118 | 126 | __raw_writel(0, base + AR71XX_RESET_REG_MISC_INT_STATUS); |
|---|