Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * arch/sh/boards/dreamcast/setup.c |
| 3 | * |
| 4 | * Hardware support for the Sega Dreamcast. |
| 5 | * |
| 6 | * Copyright (c) 2001, 2002 M. R. Brown <mrbrown@linuxdc.org> |
| 7 | * Copyright (c) 2002, 2003, 2004 Paul Mundt <lethal@linux-sh.org> |
| 8 | * |
| 9 | * This file is part of the LinuxDC project (www.linuxdc.org) |
| 10 | * |
| 11 | * Released under the terms of the GNU GPL v2.0. |
| 12 | * |
| 13 | * This file originally bore the message (with enclosed-$): |
| 14 | * Id: setup_dc.c,v 1.5 2001/05/24 05:09:16 mrbrown Exp |
| 15 | * SEGA Dreamcast support |
| 16 | */ |
| 17 | |
| 18 | #include <linux/sched.h> |
| 19 | #include <linux/kernel.h> |
| 20 | #include <linux/param.h> |
| 21 | #include <linux/interrupt.h> |
| 22 | #include <linux/init.h> |
| 23 | #include <linux/irq.h> |
| 24 | #include <linux/device.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 25 | #include <asm/io.h> |
| 26 | #include <asm/irq.h> |
Paul Mundt | e4c2cfe | 2006-09-27 12:31:01 +0900 | [diff] [blame] | 27 | #include <asm/rtc.h> |
Paul Mundt | cc64f7f | 2008-07-29 08:24:50 +0900 | [diff] [blame] | 28 | #include <asm/machvec.h> |
Paul Mundt | f15cbe6 | 2008-07-29 08:09:44 +0900 | [diff] [blame] | 29 | #include <mach/sysasic.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 30 | |
Matt Fleming | e85a477 | 2008-12-14 12:02:26 +0000 | [diff] [blame] | 31 | extern struct irq_chip systemasic_int; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 32 | extern void aica_time_init(void); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 33 | extern int systemasic_irq_demux(int); |
| 34 | |
Paul Mundt | 2c7834a | 2006-09-27 18:17:31 +0900 | [diff] [blame] | 35 | static void __init dreamcast_setup(char **cmdline_p) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 36 | { |
| 37 | int i; |
| 38 | |
| 39 | /* Mask all hardware events */ |
| 40 | /* XXX */ |
| 41 | |
| 42 | /* Acknowledge any previous events */ |
| 43 | /* XXX */ |
| 44 | |
| 45 | __set_io_port_base(0xa0000000); |
| 46 | |
| 47 | /* Assign all virtual IRQs to the System ASIC int. handler */ |
| 48 | for (i = HW_EVENT_IRQ_BASE; i < HW_EVENT_IRQ_MAX; i++) |
Matt Fleming | e85a477 | 2008-12-14 12:02:26 +0000 | [diff] [blame] | 49 | set_irq_chip_and_handler(i, &systemasic_int, |
| 50 | handle_level_irq); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 51 | |
| 52 | board_time_init = aica_time_init; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 53 | } |
Paul Mundt | 2c7834a | 2006-09-27 18:17:31 +0900 | [diff] [blame] | 54 | |
Paul Mundt | 82f81f4 | 2007-05-15 15:19:34 +0900 | [diff] [blame] | 55 | static struct sh_machine_vector mv_dreamcast __initmv = { |
Paul Mundt | 2c7834a | 2006-09-27 18:17:31 +0900 | [diff] [blame] | 56 | .mv_name = "Sega Dreamcast", |
| 57 | .mv_setup = dreamcast_setup, |
| 58 | .mv_irq_demux = systemasic_irq_demux, |
Paul Mundt | 2c7834a | 2006-09-27 18:17:31 +0900 | [diff] [blame] | 59 | }; |