diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-09 17:39:22 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-09 17:39:22 -0500 |
commit | 2ac9d7aaccbd598b5bd19ac40761b723bb675442 (patch) | |
tree | 09132a44e33798aaa5e80f10bf025b510015cab3 /arch/arm/mach-s5p64x0 | |
parent | 5ede3ceb7b2c2843e153a1803edbdc8c56655950 (diff) | |
parent | dcf7ec5ee62a78123057a1e286c88ca739717409 (diff) |
Merge tag 'drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Driver specific changes
Again, a lot of platforms have changes in here: pxa, samsung, omap,
at91, imx, ...
* tag 'drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (54 commits)
ARM: sa1100: clean up of the clock support
ARM: pxa: add dummy clock for sa1100-rtc
RTC: sa1100: support sa1100, pxa and mmp soc families
RTC: sa1100: remove redundant code of setting alarm
RTC: sa1100: Clean out ost register
Input: zylonite-wm97xx - replace IRQ_GPIO() with gpio_to_irq()
pcmcia: pxa: replace IRQ_GPIO() with gpio_to_irq()
ARM: EXYNOS: Modified files for SPI consolidation work
ARM: S5P64X0: Enable SDHCI support
ARM: S5P64X0: Add lookup of sdhci-s3c clocks using generic names
ARM: S5P64X0: Add HSMMC setup for host Controller
ARM: EXYNOS: Add USB OHCI support to ORIGEN board
USB: Add Samsung Exynos OHCI diver
ARM: EXYNOS: Add USB OHCI support to SMDKV310 board
ARM: EXYNOS: Add USB OHCI device
net: macb: fix build break with !CONFIG_OF
i2c: tegra: Support DVC controller in device tree
i2c: tegra: Add __devinit/exit to probe/remove
net/at91_ether: use gpio_is_valid for phy IRQ line
ARM: at91/net: add macb ethernet controller in 9g45/9g20 DT
...
Diffstat (limited to 'arch/arm/mach-s5p64x0')
-rw-r--r-- | arch/arm/mach-s5p64x0/Kconfig | 24 | ||||
-rw-r--r-- | arch/arm/mach-s5p64x0/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-s5p64x0/clock-s5p6440.c | 72 | ||||
-rw-r--r-- | arch/arm/mach-s5p64x0/clock-s5p6450.c | 72 | ||||
-rw-r--r-- | arch/arm/mach-s5p64x0/common.c | 9 | ||||
-rw-r--r-- | arch/arm/mach-s5p64x0/mach-smdk6440.c | 25 | ||||
-rw-r--r-- | arch/arm/mach-s5p64x0/mach-smdk6450.c | 26 | ||||
-rw-r--r-- | arch/arm/mach-s5p64x0/setup-sdhci-gpio.c | 104 |
8 files changed, 272 insertions, 61 deletions
diff --git a/arch/arm/mach-s5p64x0/Kconfig b/arch/arm/mach-s5p64x0/Kconfig index dd8c85ef6dab..c87f6108eeb1 100644 --- a/arch/arm/mach-s5p64x0/Kconfig +++ b/arch/arm/mach-s5p64x0/Kconfig | |||
@@ -41,6 +41,11 @@ config S5P64X0_SETUP_SPI | |||
41 | help | 41 | help |
42 | Common setup code for SPI GPIO configurations | 42 | Common setup code for SPI GPIO configurations |
43 | 43 | ||
44 | config S5P64X0_SETUP_SDHCI_GPIO | ||
45 | bool | ||
46 | help | ||
47 | Common setup code for SDHCI gpio. | ||
48 | |||
44 | # machine support | 49 | # machine support |
45 | 50 | ||
46 | config MACH_SMDK6440 | 51 | config MACH_SMDK6440 |
@@ -50,12 +55,16 @@ config MACH_SMDK6440 | |||
50 | select S3C_DEV_I2C1 | 55 | select S3C_DEV_I2C1 |
51 | select S3C_DEV_RTC | 56 | select S3C_DEV_RTC |
52 | select S3C_DEV_WDT | 57 | select S3C_DEV_WDT |
58 | select S3C_DEV_HSMMC | ||
59 | select S3C_DEV_HSMMC1 | ||
60 | select S3C_DEV_HSMMC2 | ||
53 | select SAMSUNG_DEV_ADC | 61 | select SAMSUNG_DEV_ADC |
54 | select SAMSUNG_DEV_BACKLIGHT | 62 | select SAMSUNG_DEV_BACKLIGHT |
55 | select SAMSUNG_DEV_PWM | 63 | select SAMSUNG_DEV_PWM |
56 | select SAMSUNG_DEV_TS | 64 | select SAMSUNG_DEV_TS |
57 | select S5P64X0_SETUP_FB_24BPP | 65 | select S5P64X0_SETUP_FB_24BPP |
58 | select S5P64X0_SETUP_I2C1 | 66 | select S5P64X0_SETUP_I2C1 |
67 | select S5P64X0_SETUP_SDHCI_GPIO | ||
59 | help | 68 | help |
60 | Machine support for the Samsung SMDK6440 | 69 | Machine support for the Samsung SMDK6440 |
61 | 70 | ||
@@ -66,13 +75,28 @@ config MACH_SMDK6450 | |||
66 | select S3C_DEV_I2C1 | 75 | select S3C_DEV_I2C1 |
67 | select S3C_DEV_RTC | 76 | select S3C_DEV_RTC |
68 | select S3C_DEV_WDT | 77 | select S3C_DEV_WDT |
78 | select S3C_DEV_HSMMC | ||
79 | select S3C_DEV_HSMMC1 | ||
80 | select S3C_DEV_HSMMC2 | ||
69 | select SAMSUNG_DEV_ADC | 81 | select SAMSUNG_DEV_ADC |
70 | select SAMSUNG_DEV_BACKLIGHT | 82 | select SAMSUNG_DEV_BACKLIGHT |
71 | select SAMSUNG_DEV_PWM | 83 | select SAMSUNG_DEV_PWM |
72 | select SAMSUNG_DEV_TS | 84 | select SAMSUNG_DEV_TS |
73 | select S5P64X0_SETUP_FB_24BPP | 85 | select S5P64X0_SETUP_FB_24BPP |
74 | select S5P64X0_SETUP_I2C1 | 86 | select S5P64X0_SETUP_I2C1 |
87 | select S5P64X0_SETUP_SDHCI_GPIO | ||
75 | help | 88 | help |
76 | Machine support for the Samsung SMDK6450 | 89 | Machine support for the Samsung SMDK6450 |
77 | 90 | ||
91 | menu "Use 8-bit SDHCI bus width" | ||
92 | |||
93 | config S5P64X0_SD_CH1_8BIT | ||
94 | bool "SDHCI Channel 1 (Slot 1)" | ||
95 | depends on MACH_SMDK6450 || MACH_SMDK6440 | ||
96 | help | ||
97 | Support SDHCI Channel 1 8-bit bus. | ||
98 | If selected, Channel 2 is disabled. | ||
99 | |||
100 | endmenu | ||
101 | |||
78 | endif | 102 | endif |
diff --git a/arch/arm/mach-s5p64x0/Makefile b/arch/arm/mach-s5p64x0/Makefile index e167ca136f5d..12bb951187a4 100644 --- a/arch/arm/mach-s5p64x0/Makefile +++ b/arch/arm/mach-s5p64x0/Makefile | |||
@@ -33,3 +33,4 @@ obj-y += setup-i2c0.o | |||
33 | obj-$(CONFIG_S5P64X0_SETUP_I2C1) += setup-i2c1.o | 33 | obj-$(CONFIG_S5P64X0_SETUP_I2C1) += setup-i2c1.o |
34 | obj-$(CONFIG_S5P64X0_SETUP_FB_24BPP) += setup-fb-24bpp.o | 34 | obj-$(CONFIG_S5P64X0_SETUP_FB_24BPP) += setup-fb-24bpp.o |
35 | obj-$(CONFIG_S5P64X0_SETUP_SPI) += setup-spi.o | 35 | obj-$(CONFIG_S5P64X0_SETUP_SPI) += setup-spi.o |
36 | obj-$(CONFIG_S5P64X0_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o | ||
diff --git a/arch/arm/mach-s5p64x0/clock-s5p6440.c b/arch/arm/mach-s5p64x0/clock-s5p6440.c index 925d2daa60c7..ee1e8e7f5631 100644 --- a/arch/arm/mach-s5p64x0/clock-s5p6440.c +++ b/arch/arm/mach-s5p64x0/clock-s5p6440.c | |||
@@ -380,36 +380,6 @@ static struct clksrc_sources clkset_audio = { | |||
380 | static struct clksrc_clk clksrcs[] = { | 380 | static struct clksrc_clk clksrcs[] = { |
381 | { | 381 | { |
382 | .clk = { | 382 | .clk = { |
383 | .name = "sclk_mmc", | ||
384 | .devname = "s3c-sdhci.0", | ||
385 | .ctrlbit = (1 << 24), | ||
386 | .enable = s5p64x0_sclk_ctrl, | ||
387 | }, | ||
388 | .sources = &clkset_group1, | ||
389 | .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 18, .size = 2 }, | ||
390 | .reg_div = { .reg = S5P64X0_CLK_DIV1, .shift = 0, .size = 4 }, | ||
391 | }, { | ||
392 | .clk = { | ||
393 | .name = "sclk_mmc", | ||
394 | .devname = "s3c-sdhci.1", | ||
395 | .ctrlbit = (1 << 25), | ||
396 | .enable = s5p64x0_sclk_ctrl, | ||
397 | }, | ||
398 | .sources = &clkset_group1, | ||
399 | .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 20, .size = 2 }, | ||
400 | .reg_div = { .reg = S5P64X0_CLK_DIV1, .shift = 4, .size = 4 }, | ||
401 | }, { | ||
402 | .clk = { | ||
403 | .name = "sclk_mmc", | ||
404 | .devname = "s3c-sdhci.2", | ||
405 | .ctrlbit = (1 << 26), | ||
406 | .enable = s5p64x0_sclk_ctrl, | ||
407 | }, | ||
408 | .sources = &clkset_group1, | ||
409 | .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 22, .size = 2 }, | ||
410 | .reg_div = { .reg = S5P64X0_CLK_DIV1, .shift = 8, .size = 4 }, | ||
411 | }, { | ||
412 | .clk = { | ||
413 | .name = "sclk_post", | 383 | .name = "sclk_post", |
414 | .ctrlbit = (1 << 10), | 384 | .ctrlbit = (1 << 10), |
415 | .enable = s5p64x0_sclk_ctrl, | 385 | .enable = s5p64x0_sclk_ctrl, |
@@ -447,6 +417,42 @@ static struct clksrc_clk clksrcs[] = { | |||
447 | }, | 417 | }, |
448 | }; | 418 | }; |
449 | 419 | ||
420 | static struct clksrc_clk clk_sclk_mmc0 = { | ||
421 | .clk = { | ||
422 | .name = "sclk_mmc", | ||
423 | .devname = "s3c-sdhci.0", | ||
424 | .ctrlbit = (1 << 24), | ||
425 | .enable = s5p64x0_sclk_ctrl, | ||
426 | }, | ||
427 | .sources = &clkset_group1, | ||
428 | .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 18, .size = 2 }, | ||
429 | .reg_div = { .reg = S5P64X0_CLK_DIV1, .shift = 0, .size = 4 }, | ||
430 | }; | ||
431 | |||
432 | static struct clksrc_clk clk_sclk_mmc1 = { | ||
433 | .clk = { | ||
434 | .name = "sclk_mmc", | ||
435 | .devname = "s3c-sdhci.1", | ||
436 | .ctrlbit = (1 << 25), | ||
437 | .enable = s5p64x0_sclk_ctrl, | ||
438 | }, | ||
439 | .sources = &clkset_group1, | ||
440 | .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 20, .size = 2 }, | ||
441 | .reg_div = { .reg = S5P64X0_CLK_DIV1, .shift = 4, .size = 4 }, | ||
442 | }; | ||
443 | |||
444 | static struct clksrc_clk clk_sclk_mmc2 = { | ||
445 | .clk = { | ||
446 | .name = "sclk_mmc", | ||
447 | .devname = "s3c-sdhci.2", | ||
448 | .ctrlbit = (1 << 26), | ||
449 | .enable = s5p64x0_sclk_ctrl, | ||
450 | }, | ||
451 | .sources = &clkset_group1, | ||
452 | .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 22, .size = 2 }, | ||
453 | .reg_div = { .reg = S5P64X0_CLK_DIV1, .shift = 8, .size = 4 }, | ||
454 | }; | ||
455 | |||
450 | static struct clksrc_clk clk_sclk_uclk = { | 456 | static struct clksrc_clk clk_sclk_uclk = { |
451 | .clk = { | 457 | .clk = { |
452 | .name = "uclk1", | 458 | .name = "uclk1", |
@@ -504,6 +510,9 @@ static struct clksrc_clk *clksrc_cdev[] = { | |||
504 | &clk_sclk_uclk, | 510 | &clk_sclk_uclk, |
505 | &clk_sclk_spi0, | 511 | &clk_sclk_spi0, |
506 | &clk_sclk_spi1, | 512 | &clk_sclk_spi1, |
513 | &clk_sclk_mmc0, | ||
514 | &clk_sclk_mmc1, | ||
515 | &clk_sclk_mmc2 | ||
507 | }; | 516 | }; |
508 | 517 | ||
509 | static struct clk_lookup s5p6440_clk_lookup[] = { | 518 | static struct clk_lookup s5p6440_clk_lookup[] = { |
@@ -512,6 +521,9 @@ static struct clk_lookup s5p6440_clk_lookup[] = { | |||
512 | CLKDEV_INIT(NULL, "spi_busclk0", &clk_p), | 521 | CLKDEV_INIT(NULL, "spi_busclk0", &clk_p), |
513 | CLKDEV_INIT("s3c64xx-spi.0", "spi_busclk1", &clk_sclk_spi0.clk), | 522 | CLKDEV_INIT("s3c64xx-spi.0", "spi_busclk1", &clk_sclk_spi0.clk), |
514 | CLKDEV_INIT("s3c64xx-spi.1", "spi_busclk1", &clk_sclk_spi1.clk), | 523 | CLKDEV_INIT("s3c64xx-spi.1", "spi_busclk1", &clk_sclk_spi1.clk), |
524 | CLKDEV_INIT("s3c-sdhci.0", "mmc_busclk.2", &clk_sclk_mmc0.clk), | ||
525 | CLKDEV_INIT("s3c-sdhci.1", "mmc_busclk.2", &clk_sclk_mmc1.clk), | ||
526 | CLKDEV_INIT("s3c-sdhci.2", "mmc_busclk.2", &clk_sclk_mmc2.clk), | ||
515 | }; | 527 | }; |
516 | 528 | ||
517 | void __init_or_cpufreq s5p6440_setup_clocks(void) | 529 | void __init_or_cpufreq s5p6440_setup_clocks(void) |
diff --git a/arch/arm/mach-s5p64x0/clock-s5p6450.c b/arch/arm/mach-s5p64x0/clock-s5p6450.c index c390a59f68ac..dae6a13f43bb 100644 --- a/arch/arm/mach-s5p64x0/clock-s5p6450.c +++ b/arch/arm/mach-s5p64x0/clock-s5p6450.c | |||
@@ -414,36 +414,6 @@ static struct clksrc_clk clk_sclk_audio0 = { | |||
414 | static struct clksrc_clk clksrcs[] = { | 414 | static struct clksrc_clk clksrcs[] = { |
415 | { | 415 | { |
416 | .clk = { | 416 | .clk = { |
417 | .name = "sclk_mmc", | ||
418 | .devname = "s3c-sdhci.0", | ||
419 | .ctrlbit = (1 << 24), | ||
420 | .enable = s5p64x0_sclk_ctrl, | ||
421 | }, | ||
422 | .sources = &clkset_group2, | ||
423 | .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 18, .size = 2 }, | ||
424 | .reg_div = { .reg = S5P64X0_CLK_DIV1, .shift = 0, .size = 4 }, | ||
425 | }, { | ||
426 | .clk = { | ||
427 | .name = "sclk_mmc", | ||
428 | .devname = "s3c-sdhci.1", | ||
429 | .ctrlbit = (1 << 25), | ||
430 | .enable = s5p64x0_sclk_ctrl, | ||
431 | }, | ||
432 | .sources = &clkset_group2, | ||
433 | .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 20, .size = 2 }, | ||
434 | .reg_div = { .reg = S5P64X0_CLK_DIV1, .shift = 4, .size = 4 }, | ||
435 | }, { | ||
436 | .clk = { | ||
437 | .name = "sclk_mmc", | ||
438 | .devname = "s3c-sdhci.2", | ||
439 | .ctrlbit = (1 << 26), | ||
440 | .enable = s5p64x0_sclk_ctrl, | ||
441 | }, | ||
442 | .sources = &clkset_group2, | ||
443 | .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 22, .size = 2 }, | ||
444 | .reg_div = { .reg = S5P64X0_CLK_DIV1, .shift = 8, .size = 4 }, | ||
445 | }, { | ||
446 | .clk = { | ||
447 | .name = "sclk_fimc", | 417 | .name = "sclk_fimc", |
448 | .ctrlbit = (1 << 10), | 418 | .ctrlbit = (1 << 10), |
449 | .enable = s5p64x0_sclk_ctrl, | 419 | .enable = s5p64x0_sclk_ctrl, |
@@ -508,6 +478,42 @@ static struct clksrc_clk clksrcs[] = { | |||
508 | }, | 478 | }, |
509 | }; | 479 | }; |
510 | 480 | ||
481 | static struct clksrc_clk clk_sclk_mmc0 = { | ||
482 | .clk = { | ||
483 | .name = "sclk_mmc", | ||
484 | .devname = "s3c-sdhci.0", | ||
485 | .ctrlbit = (1 << 24), | ||
486 | .enable = s5p64x0_sclk_ctrl, | ||
487 | }, | ||
488 | .sources = &clkset_group2, | ||
489 | .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 18, .size = 2 }, | ||
490 | .reg_div = { .reg = S5P64X0_CLK_DIV1, .shift = 0, .size = 4 }, | ||
491 | }; | ||
492 | |||
493 | static struct clksrc_clk clk_sclk_mmc1 = { | ||
494 | .clk = { | ||
495 | .name = "sclk_mmc", | ||
496 | .devname = "s3c-sdhci.1", | ||
497 | .ctrlbit = (1 << 25), | ||
498 | .enable = s5p64x0_sclk_ctrl, | ||
499 | }, | ||
500 | .sources = &clkset_group2, | ||
501 | .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 20, .size = 2 }, | ||
502 | .reg_div = { .reg = S5P64X0_CLK_DIV1, .shift = 4, .size = 4 }, | ||
503 | }; | ||
504 | |||
505 | static struct clksrc_clk clk_sclk_mmc2 = { | ||
506 | .clk = { | ||
507 | .name = "sclk_mmc", | ||
508 | .devname = "s3c-sdhci.2", | ||
509 | .ctrlbit = (1 << 26), | ||
510 | .enable = s5p64x0_sclk_ctrl, | ||
511 | }, | ||
512 | .sources = &clkset_group2, | ||
513 | .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 22, .size = 2 }, | ||
514 | .reg_div = { .reg = S5P64X0_CLK_DIV1, .shift = 8, .size = 4 }, | ||
515 | }; | ||
516 | |||
511 | static struct clksrc_clk clk_sclk_uclk = { | 517 | static struct clksrc_clk clk_sclk_uclk = { |
512 | .clk = { | 518 | .clk = { |
513 | .name = "uclk1", | 519 | .name = "uclk1", |
@@ -547,6 +553,9 @@ static struct clksrc_clk *clksrc_cdev[] = { | |||
547 | &clk_sclk_uclk, | 553 | &clk_sclk_uclk, |
548 | &clk_sclk_spi0, | 554 | &clk_sclk_spi0, |
549 | &clk_sclk_spi1, | 555 | &clk_sclk_spi1, |
556 | &clk_sclk_mmc0, | ||
557 | &clk_sclk_mmc1, | ||
558 | &clk_sclk_mmc2, | ||
550 | }; | 559 | }; |
551 | 560 | ||
552 | static struct clk_lookup s5p6450_clk_lookup[] = { | 561 | static struct clk_lookup s5p6450_clk_lookup[] = { |
@@ -555,6 +564,9 @@ static struct clk_lookup s5p6450_clk_lookup[] = { | |||
555 | CLKDEV_INIT(NULL, "spi_busclk0", &clk_p), | 564 | CLKDEV_INIT(NULL, "spi_busclk0", &clk_p), |
556 | CLKDEV_INIT("s3c64xx-spi.0", "spi_busclk1", &clk_sclk_spi0.clk), | 565 | CLKDEV_INIT("s3c64xx-spi.0", "spi_busclk1", &clk_sclk_spi0.clk), |
557 | CLKDEV_INIT("s3c64xx-spi.1", "spi_busclk1", &clk_sclk_spi1.clk), | 566 | CLKDEV_INIT("s3c64xx-spi.1", "spi_busclk1", &clk_sclk_spi1.clk), |
567 | CLKDEV_INIT("s3c-sdhci.0", "mmc_busclk.2", &clk_sclk_mmc0.clk), | ||
568 | CLKDEV_INIT("s3c-sdhci.1", "mmc_busclk.2", &clk_sclk_mmc1.clk), | ||
569 | CLKDEV_INIT("s3c-sdhci.2", "mmc_busclk.2", &clk_sclk_mmc2.clk), | ||
558 | }; | 570 | }; |
559 | 571 | ||
560 | /* Clock initialization code */ | 572 | /* Clock initialization code */ |
diff --git a/arch/arm/mach-s5p64x0/common.c b/arch/arm/mach-s5p64x0/common.c index 0d50e79fb9fc..52b89a376447 100644 --- a/arch/arm/mach-s5p64x0/common.c +++ b/arch/arm/mach-s5p64x0/common.c | |||
@@ -40,6 +40,7 @@ | |||
40 | #include <plat/clock.h> | 40 | #include <plat/clock.h> |
41 | #include <plat/devs.h> | 41 | #include <plat/devs.h> |
42 | #include <plat/pm.h> | 42 | #include <plat/pm.h> |
43 | #include <plat/sdhci.h> | ||
43 | #include <plat/adc-core.h> | 44 | #include <plat/adc-core.h> |
44 | #include <plat/fb-core.h> | 45 | #include <plat/fb-core.h> |
45 | #include <plat/gpio-cfg.h> | 46 | #include <plat/gpio-cfg.h> |
@@ -181,6 +182,10 @@ void __init s5p6440_map_io(void) | |||
181 | s3c_adc_setname("s3c64xx-adc"); | 182 | s3c_adc_setname("s3c64xx-adc"); |
182 | s3c_fb_setname("s5p64x0-fb"); | 183 | s3c_fb_setname("s5p64x0-fb"); |
183 | 184 | ||
185 | s5p64x0_default_sdhci0(); | ||
186 | s5p64x0_default_sdhci1(); | ||
187 | s5p6440_default_sdhci2(); | ||
188 | |||
184 | iotable_init(s5p6440_iodesc, ARRAY_SIZE(s5p6440_iodesc)); | 189 | iotable_init(s5p6440_iodesc, ARRAY_SIZE(s5p6440_iodesc)); |
185 | init_consistent_dma_size(SZ_8M); | 190 | init_consistent_dma_size(SZ_8M); |
186 | } | 191 | } |
@@ -191,6 +196,10 @@ void __init s5p6450_map_io(void) | |||
191 | s3c_adc_setname("s3c64xx-adc"); | 196 | s3c_adc_setname("s3c64xx-adc"); |
192 | s3c_fb_setname("s5p64x0-fb"); | 197 | s3c_fb_setname("s5p64x0-fb"); |
193 | 198 | ||
199 | s5p64x0_default_sdhci0(); | ||
200 | s5p64x0_default_sdhci1(); | ||
201 | s5p6450_default_sdhci2(); | ||
202 | |||
194 | iotable_init(s5p6450_iodesc, ARRAY_SIZE(s5p6450_iodesc)); | 203 | iotable_init(s5p6450_iodesc, ARRAY_SIZE(s5p6450_iodesc)); |
195 | init_consistent_dma_size(SZ_8M); | 204 | init_consistent_dma_size(SZ_8M); |
196 | } | 205 | } |
diff --git a/arch/arm/mach-s5p64x0/mach-smdk6440.c b/arch/arm/mach-s5p64x0/mach-smdk6440.c index 34d98a1dae57..a40e325d62c8 100644 --- a/arch/arm/mach-s5p64x0/mach-smdk6440.c +++ b/arch/arm/mach-s5p64x0/mach-smdk6440.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/gpio.h> | 24 | #include <linux/gpio.h> |
25 | #include <linux/pwm_backlight.h> | 25 | #include <linux/pwm_backlight.h> |
26 | #include <linux/fb.h> | 26 | #include <linux/fb.h> |
27 | #include <linux/mmc/host.h> | ||
27 | 28 | ||
28 | #include <video/platform_lcd.h> | 29 | #include <video/platform_lcd.h> |
29 | 30 | ||
@@ -52,6 +53,7 @@ | |||
52 | #include <plat/backlight.h> | 53 | #include <plat/backlight.h> |
53 | #include <plat/fb.h> | 54 | #include <plat/fb.h> |
54 | #include <plat/regs-fb.h> | 55 | #include <plat/regs-fb.h> |
56 | #include <plat/sdhci.h> | ||
55 | 57 | ||
56 | #include "common.h" | 58 | #include "common.h" |
57 | 59 | ||
@@ -163,6 +165,25 @@ static struct platform_device *smdk6440_devices[] __initdata = { | |||
163 | &s5p6440_device_iis, | 165 | &s5p6440_device_iis, |
164 | &s3c_device_fb, | 166 | &s3c_device_fb, |
165 | &smdk6440_lcd_lte480wv, | 167 | &smdk6440_lcd_lte480wv, |
168 | &s3c_device_hsmmc0, | ||
169 | &s3c_device_hsmmc1, | ||
170 | &s3c_device_hsmmc2, | ||
171 | }; | ||
172 | |||
173 | static struct s3c_sdhci_platdata smdk6440_hsmmc0_pdata __initdata = { | ||
174 | .cd_type = S3C_SDHCI_CD_NONE, | ||
175 | }; | ||
176 | |||
177 | static struct s3c_sdhci_platdata smdk6440_hsmmc1_pdata __initdata = { | ||
178 | .cd_type = S3C_SDHCI_CD_INTERNAL, | ||
179 | #if defined(CONFIG_S5P64X0_SD_CH1_8BIT) | ||
180 | .max_width = 8, | ||
181 | .host_caps = MMC_CAP_8_BIT_DATA, | ||
182 | #endif | ||
183 | }; | ||
184 | |||
185 | static struct s3c_sdhci_platdata smdk6440_hsmmc2_pdata __initdata = { | ||
186 | .cd_type = S3C_SDHCI_CD_NONE, | ||
166 | }; | 187 | }; |
167 | 188 | ||
168 | static struct s3c2410_platform_i2c s5p6440_i2c0_data __initdata = { | 189 | static struct s3c2410_platform_i2c s5p6440_i2c0_data __initdata = { |
@@ -236,6 +257,10 @@ static void __init smdk6440_machine_init(void) | |||
236 | s5p6440_set_lcd_interface(); | 257 | s5p6440_set_lcd_interface(); |
237 | s3c_fb_set_platdata(&smdk6440_lcd_pdata); | 258 | s3c_fb_set_platdata(&smdk6440_lcd_pdata); |
238 | 259 | ||
260 | s3c_sdhci0_set_platdata(&smdk6440_hsmmc0_pdata); | ||
261 | s3c_sdhci1_set_platdata(&smdk6440_hsmmc1_pdata); | ||
262 | s3c_sdhci2_set_platdata(&smdk6440_hsmmc2_pdata); | ||
263 | |||
239 | platform_add_devices(smdk6440_devices, ARRAY_SIZE(smdk6440_devices)); | 264 | platform_add_devices(smdk6440_devices, ARRAY_SIZE(smdk6440_devices)); |
240 | } | 265 | } |
241 | 266 | ||
diff --git a/arch/arm/mach-s5p64x0/mach-smdk6450.c b/arch/arm/mach-s5p64x0/mach-smdk6450.c index 135cf5d84737..efb69e2f2afe 100644 --- a/arch/arm/mach-s5p64x0/mach-smdk6450.c +++ b/arch/arm/mach-s5p64x0/mach-smdk6450.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/gpio.h> | 24 | #include <linux/gpio.h> |
25 | #include <linux/pwm_backlight.h> | 25 | #include <linux/pwm_backlight.h> |
26 | #include <linux/fb.h> | 26 | #include <linux/fb.h> |
27 | #include <linux/mmc/host.h> | ||
27 | 28 | ||
28 | #include <video/platform_lcd.h> | 29 | #include <video/platform_lcd.h> |
29 | 30 | ||
@@ -52,6 +53,7 @@ | |||
52 | #include <plat/backlight.h> | 53 | #include <plat/backlight.h> |
53 | #include <plat/fb.h> | 54 | #include <plat/fb.h> |
54 | #include <plat/regs-fb.h> | 55 | #include <plat/regs-fb.h> |
56 | #include <plat/sdhci.h> | ||
55 | 57 | ||
56 | #include "common.h" | 58 | #include "common.h" |
57 | 59 | ||
@@ -181,10 +183,28 @@ static struct platform_device *smdk6450_devices[] __initdata = { | |||
181 | &s5p6450_device_iis0, | 183 | &s5p6450_device_iis0, |
182 | &s3c_device_fb, | 184 | &s3c_device_fb, |
183 | &smdk6450_lcd_lte480wv, | 185 | &smdk6450_lcd_lte480wv, |
184 | 186 | &s3c_device_hsmmc0, | |
187 | &s3c_device_hsmmc1, | ||
188 | &s3c_device_hsmmc2, | ||
185 | /* s5p6450_device_spi0 will be added */ | 189 | /* s5p6450_device_spi0 will be added */ |
186 | }; | 190 | }; |
187 | 191 | ||
192 | static struct s3c_sdhci_platdata smdk6450_hsmmc0_pdata __initdata = { | ||
193 | .cd_type = S3C_SDHCI_CD_NONE, | ||
194 | }; | ||
195 | |||
196 | static struct s3c_sdhci_platdata smdk6450_hsmmc1_pdata __initdata = { | ||
197 | .cd_type = S3C_SDHCI_CD_NONE, | ||
198 | #if defined(CONFIG_S5P64X0_SD_CH1_8BIT) | ||
199 | .max_width = 8, | ||
200 | .host_caps = MMC_CAP_8_BIT_DATA, | ||
201 | #endif | ||
202 | }; | ||
203 | |||
204 | static struct s3c_sdhci_platdata smdk6450_hsmmc2_pdata __initdata = { | ||
205 | .cd_type = S3C_SDHCI_CD_NONE, | ||
206 | }; | ||
207 | |||
188 | static struct s3c2410_platform_i2c s5p6450_i2c0_data __initdata = { | 208 | static struct s3c2410_platform_i2c s5p6450_i2c0_data __initdata = { |
189 | .flags = 0, | 209 | .flags = 0, |
190 | .slave_addr = 0x10, | 210 | .slave_addr = 0x10, |
@@ -256,6 +276,10 @@ static void __init smdk6450_machine_init(void) | |||
256 | s5p6450_set_lcd_interface(); | 276 | s5p6450_set_lcd_interface(); |
257 | s3c_fb_set_platdata(&smdk6450_lcd_pdata); | 277 | s3c_fb_set_platdata(&smdk6450_lcd_pdata); |
258 | 278 | ||
279 | s3c_sdhci0_set_platdata(&smdk6450_hsmmc0_pdata); | ||
280 | s3c_sdhci1_set_platdata(&smdk6450_hsmmc1_pdata); | ||
281 | s3c_sdhci2_set_platdata(&smdk6450_hsmmc2_pdata); | ||
282 | |||
259 | platform_add_devices(smdk6450_devices, ARRAY_SIZE(smdk6450_devices)); | 283 | platform_add_devices(smdk6450_devices, ARRAY_SIZE(smdk6450_devices)); |
260 | } | 284 | } |
261 | 285 | ||
diff --git a/arch/arm/mach-s5p64x0/setup-sdhci-gpio.c b/arch/arm/mach-s5p64x0/setup-sdhci-gpio.c new file mode 100644 index 000000000000..8410af0d12bf --- /dev/null +++ b/arch/arm/mach-s5p64x0/setup-sdhci-gpio.c | |||
@@ -0,0 +1,104 @@ | |||
1 | /* linux/arch/arm/mach-s5p64x0/setup-sdhci-gpio.c | ||
2 | * | ||
3 | * Copyright (c) 2011 Samsung Electronics Co., Ltd. | ||
4 | * http://www.samsung.com/ | ||
5 | * | ||
6 | * S5P64X0 - Helper functions for setting up SDHCI device(s) GPIO (HSMMC) | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | #include <linux/platform_device.h> | ||
14 | #include <linux/io.h> | ||
15 | #include <linux/gpio.h> | ||
16 | |||
17 | #include <mach/regs-gpio.h> | ||
18 | #include <mach/regs-clock.h> | ||
19 | |||
20 | #include <plat/gpio-cfg.h> | ||
21 | #include <plat/sdhci.h> | ||
22 | #include <plat/cpu.h> | ||
23 | |||
24 | void s5p64x0_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width) | ||
25 | { | ||
26 | struct s3c_sdhci_platdata *pdata = dev->dev.platform_data; | ||
27 | |||
28 | /* Set all the necessary GPG pins to special-function 2 */ | ||
29 | if (soc_is_s5p6450()) | ||
30 | s3c_gpio_cfgrange_nopull(S5P6450_GPG(0), 2 + width, | ||
31 | S3C_GPIO_SFN(2)); | ||
32 | else | ||
33 | s3c_gpio_cfgrange_nopull(S5P6440_GPG(0), 2 + width, | ||
34 | S3C_GPIO_SFN(2)); | ||
35 | |||
36 | /* Set GPG[6] pin to special-function 2 - MMC0 CDn */ | ||
37 | if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) { | ||
38 | if (soc_is_s5p6450()) { | ||
39 | s3c_gpio_setpull(S5P6450_GPG(6), S3C_GPIO_PULL_UP); | ||
40 | s3c_gpio_cfgpin(S5P6450_GPG(6), S3C_GPIO_SFN(2)); | ||
41 | } else { | ||
42 | s3c_gpio_setpull(S5P6440_GPG(6), S3C_GPIO_PULL_UP); | ||
43 | s3c_gpio_cfgpin(S5P6440_GPG(6), S3C_GPIO_SFN(2)); | ||
44 | } | ||
45 | } | ||
46 | } | ||
47 | |||
48 | void s5p64x0_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width) | ||
49 | { | ||
50 | struct s3c_sdhci_platdata *pdata = dev->dev.platform_data; | ||
51 | |||
52 | /* Set GPH[0:1] pins to special-function 2 - CLK and CMD */ | ||
53 | if (soc_is_s5p6450()) | ||
54 | s3c_gpio_cfgrange_nopull(S5P6450_GPH(0), 2, S3C_GPIO_SFN(2)); | ||
55 | else | ||
56 | s3c_gpio_cfgrange_nopull(S5P6440_GPH(0), 2 , S3C_GPIO_SFN(2)); | ||
57 | |||
58 | switch (width) { | ||
59 | case 8: | ||
60 | /* Set data pins GPH[6:9] special-function 2 */ | ||
61 | if (soc_is_s5p6450()) | ||
62 | s3c_gpio_cfgrange_nopull(S5P6450_GPH(6), 4, | ||
63 | S3C_GPIO_SFN(2)); | ||
64 | else | ||
65 | s3c_gpio_cfgrange_nopull(S5P6440_GPH(6), 4, | ||
66 | S3C_GPIO_SFN(2)); | ||
67 | case 4: | ||
68 | /* set data pins GPH[2:5] special-function 2 */ | ||
69 | if (soc_is_s5p6450()) | ||
70 | s3c_gpio_cfgrange_nopull(S5P6450_GPH(2), 4, | ||
71 | S3C_GPIO_SFN(2)); | ||
72 | else | ||
73 | s3c_gpio_cfgrange_nopull(S5P6440_GPH(2), 4, | ||
74 | S3C_GPIO_SFN(2)); | ||
75 | default: | ||
76 | break; | ||
77 | } | ||
78 | |||
79 | /* Set GPG[6] pin to special-funtion 3 : MMC1 CDn */ | ||
80 | if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) { | ||
81 | if (soc_is_s5p6450()) { | ||
82 | s3c_gpio_setpull(S5P6450_GPG(6), S3C_GPIO_PULL_UP); | ||
83 | s3c_gpio_cfgpin(S5P6450_GPG(6), S3C_GPIO_SFN(3)); | ||
84 | } else { | ||
85 | s3c_gpio_setpull(S5P6440_GPG(6), S3C_GPIO_PULL_UP); | ||
86 | s3c_gpio_cfgpin(S5P6440_GPG(6), S3C_GPIO_SFN(3)); | ||
87 | } | ||
88 | } | ||
89 | } | ||
90 | |||
91 | void s5p6440_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width) | ||
92 | { | ||
93 | /* Set GPC[4:5] pins to special-function 3 - CLK and CMD */ | ||
94 | s3c_gpio_cfgrange_nopull(S5P6440_GPC(4), 2, S3C_GPIO_SFN(3)); | ||
95 | |||
96 | /* Set data pins GPH[6:9] pins to special-function 3 */ | ||
97 | s3c_gpio_cfgrange_nopull(S5P6440_GPH(6), 4, S3C_GPIO_SFN(3)); | ||
98 | } | ||
99 | |||
100 | void s5p6450_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width) | ||
101 | { | ||
102 | /* Set all the necessary GPG pins to special-function 3 */ | ||
103 | s3c_gpio_cfgrange_nopull(S5P6450_GPG(7), 2 + width, S3C_GPIO_SFN(3)); | ||
104 | } | ||