Skip to content

Commit

Permalink
MIPS: Alchemy: preset loops_per_jiffy based on CPU clock
Browse files Browse the repository at this point in the history
This was lost during the rewrite of clock framework support.

Signed-off-by: Manuel Lauss <[email protected]>
Cc: Linux-MIPS <[email protected]>
Patchwork: https://patchwork.linux-mips.org/patch/9149/
Signed-off-by: Ralf Baechle <[email protected]>
  • Loading branch information
mlauss2 authored and ralfbaechle committed Feb 20, 2015
1 parent 51f105d commit 45a848f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions arch/mips/alchemy/common/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,12 @@ static unsigned long alchemy_clk_cpu_recalc(struct clk_hw *hw,
return t;
}

void __init alchemy_set_lpj(void)
{
preset_lpj = alchemy_clk_cpu_recalc(NULL, ALCHEMY_ROOTCLK_RATE);
preset_lpj /= 2 * HZ;
}

static struct clk_ops alchemy_clkops_cpu = {
.recalc_rate = alchemy_clk_cpu_recalc,
};
Expand Down
3 changes: 3 additions & 0 deletions arch/mips/alchemy/common/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,12 @@

extern void __init board_setup(void);
extern void set_cpuspec(void);
extern void __init alchemy_set_lpj(void);

void __init plat_mem_setup(void)
{
alchemy_set_lpj();

if (au1xxx_cpu_needs_config_od())
/* Various early Au1xx0 errata corrected by this */
set_c0_config(1 << 19); /* Set Config[OD] */
Expand Down

0 comments on commit 45a848f

Please sign in to comment.