diff options
author | Paul Mundt <lethal@linux-sh.org> | 2011-01-13 01:06:28 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2011-01-13 01:06:28 -0500 |
commit | f43dc23d5ea91fca257be02138a255f02d98e806 (patch) | |
tree | b29722f6e965316e90ac97abf79923ced250dc21 /arch/sh/kernel/cpu/sh4a/setup-sh7722.c | |
parent | f8e53553f452dcbf67cb89c8cba63a1cd6eb4cc0 (diff) | |
parent | 4162cf64973df51fc885825bc9ca4d055891c49f (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6 into common/serial-rework
Conflicts:
arch/sh/kernel/cpu/sh2/setup-sh7619.c
arch/sh/kernel/cpu/sh2a/setup-mxg.c
arch/sh/kernel/cpu/sh2a/setup-sh7201.c
arch/sh/kernel/cpu/sh2a/setup-sh7203.c
arch/sh/kernel/cpu/sh2a/setup-sh7206.c
arch/sh/kernel/cpu/sh3/setup-sh7705.c
arch/sh/kernel/cpu/sh3/setup-sh770x.c
arch/sh/kernel/cpu/sh3/setup-sh7710.c
arch/sh/kernel/cpu/sh3/setup-sh7720.c
arch/sh/kernel/cpu/sh4/setup-sh4-202.c
arch/sh/kernel/cpu/sh4/setup-sh7750.c
arch/sh/kernel/cpu/sh4/setup-sh7760.c
arch/sh/kernel/cpu/sh4a/setup-sh7343.c
arch/sh/kernel/cpu/sh4a/setup-sh7366.c
arch/sh/kernel/cpu/sh4a/setup-sh7722.c
arch/sh/kernel/cpu/sh4a/setup-sh7723.c
arch/sh/kernel/cpu/sh4a/setup-sh7724.c
arch/sh/kernel/cpu/sh4a/setup-sh7763.c
arch/sh/kernel/cpu/sh4a/setup-sh7770.c
arch/sh/kernel/cpu/sh4a/setup-sh7780.c
arch/sh/kernel/cpu/sh4a/setup-sh7785.c
arch/sh/kernel/cpu/sh4a/setup-sh7786.c
arch/sh/kernel/cpu/sh4a/setup-shx3.c
arch/sh/kernel/cpu/sh5/setup-sh5.c
drivers/serial/sh-sci.c
drivers/serial/sh-sci.h
include/linux/serial_sci.h
Diffstat (limited to 'arch/sh/kernel/cpu/sh4a/setup-sh7722.c')
-rw-r--r-- | arch/sh/kernel/cpu/sh4a/setup-sh7722.c | 357 |
1 files changed, 299 insertions, 58 deletions
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c index f7b0551bf104..73737d00e2e7 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c | |||
@@ -7,15 +7,227 @@ | |||
7 | * License. See the file "COPYING" in the main directory of this archive | 7 | * License. See the file "COPYING" in the main directory of this archive |
8 | * for more details. | 8 | * for more details. |
9 | */ | 9 | */ |
10 | #include <linux/platform_device.h> | ||
11 | #include <linux/init.h> | 10 | #include <linux/init.h> |
11 | #include <linux/mm.h> | ||
12 | #include <linux/platform_device.h> | ||
12 | #include <linux/serial.h> | 13 | #include <linux/serial.h> |
13 | #include <linux/serial_sci.h> | 14 | #include <linux/serial_sci.h> |
14 | #include <linux/mm.h> | ||
15 | #include <linux/uio_driver.h> | ||
16 | #include <linux/sh_timer.h> | 15 | #include <linux/sh_timer.h> |
16 | #include <linux/uio_driver.h> | ||
17 | #include <linux/usb/m66592.h> | ||
18 | |||
17 | #include <asm/clock.h> | 19 | #include <asm/clock.h> |
18 | #include <asm/mmzone.h> | 20 | #include <asm/mmzone.h> |
21 | #include <asm/siu.h> | ||
22 | |||
23 | #include <cpu/dma-register.h> | ||
24 | #include <cpu/sh7722.h> | ||
25 | |||
26 | static const struct sh_dmae_slave_config sh7722_dmae_slaves[] = { | ||
27 | { | ||
28 | .slave_id = SHDMA_SLAVE_SCIF0_TX, | ||
29 | .addr = 0xffe0000c, | ||
30 | .chcr = DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT), | ||
31 | .mid_rid = 0x21, | ||
32 | }, { | ||
33 | .slave_id = SHDMA_SLAVE_SCIF0_RX, | ||
34 | .addr = 0xffe00014, | ||
35 | .chcr = DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT), | ||
36 | .mid_rid = 0x22, | ||
37 | }, { | ||
38 | .slave_id = SHDMA_SLAVE_SCIF1_TX, | ||
39 | .addr = 0xffe1000c, | ||
40 | .chcr = DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT), | ||
41 | .mid_rid = 0x25, | ||
42 | }, { | ||
43 | .slave_id = SHDMA_SLAVE_SCIF1_RX, | ||
44 | .addr = 0xffe10014, | ||
45 | .chcr = DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT), | ||
46 | .mid_rid = 0x26, | ||
47 | }, { | ||
48 | .slave_id = SHDMA_SLAVE_SCIF2_TX, | ||
49 | .addr = 0xffe2000c, | ||
50 | .chcr = DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT), | ||
51 | .mid_rid = 0x29, | ||
52 | }, { | ||
53 | .slave_id = SHDMA_SLAVE_SCIF2_RX, | ||
54 | .addr = 0xffe20014, | ||
55 | .chcr = DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT), | ||
56 | .mid_rid = 0x2a, | ||
57 | }, { | ||
58 | .slave_id = SHDMA_SLAVE_SIUA_TX, | ||
59 | .addr = 0xa454c098, | ||
60 | .chcr = DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL(XMIT_SZ_32BIT), | ||
61 | .mid_rid = 0xb1, | ||
62 | }, { | ||
63 | .slave_id = SHDMA_SLAVE_SIUA_RX, | ||
64 | .addr = 0xa454c090, | ||
65 | .chcr = DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_32BIT), | ||
66 | .mid_rid = 0xb2, | ||
67 | }, { | ||
68 | .slave_id = SHDMA_SLAVE_SIUB_TX, | ||
69 | .addr = 0xa454c09c, | ||
70 | .chcr = DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL(XMIT_SZ_32BIT), | ||
71 | .mid_rid = 0xb5, | ||
72 | }, { | ||
73 | .slave_id = SHDMA_SLAVE_SIUB_RX, | ||
74 | .addr = 0xa454c094, | ||
75 | .chcr = DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_32BIT), | ||
76 | .mid_rid = 0xb6, | ||
77 | }, { | ||
78 | .slave_id = SHDMA_SLAVE_SDHI0_TX, | ||
79 | .addr = 0x04ce0030, | ||
80 | .chcr = DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL(XMIT_SZ_16BIT), | ||
81 | .mid_rid = 0xc1, | ||
82 | }, { | ||
83 | .slave_id = SHDMA_SLAVE_SDHI0_RX, | ||
84 | .addr = 0x04ce0030, | ||
85 | .chcr = DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_16BIT), | ||
86 | .mid_rid = 0xc2, | ||
87 | }, | ||
88 | }; | ||
89 | |||
90 | static const struct sh_dmae_channel sh7722_dmae_channels[] = { | ||
91 | { | ||
92 | .offset = 0, | ||
93 | .dmars = 0, | ||
94 | .dmars_bit = 0, | ||
95 | }, { | ||
96 | .offset = 0x10, | ||
97 | .dmars = 0, | ||
98 | .dmars_bit = 8, | ||
99 | }, { | ||
100 | .offset = 0x20, | ||
101 | .dmars = 4, | ||
102 | .dmars_bit = 0, | ||
103 | }, { | ||
104 | .offset = 0x30, | ||
105 | .dmars = 4, | ||
106 | .dmars_bit = 8, | ||
107 | }, { | ||
108 | .offset = 0x50, | ||
109 | .dmars = 8, | ||
110 | .dmars_bit = 0, | ||
111 | }, { | ||
112 | .offset = 0x60, | ||
113 | .dmars = 8, | ||
114 | .dmars_bit = 8, | ||
115 | } | ||
116 | }; | ||
117 | |||
118 | static const unsigned int ts_shift[] = TS_SHIFT; | ||
119 | |||
120 | static struct sh_dmae_pdata dma_platform_data = { | ||
121 | .slave = sh7722_dmae_slaves, | ||
122 | .slave_num = ARRAY_SIZE(sh7722_dmae_slaves), | ||
123 | .channel = sh7722_dmae_channels, | ||
124 | .channel_num = ARRAY_SIZE(sh7722_dmae_channels), | ||
125 | .ts_low_shift = CHCR_TS_LOW_SHIFT, | ||
126 | .ts_low_mask = CHCR_TS_LOW_MASK, | ||
127 | .ts_high_shift = CHCR_TS_HIGH_SHIFT, | ||
128 | .ts_high_mask = CHCR_TS_HIGH_MASK, | ||
129 | .ts_shift = ts_shift, | ||
130 | .ts_shift_num = ARRAY_SIZE(ts_shift), | ||
131 | .dmaor_init = DMAOR_INIT, | ||
132 | }; | ||
133 | |||
134 | static struct resource sh7722_dmae_resources[] = { | ||
135 | [0] = { | ||
136 | /* Channel registers and DMAOR */ | ||
137 | .start = 0xfe008020, | ||
138 | .end = 0xfe00808f, | ||
139 | .flags = IORESOURCE_MEM, | ||
140 | }, | ||
141 | [1] = { | ||
142 | /* DMARSx */ | ||
143 | .start = 0xfe009000, | ||
144 | .end = 0xfe00900b, | ||
145 | .flags = IORESOURCE_MEM, | ||
146 | }, | ||
147 | { | ||
148 | /* DMA error IRQ */ | ||
149 | .start = 78, | ||
150 | .end = 78, | ||
151 | .flags = IORESOURCE_IRQ, | ||
152 | }, | ||
153 | { | ||
154 | /* IRQ for channels 0-3 */ | ||
155 | .start = 48, | ||
156 | .end = 51, | ||
157 | .flags = IORESOURCE_IRQ, | ||
158 | }, | ||
159 | { | ||
160 | /* IRQ for channels 4-5 */ | ||
161 | .start = 76, | ||
162 | .end = 77, | ||
163 | .flags = IORESOURCE_IRQ, | ||
164 | }, | ||
165 | }; | ||
166 | |||
167 | struct platform_device dma_device = { | ||
168 | .name = "sh-dma-engine", | ||
169 | .id = -1, | ||
170 | .resource = sh7722_dmae_resources, | ||
171 | .num_resources = ARRAY_SIZE(sh7722_dmae_resources), | ||
172 | .dev = { | ||
173 | .platform_data = &dma_platform_data, | ||
174 | }, | ||
175 | .archdata = { | ||
176 | .hwblk_id = HWBLK_DMAC, | ||
177 | }, | ||
178 | }; | ||
179 | |||
180 | /* Serial */ | ||
181 | static struct plat_sci_port scif0_platform_data = { | ||
182 | .mapbase = 0xffe00000, | ||
183 | .flags = UPF_BOOT_AUTOCONF, | ||
184 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, | ||
185 | .scbrr_algo_id = SCBRR_ALGO_2, | ||
186 | .type = PORT_SCIF, | ||
187 | .irqs = { 80, 80, 80, 80 }, | ||
188 | }; | ||
189 | |||
190 | static struct platform_device scif0_device = { | ||
191 | .name = "sh-sci", | ||
192 | .id = 0, | ||
193 | .dev = { | ||
194 | .platform_data = &scif0_platform_data, | ||
195 | }, | ||
196 | }; | ||
197 | |||
198 | static struct plat_sci_port scif1_platform_data = { | ||
199 | .mapbase = 0xffe10000, | ||
200 | .flags = UPF_BOOT_AUTOCONF, | ||
201 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, | ||
202 | .scbrr_algo_id = SCBRR_ALGO_2, | ||
203 | .type = PORT_SCIF, | ||
204 | .irqs = { 81, 81, 81, 81 }, | ||
205 | }; | ||
206 | |||
207 | static struct platform_device scif1_device = { | ||
208 | .name = "sh-sci", | ||
209 | .id = 1, | ||
210 | .dev = { | ||
211 | .platform_data = &scif1_platform_data, | ||
212 | }, | ||
213 | }; | ||
214 | |||
215 | static struct plat_sci_port scif2_platform_data = { | ||
216 | .mapbase = 0xffe20000, | ||
217 | .flags = UPF_BOOT_AUTOCONF, | ||
218 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, | ||
219 | .scbrr_algo_id = SCBRR_ALGO_2, | ||
220 | .type = PORT_SCIF, | ||
221 | .irqs = { 82, 82, 82, 82 }, | ||
222 | }; | ||
223 | |||
224 | static struct platform_device scif2_device = { | ||
225 | .name = "sh-sci", | ||
226 | .id = 2, | ||
227 | .dev = { | ||
228 | .platform_data = &scif2_platform_data, | ||
229 | }, | ||
230 | }; | ||
19 | 231 | ||
20 | static struct resource rtc_resources[] = { | 232 | static struct resource rtc_resources[] = { |
21 | [0] = { | 233 | [0] = { |
@@ -45,11 +257,18 @@ static struct platform_device rtc_device = { | |||
45 | .id = -1, | 257 | .id = -1, |
46 | .num_resources = ARRAY_SIZE(rtc_resources), | 258 | .num_resources = ARRAY_SIZE(rtc_resources), |
47 | .resource = rtc_resources, | 259 | .resource = rtc_resources, |
260 | .archdata = { | ||
261 | .hwblk_id = HWBLK_RTC, | ||
262 | }, | ||
263 | }; | ||
264 | |||
265 | static struct m66592_platdata usbf_platdata = { | ||
266 | .on_chip = 1, | ||
48 | }; | 267 | }; |
49 | 268 | ||
50 | static struct resource usbf_resources[] = { | 269 | static struct resource usbf_resources[] = { |
51 | [0] = { | 270 | [0] = { |
52 | .name = "m66592_udc", | 271 | .name = "USBF", |
53 | .start = 0x04480000, | 272 | .start = 0x04480000, |
54 | .end = 0x044800FF, | 273 | .end = 0x044800FF, |
55 | .flags = IORESOURCE_MEM, | 274 | .flags = IORESOURCE_MEM, |
@@ -67,9 +286,13 @@ static struct platform_device usbf_device = { | |||
67 | .dev = { | 286 | .dev = { |
68 | .dma_mask = NULL, | 287 | .dma_mask = NULL, |
69 | .coherent_dma_mask = 0xffffffff, | 288 | .coherent_dma_mask = 0xffffffff, |
289 | .platform_data = &usbf_platdata, | ||
70 | }, | 290 | }, |
71 | .num_resources = ARRAY_SIZE(usbf_resources), | 291 | .num_resources = ARRAY_SIZE(usbf_resources), |
72 | .resource = usbf_resources, | 292 | .resource = usbf_resources, |
293 | .archdata = { | ||
294 | .hwblk_id = HWBLK_USBF, | ||
295 | }, | ||
73 | }; | 296 | }; |
74 | 297 | ||
75 | static struct resource iic_resources[] = { | 298 | static struct resource iic_resources[] = { |
@@ -91,6 +314,9 @@ static struct platform_device iic_device = { | |||
91 | .id = 0, /* "i2c0" clock */ | 314 | .id = 0, /* "i2c0" clock */ |
92 | .num_resources = ARRAY_SIZE(iic_resources), | 315 | .num_resources = ARRAY_SIZE(iic_resources), |
93 | .resource = iic_resources, | 316 | .resource = iic_resources, |
317 | .archdata = { | ||
318 | .hwblk_id = HWBLK_IIC, | ||
319 | }, | ||
94 | }; | 320 | }; |
95 | 321 | ||
96 | static struct uio_info vpu_platform_data = { | 322 | static struct uio_info vpu_platform_data = { |
@@ -119,6 +345,9 @@ static struct platform_device vpu_device = { | |||
119 | }, | 345 | }, |
120 | .resource = vpu_resources, | 346 | .resource = vpu_resources, |
121 | .num_resources = ARRAY_SIZE(vpu_resources), | 347 | .num_resources = ARRAY_SIZE(vpu_resources), |
348 | .archdata = { | ||
349 | .hwblk_id = HWBLK_VPU, | ||
350 | }, | ||
122 | }; | 351 | }; |
123 | 352 | ||
124 | static struct uio_info veu_platform_data = { | 353 | static struct uio_info veu_platform_data = { |
@@ -147,6 +376,9 @@ static struct platform_device veu_device = { | |||
147 | }, | 376 | }, |
148 | .resource = veu_resources, | 377 | .resource = veu_resources, |
149 | .num_resources = ARRAY_SIZE(veu_resources), | 378 | .num_resources = ARRAY_SIZE(veu_resources), |
379 | .archdata = { | ||
380 | .hwblk_id = HWBLK_VEU, | ||
381 | }, | ||
150 | }; | 382 | }; |
151 | 383 | ||
152 | static struct uio_info jpu_platform_data = { | 384 | static struct uio_info jpu_platform_data = { |
@@ -175,20 +407,20 @@ static struct platform_device jpu_device = { | |||
175 | }, | 407 | }, |
176 | .resource = jpu_resources, | 408 | .resource = jpu_resources, |
177 | .num_resources = ARRAY_SIZE(jpu_resources), | 409 | .num_resources = ARRAY_SIZE(jpu_resources), |
410 | .archdata = { | ||
411 | .hwblk_id = HWBLK_JPU, | ||
412 | }, | ||
178 | }; | 413 | }; |
179 | 414 | ||
180 | static struct sh_timer_config cmt_platform_data = { | 415 | static struct sh_timer_config cmt_platform_data = { |
181 | .name = "CMT", | ||
182 | .channel_offset = 0x60, | 416 | .channel_offset = 0x60, |
183 | .timer_bit = 5, | 417 | .timer_bit = 5, |
184 | .clk = "cmt0", | ||
185 | .clockevent_rating = 125, | 418 | .clockevent_rating = 125, |
186 | .clocksource_rating = 125, | 419 | .clocksource_rating = 125, |
187 | }; | 420 | }; |
188 | 421 | ||
189 | static struct resource cmt_resources[] = { | 422 | static struct resource cmt_resources[] = { |
190 | [0] = { | 423 | [0] = { |
191 | .name = "CMT", | ||
192 | .start = 0x044a0060, | 424 | .start = 0x044a0060, |
193 | .end = 0x044a006b, | 425 | .end = 0x044a006b, |
194 | .flags = IORESOURCE_MEM, | 426 | .flags = IORESOURCE_MEM, |
@@ -207,19 +439,19 @@ static struct platform_device cmt_device = { | |||
207 | }, | 439 | }, |
208 | .resource = cmt_resources, | 440 | .resource = cmt_resources, |
209 | .num_resources = ARRAY_SIZE(cmt_resources), | 441 | .num_resources = ARRAY_SIZE(cmt_resources), |
442 | .archdata = { | ||
443 | .hwblk_id = HWBLK_CMT, | ||
444 | }, | ||
210 | }; | 445 | }; |
211 | 446 | ||
212 | static struct sh_timer_config tmu0_platform_data = { | 447 | static struct sh_timer_config tmu0_platform_data = { |
213 | .name = "TMU0", | ||
214 | .channel_offset = 0x04, | 448 | .channel_offset = 0x04, |
215 | .timer_bit = 0, | 449 | .timer_bit = 0, |
216 | .clk = "tmu0", | ||
217 | .clockevent_rating = 200, | 450 | .clockevent_rating = 200, |
218 | }; | 451 | }; |
219 | 452 | ||
220 | static struct resource tmu0_resources[] = { | 453 | static struct resource tmu0_resources[] = { |
221 | [0] = { | 454 | [0] = { |
222 | .name = "TMU0", | ||
223 | .start = 0xffd80008, | 455 | .start = 0xffd80008, |
224 | .end = 0xffd80013, | 456 | .end = 0xffd80013, |
225 | .flags = IORESOURCE_MEM, | 457 | .flags = IORESOURCE_MEM, |
@@ -238,19 +470,19 @@ static struct platform_device tmu0_device = { | |||
238 | }, | 470 | }, |
239 | .resource = tmu0_resources, | 471 | .resource = tmu0_resources, |
240 | .num_resources = ARRAY_SIZE(tmu0_resources), | 472 | .num_resources = ARRAY_SIZE(tmu0_resources), |
473 | .archdata = { | ||
474 | .hwblk_id = HWBLK_TMU, | ||
475 | }, | ||
241 | }; | 476 | }; |
242 | 477 | ||
243 | static struct sh_timer_config tmu1_platform_data = { | 478 | static struct sh_timer_config tmu1_platform_data = { |
244 | .name = "TMU1", | ||
245 | .channel_offset = 0x10, | 479 | .channel_offset = 0x10, |
246 | .timer_bit = 1, | 480 | .timer_bit = 1, |
247 | .clk = "tmu0", | ||
248 | .clocksource_rating = 200, | 481 | .clocksource_rating = 200, |
249 | }; | 482 | }; |
250 | 483 | ||
251 | static struct resource tmu1_resources[] = { | 484 | static struct resource tmu1_resources[] = { |
252 | [0] = { | 485 | [0] = { |
253 | .name = "TMU1", | ||
254 | .start = 0xffd80014, | 486 | .start = 0xffd80014, |
255 | .end = 0xffd8001f, | 487 | .end = 0xffd8001f, |
256 | .flags = IORESOURCE_MEM, | 488 | .flags = IORESOURCE_MEM, |
@@ -269,18 +501,18 @@ static struct platform_device tmu1_device = { | |||
269 | }, | 501 | }, |
270 | .resource = tmu1_resources, | 502 | .resource = tmu1_resources, |
271 | .num_resources = ARRAY_SIZE(tmu1_resources), | 503 | .num_resources = ARRAY_SIZE(tmu1_resources), |
504 | .archdata = { | ||
505 | .hwblk_id = HWBLK_TMU, | ||
506 | }, | ||
272 | }; | 507 | }; |
273 | 508 | ||
274 | static struct sh_timer_config tmu2_platform_data = { | 509 | static struct sh_timer_config tmu2_platform_data = { |
275 | .name = "TMU2", | ||
276 | .channel_offset = 0x1c, | 510 | .channel_offset = 0x1c, |
277 | .timer_bit = 2, | 511 | .timer_bit = 2, |
278 | .clk = "tmu0", | ||
279 | }; | 512 | }; |
280 | 513 | ||
281 | static struct resource tmu2_resources[] = { | 514 | static struct resource tmu2_resources[] = { |
282 | [0] = { | 515 | [0] = { |
283 | .name = "TMU2", | ||
284 | .start = 0xffd80020, | 516 | .start = 0xffd80020, |
285 | .end = 0xffd8002b, | 517 | .end = 0xffd8002b, |
286 | .flags = IORESOURCE_MEM, | 518 | .flags = IORESOURCE_MEM, |
@@ -299,47 +531,48 @@ static struct platform_device tmu2_device = { | |||
299 | }, | 531 | }, |
300 | .resource = tmu2_resources, | 532 | .resource = tmu2_resources, |
301 | .num_resources = ARRAY_SIZE(tmu2_resources), | 533 | .num_resources = ARRAY_SIZE(tmu2_resources), |
534 | .archdata = { | ||
535 | .hwblk_id = HWBLK_TMU, | ||
536 | }, | ||
302 | }; | 537 | }; |
303 | 538 | ||
304 | static struct plat_sci_port sci_platform_data[] = { | 539 | static struct siu_platform siu_platform_data = { |
305 | { | 540 | .dma_dev = &dma_device.dev, |
306 | .mapbase = 0xffe00000, | 541 | .dma_slave_tx_a = SHDMA_SLAVE_SIUA_TX, |
307 | .flags = UPF_BOOT_AUTOCONF, | 542 | .dma_slave_rx_a = SHDMA_SLAVE_SIUA_RX, |
308 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, | 543 | .dma_slave_tx_b = SHDMA_SLAVE_SIUB_TX, |
309 | .scbrr_algo_id = SCBRR_ALGO_2, | 544 | .dma_slave_rx_b = SHDMA_SLAVE_SIUB_RX, |
310 | .type = PORT_SCIF, | ||
311 | .irqs = { 80, 80, 80, 80 }, | ||
312 | .clk = "scif0", | ||
313 | }, { | ||
314 | .mapbase = 0xffe10000, | ||
315 | .flags = UPF_BOOT_AUTOCONF, | ||
316 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, | ||
317 | .scbrr_algo_id = SCBRR_ALGO_2, | ||
318 | .type = PORT_SCIF, | ||
319 | .irqs = { 81, 81, 81, 81 }, | ||
320 | .clk = "scif1", | ||
321 | }, { | ||
322 | .mapbase = 0xffe20000, | ||
323 | .flags = UPF_BOOT_AUTOCONF, | ||
324 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, | ||
325 | .scbrr_algo_id = SCBRR_ALGO_2, | ||
326 | .type = PORT_SCIF, | ||
327 | .irqs = { 82, 82, 82, 82 }, | ||
328 | .clk = "scif2", | ||
329 | }, { | ||
330 | .flags = 0, | ||
331 | } | ||
332 | }; | 545 | }; |
333 | 546 | ||
334 | static struct platform_device sci_device = { | 547 | static struct resource siu_resources[] = { |
335 | .name = "sh-sci", | 548 | [0] = { |
549 | .start = 0xa4540000, | ||
550 | .end = 0xa454c10f, | ||
551 | .flags = IORESOURCE_MEM, | ||
552 | }, | ||
553 | [1] = { | ||
554 | .start = 108, | ||
555 | .flags = IORESOURCE_IRQ, | ||
556 | }, | ||
557 | }; | ||
558 | |||
559 | static struct platform_device siu_device = { | ||
560 | .name = "siu-pcm-audio", | ||
336 | .id = -1, | 561 | .id = -1, |
337 | .dev = { | 562 | .dev = { |
338 | .platform_data = sci_platform_data, | 563 | .platform_data = &siu_platform_data, |
564 | }, | ||
565 | .resource = siu_resources, | ||
566 | .num_resources = ARRAY_SIZE(siu_resources), | ||
567 | .archdata = { | ||
568 | .hwblk_id = HWBLK_SIU, | ||
339 | }, | 569 | }, |
340 | }; | 570 | }; |
341 | 571 | ||
342 | static struct platform_device *sh7722_devices[] __initdata = { | 572 | static struct platform_device *sh7722_devices[] __initdata = { |
573 | &scif0_device, | ||
574 | &scif1_device, | ||
575 | &scif2_device, | ||
343 | &cmt_device, | 576 | &cmt_device, |
344 | &tmu0_device, | 577 | &tmu0_device, |
345 | &tmu1_device, | 578 | &tmu1_device, |
@@ -347,10 +580,11 @@ static struct platform_device *sh7722_devices[] __initdata = { | |||
347 | &rtc_device, | 580 | &rtc_device, |
348 | &usbf_device, | 581 | &usbf_device, |
349 | &iic_device, | 582 | &iic_device, |
350 | &sci_device, | ||
351 | &vpu_device, | 583 | &vpu_device, |
352 | &veu_device, | 584 | &veu_device, |
353 | &jpu_device, | 585 | &jpu_device, |
586 | &siu_device, | ||
587 | &dma_device, | ||
354 | }; | 588 | }; |
355 | 589 | ||
356 | static int __init sh7722_devices_setup(void) | 590 | static int __init sh7722_devices_setup(void) |
@@ -362,9 +596,12 @@ static int __init sh7722_devices_setup(void) | |||
362 | return platform_add_devices(sh7722_devices, | 596 | return platform_add_devices(sh7722_devices, |
363 | ARRAY_SIZE(sh7722_devices)); | 597 | ARRAY_SIZE(sh7722_devices)); |
364 | } | 598 | } |
365 | __initcall(sh7722_devices_setup); | 599 | arch_initcall(sh7722_devices_setup); |
366 | 600 | ||
367 | static struct platform_device *sh7722_early_devices[] __initdata = { | 601 | static struct platform_device *sh7722_early_devices[] __initdata = { |
602 | &scif0_device, | ||
603 | &scif1_device, | ||
604 | &scif2_device, | ||
368 | &cmt_device, | 605 | &cmt_device, |
369 | &tmu0_device, | 606 | &tmu0_device, |
370 | &tmu1_device, | 607 | &tmu1_device, |
@@ -379,6 +616,8 @@ void __init plat_early_device_setup(void) | |||
379 | 616 | ||
380 | enum { | 617 | enum { |
381 | UNUSED=0, | 618 | UNUSED=0, |
619 | ENABLED, | ||
620 | DISABLED, | ||
382 | 621 | ||
383 | /* interrupt sources */ | 622 | /* interrupt sources */ |
384 | IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7, | 623 | IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7, |
@@ -394,7 +633,6 @@ enum { | |||
394 | SCIF0, SCIF1, SCIF2, SIOF0, SIOF1, SIO, | 633 | SCIF0, SCIF1, SCIF2, SIOF0, SIOF1, SIO, |
395 | FLCTL_FLSTEI, FLCTL_FLENDI, FLCTL_FLTREQ0I, FLCTL_FLTREQ1I, | 634 | FLCTL_FLSTEI, FLCTL_FLENDI, FLCTL_FLTREQ0I, FLCTL_FLTREQ1I, |
396 | I2C_ALI, I2C_TACKI, I2C_WAITI, I2C_DTEI, | 635 | I2C_ALI, I2C_TACKI, I2C_WAITI, I2C_DTEI, |
397 | SDHI0, SDHI1, SDHI2, SDHI3, | ||
398 | CMT, TSIF, SIU, TWODG, | 636 | CMT, TSIF, SIU, TWODG, |
399 | TMU0, TMU1, TMU2, | 637 | TMU0, TMU1, TMU2, |
400 | IRDA, JPU, LCDC, | 638 | IRDA, JPU, LCDC, |
@@ -427,8 +665,8 @@ static struct intc_vect vectors[] __initdata = { | |||
427 | INTC_VECT(FLCTL_FLTREQ0I, 0xdc0), INTC_VECT(FLCTL_FLTREQ1I, 0xde0), | 665 | INTC_VECT(FLCTL_FLTREQ0I, 0xdc0), INTC_VECT(FLCTL_FLTREQ1I, 0xde0), |
428 | INTC_VECT(I2C_ALI, 0xe00), INTC_VECT(I2C_TACKI, 0xe20), | 666 | INTC_VECT(I2C_ALI, 0xe00), INTC_VECT(I2C_TACKI, 0xe20), |
429 | INTC_VECT(I2C_WAITI, 0xe40), INTC_VECT(I2C_DTEI, 0xe60), | 667 | INTC_VECT(I2C_WAITI, 0xe40), INTC_VECT(I2C_DTEI, 0xe60), |
430 | INTC_VECT(SDHI0, 0xe80), INTC_VECT(SDHI1, 0xea0), | 668 | INTC_VECT(SDHI, 0xe80), INTC_VECT(SDHI, 0xea0), |
431 | INTC_VECT(SDHI2, 0xec0), INTC_VECT(SDHI3, 0xee0), | 669 | INTC_VECT(SDHI, 0xec0), INTC_VECT(SDHI, 0xee0), |
432 | INTC_VECT(CMT, 0xf00), INTC_VECT(TSIF, 0xf20), | 670 | INTC_VECT(CMT, 0xf00), INTC_VECT(TSIF, 0xf20), |
433 | INTC_VECT(SIU, 0xf80), INTC_VECT(TWODG, 0xfa0), | 671 | INTC_VECT(SIU, 0xf80), INTC_VECT(TWODG, 0xfa0), |
434 | INTC_VECT(TMU0, 0x400), INTC_VECT(TMU1, 0x420), | 672 | INTC_VECT(TMU0, 0x400), INTC_VECT(TMU1, 0x420), |
@@ -446,7 +684,6 @@ static struct intc_group groups[] __initdata = { | |||
446 | INTC_GROUP(FLCTL, FLCTL_FLSTEI, FLCTL_FLENDI, | 684 | INTC_GROUP(FLCTL, FLCTL_FLSTEI, FLCTL_FLENDI, |
447 | FLCTL_FLTREQ0I, FLCTL_FLTREQ1I), | 685 | FLCTL_FLTREQ0I, FLCTL_FLTREQ1I), |
448 | INTC_GROUP(I2C, I2C_ALI, I2C_TACKI, I2C_WAITI, I2C_DTEI), | 686 | INTC_GROUP(I2C, I2C_ALI, I2C_TACKI, I2C_WAITI, I2C_DTEI), |
449 | INTC_GROUP(SDHI, SDHI0, SDHI1, SDHI2, SDHI3), | ||
450 | }; | 687 | }; |
451 | 688 | ||
452 | static struct intc_mask_reg mask_registers[] __initdata = { | 689 | static struct intc_mask_reg mask_registers[] __initdata = { |
@@ -468,7 +705,7 @@ static struct intc_mask_reg mask_registers[] __initdata = { | |||
468 | { I2C_DTEI, I2C_WAITI, I2C_TACKI, I2C_ALI, | 705 | { I2C_DTEI, I2C_WAITI, I2C_TACKI, I2C_ALI, |
469 | FLCTL_FLTREQ1I, FLCTL_FLTREQ0I, FLCTL_FLENDI, FLCTL_FLSTEI } }, | 706 | FLCTL_FLTREQ1I, FLCTL_FLTREQ0I, FLCTL_FLENDI, FLCTL_FLSTEI } }, |
470 | { 0xa40800a0, 0xa40800e0, 8, /* IMR8 / IMCR8 */ | 707 | { 0xa40800a0, 0xa40800e0, 8, /* IMR8 / IMCR8 */ |
471 | { SDHI3, SDHI2, SDHI1, SDHI0, 0, 0, TWODG, SIU } }, | 708 | { DISABLED, DISABLED, ENABLED, ENABLED, 0, 0, TWODG, SIU } }, |
472 | { 0xa40800a4, 0xa40800e4, 8, /* IMR9 / IMCR9 */ | 709 | { 0xa40800a4, 0xa40800e4, 8, /* IMR9 / IMCR9 */ |
473 | { 0, 0, 0, CMT, 0, USB_USBI1, USB_USBI0, } }, | 710 | { 0, 0, 0, CMT, 0, USB_USBI1, USB_USBI0, } }, |
474 | { 0xa40800a8, 0xa40800e8, 8, /* IMR10 / IMCR10 */ | 711 | { 0xa40800a8, 0xa40800e8, 8, /* IMR10 / IMCR10 */ |
@@ -506,9 +743,13 @@ static struct intc_mask_reg ack_registers[] __initdata = { | |||
506 | { IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7 } }, | 743 | { IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7 } }, |
507 | }; | 744 | }; |
508 | 745 | ||
509 | static DECLARE_INTC_DESC_ACK(intc_desc, "sh7722", vectors, groups, | 746 | static struct intc_desc intc_desc __initdata = { |
510 | mask_registers, prio_registers, sense_registers, | 747 | .name = "sh7722", |
511 | ack_registers); | 748 | .force_enable = ENABLED, |
749 | .force_disable = DISABLED, | ||
750 | .hw = INTC_HW_DESC(vectors, groups, mask_registers, | ||
751 | prio_registers, sense_registers, ack_registers), | ||
752 | }; | ||
512 | 753 | ||
513 | void __init plat_irq_setup(void) | 754 | void __init plat_irq_setup(void) |
514 | { | 755 | { |