18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * Common tx4927 irq handler
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci * Author: MontaVista Software, Inc.
58c2ecf20Sopenharmony_ci *	   source@mvista.com
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci *  under the terms of the GNU General Public License as published by the
88c2ecf20Sopenharmony_ci *  Free Software Foundation; either version 2 of the License, or (at your
98c2ecf20Sopenharmony_ci *  option) any later version.
108c2ecf20Sopenharmony_ci *
118c2ecf20Sopenharmony_ci *  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
128c2ecf20Sopenharmony_ci *  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
138c2ecf20Sopenharmony_ci *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
148c2ecf20Sopenharmony_ci *  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
158c2ecf20Sopenharmony_ci *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
168c2ecf20Sopenharmony_ci *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
178c2ecf20Sopenharmony_ci *  OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
188c2ecf20Sopenharmony_ci *  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
198c2ecf20Sopenharmony_ci *  TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
208c2ecf20Sopenharmony_ci *  USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
218c2ecf20Sopenharmony_ci *
228c2ecf20Sopenharmony_ci *  You should have received a copy of the GNU General Public License along
238c2ecf20Sopenharmony_ci *  with this program; if not, write to the Free Software Foundation, Inc.,
248c2ecf20Sopenharmony_ci *  675 Mass Ave, Cambridge, MA 02139, USA.
258c2ecf20Sopenharmony_ci */
268c2ecf20Sopenharmony_ci#include <linux/init.h>
278c2ecf20Sopenharmony_ci#include <linux/interrupt.h>
288c2ecf20Sopenharmony_ci#include <linux/irq.h>
298c2ecf20Sopenharmony_ci#include <asm/irq_cpu.h>
308c2ecf20Sopenharmony_ci#include <asm/txx9/tx4927.h>
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_civoid __init tx4927_irq_init(void)
338c2ecf20Sopenharmony_ci{
348c2ecf20Sopenharmony_ci	int i;
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ci	mips_cpu_irq_init();
378c2ecf20Sopenharmony_ci	txx9_irq_init(TX4927_IRC_REG & 0xfffffffffULL);
388c2ecf20Sopenharmony_ci	irq_set_chained_handler(MIPS_CPU_IRQ_BASE + TX4927_IRC_INT,
398c2ecf20Sopenharmony_ci				handle_simple_irq);
408c2ecf20Sopenharmony_ci	/* raise priority for errors, timers, SIO */
418c2ecf20Sopenharmony_ci	txx9_irq_set_pri(TX4927_IR_ECCERR, 7);
428c2ecf20Sopenharmony_ci	txx9_irq_set_pri(TX4927_IR_WTOERR, 7);
438c2ecf20Sopenharmony_ci	txx9_irq_set_pri(TX4927_IR_PCIERR, 7);
448c2ecf20Sopenharmony_ci	txx9_irq_set_pri(TX4927_IR_PCIPME, 7);
458c2ecf20Sopenharmony_ci	for (i = 0; i < TX4927_NUM_IR_TMR; i++)
468c2ecf20Sopenharmony_ci		txx9_irq_set_pri(TX4927_IR_TMR(i), 6);
478c2ecf20Sopenharmony_ci	for (i = 0; i < TX4927_NUM_IR_SIO; i++)
488c2ecf20Sopenharmony_ci		txx9_irq_set_pri(TX4927_IR_SIO(i), 5);
498c2ecf20Sopenharmony_ci}
50