162306a36Sopenharmony_ci/*
262306a36Sopenharmony_ci * linux/arch/mips/tx4938/common/irq.c
362306a36Sopenharmony_ci *
462306a36Sopenharmony_ci * Common tx4938 irq handler
562306a36Sopenharmony_ci * Copyright (C) 2000-2001 Toshiba Corporation
662306a36Sopenharmony_ci *
762306a36Sopenharmony_ci * 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the
862306a36Sopenharmony_ci * terms of the GNU General Public License version 2. This program is
962306a36Sopenharmony_ci * licensed "as is" without any warranty of any kind, whether express
1062306a36Sopenharmony_ci * or implied.
1162306a36Sopenharmony_ci *
1262306a36Sopenharmony_ci * Support for TX4938 in 2.6 - Manish Lachwani (mlachwani@mvista.com)
1362306a36Sopenharmony_ci */
1462306a36Sopenharmony_ci#include <linux/init.h>
1562306a36Sopenharmony_ci#include <linux/interrupt.h>
1662306a36Sopenharmony_ci#include <linux/irq.h>
1762306a36Sopenharmony_ci#include <asm/irq_cpu.h>
1862306a36Sopenharmony_ci#include <asm/txx9/tx4938.h>
1962306a36Sopenharmony_ci
2062306a36Sopenharmony_civoid __init tx4938_irq_init(void)
2162306a36Sopenharmony_ci{
2262306a36Sopenharmony_ci	int i;
2362306a36Sopenharmony_ci
2462306a36Sopenharmony_ci	mips_cpu_irq_init();
2562306a36Sopenharmony_ci	txx9_irq_init(TX4938_IRC_REG & 0xfffffffffULL);
2662306a36Sopenharmony_ci	irq_set_chained_handler(MIPS_CPU_IRQ_BASE + TX4938_IRC_INT,
2762306a36Sopenharmony_ci				handle_simple_irq);
2862306a36Sopenharmony_ci	/* raise priority for errors, timers, SIO */
2962306a36Sopenharmony_ci	txx9_irq_set_pri(TX4938_IR_ECCERR, 7);
3062306a36Sopenharmony_ci	txx9_irq_set_pri(TX4938_IR_WTOERR, 7);
3162306a36Sopenharmony_ci	txx9_irq_set_pri(TX4938_IR_PCIERR, 7);
3262306a36Sopenharmony_ci	txx9_irq_set_pri(TX4938_IR_PCIPME, 7);
3362306a36Sopenharmony_ci	for (i = 0; i < TX4938_NUM_IR_TMR; i++)
3462306a36Sopenharmony_ci		txx9_irq_set_pri(TX4938_IR_TMR(i), 6);
3562306a36Sopenharmony_ci	for (i = 0; i < TX4938_NUM_IR_SIO; i++)
3662306a36Sopenharmony_ci		txx9_irq_set_pri(TX4938_IR_SIO(i), 5);
3762306a36Sopenharmony_ci}
38