diff options
Diffstat (limited to 'arch/arm/mach-s5pv210')
-rw-r--r-- | arch/arm/mach-s5pv210/Kconfig | 5 | ||||
-rw-r--r-- | arch/arm/mach-s5pv210/Makefile | 20 | ||||
-rw-r--r-- | arch/arm/mach-s5pv210/clock.c | 327 | ||||
-rw-r--r-- | arch/arm/mach-s5pv210/common.c (renamed from arch/arm/mach-s5pv210/cpu.c) | 94 | ||||
-rw-r--r-- | arch/arm/mach-s5pv210/common.h | 37 | ||||
-rw-r--r-- | arch/arm/mach-s5pv210/dev-spi.c | 175 | ||||
-rw-r--r-- | arch/arm/mach-s5pv210/dma.c | 241 | ||||
-rw-r--r-- | arch/arm/mach-s5pv210/include/mach/irqs.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-s5pv210/include/mach/map.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-s5pv210/include/mach/system.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-s5pv210/init.c | 44 | ||||
-rw-r--r-- | arch/arm/mach-s5pv210/mach-aquila.c | 9 | ||||
-rw-r--r-- | arch/arm/mach-s5pv210/mach-goni.c | 12 | ||||
-rw-r--r-- | arch/arm/mach-s5pv210/mach-smdkc110.c | 6 | ||||
-rw-r--r-- | arch/arm/mach-s5pv210/mach-smdkv210.c | 16 | ||||
-rw-r--r-- | arch/arm/mach-s5pv210/mach-torbreck.c | 6 | ||||
-rw-r--r-- | arch/arm/mach-s5pv210/setup-sdhci.c | 22 | ||||
-rw-r--r-- | arch/arm/mach-s5pv210/setup-spi.c | 51 |
18 files changed, 481 insertions, 590 deletions
diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig index 646057ab2e4..2cdc42e838b 100644 --- a/arch/arm/mach-s5pv210/Kconfig +++ b/arch/arm/mach-s5pv210/Kconfig | |||
@@ -60,6 +60,11 @@ config S5PV210_SETUP_FIMC | |||
60 | help | 60 | help |
61 | Common setup code for the camera interfaces. | 61 | Common setup code for the camera interfaces. |
62 | 62 | ||
63 | config S5PV210_SETUP_SPI | ||
64 | bool | ||
65 | help | ||
66 | Common setup code for SPI GPIO configurations. | ||
67 | |||
63 | menu "S5PC110 Machines" | 68 | menu "S5PC110 Machines" |
64 | 69 | ||
65 | config MACH_AQUILA | 70 | config MACH_AQUILA |
diff --git a/arch/arm/mach-s5pv210/Makefile b/arch/arm/mach-s5pv210/Makefile index 009fbe53df9..76a121dd52b 100644 --- a/arch/arm/mach-s5pv210/Makefile +++ b/arch/arm/mach-s5pv210/Makefile | |||
@@ -10,30 +10,32 @@ obj-m := | |||
10 | obj-n := | 10 | obj-n := |
11 | obj- := | 11 | obj- := |
12 | 12 | ||
13 | # Core support for S5PV210 system | 13 | # Core |
14 | |||
15 | obj-y += common.o clock.o | ||
14 | 16 | ||
15 | obj-$(CONFIG_CPU_S5PV210) += cpu.o init.o clock.o dma.o | ||
16 | obj-$(CONFIG_CPU_S5PV210) += setup-i2c0.o | ||
17 | obj-$(CONFIG_PM) += pm.o | 17 | obj-$(CONFIG_PM) += pm.o |
18 | 18 | ||
19 | obj-y += dma.o | ||
20 | |||
19 | # machine support | 21 | # machine support |
20 | 22 | ||
21 | obj-$(CONFIG_MACH_AQUILA) += mach-aquila.o | 23 | obj-$(CONFIG_MACH_AQUILA) += mach-aquila.o |
22 | obj-$(CONFIG_MACH_SMDKV210) += mach-smdkv210.o | ||
23 | obj-$(CONFIG_MACH_SMDKC110) += mach-smdkc110.o | ||
24 | obj-$(CONFIG_MACH_GONI) += mach-goni.o | 24 | obj-$(CONFIG_MACH_GONI) += mach-goni.o |
25 | obj-$(CONFIG_MACH_SMDKC110) += mach-smdkc110.o | ||
26 | obj-$(CONFIG_MACH_SMDKV210) += mach-smdkv210.o | ||
25 | obj-$(CONFIG_MACH_TORBRECK) += mach-torbreck.o | 27 | obj-$(CONFIG_MACH_TORBRECK) += mach-torbreck.o |
26 | 28 | ||
27 | # device support | 29 | # device support |
28 | 30 | ||
29 | obj-y += dev-audio.o | 31 | obj-y += dev-audio.o |
30 | obj-$(CONFIG_S3C64XX_DEV_SPI) += dev-spi.o | ||
31 | 32 | ||
33 | obj-y += setup-i2c0.o | ||
32 | obj-$(CONFIG_S5PV210_SETUP_FB_24BPP) += setup-fb-24bpp.o | 34 | obj-$(CONFIG_S5PV210_SETUP_FB_24BPP) += setup-fb-24bpp.o |
33 | obj-$(CONFIG_S5PV210_SETUP_FIMC) += setup-fimc.o | 35 | obj-$(CONFIG_S5PV210_SETUP_FIMC) += setup-fimc.o |
34 | obj-$(CONFIG_S5PV210_SETUP_I2C1) += setup-i2c1.o | 36 | obj-$(CONFIG_S5PV210_SETUP_I2C1) += setup-i2c1.o |
35 | obj-$(CONFIG_S5PV210_SETUP_I2C2) += setup-i2c2.o | 37 | obj-$(CONFIG_S5PV210_SETUP_I2C2) += setup-i2c2.o |
36 | obj-$(CONFIG_S5PV210_SETUP_IDE) += setup-ide.o | 38 | obj-$(CONFIG_S5PV210_SETUP_IDE) += setup-ide.o |
37 | obj-$(CONFIG_S5PV210_SETUP_KEYPAD) += setup-keypad.o | 39 | obj-$(CONFIG_S5PV210_SETUP_KEYPAD) += setup-keypad.o |
38 | obj-$(CONFIG_S5PV210_SETUP_SDHCI) += setup-sdhci.o | ||
39 | obj-$(CONFIG_S5PV210_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o | 40 | obj-$(CONFIG_S5PV210_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o |
41 | obj-$(CONFIG_S5PV210_SETUP_SPI) += setup-spi.o | ||
diff --git a/arch/arm/mach-s5pv210/clock.c b/arch/arm/mach-s5pv210/clock.c index 4c5ac7a69e9..11db6c0fb66 100644 --- a/arch/arm/mach-s5pv210/clock.c +++ b/arch/arm/mach-s5pv210/clock.c | |||
@@ -29,7 +29,8 @@ | |||
29 | #include <plat/pll.h> | 29 | #include <plat/pll.h> |
30 | #include <plat/s5p-clock.h> | 30 | #include <plat/s5p-clock.h> |
31 | #include <plat/clock-clksrc.h> | 31 | #include <plat/clock-clksrc.h> |
32 | #include <plat/s5pv210.h> | 32 | |
33 | #include "common.h" | ||
33 | 34 | ||
34 | static unsigned long xtal; | 35 | static unsigned long xtal; |
35 | 36 | ||
@@ -399,30 +400,6 @@ static struct clk init_clocks_off[] = { | |||
399 | .enable = s5pv210_clk_ip1_ctrl, | 400 | .enable = s5pv210_clk_ip1_ctrl, |
400 | .ctrlbit = (1<<25), | 401 | .ctrlbit = (1<<25), |
401 | }, { | 402 | }, { |
402 | .name = "hsmmc", | ||
403 | .devname = "s3c-sdhci.0", | ||
404 | .parent = &clk_hclk_psys.clk, | ||
405 | .enable = s5pv210_clk_ip2_ctrl, | ||
406 | .ctrlbit = (1<<16), | ||
407 | }, { | ||
408 | .name = "hsmmc", | ||
409 | .devname = "s3c-sdhci.1", | ||
410 | .parent = &clk_hclk_psys.clk, | ||
411 | .enable = s5pv210_clk_ip2_ctrl, | ||
412 | .ctrlbit = (1<<17), | ||
413 | }, { | ||
414 | .name = "hsmmc", | ||
415 | .devname = "s3c-sdhci.2", | ||
416 | .parent = &clk_hclk_psys.clk, | ||
417 | .enable = s5pv210_clk_ip2_ctrl, | ||
418 | .ctrlbit = (1<<18), | ||
419 | }, { | ||
420 | .name = "hsmmc", | ||
421 | .devname = "s3c-sdhci.3", | ||
422 | .parent = &clk_hclk_psys.clk, | ||
423 | .enable = s5pv210_clk_ip2_ctrl, | ||
424 | .ctrlbit = (1<<19), | ||
425 | }, { | ||
426 | .name = "systimer", | 403 | .name = "systimer", |
427 | .parent = &clk_pclk_psys.clk, | 404 | .parent = &clk_pclk_psys.clk, |
428 | .enable = s5pv210_clk_ip3_ctrl, | 405 | .enable = s5pv210_clk_ip3_ctrl, |
@@ -559,6 +536,38 @@ static struct clk init_clocks[] = { | |||
559 | }, | 536 | }, |
560 | }; | 537 | }; |
561 | 538 | ||
539 | static struct clk clk_hsmmc0 = { | ||
540 | .name = "hsmmc", | ||
541 | .devname = "s3c-sdhci.0", | ||
542 | .parent = &clk_hclk_psys.clk, | ||
543 | .enable = s5pv210_clk_ip2_ctrl, | ||
544 | .ctrlbit = (1<<16), | ||
545 | }; | ||
546 | |||
547 | static struct clk clk_hsmmc1 = { | ||
548 | .name = "hsmmc", | ||
549 | .devname = "s3c-sdhci.1", | ||
550 | .parent = &clk_hclk_psys.clk, | ||
551 | .enable = s5pv210_clk_ip2_ctrl, | ||
552 | .ctrlbit = (1<<17), | ||
553 | }; | ||
554 | |||
555 | static struct clk clk_hsmmc2 = { | ||
556 | .name = "hsmmc", | ||
557 | .devname = "s3c-sdhci.2", | ||
558 | .parent = &clk_hclk_psys.clk, | ||
559 | .enable = s5pv210_clk_ip2_ctrl, | ||
560 | .ctrlbit = (1<<18), | ||
561 | }; | ||
562 | |||
563 | static struct clk clk_hsmmc3 = { | ||
564 | .name = "hsmmc", | ||
565 | .devname = "s3c-sdhci.3", | ||
566 | .parent = &clk_hclk_psys.clk, | ||
567 | .enable = s5pv210_clk_ip2_ctrl, | ||
568 | .ctrlbit = (1<<19), | ||
569 | }; | ||
570 | |||
562 | static struct clk *clkset_uart_list[] = { | 571 | static struct clk *clkset_uart_list[] = { |
563 | [6] = &clk_mout_mpll.clk, | 572 | [6] = &clk_mout_mpll.clk, |
564 | [7] = &clk_mout_epll.clk, | 573 | [7] = &clk_mout_epll.clk, |
@@ -809,46 +818,6 @@ static struct clksrc_clk clksrcs[] = { | |||
809 | .reg_div = { .reg = S5P_CLK_DIV6, .shift = 12, .size = 3 }, | 818 | .reg_div = { .reg = S5P_CLK_DIV6, .shift = 12, .size = 3 }, |
810 | }, { | 819 | }, { |
811 | .clk = { | 820 | .clk = { |
812 | .name = "uclk1", | ||
813 | .devname = "s5pv210-uart.0", | ||
814 | .enable = s5pv210_clk_mask0_ctrl, | ||
815 | .ctrlbit = (1 << 12), | ||
816 | }, | ||
817 | .sources = &clkset_uart, | ||
818 | .reg_src = { .reg = S5P_CLK_SRC4, .shift = 16, .size = 4 }, | ||
819 | .reg_div = { .reg = S5P_CLK_DIV4, .shift = 16, .size = 4 }, | ||
820 | }, { | ||
821 | .clk = { | ||
822 | .name = "uclk1", | ||
823 | .devname = "s5pv210-uart.1", | ||
824 | .enable = s5pv210_clk_mask0_ctrl, | ||
825 | .ctrlbit = (1 << 13), | ||
826 | }, | ||
827 | .sources = &clkset_uart, | ||
828 | .reg_src = { .reg = S5P_CLK_SRC4, .shift = 20, .size = 4 }, | ||
829 | .reg_div = { .reg = S5P_CLK_DIV4, .shift = 20, .size = 4 }, | ||
830 | }, { | ||
831 | .clk = { | ||
832 | .name = "uclk1", | ||
833 | .devname = "s5pv210-uart.2", | ||
834 | .enable = s5pv210_clk_mask0_ctrl, | ||
835 | .ctrlbit = (1 << 14), | ||
836 | }, | ||
837 | .sources = &clkset_uart, | ||
838 | .reg_src = { .reg = S5P_CLK_SRC4, .shift = 24, .size = 4 }, | ||
839 | .reg_div = { .reg = S5P_CLK_DIV4, .shift = 24, .size = 4 }, | ||
840 | }, { | ||
841 | .clk = { | ||
842 | .name = "uclk1", | ||
843 | .devname = "s5pv210-uart.3", | ||
844 | .enable = s5pv210_clk_mask0_ctrl, | ||
845 | .ctrlbit = (1 << 15), | ||
846 | }, | ||
847 | .sources = &clkset_uart, | ||
848 | .reg_src = { .reg = S5P_CLK_SRC4, .shift = 28, .size = 4 }, | ||
849 | .reg_div = { .reg = S5P_CLK_DIV4, .shift = 28, .size = 4 }, | ||
850 | }, { | ||
851 | .clk = { | ||
852 | .name = "sclk_fimc", | 821 | .name = "sclk_fimc", |
853 | .devname = "s5pv210-fimc.0", | 822 | .devname = "s5pv210-fimc.0", |
854 | .enable = s5pv210_clk_mask1_ctrl, | 823 | .enable = s5pv210_clk_mask1_ctrl, |
@@ -906,46 +875,6 @@ static struct clksrc_clk clksrcs[] = { | |||
906 | .reg_div = { .reg = S5P_CLK_DIV1, .shift = 20, .size = 4 }, | 875 | .reg_div = { .reg = S5P_CLK_DIV1, .shift = 20, .size = 4 }, |
907 | }, { | 876 | }, { |
908 | .clk = { | 877 | .clk = { |
909 | .name = "sclk_mmc", | ||
910 | .devname = "s3c-sdhci.0", | ||
911 | .enable = s5pv210_clk_mask0_ctrl, | ||
912 | .ctrlbit = (1 << 8), | ||
913 | }, | ||
914 | .sources = &clkset_group2, | ||
915 | .reg_src = { .reg = S5P_CLK_SRC4, .shift = 0, .size = 4 }, | ||
916 | .reg_div = { .reg = S5P_CLK_DIV4, .shift = 0, .size = 4 }, | ||
917 | }, { | ||
918 | .clk = { | ||
919 | .name = "sclk_mmc", | ||
920 | .devname = "s3c-sdhci.1", | ||
921 | .enable = s5pv210_clk_mask0_ctrl, | ||
922 | .ctrlbit = (1 << 9), | ||
923 | }, | ||
924 | .sources = &clkset_group2, | ||
925 | .reg_src = { .reg = S5P_CLK_SRC4, .shift = 4, .size = 4 }, | ||
926 | .reg_div = { .reg = S5P_CLK_DIV4, .shift = 4, .size = 4 }, | ||
927 | }, { | ||
928 | .clk = { | ||
929 | .name = "sclk_mmc", | ||
930 | .devname = "s3c-sdhci.2", | ||
931 | .enable = s5pv210_clk_mask0_ctrl, | ||
932 | .ctrlbit = (1 << 10), | ||
933 | }, | ||
934 | .sources = &clkset_group2, | ||
935 | .reg_src = { .reg = S5P_CLK_SRC4, .shift = 8, .size = 4 }, | ||
936 | .reg_div = { .reg = S5P_CLK_DIV4, .shift = 8, .size = 4 }, | ||
937 | }, { | ||
938 | .clk = { | ||
939 | .name = "sclk_mmc", | ||
940 | .devname = "s3c-sdhci.3", | ||
941 | .enable = s5pv210_clk_mask0_ctrl, | ||
942 | .ctrlbit = (1 << 11), | ||
943 | }, | ||
944 | .sources = &clkset_group2, | ||
945 | .reg_src = { .reg = S5P_CLK_SRC4, .shift = 12, .size = 4 }, | ||
946 | .reg_div = { .reg = S5P_CLK_DIV4, .shift = 12, .size = 4 }, | ||
947 | }, { | ||
948 | .clk = { | ||
949 | .name = "sclk_mfc", | 878 | .name = "sclk_mfc", |
950 | .devname = "s5p-mfc", | 879 | .devname = "s5p-mfc", |
951 | .enable = s5pv210_clk_ip0_ctrl, | 880 | .enable = s5pv210_clk_ip0_ctrl, |
@@ -983,26 +912,6 @@ static struct clksrc_clk clksrcs[] = { | |||
983 | .reg_div = { .reg = S5P_CLK_DIV1, .shift = 28, .size = 4 }, | 912 | .reg_div = { .reg = S5P_CLK_DIV1, .shift = 28, .size = 4 }, |
984 | }, { | 913 | }, { |
985 | .clk = { | 914 | .clk = { |
986 | .name = "sclk_spi", | ||
987 | .devname = "s3c64xx-spi.0", | ||
988 | .enable = s5pv210_clk_mask0_ctrl, | ||
989 | .ctrlbit = (1 << 16), | ||
990 | }, | ||
991 | .sources = &clkset_group2, | ||
992 | .reg_src = { .reg = S5P_CLK_SRC5, .shift = 0, .size = 4 }, | ||
993 | .reg_div = { .reg = S5P_CLK_DIV5, .shift = 0, .size = 4 }, | ||
994 | }, { | ||
995 | .clk = { | ||
996 | .name = "sclk_spi", | ||
997 | .devname = "s3c64xx-spi.1", | ||
998 | .enable = s5pv210_clk_mask0_ctrl, | ||
999 | .ctrlbit = (1 << 17), | ||
1000 | }, | ||
1001 | .sources = &clkset_group2, | ||
1002 | .reg_src = { .reg = S5P_CLK_SRC5, .shift = 4, .size = 4 }, | ||
1003 | .reg_div = { .reg = S5P_CLK_DIV5, .shift = 4, .size = 4 }, | ||
1004 | }, { | ||
1005 | .clk = { | ||
1006 | .name = "sclk_pwi", | 915 | .name = "sclk_pwi", |
1007 | .enable = s5pv210_clk_mask0_ctrl, | 916 | .enable = s5pv210_clk_mask0_ctrl, |
1008 | .ctrlbit = (1 << 29), | 917 | .ctrlbit = (1 << 29), |
@@ -1022,6 +931,147 @@ static struct clksrc_clk clksrcs[] = { | |||
1022 | }, | 931 | }, |
1023 | }; | 932 | }; |
1024 | 933 | ||
934 | static struct clksrc_clk clk_sclk_uart0 = { | ||
935 | .clk = { | ||
936 | .name = "uclk1", | ||
937 | .devname = "s5pv210-uart.0", | ||
938 | .enable = s5pv210_clk_mask0_ctrl, | ||
939 | .ctrlbit = (1 << 12), | ||
940 | }, | ||
941 | .sources = &clkset_uart, | ||
942 | .reg_src = { .reg = S5P_CLK_SRC4, .shift = 16, .size = 4 }, | ||
943 | .reg_div = { .reg = S5P_CLK_DIV4, .shift = 16, .size = 4 }, | ||
944 | }; | ||
945 | |||
946 | static struct clksrc_clk clk_sclk_uart1 = { | ||
947 | .clk = { | ||
948 | .name = "uclk1", | ||
949 | .devname = "s5pv210-uart.1", | ||
950 | .enable = s5pv210_clk_mask0_ctrl, | ||
951 | .ctrlbit = (1 << 13), | ||
952 | }, | ||
953 | .sources = &clkset_uart, | ||
954 | .reg_src = { .reg = S5P_CLK_SRC4, .shift = 20, .size = 4 }, | ||
955 | .reg_div = { .reg = S5P_CLK_DIV4, .shift = 20, .size = 4 }, | ||
956 | }; | ||
957 | |||
958 | static struct clksrc_clk clk_sclk_uart2 = { | ||
959 | .clk = { | ||
960 | .name = "uclk1", | ||
961 | .devname = "s5pv210-uart.2", | ||
962 | .enable = s5pv210_clk_mask0_ctrl, | ||
963 | .ctrlbit = (1 << 14), | ||
964 | }, | ||
965 | .sources = &clkset_uart, | ||
966 | .reg_src = { .reg = S5P_CLK_SRC4, .shift = 24, .size = 4 }, | ||
967 | .reg_div = { .reg = S5P_CLK_DIV4, .shift = 24, .size = 4 }, | ||
968 | }; | ||
969 | |||
970 | static struct clksrc_clk clk_sclk_uart3 = { | ||
971 | .clk = { | ||
972 | .name = "uclk1", | ||
973 | .devname = "s5pv210-uart.3", | ||
974 | .enable = s5pv210_clk_mask0_ctrl, | ||
975 | .ctrlbit = (1 << 15), | ||
976 | }, | ||
977 | .sources = &clkset_uart, | ||
978 | .reg_src = { .reg = S5P_CLK_SRC4, .shift = 28, .size = 4 }, | ||
979 | .reg_div = { .reg = S5P_CLK_DIV4, .shift = 28, .size = 4 }, | ||
980 | }; | ||
981 | |||
982 | static struct clksrc_clk clk_sclk_mmc0 = { | ||
983 | .clk = { | ||
984 | .name = "sclk_mmc", | ||
985 | .devname = "s3c-sdhci.0", | ||
986 | .enable = s5pv210_clk_mask0_ctrl, | ||
987 | .ctrlbit = (1 << 8), | ||
988 | }, | ||
989 | .sources = &clkset_group2, | ||
990 | .reg_src = { .reg = S5P_CLK_SRC4, .shift = 0, .size = 4 }, | ||
991 | .reg_div = { .reg = S5P_CLK_DIV4, .shift = 0, .size = 4 }, | ||
992 | }; | ||
993 | |||
994 | static struct clksrc_clk clk_sclk_mmc1 = { | ||
995 | .clk = { | ||
996 | .name = "sclk_mmc", | ||
997 | .devname = "s3c-sdhci.1", | ||
998 | .enable = s5pv210_clk_mask0_ctrl, | ||
999 | .ctrlbit = (1 << 9), | ||
1000 | }, | ||
1001 | .sources = &clkset_group2, | ||
1002 | .reg_src = { .reg = S5P_CLK_SRC4, .shift = 4, .size = 4 }, | ||
1003 | .reg_div = { .reg = S5P_CLK_DIV4, .shift = 4, .size = 4 }, | ||
1004 | }; | ||
1005 | |||
1006 | static struct clksrc_clk clk_sclk_mmc2 = { | ||
1007 | .clk = { | ||
1008 | .name = "sclk_mmc", | ||
1009 | .devname = "s3c-sdhci.2", | ||
1010 | .enable = s5pv210_clk_mask0_ctrl, | ||
1011 | .ctrlbit = (1 << 10), | ||
1012 | }, | ||
1013 | .sources = &clkset_group2, | ||
1014 | .reg_src = { .reg = S5P_CLK_SRC4, .shift = 8, .size = 4 }, | ||
1015 | .reg_div = { .reg = S5P_CLK_DIV4, .shift = 8, .size = 4 }, | ||
1016 | }; | ||
1017 | |||
1018 | static struct clksrc_clk clk_sclk_mmc3 = { | ||
1019 | .clk = { | ||
1020 | .name = "sclk_mmc", | ||
1021 | .devname = "s3c-sdhci.3", | ||
1022 | .enable = s5pv210_clk_mask0_ctrl, | ||
1023 | .ctrlbit = (1 << 11), | ||
1024 | }, | ||
1025 | .sources = &clkset_group2, | ||
1026 | .reg_src = { .reg = S5P_CLK_SRC4, .shift = 12, .size = 4 }, | ||
1027 | .reg_div = { .reg = S5P_CLK_DIV4, .shift = 12, .size = 4 }, | ||
1028 | }; | ||
1029 | |||
1030 | static struct clksrc_clk clk_sclk_spi0 = { | ||
1031 | .clk = { | ||
1032 | .name = "sclk_spi", | ||
1033 | .devname = "s3c64xx-spi.0", | ||
1034 | .enable = s5pv210_clk_mask0_ctrl, | ||
1035 | .ctrlbit = (1 << 16), | ||
1036 | }, | ||
1037 | .sources = &clkset_group2, | ||
1038 | .reg_src = { .reg = S5P_CLK_SRC5, .shift = 0, .size = 4 }, | ||
1039 | .reg_div = { .reg = S5P_CLK_DIV5, .shift = 0, .size = 4 }, | ||
1040 | }; | ||
1041 | |||
1042 | static struct clksrc_clk clk_sclk_spi1 = { | ||
1043 | .clk = { | ||
1044 | .name = "sclk_spi", | ||
1045 | .devname = "s3c64xx-spi.1", | ||
1046 | .enable = s5pv210_clk_mask0_ctrl, | ||
1047 | .ctrlbit = (1 << 17), | ||
1048 | }, | ||
1049 | .sources = &clkset_group2, | ||
1050 | .reg_src = { .reg = S5P_CLK_SRC5, .shift = 4, .size = 4 }, | ||
1051 | .reg_div = { .reg = S5P_CLK_DIV5, .shift = 4, .size = 4 }, | ||
1052 | }; | ||
1053 | |||
1054 | |||
1055 | static struct clksrc_clk *clksrc_cdev[] = { | ||
1056 | &clk_sclk_uart0, | ||
1057 | &clk_sclk_uart1, | ||
1058 | &clk_sclk_uart2, | ||
1059 | &clk_sclk_uart3, | ||
1060 | &clk_sclk_mmc0, | ||
1061 | &clk_sclk_mmc1, | ||
1062 | &clk_sclk_mmc2, | ||
1063 | &clk_sclk_mmc3, | ||
1064 | &clk_sclk_spi0, | ||
1065 | &clk_sclk_spi1, | ||
1066 | }; | ||
1067 | |||
1068 | static struct clk *clk_cdev[] = { | ||
1069 | &clk_hsmmc0, | ||
1070 | &clk_hsmmc1, | ||
1071 | &clk_hsmmc2, | ||
1072 | &clk_hsmmc3, | ||
1073 | }; | ||
1074 | |||
1025 | /* Clock initialisation code */ | 1075 | /* Clock initialisation code */ |
1026 | static struct clksrc_clk *sysclks[] = { | 1076 | static struct clksrc_clk *sysclks[] = { |
1027 | &clk_mout_apll, | 1077 | &clk_mout_apll, |
@@ -1261,6 +1311,25 @@ static struct clk *clks[] __initdata = { | |||
1261 | &clk_pcmcdclk2, | 1311 | &clk_pcmcdclk2, |
1262 | }; | 1312 | }; |
1263 | 1313 | ||
1314 | static struct clk_lookup s5pv210_clk_lookup[] = { | ||
1315 | CLKDEV_INIT(NULL, "clk_uart_baud0", &clk_p), | ||
1316 | CLKDEV_INIT("s5pv210-uart.0", "clk_uart_baud1", &clk_sclk_uart0.clk), | ||
1317 | CLKDEV_INIT("s5pv210-uart.1", "clk_uart_baud1", &clk_sclk_uart1.clk), | ||
1318 | CLKDEV_INIT("s5pv210-uart.2", "clk_uart_baud1", &clk_sclk_uart2.clk), | ||
1319 | CLKDEV_INIT("s5pv210-uart.3", "clk_uart_baud1", &clk_sclk_uart3.clk), | ||
1320 | CLKDEV_INIT("s3c-sdhci.0", "mmc_busclk.0", &clk_hsmmc0), | ||
1321 | CLKDEV_INIT("s3c-sdhci.1", "mmc_busclk.0", &clk_hsmmc1), | ||
1322 | CLKDEV_INIT("s3c-sdhci.2", "mmc_busclk.0", &clk_hsmmc2), | ||
1323 | CLKDEV_INIT("s3c-sdhci.3", "mmc_busclk.0", &clk_hsmmc3), | ||
1324 | CLKDEV_INIT("s3c-sdhci.0", "mmc_busclk.2", &clk_sclk_mmc0.clk), | ||
1325 | CLKDEV_INIT("s3c-sdhci.1", "mmc_busclk.2", &clk_sclk_mmc1.clk), | ||
1326 | CLKDEV_INIT("s3c-sdhci.2", "mmc_busclk.2", &clk_sclk_mmc2.clk), | ||
1327 | CLKDEV_INIT("s3c-sdhci.3", "mmc_busclk.2", &clk_sclk_mmc3.clk), | ||
1328 | CLKDEV_INIT(NULL, "spi_busclk0", &clk_p), | ||
1329 | CLKDEV_INIT("s3c64xx-spi.0", "spi_busclk1", &clk_sclk_spi0.clk), | ||
1330 | CLKDEV_INIT("s3c64xx-spi.1", "spi_busclk1", &clk_sclk_spi1.clk), | ||
1331 | }; | ||
1332 | |||
1264 | void __init s5pv210_register_clocks(void) | 1333 | void __init s5pv210_register_clocks(void) |
1265 | { | 1334 | { |
1266 | int ptr; | 1335 | int ptr; |
@@ -1273,11 +1342,19 @@ void __init s5pv210_register_clocks(void) | |||
1273 | for (ptr = 0; ptr < ARRAY_SIZE(sclk_tv); ptr++) | 1342 | for (ptr = 0; ptr < ARRAY_SIZE(sclk_tv); ptr++) |
1274 | s3c_register_clksrc(sclk_tv[ptr], 1); | 1343 | s3c_register_clksrc(sclk_tv[ptr], 1); |
1275 | 1344 | ||
1345 | for (ptr = 0; ptr < ARRAY_SIZE(clksrc_cdev); ptr++) | ||
1346 | s3c_register_clksrc(clksrc_cdev[ptr], 1); | ||
1347 | |||
1276 | s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); | 1348 | s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); |
1277 | s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); | 1349 | s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); |
1278 | 1350 | ||
1279 | s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); | 1351 | s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); |
1280 | s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); | 1352 | s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); |
1353 | clkdev_add_table(s5pv210_clk_lookup, ARRAY_SIZE(s5pv210_clk_lookup)); | ||
1354 | |||
1355 | s3c24xx_register_clocks(clk_cdev, ARRAY_SIZE(clk_cdev)); | ||
1356 | for (ptr = 0; ptr < ARRAY_SIZE(clk_cdev); ptr++) | ||
1357 | s3c_disable_clocks(clk_cdev[ptr], 1); | ||
1281 | 1358 | ||
1282 | s3c24xx_register_clock(&dummy_apb_pclk); | 1359 | s3c24xx_register_clock(&dummy_apb_pclk); |
1283 | s3c_pwmclk_init(); | 1360 | s3c_pwmclk_init(); |
diff --git a/arch/arm/mach-s5pv210/cpu.c b/arch/arm/mach-s5pv210/common.c index 84ec7463323..b9adefd9838 100644 --- a/arch/arm/mach-s5pv210/cpu.c +++ b/arch/arm/mach-s5pv210/common.c | |||
@@ -1,12 +1,13 @@ | |||
1 | /* linux/arch/arm/mach-s5pv210/cpu.c | 1 | /* |
2 | * | 2 | * Copyright (c) 2009-2011 Samsung Electronics Co., Ltd. |
3 | * Copyright (c) 2010 Samsung Electronics Co., Ltd. | ||
4 | * http://www.samsung.com | 3 | * http://www.samsung.com |
5 | * | 4 | * |
5 | * Common Codes for S5PV210 | ||
6 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | 7 | * 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 | * it under the terms of the GNU General Public License version 2 as |
8 | * published by the Free Software Foundation. | 9 | * published by the Free Software Foundation. |
9 | */ | 10 | */ |
10 | 11 | ||
11 | #include <linux/kernel.h> | 12 | #include <linux/kernel.h> |
12 | #include <linux/types.h> | 13 | #include <linux/types.h> |
@@ -21,33 +22,74 @@ | |||
21 | #include <linux/platform_device.h> | 22 | #include <linux/platform_device.h> |
22 | #include <linux/sched.h> | 23 | #include <linux/sched.h> |
23 | #include <linux/dma-mapping.h> | 24 | #include <linux/dma-mapping.h> |
25 | #include <linux/serial_core.h> | ||
24 | 26 | ||
27 | #include <asm/proc-fns.h> | ||
25 | #include <asm/mach/arch.h> | 28 | #include <asm/mach/arch.h> |
26 | #include <asm/mach/map.h> | 29 | #include <asm/mach/map.h> |
27 | #include <asm/mach/irq.h> | 30 | #include <asm/mach/irq.h> |
28 | 31 | ||
29 | #include <asm/proc-fns.h> | ||
30 | #include <mach/map.h> | 32 | #include <mach/map.h> |
31 | #include <mach/regs-clock.h> | 33 | #include <mach/regs-clock.h> |
32 | 34 | ||
33 | #include <plat/cpu.h> | 35 | #include <plat/cpu.h> |
34 | #include <plat/devs.h> | ||
35 | #include <plat/clock.h> | 36 | #include <plat/clock.h> |
36 | #include <plat/fb-core.h> | 37 | #include <plat/devs.h> |
37 | #include <plat/s5pv210.h> | 38 | #include <plat/sdhci.h> |
38 | #include <plat/adc-core.h> | 39 | #include <plat/adc-core.h> |
39 | #include <plat/ata-core.h> | 40 | #include <plat/ata-core.h> |
41 | #include <plat/fb-core.h> | ||
40 | #include <plat/fimc-core.h> | 42 | #include <plat/fimc-core.h> |
41 | #include <plat/iic-core.h> | 43 | #include <plat/iic-core.h> |
42 | #include <plat/keypad-core.h> | 44 | #include <plat/keypad-core.h> |
43 | #include <plat/sdhci.h> | ||
44 | #include <plat/reset.h> | ||
45 | #include <plat/tv-core.h> | 45 | #include <plat/tv-core.h> |
46 | #include <plat/regs-serial.h> | ||
47 | |||
48 | #include "common.h" | ||
49 | |||
50 | static const char name_s5pv210[] = "S5PV210/S5PC110"; | ||
51 | |||
52 | static struct cpu_table cpu_ids[] __initdata = { | ||
53 | { | ||
54 | .idcode = S5PV210_CPU_ID, | ||
55 | .idmask = S5PV210_CPU_MASK, | ||
56 | .map_io = s5pv210_map_io, | ||
57 | .init_clocks = s5pv210_init_clocks, | ||
58 | .init_uarts = s5pv210_init_uarts, | ||
59 | .init = s5pv210_init, | ||
60 | .name = name_s5pv210, | ||
61 | }, | ||
62 | }; | ||
46 | 63 | ||
47 | /* Initial IO mappings */ | 64 | /* Initial IO mappings */ |
48 | 65 | ||
49 | static struct map_desc s5pv210_iodesc[] __initdata = { | 66 | static struct map_desc s5pv210_iodesc[] __initdata = { |
50 | { | 67 | { |
68 | .virtual = (unsigned long)S5P_VA_CHIPID, | ||
69 | .pfn = __phys_to_pfn(S5PV210_PA_CHIPID), | ||
70 | .length = SZ_4K, | ||
71 | .type = MT_DEVICE, | ||
72 | }, { | ||
73 | .virtual = (unsigned long)S3C_VA_SYS, | ||
74 | .pfn = __phys_to_pfn(S5PV210_PA_SYSCON), | ||
75 | .length = SZ_64K, | ||
76 | .type = MT_DEVICE, | ||
77 | }, { | ||
78 | .virtual = (unsigned long)S3C_VA_TIMER, | ||
79 | .pfn = __phys_to_pfn(S5PV210_PA_TIMER), | ||
80 | .length = SZ_16K, | ||
81 | .type = MT_DEVICE, | ||
82 | }, { | ||
83 | .virtual = (unsigned long)S3C_VA_WATCHDOG, | ||
84 | .pfn = __phys_to_pfn(S5PV210_PA_WATCHDOG), | ||
85 | .length = SZ_4K, | ||
86 | .type = MT_DEVICE, | ||
87 | }, { | ||
88 | .virtual = (unsigned long)S5P_VA_SROMC, | ||
89 | .pfn = __phys_to_pfn(S5PV210_PA_SROMC), | ||
90 | .length = SZ_4K, | ||
91 | .type = MT_DEVICE, | ||
92 | }, { | ||
51 | .virtual = (unsigned long)S5P_VA_SYSTIMER, | 93 | .virtual = (unsigned long)S5P_VA_SYSTIMER, |
52 | .pfn = __phys_to_pfn(S5PV210_PA_SYSTIMER), | 94 | .pfn = __phys_to_pfn(S5PV210_PA_SYSTIMER), |
53 | .length = SZ_4K, | 95 | .length = SZ_4K, |
@@ -108,19 +150,32 @@ static void s5pv210_idle(void) | |||
108 | local_irq_enable(); | 150 | local_irq_enable(); |
109 | } | 151 | } |
110 | 152 | ||
111 | static void s5pv210_sw_reset(void) | 153 | void s5pv210_restart(char mode, const char *cmd) |
112 | { | 154 | { |
113 | __raw_writel(0x1, S5P_SWRESET); | 155 | __raw_writel(0x1, S5P_SWRESET); |
114 | } | 156 | } |
115 | 157 | ||
116 | /* s5pv210_map_io | 158 | /* |
159 | * s5pv210_map_io | ||
117 | * | 160 | * |
118 | * register the standard cpu IO areas | 161 | * register the standard cpu IO areas |
119 | */ | 162 | */ |
120 | 163 | ||
121 | void __init s5pv210_map_io(void) | 164 | void __init s5pv210_init_io(struct map_desc *mach_desc, int size) |
122 | { | 165 | { |
166 | /* initialize the io descriptors we need for initialization */ | ||
123 | iotable_init(s5pv210_iodesc, ARRAY_SIZE(s5pv210_iodesc)); | 167 | iotable_init(s5pv210_iodesc, ARRAY_SIZE(s5pv210_iodesc)); |
168 | if (mach_desc) | ||
169 | iotable_init(mach_desc, size); | ||
170 | |||
171 | /* detect cpu id and rev. */ | ||
172 | s5p_init_cpu(S5P_VA_CHIPID); | ||
173 | |||
174 | s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids)); | ||
175 | } | ||
176 | |||
177 | void __init s5pv210_map_io(void) | ||
178 | { | ||
124 | init_consistent_dma_size(14 << 20); | 179 | init_consistent_dma_size(14 << 20); |
125 | 180 | ||
126 | /* initialise device information early */ | 181 | /* initialise device information early */ |
@@ -186,7 +241,6 @@ static int __init s5pv210_core_init(void) | |||
186 | { | 241 | { |
187 | return sysdev_class_register(&s5pv210_sysclass); | 242 | return sysdev_class_register(&s5pv210_sysclass); |
188 | } | 243 | } |
189 | |||
190 | core_initcall(s5pv210_core_init); | 244 | core_initcall(s5pv210_core_init); |
191 | 245 | ||
192 | int __init s5pv210_init(void) | 246 | int __init s5pv210_init(void) |
@@ -196,8 +250,12 @@ int __init s5pv210_init(void) | |||
196 | /* set idle function */ | 250 | /* set idle function */ |
197 | pm_idle = s5pv210_idle; | 251 | pm_idle = s5pv210_idle; |
198 | 252 | ||
199 | /* set sw_reset function */ | ||
200 | s5p_reset_hook = s5pv210_sw_reset; | ||
201 | |||
202 | return sysdev_register(&s5pv210_sysdev); | 253 | return sysdev_register(&s5pv210_sysdev); |
203 | } | 254 | } |
255 | |||
256 | /* uart registration process */ | ||
257 | |||
258 | void __init s5pv210_init_uarts(struct s3c2410_uartcfg *cfg, int no) | ||
259 | { | ||
260 | s3c24xx_init_uartdevs("s5pv210-uart", s5p_uart_resources, cfg, no); | ||
261 | } | ||
diff --git a/arch/arm/mach-s5pv210/common.h b/arch/arm/mach-s5pv210/common.h new file mode 100644 index 00000000000..6ed2af5c751 --- /dev/null +++ b/arch/arm/mach-s5pv210/common.h | |||
@@ -0,0 +1,37 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2011 Samsung Electronics Co., Ltd. | ||
3 | * http://www.samsung.com | ||
4 | * | ||
5 | * Common Header for S5PV210 machines | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #ifndef __ARCH_ARM_MACH_S5PV210_COMMON_H | ||
13 | #define __ARCH_ARM_MACH_S5PV210_COMMON_H | ||
14 | |||
15 | void s5pv210_init_io(struct map_desc *mach_desc, int size); | ||
16 | void s5pv210_init_irq(void); | ||
17 | |||
18 | void s5pv210_register_clocks(void); | ||
19 | void s5pv210_setup_clocks(void); | ||
20 | |||
21 | void s5pv210_restart(char mode, const char *cmd); | ||
22 | |||
23 | #ifdef CONFIG_CPU_S5PV210 | ||
24 | |||
25 | extern int s5pv210_init(void); | ||
26 | extern void s5pv210_map_io(void); | ||
27 | extern void s5pv210_init_clocks(int xtal); | ||
28 | extern void s5pv210_init_uarts(struct s3c2410_uartcfg *cfg, int no); | ||
29 | |||
30 | #else | ||
31 | #define s5pv210_init_clocks NULL | ||
32 | #define s5pv210_init_uarts NULL | ||
33 | #define s5pv210_map_io NULL | ||
34 | #define s5pv210_init NULL | ||
35 | #endif | ||
36 | |||
37 | #endif /* __ARCH_ARM_MACH_S5PV210_COMMON_H */ | ||
diff --git a/arch/arm/mach-s5pv210/dev-spi.c b/arch/arm/mach-s5pv210/dev-spi.c deleted file mode 100644 index eaf9a7bff7a..00000000000 --- a/arch/arm/mach-s5pv210/dev-spi.c +++ /dev/null | |||
@@ -1,175 +0,0 @@ | |||
1 | /* linux/arch/arm/mach-s5pv210/dev-spi.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 | #include <linux/gpio.h> | ||
14 | |||
15 | #include <mach/dma.h> | ||
16 | #include <mach/map.h> | ||
17 | #include <mach/irqs.h> | ||
18 | #include <mach/spi-clocks.h> | ||
19 | |||
20 | #include <plat/s3c64xx-spi.h> | ||
21 | #include <plat/gpio-cfg.h> | ||
22 | |||
23 | static char *spi_src_clks[] = { | ||
24 | [S5PV210_SPI_SRCCLK_PCLK] = "pclk", | ||
25 | [S5PV210_SPI_SRCCLK_SCLK] = "sclk_spi", | ||
26 | }; | ||
27 | |||
28 | /* SPI Controller platform_devices */ | ||
29 | |||
30 | /* Since we emulate multi-cs capability, we do not touch the CS. | ||
31 | * The emulated CS is toggled by board specific mechanism, as it can | ||
32 | * be either some immediate GPIO or some signal out of some other | ||
33 | * chip in between ... or some yet another way. | ||
34 | * We simply do not assume anything about CS. | ||
35 | */ | ||
36 | static int s5pv210_spi_cfg_gpio(struct platform_device *pdev) | ||
37 | { | ||
38 | unsigned int base; | ||
39 | |||
40 | switch (pdev->id) { | ||
41 | case 0: | ||
42 | base = S5PV210_GPB(0); | ||
43 | break; | ||
44 | |||
45 | case 1: | ||
46 | base = S5PV210_GPB(4); | ||
47 | break; | ||
48 | |||
49 | default: | ||
50 | dev_err(&pdev->dev, "Invalid SPI Controller number!"); | ||
51 | return -EINVAL; | ||
52 | } | ||
53 | |||
54 | s3c_gpio_cfgall_range(base, 3, | ||
55 | S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP); | ||
56 | |||
57 | return 0; | ||
58 | } | ||
59 | |||
60 | static struct resource s5pv210_spi0_resource[] = { | ||
61 | [0] = { | ||
62 | .start = S5PV210_PA_SPI0, | ||
63 | .end = S5PV210_PA_SPI0 + 0x100 - 1, | ||
64 | .flags = IORESOURCE_MEM, | ||
65 | }, | ||
66 | [1] = { | ||
67 | .start = DMACH_SPI0_TX, | ||
68 | .end = DMACH_SPI0_TX, | ||
69 | .flags = IORESOURCE_DMA, | ||
70 | }, | ||
71 | [2] = { | ||
72 | .start = DMACH_SPI0_RX, | ||
73 | .end = DMACH_SPI0_RX, | ||
74 | .flags = IORESOURCE_DMA, | ||
75 | }, | ||
76 | [3] = { | ||
77 | .start = IRQ_SPI0, | ||
78 | .end = IRQ_SPI0, | ||
79 | .flags = IORESOURCE_IRQ, | ||
80 | }, | ||
81 | }; | ||
82 | |||
83 | static struct s3c64xx_spi_info s5pv210_spi0_pdata = { | ||
84 | .cfg_gpio = s5pv210_spi_cfg_gpio, | ||
85 | .fifo_lvl_mask = 0x1ff, | ||
86 | .rx_lvl_offset = 15, | ||
87 | .high_speed = 1, | ||
88 | .tx_st_done = 25, | ||
89 | }; | ||
90 | |||
91 | static u64 spi_dmamask = DMA_BIT_MASK(32); | ||
92 | |||
93 | struct platform_device s5pv210_device_spi0 = { | ||
94 | .name = "s3c64xx-spi", | ||
95 | .id = 0, | ||
96 | .num_resources = ARRAY_SIZE(s5pv210_spi0_resource), | ||
97 | .resource = s5pv210_spi0_resource, | ||
98 | .dev = { | ||
99 | .dma_mask = &spi_dmamask, | ||
100 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
101 | .platform_data = &s5pv210_spi0_pdata, | ||
102 | }, | ||
103 | }; | ||
104 | |||
105 | static struct resource s5pv210_spi1_resource[] = { | ||
106 | [0] = { | ||
107 | .start = S5PV210_PA_SPI1, | ||
108 | .end = S5PV210_PA_SPI1 + 0x100 - 1, | ||
109 | .flags = IORESOURCE_MEM, | ||
110 | }, | ||
111 | [1] = { | ||
112 | .start = DMACH_SPI1_TX, | ||
113 | .end = DMACH_SPI1_TX, | ||
114 | .flags = IORESOURCE_DMA, | ||
115 | }, | ||
116 | [2] = { | ||
117 | .start = DMACH_SPI1_RX, | ||
118 | .end = DMACH_SPI1_RX, | ||
119 | .flags = IORESOURCE_DMA, | ||
120 | }, | ||
121 | [3] = { | ||
122 | .start = IRQ_SPI1, | ||
123 | .end = IRQ_SPI1, | ||
124 | .flags = IORESOURCE_IRQ, | ||
125 | }, | ||
126 | }; | ||
127 | |||
128 | static struct s3c64xx_spi_info s5pv210_spi1_pdata = { | ||
129 | .cfg_gpio = s5pv210_spi_cfg_gpio, | ||
130 | .fifo_lvl_mask = 0x7f, | ||
131 | .rx_lvl_offset = 15, | ||
132 | .high_speed = 1, | ||
133 | .tx_st_done = 25, | ||
134 | }; | ||
135 | |||
136 | struct platform_device s5pv210_device_spi1 = { | ||
137 | .name = "s3c64xx-spi", | ||
138 | .id = 1, | ||
139 | .num_resources = ARRAY_SIZE(s5pv210_spi1_resource), | ||
140 | .resource = s5pv210_spi1_resource, | ||
141 | .dev = { | ||
142 | .dma_mask = &spi_dmamask, | ||
143 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
144 | .platform_data = &s5pv210_spi1_pdata, | ||
145 | }, | ||
146 | }; | ||
147 | |||
148 | void __init s5pv210_spi_set_info(int cntrlr, int src_clk_nr, int num_cs) | ||
149 | { | ||
150 | struct s3c64xx_spi_info *pd; | ||
151 | |||
152 | /* Reject invalid configuration */ | ||
153 | if (!num_cs || src_clk_nr < 0 | ||
154 | || src_clk_nr > S5PV210_SPI_SRCCLK_SCLK) { | ||
155 | printk(KERN_ERR "%s: Invalid SPI configuration\n", __func__); | ||
156 | return; | ||
157 | } | ||
158 | |||
159 | switch (cntrlr) { | ||
160 | case 0: | ||
161 | pd = &s5pv210_spi0_pdata; | ||
162 | break; | ||
163 | case 1: | ||
164 | pd = &s5pv210_spi1_pdata; | ||
165 | break; | ||
166 | default: | ||
167 | printk(KERN_ERR "%s: Invalid SPI controller(%d)\n", | ||
168 | __func__, cntrlr); | ||
169 | return; | ||
170 | } | ||
171 | |||
172 | pd->num_cs = num_cs; | ||
173 | pd->src_clk_nr = src_clk_nr; | ||
174 | pd->src_clk_name = spi_src_clks[src_clk_nr]; | ||
175 | } | ||
diff --git a/arch/arm/mach-s5pv210/dma.c b/arch/arm/mach-s5pv210/dma.c index 86b749c18b7..a6113e0267f 100644 --- a/arch/arm/mach-s5pv210/dma.c +++ b/arch/arm/mach-s5pv210/dma.c | |||
@@ -35,90 +35,40 @@ | |||
35 | 35 | ||
36 | static u64 dma_dmamask = DMA_BIT_MASK(32); | 36 | static u64 dma_dmamask = DMA_BIT_MASK(32); |
37 | 37 | ||
38 | struct dma_pl330_peri pdma0_peri[28] = { | 38 | u8 pdma0_peri[] = { |
39 | { | 39 | DMACH_UART0_RX, |
40 | .peri_id = (u8)DMACH_UART0_RX, | 40 | DMACH_UART0_TX, |
41 | .rqtype = DEVTOMEM, | 41 | DMACH_UART1_RX, |
42 | }, { | 42 | DMACH_UART1_TX, |
43 | .peri_id = (u8)DMACH_UART0_TX, | 43 | DMACH_UART2_RX, |
44 | .rqtype = MEMTODEV, | 44 | DMACH_UART2_TX, |
45 | }, { | 45 | DMACH_UART3_RX, |
46 | .peri_id = (u8)DMACH_UART1_RX, | 46 | DMACH_UART3_TX, |
47 | .rqtype = DEVTOMEM, | 47 | DMACH_MAX, |
48 | }, { | 48 | DMACH_I2S0_RX, |
49 | .peri_id = (u8)DMACH_UART1_TX, | 49 | DMACH_I2S0_TX, |
50 | .rqtype = MEMTODEV, | 50 | DMACH_I2S0S_TX, |
51 | }, { | 51 | DMACH_I2S1_RX, |
52 | .peri_id = (u8)DMACH_UART2_RX, | 52 | DMACH_I2S1_TX, |
53 | .rqtype = DEVTOMEM, | 53 | DMACH_MAX, |
54 | }, { | 54 | DMACH_MAX, |
55 | .peri_id = (u8)DMACH_UART2_TX, | 55 | DMACH_SPI0_RX, |
56 | .rqtype = MEMTODEV, | 56 | DMACH_SPI0_TX, |
57 | }, { | 57 | DMACH_SPI1_RX, |
58 | .peri_id = (u8)DMACH_UART3_RX, | 58 | DMACH_SPI1_TX, |
59 | .rqtype = DEVTOMEM, | 59 | DMACH_MAX, |
60 | }, { | 60 | DMACH_MAX, |
61 | .peri_id = (u8)DMACH_UART3_TX, | 61 | DMACH_AC97_MICIN, |
62 | .rqtype = MEMTODEV, | 62 | DMACH_AC97_PCMIN, |
63 | }, { | 63 | DMACH_AC97_PCMOUT, |
64 | .peri_id = DMACH_MAX, | 64 | DMACH_MAX, |
65 | }, { | 65 | DMACH_PWM, |
66 | .peri_id = (u8)DMACH_I2S0_RX, | 66 | DMACH_SPDIF, |
67 | .rqtype = DEVTOMEM, | ||
68 | }, { | ||
69 | .peri_id = (u8)DMACH_I2S0_TX, | ||
70 | .rqtype = MEMTODEV, | ||
71 | }, { | ||
72 | .peri_id = (u8)DMACH_I2S0S_TX, | ||
73 | .rqtype = MEMTODEV, | ||
74 | }, { | ||
75 | .peri_id = (u8)DMACH_I2S1_RX, | ||
76 | .rqtype = DEVTOMEM, | ||
77 | }, { | ||
78 | .peri_id = (u8)DMACH_I2S1_TX, | ||
79 | .rqtype = MEMTODEV, | ||
80 | }, { | ||
81 | .peri_id = (u8)DMACH_MAX, | ||
82 | }, { | ||
83 | .peri_id = (u8)DMACH_MAX, | ||
84 | }, { | ||
85 | .peri_id = (u8)DMACH_SPI0_RX, | ||
86 | .rqtype = DEVTOMEM, | ||
87 | }, { | ||
88 | .peri_id = (u8)DMACH_SPI0_TX, | ||
89 | .rqtype = MEMTODEV, | ||
90 | }, { | ||
91 | .peri_id = (u8)DMACH_SPI1_RX, | ||
92 | .rqtype = DEVTOMEM, | ||
93 | }, { | ||
94 | .peri_id = (u8)DMACH_SPI1_TX, | ||
95 | .rqtype = MEMTODEV, | ||
96 | }, { | ||
97 | .peri_id = (u8)DMACH_MAX, | ||
98 | }, { | ||
99 | .peri_id = (u8)DMACH_MAX, | ||
100 | }, { | ||
101 | .peri_id = (u8)DMACH_AC97_MICIN, | ||
102 | .rqtype = DEVTOMEM, | ||
103 | }, { | ||
104 | .peri_id = (u8)DMACH_AC97_PCMIN, | ||
105 | .rqtype = DEVTOMEM, | ||
106 | }, { | ||
107 | .peri_id = (u8)DMACH_AC97_PCMOUT, | ||
108 | .rqtype = MEMTODEV, | ||
109 | }, { | ||
110 | .peri_id = (u8)DMACH_MAX, | ||
111 | }, { | ||
112 | .peri_id = (u8)DMACH_PWM, | ||
113 | }, { | ||
114 | .peri_id = (u8)DMACH_SPDIF, | ||
115 | .rqtype = MEMTODEV, | ||
116 | }, | ||
117 | }; | 67 | }; |
118 | 68 | ||
119 | struct dma_pl330_platdata s5pv210_pdma0_pdata = { | 69 | struct dma_pl330_platdata s5pv210_pdma0_pdata = { |
120 | .nr_valid_peri = ARRAY_SIZE(pdma0_peri), | 70 | .nr_valid_peri = ARRAY_SIZE(pdma0_peri), |
121 | .peri = pdma0_peri, | 71 | .peri_id = pdma0_peri, |
122 | }; | 72 | }; |
123 | 73 | ||
124 | struct amba_device s5pv210_device_pdma0 = { | 74 | struct amba_device s5pv210_device_pdma0 = { |
@@ -137,102 +87,44 @@ struct amba_device s5pv210_device_pdma0 = { | |||
137 | .periphid = 0x00041330, | 87 | .periphid = 0x00041330, |
138 | }; | 88 | }; |
139 | 89 | ||
140 | struct dma_pl330_peri pdma1_peri[32] = { | 90 | u8 pdma1_peri[] = { |
141 | { | 91 | DMACH_UART0_RX, |
142 | .peri_id = (u8)DMACH_UART0_RX, | 92 | DMACH_UART0_TX, |
143 | .rqtype = DEVTOMEM, | 93 | DMACH_UART1_RX, |
144 | }, { | 94 | DMACH_UART1_TX, |
145 | .peri_id = (u8)DMACH_UART0_TX, | 95 | DMACH_UART2_RX, |
146 | .rqtype = MEMTODEV, | 96 | DMACH_UART2_TX, |
147 | }, { | 97 | DMACH_UART3_RX, |
148 | .peri_id = (u8)DMACH_UART1_RX, | 98 | DMACH_UART3_TX, |
149 | .rqtype = DEVTOMEM, | 99 | DMACH_MAX, |
150 | }, { | 100 | DMACH_I2S0_RX, |
151 | .peri_id = (u8)DMACH_UART1_TX, | 101 | DMACH_I2S0_TX, |
152 | .rqtype = MEMTODEV, | 102 | DMACH_I2S0S_TX, |
153 | }, { | 103 | DMACH_I2S1_RX, |
154 | .peri_id = (u8)DMACH_UART2_RX, | 104 | DMACH_I2S1_TX, |
155 | .rqtype = DEVTOMEM, | 105 | DMACH_I2S2_RX, |
156 | }, { | 106 | DMACH_I2S2_TX, |
157 | .peri_id = (u8)DMACH_UART2_TX, | 107 | DMACH_SPI0_RX, |
158 | .rqtype = MEMTODEV, | 108 | DMACH_SPI0_TX, |
159 | }, { | 109 | DMACH_SPI1_RX, |
160 | .peri_id = (u8)DMACH_UART3_RX, | 110 | DMACH_SPI1_TX, |
161 | .rqtype = DEVTOMEM, | 111 | DMACH_MAX, |
162 | }, { | 112 | DMACH_MAX, |
163 | .peri_id = (u8)DMACH_UART3_TX, | 113 | DMACH_PCM0_RX, |
164 | .rqtype = MEMTODEV, | 114 | DMACH_PCM0_TX, |
165 | }, { | 115 | DMACH_PCM1_RX, |
166 | .peri_id = DMACH_MAX, | 116 | DMACH_PCM1_TX, |
167 | }, { | 117 | DMACH_MSM_REQ0, |
168 | .peri_id = (u8)DMACH_I2S0_RX, | 118 | DMACH_MSM_REQ1, |
169 | .rqtype = DEVTOMEM, | 119 | DMACH_MSM_REQ2, |
170 | }, { | 120 | DMACH_MSM_REQ3, |
171 | .peri_id = (u8)DMACH_I2S0_TX, | 121 | DMACH_PCM2_RX, |
172 | .rqtype = MEMTODEV, | 122 | DMACH_PCM2_TX, |
173 | }, { | ||
174 | .peri_id = (u8)DMACH_I2S0S_TX, | ||
175 | .rqtype = MEMTODEV, | ||
176 | }, { | ||
177 | .peri_id = (u8)DMACH_I2S1_RX, | ||
178 | .rqtype = DEVTOMEM, | ||
179 | }, { | ||
180 | .peri_id = (u8)DMACH_I2S1_TX, | ||
181 | .rqtype = MEMTODEV, | ||
182 | }, { | ||
183 | .peri_id = (u8)DMACH_I2S2_RX, | ||
184 | .rqtype = DEVTOMEM, | ||
185 | }, { | ||
186 | .peri_id = (u8)DMACH_I2S2_TX, | ||
187 | .rqtype = MEMTODEV, | ||
188 | }, { | ||
189 | .peri_id = (u8)DMACH_SPI0_RX, | ||
190 | .rqtype = DEVTOMEM, | ||
191 | }, { | ||
192 | .peri_id = (u8)DMACH_SPI0_TX, | ||
193 | .rqtype = MEMTODEV, | ||
194 | }, { | ||
195 | .peri_id = (u8)DMACH_SPI1_RX, | ||
196 | .rqtype = DEVTOMEM, | ||
197 | }, { | ||
198 | .peri_id = (u8)DMACH_SPI1_TX, | ||
199 | .rqtype = MEMTODEV, | ||
200 | }, { | ||
201 | .peri_id = (u8)DMACH_MAX, | ||
202 | }, { | ||
203 | .peri_id = (u8)DMACH_MAX, | ||
204 | }, { | ||
205 | .peri_id = (u8)DMACH_PCM0_RX, | ||
206 | .rqtype = DEVTOMEM, | ||
207 | }, { | ||
208 | .peri_id = (u8)DMACH_PCM0_TX, | ||
209 | .rqtype = MEMTODEV, | ||
210 | }, { | ||
211 | .peri_id = (u8)DMACH_PCM1_RX, | ||
212 | .rqtype = DEVTOMEM, | ||
213 | }, { | ||
214 | .peri_id = (u8)DMACH_PCM1_TX, | ||
215 | .rqtype = MEMTODEV, | ||
216 | }, { | ||
217 | .peri_id = (u8)DMACH_MSM_REQ0, | ||
218 | }, { | ||
219 | .peri_id = (u8)DMACH_MSM_REQ1, | ||
220 | }, { | ||
221 | .peri_id = (u8)DMACH_MSM_REQ2, | ||
222 | }, { | ||
223 | .peri_id = (u8)DMACH_MSM_REQ3, | ||
224 | }, { | ||
225 | .peri_id = (u8)DMACH_PCM2_RX, | ||
226 | .rqtype = DEVTOMEM, | ||
227 | }, { | ||
228 | .peri_id = (u8)DMACH_PCM2_TX, | ||
229 | .rqtype = MEMTODEV, | ||
230 | }, | ||
231 | }; | 123 | }; |
232 | 124 | ||
233 | struct dma_pl330_platdata s5pv210_pdma1_pdata = { | 125 | struct dma_pl330_platdata s5pv210_pdma1_pdata = { |
234 | .nr_valid_peri = ARRAY_SIZE(pdma1_peri), | 126 | .nr_valid_peri = ARRAY_SIZE(pdma1_peri), |
235 | .peri = pdma1_peri, | 127 | .peri_id = pdma1_peri, |
236 | }; | 128 | }; |
237 | 129 | ||
238 | struct amba_device s5pv210_device_pdma1 = { | 130 | struct amba_device s5pv210_device_pdma1 = { |
@@ -253,7 +145,12 @@ struct amba_device s5pv210_device_pdma1 = { | |||
253 | 145 | ||
254 | static int __init s5pv210_dma_init(void) | 146 | static int __init s5pv210_dma_init(void) |
255 | { | 147 | { |
148 | dma_cap_set(DMA_SLAVE, s5pv210_pdma0_pdata.cap_mask); | ||
149 | dma_cap_set(DMA_CYCLIC, s5pv210_pdma0_pdata.cap_mask); | ||
256 | amba_device_register(&s5pv210_device_pdma0, &iomem_resource); | 150 | amba_device_register(&s5pv210_device_pdma0, &iomem_resource); |
151 | |||
152 | dma_cap_set(DMA_SLAVE, s5pv210_pdma1_pdata.cap_mask); | ||
153 | dma_cap_set(DMA_CYCLIC, s5pv210_pdma1_pdata.cap_mask); | ||
257 | amba_device_register(&s5pv210_device_pdma1, &iomem_resource); | 154 | amba_device_register(&s5pv210_device_pdma1, &iomem_resource); |
258 | 155 | ||
259 | return 0; | 156 | return 0; |
diff --git a/arch/arm/mach-s5pv210/include/mach/irqs.h b/arch/arm/mach-s5pv210/include/mach/irqs.h index 5e0de3a31f3..e777e010ed2 100644 --- a/arch/arm/mach-s5pv210/include/mach/irqs.h +++ b/arch/arm/mach-s5pv210/include/mach/irqs.h | |||
@@ -118,6 +118,8 @@ | |||
118 | #define IRQ_MDNIE3 S5P_IRQ_VIC3(8) | 118 | #define IRQ_MDNIE3 S5P_IRQ_VIC3(8) |
119 | #define IRQ_VIC_END S5P_IRQ_VIC3(31) | 119 | #define IRQ_VIC_END S5P_IRQ_VIC3(31) |
120 | 120 | ||
121 | #define IRQ_TIMER_BASE (11) | ||
122 | |||
121 | #define S5P_EINT_BASE1 (S5P_IRQ_VIC0(0)) | 123 | #define S5P_EINT_BASE1 (S5P_IRQ_VIC0(0)) |
122 | #define S5P_EINT_BASE2 (IRQ_VIC_END + 1) | 124 | #define S5P_EINT_BASE2 (IRQ_VIC_END + 1) |
123 | 125 | ||
diff --git a/arch/arm/mach-s5pv210/include/mach/map.h b/arch/arm/mach-s5pv210/include/mach/map.h index 7ff609f1568..89c34b8f73b 100644 --- a/arch/arm/mach-s5pv210/include/mach/map.h +++ b/arch/arm/mach-s5pv210/include/mach/map.h | |||
@@ -109,6 +109,8 @@ | |||
109 | #define S3C_PA_RTC S5PV210_PA_RTC | 109 | #define S3C_PA_RTC S5PV210_PA_RTC |
110 | #define S3C_PA_USB_HSOTG S5PV210_PA_HSOTG | 110 | #define S3C_PA_USB_HSOTG S5PV210_PA_HSOTG |
111 | #define S3C_PA_WDT S5PV210_PA_WATCHDOG | 111 | #define S3C_PA_WDT S5PV210_PA_WATCHDOG |
112 | #define S3C_PA_SPI0 S5PV210_PA_SPI0 | ||
113 | #define S3C_PA_SPI1 S5PV210_PA_SPI1 | ||
112 | 114 | ||
113 | #define S5P_PA_CHIPID S5PV210_PA_CHIPID | 115 | #define S5P_PA_CHIPID S5PV210_PA_CHIPID |
114 | #define S5P_PA_FIMC0 S5PV210_PA_FIMC0 | 116 | #define S5P_PA_FIMC0 S5PV210_PA_FIMC0 |
diff --git a/arch/arm/mach-s5pv210/include/mach/system.h b/arch/arm/mach-s5pv210/include/mach/system.h index af8a200b213..bf288ced860 100644 --- a/arch/arm/mach-s5pv210/include/mach/system.h +++ b/arch/arm/mach-s5pv210/include/mach/system.h | |||
@@ -13,8 +13,6 @@ | |||
13 | #ifndef __ASM_ARCH_SYSTEM_H | 13 | #ifndef __ASM_ARCH_SYSTEM_H |
14 | #define __ASM_ARCH_SYSTEM_H __FILE__ | 14 | #define __ASM_ARCH_SYSTEM_H __FILE__ |
15 | 15 | ||
16 | #include <plat/system-reset.h> | ||
17 | |||
18 | static void arch_idle(void) | 16 | static void arch_idle(void) |
19 | { | 17 | { |
20 | /* nothing here yet */ | 18 | /* nothing here yet */ |
diff --git a/arch/arm/mach-s5pv210/init.c b/arch/arm/mach-s5pv210/init.c deleted file mode 100644 index 4865ae2c475..00000000000 --- a/arch/arm/mach-s5pv210/init.c +++ /dev/null | |||
@@ -1,44 +0,0 @@ | |||
1 | /* linux/arch/arm/mach-s5pv210/init.c | ||
2 | * | ||
3 | * Copyright (c) 2010 Samsung Electronics Co., Ltd. | ||
4 | * http://www.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/kernel.h> | ||
12 | #include <linux/types.h> | ||
13 | #include <linux/init.h> | ||
14 | #include <linux/serial_core.h> | ||
15 | |||
16 | #include <plat/cpu.h> | ||
17 | #include <plat/devs.h> | ||
18 | #include <plat/s5pv210.h> | ||
19 | #include <plat/regs-serial.h> | ||
20 | |||
21 | static struct s3c24xx_uart_clksrc s5pv210_serial_clocks[] = { | ||
22 | [0] = { | ||
23 | .name = "pclk", | ||
24 | .divisor = 1, | ||
25 | .min_baud = 0, | ||
26 | .max_baud = 0, | ||
27 | }, | ||
28 | }; | ||
29 | |||
30 | /* uart registration process */ | ||
31 | void __init s5pv210_common_init_uarts(struct s3c2410_uartcfg *cfg, int no) | ||
32 | { | ||
33 | struct s3c2410_uartcfg *tcfg = cfg; | ||
34 | u32 ucnt; | ||
35 | |||
36 | for (ucnt = 0; ucnt < no; ucnt++, tcfg++) { | ||
37 | if (!tcfg->clocks) { | ||
38 | tcfg->clocks = s5pv210_serial_clocks; | ||
39 | tcfg->clocks_size = ARRAY_SIZE(s5pv210_serial_clocks); | ||
40 | } | ||
41 | } | ||
42 | |||
43 | s3c24xx_init_uartdevs("s5pv210-uart", s5p_uart_resources, cfg, no); | ||
44 | } | ||
diff --git a/arch/arm/mach-s5pv210/mach-aquila.c b/arch/arm/mach-s5pv210/mach-aquila.c index 71ca95604d6..5e734d025a6 100644 --- a/arch/arm/mach-s5pv210/mach-aquila.c +++ b/arch/arm/mach-s5pv210/mach-aquila.c | |||
@@ -33,7 +33,6 @@ | |||
33 | 33 | ||
34 | #include <plat/gpio-cfg.h> | 34 | #include <plat/gpio-cfg.h> |
35 | #include <plat/regs-serial.h> | 35 | #include <plat/regs-serial.h> |
36 | #include <plat/s5pv210.h> | ||
37 | #include <plat/devs.h> | 36 | #include <plat/devs.h> |
38 | #include <plat/cpu.h> | 37 | #include <plat/cpu.h> |
39 | #include <plat/fb.h> | 38 | #include <plat/fb.h> |
@@ -42,6 +41,8 @@ | |||
42 | #include <plat/s5p-time.h> | 41 | #include <plat/s5p-time.h> |
43 | #include <plat/regs-fb-v4.h> | 42 | #include <plat/regs-fb-v4.h> |
44 | 43 | ||
44 | #include "common.h" | ||
45 | |||
45 | /* Following are default values for UCON, ULCON and UFCON UART registers */ | 46 | /* Following are default values for UCON, ULCON and UFCON UART registers */ |
46 | #define AQUILA_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ | 47 | #define AQUILA_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ |
47 | S3C2410_UCON_RXILEVEL | \ | 48 | S3C2410_UCON_RXILEVEL | \ |
@@ -596,8 +597,7 @@ static struct s3c_sdhci_platdata aquila_hsmmc2_data __initdata = { | |||
596 | 597 | ||
597 | static void aquila_setup_sdhci(void) | 598 | static void aquila_setup_sdhci(void) |
598 | { | 599 | { |
599 | gpio_request(AQUILA_EXT_FLASH_EN, "FLASH_EN"); | 600 | gpio_request_one(AQUILA_EXT_FLASH_EN, GPIOF_OUT_INIT_HIGH, "FLASH_EN"); |
600 | gpio_direction_output(AQUILA_EXT_FLASH_EN, 1); | ||
601 | 601 | ||
602 | s3c_sdhci0_set_platdata(&aquila_hsmmc0_data); | 602 | s3c_sdhci0_set_platdata(&aquila_hsmmc0_data); |
603 | s3c_sdhci1_set_platdata(&aquila_hsmmc1_data); | 603 | s3c_sdhci1_set_platdata(&aquila_hsmmc1_data); |
@@ -645,7 +645,7 @@ static void __init aquila_sound_init(void) | |||
645 | 645 | ||
646 | static void __init aquila_map_io(void) | 646 | static void __init aquila_map_io(void) |
647 | { | 647 | { |
648 | s5p_init_io(NULL, 0, S5P_VA_CHIPID); | 648 | s5pv210_init_io(NULL, 0); |
649 | s3c24xx_init_clocks(24000000); | 649 | s3c24xx_init_clocks(24000000); |
650 | s3c24xx_init_uarts(aquila_uartcfgs, ARRAY_SIZE(aquila_uartcfgs)); | 650 | s3c24xx_init_uarts(aquila_uartcfgs, ARRAY_SIZE(aquila_uartcfgs)); |
651 | s5p_set_timer_source(S5P_PWM3, S5P_PWM4); | 651 | s5p_set_timer_source(S5P_PWM3, S5P_PWM4); |
@@ -685,4 +685,5 @@ MACHINE_START(AQUILA, "Aquila") | |||
685 | .map_io = aquila_map_io, | 685 | .map_io = aquila_map_io, |
686 | .init_machine = aquila_machine_init, | 686 | .init_machine = aquila_machine_init, |
687 | .timer = &s5p_timer, | 687 | .timer = &s5p_timer, |
688 | .restart = s5pv210_restart, | ||
688 | MACHINE_END | 689 | MACHINE_END |
diff --git a/arch/arm/mach-s5pv210/mach-goni.c b/arch/arm/mach-s5pv210/mach-goni.c index 448fd9ea96f..ff915261043 100644 --- a/arch/arm/mach-s5pv210/mach-goni.c +++ b/arch/arm/mach-s5pv210/mach-goni.c | |||
@@ -38,7 +38,6 @@ | |||
38 | 38 | ||
39 | #include <plat/gpio-cfg.h> | 39 | #include <plat/gpio-cfg.h> |
40 | #include <plat/regs-serial.h> | 40 | #include <plat/regs-serial.h> |
41 | #include <plat/s5pv210.h> | ||
42 | #include <plat/devs.h> | 41 | #include <plat/devs.h> |
43 | #include <plat/cpu.h> | 42 | #include <plat/cpu.h> |
44 | #include <plat/fb.h> | 43 | #include <plat/fb.h> |
@@ -55,6 +54,8 @@ | |||
55 | #include <media/s5p_fimc.h> | 54 | #include <media/s5p_fimc.h> |
56 | #include <media/noon010pc30.h> | 55 | #include <media/noon010pc30.h> |
57 | 56 | ||
57 | #include "common.h" | ||
58 | |||
58 | /* Following are default values for UCON, ULCON and UFCON UART registers */ | 59 | /* Following are default values for UCON, ULCON and UFCON UART registers */ |
59 | #define GONI_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ | 60 | #define GONI_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ |
60 | S3C2410_UCON_RXILEVEL | \ | 61 | S3C2410_UCON_RXILEVEL | \ |
@@ -228,8 +229,7 @@ static void __init goni_radio_init(void) | |||
228 | i2c1_devs[0].irq = gpio_to_irq(gpio); | 229 | i2c1_devs[0].irq = gpio_to_irq(gpio); |
229 | 230 | ||
230 | gpio = S5PV210_GPJ2(5); /* XMSMDATA_5 */ | 231 | gpio = S5PV210_GPJ2(5); /* XMSMDATA_5 */ |
231 | gpio_request(gpio, "FM_RST"); | 232 | gpio_request_one(gpio, GPIOF_OUT_INIT_HIGH, "FM_RST"); |
232 | gpio_direction_output(gpio, 1); | ||
233 | } | 233 | } |
234 | 234 | ||
235 | /* TSP */ | 235 | /* TSP */ |
@@ -265,8 +265,7 @@ static void __init goni_tsp_init(void) | |||
265 | int gpio; | 265 | int gpio; |
266 | 266 | ||
267 | gpio = S5PV210_GPJ1(3); /* XMSMADDR_11 */ | 267 | gpio = S5PV210_GPJ1(3); /* XMSMADDR_11 */ |
268 | gpio_request(gpio, "TSP_LDO_ON"); | 268 | gpio_request_one(gpio, GPIOF_OUT_INIT_HIGH, "TSP_LDO_ON"); |
269 | gpio_direction_output(gpio, 1); | ||
270 | gpio_export(gpio, 0); | 269 | gpio_export(gpio, 0); |
271 | 270 | ||
272 | gpio = S5PV210_GPJ0(5); /* XMSMADDR_5 */ | 271 | gpio = S5PV210_GPJ0(5); /* XMSMADDR_5 */ |
@@ -891,7 +890,7 @@ static void __init goni_sound_init(void) | |||
891 | 890 | ||
892 | static void __init goni_map_io(void) | 891 | static void __init goni_map_io(void) |
893 | { | 892 | { |
894 | s5p_init_io(NULL, 0, S5P_VA_CHIPID); | 893 | s5pv210_init_io(NULL, 0); |
895 | s3c24xx_init_clocks(24000000); | 894 | s3c24xx_init_clocks(24000000); |
896 | s3c24xx_init_uarts(goni_uartcfgs, ARRAY_SIZE(goni_uartcfgs)); | 895 | s3c24xx_init_uarts(goni_uartcfgs, ARRAY_SIZE(goni_uartcfgs)); |
897 | s5p_set_timer_source(S5P_PWM3, S5P_PWM4); | 896 | s5p_set_timer_source(S5P_PWM3, S5P_PWM4); |
@@ -962,4 +961,5 @@ MACHINE_START(GONI, "GONI") | |||
962 | .init_machine = goni_machine_init, | 961 | .init_machine = goni_machine_init, |
963 | .timer = &s5p_timer, | 962 | .timer = &s5p_timer, |
964 | .reserve = &goni_reserve, | 963 | .reserve = &goni_reserve, |
964 | .restart = s5pv210_restart, | ||
965 | MACHINE_END | 965 | MACHINE_END |
diff --git a/arch/arm/mach-s5pv210/mach-smdkc110.c b/arch/arm/mach-s5pv210/mach-smdkc110.c index c2531ffc720..9405da4ae3a 100644 --- a/arch/arm/mach-s5pv210/mach-smdkc110.c +++ b/arch/arm/mach-s5pv210/mach-smdkc110.c | |||
@@ -25,7 +25,6 @@ | |||
25 | #include <mach/regs-clock.h> | 25 | #include <mach/regs-clock.h> |
26 | 26 | ||
27 | #include <plat/regs-serial.h> | 27 | #include <plat/regs-serial.h> |
28 | #include <plat/s5pv210.h> | ||
29 | #include <plat/devs.h> | 28 | #include <plat/devs.h> |
30 | #include <plat/cpu.h> | 29 | #include <plat/cpu.h> |
31 | #include <plat/ata.h> | 30 | #include <plat/ata.h> |
@@ -33,6 +32,8 @@ | |||
33 | #include <plat/pm.h> | 32 | #include <plat/pm.h> |
34 | #include <plat/s5p-time.h> | 33 | #include <plat/s5p-time.h> |
35 | 34 | ||
35 | #include "common.h" | ||
36 | |||
36 | /* Following are default values for UCON, ULCON and UFCON UART registers */ | 37 | /* Following are default values for UCON, ULCON and UFCON UART registers */ |
37 | #define SMDKC110_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ | 38 | #define SMDKC110_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ |
38 | S3C2410_UCON_RXILEVEL | \ | 39 | S3C2410_UCON_RXILEVEL | \ |
@@ -110,7 +111,7 @@ static struct i2c_board_info smdkc110_i2c_devs2[] __initdata = { | |||
110 | 111 | ||
111 | static void __init smdkc110_map_io(void) | 112 | static void __init smdkc110_map_io(void) |
112 | { | 113 | { |
113 | s5p_init_io(NULL, 0, S5P_VA_CHIPID); | 114 | s5pv210_init_io(NULL, 0); |
114 | s3c24xx_init_clocks(24000000); | 115 | s3c24xx_init_clocks(24000000); |
115 | s3c24xx_init_uarts(smdkv210_uartcfgs, ARRAY_SIZE(smdkv210_uartcfgs)); | 116 | s3c24xx_init_uarts(smdkv210_uartcfgs, ARRAY_SIZE(smdkv210_uartcfgs)); |
116 | s5p_set_timer_source(S5P_PWM3, S5P_PWM4); | 117 | s5p_set_timer_source(S5P_PWM3, S5P_PWM4); |
@@ -143,4 +144,5 @@ MACHINE_START(SMDKC110, "SMDKC110") | |||
143 | .map_io = smdkc110_map_io, | 144 | .map_io = smdkc110_map_io, |
144 | .init_machine = smdkc110_machine_init, | 145 | .init_machine = smdkc110_machine_init, |
145 | .timer = &s5p_timer, | 146 | .timer = &s5p_timer, |
147 | .restart = s5pv210_restart, | ||
146 | MACHINE_END | 148 | MACHINE_END |
diff --git a/arch/arm/mach-s5pv210/mach-smdkv210.c b/arch/arm/mach-s5pv210/mach-smdkv210.c index 3ac9e57d970..f6feef4dce6 100644 --- a/arch/arm/mach-s5pv210/mach-smdkv210.c +++ b/arch/arm/mach-s5pv210/mach-smdkv210.c | |||
@@ -34,7 +34,6 @@ | |||
34 | #include <plat/regs-serial.h> | 34 | #include <plat/regs-serial.h> |
35 | #include <plat/regs-srom.h> | 35 | #include <plat/regs-srom.h> |
36 | #include <plat/gpio-cfg.h> | 36 | #include <plat/gpio-cfg.h> |
37 | #include <plat/s5pv210.h> | ||
38 | #include <plat/devs.h> | 37 | #include <plat/devs.h> |
39 | #include <plat/cpu.h> | 38 | #include <plat/cpu.h> |
40 | #include <plat/adc.h> | 39 | #include <plat/adc.h> |
@@ -48,6 +47,8 @@ | |||
48 | #include <plat/backlight.h> | 47 | #include <plat/backlight.h> |
49 | #include <plat/regs-fb-v4.h> | 48 | #include <plat/regs-fb-v4.h> |
50 | 49 | ||
50 | #include "common.h" | ||
51 | |||
51 | /* Following are default values for UCON, ULCON and UFCON UART registers */ | 52 | /* Following are default values for UCON, ULCON and UFCON UART registers */ |
52 | #define SMDKV210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ | 53 | #define SMDKV210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ |
53 | S3C2410_UCON_RXILEVEL | \ | 54 | S3C2410_UCON_RXILEVEL | \ |
@@ -154,15 +155,12 @@ static void smdkv210_lte480wv_set_power(struct plat_lcd_data *pd, | |||
154 | { | 155 | { |
155 | if (power) { | 156 | if (power) { |
156 | #if !defined(CONFIG_BACKLIGHT_PWM) | 157 | #if !defined(CONFIG_BACKLIGHT_PWM) |
157 | gpio_request(S5PV210_GPD0(3), "GPD0"); | 158 | gpio_request_one(S5PV210_GPD0(3), GPIOF_OUT_INIT_HIGH, "GPD0"); |
158 | gpio_direction_output(S5PV210_GPD0(3), 1); | ||
159 | gpio_free(S5PV210_GPD0(3)); | 159 | gpio_free(S5PV210_GPD0(3)); |
160 | #endif | 160 | #endif |
161 | 161 | ||
162 | /* fire nRESET on power up */ | 162 | /* fire nRESET on power up */ |
163 | gpio_request(S5PV210_GPH0(6), "GPH0"); | 163 | gpio_request_one(S5PV210_GPH0(6), GPIOF_OUT_INIT_HIGH, "GPH0"); |
164 | |||
165 | gpio_direction_output(S5PV210_GPH0(6), 1); | ||
166 | 164 | ||
167 | gpio_set_value(S5PV210_GPH0(6), 0); | 165 | gpio_set_value(S5PV210_GPH0(6), 0); |
168 | mdelay(10); | 166 | mdelay(10); |
@@ -173,8 +171,7 @@ static void smdkv210_lte480wv_set_power(struct plat_lcd_data *pd, | |||
173 | gpio_free(S5PV210_GPH0(6)); | 171 | gpio_free(S5PV210_GPH0(6)); |
174 | } else { | 172 | } else { |
175 | #if !defined(CONFIG_BACKLIGHT_PWM) | 173 | #if !defined(CONFIG_BACKLIGHT_PWM) |
176 | gpio_request(S5PV210_GPD0(3), "GPD0"); | 174 | gpio_request_one(S5PV210_GPD0(3), GPIOF_OUT_INIT_LOW, "GPD0"); |
177 | gpio_direction_output(S5PV210_GPD0(3), 0); | ||
178 | gpio_free(S5PV210_GPD0(3)); | 175 | gpio_free(S5PV210_GPD0(3)); |
179 | #endif | 176 | #endif |
180 | } | 177 | } |
@@ -279,7 +276,7 @@ static struct platform_pwm_backlight_data smdkv210_bl_data = { | |||
279 | 276 | ||
280 | static void __init smdkv210_map_io(void) | 277 | static void __init smdkv210_map_io(void) |
281 | { | 278 | { |
282 | s5p_init_io(NULL, 0, S5P_VA_CHIPID); | 279 | s5pv210_init_io(NULL, 0); |
283 | s3c24xx_init_clocks(24000000); | 280 | s3c24xx_init_clocks(24000000); |
284 | s3c24xx_init_uarts(smdkv210_uartcfgs, ARRAY_SIZE(smdkv210_uartcfgs)); | 281 | s3c24xx_init_uarts(smdkv210_uartcfgs, ARRAY_SIZE(smdkv210_uartcfgs)); |
285 | s5p_set_timer_source(S5P_PWM2, S5P_PWM4); | 282 | s5p_set_timer_source(S5P_PWM2, S5P_PWM4); |
@@ -321,4 +318,5 @@ MACHINE_START(SMDKV210, "SMDKV210") | |||
321 | .map_io = smdkv210_map_io, | 318 | .map_io = smdkv210_map_io, |
322 | .init_machine = smdkv210_machine_init, | 319 | .init_machine = smdkv210_machine_init, |
323 | .timer = &s5p_timer, | 320 | .timer = &s5p_timer, |
321 | .restart = s5pv210_restart, | ||
324 | MACHINE_END | 322 | MACHINE_END |
diff --git a/arch/arm/mach-s5pv210/mach-torbreck.c b/arch/arm/mach-s5pv210/mach-torbreck.c index df70fcb3451..74e99bc0dc9 100644 --- a/arch/arm/mach-s5pv210/mach-torbreck.c +++ b/arch/arm/mach-s5pv210/mach-torbreck.c | |||
@@ -24,12 +24,13 @@ | |||
24 | #include <mach/regs-clock.h> | 24 | #include <mach/regs-clock.h> |
25 | 25 | ||
26 | #include <plat/regs-serial.h> | 26 | #include <plat/regs-serial.h> |
27 | #include <plat/s5pv210.h> | ||
28 | #include <plat/devs.h> | 27 | #include <plat/devs.h> |
29 | #include <plat/cpu.h> | 28 | #include <plat/cpu.h> |
30 | #include <plat/iic.h> | 29 | #include <plat/iic.h> |
31 | #include <plat/s5p-time.h> | 30 | #include <plat/s5p-time.h> |
32 | 31 | ||
32 | #include "common.h" | ||
33 | |||
33 | /* Following are default values for UCON, ULCON and UFCON UART registers */ | 34 | /* Following are default values for UCON, ULCON and UFCON UART registers */ |
34 | #define TORBRECK_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ | 35 | #define TORBRECK_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ |
35 | S3C2410_UCON_RXILEVEL | \ | 36 | S3C2410_UCON_RXILEVEL | \ |
@@ -103,7 +104,7 @@ static struct i2c_board_info torbreck_i2c_devs2[] __initdata = { | |||
103 | 104 | ||
104 | static void __init torbreck_map_io(void) | 105 | static void __init torbreck_map_io(void) |
105 | { | 106 | { |
106 | s5p_init_io(NULL, 0, S5P_VA_CHIPID); | 107 | s5pv210_init_io(NULL, 0); |
107 | s3c24xx_init_clocks(24000000); | 108 | s3c24xx_init_clocks(24000000); |
108 | s3c24xx_init_uarts(torbreck_uartcfgs, ARRAY_SIZE(torbreck_uartcfgs)); | 109 | s3c24xx_init_uarts(torbreck_uartcfgs, ARRAY_SIZE(torbreck_uartcfgs)); |
109 | s5p_set_timer_source(S5P_PWM3, S5P_PWM4); | 110 | s5p_set_timer_source(S5P_PWM3, S5P_PWM4); |
@@ -132,4 +133,5 @@ MACHINE_START(TORBRECK, "TORBRECK") | |||
132 | .map_io = torbreck_map_io, | 133 | .map_io = torbreck_map_io, |
133 | .init_machine = torbreck_machine_init, | 134 | .init_machine = torbreck_machine_init, |
134 | .timer = &s5p_timer, | 135 | .timer = &s5p_timer, |
136 | .restart = s5pv210_restart, | ||
135 | MACHINE_END | 137 | MACHINE_END |
diff --git a/arch/arm/mach-s5pv210/setup-sdhci.c b/arch/arm/mach-s5pv210/setup-sdhci.c deleted file mode 100644 index 6b8ccc4d35f..00000000000 --- a/arch/arm/mach-s5pv210/setup-sdhci.c +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | /* linux/arch/arm/mach-s5pv210/setup-sdhci.c | ||
2 | * | ||
3 | * Copyright (c) 2009-2010 Samsung Electronics Co., Ltd. | ||
4 | * http://www.samsung.com/ | ||
5 | * | ||
6 | * S5PV210 - Helper functions for settign up SDHCI device(s) (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/types.h> | ||
14 | |||
15 | /* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */ | ||
16 | |||
17 | char *s5pv210_hsmmc_clksrcs[4] = { | ||
18 | [0] = "hsmmc", /* HCLK */ | ||
19 | /* [1] = "hsmmc", - duplicate HCLK entry */ | ||
20 | [2] = "sclk_mmc", /* mmc_bus */ | ||
21 | /* [3] = NULL, - reserved */ | ||
22 | }; | ||
diff --git a/arch/arm/mach-s5pv210/setup-spi.c b/arch/arm/mach-s5pv210/setup-spi.c new file mode 100644 index 00000000000..f43c5048a37 --- /dev/null +++ b/arch/arm/mach-s5pv210/setup-spi.c | |||
@@ -0,0 +1,51 @@ | |||
1 | /* linux/arch/arm/mach-s5pv210/setup-spi.c | ||
2 | * | ||
3 | * Copyright (C) 2011 Samsung Electronics Ltd. | ||
4 | * http://www.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/gpio.h> | ||
12 | #include <linux/platform_device.h> | ||
13 | |||
14 | #include <plat/gpio-cfg.h> | ||
15 | #include <plat/s3c64xx-spi.h> | ||
16 | |||
17 | #ifdef CONFIG_S3C64XX_DEV_SPI0 | ||
18 | struct s3c64xx_spi_info s3c64xx_spi0_pdata = { | ||
19 | .fifo_lvl_mask = 0x1ff, | ||
20 | .rx_lvl_offset = 15, | ||
21 | .high_speed = 1, | ||
22 | .tx_st_done = 25, | ||
23 | }; | ||
24 | |||
25 | int s3c64xx_spi0_cfg_gpio(struct platform_device *dev) | ||
26 | { | ||
27 | s3c_gpio_cfgpin(S5PV210_GPB(0), S3C_GPIO_SFN(2)); | ||
28 | s3c_gpio_setpull(S5PV210_GPB(0), S3C_GPIO_PULL_UP); | ||
29 | s3c_gpio_cfgall_range(S5PV210_GPB(2), 2, | ||
30 | S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP); | ||
31 | return 0; | ||
32 | } | ||
33 | #endif | ||
34 | |||
35 | #ifdef CONFIG_S3C64XX_DEV_SPI1 | ||
36 | struct s3c64xx_spi_info s3c64xx_spi1_pdata = { | ||
37 | .fifo_lvl_mask = 0x7f, | ||
38 | .rx_lvl_offset = 15, | ||
39 | .high_speed = 1, | ||
40 | .tx_st_done = 25, | ||
41 | }; | ||
42 | |||
43 | int s3c64xx_spi1_cfg_gpio(struct platform_device *dev) | ||
44 | { | ||
45 | s3c_gpio_cfgpin(S5PV210_GPB(4), S3C_GPIO_SFN(2)); | ||
46 | s3c_gpio_setpull(S5PV210_GPB(4), S3C_GPIO_PULL_UP); | ||
47 | s3c_gpio_cfgall_range(S5PV210_GPB(6), 2, | ||
48 | S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP); | ||
49 | return 0; | ||
50 | } | ||
51 | #endif | ||