aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/cpu
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/kernel/cpu')
-rw-r--r--arch/sh/kernel/cpu/irq/Makefile2
-rw-r--r--arch/sh/kernel/cpu/irq/pint.c56
-rw-r--r--arch/sh/kernel/cpu/sh3/setup-sh7705.c54
3 files changed, 105 insertions, 7 deletions
diff --git a/arch/sh/kernel/cpu/irq/Makefile b/arch/sh/kernel/cpu/irq/Makefile
index 0049d217561a..1c23308cfc25 100644
--- a/arch/sh/kernel/cpu/irq/Makefile
+++ b/arch/sh/kernel/cpu/irq/Makefile
@@ -4,6 +4,6 @@
4obj-y += imask.o 4obj-y += imask.o
5 5
6obj-$(CONFIG_CPU_HAS_IPR_IRQ) += ipr.o 6obj-$(CONFIG_CPU_HAS_IPR_IRQ) += ipr.o
7obj-$(CONFIG_CPU_HAS_PINT_IRQ) += pint.o 7obj-$(CONFIG_CPU_HAS_PINT_IRQ) += pint.o
8obj-$(CONFIG_CPU_HAS_MASKREG_IRQ) += maskreg.o 8obj-$(CONFIG_CPU_HAS_MASKREG_IRQ) += maskreg.o
9obj-$(CONFIG_CPU_HAS_INTC2_IRQ) += intc2.o 9obj-$(CONFIG_CPU_HAS_INTC2_IRQ) += intc2.o
diff --git a/arch/sh/kernel/cpu/irq/pint.c b/arch/sh/kernel/cpu/irq/pint.c
index f60007783a21..67602685df1a 100644
--- a/arch/sh/kernel/cpu/irq/pint.c
+++ b/arch/sh/kernel/cpu/irq/pint.c
@@ -18,6 +18,58 @@
18#include <asm/io.h> 18#include <asm/io.h>
19#include <asm/machvec.h> 19#include <asm/machvec.h>
20 20
21#if defined(CONFIG_CPU_SUBTYPE_SH7705)
22#define INTC_INTER 0xA4000014UL
23#define INTC_IPRD 0xA4000018UL
24#define INTC_ICR2 0xA4000012UL
25
26/* PFC */
27#define PORT_PACR 0xA4000100UL
28#define PORT_PBCR 0xA4000102UL
29#define PORT_PCCR 0xA4000104UL
30#define PORT_PDCR 0xA4000106UL
31#define PORT_PECR 0xA4000108UL
32#define PORT_PFCR 0xA400010AUL
33#define PORT_PGCR 0xA400010CUL
34#define PORT_PHCR 0xA400010EUL
35#define PORT_PJCR 0xA4000110UL
36#define PORT_PKCR 0xA4000112UL
37#define PORT_PLCR 0xA4000114UL
38#define PORT_PMCR 0xA4000118UL
39#define PORT_PNCR 0xA400011AUL
40#define PORT_PECR2 0xA4050148UL
41#define PORT_PFCR2 0xA405014AUL
42#define PORT_PNCR2 0xA405015AUL
43
44/* I/O port */
45#define PORT_PADR 0xA4000120UL
46#define PORT_PBDR 0xA4000122UL
47#define PORT_PCDR 0xA4000124UL
48#define PORT_PDDR 0xA4000126UL
49#define PORT_PEDR 0xA4000128UL
50#define PORT_PFDR 0xA400012AUL
51#define PORT_PGDR 0xA400012CUL
52#define PORT_PHDR 0xA400012EUL
53#define PORT_PJDR 0xA4000130UL
54#define PORT_PKDR 0xA4000132UL
55#define PORT_PLDR 0xA4000134UL
56#define PORT_PMDR 0xA4000138UL
57#define PORT_PNDR 0xA400013AUL
58
59#define PINT0_IRQ 40
60#define PINT8_IRQ 41
61#define PINT_IRQ_BASE 86
62
63#define PINT0_IPR_ADDR INTC_IPRD
64#define PINT0_IPR_POS 3
65#define PINT0_PRIORITY 2
66
67#define PINT8_IPR_ADDR INTC_IPRD
68#define PINT8_IPR_POS 2
69#define PINT8_PRIORITY 2
70
71#endif /* CONFIG_CPU_SUBTYPE_SH7705 */
72
21static unsigned char pint_map[256]; 73static unsigned char pint_map[256];
22static unsigned long portcr_mask; 74static unsigned long portcr_mask;
23 75
@@ -126,7 +178,7 @@ int ipr_irq_demux(int irq)
126 unsigned long creg, dreg, d, sav; 178 unsigned long creg, dreg, d, sav;
127 179
128 if (irq == PINT0_IRQ) { 180 if (irq == PINT0_IRQ) {
129#if defined(CONFIG_CPU_SUBTYPE_SH7707) 181#if defined(CONFIG_CPU_SUBTYPE_SH7705) || defined(CONFIG_CPU_SUBTYPE_SH7707)
130 creg = PORT_PACR; 182 creg = PORT_PACR;
131 dreg = PORT_PADR; 183 dreg = PORT_PADR;
132#else 184#else
@@ -144,7 +196,7 @@ int ipr_irq_demux(int irq)
144 196
145 return PINT_IRQ_BASE + pint_map[d]; 197 return PINT_IRQ_BASE + pint_map[d];
146 } else if (irq == PINT8_IRQ) { 198 } else if (irq == PINT8_IRQ) {
147#if defined(CONFIG_CPU_SUBTYPE_SH7707) 199#if defined(CONFIG_CPU_SUBTYPE_SH7705) || defined(CONFIG_CPU_SUBTYPE_SH7707)
148 creg = PORT_PBCR; 200 creg = PORT_PBCR;
149 dreg = PORT_PBDR; 201 dreg = PORT_PBDR;
150#else 202#else
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh7705.c b/arch/sh/kernel/cpu/sh3/setup-sh7705.c
index a8e41c5241fa..1983fb7ad6ea 100644
--- a/arch/sh/kernel/cpu/sh3/setup-sh7705.c
+++ b/arch/sh/kernel/cpu/sh3/setup-sh7705.c
@@ -2,6 +2,7 @@
2 * SH7705 Setup 2 * SH7705 Setup
3 * 3 *
4 * Copyright (C) 2006 Paul Mundt 4 * Copyright (C) 2006 Paul Mundt
5 * Copyright (C) 2007 Nobuhiro Iwamatsu
5 * 6 *
6 * This file is subject to the terms and conditions of the GNU General Public 7 * 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 * License. See the file "COPYING" in the main directory of this archive
@@ -14,15 +15,15 @@
14 15
15static struct plat_sci_port sci_platform_data[] = { 16static struct plat_sci_port sci_platform_data[] = {
16 { 17 {
17 .mapbase = 0xa4400000, 18 .mapbase = 0xa4410000,
18 .flags = UPF_BOOT_AUTOCONF, 19 .flags = UPF_BOOT_AUTOCONF,
19 .type = PORT_SCIF, 20 .type = PORT_SCIF,
20 .irqs = { 52, 53, 55, 54 }, 21 .irqs = { 56, 57, 59 },
21 }, { 22 }, {
22 .mapbase = 0xa4410000, 23 .mapbase = 0xa4400000,
23 .flags = UPF_BOOT_AUTOCONF, 24 .flags = UPF_BOOT_AUTOCONF,
24 .type = PORT_SCIF, 25 .type = PORT_SCIF,
25 .irqs = { 56, 57, 59, 58 }, 26 .irqs = { 52, 53, 55 },
26 }, { 27 }, {
27 .flags = 0, 28 .flags = 0,
28 } 29 }
@@ -46,3 +47,48 @@ static int __init sh7705_devices_setup(void)
46 ARRAY_SIZE(sh7705_devices)); 47 ARRAY_SIZE(sh7705_devices));
47} 48}
48__initcall(sh7705_devices_setup); 49__initcall(sh7705_devices_setup);
50
51static struct ipr_data sh7705_ipr_map[] = {
52 /* IRQ, IPR-idx, shift, priority */
53 { 16, 0, 12, 2 }, /* TMU0 TUNI*/
54 { 17, 0, 8, 2 }, /* TMU1 TUNI */
55 { 18, 0, 4, 2 }, /* TMU2 TUNI */
56 { 27, 1, 12, 2 }, /* WDT ITI */
57 { 20, 0, 0, 2 }, /* RTC ATI (alarm) */
58 { 21, 0, 0, 2 }, /* RTC PRI (period) */
59 { 22, 0, 0, 2 }, /* RTC CUI (carry) */
60 { 48, 4, 12, 7 }, /* DMAC DMTE0 */
61 { 49, 4, 12, 7 }, /* DMAC DMTE1 */
62 { 50, 4, 12, 7 }, /* DMAC DMTE2 */
63 { 51, 4, 12, 7 }, /* DMAC DMTE3 */
64 { 52, 4, 8, 3 }, /* SCIF0 ERI */
65 { 53, 4, 8, 3 }, /* SCIF0 RXI */
66 { 55, 4, 8, 3 }, /* SCIF0 TXI */
67 { 56, 4, 4, 3 }, /* SCIF1 ERI */
68 { 57, 4, 4, 3 }, /* SCIF1 RXI */
69 { 59, 4, 4, 3 }, /* SCIF1 TXI */
70};
71
72static unsigned long ipr_offsets[] = {
73 0xFFFFFEE2 /* 0: IPRA */
74, 0xFFFFFEE4 /* 1: IPRB */
75, 0xA4000016 /* 2: IPRC */
76, 0xA4000018 /* 3: IPRD */
77, 0xA400001A /* 4: IPRE */
78, 0xA4080000 /* 5: IPRF */
79, 0xA4080002 /* 6: IPRG */
80, 0xA4080004 /* 7: IPRH */
81};
82
83/* given the IPR index return the address of the IPR register */
84unsigned int map_ipridx_to_addr(int idx)
85{
86 if (idx >= ARRAY_SIZE(ipr_offsets))
87 return 0;
88 return ipr_offsets[idx];
89}
90
91void __init init_IRQ_ipr()
92{
93 make_ipr_irq(sh7705_ipr_map, ARRAY_SIZE(sh7705_ipr_map));
94}