2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-21 11:44:01 +08:00

MIPS: lantiq: explicitly enable clkout generation

Previously we relied on the bootloader to have enabled this bit. However some
bootloaders seem to not enable this for us.

Signed-off-by: John Crispin <blogic@openwrt.org>
Patchwork: http://patchwork.linux-mips.org/patch/4120/
This commit is contained in:
John Crispin 2012-07-24 08:56:41 +02:00
parent fea7a08acb
commit 98dbc5764d

View File

@ -187,10 +187,12 @@ static int clkout_enable(struct clk *clk)
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
if (clk->rates[i] == clk->rate) { if (clk->rates[i] == clk->rate) {
int shift = 14 - (2 * clk->module); int shift = 14 - (2 * clk->module);
int enable = 7 - clk->module;
unsigned int val = ltq_cgu_r32(ifccr); unsigned int val = ltq_cgu_r32(ifccr);
val &= ~(3 << shift); val &= ~(3 << shift);
val |= i << shift; val |= i << shift;
val |= enable;
ltq_cgu_w32(val, ifccr); ltq_cgu_w32(val, ifccr);
return 0; return 0;
} }