aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/cpu/sh3
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/kernel/cpu/sh3')
-rw-r--r--arch/sh/kernel/cpu/sh3/Makefile1
-rw-r--r--arch/sh/kernel/cpu/sh3/probe.c3
-rw-r--r--arch/sh/kernel/cpu/sh3/setup-sh7705.c54
-rw-r--r--arch/sh/kernel/cpu/sh3/setup-sh7709.c29
-rw-r--r--arch/sh/kernel/cpu/sh3/setup-sh7710.c60
5 files changed, 133 insertions, 14 deletions
diff --git a/arch/sh/kernel/cpu/sh3/Makefile b/arch/sh/kernel/cpu/sh3/Makefile
index 83905e4e4387..09faa056cd43 100644
--- a/arch/sh/kernel/cpu/sh3/Makefile
+++ b/arch/sh/kernel/cpu/sh3/Makefile
@@ -12,6 +12,7 @@ obj-$(CONFIG_CPU_SUBTYPE_SH7708) += setup-sh7708.o
12obj-$(CONFIG_CPU_SUBTYPE_SH7709) += setup-sh7709.o 12obj-$(CONFIG_CPU_SUBTYPE_SH7709) += setup-sh7709.o
13obj-$(CONFIG_CPU_SUBTYPE_SH7300) += setup-sh7300.o 13obj-$(CONFIG_CPU_SUBTYPE_SH7300) += setup-sh7300.o
14obj-$(CONFIG_CPU_SUBTYPE_SH7710) += setup-sh7710.o 14obj-$(CONFIG_CPU_SUBTYPE_SH7710) += setup-sh7710.o
15obj-$(CONFIG_CPU_SUBTYPE_SH7712) += setup-sh7710.o
15 16
16# Primary on-chip clocks (common) 17# Primary on-chip clocks (common)
17clock-$(CONFIG_CPU_SH3) := clock-sh3.o 18clock-$(CONFIG_CPU_SH3) := clock-sh3.o
diff --git a/arch/sh/kernel/cpu/sh3/probe.c b/arch/sh/kernel/cpu/sh3/probe.c
index 821b0ab7b528..647623b22edc 100644
--- a/arch/sh/kernel/cpu/sh3/probe.c
+++ b/arch/sh/kernel/cpu/sh3/probe.c
@@ -78,6 +78,9 @@ int __init detect_cpu_and_cache_system(void)
78#if defined(CONFIG_CPU_SUBTYPE_SH7710) 78#if defined(CONFIG_CPU_SUBTYPE_SH7710)
79 current_cpu_data.type = CPU_SH7710; 79 current_cpu_data.type = CPU_SH7710;
80#endif 80#endif
81#if defined(CONFIG_CPU_SUBTYPE_SH7712)
82 current_cpu_data.type = CPU_SH7712;
83#endif
81#if defined(CONFIG_CPU_SUBTYPE_SH7705) 84#if defined(CONFIG_CPU_SUBTYPE_SH7705)
82 current_cpu_data.type = CPU_SH7705; 85 current_cpu_data.type = CPU_SH7705;
83 86
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}
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh7709.c b/arch/sh/kernel/cpu/sh3/setup-sh7709.c
index dc9b211cf87f..c7d7c35fc834 100644
--- a/arch/sh/kernel/cpu/sh3/setup-sh7709.c
+++ b/arch/sh/kernel/cpu/sh3/setup-sh7709.c
@@ -48,24 +48,33 @@ static struct platform_device *sh7709_devices[] __initdata = {
48static int __init sh7709_devices_setup(void) 48static int __init sh7709_devices_setup(void)
49{ 49{
50 return platform_add_devices(sh7709_devices, 50 return platform_add_devices(sh7709_devices,
51 ARRAY_SIZE(sh7709_devices)); 51 ARRAY_SIZE(sh7709_devices));
52} 52}
53__initcall(sh7709_devices_setup); 53__initcall(sh7709_devices_setup);
54 54
55#define IPRx(A,N) .addr=A, .shift=0*N*-1 55#define IPRx(A,N) .addr=A, .shift=N
56#define IPRA(N) IPRx(0xfffffee2UL,N) 56#define IPRA(N) IPRx(0xfffffee2UL,N)
57#define IPRB(N) IPRx(0xfffffee4UL,N) 57#define IPRB(N) IPRx(0xfffffee4UL,N)
58#define IPRC(N) IPRx(0xa4000016UL,N)
59#define IPRD(N) IPRx(0xa4000018UL,N)
58#define IPRE(N) IPRx(0xa400001aUL,N) 60#define IPRE(N) IPRx(0xa400001aUL,N)
59 61
60static struct ipr_data sh7709_ipr_map[] = { 62static struct ipr_data sh7709_ipr_map[] = {
61 [16] = { IPRA(15-12), 2 }, /* TMU TUNI0 */ 63 [16] = { IPRA(12), 2 }, /* TMU TUNI0 */
62 [17] = { IPRA(11-8), 4 }, /* TMU TUNI1 */ 64 [17] = { IPRA(8), 4 }, /* TMU TUNI1 */
63 [22] = { IPRA(3-0), 2 }, /* RTC CUI */ 65 [18 ... 19] = { IPRA(4), 1 }, /* TMU TUNI1 */
64 [23 ... 26] = { IPRB(7-4), 3 }, /* SCI */ 66 [20 ... 22] = { IPRA(0), 2 }, /* RTC CUI */
65 [27] = { IPRB(15-12), 2 }, /* WDT ITI */ 67 [23 ... 26] = { IPRB(4), 3 }, /* SCI */
66 [48 ... 51] = { IPRE(15-12), 7 }, /* DMA */ 68 [27] = { IPRB(12), 2 }, /* WDT ITI */
67 [52 ... 55] = { IPRE(11-8), 3 }, /* IRDA */ 69 [32] = { IPRC(0), 1 }, /* IRQ 0 */
68 [56 ... 59] = { IPRE(7-4), 3 }, /* SCIF */ 70 [33] = { IPRC(4), 1 }, /* IRQ 1 */
71 [34] = { IPRC(8), 1 }, /* IRQ 2 APM */
72 [35] = { IPRC(12), 1 }, /* IRQ 3 TOUCHSCREEN */
73 [36] = { IPRD(0), 1 }, /* IRQ 4 */
74 [37] = { IPRD(4), 1 }, /* IRQ 5 */
75 [48 ... 51] = { IPRE(12), 7 }, /* DMA */
76 [52 ... 55] = { IPRE(8), 3 }, /* IRDA */
77 [56 ... 59] = { IPRE(4), 3 }, /* SCIF */
69}; 78};
70 79
71void __init init_IRQ_ipr() 80void __init init_IRQ_ipr()
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh7710.c b/arch/sh/kernel/cpu/sh3/setup-sh7710.c
index 895f99ee6a95..51760a7e7f1c 100644
--- a/arch/sh/kernel/cpu/sh3/setup-sh7710.c
+++ b/arch/sh/kernel/cpu/sh3/setup-sh7710.c
@@ -2,6 +2,7 @@
2 * SH7710 Setup 2 * SH7710 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
@@ -19,6 +20,12 @@ static struct plat_sci_port sci_platform_data[] = {
19 .type = PORT_SCIF, 20 .type = PORT_SCIF,
20 .irqs = { 52, 53, 55, 54 }, 21 .irqs = { 52, 53, 55, 54 },
21 }, { 22 }, {
23 .mapbase = 0xa4420000,
24 .flags = UPF_BOOT_AUTOCONF,
25 .type = PORT_SCIF,
26 .irqs = { 56, 57, 59, 58 },
27 }, {
28
22 .flags = 0, 29 .flags = 0,
23 } 30 }
24}; 31};
@@ -41,3 +48,56 @@ static int __init sh7710_devices_setup(void)
41 ARRAY_SIZE(sh7710_devices)); 48 ARRAY_SIZE(sh7710_devices));
42} 49}
43__initcall(sh7710_devices_setup); 50__initcall(sh7710_devices_setup);
51
52static struct ipr_data sh7710_ipr_map[] = {
53 /* IRQ, IPR-idx, shift, priority */
54 { 16, 0, 12, 2 }, /* TMU0 TUNI*/
55 { 17, 0, 8, 2 }, /* TMU1 TUNI */
56 { 18, 0, 4, 2 }, /* TMU2 TUNI */
57 { 27, 1, 12, 2 }, /* WDT ITI */
58 { 20, 0, 0, 2 }, /* RTC ATI (alarm) */
59 { 21, 0, 0, 2 }, /* RTC PRI (period) */
60 { 22, 0, 0, 2 }, /* RTC CUI (carry) */
61 { 48, 4, 12, 7 }, /* DMAC DMTE0 */
62 { 49, 4, 12, 7 }, /* DMAC DMTE1 */
63 { 50, 4, 12, 7 }, /* DMAC DMTE2 */
64 { 51, 4, 12, 7 }, /* DMAC DMTE3 */
65 { 52, 4, 8, 3 }, /* SCIF0 ERI */
66 { 53, 4, 8, 3 }, /* SCIF0 RXI */
67 { 54, 4, 8, 3 }, /* SCIF0 BRI */
68 { 55, 4, 8, 3 }, /* SCIF0 TXI */
69 { 56, 4, 4, 3 }, /* SCIF1 ERI */
70 { 57, 4, 4, 3 }, /* SCIF1 RXI */
71 { 58, 4, 4, 3 }, /* SCIF1 BRI */
72 { 59, 4, 4, 3 }, /* SCIF1 TXI */
73 { 76, 5, 8, 7 }, /* DMAC DMTE4 */
74 { 77, 5, 8, 7 }, /* DMAC DMTE5 */
75 { 80, 6, 12, 5 }, /* EDMAC EINT0 */
76 { 81, 6, 8, 5 }, /* EDMAC EINT1 */
77 { 82, 6, 4, 5 }, /* EDMAC EINT2 */
78};
79
80static unsigned long ipr_offsets[] = {
81 0xA414FEE2 /* 0: IPRA */
82, 0xA414FEE4 /* 1: IPRB */
83, 0xA4140016 /* 2: IPRC */
84, 0xA4140018 /* 3: IPRD */
85, 0xA414001A /* 4: IPRE */
86, 0xA4080000 /* 5: IPRF */
87, 0xA4080002 /* 6: IPRG */
88, 0xA4080004 /* 7: IPRH */
89, 0xA4080006 /* 8: IPRI */
90};
91
92/* given the IPR index return the address of the IPR register */
93unsigned int map_ipridx_to_addr(int idx)
94{
95 if (idx >= ARRAY_SIZE(ipr_offsets))
96 return 0;
97 return ipr_offsets[idx];
98}
99
100void __init init_IRQ_ipr()
101{
102 make_ipr_irq(sh7710_ipr_map, ARRAY_SIZE(sh7710_ipr_map));
103}