diff options
author | Takashi YOSHII <takasi-y@ops.dti.ne.jp> | 2006-12-25 04:35:24 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2007-02-12 20:54:44 -0500 |
commit | f725b5ee1e392ab1299c9317236cf736af1183ab (patch) | |
tree | abb49db7adde9ba9ccf3fbb77348d9826134aa8c | |
parent | 2c081e71baadccb4543815ef42c5290ac2961546 (diff) |
sh: shmin updates.
This fixes up shmin (and SH7706/SH7708) IPR support for some of the
recent API changes.
Signed-off-by: Takashi YOSHII <takasi-y@ops.dti.ne.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-rw-r--r-- | arch/sh/boards/shmin/setup.c | 12 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/irq/ipr.c | 19 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/sh3/setup-sh7709.c | 21 | ||||
-rw-r--r-- | arch/sh/mm/Kconfig | 2 |
4 files changed, 50 insertions, 4 deletions
diff --git a/arch/sh/boards/shmin/setup.c b/arch/sh/boards/shmin/setup.c index a31a1d1e2681..bed9ca653d3a 100644 --- a/arch/sh/boards/shmin/setup.c +++ b/arch/sh/boards/shmin/setup.c | |||
@@ -12,12 +12,22 @@ | |||
12 | #include <asm/irq.h> | 12 | #include <asm/irq.h> |
13 | #include <asm/io.h> | 13 | #include <asm/io.h> |
14 | 14 | ||
15 | #define PFC_PHCR 0xa400010e | 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 | }; | ||
16 | 25 | ||
17 | static void __init init_shmin_irq(void) | 26 | static void __init init_shmin_irq(void) |
18 | { | 27 | { |
19 | ctrl_outw(0x2a00, PFC_PHCR); // IRQ0-3=IRQ | 28 | ctrl_outw(0x2a00, PFC_PHCR); // IRQ0-3=IRQ |
20 | ctrl_outw(0x0aaa, INTC_ICR1); // IRQ0-3=IRQ-mode,Low-active. | 29 | ctrl_outw(0x0aaa, INTC_ICR1); // IRQ0-3=IRQ-mode,Low-active. |
30 | make_ipr_irq(shmin_ipr_map, ARRAY_SIZE(shmin_ipr_map)); | ||
21 | } | 31 | } |
22 | 32 | ||
23 | static void __iomem *shmin_ioport_map(unsigned long port, unsigned int size) | 33 | static void __iomem *shmin_ioport_map(unsigned long port, unsigned int size) |
diff --git a/arch/sh/kernel/cpu/irq/ipr.c b/arch/sh/kernel/cpu/irq/ipr.c index 35eb5751a3aa..210280b6fddf 100644 --- a/arch/sh/kernel/cpu/irq/ipr.c +++ b/arch/sh/kernel/cpu/irq/ipr.c | |||
@@ -43,16 +43,29 @@ static struct irq_chip ipr_irq_chip = { | |||
43 | .mask_ack = disable_ipr_irq, | 43 | .mask_ack = disable_ipr_irq, |
44 | }; | 44 | }; |
45 | 45 | ||
46 | unsigned int map_ipridx_to_addr(int idx) __attribute__ ((weak)); | ||
47 | unsigned int map_ipridx_to_addr(int idx) | ||
48 | { | ||
49 | return 0; | ||
50 | } | ||
51 | |||
46 | void make_ipr_irq(struct ipr_data *table, unsigned int nr_irqs) | 52 | void make_ipr_irq(struct ipr_data *table, unsigned int nr_irqs) |
47 | { | 53 | { |
48 | int i; | 54 | int i; |
49 | 55 | ||
50 | for (i = 0; i < nr_irqs; i++) { | 56 | for (i = 0; i < nr_irqs; i++) { |
51 | unsigned int irq = table[i].irq; | 57 | unsigned int irq = table[i].irq; |
52 | table[i].addr = map_ipridx_to_addr(table[i].ipr_idx); | 58 | |
59 | if (!irq) | ||
60 | irq = table[i].irq = i; | ||
61 | |||
53 | /* could the IPR index be mapped, if not we ignore this */ | 62 | /* could the IPR index be mapped, if not we ignore this */ |
54 | if (table[i].addr == 0) | 63 | if (!table[i].addr) { |
55 | continue; | 64 | table[i].addr = map_ipridx_to_addr(table[i].ipr_idx); |
65 | if (!table[i].addr) | ||
66 | continue; | ||
67 | } | ||
68 | |||
56 | disable_irq_nosync(irq); | 69 | disable_irq_nosync(irq); |
57 | set_irq_chip_and_handler_name(irq, &ipr_irq_chip, | 70 | set_irq_chip_and_handler_name(irq, &ipr_irq_chip, |
58 | handle_level_irq, "level"); | 71 | handle_level_irq, "level"); |
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh7709.c b/arch/sh/kernel/cpu/sh3/setup-sh7709.c index ff43ef2a1f0c..dc9b211cf87f 100644 --- a/arch/sh/kernel/cpu/sh3/setup-sh7709.c +++ b/arch/sh/kernel/cpu/sh3/setup-sh7709.c | |||
@@ -51,3 +51,24 @@ static int __init sh7709_devices_setup(void) | |||
51 | ARRAY_SIZE(sh7709_devices)); | 51 | ARRAY_SIZE(sh7709_devices)); |
52 | } | 52 | } |
53 | __initcall(sh7709_devices_setup); | 53 | __initcall(sh7709_devices_setup); |
54 | |||
55 | #define IPRx(A,N) .addr=A, .shift=0*N*-1 | ||
56 | #define IPRA(N) IPRx(0xfffffee2UL,N) | ||
57 | #define IPRB(N) IPRx(0xfffffee4UL,N) | ||
58 | #define IPRE(N) IPRx(0xa400001aUL,N) | ||
59 | |||
60 | static struct ipr_data sh7709_ipr_map[] = { | ||
61 | [16] = { IPRA(15-12), 2 }, /* TMU TUNI0 */ | ||
62 | [17] = { IPRA(11-8), 4 }, /* TMU TUNI1 */ | ||
63 | [22] = { IPRA(3-0), 2 }, /* RTC CUI */ | ||
64 | [23 ... 26] = { IPRB(7-4), 3 }, /* SCI */ | ||
65 | [27] = { IPRB(15-12), 2 }, /* WDT ITI */ | ||
66 | [48 ... 51] = { IPRE(15-12), 7 }, /* DMA */ | ||
67 | [52 ... 55] = { IPRE(11-8), 3 }, /* IRDA */ | ||
68 | [56 ... 59] = { IPRE(7-4), 3 }, /* SCIF */ | ||
69 | }; | ||
70 | |||
71 | void __init init_IRQ_ipr() | ||
72 | { | ||
73 | make_ipr_irq(sh7709_ipr_map, ARRAY_SIZE(sh7709_ipr_map)); | ||
74 | } | ||
diff --git a/arch/sh/mm/Kconfig b/arch/sh/mm/Kconfig index 29f4ee35c6dc..fddf6680ec4f 100644 --- a/arch/sh/mm/Kconfig +++ b/arch/sh/mm/Kconfig | |||
@@ -72,6 +72,7 @@ config CPU_SUBTYPE_SH7705 | |||
72 | config CPU_SUBTYPE_SH7706 | 72 | config CPU_SUBTYPE_SH7706 |
73 | bool "Support SH7706 processor" | 73 | bool "Support SH7706 processor" |
74 | select CPU_SH3 | 74 | select CPU_SH3 |
75 | select CPU_HAS_IPR_IRQ | ||
75 | help | 76 | help |
76 | Select SH7706 if you have a 133 Mhz SH-3 HD6417706 CPU. | 77 | Select SH7706 if you have a 133 Mhz SH-3 HD6417706 CPU. |
77 | 78 | ||
@@ -92,6 +93,7 @@ config CPU_SUBTYPE_SH7708 | |||
92 | config CPU_SUBTYPE_SH7709 | 93 | config CPU_SUBTYPE_SH7709 |
93 | bool "Support SH7709 processor" | 94 | bool "Support SH7709 processor" |
94 | select CPU_SH3 | 95 | select CPU_SH3 |
96 | select CPU_HAS_IPR_IRQ | ||
95 | select CPU_HAS_PINT_IRQ | 97 | select CPU_HAS_PINT_IRQ |
96 | help | 98 | help |
97 | Select SH7709 if you have a 80 Mhz SH-3 HD6417709 CPU. | 99 | Select SH7709 if you have a 80 Mhz SH-3 HD6417709 CPU. |