Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 356472
b: refs/heads/master
c: a9571a3
h: refs/heads/master
v: v3
  • Loading branch information
Anatolij Gustschin committed Feb 5, 2013
1 parent 1614b67 commit 0f44923
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: edfcf33cabf29710f12a3bba4a7b3761a918e268
refs/heads/master: a9571a3837dc4b0b478297e4eaf84332d0f129d1
18 changes: 9 additions & 9 deletions trunk/arch/powerpc/platforms/512x/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ static unsigned long spmf_mult(void)
36, 40, 44, 48,
52, 56, 60, 64
};
int spmf = (clockctl->spmr >> 24) & 0xf;
int spmf = (in_be32(&clockctl->spmr) >> 24) & 0xf;
return spmf_to_mult[spmf];
}

Expand All @@ -206,7 +206,7 @@ static unsigned long sysdiv_div_x_2(void)
52, 56, 58, 62,
60, 64, 66,
};
int sysdiv = (clockctl->scfr2 >> 26) & 0x3f;
int sysdiv = (in_be32(&clockctl->scfr2) >> 26) & 0x3f;
return sysdiv_to_div_x_2[sysdiv];
}

Expand All @@ -230,7 +230,7 @@ static unsigned long sys_to_ref(unsigned long rate)

static long ips_to_ref(unsigned long rate)
{
int ips_div = (clockctl->scfr1 >> 23) & 0x7;
int ips_div = (in_be32(&clockctl->scfr1) >> 23) & 0x7;

rate *= ips_div; /* csb_clk = ips_clk * ips_div */
rate *= 2; /* sys_clk = csb_clk * 2 */
Expand Down Expand Up @@ -284,7 +284,7 @@ static struct clk sys_clk = {

static void diu_clk_calc(struct clk *clk)
{
int diudiv_x_2 = clockctl->scfr1 & 0xff;
int diudiv_x_2 = in_be32(&clockctl->scfr1) & 0xff;
unsigned long rate;

rate = sys_clk.rate;
Expand All @@ -311,7 +311,7 @@ static void half_clk_calc(struct clk *clk)

static void generic_div_clk_calc(struct clk *clk)
{
int div = (clockctl->scfr1 >> clk->div_shift) & 0x7;
int div = (in_be32(&clockctl->scfr1) >> clk->div_shift) & 0x7;

clk->rate = clk->parent->rate / div;
}
Expand All @@ -329,7 +329,7 @@ static struct clk csb_clk = {

static void e300_clk_calc(struct clk *clk)
{
int spmf = (clockctl->spmr >> 16) & 0xf;
int spmf = (in_be32(&clockctl->spmr) >> 16) & 0xf;
int ratex2 = clk->parent->rate * spmf;

clk->rate = ratex2 / 2;
Expand Down Expand Up @@ -648,12 +648,12 @@ static void psc_calc_rate(struct clk *clk, int pscnum, struct device_node *np)
out_be32(&clockctl->pccr[pscnum], 0x00020000);
out_be32(&clockctl->pccr[pscnum], 0x00030000);

if (clockctl->pccr[pscnum] & 0x80) {
if (in_be32(&clockctl->pccr[pscnum]) & 0x80) {
clk->rate = spdif_rxclk.rate;
return;
}

switch ((clockctl->pccr[pscnum] >> 14) & 0x3) {
switch ((in_be32(&clockctl->pccr[pscnum]) >> 14) & 0x3) {
case 0:
mclk_src = sys_clk.rate;
break;
Expand All @@ -668,7 +668,7 @@ static void psc_calc_rate(struct clk *clk, int pscnum, struct device_node *np)
break;
}

mclk_div = ((clockctl->pccr[pscnum] >> 17) & 0x7fff) + 1;
mclk_div = ((in_be32(&clockctl->pccr[pscnum]) >> 17) & 0x7fff) + 1;
clk->rate = mclk_src / mclk_div;
}

Expand Down

0 comments on commit 0f44923

Please sign in to comment.