Takashi YOSHII | 51e22e7 | 2006-09-27 17:41:31 +0900 | [diff] [blame] | 1 | /* |
| 2 | * arch/sh/boards/shmin/setup.c |
| 3 | * |
| 4 | * Copyright (C) 2006 Takashi YOSHII |
| 5 | * |
| 6 | * SHMIN Support. |
| 7 | */ |
| 8 | #include <linux/init.h> |
| 9 | #include <asm/machvec.h> |
Paul Mundt | 082c44d | 2006-10-19 16:16:18 +0900 | [diff] [blame] | 10 | #include <asm/shmin.h> |
Takashi YOSHII | 51e22e7 | 2006-09-27 17:41:31 +0900 | [diff] [blame] | 11 | #include <asm/clock.h> |
| 12 | #include <asm/irq.h> |
| 13 | #include <asm/io.h> |
| 14 | |
Takashi YOSHII | f725b5e | 2006-12-25 18:35:24 +0900 | [diff] [blame^] | 15 | #define PFC_PHCR 0xa400010eUL |
| 16 | #define INTC_ICR1 0xffd00000UL |
| 17 | #define INTC_IPRC 0xa4000016UL |
| 18 | |
| 19 | static struct ipr_data shmin_ipr_map[] = { |
| 20 | { .irq=32, .addr=INTC_IPRC, .shift= 0, .priority=0 }, |
| 21 | { .irq=33, .addr=INTC_IPRC, .shift= 4, .priority=0 }, |
| 22 | { .irq=34, .addr=INTC_IPRC, .shift= 8, .priority=8 }, |
| 23 | { .irq=35, .addr=INTC_IPRC, .shift=12, .priority=0 }, |
| 24 | }; |
Takashi YOSHII | 51e22e7 | 2006-09-27 17:41:31 +0900 | [diff] [blame] | 25 | |
Takashi YOSHII | 51e22e7 | 2006-09-27 17:41:31 +0900 | [diff] [blame] | 26 | static void __init init_shmin_irq(void) |
| 27 | { |
| 28 | ctrl_outw(0x2a00, PFC_PHCR); // IRQ0-3=IRQ |
| 29 | ctrl_outw(0x0aaa, INTC_ICR1); // IRQ0-3=IRQ-mode,Low-active. |
Takashi YOSHII | f725b5e | 2006-12-25 18:35:24 +0900 | [diff] [blame^] | 30 | make_ipr_irq(shmin_ipr_map, ARRAY_SIZE(shmin_ipr_map)); |
Takashi YOSHII | 51e22e7 | 2006-09-27 17:41:31 +0900 | [diff] [blame] | 31 | } |
| 32 | |
Takashi YOSHII | 51e22e7 | 2006-09-27 17:41:31 +0900 | [diff] [blame] | 33 | static void __iomem *shmin_ioport_map(unsigned long port, unsigned int size) |
| 34 | { |
| 35 | static int dummy; |
| 36 | |
| 37 | if ((port & ~0x1f) == SHMIN_NE_BASE) |
| 38 | return (void __iomem *)(SHMIN_IO_BASE + port); |
| 39 | |
| 40 | dummy = 0; |
| 41 | |
| 42 | return &dummy; |
| 43 | |
| 44 | } |
| 45 | |
| 46 | struct sh_machine_vector mv_shmin __initmv = { |
Paul Mundt | 2c7834a | 2006-09-27 18:17:31 +0900 | [diff] [blame] | 47 | .mv_name = "SHMIN", |
Takashi YOSHII | 51e22e7 | 2006-09-27 17:41:31 +0900 | [diff] [blame] | 48 | .mv_init_irq = init_shmin_irq, |
| 49 | .mv_ioport_map = shmin_ioport_map, |
| 50 | }; |
| 51 | ALIAS_MV(shmin) |