summaryrefslogtreecommitdiffstats
path: root/drivers/clk/mxs/clk-imx28.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/clk/mxs/clk-imx28.c')
-rw-r--r--drivers/clk/mxs/clk-imx28.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/drivers/clk/mxs/clk-imx28.c b/drivers/clk/mxs/clk-imx28.c
index a6c35010e4e5..c541377838a8 100644
--- a/drivers/clk/mxs/clk-imx28.c
+++ b/drivers/clk/mxs/clk-imx28.c
@@ -53,8 +53,9 @@ static void __iomem *clkctrl;
#define BP_ENET_SLEEP 31
#define BP_CLKSEQ_BYPASS_SAIF0 0
#define BP_CLKSEQ_BYPASS_SSP0 3
-#define BP_FRAC0_IO1FRAC 16
-#define BP_FRAC0_IO0FRAC 24
+
+#define FRAC0_IO1 2
+#define FRAC0_IO0 3
static void __iomem *digctrl;
#define DIGCTRL digctrl
@@ -85,6 +86,7 @@ int mxs_saif_clkmux_select(unsigned int clkmux)
static void __init clk_misc_init(void)
{
u32 val;
+ u8 frac;
/* Gate off cpu clock in WFI for power saving */
writel_relaxed(1 << BP_CPU_INTERRUPT_WAIT, CPU + SET);
@@ -118,11 +120,16 @@ static void __init clk_misc_init(void)
/*
* 480 MHz seems too high to be ssp clock source directly,
* so set frac0 to get a 288 MHz ref_io0 and ref_io1.
+ * According to reference manual we must access frac0 bytewise.
*/
- val = readl_relaxed(FRAC0);
- val &= ~((0x3f << BP_FRAC0_IO0FRAC) | (0x3f << BP_FRAC0_IO1FRAC));
- val |= (30 << BP_FRAC0_IO0FRAC) | (30 << BP_FRAC0_IO1FRAC);
- writel_relaxed(val, FRAC0);
+ frac = readb_relaxed(FRAC0 + FRAC0_IO0);
+ frac &= ~0x3f;
+ frac |= 30;
+ writeb_relaxed(frac, FRAC0 + FRAC0_IO0);
+ frac = readb_relaxed(FRAC0 + FRAC0_IO1);
+ frac &= ~0x3f;
+ frac |= 30;
+ writeb_relaxed(frac, FRAC0 + FRAC0_IO1);
}
static const char *sel_cpu[] __initconst = { "ref_cpu", "ref_xtal", };
OpenPOWER on IntegriCloud