<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-NZ link=blue vlink=purple><div class=WordSection1><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>Signed-off-by: Tony Prisk (linux@prisktech.co.nz)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>--- /dev/null 2011-02-26 19:04:30.530140059 +1300<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+++ arch/arm/mach-vt8500/wm8505-clocks.c 2011-02-27 12:40:35.000000000 +1300<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>@@ -0,0 +1,624 @@<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+/*<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ * arch/arm/mach-vt8500/wm8505_clocks.c<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ *<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ * Copyright (C) 2011 Tony Prisk<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ *<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ * This program is free software; you can redistribute it and/or modify<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ * it under the terms of the GNU General Public License as published by<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ * the Free Software Foundation; either version 2 of the License, or<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ * (at your option) any later version.<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ *<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ * This program is distributed in the hope that it will be useful,<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ * but WITHOUT ANY WARRANTY; without even the implied warranty of<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ * GNU General Public License for more details.<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ *<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ * You should have received a copy of the GNU General Public License<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ * along with this program; if not, write to the Free Software<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ */<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+#include <linux/io.h><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+#include <linux/clk.h><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+#include <mach/wm8505_regs.h><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+#include "clock.h"<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+#define CLK_PM_STATUS_LOW 0x000<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+#define CLK_PML_ANY_CLK_UPDATING 0x00000008<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+#define CLK_PML_PLL_UPDATING 0x00000010<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+#define CLK_PML_ARM_UPDATING 0x00000080<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+#define CLK_PML_AHB_UPDATING 0x00000100<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+#define CLK_PML_UPDATE_MASK 0x1FFF9B37<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+#define CLK_PML_BUSY 0xFFFFFFFE<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+#define CLK_PM_STATUS_HIGH 0x004<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+#define CLK_PLLA_MULTIPLIER 0x200<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+#define CLK_PLLB_MULTIPLIER 0x204<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+#define CLK_PLLC_MULTIPLIER 0x208<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+#define CLK_PLLD_MULTIPLIER 0x20C<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+#define CLK_EN_LOW 0x250<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+#define CLK_EN_HIGH 0x254<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+#define CLK_ARM_DIVISOR 0x300<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+#define CLK_AHB_DIVISOR 0x304<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+#define CLK_DDR_DIVISOR 0x310 /* mask = 0x1F special */<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+#define CLK_SFM_DIVISOR 0x314<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+#define CLK_KBD_DIVISOR_PRE 0x318<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+#define CLK_KBD_DIVISOR 0x31C<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+#define CLK_SDMMC_DIVISOR 0x328 /* mask = 0x1F special */<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+#define CLK_GENET_DIVISOR 0x32C<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+#define CLK_NAND_DIVISOR 0x330<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+#define CLK_NOR_DIVISOR 0x334<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+#define CLK_SPI0_DIVISOR 0x33C<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+#define CLK_SPI1_DIVISOR 0x340<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+#define CLK_SPI2_DIVISOR 0x344<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+#define CLK_PWM_DIVISOR 0x348<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+#define CLK_APB_DIVISOR 0x350<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+#define CLK_NA0_DIVISOR 0x358<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+#define CLK_NA12_DIVISOR 0x35C<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+#define CLK_I2C0_DIVISOR 0x36C<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+#define CLK_I2C1_DIVISOR 0x370<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+#define CLK_DVO_DIVISOR 0x374<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+#define CLK_RO1_DIVISOR 0x378<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+#define CLK_RO2_DIVISOR 0x37C<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+void __iomem *clk_pmc_base;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+/*<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ * define our supported clocks<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ *<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ * Clock structure tree<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ *<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ * REF_CLK (25Mhz)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ * |\ PLL_A<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ * | |- cpu<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ * | \- ahb<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ * | - apb<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ * |\ PLL_B<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ * | |\- nand flash<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ * | | - nor flash<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ * | |- sdmmc<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ * | |- lcd controller<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ * | |- pcm<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ * | |- pwm<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ * | |- spi<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ * | \- kbdc<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ * |<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ * \ PLL_C<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ * \- ddr<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ *<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ */<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+static void wmt_pm_wait_update(void)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+{<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ while (readl(clk_pmc_base + CLK_PM_STATUS_LOW) & CLK_PML_UPDATE_MASK)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ ;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+}<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+static void wmt_pm_wait_busy(void)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+{<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ while (readl(clk_pmc_base + CLK_PM_STATUS_LOW) & CLK_PML_BUSY)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ ;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+}<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+void clk_cpu_speedstep(u32 plla_mul, u32 arm_div, u32 ahb_div)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+{<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ if (ahb_div > 1) {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ /*<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ AHB, PLL, ARM<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ */<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ wmt_pm_wait_busy();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ wmt_pm_wait_update();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ writel(ahb_div, clk_pmc_base + CLK_AHB_DIVISOR);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ wmt_pm_wait_update();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ writel(plla_mul, clk_pmc_base + CLK_PLLA_MULTIPLIER);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ wmt_pm_wait_update();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ writel(arm_div, clk_pmc_base + CLK_ARM_DIVISOR);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ } else {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ /*<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ PLL, ARM, AHB<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ */<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ wmt_pm_wait_update();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ writel(plla_mul, clk_pmc_base + CLK_PLLA_MULTIPLIER);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ wmt_pm_wait_update();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ writel(arm_div, clk_pmc_base + CLK_ARM_DIVISOR);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ wmt_pm_wait_busy();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ wmt_pm_wait_update();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ writel(ahb_div, clk_pmc_base + CLK_AHB_DIVISOR);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ }<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ wmt_pm_wait_update();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+}<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+unsigned long getrate_pll(struct clk *clk)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+{<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ unsigned long prate = clk->parent->rate;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ u32 pll_mul = (readl(clk_pmc_base + clk->div_reg) & 0x1F);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ u32 pll_prediv = (readl(clk_pmc_base + clk->div_reg) & 0x100) ? 1 : 2;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ if (pll_mul < 4)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ pll_mul = 1;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ else<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ pll_mul *= 2;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ clk->rate = prate * pll_mul / pll_prediv;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ return clk->rate;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+}<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+int setrate_pll(struct clk *clk, unsigned long rate)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+{<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ unsigned long prate = clk->parent->rate;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ unsigned long actual_plla_rate;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ unsigned long actual_arm_rate;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ u32 plla_mul;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ u32 arm_div;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ u32 ahb_div;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ struct clk *arm_clk;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ struct clk *ahb_clk;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ arm_clk = clk_get(NULL, "arm");<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ ahb_clk = clk_get(NULL, "ahb");<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ /* calculate the PLL_A multiplier */<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ if (rate % prate)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ plla_mul = rate / prate + 1;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ else<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ plla_mul = rate / prate;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ actual_plla_rate = prate * plla_mul;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ /* calculate the new ARM divisor */<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ if (actual_plla_rate % arm_clk->rate)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ arm_div = actual_plla_rate / arm_clk->rate + 1;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ else<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ arm_div = actual_plla_rate / arm_clk->rate;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ actual_arm_rate = actual_plla_rate / arm_div;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ /* calculate the new AHB divisor */<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ if (actual_arm_rate % ahb_clk->rate)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ ahb_div = actual_arm_rate / ahb_clk->rate + 1;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ else<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ ahb_div = actual_arm_rate / ahb_clk->rate;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ clk_cpu_speedstep(plla_mul, arm_div, ahb_div);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ return 0;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+}<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+unsigned long getrate_ahb(struct clk *clk)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+{<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ unsigned long prate = clk_get_rate(clk->parent);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ u32 clk_div = (readl(clk_pmc_base + clk->div_reg) & 0x07);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ if (clk_div == 0)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ clk_div = 8;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ clk->rate = prate / clk_div;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ return clk->rate;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+}<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+int setrate_ahb(struct clk *clk, unsigned long rate)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+{<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ unsigned long prate = clk_get_rate(clk->parent);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ u32 clk_div;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ /* divisor only, so the clk can't be higher than the parent clk */<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ if (rate > prate)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ return -EINVAL;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ if (prate % rate)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ clk_div = prate / rate + 1;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ else<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ clk_div = prate / rate;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ /* handle special case */<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ if (clk_div == 8)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ clk_div = 0;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ if (clk_div > 8)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ return -ENOENT;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ wmt_pm_wait_busy();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ wmt_pm_wait_update();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ writel(clk_div, clk_pmc_base + clk->div_reg);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ wmt_pm_wait_update();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ return 0;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+}<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+unsigned long getrate_arm(struct clk *clk)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+{<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ unsigned long prate = clk_get_rate(clk->parent);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ u32 clk_div = (readl(clk_pmc_base + clk->div_reg) & 0x1F);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ if (clk_div == 0)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ clk_div = 32;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ clk->rate = prate / clk_div;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ return clk->rate;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+}<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+int setrate_arm(struct clk *clk, unsigned long rate)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+{<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ unsigned long actual_plla_rate;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ unsigned long actual_arm_rate;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ u32 plla_mul;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ u32 arm_div;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ u32 ahb_div;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ struct clk *plla_clk;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ struct clk *ahb_clk;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ plla_clk = clk_get(NULL, "pll_a");<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ ahb_clk = clk_get(NULL, "ahb");<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ /*<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ calculate the PLL_A multiplier<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ PLL_A will be set to 2 * ARM_clock (if possible)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ */<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ actual_plla_rate = 2 * rate;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ if (actual_plla_rate % plla_clk->parent->rate)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ plla_mul = actual_plla_rate / plla_clk->parent->rate + 1;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ else<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ plla_mul = actual_plla_rate / plla_clk->parent->rate;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ actual_plla_rate = plla_clk->parent->rate * plla_mul;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ /* calculate the new ARM divisor */<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ if (actual_plla_rate % rate)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ arm_div = actual_plla_rate / rate + 1;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ else<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ arm_div = actual_plla_rate / rate;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ actual_arm_rate = actual_plla_rate / arm_div;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ /* calculate the new AHB divisor */<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ if (actual_arm_rate % ahb_clk->rate)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ ahb_div = actual_arm_rate / ahb_clk->rate + 1;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ else<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ ahb_div = actual_arm_rate / ahb_clk->rate;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ clk_cpu_speedstep(plla_mul, arm_div, ahb_div);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ return 0;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+}<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+int setrate_ddr(struct clk *clk, unsigned long rate)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+{<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ unsigned long prate = clk_get_rate(clk->parent);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ u32 clk_div;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ /* divisor only, so the clk can't be higher than the parent clk */<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ if (rate > prate)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ return -EINVAL;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ if (prate % rate)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ clk_div = prate / rate + 1;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ else<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ clk_div = prate / rate;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ /* clk_div must be even if != 1, so +1 if odd */<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ if ((clk_div != 1) && (clk_div % 1))<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ clk_div++;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ if (clk_div > 32)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ return -ENOENT;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ clk->rate = prate / clk_div;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ if (clk_div == 32)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ clk_div = 0;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ wmt_pm_wait_update();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ writel(clk_div, clk_pmc_base + clk->div_reg);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ return 0;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+}<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+unsigned long getrate_sdmmc(struct clk *clk)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+{<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ unsigned long prate = clk_get_rate(clk->parent);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ u32 clk_div = (readl(clk_pmc_base + clk->div_reg) & 0x3F);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ if (clk_div == 0)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ clk_div = 32;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ /* Check if fixed divisor is enabled (/64 fixed) */<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ if (clk_div & 0x20)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ clk_div = 64;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ clk->rate = prate / clk_div;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ return clk->rate;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+}<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+int setrate_sdmmc(struct clk *clk, unsigned long rate)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+{<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ unsigned long prate = clk_get_rate(clk->parent);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ u32 clk_div;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ /*<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ divisor only, so the clk can't be higher than the parent clk<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ also reject rate == 0 for now<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ */<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ if ((rate > prate) || (rate == 0))<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ return -EINVAL;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ if (prate % rate)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ clk_div = prate / rate + 1;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ else<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ clk_div = prate / rate;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ /* if clk_div > 32, enable the fixed divisor */<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ if (clk_div > 32)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ clk_div = 0x20;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ clk->rate = prate / clk_div;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ if (clk_div == 32)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ clk_div = 0;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ writel(clk_div, clk_pmc_base + clk->div_reg);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ return 0;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+}<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+unsigned long getrate_stdmask(struct clk *clk)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+{<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ unsigned long prate = clk_get_rate(clk->parent);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ u32 clk_div = (readl(clk_pmc_base + clk->div_reg) & 0x1F);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ if (clk_div == 0)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ clk_div = 32;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ clk->rate = prate / clk_div;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ return clk->rate;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+}<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+int setrate_stdmask(struct clk *clk, unsigned long rate)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+{<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ unsigned long prate = clk_get_rate(clk->parent);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ u32 clk_div;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ /* divisor only, so the clk can't be higher than the parent clk */<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ if (rate > prate)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ return -EINVAL;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ if (prate % rate)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ clk_div = prate / rate + 1;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ else<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ clk_div = prate / rate;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ if (clk_div > 32)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ return -ENOENT;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ clk->rate = prate / clk_div;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ if (clk_div == 32)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ clk_div = 0;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ wmt_pm_wait_update();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ writel(clk_div, clk_pmc_base + clk->div_reg);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ return 0;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+}<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+void enable_std(struct clk *clk)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+{<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ u32 regtmp = readl(clk_pmc_base + clk->en_reg);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ writel(regtmp | (1 << clk->en_bit), clk_pmc_base + clk->en_reg);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+}<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+void disable_std(struct clk *clk)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+{<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ u32 regtmp = readl(clk_pmc_base + clk->en_reg);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ writel(regtmp & ~(1 << clk->en_bit), clk_pmc_base + clk->en_reg);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+}<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+static struct clkops clkops_pll = {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ .getrate = &getrate_pll,<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ .setrate = &setrate_pll,<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+};<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+static struct clkops clkops_arm = {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ .getrate = &getrate_arm,<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ .setrate = &setrate_arm,<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+};<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+static struct clkops clkops_ahb = {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ .getrate = &getrate_ahb,<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ .setrate = &setrate_ahb,<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+};<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+static struct clkops clkops_ddr = {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ .getrate = &getrate_stdmask,<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ .setrate = &setrate_ddr,<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+};<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+static struct clkops clkops_sdmmc = {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ .getrate = &getrate_sdmmc,<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ .setrate = &setrate_sdmmc,<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ .enable = &enable_std,<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ .disable = &disable_std,<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+};<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+static struct clkops clkops_stdmask = {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ .getrate = &getrate_stdmask,<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ .setrate = &setrate_stdmask,<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ .enable = &enable_std,<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ .disable = &disable_std,<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+};<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKREF(ref, 25000000);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKPGNP(pll_a, &clk_ref, 0, &clkops_pll, CLK_PLLA_MULTIPLIER);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKPGNP(arm, &clk_pll_a, 0, &clkops_arm, CLK_ARM_DIVISOR);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKPG(ahb, &clk_arm, 0, &clkops_ahb, CLK_AHB_DIVISOR);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKPG(apb, &clk_arm, 0, &clkops_stdmask, CLK_APB_DIVISOR);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKPG(pll_b, &clk_ref, 0, &clkops_pll, CLK_PLLB_MULTIPLIER);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKPGEN(sdmmc, &clk_pll_b, 0, &clkops_sdmmc, CLK_SDMMC_DIVISOR , \<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ CLK_EN_HIGH, 18);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKPGEN(nand, &clk_pll_b, 0, &clkops_stdmask, CLK_NAND_DIVISOR, \<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ CLK_EN_HIGH, 16);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKPGEN(kbd_pre, &clk_pll_b, 0, &clkops_stdmask, CLK_KBD_DIVISOR_PRE, \<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ CLK_EN_HIGH, 4);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKPGEN(kbd, &clk_pll_b, 0, &clkops_stdmask, CLK_KBD_DIVISOR, \<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ CLK_EN_HIGH, 4);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKPGEN(sfm, &clk_pll_b, 0, &clkops_stdmask, CLK_SFM_DIVISOR, \<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ CLK_EN_HIGH, 23);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKPG(genet, &clk_pll_b, 0, &clkops_stdmask, CLK_GENET_DIVISOR);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKPGEN(nor, &clk_pll_b, 0, &clkops_stdmask, CLK_NOR_DIVISOR, \<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ CLK_EN_HIGH, 3);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKPGEN(spi0, &clk_pll_b, 0, &clkops_stdmask, CLK_SPI0_DIVISOR, \<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ CLK_EN_LOW, 12);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKPGEN(spi1, &clk_pll_b, 0, &clkops_stdmask, CLK_SPI1_DIVISOR, \<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ CLK_EN_LOW, 13);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKPGEN(spi2, &clk_pll_b, 0, &clkops_stdmask, CLK_SPI2_DIVISOR, \<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ CLK_EN_LOW, 14);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKPGEN(pwm, &clk_pll_b, 0, &clkops_stdmask, CLK_PWM_DIVISOR, \<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ CLK_EN_LOW, 10);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKPGEN(na0, &clk_pll_b, 0, &clkops_stdmask, CLK_NA0_DIVISOR, \<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ CLK_EN_HIGH, 1);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKPGEN(na12, &clk_pll_b, 0, &clkops_stdmask, CLK_NA12_DIVISOR, \<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ CLK_EN_HIGH, 2);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKPGEN(i2c0, &clk_pll_b, 0, &clkops_stdmask, CLK_I2C0_DIVISOR, \<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ CLK_EN_LOW, 5);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKPGEN(i2c1, &clk_pll_b, 0, &clkops_stdmask, CLK_I2C1_DIVISOR, \<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ CLK_EN_LOW, 0);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKPGEN(dvo, &clk_pll_b, 0, &clkops_stdmask, CLK_DVO_DIVISOR, \<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ CLK_EN_LOW, 18);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKPG(ro1, &clk_pll_b, 0, &clkops_stdmask, CLK_RO1_DIVISOR);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKPG(ro2, &clk_pll_b, 0, &clkops_stdmask, CLK_RO2_DIVISOR);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKPG(pll_c, &clk_ref, 0, &clkops_pll, CLK_PLLC_MULTIPLIER);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKPGEN(ddr, &clk_pll_c, 0, &clkops_ddr, CLK_DDR_DIVISOR, \<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ CLK_EN_HIGH, 0);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKPG(pll_d, &clk_ref, 0, &clkops_pll, CLK_PLLD_MULTIPLIER);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+/* Enable/Disable clocks - Non-programmable */<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKEN(govrhd, &clkops_stdmask, CLK_EN_LOW, 30);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKEN(ge, &clkops_stdmask, CLK_EN_LOW, 29);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKEN(jenc, &clkops_stdmask, CLK_EN_LOW, 27);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKEN(amp, &clkops_stdmask, CLK_EN_LOW, 24);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKEN(uart5, &clkops_stdmask, CLK_EN_LOW, 23);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKEN(uart4, &clkops_stdmask, CLK_EN_LOW, 22);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKEN(scc, &clkops_stdmask, CLK_EN_LOW, 21);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKEN(ac97, &clkops_stdmask, CLK_EN_LOW, 19);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKEN(cir, &clkops_stdmask, CLK_EN_LOW, 17);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKEN(i2s, &clkops_stdmask, CLK_EN_LOW, 16);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKEN(gpio, &clkops_stdmask, CLK_EN_LOW, 11);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKEN(keypad, &clkops_stdmask, CLK_EN_LOW, 9);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKEN(rtc, &clkops_stdmask, CLK_EN_LOW, 7);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKEN(i2c_slave, &clkops_stdmask, CLK_EN_LOW, 6);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKEN(uart3, &clkops_stdmask, CLK_EN_LOW, 4);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKEN(uart2, &clkops_stdmask, CLK_EN_LOW, 3);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKEN(uart1, &clkops_stdmask, CLK_EN_LOW, 2);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKEN(uart0, &clkops_stdmask, CLK_EN_LOW, 1);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKEN(vpp, &clkops_stdmask, CLK_EN_HIGH, 31);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKEN(vid, &clkops_stdmask, CLK_EN_HIGH, 30);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKEN(govw, &clkops_stdmask, CLK_EN_HIGH, 29);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKEN(scl444u, &clkops_stdmask, CLK_EN_HIGH, 28);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKEN(eth_phy, &clkops_stdmask, CLK_EN_HIGH, 26);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKEN(sae, &clkops_stdmask, CLK_EN_HIGH, 24);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKEN(sys, &clkops_stdmask, CLK_EN_HIGH, 21);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKEN(eth_mac0, &clkops_stdmask, CLK_EN_HIGH, 20);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKEN(sdtv, &clkops_stdmask, CLK_EN_HIGH, 14);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKEN(ahb_bridge, &clkops_stdmask, CLK_EN_HIGH, 13);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKEN(pdma, &clkops_stdmask, CLK_EN_HIGH, 9);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKEN(udc, &clkops_stdmask, CLK_EN_HIGH, 8);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKEN(uhc, &clkops_stdmask, CLK_EN_HIGH, 7);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+DEFINE_CKEN(dma, &clkops_stdmask, CLK_EN_HIGH, 5);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+static struct clk_lookup wmt_clkregs[] = {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_ref, NULL, "ref"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_pll_a, NULL, "pll_a"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_pll_b, NULL, "pll_b"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_pll_c, NULL, "pll_c"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_pll_d, NULL, "pll_d"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_arm, NULL, "arm"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_ahb, NULL, "ahb"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_ahb_bridge, NULL, "ahb_bridge"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_apb, NULL, "apb"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_ddr, NULL, "ddr"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_nor, NULL, "nor"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_nand, NULL, "nand"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_sdmmc, NULL, "sdmmc"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_keypad, NULL, "keypad"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_kbd_pre, NULL, "kbd_pre"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_kbd, NULL, "kbd"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_sfm, NULL, "sfm"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_genet, NULL, "genet"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_spi0, NULL, "spi0"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_spi1, NULL, "spi1"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_spi2, NULL, "spi2"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_govrhd, NULL, "govrhd"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_govw, NULL, "govw"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_ge, NULL, "ge"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_pwm, NULL, "pwm"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_dvo, NULL, "dvo"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_jenc, NULL, "jenc"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_sdtv, NULL, "sdtv"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_cir, NULL, "cir"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_gpio, NULL, "gpio"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_rtc, NULL, "rtc"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_i2c0, NULL, "i2c0"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_i2c1, NULL, "i2c1"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_i2c_slave, NULL, "i2c_slave"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_ac97, NULL, "ac97"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_i2s, NULL, "i2s"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_eth_phy, NULL, "eth_phy"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_eth_mac0, NULL, "eth_mac0"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_uart5, NULL, "uart5"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_uart4, NULL, "uart4"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_uart3, NULL, "uart3"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_uart2, NULL, "uart2"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_uart1, NULL, "uart1"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_uart0, NULL, "uart0"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_na0, NULL, "na0"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_na12, NULL, "na12"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_ro1, NULL, "ro1"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_ro2, NULL, "ro2"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_amp, NULL, "amp"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_scc, NULL, "scc"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_vpp, NULL, "vpp"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_vid, NULL, "vid"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_scl444u, NULL, "scl444u"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_sae, NULL, "sae"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_sys, NULL, "sys"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_udc, NULL, "udc"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_uhc, NULL, "uhc"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_dma, NULL, "dma"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_CLKREG(&clk_pdma, NULL, "pdma"),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+};<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+int wmt_clock_init(void)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+{<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ struct clk_lookup *c;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ /* map to PMC io memory */<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ clk_pmc_base = ioremap(WM8505_PMC_BASE, 0x380);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ for (c = wmt_clkregs; c->clk; c++)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ clk_register(c->clk);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ clkdev_add_table(wmt_clkregs, ARRAY_SIZE(wmt_clkregs));<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ return 0;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+}<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>