diff options
Diffstat (limited to 'arch/sh/kernel/cpu/sh3')
-rw-r--r-- | arch/sh/kernel/cpu/sh3/entry.S | 19 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/sh3/setup-sh7705.c | 40 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/sh3/setup-sh7709.c | 112 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/sh3/setup-sh7710.c | 42 |
4 files changed, 151 insertions, 62 deletions
diff --git a/arch/sh/kernel/cpu/sh3/entry.S b/arch/sh/kernel/cpu/sh3/entry.S index b0b59d4a33ca..d8e122971c3e 100644 --- a/arch/sh/kernel/cpu/sh3/entry.S +++ b/arch/sh/kernel/cpu/sh3/entry.S | |||
@@ -340,8 +340,27 @@ ENTRY(vbr_base) | |||
340 | general_exception: | 340 | general_exception: |
341 | mov.l 1f, k2 | 341 | mov.l 1f, k2 |
342 | mov.l 2f, k3 | 342 | mov.l 2f, k3 |
343 | #ifdef CONFIG_CPU_SUBTYPE_SHX3 | ||
344 | mov.l @k2, k2 | ||
345 | |||
346 | ! Is EXPEVT larger than 0x800? | ||
347 | mov #0x8, k0 | ||
348 | shll8 k0 | ||
349 | cmp/hs k0, k2 | ||
350 | bf 0f | ||
351 | |||
352 | ! then add 0x580 (k2 is 0xd80 or 0xda0) | ||
353 | mov #0x58, k0 | ||
354 | shll2 k0 | ||
355 | shll2 k0 | ||
356 | add k0, k2 | ||
357 | 0: | ||
358 | bra handle_exception | ||
359 | nop | ||
360 | #else | ||
343 | bra handle_exception | 361 | bra handle_exception |
344 | mov.l @k2, k2 | 362 | mov.l @k2, k2 |
363 | #endif | ||
345 | .align 2 | 364 | .align 2 |
346 | 1: .long EXPEVT | 365 | 1: .long EXPEVT |
347 | 2: .long ret_from_exception | 366 | 2: .long ret_from_exception |
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh7705.c b/arch/sh/kernel/cpu/sh3/setup-sh7705.c index 1983fb7ad6ea..a55b8ce2c54c 100644 --- a/arch/sh/kernel/cpu/sh3/setup-sh7705.c +++ b/arch/sh/kernel/cpu/sh3/setup-sh7705.c | |||
@@ -48,7 +48,7 @@ static int __init sh7705_devices_setup(void) | |||
48 | } | 48 | } |
49 | __initcall(sh7705_devices_setup); | 49 | __initcall(sh7705_devices_setup); |
50 | 50 | ||
51 | static struct ipr_data sh7705_ipr_map[] = { | 51 | static struct ipr_data ipr_irq_table[] = { |
52 | /* IRQ, IPR-idx, shift, priority */ | 52 | /* IRQ, IPR-idx, shift, priority */ |
53 | { 16, 0, 12, 2 }, /* TMU0 TUNI*/ | 53 | { 16, 0, 12, 2 }, /* TMU0 TUNI*/ |
54 | { 17, 0, 8, 2 }, /* TMU1 TUNI */ | 54 | { 17, 0, 8, 2 }, /* TMU1 TUNI */ |
@@ -70,25 +70,29 @@ static struct ipr_data sh7705_ipr_map[] = { | |||
70 | }; | 70 | }; |
71 | 71 | ||
72 | static unsigned long ipr_offsets[] = { | 72 | static unsigned long ipr_offsets[] = { |
73 | 0xFFFFFEE2 /* 0: IPRA */ | 73 | 0xFFFFFEE2, /* 0: IPRA */ |
74 | , 0xFFFFFEE4 /* 1: IPRB */ | 74 | 0xFFFFFEE4, /* 1: IPRB */ |
75 | , 0xA4000016 /* 2: IPRC */ | 75 | 0xA4000016, /* 2: IPRC */ |
76 | , 0xA4000018 /* 3: IPRD */ | 76 | 0xA4000018, /* 3: IPRD */ |
77 | , 0xA400001A /* 4: IPRE */ | 77 | 0xA400001A, /* 4: IPRE */ |
78 | , 0xA4080000 /* 5: IPRF */ | 78 | 0xA4080000, /* 5: IPRF */ |
79 | , 0xA4080002 /* 6: IPRG */ | 79 | 0xA4080002, /* 6: IPRG */ |
80 | , 0xA4080004 /* 7: IPRH */ | 80 | 0xA4080004, /* 7: IPRH */ |
81 | }; | 81 | }; |
82 | 82 | ||
83 | /* given the IPR index return the address of the IPR register */ | 83 | static struct ipr_desc ipr_irq_desc = { |
84 | unsigned int map_ipridx_to_addr(int idx) | 84 | .ipr_offsets = ipr_offsets, |
85 | { | 85 | .nr_offsets = ARRAY_SIZE(ipr_offsets), |
86 | if (idx >= ARRAY_SIZE(ipr_offsets)) | 86 | |
87 | return 0; | 87 | .ipr_data = ipr_irq_table, |
88 | return ipr_offsets[idx]; | 88 | .nr_irqs = ARRAY_SIZE(ipr_irq_table), |
89 | } | 89 | |
90 | .chip = { | ||
91 | .name = "IPR-sh7705", | ||
92 | }, | ||
93 | }; | ||
90 | 94 | ||
91 | void __init init_IRQ_ipr() | 95 | void __init init_IRQ_ipr(void) |
92 | { | 96 | { |
93 | make_ipr_irq(sh7705_ipr_map, ARRAY_SIZE(sh7705_ipr_map)); | 97 | register_ipr_controller(&ipr_irq_desc); |
94 | } | 98 | } |
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh7709.c b/arch/sh/kernel/cpu/sh3/setup-sh7709.c index c7d7c35fc834..d79ec0c0522f 100644 --- a/arch/sh/kernel/cpu/sh3/setup-sh7709.c +++ b/arch/sh/kernel/cpu/sh3/setup-sh7709.c | |||
@@ -12,6 +12,26 @@ | |||
12 | #include <linux/serial.h> | 12 | #include <linux/serial.h> |
13 | #include <asm/sci.h> | 13 | #include <asm/sci.h> |
14 | 14 | ||
15 | static struct resource rtc_resources[] = { | ||
16 | [0] = { | ||
17 | .start = 0xfffffec0, | ||
18 | .end = 0xfffffec0 + 0x1e, | ||
19 | .flags = IORESOURCE_IO, | ||
20 | }, | ||
21 | [1] = { | ||
22 | .start = 20, | ||
23 | .flags = IORESOURCE_IRQ, | ||
24 | }, | ||
25 | [2] = { | ||
26 | .start = 21, | ||
27 | .flags = IORESOURCE_IRQ, | ||
28 | }, | ||
29 | [3] = { | ||
30 | .start = 22, | ||
31 | .flags = IORESOURCE_IRQ, | ||
32 | }, | ||
33 | }; | ||
34 | |||
15 | static struct plat_sci_port sci_platform_data[] = { | 35 | static struct plat_sci_port sci_platform_data[] = { |
16 | { | 36 | { |
17 | .mapbase = 0xfffffe80, | 37 | .mapbase = 0xfffffe80, |
@@ -41,8 +61,16 @@ static struct platform_device sci_device = { | |||
41 | }, | 61 | }, |
42 | }; | 62 | }; |
43 | 63 | ||
64 | static struct platform_device rtc_device = { | ||
65 | .name = "sh-rtc", | ||
66 | .id = -1, | ||
67 | .num_resources = ARRAY_SIZE(rtc_resources), | ||
68 | .resource = rtc_resources, | ||
69 | }; | ||
70 | |||
44 | static struct platform_device *sh7709_devices[] __initdata = { | 71 | static struct platform_device *sh7709_devices[] __initdata = { |
45 | &sci_device, | 72 | &sci_device, |
73 | &rtc_device, | ||
46 | }; | 74 | }; |
47 | 75 | ||
48 | static int __init sh7709_devices_setup(void) | 76 | static int __init sh7709_devices_setup(void) |
@@ -52,32 +80,66 @@ static int __init sh7709_devices_setup(void) | |||
52 | } | 80 | } |
53 | __initcall(sh7709_devices_setup); | 81 | __initcall(sh7709_devices_setup); |
54 | 82 | ||
55 | #define IPRx(A,N) .addr=A, .shift=N | 83 | static struct ipr_data ipr_irq_table[] = { |
56 | #define IPRA(N) IPRx(0xfffffee2UL,N) | 84 | { 16, 0, 12, 2 }, /* TMU TUNI0 */ |
57 | #define IPRB(N) IPRx(0xfffffee4UL,N) | 85 | { 17, 0, 8, 4 }, /* TMU TUNI1 */ |
58 | #define IPRC(N) IPRx(0xa4000016UL,N) | 86 | { 18, 0, 4, 1 }, /* TMU TUNI1 */ |
59 | #define IPRD(N) IPRx(0xa4000018UL,N) | 87 | { 19, 0, 4, 1 }, /* TMU TUNI1 */ |
60 | #define IPRE(N) IPRx(0xa400001aUL,N) | 88 | { 20, 0, 0, 2 }, /* RTC CUI */ |
61 | 89 | { 21, 0, 0, 2 }, /* RTC CUI */ | |
62 | static struct ipr_data sh7709_ipr_map[] = { | 90 | { 22, 0, 0, 2 }, /* RTC CUI */ |
63 | [16] = { IPRA(12), 2 }, /* TMU TUNI0 */ | 91 | |
64 | [17] = { IPRA(8), 4 }, /* TMU TUNI1 */ | 92 | { 23, 1, 4, 3 }, /* SCI */ |
65 | [18 ... 19] = { IPRA(4), 1 }, /* TMU TUNI1 */ | 93 | { 24, 1, 4, 3 }, /* SCI */ |
66 | [20 ... 22] = { IPRA(0), 2 }, /* RTC CUI */ | 94 | { 25, 1, 4, 3 }, /* SCI */ |
67 | [23 ... 26] = { IPRB(4), 3 }, /* SCI */ | 95 | { 26, 1, 4, 3 }, /* SCI */ |
68 | [27] = { IPRB(12), 2 }, /* WDT ITI */ | 96 | { 27, 1, 12, 3 }, /* WDT ITI */ |
69 | [32] = { IPRC(0), 1 }, /* IRQ 0 */ | 97 | |
70 | [33] = { IPRC(4), 1 }, /* IRQ 1 */ | 98 | { 32, 2, 0, 1 }, /* IRQ 0 */ |
71 | [34] = { IPRC(8), 1 }, /* IRQ 2 APM */ | 99 | { 33, 2, 4, 1 }, /* IRQ 1 */ |
72 | [35] = { IPRC(12), 1 }, /* IRQ 3 TOUCHSCREEN */ | 100 | { 34, 2, 8, 1 }, /* IRQ 2 APM */ |
73 | [36] = { IPRD(0), 1 }, /* IRQ 4 */ | 101 | { 35, 2, 12, 1 }, /* IRQ 3 TOUCHSCREEN */ |
74 | [37] = { IPRD(4), 1 }, /* IRQ 5 */ | 102 | |
75 | [48 ... 51] = { IPRE(12), 7 }, /* DMA */ | 103 | { 36, 3, 0, 1 }, /* IRQ 4 */ |
76 | [52 ... 55] = { IPRE(8), 3 }, /* IRDA */ | 104 | { 37, 3, 4, 1 }, /* IRQ 5 */ |
77 | [56 ... 59] = { IPRE(4), 3 }, /* SCIF */ | 105 | |
106 | { 48, 4, 12, 7 }, /* DMA */ | ||
107 | { 49, 4, 12, 7 }, /* DMA */ | ||
108 | { 50, 4, 12, 7 }, /* DMA */ | ||
109 | { 51, 4, 12, 7 }, /* DMA */ | ||
110 | |||
111 | { 52, 4, 8, 3 }, /* IRDA */ | ||
112 | { 53, 4, 8, 3 }, /* IRDA */ | ||
113 | { 54, 4, 8, 3 }, /* IRDA */ | ||
114 | { 55, 4, 8, 3 }, /* IRDA */ | ||
115 | |||
116 | { 56, 4, 4, 3 }, /* SCIF */ | ||
117 | { 57, 4, 4, 3 }, /* SCIF */ | ||
118 | { 58, 4, 4, 3 }, /* SCIF */ | ||
119 | { 59, 4, 4, 3 }, /* SCIF */ | ||
120 | }; | ||
121 | |||
122 | static unsigned long ipr_offsets[] = { | ||
123 | 0xfffffee2, /* 0: IPRA */ | ||
124 | 0xfffffee4, /* 1: IPRB */ | ||
125 | 0xa4000016, /* 2: IPRC */ | ||
126 | 0xa4000018, /* 3: IPRD */ | ||
127 | 0xa400001a, /* 4: IPRE */ | ||
128 | }; | ||
129 | |||
130 | static struct ipr_desc ipr_irq_desc = { | ||
131 | .ipr_offsets = ipr_offsets, | ||
132 | .nr_offsets = ARRAY_SIZE(ipr_offsets), | ||
133 | |||
134 | .ipr_data = ipr_irq_table, | ||
135 | .nr_irqs = ARRAY_SIZE(ipr_irq_table), | ||
136 | |||
137 | .chip = { | ||
138 | .name = "IPR-sh7709", | ||
139 | }, | ||
78 | }; | 140 | }; |
79 | 141 | ||
80 | void __init init_IRQ_ipr() | 142 | void __init init_IRQ_ipr(void) |
81 | { | 143 | { |
82 | make_ipr_irq(sh7709_ipr_map, ARRAY_SIZE(sh7709_ipr_map)); | 144 | register_ipr_controller(&ipr_irq_desc); |
83 | } | 145 | } |
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh7710.c b/arch/sh/kernel/cpu/sh3/setup-sh7710.c index 51760a7e7f1c..f40e6dac337d 100644 --- a/arch/sh/kernel/cpu/sh3/setup-sh7710.c +++ b/arch/sh/kernel/cpu/sh3/setup-sh7710.c | |||
@@ -49,7 +49,7 @@ static int __init sh7710_devices_setup(void) | |||
49 | } | 49 | } |
50 | __initcall(sh7710_devices_setup); | 50 | __initcall(sh7710_devices_setup); |
51 | 51 | ||
52 | static struct ipr_data sh7710_ipr_map[] = { | 52 | static struct ipr_data ipr_irq_table[] = { |
53 | /* IRQ, IPR-idx, shift, priority */ | 53 | /* IRQ, IPR-idx, shift, priority */ |
54 | { 16, 0, 12, 2 }, /* TMU0 TUNI*/ | 54 | { 16, 0, 12, 2 }, /* TMU0 TUNI*/ |
55 | { 17, 0, 8, 2 }, /* TMU1 TUNI */ | 55 | { 17, 0, 8, 2 }, /* TMU1 TUNI */ |
@@ -78,26 +78,30 @@ static struct ipr_data sh7710_ipr_map[] = { | |||
78 | }; | 78 | }; |
79 | 79 | ||
80 | static unsigned long ipr_offsets[] = { | 80 | static unsigned long ipr_offsets[] = { |
81 | 0xA414FEE2 /* 0: IPRA */ | 81 | 0xA414FEE2, /* 0: IPRA */ |
82 | , 0xA414FEE4 /* 1: IPRB */ | 82 | 0xA414FEE4, /* 1: IPRB */ |
83 | , 0xA4140016 /* 2: IPRC */ | 83 | 0xA4140016, /* 2: IPRC */ |
84 | , 0xA4140018 /* 3: IPRD */ | 84 | 0xA4140018, /* 3: IPRD */ |
85 | , 0xA414001A /* 4: IPRE */ | 85 | 0xA414001A, /* 4: IPRE */ |
86 | , 0xA4080000 /* 5: IPRF */ | 86 | 0xA4080000, /* 5: IPRF */ |
87 | , 0xA4080002 /* 6: IPRG */ | 87 | 0xA4080002, /* 6: IPRG */ |
88 | , 0xA4080004 /* 7: IPRH */ | 88 | 0xA4080004, /* 7: IPRH */ |
89 | , 0xA4080006 /* 8: IPRI */ | 89 | 0xA4080006, /* 8: IPRI */ |
90 | }; | 90 | }; |
91 | 91 | ||
92 | /* given the IPR index return the address of the IPR register */ | 92 | static struct ipr_desc ipr_irq_desc = { |
93 | unsigned int map_ipridx_to_addr(int idx) | 93 | .ipr_offsets = ipr_offsets, |
94 | { | 94 | .nr_offsets = ARRAY_SIZE(ipr_offsets), |
95 | if (idx >= ARRAY_SIZE(ipr_offsets)) | 95 | |
96 | return 0; | 96 | .ipr_data = ipr_irq_table, |
97 | return ipr_offsets[idx]; | 97 | .nr_irqs = ARRAY_SIZE(ipr_irq_table), |
98 | } | 98 | |
99 | .chip = { | ||
100 | .name = "IPR-sh7710", | ||
101 | }, | ||
102 | }; | ||
99 | 103 | ||
100 | void __init init_IRQ_ipr() | 104 | void __init init_IRQ_ipr(void) |
101 | { | 105 | { |
102 | make_ipr_irq(sh7710_ipr_map, ARRAY_SIZE(sh7710_ipr_map)); | 106 | register_ipr_controller(&ipr_irq_desc); |
103 | } | 107 | } |