Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * linux/arch/sh/boards/ec3104/setup.c |
| 3 | * EC3104 companion chip support |
| 4 | * |
| 5 | * Copyright (C) 2000 Philipp Rumpf <prumpf@tux.org> |
| 6 | * |
| 7 | */ |
| 8 | /* EC3104 note: |
| 9 | * This code was written without any documentation about the EC3104 chip. While |
| 10 | * I hope I got most of the basic functionality right, the register names I use |
| 11 | * are most likely completely different from those in the chip documentation. |
| 12 | * |
| 13 | * If you have any further information about the EC3104, please tell me |
| 14 | * (prumpf@tux.org). |
| 15 | */ |
| 16 | |
| 17 | #include <linux/sched.h> |
| 18 | #include <linux/kernel.h> |
| 19 | #include <linux/param.h> |
| 20 | #include <linux/interrupt.h> |
| 21 | #include <linux/init.h> |
| 22 | #include <linux/irq.h> |
| 23 | #include <linux/types.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 24 | #include <asm/io.h> |
| 25 | #include <asm/irq.h> |
| 26 | #include <asm/machvec.h> |
| 27 | #include <asm/mach/ec3104.h> |
| 28 | |
Paul Mundt | 2c7834a | 2006-09-27 18:17:31 +0900 | [diff] [blame] | 29 | static void __init ec3104_setup(char **cmdline_p) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 30 | { |
Paul Mundt | 2c7834a | 2006-09-27 18:17:31 +0900 | [diff] [blame] | 31 | char str[8]; |
| 32 | int i; |
| 33 | |
| 34 | for (i=0; i<8; i++) |
| 35 | str[i] = ctrl_readb(EC3104_BASE + i); |
| 36 | |
| 37 | for (i = EC3104_IRQBASE; i < EC3104_IRQBASE + 32; i++) |
| 38 | irq_desc[i].handler = &ec3104_int; |
| 39 | |
| 40 | printk("initializing EC3104 \"%.8s\" at %08x, IRQ %d, IRQ base %d\n", |
| 41 | str, EC3104_BASE, EC3104_IRQ, EC3104_IRQBASE); |
| 42 | |
| 43 | /* mask all interrupts. this should have been done by the boot |
| 44 | * loader for us but we want to be sure ... */ |
| 45 | ctrl_writel(0xffffffff, EC3104_IMR); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 46 | } |
| 47 | |
| 48 | /* |
| 49 | * The Machine Vector |
| 50 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 51 | struct sh_machine_vector mv_ec3104 __initmv = { |
Paul Mundt | 2c7834a | 2006-09-27 18:17:31 +0900 | [diff] [blame] | 52 | .mv_name = "EC3104", |
| 53 | .mv_setup = ec3104_setup, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 54 | .mv_nr_irqs = 96, |
| 55 | |
| 56 | .mv_inb = ec3104_inb, |
| 57 | .mv_inw = ec3104_inw, |
| 58 | .mv_inl = ec3104_inl, |
| 59 | .mv_outb = ec3104_outb, |
| 60 | .mv_outw = ec3104_outw, |
| 61 | .mv_outl = ec3104_outl, |
| 62 | |
| 63 | .mv_irq_demux = ec3104_irq_demux, |
| 64 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 65 | ALIAS_MV(ec3104) |