aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-s5pv210/clock.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-s5pv210/clock.c')
-rw-r--r--arch/arm/mach-s5pv210/clock.c107
1 files changed, 67 insertions, 40 deletions
diff --git a/arch/arm/mach-s5pv210/clock.c b/arch/arm/mach-s5pv210/clock.c
index 04c9b578e626..d8df66887060 100644
--- a/arch/arm/mach-s5pv210/clock.c
+++ b/arch/arm/mach-s5pv210/clock.c
@@ -810,46 +810,6 @@ static struct clksrc_clk clksrcs[] = {
810 .reg_div = { .reg = S5P_CLK_DIV6, .shift = 12, .size = 3 }, 810 .reg_div = { .reg = S5P_CLK_DIV6, .shift = 12, .size = 3 },
811 }, { 811 }, {
812 .clk = { 812 .clk = {
813 .name = "uclk1",
814 .devname = "s5pv210-uart.0",
815 .enable = s5pv210_clk_mask0_ctrl,
816 .ctrlbit = (1 << 12),
817 },
818 .sources = &clkset_uart,
819 .reg_src = { .reg = S5P_CLK_SRC4, .shift = 16, .size = 4 },
820 .reg_div = { .reg = S5P_CLK_DIV4, .shift = 16, .size = 4 },
821 }, {
822 .clk = {
823 .name = "uclk1",
824 .devname = "s5pv210-uart.1",
825 .enable = s5pv210_clk_mask0_ctrl,
826 .ctrlbit = (1 << 13),
827 },
828 .sources = &clkset_uart,
829 .reg_src = { .reg = S5P_CLK_SRC4, .shift = 20, .size = 4 },
830 .reg_div = { .reg = S5P_CLK_DIV4, .shift = 20, .size = 4 },
831 }, {
832 .clk = {
833 .name = "uclk1",
834 .devname = "s5pv210-uart.2",
835 .enable = s5pv210_clk_mask0_ctrl,
836 .ctrlbit = (1 << 14),
837 },
838 .sources = &clkset_uart,
839 .reg_src = { .reg = S5P_CLK_SRC4, .shift = 24, .size = 4 },
840 .reg_div = { .reg = S5P_CLK_DIV4, .shift = 24, .size = 4 },
841 }, {
842 .clk = {
843 .name = "uclk1",
844 .devname = "s5pv210-uart.3",
845 .enable = s5pv210_clk_mask0_ctrl,
846 .ctrlbit = (1 << 15),
847 },
848 .sources = &clkset_uart,
849 .reg_src = { .reg = S5P_CLK_SRC4, .shift = 28, .size = 4 },
850 .reg_div = { .reg = S5P_CLK_DIV4, .shift = 28, .size = 4 },
851 }, {
852 .clk = {
853 .name = "sclk_fimc", 813 .name = "sclk_fimc",
854 .devname = "s5pv210-fimc.0", 814 .devname = "s5pv210-fimc.0",
855 .enable = s5pv210_clk_mask1_ctrl, 815 .enable = s5pv210_clk_mask1_ctrl,
@@ -1023,6 +983,61 @@ static struct clksrc_clk clksrcs[] = {
1023 }, 983 },
1024}; 984};
1025 985
986static struct clksrc_clk clk_sclk_uart0 = {
987 .clk = {
988 .name = "uclk1",
989 .devname = "s5pv210-uart.0",
990 .enable = s5pv210_clk_mask0_ctrl,
991 .ctrlbit = (1 << 12),
992 },
993 .sources = &clkset_uart,
994 .reg_src = { .reg = S5P_CLK_SRC4, .shift = 16, .size = 4 },
995 .reg_div = { .reg = S5P_CLK_DIV4, .shift = 16, .size = 4 },
996};
997
998static struct clksrc_clk clk_sclk_uart1 = {
999 .clk = {
1000 .name = "uclk1",
1001 .devname = "s5pv210-uart.1",
1002 .enable = s5pv210_clk_mask0_ctrl,
1003 .ctrlbit = (1 << 13),
1004 },
1005 .sources = &clkset_uart,
1006 .reg_src = { .reg = S5P_CLK_SRC4, .shift = 20, .size = 4 },
1007 .reg_div = { .reg = S5P_CLK_DIV4, .shift = 20, .size = 4 },
1008};
1009
1010static struct clksrc_clk clk_sclk_uart2 = {
1011 .clk = {
1012 .name = "uclk1",
1013 .devname = "s5pv210-uart.2",
1014 .enable = s5pv210_clk_mask0_ctrl,
1015 .ctrlbit = (1 << 14),
1016 },
1017 .sources = &clkset_uart,
1018 .reg_src = { .reg = S5P_CLK_SRC4, .shift = 24, .size = 4 },
1019 .reg_div = { .reg = S5P_CLK_DIV4, .shift = 24, .size = 4 },
1020};
1021
1022static struct clksrc_clk clk_sclk_uart3 = {
1023 .clk = {
1024 .name = "uclk1",
1025 .devname = "s5pv210-uart.3",
1026 .enable = s5pv210_clk_mask0_ctrl,
1027 .ctrlbit = (1 << 15),
1028 },
1029 .sources = &clkset_uart,
1030 .reg_src = { .reg = S5P_CLK_SRC4, .shift = 28, .size = 4 },
1031 .reg_div = { .reg = S5P_CLK_DIV4, .shift = 28, .size = 4 },
1032};
1033
1034static struct clksrc_clk *clksrc_cdev[] = {
1035 &clk_sclk_uart0,
1036 &clk_sclk_uart1,
1037 &clk_sclk_uart2,
1038 &clk_sclk_uart3,
1039};
1040
1026/* Clock initialisation code */ 1041/* Clock initialisation code */
1027static struct clksrc_clk *sysclks[] = { 1042static struct clksrc_clk *sysclks[] = {
1028 &clk_mout_apll, 1043 &clk_mout_apll,
@@ -1262,6 +1277,14 @@ static struct clk *clks[] __initdata = {
1262 &clk_pcmcdclk2, 1277 &clk_pcmcdclk2,
1263}; 1278};
1264 1279
1280static struct clk_lookup s5pv210_clk_lookup[] = {
1281 CLKDEV_INIT(NULL, "clk_uart_baud0", &clk_p),
1282 CLKDEV_INIT("s5pv210-uart.0", "clk_uart_baud1", &clk_sclk_uart0.clk),
1283 CLKDEV_INIT("s5pv210-uart.1", "clk_uart_baud1", &clk_sclk_uart1.clk),
1284 CLKDEV_INIT("s5pv210-uart.2", "clk_uart_baud1", &clk_sclk_uart2.clk),
1285 CLKDEV_INIT("s5pv210-uart.3", "clk_uart_baud1", &clk_sclk_uart3.clk),
1286};
1287
1265void __init s5pv210_register_clocks(void) 1288void __init s5pv210_register_clocks(void)
1266{ 1289{
1267 int ptr; 1290 int ptr;
@@ -1274,11 +1297,15 @@ void __init s5pv210_register_clocks(void)
1274 for (ptr = 0; ptr < ARRAY_SIZE(sclk_tv); ptr++) 1297 for (ptr = 0; ptr < ARRAY_SIZE(sclk_tv); ptr++)
1275 s3c_register_clksrc(sclk_tv[ptr], 1); 1298 s3c_register_clksrc(sclk_tv[ptr], 1);
1276 1299
1300 for (ptr = 0; ptr < ARRAY_SIZE(clksrc_cdev); ptr++)
1301 s3c_register_clksrc(clksrc_cdev[ptr], 1);
1302
1277 s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); 1303 s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs));
1278 s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); 1304 s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks));
1279 1305
1280 s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); 1306 s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off));
1281 s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); 1307 s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off));
1308 clkdev_add_table(s5pv210_clk_lookup, ARRAY_SIZE(s5pv210_clk_lookup));
1282 1309
1283 s3c24xx_register_clock(&dummy_apb_pclk); 1310 s3c24xx_register_clock(&dummy_apb_pclk);
1284 s3c_pwmclk_init(); 1311 s3c_pwmclk_init();