setup.c 1.55 KB
Newer Older
Linus Torvalds's avatar
Linus Torvalds committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
/*
 * arch/sh/boards/dreamcast/setup.c
 *
 * Hardware support for the Sega Dreamcast.
 *
 * Copyright (c) 2001, 2002 M. R. Brown <mrbrown@linuxdc.org>
 * Copyright (c) 2002, 2003, 2004 Paul Mundt <lethal@linux-sh.org>
 *
 * This file is part of the LinuxDC project (www.linuxdc.org)
 *
 * Released under the terms of the GNU GPL v2.0.
 *
 * This file originally bore the message (with enclosed-$):
 *	Id: setup_dc.c,v 1.5 2001/05/24 05:09:16 mrbrown Exp
 *	SEGA Dreamcast support
 */

#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/param.h>
#include <linux/interrupt.h>
#include <linux/init.h>
#include <linux/irq.h>
#include <linux/device.h>
#include <asm/io.h>
#include <asm/irq.h>
Paul Mundt's avatar
Paul Mundt committed
27
#include <asm/rtc.h>
28
#include <asm/machvec.h>
Paul Mundt's avatar
Paul Mundt committed
29
#include <mach/sysasic.h>
Linus Torvalds's avatar
Linus Torvalds committed
30 31 32 33 34 35

extern struct hw_interrupt_type systemasic_int;
extern void aica_time_init(void);
extern int gapspci_init(void);
extern int systemasic_irq_demux(int);

Paul Mundt's avatar
Paul Mundt committed
36
static void __init dreamcast_setup(char **cmdline_p)
Linus Torvalds's avatar
Linus Torvalds committed
37 38 39 40 41 42 43 44 45 46 47 48 49
{
	int i;

	/* Mask all hardware events */
	/* XXX */

	/* Acknowledge any previous events */
	/* XXX */

	__set_io_port_base(0xa0000000);

	/* Assign all virtual IRQs to the System ASIC int. handler */
	for (i = HW_EVENT_IRQ_BASE; i < HW_EVENT_IRQ_MAX; i++)
50
		irq_desc[i].chip = &systemasic_int;
Linus Torvalds's avatar
Linus Torvalds committed
51 52 53 54 55 56 57 58

	board_time_init = aica_time_init;

#ifdef CONFIG_PCI
	if (gapspci_init() < 0)
		printk(KERN_WARNING "GAPSPCI was not detected.\n");
#endif
}
Paul Mundt's avatar
Paul Mundt committed
59

Paul Mundt's avatar
Paul Mundt committed
60
static struct sh_machine_vector mv_dreamcast __initmv = {
Paul Mundt's avatar
Paul Mundt committed
61 62 63 64
	.mv_name		= "Sega Dreamcast",
	.mv_setup		= dreamcast_setup,
	.mv_irq_demux		= systemasic_irq_demux,
};