Tony Lindgren | 1a34275 | 2015-01-13 14:51:28 -0800 | [diff] [blame] | 1 | /* |
| 2 | * This program is free software; you can redistribute it and/or |
| 3 | * modify it under the terms of the GNU General Public License as |
| 4 | * published by the Free Software Foundation version 2. |
| 5 | * |
| 6 | * This program is distributed "as is" WITHOUT ANY WARRANTY of any |
| 7 | * kind, whether express or implied; without even the implied warranty |
| 8 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 9 | * GNU General Public License for more details. |
| 10 | */ |
| 11 | |
| 12 | #include <linux/kernel.h> |
| 13 | #include <linux/list.h> |
| 14 | #include <linux/clk-provider.h> |
| 15 | #include <linux/clk/ti.h> |
| 16 | |
Tero Kristo | a5aa8a6 | 2015-03-03 10:51:01 +0200 | [diff] [blame] | 17 | #include "clock.h" |
| 18 | |
Tony Lindgren | 1a34275 | 2015-01-13 14:51:28 -0800 | [diff] [blame] | 19 | static struct ti_dt_clk dm816x_clks[] = { |
| 20 | DT_CLK(NULL, "sys_clkin", "sys_clkin_ck"), |
| 21 | DT_CLK(NULL, "timer_sys_ck", "sys_clkin_ck"), |
| 22 | DT_CLK(NULL, "sys_32k_ck", "sys_32k_ck"), |
Neil Armstrong | 3a5b1dc | 2015-11-13 17:29:58 +0100 | [diff] [blame] | 23 | DT_CLK(NULL, "timer_32k_ck", "sysclk18_ck"), |
| 24 | DT_CLK(NULL, "timer_ext_ck", "tclkin_ck"), |
Tony Lindgren | 1a34275 | 2015-01-13 14:51:28 -0800 | [diff] [blame] | 25 | DT_CLK(NULL, "mpu_ck", "mpu_ck"), |
| 26 | DT_CLK(NULL, "timer1_fck", "timer1_fck"), |
| 27 | DT_CLK(NULL, "timer2_fck", "timer2_fck"), |
| 28 | DT_CLK(NULL, "timer3_fck", "timer3_fck"), |
| 29 | DT_CLK(NULL, "timer4_fck", "timer4_fck"), |
| 30 | DT_CLK(NULL, "timer5_fck", "timer5_fck"), |
| 31 | DT_CLK(NULL, "timer6_fck", "timer6_fck"), |
| 32 | DT_CLK(NULL, "timer7_fck", "timer7_fck"), |
| 33 | DT_CLK(NULL, "sysclk4_ck", "sysclk4_ck"), |
| 34 | DT_CLK(NULL, "sysclk5_ck", "sysclk5_ck"), |
| 35 | DT_CLK(NULL, "sysclk6_ck", "sysclk6_ck"), |
| 36 | DT_CLK(NULL, "sysclk10_ck", "sysclk10_ck"), |
| 37 | DT_CLK(NULL, "sysclk18_ck", "sysclk18_ck"), |
| 38 | DT_CLK(NULL, "sysclk24_ck", "sysclk24_ck"), |
| 39 | DT_CLK("4a100000.ethernet", "sysclk24_ck", "sysclk24_ck"), |
| 40 | { .node_name = NULL }, |
| 41 | }; |
| 42 | |
| 43 | static const char *enable_init_clks[] = { |
| 44 | "ddr_pll_clk1", |
| 45 | "ddr_pll_clk2", |
| 46 | "ddr_pll_clk3", |
| 47 | }; |
| 48 | |
Tony Lindgren | 9cf705d | 2015-07-16 01:55:57 -0700 | [diff] [blame] | 49 | int __init dm816x_dt_clk_init(void) |
Tony Lindgren | 1a34275 | 2015-01-13 14:51:28 -0800 | [diff] [blame] | 50 | { |
| 51 | ti_dt_clocks_register(dm816x_clks); |
| 52 | omap2_clk_disable_autoidle_all(); |
| 53 | omap2_clk_enable_init_clocks(enable_init_clks, |
| 54 | ARRAY_SIZE(enable_init_clks)); |
| 55 | |
| 56 | return 0; |
| 57 | } |