Jamie Lenehan | a09749d | 2006-09-27 15:05:39 +0900 | [diff] [blame] | 1 | /* |
Jamie Lenehan | ea0f8fe | 2006-12-06 12:05:02 +0900 | [diff] [blame] | 2 | * arch/sh/boards/titan/setup.c - Setup for Titan |
| 3 | * |
| 4 | * Copyright (C) 2006 Jamie Lenehan |
| 5 | * |
| 6 | * This file is subject to the terms and conditions of the GNU General Public |
| 7 | * License. See the file "COPYING" in the main directory of this archive |
| 8 | * for more details. |
Jamie Lenehan | a09749d | 2006-09-27 15:05:39 +0900 | [diff] [blame] | 9 | */ |
Jamie Lenehan | a09749d | 2006-09-27 15:05:39 +0900 | [diff] [blame] | 10 | #include <linux/init.h> |
Jamie Lenehan | ea0f8fe | 2006-12-06 12:05:02 +0900 | [diff] [blame] | 11 | #include <linux/irq.h> |
Jamie Lenehan | a09749d | 2006-09-27 15:05:39 +0900 | [diff] [blame] | 12 | #include <asm/titan.h> |
| 13 | #include <asm/io.h> |
| 14 | |
Magnus Damm | 68abdbb | 2007-06-15 18:56:19 +0900 | [diff] [blame] | 15 | static struct ipr_data ipr_irq_table[] = { |
Jamie Lenehan | ea0f8fe | 2006-12-06 12:05:02 +0900 | [diff] [blame] | 16 | /* IRQ, IPR idx, shift, prio */ |
| 17 | { TITAN_IRQ_WAN, 3, 12, 8 }, /* eth0 (WAN) */ |
| 18 | { TITAN_IRQ_LAN, 3, 8, 8 }, /* eth1 (LAN) */ |
| 19 | { TITAN_IRQ_MPCIA, 3, 4, 8 }, /* mPCI A (top) */ |
| 20 | { TITAN_IRQ_USB, 3, 0, 8 }, /* mPCI B (bottom), USB */ |
Jamie Lenehan | bd71ab8 | 2006-10-31 12:35:02 +0900 | [diff] [blame] | 21 | }; |
| 22 | |
Magnus Damm | 68abdbb | 2007-06-15 18:56:19 +0900 | [diff] [blame] | 23 | static unsigned long ipr_offsets[] = { /* stolen from setup-sh7750.c */ |
| 24 | 0xffd00004UL, /* 0: IPRA */ |
| 25 | 0xffd00008UL, /* 1: IPRB */ |
| 26 | 0xffd0000cUL, /* 2: IPRC */ |
| 27 | 0xffd00010UL, /* 3: IPRD */ |
| 28 | }; |
| 29 | |
| 30 | static struct ipr_desc ipr_irq_desc = { |
| 31 | .ipr_offsets = ipr_offsets, |
| 32 | .nr_offsets = ARRAY_SIZE(ipr_offsets), |
| 33 | |
| 34 | .ipr_data = ipr_irq_table, |
| 35 | .nr_irqs = ARRAY_SIZE(ipr_irq_table), |
| 36 | |
| 37 | .chip = { |
| 38 | .name = "IPR-titan", |
| 39 | }, |
| 40 | }; |
Jamie Lenehan | a09749d | 2006-09-27 15:05:39 +0900 | [diff] [blame] | 41 | static void __init init_titan_irq(void) |
| 42 | { |
| 43 | /* enable individual interrupt mode for externals */ |
Jamie Lenehan | ea0f8fe | 2006-12-06 12:05:02 +0900 | [diff] [blame] | 44 | ipr_irq_enable_irlm(); |
| 45 | /* register ipr irqs */ |
Magnus Damm | 68abdbb | 2007-06-15 18:56:19 +0900 | [diff] [blame] | 46 | register_ipr_controller(&ipr_irq_desc); |
Jamie Lenehan | a09749d | 2006-09-27 15:05:39 +0900 | [diff] [blame] | 47 | } |
| 48 | |
Paul Mundt | 82f81f4 | 2007-05-15 15:19:34 +0900 | [diff] [blame] | 49 | static struct sh_machine_vector mv_titan __initmv = { |
Paul Mundt | 2c7834a | 2006-09-27 18:17:31 +0900 | [diff] [blame] | 50 | .mv_name = "Titan", |
Jamie Lenehan | a09749d | 2006-09-27 15:05:39 +0900 | [diff] [blame] | 51 | |
| 52 | .mv_inb = titan_inb, |
| 53 | .mv_inw = titan_inw, |
| 54 | .mv_inl = titan_inl, |
| 55 | .mv_outb = titan_outb, |
| 56 | .mv_outw = titan_outw, |
| 57 | .mv_outl = titan_outl, |
| 58 | |
| 59 | .mv_inb_p = titan_inb_p, |
| 60 | .mv_inw_p = titan_inw, |
| 61 | .mv_inl_p = titan_inl, |
| 62 | .mv_outb_p = titan_outb_p, |
| 63 | .mv_outw_p = titan_outw, |
| 64 | .mv_outl_p = titan_outl, |
| 65 | |
| 66 | .mv_insl = titan_insl, |
| 67 | .mv_outsl = titan_outsl, |
| 68 | |
Jamie Lenehan | a09749d | 2006-09-27 15:05:39 +0900 | [diff] [blame] | 69 | .mv_ioport_map = titan_ioport_map, |
| 70 | |
| 71 | .mv_init_irq = init_titan_irq, |
Jamie Lenehan | a09749d | 2006-09-27 15:05:39 +0900 | [diff] [blame] | 72 | }; |