Path: blob/master/arch/mn10300/unit-asb2303/unit-init.c
10819 views
/* ASB2303 initialisation1*2* Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.3* Written by David Howells ([email protected])4*5* This program is free software; you can redistribute it and/or6* modify it under the terms of the GNU General Public Licence7* as published by the Free Software Foundation; either version8* 2 of the Licence, or (at your option) any later version.9*/1011#include <linux/kernel.h>12#include <linux/param.h>13#include <linux/init.h>14#include <linux/device.h>1516#include <asm/io.h>17#include <asm/setup.h>18#include <asm/processor.h>19#include <asm/irq.h>20#include <asm/intctl-regs.h>2122/*23* initialise some of the unit hardware before gdbstub is set up24*/25asmlinkage void __init unit_init(void)26{27/* set up the external interrupts */28SET_XIRQ_TRIGGER(0, XIRQ_TRIGGER_HILEVEL);29SET_XIRQ_TRIGGER(2, XIRQ_TRIGGER_LOWLEVEL);30SET_XIRQ_TRIGGER(3, XIRQ_TRIGGER_HILEVEL);31SET_XIRQ_TRIGGER(4, XIRQ_TRIGGER_LOWLEVEL);32SET_XIRQ_TRIGGER(5, XIRQ_TRIGGER_LOWLEVEL);3334#ifdef CONFIG_EXT_SERIAL_IRQ_LEVEL35set_intr_level(XIRQ0, NUM2GxICR_LEVEL(CONFIG_EXT_SERIAL_IRQ_LEVEL));36#endif3738#ifdef CONFIG_ETHERNET_IRQ_LEVEL39set_intr_level(XIRQ3, NUM2GxICR_LEVEL(CONFIG_ETHERNET_IRQ_LEVEL));40#endif41}4243/*44* initialise the rest of the unit hardware after gdbstub is ready45*/46void __init unit_setup(void)47{48}4950/*51* initialise the external interrupts used by a unit of this type52*/53void __init unit_init_IRQ(void)54{55unsigned int extnum;5657for (extnum = 0; extnum < NR_XIRQS; extnum++) {58switch (GET_XIRQ_TRIGGER(extnum)) {59case XIRQ_TRIGGER_HILEVEL:60case XIRQ_TRIGGER_LOWLEVEL:61mn10300_set_lateack_irq_type(XIRQ2IRQ(extnum));62break;63default:64break;65}66}67}686970