Path: blob/master/arch/mips/loongson/common/bonito-irq.c
10819 views
/*1* Copyright 2001 MontaVista Software Inc.2* Author: Jun Sun, [email protected] or [email protected]3* Copyright (C) 2000, 2001 Ralf Baechle ([email protected])4*5* Copyright (C) 2007 Lemote Inc. & Insititute of Computing Technology6* Author: Fuxin Zhang, [email protected]7*8* This program is free software; you can redistribute it and/or modify it9* under the terms of the GNU General Public License as published by the10* Free Software Foundation; either version 2 of the License, or (at your11* option) any later version.12*/13#include <linux/interrupt.h>14#include <linux/compiler.h>1516#include <loongson.h>1718static inline void bonito_irq_enable(struct irq_data *d)19{20LOONGSON_INTENSET = (1 << (d->irq - LOONGSON_IRQ_BASE));21mmiowb();22}2324static inline void bonito_irq_disable(struct irq_data *d)25{26LOONGSON_INTENCLR = (1 << (d->irq - LOONGSON_IRQ_BASE));27mmiowb();28}2930static struct irq_chip bonito_irq_type = {31.name = "bonito_irq",32.irq_mask = bonito_irq_disable,33.irq_unmask = bonito_irq_enable,34};3536static struct irqaction __maybe_unused dma_timeout_irqaction = {37.handler = no_action,38.name = "dma_timeout",39};4041void bonito_irq_init(void)42{43u32 i;4445for (i = LOONGSON_IRQ_BASE; i < LOONGSON_IRQ_BASE + 32; i++)46irq_set_chip_and_handler(i, &bonito_irq_type,47handle_level_irq);4849#ifdef CONFIG_CPU_LOONGSON2E50setup_irq(LOONGSON_IRQ_BASE + 10, &dma_timeout_irqaction);51#endif52}535455