diff options
Diffstat (limited to 'arch/arm/mach-mx3/clock-imx35.c')
| -rw-r--r-- | arch/arm/mach-mx3/clock-imx35.c | 38 |
1 files changed, 7 insertions, 31 deletions
diff --git a/arch/arm/mach-mx3/clock-imx35.c b/arch/arm/mach-mx3/clock-imx35.c index 3c1e06f56dd6..577ee83d1f60 100644 --- a/arch/arm/mach-mx3/clock-imx35.c +++ b/arch/arm/mach-mx3/clock-imx35.c | |||
| @@ -147,34 +147,16 @@ static struct arm_ahb_div clk_consumer[] = { | |||
| 147 | { .arm = 0, .ahb = 0, .sel = 0}, | 147 | { .arm = 0, .ahb = 0, .sel = 0}, |
| 148 | }; | 148 | }; |
| 149 | 149 | ||
| 150 | static struct arm_ahb_div clk_automotive[] = { | ||
| 151 | { .arm = 1, .ahb = 3, .sel = 0}, | ||
| 152 | { .arm = 1, .ahb = 2, .sel = 1}, | ||
| 153 | { .arm = 2, .ahb = 1, .sel = 1}, | ||
| 154 | { .arm = 0, .ahb = 0, .sel = 0}, | ||
| 155 | { .arm = 1, .ahb = 6, .sel = 0}, | ||
| 156 | { .arm = 1, .ahb = 4, .sel = 1}, | ||
| 157 | { .arm = 2, .ahb = 2, .sel = 1}, | ||
| 158 | { .arm = 0, .ahb = 0, .sel = 0}, | ||
| 159 | }; | ||
| 160 | |||
| 161 | static unsigned long get_rate_arm(void) | 150 | static unsigned long get_rate_arm(void) |
| 162 | { | 151 | { |
| 163 | unsigned long pdr0 = __raw_readl(CCM_BASE + CCM_PDR0); | 152 | unsigned long pdr0 = __raw_readl(CCM_BASE + CCM_PDR0); |
| 164 | struct arm_ahb_div *aad; | 153 | struct arm_ahb_div *aad; |
| 165 | unsigned long fref = get_rate_mpll(); | 154 | unsigned long fref = get_rate_mpll(); |
| 166 | 155 | ||
| 167 | if (pdr0 & 1) { | 156 | aad = &clk_consumer[(pdr0 >> 16) & 0xf]; |
| 168 | /* consumer path */ | 157 | if (aad->sel) |
| 169 | aad = &clk_consumer[(pdr0 >> 16) & 0xf]; | 158 | fref = fref * 2 / 3; |
| 170 | if (aad->sel) | 159 | |
| 171 | fref = fref * 2 / 3; | ||
| 172 | } else { | ||
| 173 | /* auto path */ | ||
| 174 | aad = &clk_automotive[(pdr0 >> 9) & 0x7]; | ||
| 175 | if (aad->sel) | ||
| 176 | fref = fref * 3 / 4; | ||
| 177 | } | ||
| 178 | return fref / aad->arm; | 160 | return fref / aad->arm; |
| 179 | } | 161 | } |
| 180 | 162 | ||
| @@ -184,12 +166,7 @@ static unsigned long get_rate_ahb(struct clk *clk) | |||
| 184 | struct arm_ahb_div *aad; | 166 | struct arm_ahb_div *aad; |
| 185 | unsigned long fref = get_rate_mpll(); | 167 | unsigned long fref = get_rate_mpll(); |
| 186 | 168 | ||
| 187 | if (pdr0 & 1) | 169 | aad = &clk_consumer[(pdr0 >> 16) & 0xf]; |
| 188 | /* consumer path */ | ||
| 189 | aad = &clk_consumer[(pdr0 >> 16) & 0xf]; | ||
| 190 | else | ||
| 191 | /* auto path */ | ||
| 192 | aad = &clk_automotive[(pdr0 >> 9) & 0x7]; | ||
| 193 | 170 | ||
| 194 | return fref / aad->ahb; | 171 | return fref / aad->ahb; |
| 195 | } | 172 | } |
| @@ -430,7 +407,8 @@ static struct clk_lookup lookups[] = { | |||
| 430 | _REGISTER_CLOCK("imx-i2c.1", NULL, i2c2_clk) | 407 | _REGISTER_CLOCK("imx-i2c.1", NULL, i2c2_clk) |
| 431 | _REGISTER_CLOCK("imx-i2c.2", NULL, i2c3_clk) | 408 | _REGISTER_CLOCK("imx-i2c.2", NULL, i2c3_clk) |
| 432 | _REGISTER_CLOCK(NULL, "iomuxc", iomuxc_clk) | 409 | _REGISTER_CLOCK(NULL, "iomuxc", iomuxc_clk) |
| 433 | _REGISTER_CLOCK(NULL, "ipu", ipu_clk) | 410 | _REGISTER_CLOCK("ipu-core", NULL, ipu_clk) |
| 411 | _REGISTER_CLOCK("mx3_sdc_fb", NULL, ipu_clk) | ||
| 434 | _REGISTER_CLOCK(NULL, "kpp", kpp_clk) | 412 | _REGISTER_CLOCK(NULL, "kpp", kpp_clk) |
| 435 | _REGISTER_CLOCK(NULL, "mlb", mlb_clk) | 413 | _REGISTER_CLOCK(NULL, "mlb", mlb_clk) |
| 436 | _REGISTER_CLOCK(NULL, "mshc", mshc_clk) | 414 | _REGISTER_CLOCK(NULL, "mshc", mshc_clk) |
| @@ -462,8 +440,6 @@ int __init mx35_clocks_init() | |||
| 462 | int i; | 440 | int i; |
| 463 | unsigned int ll = 0; | 441 | unsigned int ll = 0; |
| 464 | 442 | ||
| 465 | mxc_set_cpu_type(MXC_CPU_MX35); | ||
| 466 | |||
| 467 | #ifdef CONFIG_DEBUG_LL_CONSOLE | 443 | #ifdef CONFIG_DEBUG_LL_CONSOLE |
| 468 | ll = (3 << 16); | 444 | ll = (3 << 16); |
| 469 | #endif | 445 | #endif |
