18 #include <mach/common.h>
22 #define DIGCTRL MX23_IO_ADDRESS(MX23_DIGCTL_BASE_ADDR)
23 #define CLKCTRL MX23_IO_ADDRESS(MX23_CLKCTRL_BASE_ADDR)
24 #define PLLCTRL0 (CLKCTRL + 0x0000)
25 #define CPU (CLKCTRL + 0x0020)
26 #define HBUS (CLKCTRL + 0x0030)
27 #define XBUS (CLKCTRL + 0x0040)
28 #define XTAL (CLKCTRL + 0x0050)
29 #define PIX (CLKCTRL + 0x0060)
30 #define SSP (CLKCTRL + 0x0070)
31 #define GPMI (CLKCTRL + 0x0080)
32 #define SPDIF (CLKCTRL + 0x0090)
33 #define EMI (CLKCTRL + 0x00a0)
34 #define SAIF (CLKCTRL + 0x00c0)
35 #define TV (CLKCTRL + 0x00d0)
36 #define ETM (CLKCTRL + 0x00e0)
37 #define FRAC (CLKCTRL + 0x00f0)
38 #define CLKSEQ (CLKCTRL + 0x0110)
40 #define BP_CPU_INTERRUPT_WAIT 12
41 #define BP_CLKSEQ_BYPASS_SAIF 0
42 #define BP_CLKSEQ_BYPASS_SSP 5
43 #define BP_SAIF_DIV_FRAC_EN 16
44 #define BP_FRAC_IOFRAC 24
46 static void __init clk_misc_init(
void)
59 writel_relaxed(val,
SAIF);
75 static const char *sel_pll[]
__initconst = {
"pll",
"ref_xtal", };
76 static const char *sel_cpu[]
__initconst = {
"ref_cpu",
"ref_xtal", };
77 static const char *sel_pix[]
__initconst = {
"ref_pix",
"ref_xtal", };
78 static const char *sel_io[]
__initconst = {
"ref_io",
"ref_xtal", };
79 static const char *cpu_sels[]
__initconst = {
"cpu_pll",
"cpu_xtal", };
80 static const char *emi_sels[]
__initconst = {
"emi_pll",
"emi_xtal", };
87 clk32k,
dri,
pwm,
filt,
uart,
ssp,
gpmi,
spdif,
emi,
saif,
93 static struct clk_onecell_data clk_data;
106 clks[
ref_xtal] = mxs_clk_fixed(
"ref_xtal", 24000000);
130 clks[
clk32k_div] = mxs_clk_fixed_factor(
"clk32k_div",
"ref_xtal", 1, 750);
131 clks[
rtc] = mxs_clk_fixed_factor(
"rtc",
"ref_xtal", 1, 768);
132 clks[
adc] = mxs_clk_fixed_factor(
"adc",
"clk32k", 1, 16);
133 clks[
spdif_div] = mxs_clk_fixed_factor(
"spdif_div",
"pll", 1, 4);
134 clks[
clk32k] = mxs_clk_gate(
"clk32k",
"clk32k_div",
XTAL, 26);
135 clks[
dri] = mxs_clk_gate(
"dri",
"ref_xtal",
XTAL, 28);
136 clks[
pwm] = mxs_clk_gate(
"pwm",
"ref_xtal",
XTAL, 29);
137 clks[
filt] = mxs_clk_gate(
"filt",
"ref_xtal",
XTAL, 30);
138 clks[
uart] = mxs_clk_gate(
"uart",
"ref_xtal",
XTAL, 31);
139 clks[
ssp] = mxs_clk_gate(
"ssp",
"ssp_div",
SSP, 31);
140 clks[
gpmi] = mxs_clk_gate(
"gpmi",
"gpmi_div",
GPMI, 31);
141 clks[
spdif] = mxs_clk_gate(
"spdif",
"spdif_div",
SPDIF, 31);
142 clks[
emi] = mxs_clk_gate(
"emi",
"emi_sel",
EMI, 31);
143 clks[
saif] = mxs_clk_gate(
"saif",
"saif_div",
SAIF, 31);
144 clks[
lcdif] = mxs_clk_gate(
"lcdif",
"lcdif_div",
PIX, 31);
145 clks[
etm] = mxs_clk_gate(
"etm",
"etm_div",
ETM, 31);
146 clks[
usb] = mxs_clk_gate(
"usb",
"usb_pwr",
DIGCTRL, 2);
150 if (IS_ERR(clks[i])) {
151 pr_err(
"i.MX23 clk %d: register failed with %ld\n",
152 i, PTR_ERR(clks[i]));
153 return PTR_ERR(clks[i]);
158 clk_data.clks = clks;
160 of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
165 for (i = 0; i <
ARRAY_SIZE(clks_init_on); i++)
166 clk_prepare_enable(clks[clks_init_on[i]]);