|
@@ -22,19 +22,11 @@ static const int pll1rate[]={1,2,3,4,6,8};
|
|
|
static const int pfc_divisors[]={1,2,3,4,6,8,12};
|
|
|
#define ifc_divisors pfc_divisors
|
|
|
|
|
|
-#if (CONFIG_SH_CLK_MD == 2)
|
|
|
-#define PLL2 (4)
|
|
|
-#elif (CONFIG_SH_CLK_MD == 6)
|
|
|
-#define PLL2 (2)
|
|
|
-#elif (CONFIG_SH_CLK_MD == 7)
|
|
|
-#define PLL2 (1)
|
|
|
-#else
|
|
|
-#error "Illigal Clock Mode!"
|
|
|
-#endif
|
|
|
+static unsigned int pll2_mult;
|
|
|
|
|
|
static void master_clk_init(struct clk *clk)
|
|
|
{
|
|
|
- clk->rate *= PLL2 * pll1rate[(__raw_readw(FREQCR) >> 8) & 0x0007];
|
|
|
+ clk->rate *= pll2_mult * pll1rate[(__raw_readw(FREQCR) >> 8) & 0x0007];
|
|
|
}
|
|
|
|
|
|
static struct clk_ops sh7206_master_clk_ops = {
|
|
@@ -79,7 +71,13 @@ static struct clk_ops *sh7206_clk_ops[] = {
|
|
|
|
|
|
void __init arch_init_clk_ops(struct clk_ops **ops, int idx)
|
|
|
{
|
|
|
+ if (test_mode_pin(MODE_PIN2 | MODE_PIN1 | MODE_PIN0))
|
|
|
+ pll2_mult = 1;
|
|
|
+ else if (test_mode_pin(MODE_PIN2 | MODE_PIN1))
|
|
|
+ pll2_mult = 2;
|
|
|
+ else if (test_mode_pin(MODE_PIN1))
|
|
|
+ pll2_mult = 4;
|
|
|
+
|
|
|
if (idx < ARRAY_SIZE(sh7206_clk_ops))
|
|
|
*ops = sh7206_clk_ops[idx];
|
|
|
}
|
|
|
-
|