aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/clock2430_data.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/clock2430_data.c')
-rw-r--r--arch/arm/mach-omap2/clock2430_data.c64
1 files changed, 59 insertions, 5 deletions
diff --git a/arch/arm/mach-omap2/clock2430_data.c b/arch/arm/mach-omap2/clock2430_data.c
index 701a1716019e..e32afcbdfb88 100644
--- a/arch/arm/mach-omap2/clock2430_data.c
+++ b/arch/arm/mach-omap2/clock2430_data.c
@@ -27,6 +27,7 @@
27#include "prm-regbits-24xx.h" 27#include "prm-regbits-24xx.h"
28#include "cm-regbits-24xx.h" 28#include "cm-regbits-24xx.h"
29#include "sdrc.h" 29#include "sdrc.h"
30#include "control.h"
30 31
31#define OMAP_CM_REGADDR OMAP2430_CM_REGADDR 32#define OMAP_CM_REGADDR OMAP2430_CM_REGADDR
32 33
@@ -89,6 +90,12 @@ static struct clk alt_ck = { /* Typical 54M or 48M, may not exist */
89 .clkdm_name = "wkup_clkdm", 90 .clkdm_name = "wkup_clkdm",
90}; 91};
91 92
93/* Optional external clock input for McBSP CLKS */
94static struct clk mcbsp_clks = {
95 .name = "mcbsp_clks",
96 .ops = &clkops_null,
97};
98
92/* 99/*
93 * Analog domain root source clocks 100 * Analog domain root source clocks
94 */ 101 */
@@ -1123,14 +1130,34 @@ static struct clk mcbsp1_ick = {
1123 .recalc = &followparent_recalc, 1130 .recalc = &followparent_recalc,
1124}; 1131};
1125 1132
1133static const struct clksel_rate common_mcbsp_96m_rates[] = {
1134 { .div = 1, .val = 0, .flags = RATE_IN_24XX },
1135 { .div = 0 }
1136};
1137
1138static const struct clksel_rate common_mcbsp_mcbsp_rates[] = {
1139 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
1140 { .div = 0 }
1141};
1142
1143static const struct clksel mcbsp_fck_clksel[] = {
1144 { .parent = &func_96m_ck, .rates = common_mcbsp_96m_rates },
1145 { .parent = &mcbsp_clks, .rates = common_mcbsp_mcbsp_rates },
1146 { .parent = NULL }
1147};
1148
1126static struct clk mcbsp1_fck = { 1149static struct clk mcbsp1_fck = {
1127 .name = "mcbsp1_fck", 1150 .name = "mcbsp1_fck",
1128 .ops = &clkops_omap2_dflt_wait, 1151 .ops = &clkops_omap2_dflt_wait,
1129 .parent = &func_96m_ck, 1152 .parent = &func_96m_ck,
1153 .init = &omap2_init_clksel_parent,
1130 .clkdm_name = "core_l4_clkdm", 1154 .clkdm_name = "core_l4_clkdm",
1131 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1155 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1132 .enable_bit = OMAP24XX_EN_MCBSP1_SHIFT, 1156 .enable_bit = OMAP24XX_EN_MCBSP1_SHIFT,
1133 .recalc = &followparent_recalc, 1157 .clksel_reg = OMAP243X_CTRL_REGADDR(OMAP2_CONTROL_DEVCONF0),
1158 .clksel_mask = OMAP2_MCBSP1_CLKS_MASK,
1159 .clksel = mcbsp_fck_clksel,
1160 .recalc = &omap2_clksel_recalc,
1134}; 1161};
1135 1162
1136static struct clk mcbsp2_ick = { 1163static struct clk mcbsp2_ick = {
@@ -1147,10 +1174,14 @@ static struct clk mcbsp2_fck = {
1147 .name = "mcbsp2_fck", 1174 .name = "mcbsp2_fck",
1148 .ops = &clkops_omap2_dflt_wait, 1175 .ops = &clkops_omap2_dflt_wait,
1149 .parent = &func_96m_ck, 1176 .parent = &func_96m_ck,
1177 .init = &omap2_init_clksel_parent,
1150 .clkdm_name = "core_l4_clkdm", 1178 .clkdm_name = "core_l4_clkdm",
1151 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1179 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1152 .enable_bit = OMAP24XX_EN_MCBSP2_SHIFT, 1180 .enable_bit = OMAP24XX_EN_MCBSP2_SHIFT,
1153 .recalc = &followparent_recalc, 1181 .clksel_reg = OMAP243X_CTRL_REGADDR(OMAP2_CONTROL_DEVCONF0),
1182 .clksel_mask = OMAP2_MCBSP2_CLKS_MASK,
1183 .clksel = mcbsp_fck_clksel,
1184 .recalc = &omap2_clksel_recalc,
1154}; 1185};
1155 1186
1156static struct clk mcbsp3_ick = { 1187static struct clk mcbsp3_ick = {
@@ -1167,10 +1198,14 @@ static struct clk mcbsp3_fck = {
1167 .name = "mcbsp3_fck", 1198 .name = "mcbsp3_fck",
1168 .ops = &clkops_omap2_dflt_wait, 1199 .ops = &clkops_omap2_dflt_wait,
1169 .parent = &func_96m_ck, 1200 .parent = &func_96m_ck,
1201 .init = &omap2_init_clksel_parent,
1170 .clkdm_name = "core_l4_clkdm", 1202 .clkdm_name = "core_l4_clkdm",
1171 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), 1203 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1172 .enable_bit = OMAP2430_EN_MCBSP3_SHIFT, 1204 .enable_bit = OMAP2430_EN_MCBSP3_SHIFT,
1173 .recalc = &followparent_recalc, 1205 .clksel_reg = OMAP243X_CTRL_REGADDR(OMAP243X_CONTROL_DEVCONF1),
1206 .clksel_mask = OMAP2_MCBSP3_CLKS_MASK,
1207 .clksel = mcbsp_fck_clksel,
1208 .recalc = &omap2_clksel_recalc,
1174}; 1209};
1175 1210
1176static struct clk mcbsp4_ick = { 1211static struct clk mcbsp4_ick = {
@@ -1187,10 +1222,14 @@ static struct clk mcbsp4_fck = {
1187 .name = "mcbsp4_fck", 1222 .name = "mcbsp4_fck",
1188 .ops = &clkops_omap2_dflt_wait, 1223 .ops = &clkops_omap2_dflt_wait,
1189 .parent = &func_96m_ck, 1224 .parent = &func_96m_ck,
1225 .init = &omap2_init_clksel_parent,
1190 .clkdm_name = "core_l4_clkdm", 1226 .clkdm_name = "core_l4_clkdm",
1191 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), 1227 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1192 .enable_bit = OMAP2430_EN_MCBSP4_SHIFT, 1228 .enable_bit = OMAP2430_EN_MCBSP4_SHIFT,
1193 .recalc = &followparent_recalc, 1229 .clksel_reg = OMAP243X_CTRL_REGADDR(OMAP243X_CONTROL_DEVCONF1),
1230 .clksel_mask = OMAP2_MCBSP4_CLKS_MASK,
1231 .clksel = mcbsp_fck_clksel,
1232 .recalc = &omap2_clksel_recalc,
1194}; 1233};
1195 1234
1196static struct clk mcbsp5_ick = { 1235static struct clk mcbsp5_ick = {
@@ -1207,10 +1246,14 @@ static struct clk mcbsp5_fck = {
1207 .name = "mcbsp5_fck", 1246 .name = "mcbsp5_fck",
1208 .ops = &clkops_omap2_dflt_wait, 1247 .ops = &clkops_omap2_dflt_wait,
1209 .parent = &func_96m_ck, 1248 .parent = &func_96m_ck,
1249 .init = &omap2_init_clksel_parent,
1210 .clkdm_name = "core_l4_clkdm", 1250 .clkdm_name = "core_l4_clkdm",
1211 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), 1251 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1212 .enable_bit = OMAP2430_EN_MCBSP5_SHIFT, 1252 .enable_bit = OMAP2430_EN_MCBSP5_SHIFT,
1213 .recalc = &followparent_recalc, 1253 .clksel_reg = OMAP243X_CTRL_REGADDR(OMAP243X_CONTROL_DEVCONF1),
1254 .clksel_mask = OMAP2_MCBSP5_CLKS_MASK,
1255 .clksel = mcbsp_fck_clksel,
1256 .recalc = &omap2_clksel_recalc,
1214}; 1257};
1215 1258
1216static struct clk mcspi1_ick = { 1259static struct clk mcspi1_ick = {
@@ -1808,6 +1851,12 @@ static struct omap_clk omap2430_clks[] = {
1808 CLK(NULL, "osc_ck", &osc_ck, CK_243X), 1851 CLK(NULL, "osc_ck", &osc_ck, CK_243X),
1809 CLK(NULL, "sys_ck", &sys_ck, CK_243X), 1852 CLK(NULL, "sys_ck", &sys_ck, CK_243X),
1810 CLK(NULL, "alt_ck", &alt_ck, CK_243X), 1853 CLK(NULL, "alt_ck", &alt_ck, CK_243X),
1854 CLK("omap-mcbsp.1", "pad_fck", &mcbsp_clks, CK_243X),
1855 CLK("omap-mcbsp.2", "pad_fck", &mcbsp_clks, CK_243X),
1856 CLK("omap-mcbsp.3", "pad_fck", &mcbsp_clks, CK_243X),
1857 CLK("omap-mcbsp.4", "pad_fck", &mcbsp_clks, CK_243X),
1858 CLK("omap-mcbsp.5", "pad_fck", &mcbsp_clks, CK_243X),
1859 CLK(NULL, "mcbsp_clks", &mcbsp_clks, CK_243X),
1811 /* internal analog sources */ 1860 /* internal analog sources */
1812 CLK(NULL, "dpll_ck", &dpll_ck, CK_243X), 1861 CLK(NULL, "dpll_ck", &dpll_ck, CK_243X),
1813 CLK(NULL, "apll96_ck", &apll96_ck, CK_243X), 1862 CLK(NULL, "apll96_ck", &apll96_ck, CK_243X),
@@ -1815,6 +1864,11 @@ static struct omap_clk omap2430_clks[] = {
1815 /* internal prcm root sources */ 1864 /* internal prcm root sources */
1816 CLK(NULL, "func_54m_ck", &func_54m_ck, CK_243X), 1865 CLK(NULL, "func_54m_ck", &func_54m_ck, CK_243X),
1817 CLK(NULL, "core_ck", &core_ck, CK_243X), 1866 CLK(NULL, "core_ck", &core_ck, CK_243X),
1867 CLK("omap-mcbsp.1", "prcm_fck", &func_96m_ck, CK_243X),
1868 CLK("omap-mcbsp.2", "prcm_fck", &func_96m_ck, CK_243X),
1869 CLK("omap-mcbsp.3", "prcm_fck", &func_96m_ck, CK_243X),
1870 CLK("omap-mcbsp.4", "prcm_fck", &func_96m_ck, CK_243X),
1871 CLK("omap-mcbsp.5", "prcm_fck", &func_96m_ck, CK_243X),
1818 CLK(NULL, "func_96m_ck", &func_96m_ck, CK_243X), 1872 CLK(NULL, "func_96m_ck", &func_96m_ck, CK_243X),
1819 CLK(NULL, "func_48m_ck", &func_48m_ck, CK_243X), 1873 CLK(NULL, "func_48m_ck", &func_48m_ck, CK_243X),
1820 CLK(NULL, "func_12m_ck", &func_12m_ck, CK_243X), 1874 CLK(NULL, "func_12m_ck", &func_12m_ck, CK_243X),