Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 10049
b: refs/heads/master
c: a7ce8ed
h: refs/heads/master
i:
  10047: 4b300c3
v: v3
  • Loading branch information
Ben Dooks authored and Russell King committed Oct 20, 2005
1 parent 01b9c5a commit 500a985
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 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: b2640b420a806c91f6b8799314ca96bb88a246d2
refs/heads/master: a7ce8edc8232da51dc3a804ec9c734019d115b40
15 changes: 11 additions & 4 deletions trunk/include/asm-arm/arch-s3c2410/regs-clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
* 10-Feb-2005 Ben Dooks Fixed CAMDIVN address (Guillaume Gourat)
* 10-Mar-2005 Lucas Villa Real Changed S3C2410_VA to S3C24XX_VA
* 27-Aug-2005 Ben Dooks Add clock-slow info
*/
* 20-Oct-2005 Ben Dooks Fixed overflow in PLL (Guillaume Gourat)
*/

#ifndef __ASM_ARM_REGS_CLOCK
#define __ASM_ARM_REGS_CLOCK "$Id: clock.h,v 1.4 2003/04/30 14:50:51 ben Exp $"
Expand Down Expand Up @@ -83,10 +84,13 @@

#ifndef __ASSEMBLY__

#include <asm/div64.h>

static inline unsigned int
s3c2410_get_pll(int pllval, int baseclk)
s3c2410_get_pll(unsigned int pllval, unsigned int baseclk)
{
int mdiv, pdiv, sdiv;
unsigned int mdiv, pdiv, sdiv;
uint64_t fvco;

mdiv = pllval >> S3C2410_PLLCON_MDIVSHIFT;
pdiv = pllval >> S3C2410_PLLCON_PDIVSHIFT;
Expand All @@ -96,7 +100,10 @@ s3c2410_get_pll(int pllval, int baseclk)
pdiv &= S3C2410_PLLCON_PDIVMASK;
sdiv &= S3C2410_PLLCON_SDIVMASK;

return (baseclk * (mdiv + 8)) / ((pdiv + 2) << sdiv);
fvco = (uint64_t)baseclk * (mdiv + 8);
do_div(fvco, (pdiv + 2) << sdiv);

return (unsigned int)fvco;
}

#endif /* __ASSEMBLY__ */
Expand Down

0 comments on commit 500a985

Please sign in to comment.