Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 148971
b: refs/heads/master
c: d16caf6
h: refs/heads/master
i:
  148969: 76eca32
  148967: 125673c
v: v3
  • Loading branch information
Sascha Hauer committed May 7, 2009
1 parent b199618 commit 56928e7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 29 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: 54df526819d3bfbc1af3f13aed7a3f9b9fdbdd04
refs/heads/master: d16caf69ce26dbd2ec3ae4e0072c2a60f1896c89
33 changes: 5 additions & 28 deletions trunk/arch/arm/mach-mx3/clock-imx35.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,34 +147,16 @@ static struct arm_ahb_div clk_consumer[] = {
{ .arm = 0, .ahb = 0, .sel = 0},
};

static struct arm_ahb_div clk_automotive[] = {
{ .arm = 1, .ahb = 3, .sel = 0},
{ .arm = 1, .ahb = 2, .sel = 1},
{ .arm = 2, .ahb = 1, .sel = 1},
{ .arm = 0, .ahb = 0, .sel = 0},
{ .arm = 1, .ahb = 6, .sel = 0},
{ .arm = 1, .ahb = 4, .sel = 1},
{ .arm = 2, .ahb = 2, .sel = 1},
{ .arm = 0, .ahb = 0, .sel = 0},
};

static unsigned long get_rate_arm(void)
{
unsigned long pdr0 = __raw_readl(CCM_BASE + CCM_PDR0);
struct arm_ahb_div *aad;
unsigned long fref = get_rate_mpll();

if (pdr0 & 1) {
/* consumer path */
aad = &clk_consumer[(pdr0 >> 16) & 0xf];
if (aad->sel)
fref = fref * 2 / 3;
} else {
/* auto path */
aad = &clk_automotive[(pdr0 >> 9) & 0x7];
if (aad->sel)
fref = fref * 3 / 4;
}
aad = &clk_consumer[(pdr0 >> 16) & 0xf];
if (aad->sel)
fref = fref * 2 / 3;

return fref / aad->arm;
}

Expand All @@ -184,12 +166,7 @@ static unsigned long get_rate_ahb(struct clk *clk)
struct arm_ahb_div *aad;
unsigned long fref = get_rate_mpll();

if (pdr0 & 1)
/* consumer path */
aad = &clk_consumer[(pdr0 >> 16) & 0xf];
else
/* auto path */
aad = &clk_automotive[(pdr0 >> 9) & 0x7];
aad = &clk_consumer[(pdr0 >> 16) & 0xf];

return fref / aad->ahb;
}
Expand Down

0 comments on commit 56928e7

Please sign in to comment.