diff options
author | Tomasz Stanislawski <t.stanislaws@samsung.com> | 2011-09-19 03:44:42 -0400 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2011-10-04 05:58:26 -0400 |
commit | fbf05563fe2a3c83c18b4e2768a0d96971a07b16 (patch) | |
tree | 7647b301bd1a9046ba943636df5d89be56a460cc /arch | |
parent | c40e7e0d91b799ed5acf79ae16a2521809d03dd5 (diff) |
ARM: S5P: add support for tv device
This patch adds all the resources for TV drivers and devices for Samsung
Exynos4 and S5PV210 platforms.
Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
[m.szyprowski: squashed Exynos4 and S5PV210 patches and rewrote commit message]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-exynos4/clock.c | 194 | ||||
-rw-r--r-- | arch/arm/mach-exynos4/cpu.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-exynos4/include/mach/irqs.h | 4 | ||||
-rw-r--r-- | arch/arm/mach-exynos4/include/mach/map.h | 8 | ||||
-rw-r--r-- | arch/arm/mach-exynos4/include/mach/regs-pmu.h | 6 | ||||
-rw-r--r-- | arch/arm/mach-s5pv210/clock.c | 131 | ||||
-rw-r--r-- | arch/arm/mach-s5pv210/cpu.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-s5pv210/include/mach/irqs.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-s5pv210/include/mach/map.h | 10 | ||||
-rw-r--r-- | arch/arm/mach-s5pv210/include/mach/regs-clock.h | 3 | ||||
-rw-r--r-- | arch/arm/plat-s5p/Kconfig | 5 | ||||
-rw-r--r-- | arch/arm/plat-s5p/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/plat-s5p/dev-tv.c | 98 | ||||
-rw-r--r-- | arch/arm/plat-s5p/include/plat/pll.h | 14 | ||||
-rw-r--r-- | arch/arm/plat-samsung/include/plat/devs.h | 5 | ||||
-rw-r--r-- | arch/arm/plat-samsung/include/plat/tv-core.h | 44 |
16 files changed, 514 insertions, 17 deletions
diff --git a/arch/arm/mach-exynos4/clock.c b/arch/arm/mach-exynos4/clock.c index 0e1ba071e764..13e2421ba9e6 100644 --- a/arch/arm/mach-exynos4/clock.c +++ b/arch/arm/mach-exynos4/clock.c | |||
@@ -88,6 +88,11 @@ static int exynos4_clk_ip_mfc_ctrl(struct clk *clk, int enable) | |||
88 | return s5p_gatectrl(S5P_CLKGATE_IP_MFC, clk, enable); | 88 | return s5p_gatectrl(S5P_CLKGATE_IP_MFC, clk, enable); |
89 | } | 89 | } |
90 | 90 | ||
91 | static int exynos4_clksrc_mask_tv_ctrl(struct clk *clk, int enable) | ||
92 | { | ||
93 | return s5p_gatectrl(S5P_CLKSRC_MASK_TV, clk, enable); | ||
94 | } | ||
95 | |||
91 | static int exynos4_clk_ip_cam_ctrl(struct clk *clk, int enable) | 96 | static int exynos4_clk_ip_cam_ctrl(struct clk *clk, int enable) |
92 | { | 97 | { |
93 | return s5p_gatectrl(S5P_CLKGATE_IP_CAM, clk, enable); | 98 | return s5p_gatectrl(S5P_CLKGATE_IP_CAM, clk, enable); |
@@ -128,6 +133,16 @@ static int exynos4_clk_ip_perir_ctrl(struct clk *clk, int enable) | |||
128 | return s5p_gatectrl(S5P_CLKGATE_IP_PERIR, clk, enable); | 133 | return s5p_gatectrl(S5P_CLKGATE_IP_PERIR, clk, enable); |
129 | } | 134 | } |
130 | 135 | ||
136 | static int exynos4_clk_hdmiphy_ctrl(struct clk *clk, int enable) | ||
137 | { | ||
138 | return s5p_gatectrl(S5P_HDMI_PHY_CONTROL, clk, enable); | ||
139 | } | ||
140 | |||
141 | static int exynos4_clk_dac_ctrl(struct clk *clk, int enable) | ||
142 | { | ||
143 | return s5p_gatectrl(S5P_DAC_PHY_CONTROL, clk, enable); | ||
144 | } | ||
145 | |||
131 | /* Core list of CMU_CPU side */ | 146 | /* Core list of CMU_CPU side */ |
132 | 147 | ||
133 | static struct clksrc_clk clk_mout_apll = { | 148 | static struct clksrc_clk clk_mout_apll = { |
@@ -454,6 +469,36 @@ static struct clk init_clocks_off[] = { | |||
454 | .enable = exynos4_clk_ip_fsys_ctrl, | 469 | .enable = exynos4_clk_ip_fsys_ctrl, |
455 | .ctrlbit = (1 << 9), | 470 | .ctrlbit = (1 << 9), |
456 | }, { | 471 | }, { |
472 | .name = "dac", | ||
473 | .devname = "s5p-sdo", | ||
474 | .enable = exynos4_clk_ip_tv_ctrl, | ||
475 | .ctrlbit = (1 << 2), | ||
476 | }, { | ||
477 | .name = "mixer", | ||
478 | .devname = "s5p-mixer", | ||
479 | .enable = exynos4_clk_ip_tv_ctrl, | ||
480 | .ctrlbit = (1 << 1), | ||
481 | }, { | ||
482 | .name = "vp", | ||
483 | .devname = "s5p-mixer", | ||
484 | .enable = exynos4_clk_ip_tv_ctrl, | ||
485 | .ctrlbit = (1 << 0), | ||
486 | }, { | ||
487 | .name = "hdmi", | ||
488 | .devname = "exynos4-hdmi", | ||
489 | .enable = exynos4_clk_ip_tv_ctrl, | ||
490 | .ctrlbit = (1 << 3), | ||
491 | }, { | ||
492 | .name = "hdmiphy", | ||
493 | .devname = "exynos4-hdmi", | ||
494 | .enable = exynos4_clk_hdmiphy_ctrl, | ||
495 | .ctrlbit = (1 << 0), | ||
496 | }, { | ||
497 | .name = "dacphy", | ||
498 | .devname = "s5p-sdo", | ||
499 | .enable = exynos4_clk_dac_ctrl, | ||
500 | .ctrlbit = (1 << 0), | ||
501 | }, { | ||
457 | .name = "sata", | 502 | .name = "sata", |
458 | .parent = &clk_aclk_133.clk, | 503 | .parent = &clk_aclk_133.clk, |
459 | .enable = exynos4_clk_ip_fsys_ctrl, | 504 | .enable = exynos4_clk_ip_fsys_ctrl, |
@@ -793,6 +838,81 @@ static struct clksrc_sources clkset_mout_mfc = { | |||
793 | .nr_sources = ARRAY_SIZE(clkset_mout_mfc_list), | 838 | .nr_sources = ARRAY_SIZE(clkset_mout_mfc_list), |
794 | }; | 839 | }; |
795 | 840 | ||
841 | static struct clk *clkset_sclk_dac_list[] = { | ||
842 | [0] = &clk_sclk_vpll.clk, | ||
843 | [1] = &clk_sclk_hdmiphy, | ||
844 | }; | ||
845 | |||
846 | static struct clksrc_sources clkset_sclk_dac = { | ||
847 | .sources = clkset_sclk_dac_list, | ||
848 | .nr_sources = ARRAY_SIZE(clkset_sclk_dac_list), | ||
849 | }; | ||
850 | |||
851 | static struct clksrc_clk clk_sclk_dac = { | ||
852 | .clk = { | ||
853 | .name = "sclk_dac", | ||
854 | .enable = exynos4_clksrc_mask_tv_ctrl, | ||
855 | .ctrlbit = (1 << 8), | ||
856 | }, | ||
857 | .sources = &clkset_sclk_dac, | ||
858 | .reg_src = { .reg = S5P_CLKSRC_TV, .shift = 8, .size = 1 }, | ||
859 | }; | ||
860 | |||
861 | static struct clksrc_clk clk_sclk_pixel = { | ||
862 | .clk = { | ||
863 | .name = "sclk_pixel", | ||
864 | .parent = &clk_sclk_vpll.clk, | ||
865 | }, | ||
866 | .reg_div = { .reg = S5P_CLKDIV_TV, .shift = 0, .size = 4 }, | ||
867 | }; | ||
868 | |||
869 | static struct clk *clkset_sclk_hdmi_list[] = { | ||
870 | [0] = &clk_sclk_pixel.clk, | ||
871 | [1] = &clk_sclk_hdmiphy, | ||
872 | }; | ||
873 | |||
874 | static struct clksrc_sources clkset_sclk_hdmi = { | ||
875 | .sources = clkset_sclk_hdmi_list, | ||
876 | .nr_sources = ARRAY_SIZE(clkset_sclk_hdmi_list), | ||
877 | }; | ||
878 | |||
879 | static struct clksrc_clk clk_sclk_hdmi = { | ||
880 | .clk = { | ||
881 | .name = "sclk_hdmi", | ||
882 | .enable = exynos4_clksrc_mask_tv_ctrl, | ||
883 | .ctrlbit = (1 << 0), | ||
884 | }, | ||
885 | .sources = &clkset_sclk_hdmi, | ||
886 | .reg_src = { .reg = S5P_CLKSRC_TV, .shift = 0, .size = 1 }, | ||
887 | }; | ||
888 | |||
889 | static struct clk *clkset_sclk_mixer_list[] = { | ||
890 | [0] = &clk_sclk_dac.clk, | ||
891 | [1] = &clk_sclk_hdmi.clk, | ||
892 | }; | ||
893 | |||
894 | static struct clksrc_sources clkset_sclk_mixer = { | ||
895 | .sources = clkset_sclk_mixer_list, | ||
896 | .nr_sources = ARRAY_SIZE(clkset_sclk_mixer_list), | ||
897 | }; | ||
898 | |||
899 | static struct clksrc_clk clk_sclk_mixer = { | ||
900 | .clk = { | ||
901 | .name = "sclk_mixer", | ||
902 | .enable = exynos4_clksrc_mask_tv_ctrl, | ||
903 | .ctrlbit = (1 << 4), | ||
904 | }, | ||
905 | .sources = &clkset_sclk_mixer, | ||
906 | .reg_src = { .reg = S5P_CLKSRC_TV, .shift = 4, .size = 1 }, | ||
907 | }; | ||
908 | |||
909 | static struct clksrc_clk *sclk_tv[] = { | ||
910 | &clk_sclk_dac, | ||
911 | &clk_sclk_pixel, | ||
912 | &clk_sclk_hdmi, | ||
913 | &clk_sclk_mixer, | ||
914 | }; | ||
915 | |||
796 | static struct clksrc_clk clk_dout_mmc0 = { | 916 | static struct clksrc_clk clk_dout_mmc0 = { |
797 | .clk = { | 917 | .clk = { |
798 | .name = "dout_mmc0", | 918 | .name = "dout_mmc0", |
@@ -1132,6 +1252,71 @@ static struct clk_ops exynos4_fout_apll_ops = { | |||
1132 | .get_rate = exynos4_fout_apll_get_rate, | 1252 | .get_rate = exynos4_fout_apll_get_rate, |
1133 | }; | 1253 | }; |
1134 | 1254 | ||
1255 | static u32 vpll_div[][8] = { | ||
1256 | { 54000000, 3, 53, 3, 1024, 0, 17, 0 }, | ||
1257 | { 108000000, 3, 53, 2, 1024, 0, 17, 0 }, | ||
1258 | }; | ||
1259 | |||
1260 | static unsigned long exynos4_vpll_get_rate(struct clk *clk) | ||
1261 | { | ||
1262 | return clk->rate; | ||
1263 | } | ||
1264 | |||
1265 | static int exynos4_vpll_set_rate(struct clk *clk, unsigned long rate) | ||
1266 | { | ||
1267 | unsigned int vpll_con0, vpll_con1 = 0; | ||
1268 | unsigned int i; | ||
1269 | |||
1270 | /* Return if nothing changed */ | ||
1271 | if (clk->rate == rate) | ||
1272 | return 0; | ||
1273 | |||
1274 | vpll_con0 = __raw_readl(S5P_VPLL_CON0); | ||
1275 | vpll_con0 &= ~(0x1 << 27 | \ | ||
1276 | PLL90XX_MDIV_MASK << PLL46XX_MDIV_SHIFT | \ | ||
1277 | PLL90XX_PDIV_MASK << PLL46XX_PDIV_SHIFT | \ | ||
1278 | PLL90XX_SDIV_MASK << PLL46XX_SDIV_SHIFT); | ||
1279 | |||
1280 | vpll_con1 = __raw_readl(S5P_VPLL_CON1); | ||
1281 | vpll_con1 &= ~(PLL46XX_MRR_MASK << PLL46XX_MRR_SHIFT | \ | ||
1282 | PLL46XX_MFR_MASK << PLL46XX_MFR_SHIFT | \ | ||
1283 | PLL4650C_KDIV_MASK << PLL46XX_KDIV_SHIFT); | ||
1284 | |||
1285 | for (i = 0; i < ARRAY_SIZE(vpll_div); i++) { | ||
1286 | if (vpll_div[i][0] == rate) { | ||
1287 | vpll_con0 |= vpll_div[i][1] << PLL46XX_PDIV_SHIFT; | ||
1288 | vpll_con0 |= vpll_div[i][2] << PLL46XX_MDIV_SHIFT; | ||
1289 | vpll_con0 |= vpll_div[i][3] << PLL46XX_SDIV_SHIFT; | ||
1290 | vpll_con1 |= vpll_div[i][4] << PLL46XX_KDIV_SHIFT; | ||
1291 | vpll_con1 |= vpll_div[i][5] << PLL46XX_MFR_SHIFT; | ||
1292 | vpll_con1 |= vpll_div[i][6] << PLL46XX_MRR_SHIFT; | ||
1293 | vpll_con0 |= vpll_div[i][7] << 27; | ||
1294 | break; | ||
1295 | } | ||
1296 | } | ||
1297 | |||
1298 | if (i == ARRAY_SIZE(vpll_div)) { | ||
1299 | printk(KERN_ERR "%s: Invalid Clock VPLL Frequency\n", | ||
1300 | __func__); | ||
1301 | return -EINVAL; | ||
1302 | } | ||
1303 | |||
1304 | __raw_writel(vpll_con0, S5P_VPLL_CON0); | ||
1305 | __raw_writel(vpll_con1, S5P_VPLL_CON1); | ||
1306 | |||
1307 | /* Wait for VPLL lock */ | ||
1308 | while (!(__raw_readl(S5P_VPLL_CON0) & (1 << PLL46XX_LOCKED_SHIFT))) | ||
1309 | continue; | ||
1310 | |||
1311 | clk->rate = rate; | ||
1312 | return 0; | ||
1313 | } | ||
1314 | |||
1315 | static struct clk_ops exynos4_vpll_ops = { | ||
1316 | .get_rate = exynos4_vpll_get_rate, | ||
1317 | .set_rate = exynos4_vpll_set_rate, | ||
1318 | }; | ||
1319 | |||
1135 | void __init_or_cpufreq exynos4_setup_clocks(void) | 1320 | void __init_or_cpufreq exynos4_setup_clocks(void) |
1136 | { | 1321 | { |
1137 | struct clk *xtal_clk; | 1322 | struct clk *xtal_clk; |
@@ -1174,6 +1359,7 @@ void __init_or_cpufreq exynos4_setup_clocks(void) | |||
1174 | clk_fout_apll.ops = &exynos4_fout_apll_ops; | 1359 | clk_fout_apll.ops = &exynos4_fout_apll_ops; |
1175 | clk_fout_mpll.rate = mpll; | 1360 | clk_fout_mpll.rate = mpll; |
1176 | clk_fout_epll.rate = epll; | 1361 | clk_fout_epll.rate = epll; |
1362 | clk_fout_vpll.ops = &exynos4_vpll_ops; | ||
1177 | clk_fout_vpll.rate = vpll; | 1363 | clk_fout_vpll.rate = vpll; |
1178 | 1364 | ||
1179 | printk(KERN_INFO "EXYNOS4: PLL settings, A=%ld, M=%ld, E=%ld V=%ld", | 1365 | printk(KERN_INFO "EXYNOS4: PLL settings, A=%ld, M=%ld, E=%ld V=%ld", |
@@ -1201,7 +1387,10 @@ void __init_or_cpufreq exynos4_setup_clocks(void) | |||
1201 | } | 1387 | } |
1202 | 1388 | ||
1203 | static struct clk *clks[] __initdata = { | 1389 | static struct clk *clks[] __initdata = { |
1204 | /* Nothing here yet */ | 1390 | &clk_sclk_hdmi27m, |
1391 | &clk_sclk_hdmiphy, | ||
1392 | &clk_sclk_usbphy0, | ||
1393 | &clk_sclk_usbphy1, | ||
1205 | }; | 1394 | }; |
1206 | 1395 | ||
1207 | void __init exynos4_register_clocks(void) | 1396 | void __init exynos4_register_clocks(void) |
@@ -1213,6 +1402,9 @@ void __init exynos4_register_clocks(void) | |||
1213 | for (ptr = 0; ptr < ARRAY_SIZE(sysclks); ptr++) | 1402 | for (ptr = 0; ptr < ARRAY_SIZE(sysclks); ptr++) |
1214 | s3c_register_clksrc(sysclks[ptr], 1); | 1403 | s3c_register_clksrc(sysclks[ptr], 1); |
1215 | 1404 | ||
1405 | for (ptr = 0; ptr < ARRAY_SIZE(sclk_tv); ptr++) | ||
1406 | s3c_register_clksrc(sclk_tv[ptr], 1); | ||
1407 | |||
1216 | s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); | 1408 | s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); |
1217 | s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); | 1409 | s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); |
1218 | 1410 | ||
diff --git a/arch/arm/mach-exynos4/cpu.c b/arch/arm/mach-exynos4/cpu.c index 746d6fc6d397..62e46e1b0b82 100644 --- a/arch/arm/mach-exynos4/cpu.c +++ b/arch/arm/mach-exynos4/cpu.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <plat/fimc-core.h> | 28 | #include <plat/fimc-core.h> |
29 | #include <plat/iic-core.h> | 29 | #include <plat/iic-core.h> |
30 | #include <plat/reset.h> | 30 | #include <plat/reset.h> |
31 | #include <plat/tv-core.h> | ||
31 | 32 | ||
32 | #include <mach/regs-irq.h> | 33 | #include <mach/regs-irq.h> |
33 | #include <mach/regs-pmu.h> | 34 | #include <mach/regs-pmu.h> |
@@ -162,6 +163,7 @@ void __init exynos4_map_io(void) | |||
162 | s3c_i2c2_setname("s3c2440-i2c"); | 163 | s3c_i2c2_setname("s3c2440-i2c"); |
163 | 164 | ||
164 | s5p_fb_setname(0, "exynos4-fb"); | 165 | s5p_fb_setname(0, "exynos4-fb"); |
166 | s5p_hdmi_setname("exynos4-hdmi"); | ||
165 | } | 167 | } |
166 | 168 | ||
167 | void __init exynos4_init_clocks(int xtal) | 169 | void __init exynos4_init_clocks(int xtal) |
diff --git a/arch/arm/mach-exynos4/include/mach/irqs.h b/arch/arm/mach-exynos4/include/mach/irqs.h index 85011c2d983f..62093b9339db 100644 --- a/arch/arm/mach-exynos4/include/mach/irqs.h +++ b/arch/arm/mach-exynos4/include/mach/irqs.h | |||
@@ -93,9 +93,11 @@ | |||
93 | #define IRQ_2D IRQ_SPI(89) | 93 | #define IRQ_2D IRQ_SPI(89) |
94 | #define IRQ_PCIE IRQ_SPI(90) | 94 | #define IRQ_PCIE IRQ_SPI(90) |
95 | 95 | ||
96 | #define IRQ_MIXER IRQ_SPI(91) | ||
97 | #define IRQ_HDMI IRQ_SPI(92) | ||
96 | #define IRQ_IIC_HDMIPHY IRQ_SPI(93) | 98 | #define IRQ_IIC_HDMIPHY IRQ_SPI(93) |
97 | |||
98 | #define IRQ_MFC IRQ_SPI(94) | 99 | #define IRQ_MFC IRQ_SPI(94) |
100 | #define IRQ_SDO IRQ_SPI(95) | ||
99 | 101 | ||
100 | #define IRQ_AUDIO_SS IRQ_SPI(96) | 102 | #define IRQ_AUDIO_SS IRQ_SPI(96) |
101 | #define IRQ_I2S0 IRQ_SPI(97) | 103 | #define IRQ_I2S0 IRQ_SPI(97) |
diff --git a/arch/arm/mach-exynos4/include/mach/map.h b/arch/arm/mach-exynos4/include/mach/map.h index 380feb981505..d1af8563d73a 100644 --- a/arch/arm/mach-exynos4/include/mach/map.h +++ b/arch/arm/mach-exynos4/include/mach/map.h | |||
@@ -112,6 +112,10 @@ | |||
112 | 112 | ||
113 | #define EXYNOS4_PA_UART 0x13800000 | 113 | #define EXYNOS4_PA_UART 0x13800000 |
114 | 114 | ||
115 | #define EXYNOS4_PA_VP 0x12C00000 | ||
116 | #define EXYNOS4_PA_MIXER 0x12C10000 | ||
117 | #define EXYNOS4_PA_SDO 0x12C20000 | ||
118 | #define EXYNOS4_PA_HDMI 0x12D00000 | ||
115 | #define EXYNOS4_PA_IIC_HDMIPHY 0x138E0000 | 119 | #define EXYNOS4_PA_IIC_HDMIPHY 0x138E0000 |
116 | 120 | ||
117 | #define EXYNOS4_PA_IIC(x) (0x13860000 + ((x) * 0x10000)) | 121 | #define EXYNOS4_PA_IIC(x) (0x13860000 + ((x) * 0x10000)) |
@@ -163,6 +167,10 @@ | |||
163 | #define S5P_PA_TIMER EXYNOS4_PA_TIMER | 167 | #define S5P_PA_TIMER EXYNOS4_PA_TIMER |
164 | #define S5P_PA_EHCI EXYNOS4_PA_EHCI | 168 | #define S5P_PA_EHCI EXYNOS4_PA_EHCI |
165 | 169 | ||
170 | #define S5P_PA_SDO EXYNOS4_PA_SDO | ||
171 | #define S5P_PA_VP EXYNOS4_PA_VP | ||
172 | #define S5P_PA_MIXER EXYNOS4_PA_MIXER | ||
173 | #define S5P_PA_HDMI EXYNOS4_PA_HDMI | ||
166 | #define S5P_PA_IIC_HDMIPHY EXYNOS4_PA_IIC_HDMIPHY | 174 | #define S5P_PA_IIC_HDMIPHY EXYNOS4_PA_IIC_HDMIPHY |
167 | 175 | ||
168 | #define SAMSUNG_PA_KEYPAD EXYNOS4_PA_KEYPAD | 176 | #define SAMSUNG_PA_KEYPAD EXYNOS4_PA_KEYPAD |
diff --git a/arch/arm/mach-exynos4/include/mach/regs-pmu.h b/arch/arm/mach-exynos4/include/mach/regs-pmu.h index cdf9b47c303c..125ced2ad2fe 100644 --- a/arch/arm/mach-exynos4/include/mach/regs-pmu.h +++ b/arch/arm/mach-exynos4/include/mach/regs-pmu.h | |||
@@ -35,9 +35,15 @@ | |||
35 | #define S5P_EINT_WAKEUP_MASK S5P_PMUREG(0x0604) | 35 | #define S5P_EINT_WAKEUP_MASK S5P_PMUREG(0x0604) |
36 | #define S5P_WAKEUP_MASK S5P_PMUREG(0x0608) | 36 | #define S5P_WAKEUP_MASK S5P_PMUREG(0x0608) |
37 | 37 | ||
38 | #define S5P_HDMI_PHY_CONTROL S5P_PMUREG(0x0700) | ||
39 | #define S5P_HDMI_PHY_ENABLE (1 << 0) | ||
40 | |||
38 | #define S5P_USBHOST_PHY_CONTROL S5P_PMUREG(0x0708) | 41 | #define S5P_USBHOST_PHY_CONTROL S5P_PMUREG(0x0708) |
39 | #define S5P_USBHOST_PHY_ENABLE (1 << 0) | 42 | #define S5P_USBHOST_PHY_ENABLE (1 << 0) |
40 | 43 | ||
44 | #define S5P_DAC_PHY_CONTROL S5P_PMUREG(0x070C) | ||
45 | #define S5P_DAC_PHY_ENABLE (1 << 0) | ||
46 | |||
41 | #define S5P_MIPI_DPHY_CONTROL(n) S5P_PMUREG(0x0710 + (n) * 4) | 47 | #define S5P_MIPI_DPHY_CONTROL(n) S5P_PMUREG(0x0710 + (n) * 4) |
42 | #define S5P_MIPI_DPHY_ENABLE (1 << 0) | 48 | #define S5P_MIPI_DPHY_ENABLE (1 << 0) |
43 | #define S5P_MIPI_DPHY_SRESETN (1 << 1) | 49 | #define S5P_MIPI_DPHY_SRESETN (1 << 1) |
diff --git a/arch/arm/mach-s5pv210/clock.c b/arch/arm/mach-s5pv210/clock.c index 60cf8226de8b..4c5ac7a69e9e 100644 --- a/arch/arm/mach-s5pv210/clock.c +++ b/arch/arm/mach-s5pv210/clock.c | |||
@@ -174,6 +174,16 @@ static int s5pv210_clk_mask1_ctrl(struct clk *clk, int enable) | |||
174 | return s5p_gatectrl(S5P_CLK_SRC_MASK1, clk, enable); | 174 | return s5p_gatectrl(S5P_CLK_SRC_MASK1, clk, enable); |
175 | } | 175 | } |
176 | 176 | ||
177 | static int exynos4_clk_hdmiphy_ctrl(struct clk *clk, int enable) | ||
178 | { | ||
179 | return s5p_gatectrl(S5P_HDMI_PHY_CONTROL, clk, enable); | ||
180 | } | ||
181 | |||
182 | static int exynos4_clk_dac_ctrl(struct clk *clk, int enable) | ||
183 | { | ||
184 | return s5p_gatectrl(S5P_DAC_PHY_CONTROL, clk, enable); | ||
185 | } | ||
186 | |||
177 | static struct clk clk_sclk_hdmi27m = { | 187 | static struct clk clk_sclk_hdmi27m = { |
178 | .name = "sclk_hdmi27m", | 188 | .name = "sclk_hdmi27m", |
179 | .rate = 27000000, | 189 | .rate = 27000000, |
@@ -335,6 +345,40 @@ static struct clk init_clocks_off[] = { | |||
335 | .enable = s5pv210_clk_ip0_ctrl, | 345 | .enable = s5pv210_clk_ip0_ctrl, |
336 | .ctrlbit = (1 << 16), | 346 | .ctrlbit = (1 << 16), |
337 | }, { | 347 | }, { |
348 | .name = "dac", | ||
349 | .devname = "s5p-sdo", | ||
350 | .parent = &clk_hclk_dsys.clk, | ||
351 | .enable = s5pv210_clk_ip1_ctrl, | ||
352 | .ctrlbit = (1 << 10), | ||
353 | }, { | ||
354 | .name = "mixer", | ||
355 | .devname = "s5p-mixer", | ||
356 | .parent = &clk_hclk_dsys.clk, | ||
357 | .enable = s5pv210_clk_ip1_ctrl, | ||
358 | .ctrlbit = (1 << 9), | ||
359 | }, { | ||
360 | .name = "vp", | ||
361 | .devname = "s5p-mixer", | ||
362 | .parent = &clk_hclk_dsys.clk, | ||
363 | .enable = s5pv210_clk_ip1_ctrl, | ||
364 | .ctrlbit = (1 << 8), | ||
365 | }, { | ||
366 | .name = "hdmi", | ||
367 | .devname = "s5pv210-hdmi", | ||
368 | .parent = &clk_hclk_dsys.clk, | ||
369 | .enable = s5pv210_clk_ip1_ctrl, | ||
370 | .ctrlbit = (1 << 11), | ||
371 | }, { | ||
372 | .name = "hdmiphy", | ||
373 | .devname = "s5pv210-hdmi", | ||
374 | .enable = exynos4_clk_hdmiphy_ctrl, | ||
375 | .ctrlbit = (1 << 0), | ||
376 | }, { | ||
377 | .name = "dacphy", | ||
378 | .devname = "s5p-sdo", | ||
379 | .enable = exynos4_clk_dac_ctrl, | ||
380 | .ctrlbit = (1 << 0), | ||
381 | }, { | ||
338 | .name = "otg", | 382 | .name = "otg", |
339 | .parent = &clk_hclk_psys.clk, | 383 | .parent = &clk_hclk_psys.clk, |
340 | .enable = s5pv210_clk_ip1_ctrl, | 384 | .enable = s5pv210_clk_ip1_ctrl, |
@@ -605,6 +649,23 @@ static struct clksrc_sources clkset_sclk_mixer = { | |||
605 | .nr_sources = ARRAY_SIZE(clkset_sclk_mixer_list), | 649 | .nr_sources = ARRAY_SIZE(clkset_sclk_mixer_list), |
606 | }; | 650 | }; |
607 | 651 | ||
652 | static struct clksrc_clk clk_sclk_mixer = { | ||
653 | .clk = { | ||
654 | .name = "sclk_mixer", | ||
655 | .enable = s5pv210_clk_mask0_ctrl, | ||
656 | .ctrlbit = (1 << 1), | ||
657 | }, | ||
658 | .sources = &clkset_sclk_mixer, | ||
659 | .reg_src = { .reg = S5P_CLK_SRC1, .shift = 4, .size = 1 }, | ||
660 | }; | ||
661 | |||
662 | static struct clksrc_clk *sclk_tv[] = { | ||
663 | &clk_sclk_dac, | ||
664 | &clk_sclk_pixel, | ||
665 | &clk_sclk_hdmi, | ||
666 | &clk_sclk_mixer, | ||
667 | }; | ||
668 | |||
608 | static struct clk *clkset_sclk_audio0_list[] = { | 669 | static struct clk *clkset_sclk_audio0_list[] = { |
609 | [0] = &clk_ext_xtal_mux, | 670 | [0] = &clk_ext_xtal_mux, |
610 | [1] = &clk_pcmcdclk0, | 671 | [1] = &clk_pcmcdclk0, |
@@ -788,14 +849,6 @@ static struct clksrc_clk clksrcs[] = { | |||
788 | .reg_div = { .reg = S5P_CLK_DIV4, .shift = 28, .size = 4 }, | 849 | .reg_div = { .reg = S5P_CLK_DIV4, .shift = 28, .size = 4 }, |
789 | }, { | 850 | }, { |
790 | .clk = { | 851 | .clk = { |
791 | .name = "sclk_mixer", | ||
792 | .enable = s5pv210_clk_mask0_ctrl, | ||
793 | .ctrlbit = (1 << 1), | ||
794 | }, | ||
795 | .sources = &clkset_sclk_mixer, | ||
796 | .reg_src = { .reg = S5P_CLK_SRC1, .shift = 4, .size = 1 }, | ||
797 | }, { | ||
798 | .clk = { | ||
799 | .name = "sclk_fimc", | 852 | .name = "sclk_fimc", |
800 | .devname = "s5pv210-fimc.0", | 853 | .devname = "s5pv210-fimc.0", |
801 | .enable = s5pv210_clk_mask1_ctrl, | 854 | .enable = s5pv210_clk_mask1_ctrl, |
@@ -984,9 +1037,6 @@ static struct clksrc_clk *sysclks[] = { | |||
984 | &clk_pclk_psys, | 1037 | &clk_pclk_psys, |
985 | &clk_vpllsrc, | 1038 | &clk_vpllsrc, |
986 | &clk_sclk_vpll, | 1039 | &clk_sclk_vpll, |
987 | &clk_sclk_dac, | ||
988 | &clk_sclk_pixel, | ||
989 | &clk_sclk_hdmi, | ||
990 | &clk_mout_dmc0, | 1040 | &clk_mout_dmc0, |
991 | &clk_sclk_dmc0, | 1041 | &clk_sclk_dmc0, |
992 | &clk_sclk_audio0, | 1042 | &clk_sclk_audio0, |
@@ -1071,6 +1121,61 @@ static struct clk_ops s5pv210_epll_ops = { | |||
1071 | .get_rate = s5p_epll_get_rate, | 1121 | .get_rate = s5p_epll_get_rate, |
1072 | }; | 1122 | }; |
1073 | 1123 | ||
1124 | static u32 vpll_div[][5] = { | ||
1125 | { 54000000, 3, 53, 3, 0 }, | ||
1126 | { 108000000, 3, 53, 2, 0 }, | ||
1127 | }; | ||
1128 | |||
1129 | static unsigned long s5pv210_vpll_get_rate(struct clk *clk) | ||
1130 | { | ||
1131 | return clk->rate; | ||
1132 | } | ||
1133 | |||
1134 | static int s5pv210_vpll_set_rate(struct clk *clk, unsigned long rate) | ||
1135 | { | ||
1136 | unsigned int vpll_con; | ||
1137 | unsigned int i; | ||
1138 | |||
1139 | /* Return if nothing changed */ | ||
1140 | if (clk->rate == rate) | ||
1141 | return 0; | ||
1142 | |||
1143 | vpll_con = __raw_readl(S5P_VPLL_CON); | ||
1144 | vpll_con &= ~(0x1 << 27 | \ | ||
1145 | PLL90XX_MDIV_MASK << PLL90XX_MDIV_SHIFT | \ | ||
1146 | PLL90XX_PDIV_MASK << PLL90XX_PDIV_SHIFT | \ | ||
1147 | PLL90XX_SDIV_MASK << PLL90XX_SDIV_SHIFT); | ||
1148 | |||
1149 | for (i = 0; i < ARRAY_SIZE(vpll_div); i++) { | ||
1150 | if (vpll_div[i][0] == rate) { | ||
1151 | vpll_con |= vpll_div[i][1] << PLL90XX_PDIV_SHIFT; | ||
1152 | vpll_con |= vpll_div[i][2] << PLL90XX_MDIV_SHIFT; | ||
1153 | vpll_con |= vpll_div[i][3] << PLL90XX_SDIV_SHIFT; | ||
1154 | vpll_con |= vpll_div[i][4] << 27; | ||
1155 | break; | ||
1156 | } | ||
1157 | } | ||
1158 | |||
1159 | if (i == ARRAY_SIZE(vpll_div)) { | ||
1160 | printk(KERN_ERR "%s: Invalid Clock VPLL Frequency\n", | ||
1161 | __func__); | ||
1162 | return -EINVAL; | ||
1163 | } | ||
1164 | |||
1165 | __raw_writel(vpll_con, S5P_VPLL_CON); | ||
1166 | |||
1167 | /* Wait for VPLL lock */ | ||
1168 | while (!(__raw_readl(S5P_VPLL_CON) & (1 << PLL90XX_LOCKED_SHIFT))) | ||
1169 | continue; | ||
1170 | |||
1171 | clk->rate = rate; | ||
1172 | return 0; | ||
1173 | } | ||
1174 | static struct clk_ops s5pv210_vpll_ops = { | ||
1175 | .get_rate = s5pv210_vpll_get_rate, | ||
1176 | .set_rate = s5pv210_vpll_set_rate, | ||
1177 | }; | ||
1178 | |||
1074 | void __init_or_cpufreq s5pv210_setup_clocks(void) | 1179 | void __init_or_cpufreq s5pv210_setup_clocks(void) |
1075 | { | 1180 | { |
1076 | struct clk *xtal_clk; | 1181 | struct clk *xtal_clk; |
@@ -1119,6 +1224,7 @@ void __init_or_cpufreq s5pv210_setup_clocks(void) | |||
1119 | clk_fout_apll.ops = &clk_fout_apll_ops; | 1224 | clk_fout_apll.ops = &clk_fout_apll_ops; |
1120 | clk_fout_mpll.rate = mpll; | 1225 | clk_fout_mpll.rate = mpll; |
1121 | clk_fout_epll.rate = epll; | 1226 | clk_fout_epll.rate = epll; |
1227 | clk_fout_vpll.ops = &s5pv210_vpll_ops; | ||
1122 | clk_fout_vpll.rate = vpll; | 1228 | clk_fout_vpll.rate = vpll; |
1123 | 1229 | ||
1124 | printk(KERN_INFO "S5PV210: PLL settings, A=%ld, M=%ld, E=%ld V=%ld", | 1230 | printk(KERN_INFO "S5PV210: PLL settings, A=%ld, M=%ld, E=%ld V=%ld", |
@@ -1164,6 +1270,9 @@ void __init s5pv210_register_clocks(void) | |||
1164 | for (ptr = 0; ptr < ARRAY_SIZE(sysclks); ptr++) | 1270 | for (ptr = 0; ptr < ARRAY_SIZE(sysclks); ptr++) |
1165 | s3c_register_clksrc(sysclks[ptr], 1); | 1271 | s3c_register_clksrc(sysclks[ptr], 1); |
1166 | 1272 | ||
1273 | for (ptr = 0; ptr < ARRAY_SIZE(sclk_tv); ptr++) | ||
1274 | s3c_register_clksrc(sclk_tv[ptr], 1); | ||
1275 | |||
1167 | s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); | 1276 | s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); |
1168 | s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); | 1277 | s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); |
1169 | 1278 | ||
diff --git a/arch/arm/mach-s5pv210/cpu.c b/arch/arm/mach-s5pv210/cpu.c index 79907ec78d43..6b8cdccbe931 100644 --- a/arch/arm/mach-s5pv210/cpu.c +++ b/arch/arm/mach-s5pv210/cpu.c | |||
@@ -41,6 +41,7 @@ | |||
41 | #include <plat/keypad-core.h> | 41 | #include <plat/keypad-core.h> |
42 | #include <plat/sdhci.h> | 42 | #include <plat/sdhci.h> |
43 | #include <plat/reset.h> | 43 | #include <plat/reset.h> |
44 | #include <plat/tv-core.h> | ||
44 | 45 | ||
45 | /* Initial IO mappings */ | 46 | /* Initial IO mappings */ |
46 | 47 | ||
@@ -143,6 +144,9 @@ void __init s5pv210_map_io(void) | |||
143 | 144 | ||
144 | /* Use s5pv210-keypad instead of samsung-keypad */ | 145 | /* Use s5pv210-keypad instead of samsung-keypad */ |
145 | samsung_keypad_setname("s5pv210-keypad"); | 146 | samsung_keypad_setname("s5pv210-keypad"); |
147 | |||
148 | /* setup TV devices */ | ||
149 | s5p_hdmi_setname("s5pv210-hdmi"); | ||
146 | } | 150 | } |
147 | 151 | ||
148 | void __init s5pv210_init_clocks(int xtal) | 152 | void __init s5pv210_init_clocks(int xtal) |
diff --git a/arch/arm/mach-s5pv210/include/mach/irqs.h b/arch/arm/mach-s5pv210/include/mach/irqs.h index c1da0a7fb184..5e0de3a31f3d 100644 --- a/arch/arm/mach-s5pv210/include/mach/irqs.h +++ b/arch/arm/mach-s5pv210/include/mach/irqs.h | |||
@@ -86,7 +86,7 @@ | |||
86 | #define IRQ_HDMI S5P_IRQ_VIC2(12) | 86 | #define IRQ_HDMI S5P_IRQ_VIC2(12) |
87 | #define IRQ_IIC1 S5P_IRQ_VIC2(13) | 87 | #define IRQ_IIC1 S5P_IRQ_VIC2(13) |
88 | #define IRQ_MFC S5P_IRQ_VIC2(14) | 88 | #define IRQ_MFC S5P_IRQ_VIC2(14) |
89 | #define IRQ_TVENC S5P_IRQ_VIC2(15) | 89 | #define IRQ_SDO S5P_IRQ_VIC2(15) |
90 | #define IRQ_I2S0 S5P_IRQ_VIC2(16) | 90 | #define IRQ_I2S0 S5P_IRQ_VIC2(16) |
91 | #define IRQ_I2S1 S5P_IRQ_VIC2(17) | 91 | #define IRQ_I2S1 S5P_IRQ_VIC2(17) |
92 | #define IRQ_I2S2 S5P_IRQ_VIC2(18) | 92 | #define IRQ_I2S2 S5P_IRQ_VIC2(18) |
diff --git a/arch/arm/mach-s5pv210/include/mach/map.h b/arch/arm/mach-s5pv210/include/mach/map.h index a420654c2c73..7ff609f1568b 100644 --- a/arch/arm/mach-s5pv210/include/mach/map.h +++ b/arch/arm/mach-s5pv210/include/mach/map.h | |||
@@ -90,6 +90,10 @@ | |||
90 | #define S5PV210_PA_FIMC1 0xFB300000 | 90 | #define S5PV210_PA_FIMC1 0xFB300000 |
91 | #define S5PV210_PA_FIMC2 0xFB400000 | 91 | #define S5PV210_PA_FIMC2 0xFB400000 |
92 | 92 | ||
93 | #define S5PV210_PA_SDO 0xF9000000 | ||
94 | #define S5PV210_PA_VP 0xF9100000 | ||
95 | #define S5PV210_PA_MIXER 0xF9200000 | ||
96 | #define S5PV210_PA_HDMI 0xFA100000 | ||
93 | #define S5PV210_PA_IIC_HDMIPHY 0xFA900000 | 97 | #define S5PV210_PA_IIC_HDMIPHY 0xFA900000 |
94 | 98 | ||
95 | /* Compatibiltiy Defines */ | 99 | /* Compatibiltiy Defines */ |
@@ -113,6 +117,12 @@ | |||
113 | #define S5P_PA_MIPI_CSIS0 S5PV210_PA_MIPI_CSIS | 117 | #define S5P_PA_MIPI_CSIS0 S5PV210_PA_MIPI_CSIS |
114 | #define S5P_PA_MFC S5PV210_PA_MFC | 118 | #define S5P_PA_MFC S5PV210_PA_MFC |
115 | #define S5P_PA_IIC_HDMIPHY S5PV210_PA_IIC_HDMIPHY | 119 | #define S5P_PA_IIC_HDMIPHY S5PV210_PA_IIC_HDMIPHY |
120 | |||
121 | #define S5P_PA_SDO S5PV210_PA_SDO | ||
122 | #define S5P_PA_VP S5PV210_PA_VP | ||
123 | #define S5P_PA_MIXER S5PV210_PA_MIXER | ||
124 | #define S5P_PA_HDMI S5PV210_PA_HDMI | ||
125 | |||
116 | #define S5P_PA_ONENAND S5PC110_PA_ONENAND | 126 | #define S5P_PA_ONENAND S5PC110_PA_ONENAND |
117 | #define S5P_PA_ONENAND_DMA S5PC110_PA_ONENAND_DMA | 127 | #define S5P_PA_ONENAND_DMA S5PC110_PA_ONENAND_DMA |
118 | #define S5P_PA_SDRAM S5PV210_PA_SDRAM | 128 | #define S5P_PA_SDRAM S5PV210_PA_SDRAM |
diff --git a/arch/arm/mach-s5pv210/include/mach/regs-clock.h b/arch/arm/mach-s5pv210/include/mach/regs-clock.h index 78925c516346..032de66fb8be 100644 --- a/arch/arm/mach-s5pv210/include/mach/regs-clock.h +++ b/arch/arm/mach-s5pv210/include/mach/regs-clock.h | |||
@@ -144,8 +144,9 @@ | |||
144 | 144 | ||
145 | #define S5P_OTHERS S5P_CLKREG(0xE000) | 145 | #define S5P_OTHERS S5P_CLKREG(0xE000) |
146 | #define S5P_OM_STAT S5P_CLKREG(0xE100) | 146 | #define S5P_OM_STAT S5P_CLKREG(0xE100) |
147 | #define S5P_HDMI_PHY_CONTROL S5P_CLKREG(0xE804) | ||
147 | #define S5P_USB_PHY_CONTROL S5P_CLKREG(0xE80C) | 148 | #define S5P_USB_PHY_CONTROL S5P_CLKREG(0xE80C) |
148 | #define S5P_DAC_CONTROL S5P_CLKREG(0xE810) | 149 | #define S5P_DAC_PHY_CONTROL S5P_CLKREG(0xE810) |
149 | #define S5P_MIPI_DPHY_CONTROL(x) S5P_CLKREG(0xE814) | 150 | #define S5P_MIPI_DPHY_CONTROL(x) S5P_CLKREG(0xE814) |
150 | #define S5P_MIPI_DPHY_ENABLE (1 << 0) | 151 | #define S5P_MIPI_DPHY_ENABLE (1 << 0) |
151 | #define S5P_MIPI_DPHY_SRESETN (1 << 1) | 152 | #define S5P_MIPI_DPHY_SRESETN (1 << 1) |
diff --git a/arch/arm/plat-s5p/Kconfig b/arch/arm/plat-s5p/Kconfig index a554d03b99b1..f9241a7a68ca 100644 --- a/arch/arm/plat-s5p/Kconfig +++ b/arch/arm/plat-s5p/Kconfig | |||
@@ -98,6 +98,11 @@ config S5P_DEV_CSIS1 | |||
98 | help | 98 | help |
99 | Compile in platform device definitions for MIPI-CSIS channel 1 | 99 | Compile in platform device definitions for MIPI-CSIS channel 1 |
100 | 100 | ||
101 | config S5P_DEV_TV | ||
102 | bool | ||
103 | help | ||
104 | Compile in platform device definition for TV interface | ||
105 | |||
101 | config S5P_DEV_USB_EHCI | 106 | config S5P_DEV_USB_EHCI |
102 | bool | 107 | bool |
103 | help | 108 | help |
diff --git a/arch/arm/plat-s5p/Makefile b/arch/arm/plat-s5p/Makefile index 1dd10dc91e64..181201974b41 100644 --- a/arch/arm/plat-s5p/Makefile +++ b/arch/arm/plat-s5p/Makefile | |||
@@ -35,5 +35,6 @@ obj-$(CONFIG_S5P_DEV_I2C_HDMIPHY) += dev-i2c-hdmiphy.o | |||
35 | obj-$(CONFIG_S5P_DEV_ONENAND) += dev-onenand.o | 35 | obj-$(CONFIG_S5P_DEV_ONENAND) += dev-onenand.o |
36 | obj-$(CONFIG_S5P_DEV_CSIS0) += dev-csis0.o | 36 | obj-$(CONFIG_S5P_DEV_CSIS0) += dev-csis0.o |
37 | obj-$(CONFIG_S5P_DEV_CSIS1) += dev-csis1.o | 37 | obj-$(CONFIG_S5P_DEV_CSIS1) += dev-csis1.o |
38 | obj-$(CONFIG_S5P_DEV_TV) += dev-tv.o | ||
38 | obj-$(CONFIG_S5P_DEV_USB_EHCI) += dev-ehci.o | 39 | obj-$(CONFIG_S5P_DEV_USB_EHCI) += dev-ehci.o |
39 | obj-$(CONFIG_S5P_SETUP_MIPIPHY) += setup-mipiphy.o | 40 | obj-$(CONFIG_S5P_SETUP_MIPIPHY) += setup-mipiphy.o |
diff --git a/arch/arm/plat-s5p/dev-tv.c b/arch/arm/plat-s5p/dev-tv.c new file mode 100644 index 000000000000..361a1b63a81b --- /dev/null +++ b/arch/arm/plat-s5p/dev-tv.c | |||
@@ -0,0 +1,98 @@ | |||
1 | /* linux/arch/arm/plat-s5p/dev-tv.c | ||
2 | * | ||
3 | * Copyright (C) 2011 Samsung Electronics Co.Ltd | ||
4 | * Author: Tomasz Stanislawski <t.stanislaws@samsung.com> | ||
5 | * | ||
6 | * S5P series device definition for TV device | ||
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/dma-mapping.h> | ||
14 | |||
15 | #include <mach/irqs.h> | ||
16 | #include <mach/map.h> | ||
17 | |||
18 | #include <plat/devs.h> | ||
19 | |||
20 | /* HDMI interface */ | ||
21 | static struct resource s5p_hdmi_resources[] = { | ||
22 | [0] = { | ||
23 | .start = S5P_PA_HDMI, | ||
24 | .end = S5P_PA_HDMI + SZ_1M - 1, | ||
25 | .flags = IORESOURCE_MEM, | ||
26 | }, | ||
27 | [1] = { | ||
28 | .start = IRQ_HDMI, | ||
29 | .end = IRQ_HDMI, | ||
30 | .flags = IORESOURCE_IRQ, | ||
31 | }, | ||
32 | }; | ||
33 | |||
34 | struct platform_device s5p_device_hdmi = { | ||
35 | .name = "s5p-hdmi", | ||
36 | .id = -1, | ||
37 | .num_resources = ARRAY_SIZE(s5p_hdmi_resources), | ||
38 | .resource = s5p_hdmi_resources, | ||
39 | }; | ||
40 | EXPORT_SYMBOL(s5p_device_hdmi); | ||
41 | |||
42 | /* SDO interface */ | ||
43 | static struct resource s5p_sdo_resources[] = { | ||
44 | [0] = { | ||
45 | .start = S5P_PA_SDO, | ||
46 | .end = S5P_PA_SDO + SZ_64K - 1, | ||
47 | .flags = IORESOURCE_MEM, | ||
48 | }, | ||
49 | [1] = { | ||
50 | .start = IRQ_SDO, | ||
51 | .end = IRQ_SDO, | ||
52 | .flags = IORESOURCE_IRQ, | ||
53 | } | ||
54 | }; | ||
55 | |||
56 | struct platform_device s5p_device_sdo = { | ||
57 | .name = "s5p-sdo", | ||
58 | .id = -1, | ||
59 | .num_resources = ARRAY_SIZE(s5p_sdo_resources), | ||
60 | .resource = s5p_sdo_resources, | ||
61 | }; | ||
62 | EXPORT_SYMBOL(s5p_device_sdo); | ||
63 | |||
64 | /* MIXER */ | ||
65 | static struct resource s5p_mixer_resources[] = { | ||
66 | [0] = { | ||
67 | .start = S5P_PA_MIXER, | ||
68 | .end = S5P_PA_MIXER + SZ_64K - 1, | ||
69 | .flags = IORESOURCE_MEM, | ||
70 | .name = "mxr" | ||
71 | }, | ||
72 | [1] = { | ||
73 | .start = S5P_PA_VP, | ||
74 | .end = S5P_PA_VP + SZ_64K - 1, | ||
75 | .flags = IORESOURCE_MEM, | ||
76 | .name = "vp" | ||
77 | }, | ||
78 | [2] = { | ||
79 | .start = IRQ_MIXER, | ||
80 | .end = IRQ_MIXER, | ||
81 | .flags = IORESOURCE_IRQ, | ||
82 | .name = "irq" | ||
83 | } | ||
84 | }; | ||
85 | |||
86 | static u64 s5p_tv_dmamask = DMA_BIT_MASK(32); | ||
87 | |||
88 | struct platform_device s5p_device_mixer = { | ||
89 | .name = "s5p-mixer", | ||
90 | .id = -1, | ||
91 | .num_resources = ARRAY_SIZE(s5p_mixer_resources), | ||
92 | .resource = s5p_mixer_resources, | ||
93 | .dev = { | ||
94 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
95 | .dma_mask = &s5p_tv_dmamask, | ||
96 | } | ||
97 | }; | ||
98 | EXPORT_SYMBOL(s5p_device_mixer); | ||
diff --git a/arch/arm/plat-s5p/include/plat/pll.h b/arch/arm/plat-s5p/include/plat/pll.h index bf28fadee7ae..8b24b366c65d 100644 --- a/arch/arm/plat-s5p/include/plat/pll.h +++ b/arch/arm/plat-s5p/include/plat/pll.h | |||
@@ -46,15 +46,24 @@ static inline unsigned long s5p_get_pll45xx(unsigned long baseclk, u32 pll_con, | |||
46 | return (unsigned long)fvco; | 46 | return (unsigned long)fvco; |
47 | } | 47 | } |
48 | 48 | ||
49 | #define PLL46XX_KDIV_MASK (0xFFFF) | 49 | /* CON0 bit-fields */ |
50 | #define PLL4650C_KDIV_MASK (0xFFF) | ||
51 | #define PLL46XX_MDIV_MASK (0x1FF) | 50 | #define PLL46XX_MDIV_MASK (0x1FF) |
52 | #define PLL46XX_PDIV_MASK (0x3F) | 51 | #define PLL46XX_PDIV_MASK (0x3F) |
53 | #define PLL46XX_SDIV_MASK (0x7) | 52 | #define PLL46XX_SDIV_MASK (0x7) |
53 | #define PLL46XX_LOCKED_SHIFT (29) | ||
54 | #define PLL46XX_MDIV_SHIFT (16) | 54 | #define PLL46XX_MDIV_SHIFT (16) |
55 | #define PLL46XX_PDIV_SHIFT (8) | 55 | #define PLL46XX_PDIV_SHIFT (8) |
56 | #define PLL46XX_SDIV_SHIFT (0) | 56 | #define PLL46XX_SDIV_SHIFT (0) |
57 | 57 | ||
58 | /* CON1 bit-fields */ | ||
59 | #define PLL46XX_MRR_MASK (0x1F) | ||
60 | #define PLL46XX_MFR_MASK (0x3F) | ||
61 | #define PLL46XX_KDIV_MASK (0xFFFF) | ||
62 | #define PLL4650C_KDIV_MASK (0xFFF) | ||
63 | #define PLL46XX_MRR_SHIFT (24) | ||
64 | #define PLL46XX_MFR_SHIFT (16) | ||
65 | #define PLL46XX_KDIV_SHIFT (0) | ||
66 | |||
58 | enum pll46xx_type_t { | 67 | enum pll46xx_type_t { |
59 | pll_4600, | 68 | pll_4600, |
60 | pll_4650, | 69 | pll_4650, |
@@ -98,6 +107,7 @@ static inline unsigned long s5p_get_pll46xx(unsigned long baseclk, | |||
98 | #define PLL90XX_PDIV_MASK (0x3F) | 107 | #define PLL90XX_PDIV_MASK (0x3F) |
99 | #define PLL90XX_SDIV_MASK (0x7) | 108 | #define PLL90XX_SDIV_MASK (0x7) |
100 | #define PLL90XX_KDIV_MASK (0xffff) | 109 | #define PLL90XX_KDIV_MASK (0xffff) |
110 | #define PLL90XX_LOCKED_SHIFT (29) | ||
101 | #define PLL90XX_MDIV_SHIFT (16) | 111 | #define PLL90XX_MDIV_SHIFT (16) |
102 | #define PLL90XX_PDIV_SHIFT (8) | 112 | #define PLL90XX_PDIV_SHIFT (8) |
103 | #define PLL90XX_SDIV_SHIFT (0) | 113 | #define PLL90XX_SDIV_SHIFT (0) |
diff --git a/arch/arm/plat-samsung/include/plat/devs.h b/arch/arm/plat-samsung/include/plat/devs.h index b15805f4de97..ee5014a7cc96 100644 --- a/arch/arm/plat-samsung/include/plat/devs.h +++ b/arch/arm/plat-samsung/include/plat/devs.h | |||
@@ -143,6 +143,11 @@ extern struct platform_device s5p_device_fimc3; | |||
143 | extern struct platform_device s5p_device_mfc; | 143 | extern struct platform_device s5p_device_mfc; |
144 | extern struct platform_device s5p_device_mfc_l; | 144 | extern struct platform_device s5p_device_mfc_l; |
145 | extern struct platform_device s5p_device_mfc_r; | 145 | extern struct platform_device s5p_device_mfc_r; |
146 | |||
147 | extern struct platform_device s5p_device_hdmi; | ||
148 | extern struct platform_device s5p_device_mixer; | ||
149 | extern struct platform_device s5p_device_sdo; | ||
150 | |||
146 | extern struct platform_device s5p_device_mipi_csis0; | 151 | extern struct platform_device s5p_device_mipi_csis0; |
147 | extern struct platform_device s5p_device_mipi_csis1; | 152 | extern struct platform_device s5p_device_mipi_csis1; |
148 | 153 | ||
diff --git a/arch/arm/plat-samsung/include/plat/tv-core.h b/arch/arm/plat-samsung/include/plat/tv-core.h new file mode 100644 index 000000000000..3bc34f3ce28f --- /dev/null +++ b/arch/arm/plat-samsung/include/plat/tv-core.h | |||
@@ -0,0 +1,44 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-samsung/include/plat/tv.h | ||
3 | * | ||
4 | * Copyright 2011 Samsung Electronics Co., Ltd. | ||
5 | * Tomasz Stanislawski <t.stanislaws@samsung.com> | ||
6 | * | ||
7 | * Samsung TV driver core functions | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License version 2 as | ||
11 | * published by the Free Software Foundation. | ||
12 | */ | ||
13 | |||
14 | #ifndef __SAMSUNG_PLAT_TV_H | ||
15 | #define __SAMSUNG_PLAT_TV_H __FILE__ | ||
16 | |||
17 | /* | ||
18 | * These functions are only for use with the core support code, such as | ||
19 | * the CPU-specific initialization code. | ||
20 | */ | ||
21 | |||
22 | /* Re-define device name to differentiate the subsystem in various SoCs. */ | ||
23 | static inline void s5p_hdmi_setname(char *name) | ||
24 | { | ||
25 | #ifdef CONFIG_S5P_DEV_TV | ||
26 | s5p_device_hdmi.name = name; | ||
27 | #endif | ||
28 | } | ||
29 | |||
30 | static inline void s5p_mixer_setname(char *name) | ||
31 | { | ||
32 | #ifdef CONFIG_S5P_DEV_TV | ||
33 | s5p_device_mixer.name = name; | ||
34 | #endif | ||
35 | } | ||
36 | |||
37 | static inline void s5p_sdo_setname(char *name) | ||
38 | { | ||
39 | #ifdef CONFIG_S5P_DEV_TV | ||
40 | s5p_device_sdo.name = name; | ||
41 | #endif | ||
42 | } | ||
43 | |||
44 | #endif /* __SAMSUNG_PLAT_TV_H */ | ||