linux/arch/mn10300/unit-asb2305/unit-init.c

64 lines
1.5 KiB
C
Raw Normal View History

/* ASB2305 Initialisation
*
* Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
* Written by David Howells (dhowells@redhat.com)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public Licence
* as published by the Free Software Foundation; either version
* 2 of the Licence, or (at your option) any later version.
*/
#include <linux/kernel.h>
#include <linux/param.h>
#include <linux/init.h>
#include <linux/pci.h>
#include <asm/io.h>
mn10300: move setup_jiffies_interrupt() to cevt-mn10300.c Move the static inline function setup_jiffies_interrupt() from <asm/timex.h> to arch/mn10300/kernel/cevt-mn10300.c, which is its only callsite. This allows to remove the inclusion of <asm/hardirq.h> and <linux/irq.h> from <asm/timex.h> and <unit/timex.h>, fixing include hell like: include/linux/jiffies.h:260:31: warning: "CLOCK_TICK_RATE" is not defined [-Wundef] include/linux/jiffies.h:260:31: warning: "CLOCK_TICK_RATE" is not defined [-Wundef] include/linux/jiffies.h:46:42: error: division by zero in #if ... make[4]: *** [arch/mn10300/kernel/asm-offsets.s] Error 1 and (after a quick hack for the above by defining CLOCK_TICK_RATE in <linux/jiffies.h>): In file included from include/linux/notifier.h:15:0, from include/linux/memory_hotplug.h:6, from include/linux/mmzone.h:718, from include/linux/gfp.h:4, from include/linux/irq.h:20, from arch/mn10300/unit-asb2303/include/unit/timex.h:15, from arch/mn10300/include/asm/timex.h:15, from include/linux/timex.h:174, from include/linux/jiffies.h:8, from include/linux/ktime.h:25, from include/linux/timer.h:5, from include/linux/workqueue.h:8, include/linux/srcu.h:55:22: error: field 'work' has incomplete type As a consequence, we do need a few more inclusions of <asm/irq.h>, namely in arch/mn10300/unit-asb2303/smc91111.c and arch/mn10300/unit-asb2305/unit-init.c. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Cc: David Howells <dhowells@redhat.com> Cc: Koichi Yasutake <yasutake.koichi@jp.panasonic.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-07-11 21:01:56 +00:00
#include <asm/irq.h>
#include <asm/setup.h>
#include <asm/processor.h>
#include <asm/intctl-regs.h>
#include <asm/serial-regs.h>
#include <unit/serial.h>
/*
* initialise some of the unit hardware before gdbstub is set up
*/
asmlinkage void __init unit_init(void)
{
#ifndef CONFIG_GDBSTUB_ON_TTYSx
/* set the 16550 interrupt line to level 3 if not being used for GDB */
#ifdef CONFIG_EXT_SERIAL_IRQ_LEVEL
set_intr_level(XIRQ0, NUM2GxICR_LEVEL(CONFIG_EXT_SERIAL_IRQ_LEVEL));
#endif
#endif /* CONFIG_GDBSTUB_ON_TTYSx */
}
/*
* initialise the rest of the unit hardware after gdbstub is ready
*/
void __init unit_setup(void)
{
#ifdef CONFIG_PCI
unit_pci_init();
#endif
}
/*
* initialise the external interrupts used by a unit of this type
*/
void __init unit_init_IRQ(void)
{
unsigned int extnum;
for (extnum = 0; extnum < NR_XIRQS; extnum++) {
switch (GET_XIRQ_TRIGGER(extnum)) {
case XIRQ_TRIGGER_HILEVEL:
case XIRQ_TRIGGER_LOWLEVEL:
mn10300_set_lateack_irq_type(XIRQ2IRQ(extnum));
break;
default:
break;
}
}
}