diff options
author | Tony Lindgren <tony@atomide.com> | 2010-05-20 14:37:23 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2010-05-20 14:37:23 -0400 |
commit | f6304f5804f228b6c2fea9e3dfac25c5b2db9b38 (patch) | |
tree | 362b9b6a3bd32b868e5917a32d448ac75c5854df /arch/arm/mach-s5p6440 | |
parent | 4fa73a1bf89ebea4eba8a9982b5f64d266d8b5e9 (diff) | |
parent | 6daa642d9b8ec762b3c5641cd5e5fa855a5405bf (diff) |
Merge branch 'omap4-i2c-init' into omap-for-linus
Diffstat (limited to 'arch/arm/mach-s5p6440')
-rw-r--r-- | arch/arm/mach-s5p6440/Kconfig | 1 | ||||
-rw-r--r-- | arch/arm/mach-s5p6440/Makefile | 6 | ||||
-rw-r--r-- | arch/arm/mach-s5p6440/clock.c | 350 | ||||
-rw-r--r-- | arch/arm/mach-s5p6440/cpu.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-s5p6440/dev-audio.c | 127 | ||||
-rw-r--r-- | arch/arm/mach-s5p6440/dma.c | 105 | ||||
-rw-r--r-- | arch/arm/mach-s5p6440/gpio.c | 5 | ||||
-rw-r--r-- | arch/arm/mach-s5p6440/include/mach/dma.h | 26 | ||||
-rw-r--r-- | arch/arm/mach-s5p6440/include/mach/map.h | 8 | ||||
-rw-r--r-- | arch/arm/mach-s5p6440/include/mach/pwm-clock.h | 24 | ||||
-rw-r--r-- | arch/arm/mach-s5p6440/mach-smdk6440.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-s5p6440/setup-i2c0.c | 25 |
12 files changed, 569 insertions, 111 deletions
diff --git a/arch/arm/mach-s5p6440/Kconfig b/arch/arm/mach-s5p6440/Kconfig index 4c29ff8b07d..77aeffd1733 100644 --- a/arch/arm/mach-s5p6440/Kconfig +++ b/arch/arm/mach-s5p6440/Kconfig | |||
@@ -9,6 +9,7 @@ if ARCH_S5P6440 | |||
9 | 9 | ||
10 | config CPU_S5P6440 | 10 | config CPU_S5P6440 |
11 | bool | 11 | bool |
12 | select S3C_PL330_DMA | ||
12 | help | 13 | help |
13 | Enable S5P6440 CPU support | 14 | Enable S5P6440 CPU support |
14 | 15 | ||
diff --git a/arch/arm/mach-s5p6440/Makefile b/arch/arm/mach-s5p6440/Makefile index 1ad894b1d3a..44facf43d59 100644 --- a/arch/arm/mach-s5p6440/Makefile +++ b/arch/arm/mach-s5p6440/Makefile | |||
@@ -12,8 +12,12 @@ obj- := | |||
12 | 12 | ||
13 | # Core support for S5P6440 system | 13 | # Core support for S5P6440 system |
14 | 14 | ||
15 | obj-$(CONFIG_CPU_S5P6440) += cpu.o init.o clock.o gpio.o | 15 | obj-$(CONFIG_CPU_S5P6440) += cpu.o init.o clock.o gpio.o dma.o |
16 | obj-$(CONFIG_CPU_S5P6440) += setup-i2c0.o | ||
16 | 17 | ||
17 | # machine support | 18 | # machine support |
18 | 19 | ||
19 | obj-$(CONFIG_MACH_SMDK6440) += mach-smdk6440.o | 20 | obj-$(CONFIG_MACH_SMDK6440) += mach-smdk6440.o |
21 | |||
22 | # device support | ||
23 | obj-y += dev-audio.o | ||
diff --git a/arch/arm/mach-s5p6440/clock.c b/arch/arm/mach-s5p6440/clock.c index b2672e16e7a..ca6e48dce77 100644 --- a/arch/arm/mach-s5p6440/clock.c +++ b/arch/arm/mach-s5p6440/clock.c | |||
@@ -134,24 +134,6 @@ static struct clksrc_clk clk_mout_mpll = { | |||
134 | .reg_src = { .reg = S5P_CLK_SRC0, .shift = 1, .size = 1 }, | 134 | .reg_src = { .reg = S5P_CLK_SRC0, .shift = 1, .size = 1 }, |
135 | }; | 135 | }; |
136 | 136 | ||
137 | static struct clk clk_h_low = { | ||
138 | .name = "hclk_low", | ||
139 | .id = -1, | ||
140 | .rate = 0, | ||
141 | .parent = NULL, | ||
142 | .ctrlbit = 0, | ||
143 | .ops = &clk_ops_def_setrate, | ||
144 | }; | ||
145 | |||
146 | static struct clk clk_p_low = { | ||
147 | .name = "pclk_low", | ||
148 | .id = -1, | ||
149 | .rate = 0, | ||
150 | .parent = NULL, | ||
151 | .ctrlbit = 0, | ||
152 | .ops = &clk_ops_def_setrate, | ||
153 | }; | ||
154 | |||
155 | enum perf_level { | 137 | enum perf_level { |
156 | L0 = 532*1000, | 138 | L0 = 532*1000, |
157 | L1 = 266*1000, | 139 | L1 = 266*1000, |
@@ -247,23 +229,70 @@ static struct clk_ops s5p6440_clkarm_ops = { | |||
247 | .round_rate = s5p6440_armclk_round_rate, | 229 | .round_rate = s5p6440_armclk_round_rate, |
248 | }; | 230 | }; |
249 | 231 | ||
250 | static unsigned long s5p6440_clk_doutmpll_get_rate(struct clk *clk) | 232 | static struct clksrc_clk clk_armclk = { |
251 | { | 233 | .clk = { |
252 | unsigned long rate = clk_get_rate(clk->parent); | 234 | .name = "armclk", |
235 | .id = 1, | ||
236 | .parent = &clk_mout_apll.clk, | ||
237 | .ops = &s5p6440_clkarm_ops, | ||
238 | }, | ||
239 | .reg_div = { .reg = S5P_CLK_DIV0, .shift = 0, .size = 4 }, | ||
240 | }; | ||
253 | 241 | ||
254 | if (__raw_readl(S5P_CLK_DIV0) & S5P_CLKDIV0_MPLL_MASK) | 242 | static struct clksrc_clk clk_dout_mpll = { |
255 | rate /= 2; | 243 | .clk = { |
244 | .name = "dout_mpll", | ||
245 | .id = -1, | ||
246 | .parent = &clk_mout_mpll.clk, | ||
247 | }, | ||
248 | .reg_div = { .reg = S5P_CLK_DIV0, .shift = 4, .size = 1 }, | ||
249 | }; | ||
256 | 250 | ||
257 | return rate; | 251 | static struct clksrc_clk clk_hclk = { |
258 | } | 252 | .clk = { |
253 | .name = "clk_hclk", | ||
254 | .id = -1, | ||
255 | .parent = &clk_armclk.clk, | ||
256 | }, | ||
257 | .reg_div = { .reg = S5P_CLK_DIV0, .shift = 8, .size = 4 }, | ||
258 | }; | ||
259 | 259 | ||
260 | static struct clk clk_dout_mpll = { | 260 | static struct clksrc_clk clk_pclk = { |
261 | .name = "dout_mpll", | 261 | .clk = { |
262 | .id = -1, | 262 | .name = "clk_pclk", |
263 | .parent = &clk_mout_mpll.clk, | 263 | .id = -1, |
264 | .ops = &(struct clk_ops) { | 264 | .parent = &clk_hclk.clk, |
265 | .get_rate = s5p6440_clk_doutmpll_get_rate, | ||
266 | }, | 265 | }, |
266 | .reg_div = { .reg = S5P_CLK_DIV0, .shift = 12, .size = 4 }, | ||
267 | }; | ||
268 | |||
269 | static struct clk *clkset_hclklow_list[] = { | ||
270 | &clk_mout_apll.clk, | ||
271 | &clk_mout_mpll.clk, | ||
272 | }; | ||
273 | |||
274 | static struct clksrc_sources clkset_hclklow = { | ||
275 | .sources = clkset_hclklow_list, | ||
276 | .nr_sources = ARRAY_SIZE(clkset_hclklow_list), | ||
277 | }; | ||
278 | |||
279 | static struct clksrc_clk clk_hclk_low = { | ||
280 | .clk = { | ||
281 | .name = "hclk_low", | ||
282 | .id = -1, | ||
283 | }, | ||
284 | .sources = &clkset_hclklow, | ||
285 | .reg_src = { .reg = S5P_SYS_OTHERS, .shift = 6, .size = 1 }, | ||
286 | .reg_div = { .reg = S5P_CLK_DIV3, .shift = 8, .size = 4 }, | ||
287 | }; | ||
288 | |||
289 | static struct clksrc_clk clk_pclk_low = { | ||
290 | .clk = { | ||
291 | .name = "pclk_low", | ||
292 | .id = -1, | ||
293 | .parent = &clk_hclk_low.clk, | ||
294 | }, | ||
295 | .reg_div = { .reg = S5P_CLK_DIV3, .shift = 12, .size = 4 }, | ||
267 | }; | 296 | }; |
268 | 297 | ||
269 | int s5p6440_clk48m_ctrl(struct clk *clk, int enable) | 298 | int s5p6440_clk48m_ctrl(struct clk *clk, int enable) |
@@ -307,6 +336,11 @@ static int s5p6440_sclk_ctrl(struct clk *clk, int enable) | |||
307 | return s5p_gatectrl(S5P_CLK_GATE_SCLK0, clk, enable); | 336 | return s5p_gatectrl(S5P_CLK_GATE_SCLK0, clk, enable); |
308 | } | 337 | } |
309 | 338 | ||
339 | static int s5p6440_sclk1_ctrl(struct clk *clk, int enable) | ||
340 | { | ||
341 | return s5p_gatectrl(S5P_CLK_GATE_SCLK1, clk, enable); | ||
342 | } | ||
343 | |||
310 | static int s5p6440_mem_ctrl(struct clk *clk, int enable) | 344 | static int s5p6440_mem_ctrl(struct clk *clk, int enable) |
311 | { | 345 | { |
312 | return s5p_gatectrl(S5P_CLK_GATE_MEM0, clk, enable); | 346 | return s5p_gatectrl(S5P_CLK_GATE_MEM0, clk, enable); |
@@ -321,37 +355,37 @@ static struct clk init_clocks_disable[] = { | |||
321 | { | 355 | { |
322 | .name = "nand", | 356 | .name = "nand", |
323 | .id = -1, | 357 | .id = -1, |
324 | .parent = &clk_h, | 358 | .parent = &clk_hclk.clk, |
325 | .enable = s5p6440_mem_ctrl, | 359 | .enable = s5p6440_mem_ctrl, |
326 | .ctrlbit = S5P_CLKCON_MEM0_HCLK_NFCON, | 360 | .ctrlbit = S5P_CLKCON_MEM0_HCLK_NFCON, |
327 | }, { | 361 | }, { |
328 | .name = "adc", | 362 | .name = "adc", |
329 | .id = -1, | 363 | .id = -1, |
330 | .parent = &clk_p_low, | 364 | .parent = &clk_pclk_low.clk, |
331 | .enable = s5p6440_pclk_ctrl, | 365 | .enable = s5p6440_pclk_ctrl, |
332 | .ctrlbit = S5P_CLKCON_PCLK_TSADC, | 366 | .ctrlbit = S5P_CLKCON_PCLK_TSADC, |
333 | }, { | 367 | }, { |
334 | .name = "i2c", | 368 | .name = "i2c", |
335 | .id = -1, | 369 | .id = -1, |
336 | .parent = &clk_p_low, | 370 | .parent = &clk_pclk_low.clk, |
337 | .enable = s5p6440_pclk_ctrl, | 371 | .enable = s5p6440_pclk_ctrl, |
338 | .ctrlbit = S5P_CLKCON_PCLK_IIC0, | 372 | .ctrlbit = S5P_CLKCON_PCLK_IIC0, |
339 | }, { | 373 | }, { |
340 | .name = "i2s_v40", | 374 | .name = "i2s_v40", |
341 | .id = 0, | 375 | .id = 0, |
342 | .parent = &clk_p_low, | 376 | .parent = &clk_pclk_low.clk, |
343 | .enable = s5p6440_pclk_ctrl, | 377 | .enable = s5p6440_pclk_ctrl, |
344 | .ctrlbit = S5P_CLKCON_PCLK_IIS2, | 378 | .ctrlbit = S5P_CLKCON_PCLK_IIS2, |
345 | }, { | 379 | }, { |
346 | .name = "spi", | 380 | .name = "spi", |
347 | .id = 0, | 381 | .id = 0, |
348 | .parent = &clk_p_low, | 382 | .parent = &clk_pclk_low.clk, |
349 | .enable = s5p6440_pclk_ctrl, | 383 | .enable = s5p6440_pclk_ctrl, |
350 | .ctrlbit = S5P_CLKCON_PCLK_SPI0, | 384 | .ctrlbit = S5P_CLKCON_PCLK_SPI0, |
351 | }, { | 385 | }, { |
352 | .name = "spi", | 386 | .name = "spi", |
353 | .id = 1, | 387 | .id = 1, |
354 | .parent = &clk_p_low, | 388 | .parent = &clk_pclk_low.clk, |
355 | .enable = s5p6440_pclk_ctrl, | 389 | .enable = s5p6440_pclk_ctrl, |
356 | .ctrlbit = S5P_CLKCON_PCLK_SPI1, | 390 | .ctrlbit = S5P_CLKCON_PCLK_SPI1, |
357 | }, { | 391 | }, { |
@@ -387,58 +421,124 @@ static struct clk init_clocks_disable[] = { | |||
387 | }, { | 421 | }, { |
388 | .name = "otg", | 422 | .name = "otg", |
389 | .id = -1, | 423 | .id = -1, |
390 | .parent = &clk_h_low, | 424 | .parent = &clk_hclk_low.clk, |
391 | .enable = s5p6440_hclk0_ctrl, | 425 | .enable = s5p6440_hclk0_ctrl, |
392 | .ctrlbit = S5P_CLKCON_HCLK0_USB | 426 | .ctrlbit = S5P_CLKCON_HCLK0_USB |
393 | }, { | 427 | }, { |
394 | .name = "post", | 428 | .name = "post", |
395 | .id = -1, | 429 | .id = -1, |
396 | .parent = &clk_h_low, | 430 | .parent = &clk_hclk_low.clk, |
397 | .enable = s5p6440_hclk0_ctrl, | 431 | .enable = s5p6440_hclk0_ctrl, |
398 | .ctrlbit = S5P_CLKCON_HCLK0_POST0 | 432 | .ctrlbit = S5P_CLKCON_HCLK0_POST0 |
399 | }, { | 433 | }, { |
400 | .name = "lcd", | 434 | .name = "lcd", |
401 | .id = -1, | 435 | .id = -1, |
402 | .parent = &clk_h_low, | 436 | .parent = &clk_hclk_low.clk, |
403 | .enable = s5p6440_hclk1_ctrl, | 437 | .enable = s5p6440_hclk1_ctrl, |
404 | .ctrlbit = S5P_CLKCON_HCLK1_DISPCON, | 438 | .ctrlbit = S5P_CLKCON_HCLK1_DISPCON, |
405 | }, { | 439 | }, { |
406 | .name = "hsmmc", | 440 | .name = "hsmmc", |
407 | .id = 0, | 441 | .id = 0, |
408 | .parent = &clk_h_low, | 442 | .parent = &clk_hclk_low.clk, |
409 | .enable = s5p6440_hclk0_ctrl, | 443 | .enable = s5p6440_hclk0_ctrl, |
410 | .ctrlbit = S5P_CLKCON_HCLK0_HSMMC0, | 444 | .ctrlbit = S5P_CLKCON_HCLK0_HSMMC0, |
411 | }, { | 445 | }, { |
412 | .name = "hsmmc", | 446 | .name = "hsmmc", |
413 | .id = 1, | 447 | .id = 1, |
414 | .parent = &clk_h_low, | 448 | .parent = &clk_hclk_low.clk, |
415 | .enable = s5p6440_hclk0_ctrl, | 449 | .enable = s5p6440_hclk0_ctrl, |
416 | .ctrlbit = S5P_CLKCON_HCLK0_HSMMC1, | 450 | .ctrlbit = S5P_CLKCON_HCLK0_HSMMC1, |
417 | }, { | 451 | }, { |
418 | .name = "hsmmc", | 452 | .name = "hsmmc", |
419 | .id = 2, | 453 | .id = 2, |
420 | .parent = &clk_h_low, | 454 | .parent = &clk_hclk_low.clk, |
421 | .enable = s5p6440_hclk0_ctrl, | 455 | .enable = s5p6440_hclk0_ctrl, |
422 | .ctrlbit = S5P_CLKCON_HCLK0_HSMMC2, | 456 | .ctrlbit = S5P_CLKCON_HCLK0_HSMMC2, |
423 | }, { | 457 | }, { |
424 | .name = "rtc", | 458 | .name = "rtc", |
425 | .id = -1, | 459 | .id = -1, |
426 | .parent = &clk_p_low, | 460 | .parent = &clk_pclk_low.clk, |
427 | .enable = s5p6440_pclk_ctrl, | 461 | .enable = s5p6440_pclk_ctrl, |
428 | .ctrlbit = S5P_CLKCON_PCLK_RTC, | 462 | .ctrlbit = S5P_CLKCON_PCLK_RTC, |
429 | }, { | 463 | }, { |
430 | .name = "watchdog", | 464 | .name = "watchdog", |
431 | .id = -1, | 465 | .id = -1, |
432 | .parent = &clk_p_low, | 466 | .parent = &clk_pclk_low.clk, |
433 | .enable = s5p6440_pclk_ctrl, | 467 | .enable = s5p6440_pclk_ctrl, |
434 | .ctrlbit = S5P_CLKCON_PCLK_WDT, | 468 | .ctrlbit = S5P_CLKCON_PCLK_WDT, |
435 | }, { | 469 | }, { |
436 | .name = "timers", | 470 | .name = "timers", |
437 | .id = -1, | 471 | .id = -1, |
438 | .parent = &clk_p_low, | 472 | .parent = &clk_pclk_low.clk, |
439 | .enable = s5p6440_pclk_ctrl, | 473 | .enable = s5p6440_pclk_ctrl, |
440 | .ctrlbit = S5P_CLKCON_PCLK_PWM, | 474 | .ctrlbit = S5P_CLKCON_PCLK_PWM, |
441 | } | 475 | }, { |
476 | .name = "hclk_fimgvg", | ||
477 | .id = -1, | ||
478 | .parent = &clk_hclk.clk, | ||
479 | .enable = s5p6440_hclk1_ctrl, | ||
480 | .ctrlbit = (1 << 2), | ||
481 | }, { | ||
482 | .name = "tsi", | ||
483 | .id = -1, | ||
484 | .parent = &clk_hclk_low.clk, | ||
485 | .enable = s5p6440_hclk1_ctrl, | ||
486 | .ctrlbit = (1 << 0), | ||
487 | }, { | ||
488 | .name = "pclk_fimgvg", | ||
489 | .id = -1, | ||
490 | .parent = &clk_pclk.clk, | ||
491 | .enable = s5p6440_pclk_ctrl, | ||
492 | .ctrlbit = (1 << 31), | ||
493 | }, { | ||
494 | .name = "dmc0", | ||
495 | .id = -1, | ||
496 | .parent = &clk_pclk.clk, | ||
497 | .enable = s5p6440_pclk_ctrl, | ||
498 | .ctrlbit = (1 << 30), | ||
499 | }, { | ||
500 | .name = "etm", | ||
501 | .id = -1, | ||
502 | .parent = &clk_pclk.clk, | ||
503 | .enable = s5p6440_pclk_ctrl, | ||
504 | .ctrlbit = (1 << 29), | ||
505 | }, { | ||
506 | .name = "dsim", | ||
507 | .id = -1, | ||
508 | .parent = &clk_pclk_low.clk, | ||
509 | .enable = s5p6440_pclk_ctrl, | ||
510 | .ctrlbit = (1 << 28), | ||
511 | }, { | ||
512 | .name = "gps", | ||
513 | .id = -1, | ||
514 | .parent = &clk_pclk_low.clk, | ||
515 | .enable = s5p6440_pclk_ctrl, | ||
516 | .ctrlbit = (1 << 25), | ||
517 | }, { | ||
518 | .name = "pcm", | ||
519 | .id = -1, | ||
520 | .parent = &clk_pclk_low.clk, | ||
521 | .enable = s5p6440_pclk_ctrl, | ||
522 | .ctrlbit = (1 << 8), | ||
523 | }, { | ||
524 | .name = "irom", | ||
525 | .id = -1, | ||
526 | .parent = &clk_hclk.clk, | ||
527 | .enable = s5p6440_hclk0_ctrl, | ||
528 | .ctrlbit = (1 << 25), | ||
529 | }, { | ||
530 | .name = "dma", | ||
531 | .id = -1, | ||
532 | .parent = &clk_hclk_low.clk, | ||
533 | .enable = s5p6440_hclk0_ctrl, | ||
534 | .ctrlbit = (1 << 12), | ||
535 | }, { | ||
536 | .name = "2d", | ||
537 | .id = -1, | ||
538 | .parent = &clk_hclk.clk, | ||
539 | .enable = s5p6440_hclk0_ctrl, | ||
540 | .ctrlbit = (1 << 8), | ||
541 | }, | ||
442 | }; | 542 | }; |
443 | 543 | ||
444 | /* | 544 | /* |
@@ -448,34 +548,46 @@ static struct clk init_clocks[] = { | |||
448 | { | 548 | { |
449 | .name = "gpio", | 549 | .name = "gpio", |
450 | .id = -1, | 550 | .id = -1, |
451 | .parent = &clk_p_low, | 551 | .parent = &clk_pclk_low.clk, |
452 | .enable = s5p6440_pclk_ctrl, | 552 | .enable = s5p6440_pclk_ctrl, |
453 | .ctrlbit = S5P_CLKCON_PCLK_GPIO, | 553 | .ctrlbit = S5P_CLKCON_PCLK_GPIO, |
454 | }, { | 554 | }, { |
455 | .name = "uart", | 555 | .name = "uart", |
456 | .id = 0, | 556 | .id = 0, |
457 | .parent = &clk_p_low, | 557 | .parent = &clk_pclk_low.clk, |
458 | .enable = s5p6440_pclk_ctrl, | 558 | .enable = s5p6440_pclk_ctrl, |
459 | .ctrlbit = S5P_CLKCON_PCLK_UART0, | 559 | .ctrlbit = S5P_CLKCON_PCLK_UART0, |
460 | }, { | 560 | }, { |
461 | .name = "uart", | 561 | .name = "uart", |
462 | .id = 1, | 562 | .id = 1, |
463 | .parent = &clk_p_low, | 563 | .parent = &clk_pclk_low.clk, |
464 | .enable = s5p6440_pclk_ctrl, | 564 | .enable = s5p6440_pclk_ctrl, |
465 | .ctrlbit = S5P_CLKCON_PCLK_UART1, | 565 | .ctrlbit = S5P_CLKCON_PCLK_UART1, |
466 | }, { | 566 | }, { |
467 | .name = "uart", | 567 | .name = "uart", |
468 | .id = 2, | 568 | .id = 2, |
469 | .parent = &clk_p_low, | 569 | .parent = &clk_pclk_low.clk, |
470 | .enable = s5p6440_pclk_ctrl, | 570 | .enable = s5p6440_pclk_ctrl, |
471 | .ctrlbit = S5P_CLKCON_PCLK_UART2, | 571 | .ctrlbit = S5P_CLKCON_PCLK_UART2, |
472 | }, { | 572 | }, { |
473 | .name = "uart", | 573 | .name = "uart", |
474 | .id = 3, | 574 | .id = 3, |
475 | .parent = &clk_p_low, | 575 | .parent = &clk_pclk_low.clk, |
476 | .enable = s5p6440_pclk_ctrl, | 576 | .enable = s5p6440_pclk_ctrl, |
477 | .ctrlbit = S5P_CLKCON_PCLK_UART3, | 577 | .ctrlbit = S5P_CLKCON_PCLK_UART3, |
478 | } | 578 | }, { |
579 | .name = "mem", | ||
580 | .id = -1, | ||
581 | .parent = &clk_hclk.clk, | ||
582 | .enable = s5p6440_hclk0_ctrl, | ||
583 | .ctrlbit = (1 << 21), | ||
584 | }, { | ||
585 | .name = "intc", | ||
586 | .id = -1, | ||
587 | .parent = &clk_hclk.clk, | ||
588 | .enable = s5p6440_hclk0_ctrl, | ||
589 | .ctrlbit = (1 << 1), | ||
590 | }, | ||
479 | }; | 591 | }; |
480 | 592 | ||
481 | static struct clk clk_iis_cd_v40 = { | 593 | static struct clk clk_iis_cd_v40 = { |
@@ -488,20 +600,20 @@ static struct clk clk_pcm_cd = { | |||
488 | .id = -1, | 600 | .id = -1, |
489 | }; | 601 | }; |
490 | 602 | ||
491 | static struct clk *clkset_spi_mmc_list[] = { | 603 | static struct clk *clkset_group1_list[] = { |
492 | &clk_mout_epll.clk, | 604 | &clk_mout_epll.clk, |
493 | &clk_dout_mpll, | 605 | &clk_dout_mpll.clk, |
494 | &clk_fin_epll, | 606 | &clk_fin_epll, |
495 | }; | 607 | }; |
496 | 608 | ||
497 | static struct clksrc_sources clkset_spi_mmc = { | 609 | static struct clksrc_sources clkset_group1 = { |
498 | .sources = clkset_spi_mmc_list, | 610 | .sources = clkset_group1_list, |
499 | .nr_sources = ARRAY_SIZE(clkset_spi_mmc_list), | 611 | .nr_sources = ARRAY_SIZE(clkset_group1_list), |
500 | }; | 612 | }; |
501 | 613 | ||
502 | static struct clk *clkset_uart_list[] = { | 614 | static struct clk *clkset_uart_list[] = { |
503 | &clk_mout_epll.clk, | 615 | &clk_mout_epll.clk, |
504 | &clk_dout_mpll | 616 | &clk_dout_mpll.clk, |
505 | }; | 617 | }; |
506 | 618 | ||
507 | static struct clksrc_sources clkset_uart = { | 619 | static struct clksrc_sources clkset_uart = { |
@@ -509,6 +621,19 @@ static struct clksrc_sources clkset_uart = { | |||
509 | .nr_sources = ARRAY_SIZE(clkset_uart_list), | 621 | .nr_sources = ARRAY_SIZE(clkset_uart_list), |
510 | }; | 622 | }; |
511 | 623 | ||
624 | static struct clk *clkset_audio_list[] = { | ||
625 | &clk_mout_epll.clk, | ||
626 | &clk_dout_mpll.clk, | ||
627 | &clk_fin_epll, | ||
628 | &clk_iis_cd_v40, | ||
629 | &clk_pcm_cd, | ||
630 | }; | ||
631 | |||
632 | static struct clksrc_sources clkset_audio = { | ||
633 | .sources = clkset_audio_list, | ||
634 | .nr_sources = ARRAY_SIZE(clkset_audio_list), | ||
635 | }; | ||
636 | |||
512 | static struct clksrc_clk clksrcs[] = { | 637 | static struct clksrc_clk clksrcs[] = { |
513 | { | 638 | { |
514 | .clk = { | 639 | .clk = { |
@@ -517,7 +642,7 @@ static struct clksrc_clk clksrcs[] = { | |||
517 | .ctrlbit = S5P_CLKCON_SCLK0_MMC0, | 642 | .ctrlbit = S5P_CLKCON_SCLK0_MMC0, |
518 | .enable = s5p6440_sclk_ctrl, | 643 | .enable = s5p6440_sclk_ctrl, |
519 | }, | 644 | }, |
520 | .sources = &clkset_spi_mmc, | 645 | .sources = &clkset_group1, |
521 | .reg_src = { .reg = S5P_CLK_SRC0, .shift = 18, .size = 2 }, | 646 | .reg_src = { .reg = S5P_CLK_SRC0, .shift = 18, .size = 2 }, |
522 | .reg_div = { .reg = S5P_CLK_DIV1, .shift = 0, .size = 4 }, | 647 | .reg_div = { .reg = S5P_CLK_DIV1, .shift = 0, .size = 4 }, |
523 | }, { | 648 | }, { |
@@ -527,7 +652,7 @@ static struct clksrc_clk clksrcs[] = { | |||
527 | .ctrlbit = S5P_CLKCON_SCLK0_MMC1, | 652 | .ctrlbit = S5P_CLKCON_SCLK0_MMC1, |
528 | .enable = s5p6440_sclk_ctrl, | 653 | .enable = s5p6440_sclk_ctrl, |
529 | }, | 654 | }, |
530 | .sources = &clkset_spi_mmc, | 655 | .sources = &clkset_group1, |
531 | .reg_src = { .reg = S5P_CLK_SRC0, .shift = 20, .size = 2 }, | 656 | .reg_src = { .reg = S5P_CLK_SRC0, .shift = 20, .size = 2 }, |
532 | .reg_div = { .reg = S5P_CLK_DIV1, .shift = 4, .size = 4 }, | 657 | .reg_div = { .reg = S5P_CLK_DIV1, .shift = 4, .size = 4 }, |
533 | }, { | 658 | }, { |
@@ -537,7 +662,7 @@ static struct clksrc_clk clksrcs[] = { | |||
537 | .ctrlbit = S5P_CLKCON_SCLK0_MMC2, | 662 | .ctrlbit = S5P_CLKCON_SCLK0_MMC2, |
538 | .enable = s5p6440_sclk_ctrl, | 663 | .enable = s5p6440_sclk_ctrl, |
539 | }, | 664 | }, |
540 | .sources = &clkset_spi_mmc, | 665 | .sources = &clkset_group1, |
541 | .reg_src = { .reg = S5P_CLK_SRC0, .shift = 22, .size = 2 }, | 666 | .reg_src = { .reg = S5P_CLK_SRC0, .shift = 22, .size = 2 }, |
542 | .reg_div = { .reg = S5P_CLK_DIV1, .shift = 8, .size = 4 }, | 667 | .reg_div = { .reg = S5P_CLK_DIV1, .shift = 8, .size = 4 }, |
543 | }, { | 668 | }, { |
@@ -557,7 +682,7 @@ static struct clksrc_clk clksrcs[] = { | |||
557 | .ctrlbit = S5P_CLKCON_SCLK0_SPI0, | 682 | .ctrlbit = S5P_CLKCON_SCLK0_SPI0, |
558 | .enable = s5p6440_sclk_ctrl, | 683 | .enable = s5p6440_sclk_ctrl, |
559 | }, | 684 | }, |
560 | .sources = &clkset_spi_mmc, | 685 | .sources = &clkset_group1, |
561 | .reg_src = { .reg = S5P_CLK_SRC0, .shift = 14, .size = 2 }, | 686 | .reg_src = { .reg = S5P_CLK_SRC0, .shift = 14, .size = 2 }, |
562 | .reg_div = { .reg = S5P_CLK_DIV2, .shift = 0, .size = 4 }, | 687 | .reg_div = { .reg = S5P_CLK_DIV2, .shift = 0, .size = 4 }, |
563 | }, { | 688 | }, { |
@@ -567,17 +692,63 @@ static struct clksrc_clk clksrcs[] = { | |||
567 | .ctrlbit = S5P_CLKCON_SCLK0_SPI1, | 692 | .ctrlbit = S5P_CLKCON_SCLK0_SPI1, |
568 | .enable = s5p6440_sclk_ctrl, | 693 | .enable = s5p6440_sclk_ctrl, |
569 | }, | 694 | }, |
570 | .sources = &clkset_spi_mmc, | 695 | .sources = &clkset_group1, |
571 | .reg_src = { .reg = S5P_CLK_SRC0, .shift = 16, .size = 2 }, | 696 | .reg_src = { .reg = S5P_CLK_SRC0, .shift = 16, .size = 2 }, |
572 | .reg_div = { .reg = S5P_CLK_DIV2, .shift = 4, .size = 4 }, | 697 | .reg_div = { .reg = S5P_CLK_DIV2, .shift = 4, .size = 4 }, |
573 | } | 698 | }, { |
699 | .clk = { | ||
700 | .name = "sclk_post", | ||
701 | .id = -1, | ||
702 | .ctrlbit = (1 << 10), | ||
703 | .enable = s5p6440_sclk_ctrl, | ||
704 | }, | ||
705 | .sources = &clkset_group1, | ||
706 | .reg_src = { .reg = S5P_CLK_SRC0, .shift = 26, .size = 2 }, | ||
707 | .reg_div = { .reg = S5P_CLK_DIV1, .shift = 12, .size = 4 }, | ||
708 | }, { | ||
709 | .clk = { | ||
710 | .name = "sclk_dispcon", | ||
711 | .id = -1, | ||
712 | .ctrlbit = (1 << 1), | ||
713 | .enable = s5p6440_sclk1_ctrl, | ||
714 | }, | ||
715 | .sources = &clkset_group1, | ||
716 | .reg_src = { .reg = S5P_CLK_SRC1, .shift = 4, .size = 2 }, | ||
717 | .reg_div = { .reg = S5P_CLK_DIV3, .shift = 0, .size = 4 }, | ||
718 | }, { | ||
719 | .clk = { | ||
720 | .name = "sclk_fimgvg", | ||
721 | .id = -1, | ||
722 | .ctrlbit = (1 << 2), | ||
723 | .enable = s5p6440_sclk1_ctrl, | ||
724 | }, | ||
725 | .sources = &clkset_group1, | ||
726 | .reg_src = { .reg = S5P_CLK_SRC1, .shift = 8, .size = 2 }, | ||
727 | .reg_div = { .reg = S5P_CLK_DIV3, .shift = 4, .size = 4 }, | ||
728 | }, { | ||
729 | .clk = { | ||
730 | .name = "sclk_audio2", | ||
731 | .id = -1, | ||
732 | .ctrlbit = (1 << 11), | ||
733 | .enable = s5p6440_sclk_ctrl, | ||
734 | }, | ||
735 | .sources = &clkset_audio, | ||
736 | .reg_src = { .reg = S5P_CLK_SRC1, .shift = 0, .size = 3 }, | ||
737 | .reg_div = { .reg = S5P_CLK_DIV2, .shift = 24, .size = 4 }, | ||
738 | }, | ||
574 | }; | 739 | }; |
575 | 740 | ||
576 | /* Clock initialisation code */ | 741 | /* Clock initialisation code */ |
577 | static struct clksrc_clk *init_parents[] = { | 742 | static struct clksrc_clk *sysclks[] = { |
578 | &clk_mout_apll, | 743 | &clk_mout_apll, |
579 | &clk_mout_epll, | 744 | &clk_mout_epll, |
580 | &clk_mout_mpll, | 745 | &clk_mout_mpll, |
746 | &clk_dout_mpll, | ||
747 | &clk_armclk, | ||
748 | &clk_hclk, | ||
749 | &clk_pclk, | ||
750 | &clk_hclk_low, | ||
751 | &clk_pclk_low, | ||
581 | }; | 752 | }; |
582 | 753 | ||
583 | void __init_or_cpufreq s5p6440_setup_clocks(void) | 754 | void __init_or_cpufreq s5p6440_setup_clocks(void) |
@@ -593,21 +764,13 @@ void __init_or_cpufreq s5p6440_setup_clocks(void) | |||
593 | unsigned long apll; | 764 | unsigned long apll; |
594 | unsigned long mpll; | 765 | unsigned long mpll; |
595 | unsigned int ptr; | 766 | unsigned int ptr; |
596 | u32 clkdiv0; | ||
597 | u32 clkdiv3; | ||
598 | 767 | ||
599 | /* Set S5P6440 functions for clk_fout_epll */ | 768 | /* Set S5P6440 functions for clk_fout_epll */ |
600 | clk_fout_epll.enable = s5p6440_epll_enable; | 769 | clk_fout_epll.enable = s5p6440_epll_enable; |
601 | clk_fout_epll.ops = &s5p6440_epll_ops; | 770 | clk_fout_epll.ops = &s5p6440_epll_ops; |
602 | 771 | ||
603 | /* Set S5P6440 functions for arm clock */ | ||
604 | clk_arm.parent = &clk_mout_apll.clk; | ||
605 | clk_arm.ops = &s5p6440_clkarm_ops; | ||
606 | clk_48m.enable = s5p6440_clk48m_ctrl; | 772 | clk_48m.enable = s5p6440_clk48m_ctrl; |
607 | 773 | ||
608 | clkdiv0 = __raw_readl(S5P_CLK_DIV0); | ||
609 | clkdiv3 = __raw_readl(S5P_CLK_DIV3); | ||
610 | |||
611 | xtal_clk = clk_get(NULL, "ext_xtal"); | 774 | xtal_clk = clk_get(NULL, "ext_xtal"); |
612 | BUG_ON(IS_ERR(xtal_clk)); | 775 | BUG_ON(IS_ERR(xtal_clk)); |
613 | 776 | ||
@@ -619,41 +782,28 @@ void __init_or_cpufreq s5p6440_setup_clocks(void) | |||
619 | mpll = s5p_get_pll45xx(xtal, __raw_readl(S5P_MPLL_CON), pll_4502); | 782 | mpll = s5p_get_pll45xx(xtal, __raw_readl(S5P_MPLL_CON), pll_4502); |
620 | apll = s5p_get_pll45xx(xtal, __raw_readl(S5P_APLL_CON), pll_4502); | 783 | apll = s5p_get_pll45xx(xtal, __raw_readl(S5P_APLL_CON), pll_4502); |
621 | 784 | ||
785 | clk_fout_mpll.rate = mpll; | ||
786 | clk_fout_epll.rate = epll; | ||
787 | clk_fout_apll.rate = apll; | ||
788 | |||
622 | printk(KERN_INFO "S5P6440: PLL settings, A=%ld.%ldMHz, M=%ld.%ldMHz," \ | 789 | printk(KERN_INFO "S5P6440: PLL settings, A=%ld.%ldMHz, M=%ld.%ldMHz," \ |
623 | " E=%ld.%ldMHz\n", | 790 | " E=%ld.%ldMHz\n", |
624 | print_mhz(apll), print_mhz(mpll), print_mhz(epll)); | 791 | print_mhz(apll), print_mhz(mpll), print_mhz(epll)); |
625 | 792 | ||
626 | fclk = apll / GET_DIV(clkdiv0, S5P_CLKDIV0_ARM); | 793 | fclk = clk_get_rate(&clk_armclk.clk); |
627 | hclk = fclk / GET_DIV(clkdiv0, S5P_CLKDIV0_HCLK); | 794 | hclk = clk_get_rate(&clk_hclk.clk); |
628 | pclk = hclk / GET_DIV(clkdiv0, S5P_CLKDIV0_PCLK); | 795 | pclk = clk_get_rate(&clk_pclk.clk); |
629 | 796 | hclk_low = clk_get_rate(&clk_hclk_low.clk); | |
630 | if (__raw_readl(S5P_OTHERS) & S5P_OTHERS_HCLK_LOW_SEL_MPLL) { | 797 | pclk_low = clk_get_rate(&clk_pclk_low.clk); |
631 | /* Asynchronous mode */ | ||
632 | hclk_low = mpll / GET_DIV(clkdiv3, S5P_CLKDIV3_HCLK_LOW); | ||
633 | } else { | ||
634 | /* Synchronous mode */ | ||
635 | hclk_low = apll / GET_DIV(clkdiv3, S5P_CLKDIV3_HCLK_LOW); | ||
636 | } | ||
637 | |||
638 | pclk_low = hclk_low / GET_DIV(clkdiv3, S5P_CLKDIV3_PCLK_LOW); | ||
639 | 798 | ||
640 | printk(KERN_INFO "S5P6440: HCLK=%ld.%ldMHz, HCLK_LOW=%ld.%ldMHz," \ | 799 | printk(KERN_INFO "S5P6440: HCLK=%ld.%ldMHz, HCLK_LOW=%ld.%ldMHz," \ |
641 | " PCLK=%ld.%ldMHz, PCLK_LOW=%ld.%ldMHz\n", | 800 | " PCLK=%ld.%ldMHz, PCLK_LOW=%ld.%ldMHz\n", |
642 | print_mhz(hclk), print_mhz(hclk_low), | 801 | print_mhz(hclk), print_mhz(hclk_low), |
643 | print_mhz(pclk), print_mhz(pclk_low)); | 802 | print_mhz(pclk), print_mhz(pclk_low)); |
644 | 803 | ||
645 | clk_fout_mpll.rate = mpll; | ||
646 | clk_fout_epll.rate = epll; | ||
647 | clk_fout_apll.rate = apll; | ||
648 | |||
649 | clk_f.rate = fclk; | 804 | clk_f.rate = fclk; |
650 | clk_h.rate = hclk; | 805 | clk_h.rate = hclk; |
651 | clk_p.rate = pclk; | 806 | clk_p.rate = pclk; |
652 | clk_h_low.rate = hclk_low; | ||
653 | clk_p_low.rate = pclk_low; | ||
654 | |||
655 | for (ptr = 0; ptr < ARRAY_SIZE(init_parents); ptr++) | ||
656 | s3c_set_clksrc(init_parents[ptr], true); | ||
657 | 807 | ||
658 | for (ptr = 0; ptr < ARRAY_SIZE(clksrcs); ptr++) | 808 | for (ptr = 0; ptr < ARRAY_SIZE(clksrcs); ptr++) |
659 | s3c_set_clksrc(&clksrcs[ptr], true); | 809 | s3c_set_clksrc(&clksrcs[ptr], true); |
@@ -661,13 +811,8 @@ void __init_or_cpufreq s5p6440_setup_clocks(void) | |||
661 | 811 | ||
662 | static struct clk *clks[] __initdata = { | 812 | static struct clk *clks[] __initdata = { |
663 | &clk_ext, | 813 | &clk_ext, |
664 | &clk_mout_epll.clk, | ||
665 | &clk_mout_mpll.clk, | ||
666 | &clk_dout_mpll, | ||
667 | &clk_iis_cd_v40, | 814 | &clk_iis_cd_v40, |
668 | &clk_pcm_cd, | 815 | &clk_pcm_cd, |
669 | &clk_p_low, | ||
670 | &clk_h_low, | ||
671 | }; | 816 | }; |
672 | 817 | ||
673 | void __init s5p6440_register_clocks(void) | 818 | void __init s5p6440_register_clocks(void) |
@@ -680,6 +825,9 @@ void __init s5p6440_register_clocks(void) | |||
680 | if (ret > 0) | 825 | if (ret > 0) |
681 | printk(KERN_ERR "Failed to register %u clocks\n", ret); | 826 | printk(KERN_ERR "Failed to register %u clocks\n", ret); |
682 | 827 | ||
828 | for (ptr = 0; ptr < ARRAY_SIZE(sysclks); ptr++) | ||
829 | s3c_register_clksrc(sysclks[ptr], 1); | ||
830 | |||
683 | s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); | 831 | s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); |
684 | s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); | 832 | s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); |
685 | 833 | ||
diff --git a/arch/arm/mach-s5p6440/cpu.c b/arch/arm/mach-s5p6440/cpu.c index 1794131aeac..ca3b3206e6f 100644 --- a/arch/arm/mach-s5p6440/cpu.c +++ b/arch/arm/mach-s5p6440/cpu.c | |||
@@ -88,7 +88,7 @@ void __init s5p6440_init_irq(void) | |||
88 | s5p_init_irq(vic, ARRAY_SIZE(vic)); | 88 | s5p_init_irq(vic, ARRAY_SIZE(vic)); |
89 | } | 89 | } |
90 | 90 | ||
91 | static struct sysdev_class s5p6440_sysclass = { | 91 | struct sysdev_class s5p6440_sysclass = { |
92 | .name = "s5p6440-core", | 92 | .name = "s5p6440-core", |
93 | }; | 93 | }; |
94 | 94 | ||
diff --git a/arch/arm/mach-s5p6440/dev-audio.c b/arch/arm/mach-s5p6440/dev-audio.c new file mode 100644 index 00000000000..0c536796283 --- /dev/null +++ b/arch/arm/mach-s5p6440/dev-audio.c | |||
@@ -0,0 +1,127 @@ | |||
1 | /* linux/arch/arm/mach-s5p6440/dev-audio.c | ||
2 | * | ||
3 | * Copyright (c) 2010 Samsung Electronics Co. Ltd | ||
4 | * Jaswinder Singh <jassi.brar@samsung.com> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #include <linux/platform_device.h> | ||
12 | #include <linux/dma-mapping.h> | ||
13 | |||
14 | #include <plat/gpio-cfg.h> | ||
15 | #include <plat/audio.h> | ||
16 | |||
17 | #include <mach/gpio.h> | ||
18 | #include <mach/map.h> | ||
19 | #include <mach/dma.h> | ||
20 | #include <mach/irqs.h> | ||
21 | |||
22 | static int s5p6440_cfg_i2s(struct platform_device *pdev) | ||
23 | { | ||
24 | /* configure GPIO for i2s port */ | ||
25 | switch (pdev->id) { | ||
26 | case -1: | ||
27 | s3c_gpio_cfgpin(S5P6440_GPR(4), S3C_GPIO_SFN(5)); | ||
28 | s3c_gpio_cfgpin(S5P6440_GPR(5), S3C_GPIO_SFN(5)); | ||
29 | s3c_gpio_cfgpin(S5P6440_GPR(6), S3C_GPIO_SFN(5)); | ||
30 | s3c_gpio_cfgpin(S5P6440_GPR(7), S3C_GPIO_SFN(5)); | ||
31 | s3c_gpio_cfgpin(S5P6440_GPR(8), S3C_GPIO_SFN(5)); | ||
32 | s3c_gpio_cfgpin(S5P6440_GPR(13), S3C_GPIO_SFN(5)); | ||
33 | s3c_gpio_cfgpin(S5P6440_GPR(14), S3C_GPIO_SFN(5)); | ||
34 | break; | ||
35 | |||
36 | default: | ||
37 | printk(KERN_ERR "Invalid Device %d\n", pdev->id); | ||
38 | return -EINVAL; | ||
39 | } | ||
40 | |||
41 | return 0; | ||
42 | } | ||
43 | |||
44 | static struct s3c_audio_pdata s3c_i2s_pdata = { | ||
45 | .cfg_gpio = s5p6440_cfg_i2s, | ||
46 | }; | ||
47 | |||
48 | static struct resource s5p6440_iis0_resource[] = { | ||
49 | [0] = { | ||
50 | .start = S5P6440_PA_I2S, | ||
51 | .end = S5P6440_PA_I2S + 0x100 - 1, | ||
52 | .flags = IORESOURCE_MEM, | ||
53 | }, | ||
54 | [1] = { | ||
55 | .start = DMACH_I2S0_TX, | ||
56 | .end = DMACH_I2S0_TX, | ||
57 | .flags = IORESOURCE_DMA, | ||
58 | }, | ||
59 | [2] = { | ||
60 | .start = DMACH_I2S0_RX, | ||
61 | .end = DMACH_I2S0_RX, | ||
62 | .flags = IORESOURCE_DMA, | ||
63 | }, | ||
64 | }; | ||
65 | |||
66 | struct platform_device s5p6440_device_iis = { | ||
67 | .name = "s3c64xx-iis-v4", | ||
68 | .id = -1, | ||
69 | .num_resources = ARRAY_SIZE(s5p6440_iis0_resource), | ||
70 | .resource = s5p6440_iis0_resource, | ||
71 | .dev = { | ||
72 | .platform_data = &s3c_i2s_pdata, | ||
73 | }, | ||
74 | }; | ||
75 | |||
76 | /* PCM Controller platform_devices */ | ||
77 | |||
78 | static int s5p6440_pcm_cfg_gpio(struct platform_device *pdev) | ||
79 | { | ||
80 | switch (pdev->id) { | ||
81 | case 0: | ||
82 | s3c_gpio_cfgpin(S5P6440_GPR(7), S3C_GPIO_SFN(2)); | ||
83 | s3c_gpio_cfgpin(S5P6440_GPR(13), S3C_GPIO_SFN(2)); | ||
84 | s3c_gpio_cfgpin(S5P6440_GPR(14), S3C_GPIO_SFN(2)); | ||
85 | s3c_gpio_cfgpin(S5P6440_GPR(8), S3C_GPIO_SFN(2)); | ||
86 | s3c_gpio_cfgpin(S5P6440_GPR(6), S3C_GPIO_SFN(2)); | ||
87 | break; | ||
88 | |||
89 | default: | ||
90 | printk(KERN_DEBUG "Invalid PCM Controller number!"); | ||
91 | return -EINVAL; | ||
92 | } | ||
93 | |||
94 | return 0; | ||
95 | } | ||
96 | |||
97 | static struct s3c_audio_pdata s3c_pcm_pdata = { | ||
98 | .cfg_gpio = s5p6440_pcm_cfg_gpio, | ||
99 | }; | ||
100 | |||
101 | static struct resource s5p6440_pcm0_resource[] = { | ||
102 | [0] = { | ||
103 | .start = S5P6440_PA_PCM, | ||
104 | .end = S5P6440_PA_PCM + 0x100 - 1, | ||
105 | .flags = IORESOURCE_MEM, | ||
106 | }, | ||
107 | [1] = { | ||
108 | .start = DMACH_PCM0_TX, | ||
109 | .end = DMACH_PCM0_TX, | ||
110 | .flags = IORESOURCE_DMA, | ||
111 | }, | ||
112 | [2] = { | ||
113 | .start = DMACH_PCM0_RX, | ||
114 | .end = DMACH_PCM0_RX, | ||
115 | .flags = IORESOURCE_DMA, | ||
116 | }, | ||
117 | }; | ||
118 | |||
119 | struct platform_device s5p6440_device_pcm = { | ||
120 | .name = "samsung-pcm", | ||
121 | .id = 0, | ||
122 | .num_resources = ARRAY_SIZE(s5p6440_pcm0_resource), | ||
123 | .resource = s5p6440_pcm0_resource, | ||
124 | .dev = { | ||
125 | .platform_data = &s3c_pcm_pdata, | ||
126 | }, | ||
127 | }; | ||
diff --git a/arch/arm/mach-s5p6440/dma.c b/arch/arm/mach-s5p6440/dma.c new file mode 100644 index 00000000000..07606ad5751 --- /dev/null +++ b/arch/arm/mach-s5p6440/dma.c | |||
@@ -0,0 +1,105 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Samsung Electronics Co. Ltd. | ||
3 | * Jaswinder Singh <jassi.brar@samsung.com> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
18 | */ | ||
19 | |||
20 | #include <linux/platform_device.h> | ||
21 | #include <linux/dma-mapping.h> | ||
22 | |||
23 | #include <plat/devs.h> | ||
24 | #include <plat/irqs.h> | ||
25 | |||
26 | #include <mach/map.h> | ||
27 | #include <mach/irqs.h> | ||
28 | |||
29 | #include <plat/s3c-pl330-pdata.h> | ||
30 | |||
31 | static u64 dma_dmamask = DMA_BIT_MASK(32); | ||
32 | |||
33 | static struct resource s5p6440_pdma_resource[] = { | ||
34 | [0] = { | ||
35 | .start = S5P6440_PA_PDMA, | ||
36 | .end = S5P6440_PA_PDMA + SZ_4K, | ||
37 | .flags = IORESOURCE_MEM, | ||
38 | }, | ||
39 | [1] = { | ||
40 | .start = IRQ_DMA0, | ||
41 | .end = IRQ_DMA0, | ||
42 | .flags = IORESOURCE_IRQ, | ||
43 | }, | ||
44 | }; | ||
45 | |||
46 | static struct s3c_pl330_platdata s5p6440_pdma_pdata = { | ||
47 | .peri = { | ||
48 | [0] = DMACH_UART0_RX, | ||
49 | [1] = DMACH_UART0_TX, | ||
50 | [2] = DMACH_UART1_RX, | ||
51 | [3] = DMACH_UART1_TX, | ||
52 | [4] = DMACH_UART2_RX, | ||
53 | [5] = DMACH_UART2_TX, | ||
54 | [6] = DMACH_UART3_RX, | ||
55 | [7] = DMACH_UART3_TX, | ||
56 | [8] = DMACH_MAX, | ||
57 | [9] = DMACH_MAX, | ||
58 | [10] = DMACH_PCM0_TX, | ||
59 | [11] = DMACH_PCM0_RX, | ||
60 | [12] = DMACH_I2S0_TX, | ||
61 | [13] = DMACH_I2S0_RX, | ||
62 | [14] = DMACH_SPI0_TX, | ||
63 | [15] = DMACH_SPI0_RX, | ||
64 | [16] = DMACH_MAX, | ||
65 | [17] = DMACH_MAX, | ||
66 | [18] = DMACH_MAX, | ||
67 | [19] = DMACH_MAX, | ||
68 | [20] = DMACH_SPI1_TX, | ||
69 | [21] = DMACH_SPI1_RX, | ||
70 | [22] = DMACH_MAX, | ||
71 | [23] = DMACH_MAX, | ||
72 | [24] = DMACH_MAX, | ||
73 | [25] = DMACH_MAX, | ||
74 | [26] = DMACH_MAX, | ||
75 | [27] = DMACH_MAX, | ||
76 | [28] = DMACH_MAX, | ||
77 | [29] = DMACH_PWM, | ||
78 | [30] = DMACH_MAX, | ||
79 | [31] = DMACH_MAX, | ||
80 | }, | ||
81 | }; | ||
82 | |||
83 | static struct platform_device s5p6440_device_pdma = { | ||
84 | .name = "s3c-pl330", | ||
85 | .id = 1, | ||
86 | .num_resources = ARRAY_SIZE(s5p6440_pdma_resource), | ||
87 | .resource = s5p6440_pdma_resource, | ||
88 | .dev = { | ||
89 | .dma_mask = &dma_dmamask, | ||
90 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
91 | .platform_data = &s5p6440_pdma_pdata, | ||
92 | }, | ||
93 | }; | ||
94 | |||
95 | static struct platform_device *s5p6440_dmacs[] __initdata = { | ||
96 | &s5p6440_device_pdma, | ||
97 | }; | ||
98 | |||
99 | static int __init s5p6440_dma_init(void) | ||
100 | { | ||
101 | platform_add_devices(s5p6440_dmacs, ARRAY_SIZE(s5p6440_dmacs)); | ||
102 | |||
103 | return 0; | ||
104 | } | ||
105 | arch_initcall(s5p6440_dma_init); | ||
diff --git a/arch/arm/mach-s5p6440/gpio.c b/arch/arm/mach-s5p6440/gpio.c index b0ea741177a..262dc75d5be 100644 --- a/arch/arm/mach-s5p6440/gpio.c +++ b/arch/arm/mach-s5p6440/gpio.c | |||
@@ -161,12 +161,15 @@ static struct s3c_gpio_cfg s5p6440_gpio_cfgs[] = { | |||
161 | }, { | 161 | }, { |
162 | .cfg_eint = 0, | 162 | .cfg_eint = 0, |
163 | .set_config = s3c_gpio_setcfg_s3c24xx, | 163 | .set_config = s3c_gpio_setcfg_s3c24xx, |
164 | .get_config = s3c_gpio_getcfg_s3c24xx, | ||
164 | }, { | 165 | }, { |
165 | .cfg_eint = 2, | 166 | .cfg_eint = 2, |
166 | .set_config = s3c_gpio_setcfg_s3c24xx, | 167 | .set_config = s3c_gpio_setcfg_s3c24xx, |
168 | .get_config = s3c_gpio_getcfg_s3c24xx, | ||
167 | }, { | 169 | }, { |
168 | .cfg_eint = 3, | 170 | .cfg_eint = 3, |
169 | .set_config = s3c_gpio_setcfg_s3c24xx, | 171 | .set_config = s3c_gpio_setcfg_s3c24xx, |
172 | .get_config = s3c_gpio_getcfg_s3c24xx, | ||
170 | }, | 173 | }, |
171 | }; | 174 | }; |
172 | 175 | ||
@@ -279,6 +282,8 @@ void __init s5p6440_gpiolib_set_cfg(struct s3c_gpio_cfg *chipcfg, int nr_chips) | |||
279 | for (; nr_chips > 0; nr_chips--, chipcfg++) { | 282 | for (; nr_chips > 0; nr_chips--, chipcfg++) { |
280 | if (!chipcfg->set_config) | 283 | if (!chipcfg->set_config) |
281 | chipcfg->set_config = s3c_gpio_setcfg_s3c64xx_4bit; | 284 | chipcfg->set_config = s3c_gpio_setcfg_s3c64xx_4bit; |
285 | if (!chipcfg->get_config) | ||
286 | chipcfg->get_config = s3c_gpio_getcfg_s3c64xx_4bit; | ||
282 | if (!chipcfg->set_pull) | 287 | if (!chipcfg->set_pull) |
283 | chipcfg->set_pull = s3c_gpio_setpull_updown; | 288 | chipcfg->set_pull = s3c_gpio_setpull_updown; |
284 | if (!chipcfg->get_pull) | 289 | if (!chipcfg->get_pull) |
diff --git a/arch/arm/mach-s5p6440/include/mach/dma.h b/arch/arm/mach-s5p6440/include/mach/dma.h new file mode 100644 index 00000000000..81209eb1409 --- /dev/null +++ b/arch/arm/mach-s5p6440/include/mach/dma.h | |||
@@ -0,0 +1,26 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Samsung Electronics Co. Ltd. | ||
3 | * Jaswinder Singh <jassi.brar@samsung.com> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
18 | */ | ||
19 | |||
20 | #ifndef __MACH_DMA_H | ||
21 | #define __MACH_DMA_H | ||
22 | |||
23 | /* This platform uses the common S3C DMA API driver for PL330 */ | ||
24 | #include <plat/s3c-dma-pl330.h> | ||
25 | |||
26 | #endif /* __MACH_DMA_H */ | ||
diff --git a/arch/arm/mach-s5p6440/include/mach/map.h b/arch/arm/mach-s5p6440/include/mach/map.h index 8924e5a4d6a..72aedadd412 100644 --- a/arch/arm/mach-s5p6440/include/mach/map.h +++ b/arch/arm/mach-s5p6440/include/mach/map.h | |||
@@ -29,6 +29,8 @@ | |||
29 | #define S5P6440_PA_VIC0 (0xE4000000) | 29 | #define S5P6440_PA_VIC0 (0xE4000000) |
30 | #define S5P_PA_VIC0 S5P6440_PA_VIC0 | 30 | #define S5P_PA_VIC0 S5P6440_PA_VIC0 |
31 | 31 | ||
32 | #define S5P6440_PA_PDMA 0xE9000000 | ||
33 | |||
32 | #define S5P6440_PA_VIC1 (0xE4100000) | 34 | #define S5P6440_PA_VIC1 (0xE4100000) |
33 | #define S5P_PA_VIC1 S5P6440_PA_VIC1 | 35 | #define S5P_PA_VIC1 S5P6440_PA_VIC1 |
34 | 36 | ||
@@ -61,6 +63,12 @@ | |||
61 | #define S5P6440_PA_SDRAM (0x20000000) | 63 | #define S5P6440_PA_SDRAM (0x20000000) |
62 | #define S5P_PA_SDRAM S5P6440_PA_SDRAM | 64 | #define S5P_PA_SDRAM S5P6440_PA_SDRAM |
63 | 65 | ||
66 | /* I2S */ | ||
67 | #define S5P6440_PA_I2S 0xF2000000 | ||
68 | |||
69 | /* PCM */ | ||
70 | #define S5P6440_PA_PCM 0xF2100000 | ||
71 | |||
64 | /* compatibiltiy defines. */ | 72 | /* compatibiltiy defines. */ |
65 | #define S3C_PA_UART S5P6440_PA_UART | 73 | #define S3C_PA_UART S5P6440_PA_UART |
66 | #define S3C_PA_IIC S5P6440_PA_IIC0 | 74 | #define S3C_PA_IIC S5P6440_PA_IIC0 |
diff --git a/arch/arm/mach-s5p6440/include/mach/pwm-clock.h b/arch/arm/mach-s5p6440/include/mach/pwm-clock.h index c4bb7c55547..6a2a02fdf12 100644 --- a/arch/arm/mach-s5p6440/include/mach/pwm-clock.h +++ b/arch/arm/mach-s5p6440/include/mach/pwm-clock.h | |||
@@ -1,11 +1,14 @@ | |||
1 | /* linux/arch/arm/mach-s5p6440/include/mach/pwm-clock.h | 1 | /* linux/arch/arm/mach-s5p6440/include/mach/pwm-clock.h |
2 | * | 2 | * |
3 | * Copyright (c) 2009 Samsung Electronics Co., Ltd. | ||
4 | * http://www.samsung.com/ | ||
5 | * | ||
6 | * Copyright 2008 Openmoko, Inc. | ||
3 | * Copyright 2008 Simtec Electronics | 7 | * Copyright 2008 Simtec Electronics |
4 | * Ben Dooks <ben@simtec.co.uk> | 8 | * Ben Dooks <ben@simtec.co.uk> |
5 | * http://armlinux.simtec.co.uk/ | 9 | * http://armlinux.simtec.co.uk/ |
6 | * | 10 | * |
7 | * Copyright 2009 Samsung Electronics Co., Ltd. | 11 | * Based on arch/arm/mach-s3c64xx/include/mach/pwm-clock.h |
8 | * http://www.samsung.com/ | ||
9 | * | 12 | * |
10 | * S5P6440 - pwm clock and timer support | 13 | * S5P6440 - pwm clock and timer support |
11 | * | 14 | * |
@@ -14,16 +17,19 @@ | |||
14 | * published by the Free Software Foundation. | 17 | * published by the Free Software Foundation. |
15 | */ | 18 | */ |
16 | 19 | ||
20 | #ifndef __ASM_ARCH_PWMCLK_H | ||
21 | #define __ASM_ARCH_PWMCLK_H __FILE__ | ||
22 | |||
17 | /** | 23 | /** |
18 | * pwm_cfg_src_is_tclk() - return whether the given mux config is a tclk | 24 | * pwm_cfg_src_is_tclk() - return whether the given mux config is a tclk |
19 | * @cfg: The timer TCFG1 register bits shifted down to 0. | 25 | * @tcfg: The timer TCFG1 register bits shifted down to 0. |
20 | * | 26 | * |
21 | * Return true if the given configuration from TCFG1 is a TCLK instead | 27 | * Return true if the given configuration from TCFG1 is a TCLK instead |
22 | * any of the TDIV clocks. | 28 | * any of the TDIV clocks. |
23 | */ | 29 | */ |
24 | static inline int pwm_cfg_src_is_tclk(unsigned long tcfg) | 30 | static inline int pwm_cfg_src_is_tclk(unsigned long tcfg) |
25 | { | 31 | { |
26 | return tcfg == S3C2410_TCFG1_MUX_TCLK; | 32 | return 0; |
27 | } | 33 | } |
28 | 34 | ||
29 | /** | 35 | /** |
@@ -35,7 +41,7 @@ static inline int pwm_cfg_src_is_tclk(unsigned long tcfg) | |||
35 | */ | 41 | */ |
36 | static inline unsigned long tcfg_to_divisor(unsigned long tcfg1) | 42 | static inline unsigned long tcfg_to_divisor(unsigned long tcfg1) |
37 | { | 43 | { |
38 | return 1 << (1 + tcfg1); | 44 | return 1 << tcfg1; |
39 | } | 45 | } |
40 | 46 | ||
41 | /** | 47 | /** |
@@ -45,7 +51,7 @@ static inline unsigned long tcfg_to_divisor(unsigned long tcfg1) | |||
45 | */ | 51 | */ |
46 | static inline unsigned int pwm_tdiv_has_div1(void) | 52 | static inline unsigned int pwm_tdiv_has_div1(void) |
47 | { | 53 | { |
48 | return 0; | 54 | return 1; |
49 | } | 55 | } |
50 | 56 | ||
51 | /** | 57 | /** |
@@ -56,7 +62,9 @@ static inline unsigned int pwm_tdiv_has_div1(void) | |||
56 | */ | 62 | */ |
57 | static inline unsigned long pwm_tdiv_div_bits(unsigned int div) | 63 | static inline unsigned long pwm_tdiv_div_bits(unsigned int div) |
58 | { | 64 | { |
59 | return ilog2(div) - 1; | 65 | return ilog2(div); |
60 | } | 66 | } |
61 | 67 | ||
62 | #define S3C_TCFG1_MUX_TCLK S3C2410_TCFG1_MUX_TCLK | 68 | #define S3C_TCFG1_MUX_TCLK 0 |
69 | |||
70 | #endif /* __ASM_ARCH_PWMCLK_H */ | ||
diff --git a/arch/arm/mach-s5p6440/mach-smdk6440.c b/arch/arm/mach-s5p6440/mach-smdk6440.c index 3ae88f2c7c7..d7fede971ca 100644 --- a/arch/arm/mach-s5p6440/mach-smdk6440.c +++ b/arch/arm/mach-s5p6440/mach-smdk6440.c | |||
@@ -84,6 +84,7 @@ static struct s3c2410_uartcfg smdk6440_uartcfgs[] __initdata = { | |||
84 | }; | 84 | }; |
85 | 85 | ||
86 | static struct platform_device *smdk6440_devices[] __initdata = { | 86 | static struct platform_device *smdk6440_devices[] __initdata = { |
87 | &s5p6440_device_iis, | ||
87 | }; | 88 | }; |
88 | 89 | ||
89 | static void __init smdk6440_map_io(void) | 90 | static void __init smdk6440_map_io(void) |
diff --git a/arch/arm/mach-s5p6440/setup-i2c0.c b/arch/arm/mach-s5p6440/setup-i2c0.c new file mode 100644 index 00000000000..69e8a664aed --- /dev/null +++ b/arch/arm/mach-s5p6440/setup-i2c0.c | |||
@@ -0,0 +1,25 @@ | |||
1 | /* linux/arch/arm/mach-s5p6440/setup-i2c0.c | ||
2 | * | ||
3 | * Copyright (c) 2009 Samsung Electronics Co., Ltd. | ||
4 | * http://www.samsung.com/ | ||
5 | * | ||
6 | * I2C0 GPIO configuration. | ||
7 | * | ||
8 | * Based on plat-s3c64xx/setup-i2c0.c | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License version 2 as | ||
12 | * published by the Free Software Foundation. | ||
13 | */ | ||
14 | |||
15 | #include <linux/kernel.h> | ||
16 | #include <linux/types.h> | ||
17 | |||
18 | struct platform_device; /* don't need the contents */ | ||
19 | |||
20 | #include <plat/iic.h> | ||
21 | |||
22 | void s3c_i2c0_cfg_gpio(struct platform_device *dev) | ||
23 | { | ||
24 | /* Will be populated later */ | ||
25 | } | ||